diff --git a/assets/Legend-07540826.js b/assets/Legend-07540826.js deleted file mode 100644 index 896e6e7..0000000 --- a/assets/Legend-07540826.js +++ /dev/null @@ -1,593 +0,0 @@ -var Qm=Object.defineProperty;var $m=(f,_,v)=>_ in f?Qm(f,_,{enumerable:!0,configurable:!0,writable:!0,value:v}):f[_]=v;var Cs=(f,_,v)=>($m(f,typeof _!="symbol"?_+"":_,v),v);(function(){const _=document.createElement("link").relList;if(_&&_.supports&&_.supports("modulepreload"))return;for(const M of document.querySelectorAll('link[rel="modulepreload"]'))w(M);new MutationObserver(M=>{for(const z of M)if(z.type==="childList")for(const F of z.addedNodes)F.tagName==="LINK"&&F.rel==="modulepreload"&&w(F)}).observe(document,{childList:!0,subtree:!0});function v(M){const z={};return M.integrity&&(z.integrity=M.integrity),M.referrerPolicy&&(z.referrerPolicy=M.referrerPolicy),M.crossOrigin==="use-credentials"?z.credentials="include":M.crossOrigin==="anonymous"?z.credentials="omit":z.credentials="same-origin",z}function w(M){if(M.ep)return;M.ep=!0;const z=v(M);fetch(M.href,z)}})();function Sr(){}function eg(f,_){for(const v in _)f[v]=_[v];return f}function zp(f){return f()}function Qd(){return Object.create(null)}function no(f){f.forEach(zp)}function dh(f){return typeof f=="function"}function Rr(f,_){return f!=f?_==_:f!==_||f&&typeof f=="object"||typeof f=="function"}let Bc;function $d(f,_){return f===_?!0:(Bc||(Bc=document.createElement("a")),Bc.href=_,f===Bc.href)}function tg(f){return Object.keys(f).length===0}function Pp(f,..._){if(f==null){for(const w of _)w(void 0);return Sr}const v=f.subscribe(..._);return v.unsubscribe?()=>v.unsubscribe():v}function ly(f){let _;return Pp(f,v=>_=v)(),_}function Br(f,_,v){f.$$.on_destroy.push(Pp(_,v))}function ta(f,_,v,w){if(f){const M=Dp(f,_,v,w);return f[0](M)}}function Dp(f,_,v,w){return f[1]&&w?eg(v.ctx.slice(),f[1](w(_))):v.ctx}function ia(f,_,v,w){if(f[2]&&w){const M=f[2](w(v));if(_.dirty===void 0)return M;if(typeof M=="object"){const z=[],F=Math.max(_.dirty.length,M.length);for(let o=0;o32){const _=[],v=f.ctx.length/32;for(let w=0;wf.removeEventListener(_,v,w)}function li(f,_,v){v==null?f.removeAttribute(_):f.getAttribute(_)!==v&&f.setAttribute(_,v)}function cy(f){let _;return{p(...v){_=v,_.forEach(w=>f.push(w))},r(){_.forEach(v=>f.splice(f.indexOf(v),1))}}}function uy(f){return f===""?null:+f}function sg(f){return Array.from(f.childNodes)}function Qr(f,_){_=""+_,f.data!==_&&(f.data=_)}function $u(f,_){f.value=_??""}function Ya(f,_,v,w){v==null?f.style.removeProperty(_):f.style.setProperty(_,v,w?"important":"")}function tp(f,_,v){for(let w=0;w{const M=f.$$.callbacks[_];if(M){const z=og(_,v,{cancelable:w});return M.slice().forEach(F=>{F.call(f,z)}),!z.defaultPrevented}return!0}}function Bp(f,_){return Al().$$.context.set(f,_),_}function cg(f){return Al().$$.context.get(f)}function Ha(f,_){const v=f.$$.callbacks[_.type];v&&v.slice().forEach(w=>w.call(this,_))}const Ja=[],Il=[];let io=[];const oh=[],Rp=Promise.resolve();let lh=!1;function Fp(){lh||(lh=!0,Rp.then(Op))}function dy(){return Fp(),Rp}function jc(f){io.push(f)}function ug(f){oh.push(f)}const eh=new Set;let Wa=0;function Op(){if(Wa!==0)return;const f=Sl;do{try{for(;Waf.indexOf(w)===-1?_.push(w):v.push(w)),v.forEach(w=>w()),io=_}const Oc=new Set;let Qs;function so(){Qs={r:0,c:[],p:Qs}}function ao(){Qs.r||no(Qs.c),Qs=Qs.p}function ei(f,_){f&&f.i&&(Oc.delete(f),f.i(_))}function vi(f,_,v,w){if(f&&f.o){if(Oc.has(f))return;Oc.add(f),Qs.c.push(()=>{Oc.delete(f),w&&(v&&f.d(1),w())}),f.o(_)}else w&&w()}function ro(f){return(f==null?void 0:f.length)!==void 0?f:Array.from(f)}function pg(f,_,v){const w=f.$$.props[_];w!==void 0&&(f.$$.bound[w]=v,v(f.$$.ctx[w]))}function Qa(f){f&&f.c()}function $s(f,_,v){const{fragment:w,after_update:M}=f.$$;w&&w.m(_,v),jc(()=>{const z=f.$$.on_mount.map(zp).filter(dh);f.$$.on_destroy?f.$$.on_destroy.push(...z):no(z),f.$$.on_mount=[]}),M.forEach(jc)}function ea(f,_){const v=f.$$;v.fragment!==null&&(dg(v.after_update),no(v.on_destroy),v.fragment&&v.fragment.d(_),v.on_destroy=v.fragment=null,v.ctx=[])}function fg(f,_){f.$$.dirty[0]===-1&&(Ja.push(f),Fp(),f.$$.dirty.fill(0)),f.$$.dirty[_/31|0]|=1<<_%31}function $r(f,_,v,w,M,z,F=null,o=[-1]){const te=Sl;bl(f);const O=f.$$={fragment:null,ctx:[],props:z,update:Sr,not_equal:M,bound:Qd(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(_.context||(te?te.$$.context:[])),callbacks:Qd(),dirty:o,skip_bound:!1,root:_.target||te.$$.root};F&&F(O.root);let ne=!1;if(O.ctx=v?v(f,_.props||{},(le,ge,...We)=>{const He=We.length?We[0]:ge;return O.ctx&&M(O.ctx[le],O.ctx[le]=He)&&(!O.skip_bound&&O.bound[le]&&O.bound[le](He),ne&&fg(f,le)),ge}):[],O.update(),ne=!0,no(O.before_update),O.fragment=w?w(O.ctx):!1,_.target){if(_.hydrate){const le=sg(_.target);O.fragment&&O.fragment.l(le),le.forEach(Mt)}else O.fragment&&O.fragment.c();_.intro&&ei(f.$$.fragment),$s(f,_.target,_.anchor),Op()}bl(te)}class en{constructor(){Cs(this,"$$");Cs(this,"$$set")}$destroy(){ea(this,1),this.$destroy=Sr}$on(_,v){if(!dh(v))return Sr;const w=this.$$.callbacks[_]||(this.$$.callbacks[_]=[]);return w.push(v),()=>{const M=w.indexOf(v);M!==-1&&w.splice(M,1)}}$set(_){this.$$set&&!tg(_)&&(this.$$.skip_bound=!0,this.$$set(_),this.$$.skip_bound=!1)}}const mg="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(mg);let wr;const as=new Array(128).fill(void 0);as.push(void 0,null,!0,!1);function Zt(f){return as[f]}let qc=0,yl=null;function Vc(){return(yl===null||yl.byteLength===0)&&(yl=new Uint8Array(wr.memory.buffer)),yl}const Nc=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},gg=typeof Nc.encodeInto=="function"?function(f,_){return Nc.encodeInto(f,_)}:function(f,_){const v=Nc.encode(f);return _.set(v),{read:f.length,written:v.length}};function rp(f,_,v){if(v===void 0){const o=Nc.encode(f),te=_(o.length,1)>>>0;return Vc().subarray(te,te+o.length).set(o),qc=o.length,te}let w=f.length,M=_(w,1)>>>0;const z=Vc();let F=0;for(;F127)break;z[M+F]=o}if(F!==w){F!==0&&(f=f.slice(F)),M=v(M,w,w=F+f.length*3,1)>>>0;const o=Vc().subarray(M+F,M+w),te=gg(f,o);F+=te.written}return qc=F,M}function th(f){return f==null}let xl=null;function Es(){return(xl===null||xl.byteLength===0)&&(xl=new Int32Array(wr.memory.buffer)),xl}let wl=as.length;function _g(f){f<132||(as[f]=wl,wl=f)}function $a(f){const _=Zt(f);return _g(f),_}const Vp=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Vp.decode();function ih(f,_){return f=f>>>0,Vp.decode(Vc().subarray(f,f+_))}function ji(f){wl===as.length&&as.push(as.length+1);const _=wl;return wl=as[_],as[_]=f,_}let vl=null;function yg(){return(vl===null||vl.byteLength===0)&&(vl=new Float64Array(wr.memory.buffer)),vl}function ch(f){const _=typeof f;if(_=="number"||_=="boolean"||f==null)return`${f}`;if(_=="string")return`"${f}"`;if(_=="symbol"){const M=f.description;return M==null?"Symbol":`Symbol(${M})`}if(_=="function"){const M=f.name;return typeof M=="string"&&M.length>0?`Function(${M})`:"Function"}if(Array.isArray(f)){const M=f.length;let z="[";M>0&&(z+=ch(f[0]));for(let F=1;F1)w=v[1];else return toString.call(f);if(w=="Object")try{return"Object("+JSON.stringify(f)+")"}catch{return"Object"}return f instanceof Error?`${f.name}: ${f.message} -${f.stack}`:w}function xg(f){try{const M=wr.__wbindgen_add_to_stack_pointer(-16);wr.calculate(M,ji(f));var _=Es()[M/4+0],v=Es()[M/4+1],w=Es()[M/4+2];if(w)throw $a(v);return $a(_)}finally{wr.__wbindgen_add_to_stack_pointer(16)}}function rh(f,_){try{return f.apply(this,_)}catch(v){wr.__wbindgen_exn_store(ji(v))}}async function vg(f,_){if(typeof Response=="function"&&f instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(f,_)}catch(w){if(f.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",w);else throw w}const v=await f.arrayBuffer();return await WebAssembly.instantiate(v,_)}else{const v=await WebAssembly.instantiate(f,_);return v instanceof WebAssembly.Instance?{instance:v,module:f}:v}}function bg(){const f={};return f.wbg={},f.wbg.__wbindgen_string_get=function(_,v){const w=Zt(v),M=typeof w=="string"?w:void 0;var z=th(M)?0:rp(M,wr.__wbindgen_malloc,wr.__wbindgen_realloc),F=qc;Es()[_/4+1]=F,Es()[_/4+0]=z},f.wbg.__wbindgen_object_drop_ref=function(_){$a(_)},f.wbg.__wbindgen_is_object=function(_){const v=Zt(_);return typeof v=="object"&&v!==null},f.wbg.__wbindgen_is_undefined=function(_){return Zt(_)===void 0},f.wbg.__wbindgen_in=function(_,v){return Zt(_)in Zt(v)},f.wbg.__wbindgen_error_new=function(_,v){const w=new Error(ih(_,v));return ji(w)},f.wbg.__wbindgen_jsval_loose_eq=function(_,v){return Zt(_)==Zt(v)},f.wbg.__wbindgen_boolean_get=function(_){const v=Zt(_);return typeof v=="boolean"?v?1:0:2},f.wbg.__wbindgen_number_get=function(_,v){const w=Zt(v),M=typeof w=="number"?w:void 0;yg()[_/8+1]=th(M)?0:M,Es()[_/4+0]=!th(M)},f.wbg.__wbindgen_number_new=function(_){return ji(_)},f.wbg.__wbindgen_object_clone_ref=function(_){const v=Zt(_);return ji(v)},f.wbg.__wbindgen_string_new=function(_,v){const w=ih(_,v);return ji(w)},f.wbg.__wbg_getwithrefkey_5e6d9547403deab8=function(_,v){const w=Zt(_)[Zt(v)];return ji(w)},f.wbg.__wbg_set_841ac57cff3d672b=function(_,v,w){Zt(_)[$a(v)]=$a(w)},f.wbg.__wbg_get_44be0491f933a435=function(_,v){const w=Zt(_)[v>>>0];return ji(w)},f.wbg.__wbg_length_fff51ee6522a1a18=function(_){return Zt(_).length},f.wbg.__wbg_new_898a68150f225f2e=function(){const _=new Array;return ji(_)},f.wbg.__wbindgen_is_function=function(_){return typeof Zt(_)=="function"},f.wbg.__wbg_next_526fc47e980da008=function(_){const v=Zt(_).next;return ji(v)},f.wbg.__wbg_next_ddb3312ca1c4e32a=function(){return rh(function(_){const v=Zt(_).next();return ji(v)},arguments)},f.wbg.__wbg_done_5c1f01fb660d73b5=function(_){return Zt(_).done},f.wbg.__wbg_value_1695675138684bd5=function(_){const v=Zt(_).value;return ji(v)},f.wbg.__wbg_iterator_97f0c81209c6c35a=function(){return ji(Symbol.iterator)},f.wbg.__wbg_get_97b561fb56f034b5=function(){return rh(function(_,v){const w=Reflect.get(Zt(_),Zt(v));return ji(w)},arguments)},f.wbg.__wbg_call_cb65541d95d71282=function(){return rh(function(_,v){const w=Zt(_).call(Zt(v));return ji(w)},arguments)},f.wbg.__wbg_new_b51585de1b234aff=function(){const _=new Object;return ji(_)},f.wbg.__wbg_set_502d29070ea18557=function(_,v,w){Zt(_)[v>>>0]=$a(w)},f.wbg.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb=function(_){let v;try{v=Zt(_)instanceof ArrayBuffer}catch{v=!1}return v},f.wbg.__wbg_entries_e51f29c7bba0c054=function(_){const v=Object.entries(Zt(_));return ji(v)},f.wbg.__wbg_buffer_085ec1f694018c4f=function(_){const v=Zt(_).buffer;return ji(v)},f.wbg.__wbg_new_8125e318e6245eed=function(_){const v=new Uint8Array(Zt(_));return ji(v)},f.wbg.__wbg_set_5cf90238115182c3=function(_,v,w){Zt(_).set(Zt(v),w>>>0)},f.wbg.__wbg_length_72e2208bbc0efc61=function(_){return Zt(_).length},f.wbg.__wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4=function(_){let v;try{v=Zt(_)instanceof Uint8Array}catch{v=!1}return v},f.wbg.__wbindgen_debug_string=function(_,v){const w=ch(Zt(v)),M=rp(w,wr.__wbindgen_malloc,wr.__wbindgen_realloc),z=qc;Es()[_/4+1]=z,Es()[_/4+0]=M},f.wbg.__wbindgen_throw=function(_,v){throw new Error(ih(_,v))},f.wbg.__wbindgen_memory=function(){const _=wr.memory;return ji(_)},f}function wg(f,_){return wr=f.exports,Tg.__wbindgen_wasm_module=_,vl=null,xl=null,yl=null,wr}async function Tg(f){if(wr!==void 0)return wr;typeof f>"u"&&(f="/od2net/assets/lts_bg.wasm");const _=bg();(typeof f=="string"||typeof Request=="function"&&f instanceof Request||typeof URL=="function"&&f instanceof URL)&&(f=fetch(f));const{instance:v,module:w}=await vg(await f,_);return wg(v,w)}var Tr=(f,_,v)=>new Promise((w,M)=>{var z=te=>{try{o(v.next(te))}catch(O){M(O)}},F=te=>{try{o(v.throw(te))}catch(O){M(O)}},o=te=>te.done?w(te.value):Promise.resolve(te.value).then(z,F);o((v=v.apply(f,_)).next())}),Yr=Uint8Array,eo=Uint16Array,Sg=Int32Array,Np=new Yr([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]),Up=new Yr([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]),Ig=new Yr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),jp=function(f,_){for(var v=new eo(31),w=0;w<31;++w)v[w]=_+=1<>1|($t&21845)<<1,ss=(ss&52428)>>2|(ss&13107)<<2,ss=(ss&61680)>>4|(ss&3855)<<4,uh[$t]=((ss&65280)>>8|(ss&255)<<8)>>1;var ss,$t,Tl=function(f,_,v){for(var w=f.length,M=0,z=new eo(_);M>te]=O}else for(o=new eo(w),M=0;M>15-f[M]);return o},Ml=new Yr(288);for($t=0;$t<144;++$t)Ml[$t]=8;var $t;for($t=144;$t<256;++$t)Ml[$t]=9;var $t;for($t=256;$t<280;++$t)Ml[$t]=7;var $t;for($t=280;$t<288;++$t)Ml[$t]=8;var $t,Gp=new Yr(32);for($t=0;$t<32;++$t)Gp[$t]=5;var $t,Cg=Tl(Ml,9,1),Eg=Tl(Gp,5,1),nh=function(f){for(var _=f[0],v=1;v_&&(_=f[v]);return _},Mn=function(f,_,v){var w=_/8|0;return(f[w]|f[w+1]<<8)>>(_&7)&v},sh=function(f,_){var v=_/8|0;return(f[v]|f[v+1]<<8|f[v+2]<<16)>>(_&7)},zg=function(f){return(f+7)/8|0},Pg=function(f,_,v){(_==null||_<0)&&(_=0),(v==null||v>f.length)&&(v=f.length);var w=new Yr(v-_);return w.set(f.subarray(_,v)),w},Dg=["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"],Jr=function(f,_,v){var w=new Error(_||Dg[f]);if(w.code=f,Error.captureStackTrace&&Error.captureStackTrace(w,Jr),!v)throw w;return w},fh=function(f,_,v,w){var M=f.length,z=w?w.length:0;if(!M||_.f&&!_.l)return v||new Yr(0);var F=!v||_.i!=2,o=_.i;v||(v=new Yr(M*3));var te=function(Jt){var nr=v.length;if(Jt>nr){var Yi=new Yr(Math.max(nr*2,Jt));Yi.set(v),v=Yi}},O=_.f||0,ne=_.p||0,le=_.b||0,ge=_.l,We=_.d,He=_.m,vt=_.n,Ge=M*8;do{if(!ge){O=Mn(f,ne,1);var et=Mn(f,ne+1,3);if(ne+=3,et)if(et==1)ge=Cg,We=Eg,He=9,vt=5;else if(et==2){var ht=Mn(f,ne,31)+257,zt=Mn(f,ne+10,15)+4,st=ht+Mn(f,ne+5,31)+1;ne+=14;for(var dt=new Yr(st),mt=new Yr(19),qe=0;qe>4;if(Je<16)dt[qe++]=Je;else{var pt=0,$e=0;for(Je==16?($e=3+Mn(f,ne,3),ne+=2,pt=dt[qe-1]):Je==17?($e=3+Mn(f,ne,7),ne+=3):Je==18&&($e=11+Mn(f,ne,127),ne+=7);$e--;)dt[qe++]=pt}}var Ht=dt.subarray(0,ht),Pt=dt.subarray(ht);He=nh(Ht),vt=nh(Pt),ge=Tl(Ht,He,1),We=Tl(Pt,vt,1)}else Jr(1);else{var Je=zg(ne)+4,Ye=f[Je-4]|f[Je-3]<<8,bt=Je+Ye;if(bt>M){o&&Jr(0);break}F&&te(le+Ye),v.set(f.subarray(Je,bt),le),_.b=le+=Ye,_.p=ne=bt*8,_.f=O;continue}if(ne>Ge){o&&Jr(0);break}}F&&te(le+131072);for(var Ji=(1<>4;if(ne+=pt&15,ne>Ge){o&&Jr(0);break}if(pt||Jr(2),Ot<256)v[le++]=Ot;else if(Ot==256){Kt=ne,ge=null;break}else{var yt=Ot-254;if(Ot>264){var qe=Ot-257,Rt=Np[qe];yt=Mn(f,ne,(1<>4;ki||Jr(3),ne+=ki&15;var Pt=kg[ti];if(ti>3){var Rt=Up[ti];Pt+=sh(f,ne)&(1<Ge){o&&Jr(0);break}F&&te(le+131072);var Ie=le+yt;if(le>3&1)+(_>>4&1);w>0;w-=!f[v++]);return v+(_&2)},Rg=function(f){var _=f.length;return(f[_-4]|f[_-3]<<8|f[_-2]<<16|f[_-1]<<24)>>>0},Fg=function(f,_){return((f[0]&15)!=8||f[0]>>4>7||(f[0]<<8|f[1])%31)&&Jr(6,"invalid zlib data"),(f[1]>>5&1)==+!_&&Jr(6,"invalid zlib data: "+(f[1]&32?"need":"unexpected")+" dictionary"),(f[1]>>3&4)+2};function Og(f,_){return fh(f,{i:2},_&&_.out,_&&_.dictionary)}function Vg(f,_){var v=Bg(f);return v+8>f.length&&Jr(6,"invalid gzip data"),fh(f.subarray(v,-8),{i:2},_&&_.out||new Yr(Rg(f)),_&&_.dictionary)}function Ng(f,_){return fh(f.subarray(Fg(f,_&&_.dictionary),-4),{i:2},_&&_.out,_&&_.dictionary)}function hh(f,_){return f[0]==31&&f[1]==139&&f[2]==8?Vg(f,_):(f[0]&15)!=8||f[0]>>4>7||(f[0]<<8|f[1])%31?Og(f,_):Ng(f,_)}var Ug=typeof TextDecoder<"u"&&new TextDecoder,jg=0;try{Ug.decode(Lg,{stream:!0}),jg=1}catch{}var Hp=(f,_)=>f*Math.pow(2,_),ml=(f,_)=>Math.floor(f/Math.pow(2,_)),Zc=(f,_)=>Hp(f.getUint16(_+1,!0),8)+f.getUint8(_),Wp=(f,_)=>Hp(f.getUint32(_+2,!0),16)+f.getUint16(_,!0),qg=(f,_,v,w,M)=>{if(f!=w.getUint8(M))return f-w.getUint8(M);const z=Zc(w,M+1);if(_!=z)return _-z;const F=Zc(w,M+4);return v!=F?v-F:0},Zg=(f,_,v,w)=>{const M=Xp(f,_|128,v,w);return M?{z:_,x:v,y:w,offset:M[0],length:M[1],is_dir:!0}:null},np=(f,_,v,w)=>{const M=Xp(f,_,v,w);return M?{z:_,x:v,y:w,offset:M[0],length:M[1],is_dir:!1}:null},Xp=(f,_,v,w)=>{let M=0,z=f.byteLength/17-1;for(;M<=z;){const F=z+M>>1,o=qg(_,v,w,f,F*17);if(o>0)M=F+1;else if(o<0)z=F-1;else return[Wp(f,F*17+7),f.getUint32(F*17+13,!0)]}return null},Gg=(f,_)=>f.is_dir&&!_.is_dir?1:!f.is_dir&&_.is_dir?-1:f.z!==_.z?f.z-_.z:f.x!==_.x?f.x-_.x:f.y-_.y,Kp=(f,_)=>{const v=f.getUint8(_*17);return{z:v&127,x:Zc(f,_*17+1),y:Zc(f,_*17+4),offset:Wp(f,_*17+7),length:f.getUint32(_*17+13,!0),is_dir:v>>7===1}},sp=f=>{const _=[],v=new DataView(f);for(let w=0;w{f.sort(Gg);const _=new ArrayBuffer(17*f.length),v=new Uint8Array(_);for(let w=0;w>8&255,v[w*17+3]=M.x>>16&255,v[w*17+4]=M.y&255,v[w*17+5]=M.y>>8&255,v[w*17+6]=M.y>>16&255,v[w*17+7]=M.offset&255,v[w*17+8]=ml(M.offset,8)&255,v[w*17+9]=ml(M.offset,16)&255,v[w*17+10]=ml(M.offset,24)&255,v[w*17+11]=ml(M.offset,32)&255,v[w*17+12]=ml(M.offset,48)&255,v[w*17+13]=M.length&255,v[w*17+14]=M.length>>8&255,v[w*17+15]=M.length>>16&255,v[w*17+16]=M.length>>24&255}return _},Wg=(f,_)=>{if(f.byteLength<17)return null;const v=f.byteLength/17,w=Kp(f,v-1);if(w.is_dir){const M=w.z,z=_.z-M,F=Math.trunc(_.x/(1<{if(f.type=="json"){const v=f.url.substr(10);let w=this.tiles.get(v);return w||(w=new ap(v),this.tiles.set(v,w)),w.getHeader().then(M=>{const z={tiles:[f.url+"/{z}/{x}/{y}"],minzoom:M.minZoom,maxzoom:M.maxZoom,bounds:[M.minLon,M.minLat,M.maxLon,M.maxLat]};_(null,z,null,null)}).catch(M=>{_(M,null,null,null)}),{cancel:()=>{}}}else{const v=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),w=f.url.match(v);if(!w)throw new Error("Invalid PMTiles protocol URL");const M=w[1];let z=this.tiles.get(M);z||(z=new ap(M),this.tiles.set(M,z));const F=w[2],o=w[3],te=w[4],O=new AbortController,ne=O.signal;let le=()=>{O.abort()};return z.getHeader().then(ge=>{z.getZxy(+F,+o,+te,ne).then(We=>{We?_(null,new Uint8Array(We.data),We.cacheControl,We.expires):ge.tileType==1?_(null,new Uint8Array,null,null):_(null,null,null,null)}).catch(We=>{We.name!=="AbortError"&&_(We,null,null,null)})}),{cancel:le}}},this.tiles=new Map}add(f){this.tiles.set(f.source.getKey(),f)}get(f){return this.tiles.get(f)}};function Xa(f,_){return(_>>>0)*4294967296+(f>>>0)}function Jg(f,_){const v=_.buf;let w,M;if(M=v[_.pos++],w=(M&112)>>4,M<128||(M=v[_.pos++],w|=(M&127)<<3,M<128)||(M=v[_.pos++],w|=(M&127)<<10,M<128)||(M=v[_.pos++],w|=(M&127)<<17,M<128)||(M=v[_.pos++],w|=(M&127)<<24,M<128)||(M=v[_.pos++],w|=(M&1)<<31,M<128))return Xa(f,w);throw new Error("Expected varint not more than 10 bytes")}function gl(f){const _=f.buf;let v,w;return w=_[f.pos++],v=w&127,w<128||(w=_[f.pos++],v|=(w&127)<<7,w<128)||(w=_[f.pos++],v|=(w&127)<<14,w<128)||(w=_[f.pos++],v|=(w&127)<<21,w<128)?v:(w=_[f.pos],v|=(w&15)<<28,Jg(v,f))}function Yg(f,_,v,w){if(w==0){v==1&&(_[0]=f-1-_[0],_[1]=f-1-_[1]);const M=_[0];_[0]=_[1],_[1]=M}}var Qg=[0,1,5,21,85,341,1365,5461,21845,87381,349525,1398101,5592405,22369621,89478485,357913941,1431655765,5726623061,22906492245,91625968981,366503875925,1466015503701,5864062014805,23456248059221,93824992236885,375299968947541,0x5555555555555];function $g(f,_,v){if(f>26)throw Error("Tile zoom level exceeds max safe number limit (26)");if(_>Math.pow(2,f)-1||v>Math.pow(2,f)-1)throw Error("tile x/y outside zoom level bounds");const w=Qg[f],M=Math.pow(2,f);let z=0,F=0,o=0;const te=[_,v];let O=M/2;for(;O>0;)z=(te[0]&O)>0?1:0,F=(te[1]&O)>0?1:0,o+=O*O*(3*z^F),Yg(O,te,z,F),O=O/2;return w+o}function Yp(f,_){return Tr(this,null,function*(){if(_===1||_===0)return f;if(_===2){if(typeof globalThis.DecompressionStream>"u")return hh(new Uint8Array(f));{let w=new Response(f).body.pipeThrough(new globalThis.DecompressionStream("gzip"));return new Response(w).arrayBuffer()}}else throw Error("Compression method not supported")})}var e_=127;function t_(f,_){let v=0,w=f.length-1;for(;v<=w;){const M=w+v>>1,z=_-f[M].tileId;if(z>0)v=M+1;else if(z<0)w=M-1;else return f[M]}return w>=0&&(f[w].runLength===0||_-f[w].tileId=300)throw Error("Bad response code: "+M.status);const z=M.headers.get("Content-Length");if(M.status===200&&(!z||+z>_))throw w&&w.abort(),Error("Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.");return{data:yield M.arrayBuffer(),etag:M.headers.get("ETag")||void 0,cacheControl:M.headers.get("Cache-Control")||void 0,expires:M.headers.get("Expires")||void 0}})}};function kn(f,_){const v=f.getUint32(_+4,!0),w=f.getUint32(_+0,!0);return v*Math.pow(2,32)+w}function r_(f,_){const v=new DataView(f),w=v.getUint8(7);if(w>3)throw Error(`Archive is spec version ${w} but this library supports up to spec version 3`);return{specVersion:w,rootDirectoryOffset:kn(v,8),rootDirectoryLength:kn(v,16),jsonMetadataOffset:kn(v,24),jsonMetadataLength:kn(v,32),leafDirectoryOffset:kn(v,40),leafDirectoryLength:kn(v,48),tileDataOffset:kn(v,56),tileDataLength:kn(v,64),numAddressedTiles:kn(v,72),numTileEntries:kn(v,80),numTileContents:kn(v,88),clustered:v.getUint8(96)===1,internalCompression:v.getUint8(97),tileCompression:v.getUint8(98),tileType:v.getUint8(99),minZoom:v.getUint8(100),maxZoom:v.getUint8(101),minLon:v.getInt32(102,!0)/1e7,minLat:v.getInt32(106,!0)/1e7,maxLon:v.getInt32(110,!0)/1e7,maxLat:v.getInt32(114,!0)/1e7,centerZoom:v.getUint8(118),centerLon:v.getInt32(119,!0)/1e7,centerLat:v.getInt32(123,!0)/1e7,etag:_}}function Qp(f){const _={buf:new Uint8Array(f),pos:0},v=gl(_),w=[];let M=0;for(let z=0;z0?w[z].offset=w[z-1].offset+w[z-1].length:w[z].offset=F-1}return w}function n_(f){const _=new DataView(f);return _.getUint16(2,!0)===2?(console.warn("PMTiles spec version 2 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),2):_.getUint16(2,!0)===1?(console.warn("PMTiles spec version 1 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),1):3}var to=class extends Error{};function s_(f,_,v,w){return Tr(this,null,function*(){const M=yield f.getBytes(0,16384);if(new DataView(M.data).getUint16(0,!0)!==19792)throw new Error("Wrong magic number for PMTiles archive");if(n_(M.data)<3)return[yield Jp.getHeader(f)];const F=M.data.slice(0,e_);let o=M.etag;w&&M.etag!=w&&(console.warn("ETag conflict detected; your HTTP server might not support content-based ETag headers. ETags disabled for "+f.getKey()),o=void 0);const te=r_(F,o);if(v){const O=M.data.slice(te.rootDirectoryOffset,te.rootDirectoryOffset+te.rootDirectoryLength),ne=f.getKey()+"|"+(te.etag||"")+"|"+te.rootDirectoryOffset+"|"+te.rootDirectoryLength,le=Qp(yield _(O,te.internalCompression));return[te,[ne,le.length,le]]}return[te,void 0]})}function a_(f,_,v,w,M){return Tr(this,null,function*(){const z=yield f.getBytes(v,w);if(M.etag&&M.etag!==z.etag)throw new to(z.etag);const F=yield _(z.data,M.internalCompression),o=Qp(F);if(o.length===0)throw new Error("Empty directory is invalid");return o})}var o_=class{constructor(f=100,_=!0,v=Yp){this.cache=new Map,this.maxCacheEntries=f,this.counter=1,this.prefetch=_,this.decompress=v}getHeader(f,_){return Tr(this,null,function*(){const v=f.getKey();if(this.cache.has(v))return this.cache.get(v).lastUsed=this.counter++,yield this.cache.get(v).data;const w=new Promise((M,z)=>{s_(f,this.decompress,this.prefetch,_).then(F=>{F[1]&&this.cache.set(F[1][0],{lastUsed:this.counter++,data:Promise.resolve(F[1][2])}),M(F[0]),this.prune()}).catch(F=>{z(F)})});return this.cache.set(v,{lastUsed:this.counter++,data:w}),w})}getDirectory(f,_,v,w){return Tr(this,null,function*(){const M=f.getKey()+"|"+(w.etag||"")+"|"+_+"|"+v;if(this.cache.has(M))return this.cache.get(M).lastUsed=this.counter++,yield this.cache.get(M).data;const z=new Promise((F,o)=>{a_(f,this.decompress,_,v,w).then(te=>{F(te),this.prune()}).catch(te=>{o(te)})});return this.cache.set(M,{lastUsed:this.counter++,data:z}),z})}getArrayBuffer(f,_,v,w){return Tr(this,null,function*(){const M=f.getKey()+"|"+(w.etag||"")+"|"+_+"|"+v;if(this.cache.has(M))return this.cache.get(M).lastUsed=this.counter++,yield this.cache.get(M).data;const z=new Promise((F,o)=>{f.getBytes(_,v).then(te=>{if(w.etag&&w.etag!==te.etag)throw new to(te.etag);F(te.data),this.cache.has(M),this.prune()}).catch(te=>{o(te)})});return this.cache.set(M,{lastUsed:this.counter++,data:z}),z})}prune(){if(this.cache.size>=this.maxCacheEntries){let f=1/0,_;this.cache.forEach((v,w)=>{v.lastUsedz.maxZoom)return;let F=z.rootDirectoryOffset,o=z.rootDirectoryLength;for(let te=0;te<=3;te++){const O=yield this.cache.getDirectory(this.source,F,o,z),ne=t_(O,M);if(ne)if(ne.runLength>0){const le=yield this.source.getBytes(z.tileDataOffset+ne.offset,ne.length,w);if(z.etag&&z.etag!==le.etag)throw new to(le.etag);return{data:yield this.decompress(le.data,z.tileCompression),cacheControl:le.cacheControl,expires:le.expires}}else F=z.leafDirectoryOffset+ne.offset,o=ne.length;else return}throw Error("Maximum directory depth exceeded")})}getZxy(f,_,v,w){return Tr(this,null,function*(){try{return yield this.getZxyAttempt(f,_,v,w)}catch(M){if(M instanceof to)return this.cache.invalidate(this.source,M.message),yield this.getZxyAttempt(f,_,v,w);throw M}})}getMetadataAttempt(){return Tr(this,null,function*(){const f=yield this.cache.getHeader(this.source),_=yield this.source.getBytes(f.jsonMetadataOffset,f.jsonMetadataLength);if(f.etag&&f.etag!==_.etag)throw new to(_.etag);const v=yield this.decompress(_.data,f.internalCompression),w=new TextDecoder("utf-8");return JSON.parse(w.decode(v))})}getMetadata(){return Tr(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(f){if(f instanceof to)return this.cache.invalidate(this.source,f.message),yield this.getMetadataAttempt();throw f}})}};const Ka=[];function ah(f,_){return{subscribe:Nn(f,_).subscribe}}function Nn(f,_=Sr){let v;const w=new Set;function M(o){if(Rr(f,o)&&(f=o,v)){const te=!Ka.length;for(const O of w)O[1](),Ka.push(O,f);if(te){for(let O=0;O{w.delete(O),w.size===0&&v&&(v(),v=null)}}return{set:M,update:z,subscribe:F}}let l_=Date.now();function $p(f){return`${f}-${l_++}`}const mh=Symbol.for("svelte-maplibre");function oo(){return cg(mh)}function c_(f){let _=new WeakMap;return v=>{var F;let w=_.get(v.originalEvent);if(w!==void 0)return w;let z=(F=v.target.queryRenderedFeatures(v.point).find(o=>{var te;return(te=f.get(o.layer.id))==null?void 0:te.interactive}))==null?void 0:F.layer.id;return _.set(v.originalEvent,z),z}}function u_(){let f=new Map;return Bp(mh,{map:Nn(null),source:ah(null),layer:ah(null),popupTarget:ah(null),cluster:Nn(),loadedImages:Nn(new Set),minzoom:Nn(0),maxzoom:Nn(24),layerEvent:Nn(null),layerInfo:f,eventTopMost:c_(f)})}function op(f){return{subscribe:f.subscribe}}function gh({key:f,setPopupTarget:_=!1,setCluster:v=!1,setMouseEvent:w=!1}){let M=oo(),z=Nn(null),F=op(z),o={...M,[f]:op(z)};if(_&&(o.popupTarget=F),w){let te=Nn(null);o.layerEvent=te,M.layerEvent=te}return v&&(o.cluster=Nn()),Bp(mh,o),{...M,self:z}}function my(){return gh({key:"source",setCluster:!0})}function h_(f=!0){return gh({key:"layer",setPopupTarget:f,setMouseEvent:f})}function gy(){return gh({key:"popupTarget",setPopupTarget:!0,setMouseEvent:!0})}function d_(f){return"layerType"in f&&f.layerType==="deckgl"}var p_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function f_(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var ef={exports:{}};(function(f,_){(function(v,w){f.exports=w()})(p_,function(){var v,w,M;function z(o,te){if(!v)v=te;else if(!w)w=te;else{var O="var sharedChunk = {}; ("+v+")(sharedChunk); ("+w+")(sharedChunk);",ne={};v(ne),M=te(ne),typeof window<"u"&&(M.workerUrl=window.URL.createObjectURL(new Blob([O],{type:"text/javascript"})))}}z(["exports"],function(o){function te(i,e,r,s){return new(r||(r=Promise))(function(l,h){function p(T){try{x(s.next(T))}catch(I){h(I)}}function m(T){try{x(s.throw(T))}catch(I){h(I)}}function x(T){var I;T.done?l(T.value):(I=T.value,I instanceof r?I:new r(function(C){C(I)})).then(p,m)}x((s=s.apply(i,e||[])).next())})}function O(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var ne=le;function le(i,e){this.x=i,this.y=e}le.prototype={clone:function(){return new le(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),s=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=s,this},_rotateAround:function(i,e){var r=Math.cos(i),s=Math.sin(i),l=e.y+s*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-s*(this.y-e.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},le.convert=function(i){return i instanceof le?i:Array.isArray(i)?new le(i[0],i[1]):i};var ge=O(ne),We=He;function He(i,e,r,s){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(s-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=s}He.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,s=0;s<8;s++){var l=this.sampleCurveX(r)-i;if(Math.abs(l)l?p=r:m=r,r=.5*(m-p)+p;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var vt=O(We);let Ge,et;function Je(){return Ge==null&&(Ge=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Ge}function Ye(){if(et==null&&(et=!1,Je())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let s=0;s<5*5;s++){const l=4*s;e.fillStyle=`rgb(${l},${l+1},${l+2})`,e.fillRect(s%5,Math.floor(s/5),1,1)}const r=e.getImageData(0,0,5,5).data;for(let s=0;s<5*5*4;s++)if(s%4!=3&&r[s]!==s){et=!0;break}}}return et||!1}function bt(i,e,r,s){const l=new vt(i,e,r,s);return function(h){return l.solve(h)}}const ht=bt(.25,.1,.25,1);function zt(i,e,r){return Math.min(r,Math.max(e,i))}function st(i,e,r){const s=r-e,l=((i-e)%s+s)%s+e;return l===e?r:l}function dt(i,...e){for(const r of e)for(const s in r)i[s]=r[s];return i}let mt=1;function qe(i,e,r){const s={};for(const l in i)s[l]=e.call(r||this,i[l],l,i);return s}function ve(i,e,r){const s={};for(const l in i)e.call(r||this,i[l],l,i)&&(s[l]=i[l]);return s}function rt(i){return Array.isArray(i)?i.map(rt):typeof i=="object"&&i?qe(i,rt):i}const gt={};function lt(i){gt[i]||(typeof console<"u"&&console.warn(i),gt[i]=!0)}function pt(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function $e(i){let e=0;for(let r,s,l=0,h=i.length,p=h-1;l"u")throw new Error("VideoFrame not supported");const h=new VideoFrame(i,{timestamp:0});try{const p=h==null?void 0:h.format;if(!p||!p.startsWith("BGR")&&!p.startsWith("RGB"))throw new Error(`Unrecognized format ${p}`);const m=p.startsWith("BGR"),x=new Uint8ClampedArray(s*l*4);if(yield h.copyTo(x,function(T,I,C,P,B){const R=4*Math.max(-I,0),U=(Math.max(0,C)-C)*P*4+R,W=4*P,J=Math.max(0,I),se=Math.max(0,C);return{rect:{x:J,y:se,width:Math.min(T.width,I+P)-J,height:Math.min(T.height,C+B)-se},layout:[{offset:U,stride:W}]}}(i,e,r,s,l)),m)for(let T=0;TcancelAnimationFrame(e)}},getImageData(i,e=0){return this.getImageCanvasContext(i).getImageData(-e,-e,i.width+2*e,i.height+2*e)},getImageCanvasContext(i){const e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=i.width,e.height=i.height,r.drawImage(i,0,0,i.width,i.height),r},resolveURL:i=>(Rt||(Rt=document.createElement("a")),Rt.href=i,Rt.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(ki==null&&(ki=matchMedia("(prefers-reduced-motion: reduce)")),ki.matches)}},Ie={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class nt extends Error{constructor(e,r,s,l){super(`AJAXError: ${r} (${e}): ${s}`),this.status=e,this.statusText=r,this.url=s,this.body=l}}const St=Ht()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,Jt=i=>Ie.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))];function nr(i,e){const r=new AbortController,s=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,cache:i.cache,referrer:St(),signal:r.signal});let l=!1,h=!1;return i.type==="json"&&s.headers.set("Accept","application/json"),h||fetch(s).then(p=>p.ok?(m=>{(i.type==="arrayBuffer"||i.type==="image"?m.arrayBuffer():i.type==="json"?m.json():m.text()).then(x=>{h||(l=!0,e(null,x,m.headers.get("Cache-Control"),m.headers.get("Expires")))}).catch(x=>{h||e(new Error(x.message))})})(p):p.blob().then(m=>e(new nt(p.status,p.statusText,i.url,m)))).catch(p=>{p.code!==20&&e(new Error(p.message))}),{cancel:()=>{h=!0,l||r.abort()}}}const Yi=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(Ht()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!Ht())return(Jt(i.url)||nr)(i,e)}if(!(/^file:/.test(r=i.url)||/^file:/.test(St())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return nr(i,e);if(Ht()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var r;return function(s,l){const h=new XMLHttpRequest;h.open(s.method||"GET",s.url,!0),s.type!=="arrayBuffer"&&s.type!=="image"||(h.responseType="arraybuffer");for(const p in s.headers)h.setRequestHeader(p,s.headers[p]);return s.type==="json"&&(h.responseType="text",h.setRequestHeader("Accept","application/json")),h.withCredentials=s.credentials==="include",h.onerror=()=>{l(new Error(h.statusText))},h.onload=()=>{if((h.status>=200&&h.status<300||h.status===0)&&h.response!==null){let p=h.response;if(s.type==="json")try{p=JSON.parse(h.response)}catch(m){return l(m)}l(null,p,h.getResponseHeader("Cache-Control"),h.getResponseHeader("Expires"))}else{const p=new Blob([h.response],{type:h.getResponseHeader("Content-Type")});l(new nt(h.status,h.statusText,s.url,p))}},h.send(s.body),{cancel:()=>h.abort()}}(i,e)},ue=function(i,e){return Yi(dt(i,{type:"arrayBuffer"}),e)};function Vt(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const e=new URL(i),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function Ui(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function qi(i,e,r){if(r&&r[i]){const s=r[i].indexOf(e);s!==-1&&r[i].splice(s,1)}}class Pi{constructor(e,r={}){dt(this,r),this.type=e}}class Zi extends Pi{constructor(e,r={}){super("error",dt({error:e},r))}}class tn{on(e,r){return this._listeners=this._listeners||{},Ui(e,r,this._listeners),this}off(e,r){return qi(e,r,this._listeners),qi(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Ui(e,r,this._oneTimeListeners),this):new Promise(s=>this.once(e,s))}fire(e,r){typeof e=="string"&&(e=new Pi(e,r||{}));const s=e.type;if(this.listens(s)){e.target=this;const l=this._listeners&&this._listeners[s]?this._listeners[s].slice():[];for(const m of l)m.call(this,e);const h=this._oneTimeListeners&&this._oneTimeListeners[s]?this._oneTimeListeners[s].slice():[];for(const m of h)qi(s,m,this._oneTimeListeners),m.call(this,e);const p=this._eventedParent;p&&(dt(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(e))}else e instanceof Zi&&console.error(e.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,r){return this._eventedParent=e,this._eventedParentData=r,this}}var fe={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const pr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Fr(i,e){const r={};for(const s in i)s!=="ref"&&(r[s]=i[s]);return pr.forEach(s=>{s in e&&(r[s]=e[s])}),r}function ii(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let r=0;r`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const ae=[mn,Ee,xt,ct,sr,Z,sn,H(ft),E,D,V];function $(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!$(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of ae)if(!$(r,e))return null}}return`Expected ${X(i)} but found ${X(e)} instead.`}function Y(i,e){return e.some(r=>r.kind===i.kind)}function re(i,e){return e.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function me(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}const _e=.96422,be=.82521,Xe=4/29,at=6/29,Oe=3*at*at,Qe=at*at*at,ut=Math.PI/180,Gt=180/Math.PI;function Yt(i){return(i%=360)<0&&(i+=360),i}function Ft([i,e,r,s]){let l,h;const p=Qi((.2225045*(i=Bt(i))+.7168786*(e=Bt(e))+.0606169*(r=Bt(r)))/1);i===e&&e===r?l=h=p:(l=Qi((.4360747*i+.3850649*e+.1430804*r)/_e),h=Qi((.0139322*i+.0971045*e+.7141733*r)/be));const m=116*p-16;return[m<0?0:m,500*(l-p),200*(p-h),s]}function Bt(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Qi(i){return i>Qe?Math.pow(i,1/3):i/Oe+Xe}function ri([i,e,r,s]){let l=(i+16)/116,h=isNaN(e)?l:l+e/500,p=isNaN(r)?l:l-r/200;return l=1*Gi(l),h=_e*Gi(h),p=be*Gi(p),[Ci(3.1338561*h-1.6168667*l-.4906146*p),Ci(-.9787684*h+1.9161415*l+.033454*p),Ci(.0719453*h-.2289914*l+1.4052427*p),s]}function Ci(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function Gi(i){return i>at?i*i*i:Oe*(i-Xe)}function Or(i){return parseInt(i.padEnd(2,i),16)/255}function kl(i,e){return cs(e?i/100:i,0,1)}function cs(i,e,r){return Math.min(Math.max(e,i),r)}function us(i){return!i.some(Number.isNaN)}const Hc={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Wt{constructor(e,r,s,l=1,h=!0){this.r=e,this.g=r,this.b=s,this.a=l,h||(this.r*=l,this.g*=l,this.b*=l,l||this.overwriteGetter("rgb",[e,r,s,l]))}static parse(e){if(e instanceof Wt)return e;if(typeof e!="string")return;const r=function(s){if((s=s.toLowerCase().trim())==="transparent")return[0,0,0,0];const l=Hc[s];if(l){const[p,m,x]=l;return[p/255,m/255,x/255,1]}if(s.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(s)){const p=s.length<6?1:2;let m=1;return[Or(s.slice(m,m+=p)),Or(s.slice(m,m+=p)),Or(s.slice(m,m+=p)),Or(s.slice(m,m+p)||"ff")]}if(s.startsWith("rgb")){const p=s.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){const[m,x,T,I,C,P,B,R,U,W,J,se]=p,Q=[I||" ",B||" ",W].join("");if(Q===" "||Q===" /"||Q===",,"||Q===",,,"){const oe=[T,P,U].join(""),he=oe==="%%%"?100:oe===""?255:0;if(he){const xe=[cs(+x/he,0,1),cs(+C/he,0,1),cs(+R/he,0,1),J?kl(+J,se):1];if(us(xe))return xe}}return}}const h=s.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(h){const[p,m,x,T,I,C,P,B,R]=h,U=[x||" ",I||" ",P].join("");if(U===" "||U===" /"||U===",,"||U===",,,"){const W=[+m,cs(+T,0,100),cs(+C,0,100),B?kl(+B,R):1];if(us(W))return function([J,se,Q,oe]){function he(xe){const Be=(xe+J/30)%12,Ne=se*Math.min(Q,1-Q);return Q-Ne*Math.max(-1,Math.min(Be-3,9-Be,1))}return J=Yt(J),se/=100,Q/=100,[he(0),he(8),he(4),oe]}(W)}}}(e);return r?new Wt(...r,!1):void 0}get rgb(){const{r:e,g:r,b:s,a:l}=this,h=l||1/0;return this.overwriteGetter("rgb",[e/h,r/h,s/h,l])}get hcl(){return this.overwriteGetter("hcl",function(e){const[r,s,l,h]=Ft(e),p=Math.sqrt(s*s+l*l);return[Math.round(1e4*p)?Yt(Math.atan2(l,s)*Gt):NaN,p,r,h]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ft(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){const[e,r,s,l]=this.rgb;return`rgba(${[e,r,s].map(h=>Math.round(255*h)).join(",")},${l})`}}Wt.black=new Wt(0,0,0,1),Wt.white=new Wt(1,1,1,1),Wt.transparent=new Wt(0,0,0,0),Wt.red=new Wt(1,0,0,1);class lo{constructor(e,r,s){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=s,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class oa{constructor(e,r,s,l,h){this.text=e,this.image=r,this.scale=s,this.fontStack=l,this.textColor=h}}class $i{constructor(e){this.sections=e}static fromString(e){return new $i([new oa(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof $i?e:$i.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class Ir{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ir)return e;if(typeof e=="number")return new Ir([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Ir(e)}}toString(){return JSON.stringify(this.values)}}const Wc=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Vr{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Vr)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let r=0;r=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?s===void 0||typeof s=="number"&&s>=0&&s<=1?null:`Invalid rgba value [${[i,e,r,s].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof s=="number"?[i,e,r,s]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function hs(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof Wt||i instanceof lo||i instanceof $i||i instanceof Ir||i instanceof Vr||i instanceof Hi)return!0;if(Array.isArray(i)){for(const e of i)if(!hs(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!hs(i[e]))return!1;return!0}return!1}function di(i){if(i===null)return mn;if(typeof i=="string")return xt;if(typeof i=="boolean")return ct;if(typeof i=="number")return Ee;if(i instanceof Wt)return sr;if(i instanceof lo)return gn;if(i instanceof $i)return Z;if(i instanceof Ir)return E;if(i instanceof Vr)return V;if(i instanceof Hi)return D;if(Array.isArray(i)){const e=i.length;let r;for(const s of i){const l=di(s);if(r){if(r===l)continue;r=ft;break}r=l}return H(r||ft,e)}return sn}function Ut(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof Wt||i instanceof $i||i instanceof Ir||i instanceof Vr||i instanceof Hi?i.toString():JSON.stringify(i)}class qn{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!hs(e[1]))return r.error("invalid value");const s=e[1];let l=di(s);const h=r.expectedType;return l.kind!=="array"||l.N!==0||!h||h.kind!=="array"||typeof h.N=="number"&&h.N!==0||(l=h),new qn(l,s)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class _i{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const ca={string:xt,number:Ee,boolean:ct,object:sn};class Nr{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let s,l=1;const h=e[0];if(h==="array"){let m,x;if(e.length>2){const T=e[1];if(typeof T!="string"||!(T in ca)||T==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);m=ca[T],l++}else m=ft;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);x=e[2],l++}s=H(m,x)}else{if(!ca[h])throw new Error(`Types doesn't contain name = ${h}`);s=ca[h]}const p=[];for(;le.outputDefined())}}const co={"to-boolean":ct,"to-color":sr,"to-number":Ee,"to-string":xt};class zn{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const s=e[0];if(!co[s])throw new Error(`Can't parse ${s} as it is not part of the known types`);if((s==="to-boolean"||s==="to-string")&&e.length!==2)return r.error("Expected one argument.");const l=co[s],h=[];for(let p=1;p4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:la(r[0],r[1],r[2],r[3]),!s))return new Wt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new _i(s||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const s of this.args){r=s.evaluate(e);const l=Ir.parse(r);if(l)return l}throw new _i(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const s of this.args){r=s.evaluate(e);const l=Vr.parse(r);if(l)return l}throw new _i(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const s of this.args){if(r=s.evaluate(e),r===null)return 0;const l=Number(r);if(!isNaN(l))return l}throw new _i(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return $i.fromString(Ut(this.args[0].evaluate(e)));case"resolvedImage":return Hi.fromString(Ut(this.args[0].evaluate(e)));default:return Ut(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const Cl=["Unknown","Point","LineString","Polygon"];class uo{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Cl[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=Wt.parse(e)),r}}class ua{constructor(e,r,s=[],l,h=new jn,p=[]){this.registry=e,this.path=s,this.key=s.map(m=>`[${m}]`).join(""),this.scope=h,this.errors=p,this.expectedType=l,this._isConstant=r}parse(e,r,s,l,h={}){return r?this.concat(r,s,l)._parse(e,h):this._parse(e,h)}_parse(e,r){function s(l,h,p){return p==="assert"?new Nr(h,[l]):p==="coerce"?new zn(h,[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=e[0];if(typeof l!="string")return this.error(`Expression name must be a string, but found ${typeof l} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const h=this.registry[l];if(h){let p=h.parse(e,this);if(!p)return null;if(this.expectedType){const m=this.expectedType,x=p.type;if(m.kind!=="string"&&m.kind!=="number"&&m.kind!=="boolean"&&m.kind!=="object"&&m.kind!=="array"||x.kind!=="value")if(m.kind!=="color"&&m.kind!=="formatted"&&m.kind!=="resolvedImage"||x.kind!=="value"&&x.kind!=="string")if(m.kind!=="padding"||x.kind!=="value"&&x.kind!=="number"&&x.kind!=="array")if(m.kind!=="variableAnchorOffsetCollection"||x.kind!=="value"&&x.kind!=="array"){if(this.checkSubtype(m,x))return null}else p=s(p,m,r.typeAnnotation||"coerce");else p=s(p,m,r.typeAnnotation||"coerce");else p=s(p,m,r.typeAnnotation||"coerce");else p=s(p,m,r.typeAnnotation||"assert")}if(!(p instanceof qn)&&p.type.kind!=="resolvedImage"&&this._isConstant(p)){const m=new uo;try{p=new qn(p.type,p.evaluate(m))}catch(x){return this.error(x.message),null}}return p}return this.error(`Unknown expression "${l}". If you wanted a literal array, use ["literal", [...]].`,0)}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,r,s){const l=typeof e=="number"?this.path.concat(e):this.path,h=s?this.scope.concat(s):this.scope;return new ua(this.registry,this._isConstant,l,r||null,h,this.errors)}error(e,...r){const s=`${this.key}${r.map(l=>`[${l}]`).join("")}`;this.errors.push(new gi(s,e))}checkSubtype(e,r){const s=$(e,r);return s&&this.error(s),s}}class ha{constructor(e,r,s){this.type=gn,this.locale=s,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const s=e[1];if(typeof s!="object"||Array.isArray(s))return r.error("Collator options argument must be an object.");const l=r.parse(s["case-sensitive"]!==void 0&&s["case-sensitive"],1,ct);if(!l)return null;const h=r.parse(s["diacritic-sensitive"]!==void 0&&s["diacritic-sensitive"],1,ct);if(!h)return null;let p=null;return s.locale&&(p=r.parse(s.locale,1,xt),!p)?null:new ha(l,h,p)}evaluate(e){return new lo(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}const Pn=8192;function ho(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function zs(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function El(i,e){const r=(180+i[0])/360,s=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,l=Math.pow(2,e.z);return[Math.round(r*l*Pn),Math.round(s*l*Pn)]}function Xc(i,e,r){const s=i[0]-e[0],l=i[1]-e[1],h=i[0]-r[0],p=i[1]-r[1];return s*p-h*l==0&&s*h<=0&&l*p<=0}function po(i,e){let r=!1;for(let p=0,m=e.length;p(s=i)[1]!=(h=x[T+1])[1]>s[1]&&s[0]<(h[0]-l[0])*(s[1]-l[1])/(h[1]-l[1])+l[0]&&(r=!r)}}var s,l,h;return r}function fo(i,e){for(let r=0;r0&&m<0||p<0&&m>0}function Kc(i,e,r){for(const T of r)for(let I=0;Ir[2]){const l=.5*s;let h=i[0]-r[0]>l?-s:r[0]-i[0]>l?s:0;h===0&&(h=i[0]-r[2]>l?-s:r[2]-i[0]>l?s:0),i[0]+=h}ho(e,i)}function mo(i,e,r,s){const l=Math.pow(2,s.z)*Pn,h=[s.x*Pn,s.y*Pn],p=[];for(const m of i)for(const x of m){const T=[x.x+h[0],x.y+h[1]];Bl(T,e,r,l),p.push(T)}return p}function go(i,e,r,s){const l=Math.pow(2,s.z)*Pn,h=[s.x*Pn,s.y*Pn],p=[];for(const x of i){const T=[];for(const I of x){const C=[I.x+h[0],I.y+h[1]];ho(e,C),T.push(C)}p.push(T)}if(e[2]-e[0]<=l/2){(m=e)[0]=m[1]=1/0,m[2]=m[3]=-1/0;for(const x of p)for(const T of x)Bl(T,e,r,l)}var m;return p}class Zn{constructor(e,r){this.type=ct,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(hs(e[1])){const s=e[1];if(s.type==="FeatureCollection")for(let l=0;l!Array.isArray(T)||T.length===e.length-1);let x=null;for(const[T,I]of m){x=new ua(r.registry,fa,r.path,null,r.scope);const C=[];let P=!1;for(let B=1;B{return P=C,Array.isArray(P)?`(${P.map(X).join(", ")})`:`(${X(P.type)}...)`;var P}).join(" | "),I=[];for(let C=1;C{r=e?r&&fa(s):r&&s instanceof qn}),!!r&&ma(i)&&ga(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function ma(i){if(i instanceof Ur&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof Zn)return!1;let e=!0;return i.eachChild(r=>{e&&!ma(r)&&(e=!1)}),e}function Ps(i){if(i instanceof Ur&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!Ps(r)&&(e=!1)}),e}function ga(i,e){if(i instanceof Ur&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(s=>{r&&!ga(s,e)&&(r=!1)}),r}function ds(i,e){const r=i.length-1;let s,l,h=0,p=r,m=0;for(;h<=p;)if(m=Math.floor((h+p)/2),s=i[m],l=i[m+1],s<=e){if(m===r||ee))throw new _i("Input is not a number.");p=m-1}return 0}class Dn{constructor(e,r,s){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[l,h]of s)this.labels.push(l),this.outputs.push(h)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const s=r.parse(e[1],1,Ee);if(!s)return null;const l=[];let h=null;r.expectedType&&r.expectedType.kind!=="value"&&(h=r.expectedType);for(let p=1;p=m)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',T);const C=r.parse(x,I,h);if(!C)return null;h=h||C.type,l.push([m,C])}return new Dn(h,s,l)}evaluate(e){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(e);const l=this.input.evaluate(e);if(l<=r[0])return s[0].evaluate(e);const h=r.length;return l>=r[h-1]?s[h-1].evaluate(e):s[ds(r,l)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Dt(i,e,r){return i+r*(e-i)}function _a(i,e,r){return i.map((s,l)=>Dt(s,e[l],r))}const Ar={number:Dt,color:function(i,e,r,s="rgb"){switch(s){case"rgb":{const[l,h,p,m]=_a(i.rgb,e.rgb,r);return new Wt(l,h,p,m,!1)}case"hcl":{const[l,h,p,m]=i.hcl,[x,T,I,C]=e.hcl;let P,B;if(isNaN(l)||isNaN(x))isNaN(l)?isNaN(x)?P=NaN:(P=x,p!==1&&p!==0||(B=T)):(P=l,I!==1&&I!==0||(B=h));else{let se=x-l;x>l&&se>180?se-=360:x180&&(se+=360),P=l+r*se}const[R,U,W,J]=function([se,Q,oe,he]){return se=isNaN(se)?0:se*ut,ri([oe,Math.cos(se)*Q,Math.sin(se)*Q,he])}([P,B??Dt(h,T,r),Dt(p,I,r),Dt(m,C,r)]);return new Wt(R,U,W,J,!1)}case"lab":{const[l,h,p,m]=ri(_a(i.lab,e.lab,r));return new Wt(l,h,p,m,!1)}}},array:_a,padding:function(i,e,r){return new Ir(_a(i.values,e.values,r))},variableAnchorOffsetCollection:function(i,e,r){const s=i.values,l=e.values;if(s.length!==l.length)throw new _i(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${e.toString()}`);const h=[];for(let p=0;ptypeof I!="number"||I<0||I>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);l={name:"cubic-bezier",controlPoints:T}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(h=r.parse(h,2,Ee),!h)return null;const m=[];let x=null;s==="interpolate-hcl"||s==="interpolate-lab"?x=sr:r.expectedType&&r.expectedType.kind!=="value"&&(x=r.expectedType);for(let T=0;T=I)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',P);const R=r.parse(C,B,x);if(!R)return null;x=x||R.type,m.push([I,R])}return me(x,Ee)||me(x,sr)||me(x,E)||me(x,V)||me(x,H(Ee))?new Mr(x,s,l,h,m):r.error(`Type ${X(x)} is not interpolatable.`)}evaluate(e){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(e);const l=this.input.evaluate(e);if(l<=r[0])return s[0].evaluate(e);const h=r.length;if(l>=r[h-1])return s[h-1].evaluate(e);const p=ds(r,l),m=Mr.interpolationFactor(this.interpolation,l,r[p],r[p+1]),x=s[p].evaluate(e),T=s[p+1].evaluate(e);switch(this.operator){case"interpolate":return Ar[this.type.kind](x,T,m);case"interpolate-hcl":return Ar.color(x,T,m,"hcl");case"interpolate-lab":return Ar.color(x,T,m,"lab")}}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function _o(i,e,r,s){const l=s-r,h=i-r;return l===0?0:e===1?h/l:(Math.pow(e,h)-1)/(Math.pow(e,l)-1)}class ya{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let s=null;const l=r.expectedType;l&&l.kind!=="value"&&(s=l);const h=[];for(const m of e.slice(1)){const x=r.parse(m,1+h.length,s,void 0,{typeAnnotation:"omit"});if(!x)return null;s=s||x.type,h.push(x)}if(!s)throw new Error("No output type");const p=l&&h.some(m=>$(l,m.type));return new ya(p?ft:s,h)}evaluate(e){let r,s=null,l=0;for(const h of this.args)if(l++,s=h.evaluate(e),s&&s instanceof Hi&&!s.available&&(r||(r=s.name),s=null,l===this.args.length&&(s=r)),s!==null)break;return s}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class xa{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const s=[];for(let h=1;h=s.length)throw new _i(`Array index out of bounds: ${r} > ${s.length-1}.`);if(r!==Math.floor(r))throw new _i(`Array index must be an integer, but found ${r} instead.`);return s[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class xo{constructor(e,r){this.type=ct,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,ft),l=r.parse(e[2],2,ft);return s&&l?Y(s.type,[ct,xt,Ee,mn,ft])?new xo(s,l):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${X(s.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!s)return!1;if(!re(r,["boolean","string","number","null"]))throw new _i(`Expected first argument to be of type boolean, string, number or null, but found ${X(di(r))} instead.`);if(!re(s,["string","array"]))throw new _i(`Expected second argument to be of type array or string, but found ${X(di(s))} instead.`);return s.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class va{constructor(e,r,s){this.type=Ee,this.needle=e,this.haystack=r,this.fromIndex=s}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,ft),l=r.parse(e[2],2,ft);if(!s||!l)return null;if(!Y(s.type,[ct,xt,Ee,mn,ft]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${X(s.type)} instead`);if(e.length===4){const h=r.parse(e[3],3,Ee);return h?new va(s,l,h):null}return new va(s,l)}evaluate(e){const r=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!re(r,["boolean","string","number","null"]))throw new _i(`Expected first argument to be of type boolean, string, number or null, but found ${X(di(r))} instead.`);if(!re(s,["string","array"]))throw new _i(`Expected second argument to be of type array or string, but found ${X(di(s))} instead.`);if(this.fromIndex){const l=this.fromIndex.evaluate(e);return s.indexOf(r,l)}return s.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class vo{constructor(e,r,s,l,h,p){this.inputType=e,this.type=r,this.input=s,this.cases=l,this.outputs=h,this.otherwise=p}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let s,l;r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);const h={},p=[];for(let T=2;TNumber.MAX_SAFE_INTEGER)return P.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof R=="number"&&Math.floor(R)!==R)return P.error("Numeric branch labels must be integer values.");if(s){if(P.checkSubtype(s,di(R)))return null}else s=di(R);if(h[String(R)]!==void 0)return P.error("Branch labels must be unique.");h[String(R)]=p.length}const B=r.parse(C,T,l);if(!B)return null;l=l||B.type,p.push(B)}const m=r.parse(e[1],1,ft);if(!m)return null;const x=r.parse(e[e.length-1],e.length-1,l);return x?m.type.kind!=="value"&&r.concat(1).checkSubtype(s,m.type)?null:new vo(s,l,m,h,p,x):null}evaluate(e){const r=this.input.evaluate(e);return(di(r)===this.inputType&&this.outputs[this.cases[r]]||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()}}class bo{constructor(e,r,s){this.type=e,this.branches=r,this.otherwise=s}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let s;r.expectedType&&r.expectedType.kind!=="value"&&(s=r.expectedType);const l=[];for(let p=1;pr.outputDefined())&&this.otherwise.outputDefined()}}class ba{constructor(e,r,s,l){this.type=e,this.input=r,this.beginIndex=s,this.endIndex=l}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,ft),l=r.parse(e[2],2,Ee);if(!s||!l)return null;if(!Y(s.type,[H(ft),xt,ft]))return r.error(`Expected first argument to be of type array or string, but found ${X(s.type)} instead`);if(e.length===4){const h=r.parse(e[3],3,Ee);return h?new ba(s.type,s,l,h):null}return new ba(s.type,s,l)}evaluate(e){const r=this.input.evaluate(e),s=this.beginIndex.evaluate(e);if(!re(r,["string","array"]))throw new _i(`Expected first argument to be of type array or string, but found ${X(di(r))} instead.`);if(this.endIndex){const l=this.endIndex.evaluate(e);return r.slice(s,l)}return r.slice(s)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Rl(i,e){return i==="=="||i==="!="?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 Fl(i,e,r,s){return s.compare(e,r)===0}function ps(i,e,r){const s=i!=="=="&&i!=="!=";return class tf{constructor(h,p,m){this.type=ct,this.lhs=h,this.rhs=p,this.collator=m,this.hasUntypedArgument=h.type.kind==="value"||p.type.kind==="value"}static parse(h,p){if(h.length!==3&&h.length!==4)return p.error("Expected two or three arguments.");const m=h[0];let x=p.parse(h[1],1,ft);if(!x)return null;if(!Rl(m,x.type))return p.concat(1).error(`"${m}" comparisons are not supported for type '${X(x.type)}'.`);let T=p.parse(h[2],2,ft);if(!T)return null;if(!Rl(m,T.type))return p.concat(2).error(`"${m}" comparisons are not supported for type '${X(T.type)}'.`);if(x.type.kind!==T.type.kind&&x.type.kind!=="value"&&T.type.kind!=="value")return p.error(`Cannot compare types '${X(x.type)}' and '${X(T.type)}'.`);s&&(x.type.kind==="value"&&T.type.kind!=="value"?x=new Nr(T.type,[x]):x.type.kind!=="value"&&T.type.kind==="value"&&(T=new Nr(x.type,[T])));let I=null;if(h.length===4){if(x.type.kind!=="string"&&T.type.kind!=="string"&&x.type.kind!=="value"&&T.type.kind!=="value")return p.error("Cannot use collator to compare non-string types.");if(I=p.parse(h[3],3,gn),!I)return null}return new tf(x,T,I)}evaluate(h){const p=this.lhs.evaluate(h),m=this.rhs.evaluate(h);if(s&&this.hasUntypedArgument){const x=di(p),T=di(m);if(x.kind!==T.kind||x.kind!=="string"&&x.kind!=="number")throw new _i(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${x.kind}, ${T.kind}) instead.`)}if(this.collator&&!s&&this.hasUntypedArgument){const x=di(p),T=di(m);if(x.kind!=="string"||T.kind!=="string")return e(h,p,m)}return this.collator?r(h,p,m,this.collator.evaluate(h)):e(h,p,m)}eachChild(h){h(this.lhs),h(this.rhs),this.collator&&h(this.collator)}outputDefined(){return!0}}}const Jc=ps("==",function(i,e,r){return e===r},Fl),Yc=ps("!=",function(i,e,r){return e!==r},function(i,e,r,s){return!Fl(0,e,r,s)}),Qc=ps("<",function(i,e,r){return e",function(i,e,r){return e>r},function(i,e,r,s){return s.compare(e,r)>0}),eu=ps("<=",function(i,e,r){return e<=r},function(i,e,r,s){return s.compare(e,r)<=0}),tu=ps(">=",function(i,e,r){return e>=r},function(i,e,r,s){return s.compare(e,r)>=0});class wo{constructor(e,r,s,l,h){this.type=xt,this.number=e,this.locale=r,this.currency=s,this.minFractionDigits=l,this.maxFractionDigits=h}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const s=r.parse(e[1],1,Ee);if(!s)return null;const l=e[2];if(typeof l!="object"||Array.isArray(l))return r.error("NumberFormat options argument must be an object.");let h=null;if(l.locale&&(h=r.parse(l.locale,1,xt),!h))return null;let p=null;if(l.currency&&(p=r.parse(l.currency,1,xt),!p))return null;let m=null;if(l["min-fraction-digits"]&&(m=r.parse(l["min-fraction-digits"],1,Ee),!m))return null;let x=null;return l["max-fraction-digits"]&&(x=r.parse(l["max-fraction-digits"],1,Ee),!x)?null:new wo(s,h,p,m,x)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.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.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class wa{constructor(e){this.type=Z,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const s=e[1];if(!Array.isArray(s)&&typeof s=="object")return r.error("First argument must be an image or text section.");const l=[];let h=!1;for(let p=1;p<=e.length-1;++p){const m=e[p];if(h&&typeof m=="object"&&!Array.isArray(m)){h=!1;let x=null;if(m["font-scale"]&&(x=r.parse(m["font-scale"],1,Ee),!x))return null;let T=null;if(m["text-font"]&&(T=r.parse(m["text-font"],1,H(xt)),!T))return null;let I=null;if(m["text-color"]&&(I=r.parse(m["text-color"],1,sr),!I))return null;const C=l[l.length-1];C.scale=x,C.font=T,C.textColor=I}else{const x=r.parse(e[p],1,ft);if(!x)return null;const T=x.type.kind;if(T!=="string"&&T!=="value"&&T!=="null"&&T!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");h=!0,l.push({content:x,scale:null,font:null,textColor:null})}}return new wa(l)}evaluate(e){return new $i(this.sections.map(r=>{const s=r.content.evaluate(e);return di(s)===D?new oa("",s,null,null,null):new oa(Ut(s),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class To{constructor(e){this.type=D,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const s=r.parse(e[1],1,xt);return s?new To(s):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),s=Hi.fromString(r);return s&&e.availableImages&&(s.available=e.availableImages.indexOf(r)>-1),s}eachChild(e){e(this.input)}outputDefined(){return!1}}class So{constructor(e){this.type=Ee,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const s=r.parse(e[1],1);return s?s.type.kind!=="array"&&s.type.kind!=="string"&&s.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${X(s.type)} instead.`):new So(s):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new _i(`Expected value to be of type string or array, but found ${X(di(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const fs={"==":Jc,"!=":Yc,">":$c,"<":Qc,">=":tu,"<=":eu,array:Nr,at:yo,boolean:Nr,case:bo,coalesce:ya,collator:ha,format:wa,image:To,in:xo,"index-of":va,interpolate:Mr,"interpolate-hcl":Mr,"interpolate-lab":Mr,length:So,let:xa,literal:qn,match:vo,number:Nr,"number-format":wo,object:Nr,slice:ba,step:Dn,string:Nr,"to-boolean":zn,"to-color":zn,"to-number":zn,"to-string":zn,var:pa,within:Zn};function Ol(i,[e,r,s,l]){e=e.evaluate(i),r=r.evaluate(i),s=s.evaluate(i);const h=l?l.evaluate(i):1,p=la(e,r,s,h);if(p)throw new _i(p);return new Wt(e/255,r/255,s/255,h,!1)}function Vl(i,e){return i in e}function Io(i,e){const r=e[i];return r===void 0?null:r}function Gn(i){return{type:i}}function Nl(i){return{result:"success",value:i}}function Ln(i){return{result:"error",value:i}}function ms(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Ul(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Ao(i){return!!i.expression&&i.expression.interpolated}function jt(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function pi(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function iu(i){return i}function Lt(i,e){const r=e.type==="color",s=i.stops&&typeof i.stops[0][0]=="object",l=s||!(s||i.property!==void 0),h=i.type||(Ao(e)?"exponential":"interval");if(r||e.type==="padding"){const I=r?Wt.parse:Ir.parse;(i=nn({},i)).stops&&(i.stops=i.stops.map(C=>[C[0],I(C[1])])),i.default=I(i.default?i.default:e.default)}if(i.colorSpace&&(p=i.colorSpace)!=="rgb"&&p!=="hcl"&&p!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var p;let m,x,T;if(h==="exponential")m=Ds;else if(h==="interval")m=ui;else if(h==="categorical"){m=fi,x=Object.create(null);for(const I of i.stops)x[I[0]]=I[1];T=typeof i.stops[0][0]}else{if(h!=="identity")throw new Error(`Unknown function type "${h}"`);m=jl}if(s){const I={},C=[];for(let R=0;RR[0]),evaluate:({zoom:R},U)=>Ds({stops:P,base:i.base},e,R).evaluate(R,U)}}if(l){const I=h==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:I,interpolationFactor:Mr.interpolationFactor.bind(void 0,I),zoomStops:i.stops.map(C=>C[0]),evaluate:({zoom:C})=>m(i,e,C,x,T)}}return{kind:"source",evaluate(I,C){const P=C&&C.properties?C.properties[i.property]:void 0;return P===void 0?Hn(i.default,e.default):m(i,e,P,x,T)}}}function Hn(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function fi(i,e,r,s,l){return Hn(typeof r===l?s[r]:void 0,i.default,e.default)}function ui(i,e,r){if(jt(r)!=="number")return Hn(i.default,e.default);const s=i.stops.length;if(s===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[s-1][0])return i.stops[s-1][1];const l=ds(i.stops.map(h=>h[0]),r);return i.stops[l][1]}function Ds(i,e,r){const s=i.base!==void 0?i.base:1;if(jt(r)!=="number")return Hn(i.default,e.default);const l=i.stops.length;if(l===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[l-1][0])return i.stops[l-1][1];const h=ds(i.stops.map(I=>I[0]),r),p=function(I,C,P,B){const R=B-P,U=I-P;return R===0?0:C===1?U/R:(Math.pow(C,U)-1)/(Math.pow(C,R)-1)}(r,s,i.stops[h][0],i.stops[h+1][0]),m=i.stops[h][1],x=i.stops[h+1][1],T=Ar[e.type]||iu;return typeof m.evaluate=="function"?{evaluate(...I){const C=m.evaluate.apply(void 0,I),P=x.evaluate.apply(void 0,I);if(C!==void 0&&P!==void 0)return T(C,P,p,i.colorSpace)}}:T(m,x,p,i.colorSpace)}function jl(i,e,r){switch(e.type){case"color":r=Wt.parse(r);break;case"formatted":r=$i.fromString(r.toString());break;case"resolvedImage":r=Hi.fromString(r.toString());break;case"padding":r=Ir.parse(r);break;default:jt(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return Hn(r,i.default,e.default)}Ur.register(fs,{error:[{kind:"error"},[xt],(i,[e])=>{throw new _i(e.evaluate(i))}],typeof:[xt,[ft],(i,[e])=>X(di(e.evaluate(i)))],"to-rgba":[H(Ee,4),[sr],(i,[e])=>{const[r,s,l,h]=e.evaluate(i).rgb;return[255*r,255*s,255*l,h]}],rgb:[sr,[Ee,Ee,Ee],Ol],rgba:[sr,[Ee,Ee,Ee,Ee],Ol],has:{type:ct,overloads:[[[xt],(i,[e])=>Vl(e.evaluate(i),i.properties())],[[xt,sn],(i,[e,r])=>Vl(e.evaluate(i),r.evaluate(i))]]},get:{type:ft,overloads:[[[xt],(i,[e])=>Io(e.evaluate(i),i.properties())],[[xt,sn],(i,[e,r])=>Io(e.evaluate(i),r.evaluate(i))]]},"feature-state":[ft,[xt],(i,[e])=>Io(e.evaluate(i),i.featureState||{})],properties:[sn,[],i=>i.properties()],"geometry-type":[xt,[],i=>i.geometryType()],id:[ft,[],i=>i.id()],zoom:[Ee,[],i=>i.globals.zoom],"heatmap-density":[Ee,[],i=>i.globals.heatmapDensity||0],"line-progress":[Ee,[],i=>i.globals.lineProgress||0],accumulated:[ft,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[Ee,Gn(Ee),(i,e)=>{let r=0;for(const s of e)r+=s.evaluate(i);return r}],"*":[Ee,Gn(Ee),(i,e)=>{let r=1;for(const s of e)r*=s.evaluate(i);return r}],"-":{type:Ee,overloads:[[[Ee,Ee],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[Ee],(i,[e])=>-e.evaluate(i)]]},"/":[Ee,[Ee,Ee],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[Ee,[Ee,Ee],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[Ee,[],()=>Math.LN2],pi:[Ee,[],()=>Math.PI],e:[Ee,[],()=>Math.E],"^":[Ee,[Ee,Ee],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[Ee,[Ee],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[Ee,[Ee],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[Ee,[Ee],(i,[e])=>Math.log(e.evaluate(i))],log2:[Ee,[Ee],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[Ee,[Ee],(i,[e])=>Math.sin(e.evaluate(i))],cos:[Ee,[Ee],(i,[e])=>Math.cos(e.evaluate(i))],tan:[Ee,[Ee],(i,[e])=>Math.tan(e.evaluate(i))],asin:[Ee,[Ee],(i,[e])=>Math.asin(e.evaluate(i))],acos:[Ee,[Ee],(i,[e])=>Math.acos(e.evaluate(i))],atan:[Ee,[Ee],(i,[e])=>Math.atan(e.evaluate(i))],min:[Ee,Gn(Ee),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[Ee,Gn(Ee),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[Ee,[Ee],(i,[e])=>Math.abs(e.evaluate(i))],round:[Ee,[Ee],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ee,[Ee],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[Ee,[Ee],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[ct,[xt,ft],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[ct,[ft],(i,[e])=>i.id()===e.value],"filter-type-==":[ct,[xt],(i,[e])=>i.geometryType()===e.value],"filter-<":[ct,[xt,ft],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s{const r=i.id(),s=e.value;return typeof r==typeof s&&r":[ct,[xt,ft],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s>l}],"filter-id->":[ct,[ft],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r>s}],"filter-<=":[ct,[xt,ft],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s<=l}],"filter-id-<=":[ct,[ft],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r<=s}],"filter->=":[ct,[xt,ft],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s>=l}],"filter-id->=":[ct,[ft],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r>=s}],"filter-has":[ct,[ft],(i,[e])=>e.value in i.properties()],"filter-has-id":[ct,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[ct,[H(xt)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[ct,[H(ft)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[ct,[xt,H(ft)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[ct,[xt,H(ft)],(i,[e,r])=>function(s,l,h,p){for(;h<=p;){const m=h+p>>1;if(l[m]===s)return!0;l[m]>s?p=m-1:h=m+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:ct,overloads:[[[ct,ct],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[Gn(ct),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:ct,overloads:[[[ct,ct],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[Gn(ct),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[ct,[ct],(i,[e])=>!e.evaluate(i)],"is-supported-script":[ct,[xt],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[xt,[xt],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[xt,[xt],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[xt,Gn(ft),(i,e)=>e.map(r=>Ut(r.evaluate(i))).join("")],"resolved-locale":[xt,[gn],(i,[e])=>e.evaluate(i).resolvedLocale()]});class Mo{constructor(e,r){var s;this.expression=e,this._warningHistory={},this._evaluator=new uo,this._defaultValue=r?(s=r).type==="color"&&pi(s.default)?new Wt(0,0,0,0):s.type==="color"?Wt.parse(s.default)||null:s.type==="padding"?Ir.parse(s.default)||null:s.type==="variableAnchorOffsetCollection"?Vr.parse(s.default)||null:s.default===void 0?null:s.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,s,l,h,p){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=s,this._evaluator.canonical=l,this._evaluator.availableImages=h||null,this._evaluator.formattedSection=p,this.expression.evaluate(this._evaluator)}evaluate(e,r,s,l,h,p){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=s||null,this._evaluator.canonical=l,this._evaluator.availableImages=h||null,this._evaluator.formattedSection=p||null;try{const m=this.expression.evaluate(this._evaluator);if(m==null||typeof m=="number"&&m!=m)return this._defaultValue;if(this._enumValues&&!(m in this._enumValues))throw new _i(`Expected value to be one of ${Object.keys(this._enumValues).map(x=>JSON.stringify(x)).join(", ")}, but found ${JSON.stringify(m)} instead.`);return m}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}}}function Ta(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in fs}function Sa(i,e){const r=new ua(fs,fa,[],e?function(l){const h={color:sr,string:xt,number:Ee,enum:xt,boolean:ct,formatted:Z,padding:E,resolvedImage:D,variableAnchorOffsetCollection:V};return l.type==="array"?H(h[l.value]||ft,l.length):h[l.type]}(e):void 0),s=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return s?Nl(new Mo(s,e)):Ln(r.errors)}class ko{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!Ps(r.expression)}evaluateWithoutErrorHandling(e,r,s,l,h,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,s,l,h,p)}evaluate(e,r,s,l,h,p){return this._styleExpression.evaluate(e,r,s,l,h,p)}}class Ia{constructor(e,r,s,l){this.kind=e,this.zoomStops=s,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!Ps(r.expression),this.interpolationType=l}evaluateWithoutErrorHandling(e,r,s,l,h,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,s,l,h,p)}evaluate(e,r,s,l,h,p){return this._styleExpression.evaluate(e,r,s,l,h,p)}interpolationFactor(e,r,s){return this.interpolationType?Mr.interpolationFactor(this.interpolationType,e,r,s):0}}function Co(i,e){const r=Sa(i,e);if(r.result==="error")return r;const s=r.value.expression,l=ma(s);if(!l&&!ms(e))return Ln([new gi("","data expressions not supported")]);const h=ga(s,["zoom"]);if(!h&&!Ul(e))return Ln([new gi("","zoom expressions not supported")]);const p=Bs(s);return p||h?p instanceof gi?Ln([p]):p instanceof Mr&&!Ao(e)?Ln([new gi("",'"interpolate" expressions cannot be used with this property')]):Nl(p?new Ia(l?"camera":"composite",r.value,p.labels,p instanceof Mr?p.interpolation:void 0):new ko(l?"constant":"source",r.value)):Ln([new gi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ls{constructor(e,r){this._parameters=e,this._specification=r,nn(this,Lt(this._parameters,this._specification))}static deserialize(e){return new Ls(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Bs(i){let e=null;if(i instanceof xa)e=Bs(i.result);else if(i instanceof ya){for(const r of i.args)if(e=Bs(r),e)break}else(i instanceof Dn||i instanceof Mr)&&i.input instanceof Ur&&i.input.name==="zoom"&&(e=i);return e instanceof gi||i.eachChild(r=>{const s=Bs(r);s instanceof gi?e=s:!e&&s?e=new gi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&s&&e!==s&&(e=new gi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Rs(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!Rs(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const ru={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Eo(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Rs(i)||(i=Aa(i));const e=Sa(i,ru);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,s,l)=>e.value.evaluate(r,s,{},l),needGeometry:ql(i)}}function nu(i,e){return ie?1:0}function ql(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?zo(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(Aa))):e==="all"?["all"].concat(i.slice(1).map(Aa)):e==="none"?["all"].concat(i.slice(1).map(Aa).map(Fs)):e==="in"?Zl(i[1],i.slice(2)):e==="!in"?Fs(Zl(i[1],i.slice(2))):e==="has"?Gl(i[1]):e==="!has"?Fs(Gl(i[1])):e!=="within"||i;var r}function zo(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function Zl(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",i,["literal",e.sort(nu)]]:["filter-in-small",i,["literal",e]]}}function Gl(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Fs(i){return["!",i]}function Ma(i){const e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let l="[";for(const h of i)l+=`${Ma(h)},`;return`${l}]`}const r=Object.keys(i).sort();let s="{";for(let l=0;ls.maximum?[new ke(e,r,`${r} is greater than the maximum value ${s.maximum}`)]:[]}function Ca(i){const e=i.valueSpec,r=yi(i.value.type);let s,l,h,p={};const m=r!=="categorical"&&i.value.property===void 0,x=!m,T=jt(i.value.stops)==="array"&&jt(i.value.stops[0])==="array"&&jt(i.value.stops[0][0])==="object",I=fr({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(B){if(r==="identity")return[new ke(B.key,B.value,'identity function may not have a "stops" property')];let R=[];const U=B.value;return R=R.concat(gs({key:B.key,value:U,valueSpec:B.valueSpec,validateSpec:B.validateSpec,style:B.style,styleSpec:B.styleSpec,arrayElementValidator:C})),jt(U)==="array"&&U.length===0&&R.push(new ke(B.key,U,"array must have at least one stop")),R},default:function(B){return B.validateSpec({key:B.key,value:B.value,valueSpec:e,validateSpec:B.validateSpec,style:B.style,styleSpec:B.styleSpec})}}});return r==="identity"&&m&&I.push(new ke(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||I.push(new ke(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!Ao(i.valueSpec)&&I.push(new ke(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(x&&!ms(i.valueSpec)?I.push(new ke(i.key,i.value,"property functions not supported")):m&&!Ul(i.valueSpec)&&I.push(new ke(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!T||i.value.property!==void 0||I.push(new ke(i.key,i.value,'"property" property is required')),I;function C(B){let R=[];const U=B.value,W=B.key;if(jt(U)!=="array")return[new ke(W,U,`array expected, ${jt(U)} found`)];if(U.length!==2)return[new ke(W,U,`array length 2 expected, length ${U.length} found`)];if(T){if(jt(U[0])!=="object")return[new ke(W,U,`object expected, ${jt(U[0])} found`)];if(U[0].zoom===void 0)return[new ke(W,U,"object stop key must have zoom")];if(U[0].value===void 0)return[new ke(W,U,"object stop key must have value")];if(h&&h>yi(U[0].zoom))return[new ke(W,U[0].zoom,"stop zoom values must appear in ascending order")];yi(U[0].zoom)!==h&&(h=yi(U[0].zoom),l=void 0,p={}),R=R.concat(fr({key:`${W}[0]`,value:U[0],valueSpec:{zoom:{}},validateSpec:B.validateSpec,style:B.style,styleSpec:B.styleSpec,objectElementValidators:{zoom:Os,value:P}}))}else R=R.concat(P({key:`${W}[0]`,value:U[0],valueSpec:{},validateSpec:B.validateSpec,style:B.style,styleSpec:B.styleSpec},U));return Ta(Wn(U[1]))?R.concat([new ke(`${W}[1]`,U[1],"expressions are not allowed in function stops.")]):R.concat(B.validateSpec({key:`${W}[1]`,value:U[1],valueSpec:e,validateSpec:B.validateSpec,style:B.style,styleSpec:B.styleSpec}))}function P(B,R){const U=jt(B.value),W=yi(B.value),J=B.value!==null?B.value:R;if(s){if(U!==s)return[new ke(B.key,J,`${U} stop domain type must match previous stop domain type ${s}`)]}else s=U;if(U!=="number"&&U!=="string"&&U!=="boolean")return[new ke(B.key,J,"stop domain value must be a number, string, or boolean")];if(U!=="number"&&r!=="categorical"){let se=`number expected, ${U} found`;return ms(e)&&r===void 0&&(se+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ke(B.key,J,se)]}return r!=="categorical"||U!=="number"||isFinite(W)&&Math.floor(W)===W?r!=="categorical"&&U==="number"&&l!==void 0&&Wnew ke(`${i.key}${s.key}`,i.value,s.message));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new ke(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!Ps(r))return[new ke(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!Ps(r))return[new ke(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!ga(r,["zoom","feature-state"]))return[new ke(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!ma(r))return[new ke(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Vs(i){const e=i.key,r=i.value,s=i.valueSpec,l=[];return Array.isArray(s.values)?s.values.indexOf(yi(r))===-1&&l.push(new ke(e,r,`expected one of [${s.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(s.values).indexOf(yi(r))===-1&&l.push(new ke(e,r,`expected one of [${Object.keys(s.values).join(", ")}], ${JSON.stringify(r)} found`)),l}function _s(i){return Rs(Wn(i.value))?Xn(nn({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Wl(i)}function Wl(i){const e=i.value,r=i.key;if(jt(e)!=="array")return[new ke(r,e,`array expected, ${jt(e)} found`)];const s=i.styleSpec;let l,h=[];if(e.length<1)return[new ke(r,e,"filter array must have at least 1 element")];switch(h=h.concat(Vs({key:`${r}[0]`,value:e[0],valueSpec:s.filter_operator,style:i.style,styleSpec:i.styleSpec})),yi(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&yi(e[1])==="$type"&&h.push(new ke(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&h.push(new ke(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(l=jt(e[1]),l!=="string"&&h.push(new ke(`${r}[1]`,e[1],`string expected, ${l} found`)));for(let p=2;p{T in r&&e.push(new ke(s,r[T],`"${T}" is prohibited for ref layers`))}),l.layers.forEach(T=>{yi(T.id)===m&&(x=T)}),x?x.ref?e.push(new ke(s,r.ref,"ref cannot reference another ref layer")):p=yi(x.type):e.push(new ke(s,r.ref,`ref layer "${m}" not found`))}else if(p!=="background")if(r.source){const x=l.sources&&l.sources[r.source],T=x&&yi(x.type);x?T==="vector"&&p==="raster"?e.push(new ke(s,r.source,`layer "${r.id}" requires a raster source`)):T!=="raster-dem"&&p==="hillshade"?e.push(new ke(s,r.source,`layer "${r.id}" requires a raster-dem source`)):T==="raster"&&p!=="raster"?e.push(new ke(s,r.source,`layer "${r.id}" requires a vector source`)):T!=="vector"||r["source-layer"]?T==="raster-dem"&&p!=="hillshade"?e.push(new ke(s,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):p!=="line"||!r.paint||!r.paint["line-gradient"]||T==="geojson"&&x.lineMetrics||e.push(new ke(s,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new ke(s,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new ke(s,r.source,`source "${r.source}" not found`))}else e.push(new ke(s,r,'missing required property "source"'));return e=e.concat(fr({key:s,value:r,valueSpec:h.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${s}.type`,value:r.type,valueSpec:h.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:_s,layout:x=>fr({layer:r,key:x.key,value:x.value,style:x.style,styleSpec:x.styleSpec,validateSpec:x.validateSpec,objectElementValidators:{"*":T=>Jl(nn({layerType:p},T))}}),paint:x=>fr({layer:r,key:x.key,value:x.value,style:x.style,styleSpec:x.styleSpec,validateSpec:x.validateSpec,objectElementValidators:{"*":T=>Kl(nn({layerType:p},T))}})}})),e}function an(i){const e=i.value,r=i.key,s=jt(e);return s!=="string"?[new ke(r,e,`string expected, ${s} found`)]:[]}const Ns={promoteId:function({key:i,value:e}){if(jt(e)==="string")return an({key:i,value:e});{const r=[];for(const s in e)r.push(...an({key:`${i}.${s}`,value:e[s]}));return r}}};function kr(i){const e=i.value,r=i.key,s=i.styleSpec,l=i.style,h=i.validateSpec;if(!e.type)return[new ke(r,e,'"type" is required')];const p=yi(e.type);let m;switch(p){case"vector":case"raster":return m=fr({key:r,value:e,valueSpec:s[`source_${p.replace("-","_")}`],style:i.style,styleSpec:s,objectElementValidators:Ns,validateSpec:h}),m;case"raster-dem":return m=function(x){var T;const I=(T=x.sourceName)!==null&&T!==void 0?T:"",C=x.value,P=x.styleSpec,B=P.source_raster_dem,R=x.style;let U=[];const W=jt(C);if(C===void 0)return U;if(W!=="object")return U.push(new ke("source_raster_dem",C,`object expected, ${W} found`)),U;const J=yi(C.encoding)==="custom",se=["redFactor","greenFactor","blueFactor","baseShift"],Q=x.value.encoding?`"${x.value.encoding}"`:"Default";for(const oe in C)!J&&se.includes(oe)?U.push(new ke(oe,C[oe],`In "${I}": "${oe}" is only valid when "encoding" is set to "custom". ${Q} encoding found`)):B[oe]?U=U.concat(x.validateSpec({key:oe,value:C[oe],valueSpec:B[oe],validateSpec:x.validateSpec,style:R,styleSpec:P})):U.push(new ke(oe,C[oe],`unknown property "${oe}"`));return U}({sourceName:r,value:e,style:i.style,styleSpec:s,validateSpec:h}),m;case"geojson":if(m=fr({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s,validateSpec:h,objectElementValidators:Ns}),e.cluster)for(const x in e.clusterProperties){const[T,I]=e.clusterProperties[x],C=typeof T=="string"?[T,["accumulated"],["get",x]]:T;m.push(...Xn({key:`${r}.${x}.map`,value:I,validateSpec:h,expressionContext:"cluster-map"})),m.push(...Xn({key:`${r}.${x}.reduce`,value:C,validateSpec:h,expressionContext:"cluster-reduce"}))}return m;case"video":return fr({key:r,value:e,valueSpec:s.source_video,style:l,validateSpec:h,styleSpec:s});case"image":return fr({key:r,value:e,valueSpec:s.source_image,style:l,validateSpec:h,styleSpec:s});case"canvas":return[new ke(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Vs({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:l,validateSpec:h,styleSpec:s})}}function Us(i){const e=i.value,r=i.styleSpec,s=r.light,l=i.style;let h=[];const p=jt(e);if(e===void 0)return h;if(p!=="object")return h=h.concat([new ke("light",e,`object expected, ${p} found`)]),h;for(const m in e){const x=m.match(/^(.*)-transition$/);h=h.concat(x&&s[x[1]]&&s[x[1]].transition?i.validateSpec({key:m,value:e[m],valueSpec:r.transition,validateSpec:i.validateSpec,style:l,styleSpec:r}):s[m]?i.validateSpec({key:m,value:e[m],valueSpec:s[m],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new ke(m,e[m],`unknown property "${m}"`)])}return h}function Ql(i){const e=i.value,r=i.styleSpec,s=r.terrain,l=i.style;let h=[];const p=jt(e);if(e===void 0)return h;if(p!=="object")return h=h.concat([new ke("terrain",e,`object expected, ${p} found`)]),h;for(const m in e)h=h.concat(s[m]?i.validateSpec({key:m,value:e[m],valueSpec:s[m],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new ke(m,e[m],`unknown property "${m}"`)]);return h}function $l(i){let e=[];const r=i.value,s=i.key;if(Array.isArray(r)){const l=[],h=[];for(const p in r)r[p].id&&l.includes(r[p].id)&&e.push(new ke(s,r,`all the sprites' ids must be unique, but ${r[p].id} is duplicated`)),l.push(r[p].id),r[p].url&&h.includes(r[p].url)&&e.push(new ke(s,r,`all the sprites' URLs must be unique, but ${r[p].url} is duplicated`)),h.push(r[p].url),e=e.concat(fr({key:`${s}[${p}]`,value:r[p],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return an({key:s,value:r})}const ec={"*":()=>[],array:gs,boolean:function(i){const e=i.value,r=i.key,s=jt(e);return s!=="boolean"?[new ke(r,e,`boolean expected, ${s} found`)]:[]},number:Os,color:function(i){const e=i.key,r=i.value,s=jt(r);return s!=="string"?[new ke(e,r,`color expected, ${s} found`)]:Wt.parse(String(r))?[]:[new ke(e,r,`color expected, "${r}" found`)]},constants:Hl,enum:Vs,filter:_s,function:Ca,layer:Yl,object:fr,source:kr,light:Us,terrain:Ql,string:an,formatted:function(i){return an(i).length===0?[]:Xn(i)},resolvedImage:function(i){return an(i).length===0?[]:Xn(i)},padding:function(i){const e=i.key,r=i.value;if(jt(r)==="array"){if(r.length<1||r.length>4)return[new ke(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const s={type:"number"};let l=[];for(let h=0;h[]}})),i.constants&&(r=r.concat(Hl({key:"constants",value:i.constants,style:i,styleSpec:e,validateSpec:_n}))),Ea(r)}function yn(i){return function(e){return i({...e,validateSpec:_n})}}function Ea(i){return[].concat(i).sort((e,r)=>e.line-r.line)}function xn(i){return function(...e){return Ea(i.apply(this,e))}}jr.source=xn(yn(kr)),jr.sprite=xn(yn($l)),jr.glyphs=xn(yn(tc)),jr.light=xn(yn(Us)),jr.terrain=xn(yn(Ql)),jr.layer=xn(yn(Yl)),jr.filter=xn(yn(_s)),jr.paintProperty=xn(yn(Kl)),jr.layoutProperty=xn(yn(Jl));const vn=jr,su=vn.light,Po=vn.paintProperty,ic=vn.layoutProperty;function za(i,e){let r=!1;if(e&&e.length)for(const s of e)i.fire(new Zi(new Error(s.message))),r=!0;return r}class ys{constructor(e,r,s){const l=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const p=new Int32Array(this.arrayBuffer);e=p[0],this.d=(r=p[1])+2*(s=p[2]);for(let x=0;x=C[R+0]&&l>=C[R+1])?(m[B]=!0,p.push(I[B])):m[B]=!1}}}}_forEachCell(e,r,s,l,h,p,m,x){const T=this._convertToCellCoord(e),I=this._convertToCellCoord(r),C=this._convertToCellCoord(s),P=this._convertToCellCoord(l);for(let B=T;B<=C;B++)for(let R=I;R<=P;R++){const U=this.d*R+B;if((!x||x(this._convertFromCellCoord(B),this._convertFromCellCoord(R),this._convertFromCellCoord(B+1),this._convertFromCellCoord(R+1)))&&h.call(this,e,r,s,l,U,p,m,x))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,r=3+this.cells.length+1+1;let s=0;for(let p=0;p=0)continue;const p=i[h];l[h]=bn[s].shallow.indexOf(h)>=0?p:Bn(p,e)}i instanceof Error&&(l.message=i.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return s!=="Object"&&(l.$name=s),l}throw new Error("can't serialize object of type "+typeof i)}function xs(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||Pa(i)||Ji(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(xs);if(typeof i=="object"){const e=i.$name||"Object";if(!bn[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=bn[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);const s=Object.create(r.prototype);for(const l of Object.keys(i)){if(l==="$name")continue;const h=i[l];s[l]=bn[e].shallow.indexOf(l)>=0?h:xs(h)}return s}throw new Error("can't deserialize object of type "+typeof i)}class rc{constructor(){this.first=!0}update(e,r){const s=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=s,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=s,!0):(this.lastFloorZoom>s?(this.lastIntegerZoom=s+1,this.lastIntegerZoomTime=r):this.lastFloorZoomi>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function Do(i){for(const e of i)if(Bo(e.charCodeAt(0)))return!0;return!1}function Lo(i){for(const e of i)if(!au(e.charCodeAt(0)))return!1;return!0}function au(i){return!(Le.Arabic(i)||Le["Arabic Supplement"](i)||Le["Arabic Extended-A"](i)||Le["Arabic Presentation Forms-A"](i)||Le["Arabic Presentation Forms-B"](i))}function Bo(i){return!(i!==746&&i!==747&&(i<4352||!(Le["Bopomofo Extended"](i)||Le.Bopomofo(i)||Le["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||Le["CJK Compatibility Ideographs"](i)||Le["CJK Compatibility"](i)||Le["CJK Radicals Supplement"](i)||Le["CJK Strokes"](i)||!(!Le["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||Le["CJK Unified Ideographs Extension A"](i)||Le["CJK Unified Ideographs"](i)||Le["Enclosed CJK Letters and Months"](i)||Le["Hangul Compatibility Jamo"](i)||Le["Hangul Jamo Extended-A"](i)||Le["Hangul Jamo Extended-B"](i)||Le["Hangul Jamo"](i)||Le["Hangul Syllables"](i)||Le.Hiragana(i)||Le["Ideographic Description Characters"](i)||Le.Kanbun(i)||Le["Kangxi Radicals"](i)||Le["Katakana Phonetic Extensions"](i)||Le.Katakana(i)&&i!==12540||!(!Le["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!Le["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||Le["Unified Canadian Aboriginal Syllabics"](i)||Le["Unified Canadian Aboriginal Syllabics Extended"](i)||Le["Vertical Forms"](i)||Le["Yijing Hexagram Symbols"](i)||Le["Yi Syllables"](i)||Le["Yi Radicals"](i))))}function nc(i){return!(Bo(i)||function(e){return!!(Le["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Le["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)||Le["Letterlike Symbols"](e)||Le["Number Forms"](e)||Le["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)||Le["Control Pictures"](e)&&e!==9251||Le["Optical Character Recognition"](e)||Le["Enclosed Alphanumerics"](e)||Le["Geometric Shapes"](e)||Le["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Le["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Le["CJK Symbols and Punctuation"](e)||Le.Katakana(e)||Le["Private Use Area"](e)||Le["CJK Compatibility Forms"](e)||Le["Small Form Variants"](e)||Le["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}function sc(i){return i>=1424&&i<=2303||Le["Arabic Presentation Forms-A"](i)||Le["Arabic Presentation Forms-B"](i)}function ac(i,e){return!(!e&&sc(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||Le.Khmer(i))}function ou(i){for(const e of i)if(sc(e.charCodeAt(0)))return!0;return!1}const Ro="deferred",Fo="loading",Oo="loaded";let Vo=null,mr="unavailable",Rn=null;const js=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(mr="error"),Vo&&Vo(i)};function No(){qs.fire(new Pi("pluginStateChange",{pluginStatus:mr,pluginURL:Rn}))}const qs=new tn,Uo=function(){return mr},oc=function(){if(mr!==Ro||!Rn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");mr=Fo,No(),Rn&&ue({url:Rn},i=>{i?js(i):(mr=Oo,No())})},Cr={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>mr===Oo||Cr.applyArabicShaping!=null,isLoading:()=>mr===Fo,setState(i){if(!Ht())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");mr=i.pluginStatus,Rn=i.pluginURL},isParsed(){if(!Ht())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Cr.applyArabicShaping!=null&&Cr.processBidirectionalText!=null&&Cr.processStyledBidirectionalText!=null},getPluginURL(){if(!Ht())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Rn}};class si{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new rc,this.transition={})}isSupportedScript(e){return function(r,s){for(const l of r)if(!ac(l.charCodeAt(0),s))return!1;return!0}(e,Cr.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,r=e-Math.floor(e),s=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*s}:{fromScale:.5,toScale:1,t:1-(1-s)*r}}}class Da{constructor(e,r){this.property=e,this.value=r,this.expression=function(s,l){if(pi(s))return new Ls(s,l);if(Ta(s)){const h=Co(s,l);if(h.result==="error")throw new Error(h.value.map(p=>`${p.key}: ${p.message}`).join(", "));return h.value}{let h=s;return l.type==="color"&&typeof s=="string"?h=Wt.parse(s):l.type!=="padding"||typeof s!="number"&&!Array.isArray(s)?l.type==="variableAnchorOffsetCollection"&&Array.isArray(s)&&(h=Vr.parse(s)):h=Ir.parse(s),{kind:"constant",evaluate:()=>h}}}(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,s){return this.property.possiblyEvaluate(this,e,r,s)}}class jo{constructor(e){this.property=e,this.value=new Da(e,void 0)}transitioned(e,r){return new cc(this.property,this.value,r,dt({},e.transition,this.transition),e.now)}untransitioned(){return new cc(this.property,this.value,null,{},0)}}class lc{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return rt(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new jo(this._values[e].property)),this._values[e].value=new Da(this._values[e].property,r===null?void 0:rt(r))}getTransition(e){return rt(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new jo(this._values[e].property)),this._values[e].transition=rt(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(e[r]=s);const l=this.getTransition(r);l!==void 0&&(e[`${r}-transition`]=l)}return e}transitioned(e,r){const s=new uc(this._properties);for(const l of Object.keys(this._values))s._values[l]=this._values[l].transitioned(e,r._values[l]);return s}untransitioned(){const e=new uc(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class cc{constructor(e,r,s,l,h){this.property=e,this.value=r,this.begin=h+l.delay||0,this.end=this.begin+l.duration||0,e.specification.transition&&(l.delay||l.duration)&&(this.prior=s)}possiblyEvaluate(e,r,s){const l=e.now||0,h=this.value.possiblyEvaluate(e,r,s),p=this.prior;if(p){if(l>this.end)return this.prior=null,h;if(this.value.isDataDriven())return this.prior=null,h;if(l=1)return 1;const T=x*x,I=T*x;return 4*(x<.5?I:3*(x-T)+I-.75)}(m))}}return h}}class uc{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,s){const l=new La(this._properties);for(const h of Object.keys(this._values))l._values[h]=this._values[h].possiblyEvaluate(e,r,s);return l}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class lu{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return rt(this._values[e].value)}setValue(e,r){this._values[e]=new Da(this._values[e].property,r===null?void 0:rt(r))}serialize(){const e={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(e[r]=s)}return e}possiblyEvaluate(e,r,s){const l=new La(this._properties);for(const h of Object.keys(this._values))l._values[h]=this._values[h].possiblyEvaluate(e,r,s);return l}}class ar{constructor(e,r,s){this.property=e,this.value=r,this.parameters=s}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,s,l){return this.property.evaluate(this.value,this.parameters,e,r,s,l)}}class La{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Ze{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,s){const l=Ar[this.specification.type];return l?l(e,r,s):e}}class tt{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,s,l){return new ar(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},s,l)}:e.expression,r)}interpolate(e,r,s){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new ar(this,{kind:"constant",value:void 0},e.parameters);const l=Ar[this.specification.type];if(l){const h=l(e.value.value,r.value.value,s);return new ar(this,{kind:"constant",value:h},e.parameters)}return e}evaluate(e,r,s,l,h,p){return e.kind==="constant"?e.value:e.evaluate(r,s,l,h,p)}}class Zs extends tt{possiblyEvaluate(e,r,s,l){if(e.value===void 0)return new ar(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){const h=e.expression.evaluate(r,null,{},s,l),p=e.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,m=this._calculate(p,p,p,r);return new ar(this,{kind:"constant",value:m},r)}if(e.expression.kind==="camera"){const h=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new ar(this,{kind:"constant",value:h},r)}return new ar(this,e.expression,r)}evaluate(e,r,s,l,h,p){if(e.kind==="source"){const m=e.evaluate(r,s,l,h,p);return this._calculate(m,m,m,r)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},s,l),e.evaluate({zoom:Math.floor(r.zoom)},s,l),e.evaluate({zoom:Math.floor(r.zoom)+1},s,l),r):e.value}_calculate(e,r,s,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:s,to:r}}interpolate(e){return e}}class qo{constructor(e){this.specification=e}possiblyEvaluate(e,r,s,l){if(e.value!==void 0){if(e.expression.kind==="constant"){const h=e.expression.evaluate(r,null,{},s,l);return this._calculate(h,h,h,r)}return this._calculate(e.expression.evaluate(new si(Math.floor(r.zoom-1),r)),e.expression.evaluate(new si(Math.floor(r.zoom),r)),e.expression.evaluate(new si(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,s,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:s,to:r}}interpolate(e){return e}}class Zo{constructor(e){this.specification=e}possiblyEvaluate(e,r,s,l){return!!e.expression.evaluate(r,null,{},s,l)}interpolate(){return!1}}class Ii{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){const s=e[r];s.specification.overridable&&this.overridableProperties.push(r);const l=this.defaultPropertyValues[r]=new Da(s,void 0),h=this.defaultTransitionablePropertyValues[r]=new jo(s);this.defaultTransitioningPropertyValues[r]=h.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=l.possiblyEvaluate({})}}}Re("DataDrivenProperty",tt),Re("DataConstantProperty",Ze),Re("CrossFadedDataDrivenProperty",Zs),Re("CrossFadedProperty",qo),Re("ColorRampProperty",Zo);const Go="-transition";class qr extends tn{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new lu(r.layout)),r.paint)){this._transitionablePaint=new lc(r.paint);for(const s in e.paint)this.setPaintProperty(s,e.paint[s],{validate:!1});for(const s in e.layout)this.setLayoutProperty(s,e.layout[s],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new La(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,s={}){r!=null&&this._validate(ic,`layers.${this.id}.layout.${e}`,e,r,s)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith(Go)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,s={}){if(r!=null&&this._validate(Po,`layers.${this.id}.paint.${e}`,e,r,s))return!1;if(e.endsWith(Go))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{const l=this._transitionablePaint._values[e],h=l.property.specification["property-type"]==="cross-faded-data-driven",p=l.value.isDataDriven(),m=l.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const x=this._transitionablePaint._values[e].value;return x.isDataDriven()||p||h||this._handleOverridablePaintPropertyUpdate(e,m,x)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,s){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,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),ve(e,(r,s)=>!(r===void 0||s==="layout"&&!Object.keys(r).length||s==="paint"&&!Object.keys(r).length))}_validate(e,r,s,l,h={}){return(!h||h.validate!==!1)&&za(this,e.call(vn,{key:r,layerType:this.type,objectKey:s,value:l,styleSpec:fe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof ar&&ms(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const hc={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Kn{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class xi{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_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 r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function mi(i,e=1){let r=0,s=0;return{members:i.map(l=>{const h=hc[l.type].BYTES_PER_ELEMENT,p=r=vs(r,Math.max(e,h)),m=l.components||1;return s=Math.max(s,h),r+=h*m,{name:l.name,type:l.type,components:m,offset:p}}),size:vs(r,Math.max(s,e)),alignment:e}}function vs(i,e){return Math.ceil(i/e)*e}class Gs extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const l=2*e;return this.int16[l+0]=r,this.int16[l+1]=s,e}}Gs.prototype.bytesPerElement=4,Re("StructArrayLayout2i4",Gs);class Hs extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const h=3*e;return this.int16[h+0]=r,this.int16[h+1]=s,this.int16[h+2]=l,e}}Hs.prototype.bytesPerElement=6,Re("StructArrayLayout3i6",Hs);class Jn extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l){const h=this.length;return this.resize(h+1),this.emplace(h,e,r,s,l)}emplace(e,r,s,l,h){const p=4*e;return this.int16[p+0]=r,this.int16[p+1]=s,this.int16[p+2]=l,this.int16[p+3]=h,e}}Jn.prototype.bytesPerElement=8,Re("StructArrayLayout4i8",Jn);class Ho extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,h,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,s,l,h,p)}emplace(e,r,s,l,h,p,m){const x=6*e;return this.int16[x+0]=r,this.int16[x+1]=s,this.int16[x+2]=l,this.int16[x+3]=h,this.int16[x+4]=p,this.int16[x+5]=m,e}}Ho.prototype.bytesPerElement=12,Re("StructArrayLayout2i4i12",Ho);class Wo extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,h,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,s,l,h,p)}emplace(e,r,s,l,h,p,m){const x=4*e,T=8*e;return this.int16[x+0]=r,this.int16[x+1]=s,this.uint8[T+4]=l,this.uint8[T+5]=h,this.uint8[T+6]=p,this.uint8[T+7]=m,e}}Wo.prototype.bytesPerElement=8,Re("StructArrayLayout2i4ub8",Wo);class bs extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const l=2*e;return this.float32[l+0]=r,this.float32[l+1]=s,e}}bs.prototype.bytesPerElement=8,Re("StructArrayLayout2f8",bs);class Xo extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,h,p,m,x,T,I){const C=this.length;return this.resize(C+1),this.emplace(C,e,r,s,l,h,p,m,x,T,I)}emplace(e,r,s,l,h,p,m,x,T,I,C){const P=10*e;return this.uint16[P+0]=r,this.uint16[P+1]=s,this.uint16[P+2]=l,this.uint16[P+3]=h,this.uint16[P+4]=p,this.uint16[P+5]=m,this.uint16[P+6]=x,this.uint16[P+7]=T,this.uint16[P+8]=I,this.uint16[P+9]=C,e}}Xo.prototype.bytesPerElement=20,Re("StructArrayLayout10ui20",Xo);class Ko extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,h,p,m,x,T,I,C,P){const B=this.length;return this.resize(B+1),this.emplace(B,e,r,s,l,h,p,m,x,T,I,C,P)}emplace(e,r,s,l,h,p,m,x,T,I,C,P,B){const R=12*e;return this.int16[R+0]=r,this.int16[R+1]=s,this.int16[R+2]=l,this.int16[R+3]=h,this.uint16[R+4]=p,this.uint16[R+5]=m,this.uint16[R+6]=x,this.uint16[R+7]=T,this.int16[R+8]=I,this.int16[R+9]=C,this.int16[R+10]=P,this.int16[R+11]=B,e}}Ko.prototype.bytesPerElement=24,Re("StructArrayLayout4i4ui4i24",Ko);class qt extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const h=3*e;return this.float32[h+0]=r,this.float32[h+1]=s,this.float32[h+2]=l,e}}qt.prototype.bytesPerElement=12,Re("StructArrayLayout3f12",qt);class u extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}u.prototype.bytesPerElement=4,Re("StructArrayLayout1ul4",u);class t extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,h,p,m,x,T){const I=this.length;return this.resize(I+1),this.emplace(I,e,r,s,l,h,p,m,x,T)}emplace(e,r,s,l,h,p,m,x,T,I){const C=10*e,P=5*e;return this.int16[C+0]=r,this.int16[C+1]=s,this.int16[C+2]=l,this.int16[C+3]=h,this.int16[C+4]=p,this.int16[C+5]=m,this.uint32[P+3]=x,this.uint16[C+8]=T,this.uint16[C+9]=I,e}}t.prototype.bytesPerElement=20,Re("StructArrayLayout6i1ul2ui20",t);class n extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,h,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,s,l,h,p)}emplace(e,r,s,l,h,p,m){const x=6*e;return this.int16[x+0]=r,this.int16[x+1]=s,this.int16[x+2]=l,this.int16[x+3]=h,this.int16[x+4]=p,this.int16[x+5]=m,e}}n.prototype.bytesPerElement=12,Re("StructArrayLayout2i2i2i12",n);class a extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,h){const p=this.length;return this.resize(p+1),this.emplace(p,e,r,s,l,h)}emplace(e,r,s,l,h,p){const m=4*e,x=8*e;return this.float32[m+0]=r,this.float32[m+1]=s,this.float32[m+2]=l,this.int16[x+6]=h,this.int16[x+7]=p,e}}a.prototype.bytesPerElement=16,Re("StructArrayLayout2f1f2i16",a);class c extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,l){const h=this.length;return this.resize(h+1),this.emplace(h,e,r,s,l)}emplace(e,r,s,l,h){const p=12*e,m=3*e;return this.uint8[p+0]=r,this.uint8[p+1]=s,this.float32[m+1]=l,this.float32[m+2]=h,e}}c.prototype.bytesPerElement=12,Re("StructArrayLayout2ub2f12",c);class d extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const h=3*e;return this.uint16[h+0]=r,this.uint16[h+1]=s,this.uint16[h+2]=l,e}}d.prototype.bytesPerElement=6,Re("StructArrayLayout3ui6",d);class g extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,l,h,p,m,x,T,I,C,P,B,R,U,W,J){const se=this.length;return this.resize(se+1),this.emplace(se,e,r,s,l,h,p,m,x,T,I,C,P,B,R,U,W,J)}emplace(e,r,s,l,h,p,m,x,T,I,C,P,B,R,U,W,J,se){const Q=24*e,oe=12*e,he=48*e;return this.int16[Q+0]=r,this.int16[Q+1]=s,this.uint16[Q+2]=l,this.uint16[Q+3]=h,this.uint32[oe+2]=p,this.uint32[oe+3]=m,this.uint32[oe+4]=x,this.uint16[Q+10]=T,this.uint16[Q+11]=I,this.uint16[Q+12]=C,this.float32[oe+7]=P,this.float32[oe+8]=B,this.uint8[he+36]=R,this.uint8[he+37]=U,this.uint8[he+38]=W,this.uint32[oe+10]=J,this.int16[Q+22]=se,e}}g.prototype.bytesPerElement=48,Re("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",g);class y extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,l,h,p,m,x,T,I,C,P,B,R,U,W,J,se,Q,oe,he,xe,Be,Ne,De,Pe,Me,Fe){const Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,e,r,s,l,h,p,m,x,T,I,C,P,B,R,U,W,J,se,Q,oe,he,xe,Be,Ne,De,Pe,Me,Fe)}emplace(e,r,s,l,h,p,m,x,T,I,C,P,B,R,U,W,J,se,Q,oe,he,xe,Be,Ne,De,Pe,Me,Fe,Ce){const Se=32*e,Ke=16*e;return this.int16[Se+0]=r,this.int16[Se+1]=s,this.int16[Se+2]=l,this.int16[Se+3]=h,this.int16[Se+4]=p,this.int16[Se+5]=m,this.int16[Se+6]=x,this.int16[Se+7]=T,this.uint16[Se+8]=I,this.uint16[Se+9]=C,this.uint16[Se+10]=P,this.uint16[Se+11]=B,this.uint16[Se+12]=R,this.uint16[Se+13]=U,this.uint16[Se+14]=W,this.uint16[Se+15]=J,this.uint16[Se+16]=se,this.uint16[Se+17]=Q,this.uint16[Se+18]=oe,this.uint16[Se+19]=he,this.uint16[Se+20]=xe,this.uint16[Se+21]=Be,this.uint16[Se+22]=Ne,this.uint32[Ke+12]=De,this.float32[Ke+13]=Pe,this.float32[Ke+14]=Me,this.uint16[Se+30]=Fe,this.uint16[Se+31]=Ce,e}}y.prototype.bytesPerElement=64,Re("StructArrayLayout8i15ui1ul2f2ui64",y);class b extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}b.prototype.bytesPerElement=4,Re("StructArrayLayout1f4",b);class S extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const h=3*e;return this.uint16[6*e+0]=r,this.float32[h+1]=s,this.float32[h+2]=l,e}}S.prototype.bytesPerElement=12,Re("StructArrayLayout1ui2f12",S);class A extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const h=4*e;return this.uint32[2*e+0]=r,this.uint16[h+2]=s,this.uint16[h+3]=l,e}}A.prototype.bytesPerElement=8,Re("StructArrayLayout1ul2ui8",A);class k extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const l=2*e;return this.uint16[l+0]=r,this.uint16[l+1]=s,e}}k.prototype.bytesPerElement=4,Re("StructArrayLayout2ui4",k);class L extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}L.prototype.bytesPerElement=2,Re("StructArrayLayout1ui2",L);class q extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,l){const h=this.length;return this.resize(h+1),this.emplace(h,e,r,s,l)}emplace(e,r,s,l,h){const p=4*e;return this.float32[p+0]=r,this.float32[p+1]=s,this.float32[p+2]=l,this.float32[p+3]=h,e}}q.prototype.bytesPerElement=16,Re("StructArrayLayout4f16",q);class j extends Kn{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new ge(this.anchorPointX,this.anchorPointY)}}j.prototype.size=20;class G extends t{get(e){return new j(this,e)}}Re("CollisionBoxArray",G);class N extends Kn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}N.prototype.size=48;class ee extends g{get(e){return new N(this,e)}}Re("PlacedSymbolArray",ee);class ce extends Kn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}ce.prototype.size=64;class K extends y{get(e){return new ce(this,e)}}Re("SymbolInstanceArray",K);class ie extends b{getoffsetX(e){return this.float32[1*e+0]}}Re("GlyphOffsetArray",ie);class de extends Hs{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Re("SymbolLineVertexArray",de);class pe extends Kn{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}pe.prototype.size=12;class ye extends S{get(e){return new pe(this,e)}}Re("TextAnchorOffsetArray",ye);class Te extends Kn{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]}}Te.prototype.size=8;class we extends A{get(e){return new Te(this,e)}}Re("FeatureIndexArray",we);class Ae extends Gs{}class Ve extends Gs{}class It extends Gs{}class ze extends Ho{}class it extends Wo{}class Ue extends bs{}class Xt extends Xo{}class Tt extends Ko{}class _t extends qt{}class At extends u{}class bi extends n{}class ni extends c{}class Wi extends d{}class Di extends k{}const Ai=mi([{name:"a_pos",components:2,type:"Int16"}],4),{members:Er}=Ai;class ai{constructor(e=[]){this.segments=e}prepareSegment(e,r,s,l){let h=this.segments[this.segments.length-1];return e>ai.MAX_VERTEX_ARRAY_LENGTH&<(`Max vertices per segment is ${ai.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!h||h.vertexLength+e>ai.MAX_VERTEX_ARRAY_LENGTH||h.sortKey!==l)&&(h={vertexOffset:r.length,primitiveOffset:s.length,vertexLength:0,primitiveLength:0},l!==void 0&&(h.sortKey=l),this.segments.push(h)),h}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,s,l){return new ai([{vertexOffset:e,primitiveOffset:r,vertexLength:s,primitiveLength:l,vaos:{},sortKey:0}])}}function on(i,e){return 256*(i=zt(Math.floor(i),0,255))+zt(Math.floor(e),0,255)}ai.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Re("SegmentVector",ai);const ln=mi([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Fn={exports:{}},Yn={exports:{}};Yn.exports=function(i,e){var r,s,l,h,p,m,x,T;for(s=i.length-(r=3&i.length),l=e,p=3432918353,m=461845907,T=0;T>>16)*p&65535)<<16)&4294967295)<<15|x>>>17))*m+(((x>>>16)*m&65535)<<16)&4294967295)<<13|l>>>19))+((5*(l>>>16)&65535)<<16)&4294967295))+((58964+(h>>>16)&65535)<<16);switch(x=0,r){case 3:x^=(255&i.charCodeAt(T+2))<<16;case 2:x^=(255&i.charCodeAt(T+1))<<8;case 1:l^=x=(65535&(x=(x=(65535&(x^=255&i.charCodeAt(T)))*p+(((x>>>16)*p&65535)<<16)&4294967295)<<15|x>>>17))*m+(((x>>>16)*m&65535)<<16)&4294967295}return l^=i.length,l=2246822507*(65535&(l^=l>>>16))+((2246822507*(l>>>16)&65535)<<16)&4294967295,l=3266489909*(65535&(l^=l>>>13))+((3266489909*(l>>>16)&65535)<<16)&4294967295,(l^=l>>>16)>>>0};var ws=Yn.exports,er={exports:{}};er.exports=function(i,e){for(var r,s=i.length,l=e^s,h=0;s>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(h)|(255&i.charCodeAt(++h))<<8|(255&i.charCodeAt(++h))<<16|(255&i.charCodeAt(++h))<<24))+((1540483477*(r>>>16)&65535)<<16),l=1540483477*(65535&l)+((1540483477*(l>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),s-=4,++h;switch(s){case 3:l^=(255&i.charCodeAt(h+2))<<16;case 2:l^=(255&i.charCodeAt(h+1))<<8;case 1:l=1540483477*(65535&(l^=255&i.charCodeAt(h)))+((1540483477*(l>>>16)&65535)<<16)}return l=1540483477*(65535&(l^=l>>>13))+((1540483477*(l>>>16)&65535)<<16),(l^=l>>>15)>>>0};var Xi=ws,or=er.exports;Fn.exports=Xi,Fn.exports.murmur3=Xi,Fn.exports.murmur2=or;var Qn=O(Fn.exports);class wi{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,s,l){this.ids.push(Li(e)),this.positions.push(r,s,l)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=Li(e);let s=0,l=this.ids.length-1;for(;s>1;this.ids[p]>=r?l=p:s=p+1}const h=[];for(;this.ids[s]===r;)h.push({index:this.positions[3*s],start:this.positions[3*s+1],end:this.positions[3*s+2]}),s++;return h}static serialize(e,r){const s=new Float64Array(e.ids),l=new Uint32Array(e.positions);return gr(s,l,0,s.length-1),r&&r.push(s.buffer,l.buffer),{ids:s,positions:l}}static deserialize(e){const r=new wi;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function Li(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Qn(String(i))}function gr(i,e,r,s){for(;r>1];let h=r-1,p=s+1;for(;;){do h++;while(i[h]l);if(h>=p)break;Ti(i,h,p),Ti(e,3*h,3*p),Ti(e,3*h+1,3*p+1),Ti(e,3*h+2,3*p+2)}p-r`u_${l}`),this.type=s}setUniform(e,r,s){e.set(s.constantOr(this.value))}getBinding(e,r,s){return this.type==="color"?new pc(e,r):new Ba(e,r)}}class es{constructor(e,r){this.uniformNames=r.map(s=>`u_${s}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,s,l){const h=l==="u_pattern_to"?this.patternTo:l==="u_pattern_from"?this.patternFrom:l==="u_pixel_ratio_to"?this.pixelRatioTo:l==="u_pixel_ratio_from"?this.pixelRatioFrom:null;h&&e.set(h)}getBinding(e,r,s){return s.substr(0,9)==="u_pattern"?new dc(e,r):new Ba(e,r)}}class un{constructor(e,r,s,l){this.expression=e,this.type=s,this.maxValue=0,this.paintVertexAttributes=r.map(h=>({name:`a_${h}`,type:"Float32",components:s==="color"?2:1,offset:0})),this.paintVertexArray=new l}populatePaintArray(e,r,s,l,h){const p=this.paintVertexArray.length,m=this.expression.evaluate(new si(0),r,{},l,[],h);this.paintVertexArray.resize(e),this._setPaintValue(p,e,m)}updatePaintArray(e,r,s,l){const h=this.expression.evaluate({zoom:0},s,l);this._setPaintValue(e,r,h)}_setPaintValue(e,r,s){if(this.type==="color"){const l=Jo(s);for(let h=e;h`u_${m}_t`),this.type=s,this.useIntegerZoom=l,this.zoom=h,this.maxValue=0,this.paintVertexAttributes=r.map(m=>({name:`a_${m}`,type:"Float32",components:s==="color"?4:2,offset:0})),this.paintVertexArray=new p}populatePaintArray(e,r,s,l,h){const p=this.expression.evaluate(new si(this.zoom),r,{},l,[],h),m=this.expression.evaluate(new si(this.zoom+1),r,{},l,[],h),x=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(x,e,p,m)}updatePaintArray(e,r,s,l){const h=this.expression.evaluate({zoom:this.zoom},s,l),p=this.expression.evaluate({zoom:this.zoom+1},s,l);this._setPaintValue(e,r,h,p)}_setPaintValue(e,r,s,l){if(this.type==="color"){const h=Jo(s),p=Jo(l);for(let m=e;m`#define HAS_UNIFORM_${l}`))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const s=this.binders[r];if(s instanceof un||s instanceof Zr)for(let l=0;l!0){this.programConfigurations={};for(const l of e)this.programConfigurations[l.id]=new Yo(l,r,s);this.needsUpload=!1,this._featureMap=new wi,this._bufferOffset=0}populatePaintArrays(e,r,s,l,h,p){for(const m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(e,r,l,h,p);r.id!==void 0&&this._featureMap.add(r.id,s,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,s,l){for(const h of s)this.needsUpload=this.programConfigurations[h.id].updatePaintArrays(e,this._featureMap,r,h,l)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function nf(i,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function yh(i,e,r){const s={color:{source:bs,composite:q},number:{source:b,composite:bs}},l=function(h){return{"line-pattern":{source:Xt,composite:Xt},"fill-pattern":{source:Xt,composite:Xt},"fill-extrusion-pattern":{source:Xt,composite:Xt}}[h]}(i);return l&&l[r]||s[e][r]}Re("ConstantBinder",cn),Re("CrossFadedConstantBinder",es),Re("SourceExpressionBinder",un),Re("CrossFadedCompositeBinder",hn),Re("CompositeExpressionBinder",Zr),Re("ProgramConfiguration",Yo,{omit:["_buffers"]}),Re("ProgramConfigurationSet",wn);const Ei=8192,uu=Math.pow(2,14)-1,xh=-uu-1;function Ws(i){const e=Ei/i.extent,r=i.loadGeometry();for(let s=0;sp.x+1||xp.y+1)&<("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function Xs(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?Ws(i):[]}}function fc(i,e,r,s,l){i.emplaceBack(2*e+(s+1)/2,2*r+(l+1)/2)}class hu{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Ve,this.indexArray=new Wi,this.segments=new ai,this.programConfigurations=new wn(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){const l=this.layers[0],h=[];let p=null,m=!1;l.type==="circle"&&(p=l.layout.get("circle-sort-key"),m=!p.isConstant());for(const{feature:x,id:T,index:I,sourceLayerIndex:C}of e){const P=this.layers[0]._featureFilter.needGeometry,B=Xs(x,P);if(!this.layers[0]._featureFilter.filter(new si(this.zoom),B,s))continue;const R=m?p.evaluate(B,{},s):void 0,U={id:T,properties:x.properties,type:x.type,sourceLayerIndex:C,index:I,geometry:P?B.geometry:Ws(x),patterns:{},sortKey:R};h.push(U)}m&&h.sort((x,T)=>x.sortKey-T.sortKey);for(const x of h){const{geometry:T,index:I,sourceLayerIndex:C}=x,P=e[I].feature;this.addFeature(x,T,I,s),r.featureIndex.insert(P,T,I,C,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Er),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,s,l){for(const h of r)for(const p of h){const m=p.x,x=p.y;if(m<0||m>=Ei||x<0||x>=Ei)continue;const T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),I=T.vertexLength;fc(this.layoutVertexArray,m,x,-1,-1),fc(this.layoutVertexArray,m,x,1,-1),fc(this.layoutVertexArray,m,x,1,1),fc(this.layoutVertexArray,m,x,-1,1),this.indexArray.emplaceBack(I,I+1,I+2),this.indexArray.emplaceBack(I,I+3,I+2),T.vertexLength+=4,T.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,{},l)}}function vh(i,e){for(let r=0;r1){if(du(i,e))return!0;for(let s=0;s1?r:r.sub(e)._mult(l)._add(e))}function Th(i,e){let r,s,l,h=!1;for(let p=0;pe.y!=l.y>e.y&&e.x<(l.x-s.x)*(e.y-s.y)/(l.y-s.y)+s.x&&(h=!h)}return h}function Ra(i,e){let r=!1;for(let s=0,l=i.length-1;se.y!=p.y>e.y&&e.x<(p.x-h.x)*(e.y-h.y)/(p.y-h.y)+h.x&&(r=!r)}return r}function lf(i,e,r){const s=r[0],l=r[2];if(i.xl.x&&e.x>l.x||i.yl.y&&e.y>l.y)return!1;const h=pt(i,e,r[0]);return h!==pt(i,e,r[1])||h!==pt(i,e,r[2])||h!==pt(i,e,r[3])}function Qo(i,e,r){const s=e.paint.get(i).value;return s.kind==="constant"?s.value:r.programConfigurations.get(e.id).getMaxValue(i)}function mc(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function gc(i,e,r,s,l){if(!e[0]&&!e[1])return i;const h=ge.convert(e)._mult(l);r==="viewport"&&h._rotate(-s);const p=[];for(let m=0;mMh(W,U))}(T,x),B=C?I*m:I;for(const R of l)for(const U of R){const W=C?U:Mh(U,x);let J=B;const se=_c([],[U.x,U.y,0,1],x);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?J*=se[3]/p.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(J*=p.cameraToCenterDistance/se[3]),sf(P,W,J))return!0}return!1}}function Mh(i,e){const r=_c([],[i.x,i.y,0,1],e);return new ge(r[0]/r[3],r[1]/r[3])}class kh extends hu{}let Ch;Re("HeatmapBucket",kh,{omit:["layers"]});var df={get paint(){return Ch=Ch||new Ii({"heatmap-radius":new tt(fe.paint_heatmap["heatmap-radius"]),"heatmap-weight":new tt(fe.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ze(fe.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Zo(fe.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ze(fe.paint_heatmap["heatmap-opacity"])})}};function mu(i,{width:e,height:r},s,l){if(l){if(l instanceof Uint8ClampedArray)l=new Uint8Array(l.buffer);else if(l.length!==e*r*s)throw new RangeError(`mismatched image size. expected: ${l.length} but got: ${e*r*s}`)}else l=new Uint8Array(e*r*s);return i.width=e,i.height=r,i.data=l,i}function Eh(i,{width:e,height:r},s){if(e===i.width&&r===i.height)return;const l=mu({},{width:e,height:r},s);gu(i,l,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,r)},s),i.width=e,i.height=r,i.data=l.data}function gu(i,e,r,s,l,h){if(l.width===0||l.height===0)return e;if(l.width>i.width||l.height>i.height||r.x>i.width-l.width||r.y>i.height-l.height)throw new RangeError("out of range source coordinates for image copy");if(l.width>e.width||l.height>e.height||s.x>e.width-l.width||s.y>e.height-l.height)throw new RangeError("out of range destination coordinates for image copy");const p=i.data,m=e.data;if(p===m)throw new Error("srcData equals dstData, so image is already copied");for(let x=0;x{e[i.evaluationKey]=x;const T=i.expression.evaluate(e);l.data[p+m+0]=Math.floor(255*T.r/T.a),l.data[p+m+1]=Math.floor(255*T.g/T.a),l.data[p+m+2]=Math.floor(255*T.b/T.a),l.data[p+m+3]=Math.floor(255*T.a)};if(i.clips)for(let p=0,m=0;p80*r){s=h=i[0],l=p=i[1];for(var R=r;Rh&&(h=m),x>p&&(p=x);T=(T=Math.max(h-s,p-l))!==0?32767/T:0}return tl(P,B,r,s,l,T,0),B}function Dh(i,e,r,s,l){var h,p;if(l===vu(i,e,r,s)>0)for(h=e;h=e;h-=s)p=Rh(h,i[h],i[h+1],p);return p&&xc(p,p.next)&&(rl(p),p=p.next),p}function Ks(i,e){if(!i)return i;e||(e=i);var r,s=i;do if(r=!1,s.steiner||!xc(s,s.next)&&Mi(s.prev,s,s.next)!==0)s=s.next;else{if(rl(s),(s=e=s.prev)===s.next)break;r=!0}while(r||s!==e);return e}function tl(i,e,r,s,l,h,p){if(i){!p&&h&&function(I,C,P,B){var R=I;do R.z===0&&(R.z=yu(R.x,R.y,C,P,B)),R.prevZ=R.prev,R.nextZ=R.next,R=R.next;while(R!==I);R.prevZ.nextZ=null,R.prevZ=null,function(U){var W,J,se,Q,oe,he,xe,Be,Ne=1;do{for(J=U,U=null,oe=null,he=0;J;){for(he++,se=J,xe=0,W=0;W0||Be>0&&se;)xe!==0&&(Be===0||!se||J.z<=se.z)?(Q=J,J=J.nextZ,xe--):(Q=se,se=se.nextZ,Be--),oe?oe.nextZ=Q:U=Q,Q.prevZ=oe,oe=Q;J=se}oe.nextZ=null,Ne*=2}while(he>1)}(R)}(i,s,l,h);for(var m,x,T=i;i.prev!==i.next;)if(m=i.prev,x=i.next,h?xf(i,s,l,h):yf(i))e.push(m.i/r|0),e.push(i.i/r|0),e.push(x.i/r|0),rl(i),i=x.next,T=x.next;else if((i=x)===T){p?p===1?tl(i=vf(Ks(i),e,r),e,r,s,l,h,2):p===2&&bf(i,e,r,s,l,h):tl(Ks(i),e,r,s,l,h,1);break}}}function yf(i){var e=i.prev,r=i,s=i.next;if(Mi(e,r,s)>=0)return!1;for(var l=e.x,h=r.x,p=s.x,m=e.y,x=r.y,T=s.y,I=lh?l>p?l:p:h>p?h:p,B=m>x?m>T?m:T:x>T?x:T,R=s.next;R!==e;){if(R.x>=I&&R.x<=P&&R.y>=C&&R.y<=B&&Oa(l,m,h,x,p,T,R.x,R.y)&&Mi(R.prev,R,R.next)>=0)return!1;R=R.next}return!0}function xf(i,e,r,s){var l=i.prev,h=i,p=i.next;if(Mi(l,h,p)>=0)return!1;for(var m=l.x,x=h.x,T=p.x,I=l.y,C=h.y,P=p.y,B=mx?m>T?m:T:x>T?x:T,W=I>C?I>P?I:P:C>P?C:P,J=yu(B,R,e,r,s),se=yu(U,W,e,r,s),Q=i.prevZ,oe=i.nextZ;Q&&Q.z>=J&&oe&&oe.z<=se;){if(Q.x>=B&&Q.x<=U&&Q.y>=R&&Q.y<=W&&Q!==l&&Q!==p&&Oa(m,I,x,C,T,P,Q.x,Q.y)&&Mi(Q.prev,Q,Q.next)>=0||(Q=Q.prevZ,oe.x>=B&&oe.x<=U&&oe.y>=R&&oe.y<=W&&oe!==l&&oe!==p&&Oa(m,I,x,C,T,P,oe.x,oe.y)&&Mi(oe.prev,oe,oe.next)>=0))return!1;oe=oe.nextZ}for(;Q&&Q.z>=J;){if(Q.x>=B&&Q.x<=U&&Q.y>=R&&Q.y<=W&&Q!==l&&Q!==p&&Oa(m,I,x,C,T,P,Q.x,Q.y)&&Mi(Q.prev,Q,Q.next)>=0)return!1;Q=Q.prevZ}for(;oe&&oe.z<=se;){if(oe.x>=B&&oe.x<=U&&oe.y>=R&&oe.y<=W&&oe!==l&&oe!==p&&Oa(m,I,x,C,T,P,oe.x,oe.y)&&Mi(oe.prev,oe,oe.next)>=0)return!1;oe=oe.nextZ}return!0}function vf(i,e,r){var s=i;do{var l=s.prev,h=s.next.next;!xc(l,h)&&Lh(l,s,s.next,h)&&il(l,h)&&il(h,l)&&(e.push(l.i/r|0),e.push(s.i/r|0),e.push(h.i/r|0),rl(s),rl(s.next),s=i=h),s=s.next}while(s!==i);return Ks(s)}function bf(i,e,r,s,l,h){var p=i;do{for(var m=p.next.next;m!==p.prev;){if(p.i!==m.i&&Af(p,m)){var x=Bh(p,m);return p=Ks(p,p.next),x=Ks(x,x.next),tl(p,e,r,s,l,h,0),void tl(x,e,r,s,l,h,0)}m=m.next}p=p.next}while(p!==i)}function wf(i,e){return i.x-e.x}function Tf(i,e){var r=function(l,h){var p,m=h,x=l.x,T=l.y,I=-1/0;do{if(T<=m.y&&T>=m.next.y&&m.next.y!==m.y){var C=m.x+(T-m.y)*(m.next.x-m.x)/(m.next.y-m.y);if(C<=x&&C>I&&(I=C,p=m.x=m.x&&m.x>=R&&x!==m.x&&Oa(Tp.x||m.x===p.x&&Sf(p,m)))&&(p=m,W=P)),m=m.next;while(m!==B);return p}(i,e);if(!r)return e;var s=Bh(r,i);return Ks(s,s.next),Ks(r,r.next)}function Sf(i,e){return Mi(i.prev,i,e.prev)<0&&Mi(e.next,i,i.next)<0}function yu(i,e,r,s,l){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*l|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*l|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function If(i){var e=i,r=i;do(e.x=(i-p)*(h-m)&&(i-p)*(s-m)>=(r-p)*(e-m)&&(r-p)*(h-m)>=(l-p)*(s-m)}function Af(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(r,s){var l=r;do{if(l.i!==r.i&&l.next.i!==r.i&&l.i!==s.i&&l.next.i!==s.i&&Lh(l,l.next,r,s))return!0;l=l.next}while(l!==r);return!1}(i,e)&&(il(i,e)&&il(e,i)&&function(r,s){var l=r,h=!1,p=(r.x+s.x)/2,m=(r.y+s.y)/2;do l.y>m!=l.next.y>m&&l.next.y!==l.y&&p<(l.next.x-l.x)*(m-l.y)/(l.next.y-l.y)+l.x&&(h=!h),l=l.next;while(l!==r);return h}(i,e)&&(Mi(i.prev,i,e.prev)||Mi(i,e.prev,e))||xc(i,e)&&Mi(i.prev,i,i.next)>0&&Mi(e.prev,e,e.next)>0)}function Mi(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function xc(i,e){return i.x===e.x&&i.y===e.y}function Lh(i,e,r,s){var l=bc(Mi(i,e,r)),h=bc(Mi(i,e,s)),p=bc(Mi(r,s,i)),m=bc(Mi(r,s,e));return l!==h&&p!==m||!(l!==0||!vc(i,r,e))||!(h!==0||!vc(i,s,e))||!(p!==0||!vc(r,i,s))||!(m!==0||!vc(r,e,s))}function vc(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function bc(i){return i>0?1:i<0?-1:0}function il(i,e){return Mi(i.prev,i,i.next)<0?Mi(i,e,i.next)>=0&&Mi(i,i.prev,e)>=0:Mi(i,e,i.prev)<0||Mi(i,i.next,e)<0}function Bh(i,e){var r=new xu(i.i,i.x,i.y),s=new xu(e.i,e.x,e.y),l=i.next,h=e.prev;return i.next=e,e.prev=i,r.next=l,l.prev=r,s.next=r,r.prev=s,h.next=s,s.prev=h,s}function Rh(i,e,r,s){var l=new xu(i,e,r);return s?(l.next=s.next,l.prev=s,s.next.prev=l,s.next=l):(l.prev=l,l.next=l),l}function rl(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function xu(i,e,r){this.i=i,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function vu(i,e,r,s){for(var l=0,h=e,p=r-s;h0&&r.holes.push(s+=i[l-1].length)}return r};var Fh=O(_u.exports);function Mf(i,e,r,s,l){Oh(i,e,r||0,s||i.length-1,l||kf)}function Oh(i,e,r,s,l){for(;s>r;){if(s-r>600){var h=s-r+1,p=e-r+1,m=Math.log(h),x=.5*Math.exp(2*m/3),T=.5*Math.sqrt(m*x*(h-x)/h)*(p-h/2<0?-1:1);Oh(i,e,Math.max(r,Math.floor(e-p*x/h+T)),Math.min(s,Math.floor(e+(h-p)*x/h+T)),l)}var I=i[e],C=r,P=s;for(nl(i,r,e),l(i[s],I)>0&&nl(i,r,s);C0;)P--}l(i[r],I)===0?nl(i,r,P):nl(i,++P,s),P<=e&&(r=P+1),e<=P&&(s=P-1)}}function nl(i,e,r){var s=i[e];i[e]=i[r],i[r]=s}function kf(i,e){return ie?1:0}function bu(i,e){const r=i.length;if(r<=1)return[i];const s=[];let l,h;for(let p=0;p1)for(let p=0;pr.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new It,this.indexArray=new Wi,this.indexArray2=new Di,this.programConfigurations=new wn(e.layers,e.zoom),this.segments=new ai,this.segments2=new ai,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.hasPattern=wu("fill",this.layers,r);const l=this.layers[0].layout.get("fill-sort-key"),h=!l.isConstant(),p=[];for(const{feature:m,id:x,index:T,sourceLayerIndex:I}of e){const C=this.layers[0]._featureFilter.needGeometry,P=Xs(m,C);if(!this.layers[0]._featureFilter.filter(new si(this.zoom),P,s))continue;const B=h?l.evaluate(P,{},s,r.availableImages):void 0,R={id:x,properties:m.properties,type:m.type,sourceLayerIndex:I,index:T,geometry:C?P.geometry:Ws(m),patterns:{},sortKey:B};p.push(R)}h&&p.sort((m,x)=>m.sortKey-x.sortKey);for(const m of p){const{geometry:x,index:T,sourceLayerIndex:I}=m;if(this.hasPattern){const C=Tu("fill",this.layers,m,this.zoom,r);this.patternFeatures.push(C)}else this.addFeature(m,x,T,s,{});r.featureIndex.insert(e[T].feature,x,T,I,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}addFeatures(e,r,s){for(const l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,_f),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,s,l,h){for(const p of bu(r,500)){let m=0;for(const B of p)m+=B.length;const x=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),T=x.vertexLength,I=[],C=[];for(const B of p){if(B.length===0)continue;B!==p[0]&&C.push(I.length/2);const R=this.segments2.prepareSegment(B.length,this.layoutVertexArray,this.indexArray2),U=R.vertexLength;this.layoutVertexArray.emplaceBack(B[0].x,B[0].y),this.indexArray2.emplaceBack(U+B.length-1,U),I.push(B[0].x),I.push(B[0].y);for(let W=1;W>3}if(l--,s===1||s===2)h+=i.readSVarint(),p+=i.readSVarint(),s===1&&(e&&m.push(e),e=[]),e.push(new Bf(h,p));else{if(s!==7)throw new Error("unknown command "+s);e&&e.push(e[0].clone())}}return e&&m.push(e),m},Va.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,r=1,s=0,l=0,h=0,p=1/0,m=-1/0,x=1/0,T=-1/0;i.pos>3}if(s--,r===1||r===2)(l+=i.readSVarint())m&&(m=l),(h+=i.readSVarint())T&&(T=h);else if(r!==7)throw new Error("unknown command "+r)}return[p,x,m,T]},Va.prototype.toGeoJSON=function(i,e,r){var s,l,h=this.extent*Math.pow(2,r),p=this.extent*i,m=this.extent*e,x=this.loadGeometry(),T=Va.types[this.type];function I(B){for(var R=0;R>3;l=p===1?s.readString():p===2?s.readFloat():p===3?s.readDouble():p===4?s.readVarint64():p===5?s.readVarint():p===6?s.readSVarint():p===7?s.readBoolean():null}return l}(r))}qh.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new Of(this._pbf,e,this.extent,this._keys,this._values)};var Nf=jh;function Uf(i,e,r){if(i===3){var s=new Nf(r,r.readVarint()+r.pos);s.length&&(e[s.name]=s)}}Ts.VectorTile=function(i,e){this.layers=i.readFields(Uf,{},e)},Ts.VectorTileFeature=Uh,Ts.VectorTileLayer=jh;const jf=Ts.VectorTileFeature.types,Iu=Math.pow(2,13);function sl(i,e,r,s,l,h,p,m){i.emplaceBack(e,r,2*Math.floor(s*Iu)+p,l*Iu*2,h*Iu*2,Math.round(m))}class Au{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new ze,this.centroidVertexArray=new Ae,this.indexArray=new Wi,this.programConfigurations=new wn(e.layers,e.zoom),this.segments=new ai,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.features=[],this.hasPattern=wu("fill-extrusion",this.layers,r);for(const{feature:l,id:h,index:p,sourceLayerIndex:m}of e){const x=this.layers[0]._featureFilter.needGeometry,T=Xs(l,x);if(!this.layers[0]._featureFilter.filter(new si(this.zoom),T,s))continue;const I={id:h,sourceLayerIndex:m,index:p,geometry:x?T.geometry:Ws(l),properties:l.properties,type:l.type,patterns:{}};this.hasPattern?this.features.push(Tu("fill-extrusion",this.layers,I,this.zoom,r)):this.addFeature(I,I.geometry,p,s,{}),r.featureIndex.insert(l,I.geometry,p,m,this.index,!0)}}addFeatures(e,r,s){for(const l of this.features){const{geometry:h}=l;this.addFeature(l,h,l.index,r,s)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Lf),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Df.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,s,l,h){const p={x:0,y:0,vertexCount:0};for(const m of bu(r,500)){let x=0;for(const R of m)x+=R.length;let T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const R of m){if(R.length===0||Zf(R))continue;let U=0;for(let W=0;W=1){const se=R[W-1];if(!qf(J,se)){T.vertexLength+4>ai.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Q=J.sub(se)._perp()._unit(),oe=se.dist(J);U+oe>32768&&(U=0),sl(this.layoutVertexArray,J.x,J.y,Q.x,Q.y,0,0,U),sl(this.layoutVertexArray,J.x,J.y,Q.x,Q.y,0,1,U),p.x+=2*J.x,p.y+=2*J.y,p.vertexCount+=2,U+=oe,sl(this.layoutVertexArray,se.x,se.y,Q.x,Q.y,0,0,U),sl(this.layoutVertexArray,se.x,se.y,Q.x,Q.y,0,1,U),p.x+=2*se.x,p.y+=2*se.y,p.vertexCount+=2;const he=T.vertexLength;this.indexArray.emplaceBack(he,he+2,he+1),this.indexArray.emplaceBack(he+1,he+2,he+3),T.vertexLength+=4,T.primitiveLength+=2}}}}if(T.vertexLength+x>ai.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(x,this.layoutVertexArray,this.indexArray)),jf[e.type]!=="Polygon")continue;const I=[],C=[],P=T.vertexLength;for(const R of m)if(R.length!==0){R!==m[0]&&C.push(I.length/2);for(let U=0;UEi)||i.y===e.y&&(i.y<0||i.y>Ei)}function Zf(i){return i.every(e=>e.x<0)||i.every(e=>e.x>Ei)||i.every(e=>e.y<0)||i.every(e=>e.y>Ei)}let Zh;Re("FillExtrusionBucket",Au,{omit:["layers","features"]});var Gf={get paint(){return Zh=Zh||new Ii({"fill-extrusion-opacity":new Ze(fe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new tt(fe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ze(fe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ze(fe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Zs(fe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new tt(fe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new tt(fe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ze(fe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Hf extends qr{constructor(e){super(e,Gf)}createBucket(e){return new Au(e)}queryRadius(){return mc(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,r,s,l,h,p,m,x){const T=gc(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),p.angle,m),I=this.paint.get("fill-extrusion-height").evaluate(r,s),C=this.paint.get("fill-extrusion-base").evaluate(r,s),P=function(R,U,W,J){const se=[];for(const Q of R){const oe=[Q.x,Q.y,0,1];_c(oe,oe,U),se.push(new ge(oe[0]/oe[3],oe[1]/oe[3]))}return se}(T,x),B=function(R,U,W,J){const se=[],Q=[],oe=J[8]*U,he=J[9]*U,xe=J[10]*U,Be=J[11]*U,Ne=J[8]*W,De=J[9]*W,Pe=J[10]*W,Me=J[11]*W;for(const Fe of R){const Ce=[],Se=[];for(const Ke of Fe){const je=Ke.x,wt=Ke.y,oi=J[0]*je+J[4]*wt+J[12],hi=J[1]*je+J[5]*wt+J[13],Ri=J[2]*je+J[6]*wt+J[14],Gr=J[3]*je+J[7]*wt+J[15],yr=Ri+xe,zi=Gr+Be,Ki=oi+Ne,ir=hi+De,xr=Ri+Pe,vr=Gr+Me,Fi=new ge((oi+oe)/zi,(hi+he)/zi);Fi.z=yr/zi,Ce.push(Fi);const Oi=new ge(Ki/vr,ir/vr);Oi.z=xr/vr,Se.push(Oi)}se.push(Ce),Q.push(Se)}return[se,Q]}(l,C,I,x);return function(R,U,W){let J=1/0;bh(W,U)&&(J=Gh(W,U[0]));for(let se=0;ser.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new it,this.layoutVertexArray2=new Ue,this.indexArray=new Wi,this.programConfigurations=new wn(e.layers,e.zoom),this.segments=new ai,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.hasPattern=wu("line",this.layers,r);const l=this.layers[0].layout.get("line-sort-key"),h=!l.isConstant(),p=[];for(const{feature:m,id:x,index:T,sourceLayerIndex:I}of e){const C=this.layers[0]._featureFilter.needGeometry,P=Xs(m,C);if(!this.layers[0]._featureFilter.filter(new si(this.zoom),P,s))continue;const B=h?l.evaluate(P,{},s):void 0,R={id:x,properties:m.properties,type:m.type,sourceLayerIndex:I,index:T,geometry:C?P.geometry:Ws(m),patterns:{},sortKey:B};p.push(R)}h&&p.sort((m,x)=>m.sortKey-x.sortKey);for(const m of p){const{geometry:x,index:T,sourceLayerIndex:I}=m;if(this.hasPattern){const C=Tu("line",this.layers,m,this.zoom,r);this.patternFeatures.push(C)}else this.addFeature(m,x,T,s,{});r.featureIndex.insert(e[T].feature,x,T,I,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}addFeatures(e,r,s){for(const l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,s)}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,Jf)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Xf),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,s,l,h){const p=this.layers[0].layout,m=p.get("line-join").evaluate(e,{}),x=p.get("line-cap"),T=p.get("line-miter-limit"),I=p.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const C of r)this.addLine(C,e,m,x,T,I);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,h,l)}addLine(e,r,s,l,h,p){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let J=0;J=2&&e[x-1].equals(e[x-2]);)x--;let T=0;for(;T0;if(Be&&J>T){const Me=P.dist(B);if(Me>2*I){const Fe=P.sub(P.sub(B)._mult(I/Me)._round());this.updateDistance(B,Fe),this.addCurrentVertex(Fe,U,0,0,C),B=Fe}}const De=B&&R;let Pe=De?s:m?"butt":l;if(De&&Pe==="round"&&(heh&&(Pe="bevel"),Pe==="bevel"&&(he>2&&(Pe="flipbevel"),he100)se=W.mult(-1);else{const Me=he*U.add(W).mag()/U.sub(W).mag();se._perp()._mult(Me*(Ne?-1:1))}this.addCurrentVertex(P,se,0,0,C),this.addCurrentVertex(P,se.mult(-1),0,0,C)}else if(Pe==="bevel"||Pe==="fakeround"){const Me=-Math.sqrt(he*he-1),Fe=Ne?Me:0,Ce=Ne?0:Me;if(B&&this.addCurrentVertex(P,U,Fe,Ce,C),Pe==="fakeround"){const Se=Math.round(180*xe/Math.PI/20);for(let Ke=1;Ke2*I){const Fe=P.add(R.sub(P)._mult(I/Me)._round());this.updateDistance(P,Fe),this.addCurrentVertex(Fe,W,0,0,C),P=Fe}}}}addCurrentVertex(e,r,s,l,h,p=!1){const m=r.y*l-r.x,x=-r.y-r.x*l;this.addHalfVertex(e,r.x+r.y*s,r.y-r.x*s,p,!1,s,h),this.addHalfVertex(e,m,x,p,!0,-l,h),this.distance>Hh/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,s,l,h,p))}addHalfVertex({x:e,y:r},s,l,h,p,m,x){const T=.5*(this.lineClips?this.scaledDistance*(Hh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(h?1:0),(r<<1)+(p?1:0),Math.round(63*s)+128,Math.round(63*l)+128,1+(m===0?0:m<0?-1:1)|(63&T)<<2,T>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const I=x.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,I),x.primitiveLength++),p?this.e2=I:this.e1=I}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}let Wh,Xh;Re("LineBucket",Mu,{omit:["layers","patternFeatures"]});var Kh={get paint(){return Xh=Xh||new Ii({"line-opacity":new tt(fe.paint_line["line-opacity"]),"line-color":new tt(fe.paint_line["line-color"]),"line-translate":new Ze(fe.paint_line["line-translate"]),"line-translate-anchor":new Ze(fe.paint_line["line-translate-anchor"]),"line-width":new tt(fe.paint_line["line-width"]),"line-gap-width":new tt(fe.paint_line["line-gap-width"]),"line-offset":new tt(fe.paint_line["line-offset"]),"line-blur":new tt(fe.paint_line["line-blur"]),"line-dasharray":new qo(fe.paint_line["line-dasharray"]),"line-pattern":new Zs(fe.paint_line["line-pattern"]),"line-gradient":new Zo(fe.paint_line["line-gradient"])})},get layout(){return Wh=Wh||new Ii({"line-cap":new Ze(fe.layout_line["line-cap"]),"line-join":new tt(fe.layout_line["line-join"]),"line-miter-limit":new Ze(fe.layout_line["line-miter-limit"]),"line-round-limit":new Ze(fe.layout_line["line-round-limit"]),"line-sort-key":new tt(fe.layout_line["line-sort-key"])})}};class $f extends tt{possiblyEvaluate(e,r){return r=new si(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,s,l){return r=dt({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,s,l)}}let wc;class em extends qr{constructor(e){super(e,Kh),this.gradientVersion=0,wc||(wc=new $f(Kh.paint.properties["line-width"].specification),wc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){const r=this.gradientExpression();this.stepInterpolant=!!function(s){return s._styleExpression!==void 0}(r)&&r._styleExpression.expression instanceof Dn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=wc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Mu(e)}queryRadius(e){const r=e,s=Jh(Qo("line-width",this,r),Qo("line-gap-width",this,r)),l=Qo("line-offset",this,r);return s/2+Math.abs(l)+mc(this.paint.get("line-translate"))}queryIntersectsFeature(e,r,s,l,h,p,m){const x=gc(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),p.angle,m),T=m/2*Jh(this.paint.get("line-width").evaluate(r,s),this.paint.get("line-gap-width").evaluate(r,s)),I=this.paint.get("line-offset").evaluate(r,s);return I&&(l=function(C,P){const B=[];for(let R=0;R=3){for(let W=0;W0?e+2*i:i}const tm=mi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),im=mi([{name:"a_projected_pos",components:3,type:"Float32"}],4);mi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const rm=mi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);mi([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Yh=mi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),nm=mi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function sm(i,e,r){return i.sections.forEach(s=>{s.text=function(l,h,p){const m=h.layout.get("text-transform").evaluate(p,{});return m==="uppercase"?l=l.toLocaleUpperCase():m==="lowercase"&&(l=l.toLocaleLowerCase()),Cr.applyArabicShaping&&(l=Cr.applyArabicShaping(l)),l}(s.text,e,r)}),i}mi([{name:"triangle",components:3,type:"Uint16"}]),mi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),mi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),mi([{type:"Float32",name:"offsetX"}]),mi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),mi([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const ol={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Bi=24,Qh=Qt,$h=function(i,e,r,s,l){var h,p,m=8*l-s-1,x=(1<>1,I=-7,C=r?l-1:0,P=r?-1:1,B=i[e+C];for(C+=P,h=B&(1<<-I)-1,B>>=-I,I+=m;I>0;h=256*h+i[e+C],C+=P,I-=8);for(p=h&(1<<-I)-1,h>>=-I,I+=s;I>0;p=256*p+i[e+C],C+=P,I-=8);if(h===0)h=1-T;else{if(h===x)return p?NaN:1/0*(B?-1:1);p+=Math.pow(2,s),h-=T}return(B?-1:1)*p*Math.pow(2,h-s)},ed=function(i,e,r,s,l,h){var p,m,x,T=8*h-l-1,I=(1<>1,P=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=s?0:h-1,R=s?1:-1,U=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(m=isNaN(e)?1:0,p=I):(p=Math.floor(Math.log(e)/Math.LN2),e*(x=Math.pow(2,-p))<1&&(p--,x*=2),(e+=p+C>=1?P/x:P*Math.pow(2,1-C))*x>=2&&(p++,x/=2),p+C>=I?(m=0,p=I):p+C>=1?(m=(e*x-1)*Math.pow(2,l),p+=C):(m=e*Math.pow(2,C-1)*Math.pow(2,l),p=0));l>=8;i[r+B]=255&m,B+=R,m/=256,l-=8);for(p=p<0;i[r+B]=255&p,B+=R,p/=256,T-=8);i[r+B-R]|=128*U};function Qt(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}Qt.Varint=0,Qt.Fixed64=1,Qt.Bytes=2,Qt.Fixed32=5;var ku=4294967296,td=1/ku,id=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function ts(i){return i.type===Qt.Bytes?i.readVarint()+i.pos:i.pos+1}function Na(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function rd(i,e,r){var s=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(s);for(var l=r.pos-1;l>=i;l--)r.buf[l+s]=r.buf[l]}function am(i,e){for(var r=0;r>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function nd(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}Qt.prototype={destroy:function(){this.buf=null},readFields:function(i,e,r){for(r=r||this.length;this.pos>3,h=this.pos;this.type=7&s,i(l,e,this),this.pos===h&&this.skip(s)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=Tc(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=nd(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Tc(this.buf,this.pos)+Tc(this.buf,this.pos+4)*ku;return this.pos+=8,i},readSFixed64:function(){var i=Tc(this.buf,this.pos)+nd(this.buf,this.pos+4)*ku;return this.pos+=8,i},readFloat:function(){var i=$h(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=$h(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,r,s=this.buf;return e=127&(r=s[this.pos++]),r<128?e:(e|=(127&(r=s[this.pos++]))<<7,r<128?e:(e|=(127&(r=s[this.pos++]))<<14,r<128?e:(e|=(127&(r=s[this.pos++]))<<21,r<128?e:function(l,h,p){var m,x,T=p.buf;if(m=(112&(x=T[p.pos++]))>>4,x<128||(m|=(127&(x=T[p.pos++]))<<3,x<128)||(m|=(127&(x=T[p.pos++]))<<10,x<128)||(m|=(127&(x=T[p.pos++]))<<17,x<128)||(m|=(127&(x=T[p.pos++]))<<24,x<128)||(m|=(1&(x=T[p.pos++]))<<31,x<128))return Na(l,m,h);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=s[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&id?function(r,s,l){return id.decode(r.subarray(s,l))}(this.buf,e,i):function(r,s,l){for(var h="",p=s;p239?4:I>223?3:I>191?2:1;if(p+P>l)break;P===1?I<128&&(C=I):P===2?(192&(m=r[p+1]))==128&&(C=(31&I)<<6|63&m)<=127&&(C=null):P===3?(x=r[p+2],(192&(m=r[p+1]))==128&&(192&x)==128&&((C=(15&I)<<12|(63&m)<<6|63&x)<=2047||C>=55296&&C<=57343)&&(C=null)):P===4&&(x=r[p+2],T=r[p+3],(192&(m=r[p+1]))==128&&(192&x)==128&&(192&T)==128&&((C=(15&I)<<18|(63&m)<<12|(63&x)<<6|63&T)<=65535||C>=1114112)&&(C=null)),C===null?(C=65533,P=1):C>65535&&(C-=65536,h+=String.fromCharCode(C>>>10&1023|55296),C=56320|1023&C),h+=String.fromCharCode(C),p+=P}return h}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==Qt.Bytes)return i.push(this.readVarint(e));var r=ts(this);for(i=i||[];this.pos127;);else if(e===Qt.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Qt.Fixed32)this.pos+=4;else{if(e!==Qt.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e268435455||i<0?function(e,r){var s,l;if(e>=0?(s=e%4294967296|0,l=e/4294967296|0):(l=~(-e/4294967296),4294967295^(s=~(-e%4294967296))?s=s+1|0:(s=0,l=l+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(h,p,m){m.buf[m.pos++]=127&h|128,h>>>=7,m.buf[m.pos++]=127&h|128,h>>>=7,m.buf[m.pos++]=127&h|128,h>>>=7,m.buf[m.pos++]=127&h|128,m.buf[m.pos]=127&(h>>>=7)}(s,0,r),function(h,p){var m=(7&h)<<4;p.buf[p.pos++]|=m|((h>>>=3)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.pos++]=127&h)))))}(l,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(s,l,h){for(var p,m,x=0;x55295&&p<57344){if(!m){p>56319||x+1===l.length?(s[h++]=239,s[h++]=191,s[h++]=189):m=p;continue}if(p<56320){s[h++]=239,s[h++]=191,s[h++]=189,m=p;continue}p=m-55296<<10|p-56320|65536,m=null}else m&&(s[h++]=239,s[h++]=191,s[h++]=189,m=null);p<128?s[h++]=p:(p<2048?s[h++]=p>>6|192:(p<65536?s[h++]=p>>12|224:(s[h++]=p>>18|240,s[h++]=p>>12&63|128),s[h++]=p>>6&63|128),s[h++]=63&p|128)}return h}(this.buf,i,this.pos);var r=this.pos-e;r>=128&&rd(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),ed(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),ed(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&rd(r,s,this),this.pos=r-1,this.writeVarint(s),this.pos+=s},writeMessage:function(i,e,r){this.writeTag(i,Qt.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,am,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,om,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,um,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,lm,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,cm,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,hm,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,dm,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,pm,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,fm,e)},writeBytesField:function(i,e){this.writeTag(i,Qt.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,Qt.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,Qt.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,Qt.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,Qt.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,Qt.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,Qt.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,Qt.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,Qt.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,Qt.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,!!e)}};var Cu=O(Qh);const Eu=3;function mm(i,e,r){i===1&&r.readMessage(gm,e)}function gm(i,e,r){if(i===3){const{id:s,bitmap:l,width:h,height:p,left:m,top:x,advance:T}=r.readMessage(_m,{});e.push({id:s,bitmap:new el({width:h+2*Eu,height:p+2*Eu},l),metrics:{width:h,height:p,left:m,top:x,advance:T}})}}function _m(i,e,r){i===1?e.id=r.readVarint():i===2?e.bitmap=r.readBytes():i===3?e.width=r.readVarint():i===4?e.height=r.readVarint():i===5?e.left=r.readSVarint():i===6?e.top=r.readSVarint():i===7&&(e.advance=r.readVarint())}const sd=Eu;function ad(i){let e=0,r=0;for(const p of i)e+=p.w*p.h,r=Math.max(r,p.w);i.sort((p,m)=>m.h-p.h);const s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let l=0,h=0;for(const p of i)for(let m=s.length-1;m>=0;m--){const x=s[m];if(!(p.w>x.w||p.h>x.h)){if(p.x=x.x,p.y=x.y,h=Math.max(h,p.y+p.h),l=Math.max(l,p.x+p.w),p.w===x.w&&p.h===x.h){const T=s.pop();m=0&&s>=e&&Ic[this.text.charCodeAt(s)];s--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const s=new ja;return s.text=this.text.substring(e,r),s.sectionIndex=this.sectionIndex.slice(e,r),s.sections=this.sections,s}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(cl.forText(e.scale,e.fontStack||r));const s=this.sections.length-1;for(let l=0;l=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Sc(i,e,r,s,l,h,p,m,x,T,I,C,P,B,R,U){const W=ja.fromFeature(i,l);let J;C===o.ai.vertical&&W.verticalizePunctuation();const{processBidirectionalText:se,processStyledBidirectionalText:Q}=Cr;if(se&&W.sections.length===1){J=[];const xe=se(W.toString(),Pu(W,T,h,e,s,B,R));for(const Be of xe){const Ne=new ja;Ne.text=Be,Ne.sections=W.sections;for(let De=0;De0&&rs>Pr&&(Pr=rs)}else{const Xr=Ne[kt.fontStack],Lr=Xr&&Xr[rr];if(Lr&&Lr.rect)Tn=Lr.rect,dn=Lr.metrics;else{const rs=Be[kt.fontStack],fl=rs&&rs[rr];if(!fl)continue;dn=fl.metrics}Ni=(Oi-kt.scale)*Bi}pn?(xe.verticalizable=!0,cr.push({glyph:rr,imageName:Sn,x:oi,y:hi+Ni,vertical:pn,scale:kt.scale,fontStack:kt.fontStack,sectionIndex:ur,metrics:dn,rect:Tn}),oi+=is*kt.scale+Ke):(cr.push({glyph:rr,imageName:Sn,x:oi,y:hi+Ni,vertical:pn,scale:kt.scale,fontStack:kt.fontStack,sectionIndex:ur,metrics:dn,rect:Tn}),oi+=dn.advance*kt.scale+Ke)}cr.length!==0&&(Ri=Math.max(oi-Ke,Ri),vm(cr,0,cr.length-1,yr,Pr)),oi=0;const Dr=Me*Oi+Pr;br.lineOffset=Math.max(Pr,lr),hi+=Dr,Gr=Math.max(Dr,Gr),++zi}var Ki;const ir=hi-ll,{horizontalAlign:xr,verticalAlign:vr}=Du(Fe);(function(Fi,Oi,lr,br,cr,Pr,Dr,Vi,kt){const ur=(Oi-lr)*cr;let rr=0;rr=Pr!==Dr?-Vi*br-ll:(-br*kt+.5)*Dr;for(const Ni of Fi)for(const dn of Ni.positionedGlyphs)dn.x+=ur,dn.y+=rr})(xe.positionedLines,yr,xr,vr,Ri,Gr,Me,ir,Pe.length),xe.top+=-vr*ir,xe.bottom=xe.top+ir,xe.left+=-xr*Ri,xe.right=xe.left+Ri}(he,e,r,s,J,p,m,x,C,T,P,U),!function(xe){for(const Be of xe)if(Be.positionedGlyphs.length!==0)return!1;return!0}(oe)&&he}const Ic={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ym={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function ld(i,e,r,s,l,h){if(e.imageName){const p=s[e.imageName];return p?p.displaySize[0]*e.scale*Bi/h+l:0}{const p=r[e.fontStack],m=p&&p[i];return m?m.metrics.advance*e.scale+l:0}}function cd(i,e,r,s){const l=Math.pow(i-e,2);return s?i=0;let I=0;for(let P=0;Pp.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=fu([]),this.placementViewportMatrix=fu([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=pd(this.zoom,r["text-size"]),this.iconSizeData=pd(this.zoom,r["icon-size"]);const s=this.layers[0].layout,l=s.get("symbol-sort-key"),h=s.get("symbol-z-order");this.canOverlap=Lu(s,"text-overlap","text-allow-overlap")!=="never"||Lu(s,"icon-overlap","icon-allow-overlap")!=="never"||s.get("text-ignore-placement")||s.get("icon-ignore-placement"),this.sortFeaturesByKey=h!=="viewport-y"&&!l.isConstant(),this.sortFeaturesByY=(h==="viewport-y"||h==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,s.get("symbol-placement")==="point"&&(this.writingModes=s.get("text-writing-mode").map(p=>o.ai[p])),this.stateDependentLayerIds=this.layers.filter(p=>p.isStateDependent()).map(p=>p.id),this.sourceID=e.sourceID}createArrays(){this.text=new Ru(new wn(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Ru(new wn(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new ie,this.lineVertexArray=new de,this.symbolInstances=new K,this.textAnchorOffsets=new ye}calculateGlyphDependencies(e,r,s,l,h){for(let p=0;p0)&&(p.value.kind!=="constant"||p.value.value.length>0),I=x.value.kind!=="constant"||!!x.value.value||Object.keys(x.parameters).length>0,C=h.get("symbol-sort-key");if(this.features=[],!T&&!I)return;const P=r.iconDependencies,B=r.glyphDependencies,R=r.availableImages,U=new si(this.zoom);for(const{feature:W,id:J,index:se,sourceLayerIndex:Q}of e){const oe=l._featureFilter.needGeometry,he=Xs(W,oe);if(!l._featureFilter.filter(U,he,s))continue;let xe,Be;if(oe||(he.geometry=Ws(W)),T){const De=l.getValueAndResolveTokens("text-field",he,s,R),Pe=$i.factory(De);Sm(Pe)&&(this.hasRTLText=!0),(!this.hasRTLText||Uo()==="unavailable"||this.hasRTLText&&Cr.isParsed())&&(xe=sm(Pe,l,he))}if(I){const De=l.getValueAndResolveTokens("icon-image",he,s,R);Be=De instanceof Hi?De:Hi.fromString(De)}if(!xe&&!Be)continue;const Ne=this.sortFeaturesByKey?C.evaluate(he,{},s):void 0;if(this.features.push({id:J,text:xe,icon:Be,index:se,sourceLayerIndex:Q,geometry:he.geometry,properties:W.properties,type:wm[W.type],sortKey:Ne}),Be&&(P[Be.name]=!0),xe){const De=p.evaluate(he,{},s).join(","),Pe=h.get("text-rotation-alignment")!=="viewport"&&h.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(o.ai.vertical)>=0;for(const Me of xe.sections)if(Me.image)P[Me.image.name]=!0;else{const Fe=Do(xe.toString()),Ce=Me.fontStack||De,Se=B[Ce]=B[Ce]||{};this.calculateGlyphDependencies(Me.text,Se,Pe,this.allowVerticalPlacement,Fe)}}}h.get("symbol-placement")==="line"&&(this.features=function(W){const J={},se={},Q=[];let oe=0;function he(De){Q.push(W[De]),oe++}function xe(De,Pe,Me){const Fe=se[De];return delete se[De],se[Pe]=Fe,Q[Fe].geometry[0].pop(),Q[Fe].geometry[0]=Q[Fe].geometry[0].concat(Me[0]),Fe}function Be(De,Pe,Me){const Fe=J[Pe];return delete J[Pe],J[De]=Fe,Q[Fe].geometry[0].shift(),Q[Fe].geometry[0]=Me[0].concat(Q[Fe].geometry[0]),Fe}function Ne(De,Pe,Me){const Fe=Me?Pe[0][Pe[0].length-1]:Pe[0][0];return`${De}:${Fe.x}:${Fe.y}`}for(let De=0;DeDe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((W,J)=>W.sortKey-J.sortKey)}update(e,r,s){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,s),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,s))}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.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){const s=this.lineVertexArray.length;if(e.segment!==void 0){let l=e.dist(r[e.segment+1]),h=e.dist(r[e.segment]);const p={};for(let m=e.segment+1;m=0;m--)p[m]={x:r[m].x,y:r[m].y,tileUnitDistanceFromAnchor:h},m>0&&(h+=r[m-1].dist(r[m]));for(let m=0;m0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,r){const s=e.placedSymbolArray.get(r),l=s.vertexStartIndex+4*s.numGlyphs;for(let h=s.vertexStartIndex;hl[m]-l[x]||h[x]-h[m]),p}addToSortKeyRanges(e,r){const s=this.sortKeyRanges[this.sortKeyRanges.length-1];s&&s.sortKey===r?s.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,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 r of this.symbolInstanceIndexes){const s=this.symbolInstances.get(r);this.featureSortOrder.push(s.featureIndex),[s.rightJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.leftJustifiedTextSymbolIndex].forEach((l,h,p)=>{l>=0&&p.indexOf(l)===h&&this.addIndicesForPlacedSymbol(this.text,l)}),s.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,s.verticalPlacedTextSymbolIndex),s.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.placedIconSymbolIndex),s.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let fd,md;Re("SymbolBucket",qa,{omit:["layers","collisionBoxArray","features","compareText"]}),qa.MAX_GLYPHS=65535,qa.addDynamicAttributes=Bu;var Ou={get paint(){return md=md||new Ii({"icon-opacity":new tt(fe.paint_symbol["icon-opacity"]),"icon-color":new tt(fe.paint_symbol["icon-color"]),"icon-halo-color":new tt(fe.paint_symbol["icon-halo-color"]),"icon-halo-width":new tt(fe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new tt(fe.paint_symbol["icon-halo-blur"]),"icon-translate":new Ze(fe.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ze(fe.paint_symbol["icon-translate-anchor"]),"text-opacity":new tt(fe.paint_symbol["text-opacity"]),"text-color":new tt(fe.paint_symbol["text-color"],{runtimeType:sr,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new tt(fe.paint_symbol["text-halo-color"]),"text-halo-width":new tt(fe.paint_symbol["text-halo-width"]),"text-halo-blur":new tt(fe.paint_symbol["text-halo-blur"]),"text-translate":new Ze(fe.paint_symbol["text-translate"]),"text-translate-anchor":new Ze(fe.paint_symbol["text-translate-anchor"])})},get layout(){return fd=fd||new Ii({"symbol-placement":new Ze(fe.layout_symbol["symbol-placement"]),"symbol-spacing":new Ze(fe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ze(fe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new tt(fe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ze(fe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ze(fe.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ze(fe.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ze(fe.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ze(fe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ze(fe.layout_symbol["icon-rotation-alignment"]),"icon-size":new tt(fe.layout_symbol["icon-size"]),"icon-text-fit":new Ze(fe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ze(fe.layout_symbol["icon-text-fit-padding"]),"icon-image":new tt(fe.layout_symbol["icon-image"]),"icon-rotate":new tt(fe.layout_symbol["icon-rotate"]),"icon-padding":new tt(fe.layout_symbol["icon-padding"]),"icon-keep-upright":new Ze(fe.layout_symbol["icon-keep-upright"]),"icon-offset":new tt(fe.layout_symbol["icon-offset"]),"icon-anchor":new tt(fe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ze(fe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ze(fe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ze(fe.layout_symbol["text-rotation-alignment"]),"text-field":new tt(fe.layout_symbol["text-field"]),"text-font":new tt(fe.layout_symbol["text-font"]),"text-size":new tt(fe.layout_symbol["text-size"]),"text-max-width":new tt(fe.layout_symbol["text-max-width"]),"text-line-height":new Ze(fe.layout_symbol["text-line-height"]),"text-letter-spacing":new tt(fe.layout_symbol["text-letter-spacing"]),"text-justify":new tt(fe.layout_symbol["text-justify"]),"text-radial-offset":new tt(fe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ze(fe.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new tt(fe.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new tt(fe.layout_symbol["text-anchor"]),"text-max-angle":new Ze(fe.layout_symbol["text-max-angle"]),"text-writing-mode":new Ze(fe.layout_symbol["text-writing-mode"]),"text-rotate":new tt(fe.layout_symbol["text-rotate"]),"text-padding":new Ze(fe.layout_symbol["text-padding"]),"text-keep-upright":new Ze(fe.layout_symbol["text-keep-upright"]),"text-transform":new tt(fe.layout_symbol["text-transform"]),"text-offset":new tt(fe.layout_symbol["text-offset"]),"text-allow-overlap":new Ze(fe.layout_symbol["text-allow-overlap"]),"text-overlap":new Ze(fe.layout_symbol["text-overlap"]),"text-ignore-placement":new Ze(fe.layout_symbol["text-ignore-placement"]),"text-optional":new Ze(fe.layout_symbol["text-optional"])})}};class gd{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:mn,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.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}}Re("FormatSectionOverride",gd,{omit:["defaultValue"]});class Mc extends qr{constructor(e){super(e,Ou)}recalculate(e,r){if(super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const s=this.layout.get("text-writing-mode");if(s){const l=[];for(const h of s)l.indexOf(h)<0&&l.push(h);this.layout._values["text-writing-mode"]=l}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,s,l){const h=this.layout.get(e).evaluate(r,{},s,l),p=this._unevaluatedLayout._values[e];return p.isDataDriven()||Ta(p.value)||!h?h:function(m,x){return x.replace(/{([^{}]+)}/g,(T,I)=>m&&I in m?String(m[I]):"")}(r.properties,h)}createBucket(e){return new qa(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of Ou.paint.overridableProperties){if(!Mc.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),s=new gd(r),l=new Mo(s,r.property.specification);let h=null;h=r.value.kind==="constant"||r.value.kind==="source"?new ko("source",l):new Ia("composite",l,r.value.zoomStops),this.paint._values[e]=new ar(r.property,h,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,s){return!(!this.layout||r.isDataDriven()||s.isDataDriven())&&Mc.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const s=e.get("text-field"),l=Ou.paint.properties[r];let h=!1;const p=m=>{for(const x of m)if(l.overrides&&l.overrides.hasOverride(x))return void(h=!0)};if(s.value.kind==="constant"&&s.value.value instanceof $i)p(s.value.value.sections);else if(s.value.kind==="source"){const m=T=>{h||(T instanceof qn&&di(T.value)===Z?p(T.value.sections):T instanceof wa?p(T.sections):T.eachChild(m))},x=s.value;x._styleExpression&&m(x._styleExpression.expression)}return h}}let _d;var Im={get paint(){return _d=_d||new Ii({"background-color":new Ze(fe.paint_background["background-color"]),"background-pattern":new qo(fe.paint_background["background-pattern"]),"background-opacity":new Ze(fe.paint_background["background-opacity"])})}};class Am extends qr{constructor(e){super(e,Im)}}let yd;var Mm={get paint(){return yd=yd||new Ii({"raster-opacity":new Ze(fe.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ze(fe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ze(fe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ze(fe.paint_raster["raster-brightness-max"]),"raster-saturation":new Ze(fe.paint_raster["raster-saturation"]),"raster-contrast":new Ze(fe.paint_raster["raster-contrast"]),"raster-resampling":new Ze(fe.paint_raster["raster-resampling"]),"raster-fade-duration":new Ze(fe.paint_raster["raster-fade-duration"])})}};class km extends qr{constructor(e){super(e,Mm)}}class Cm extends qr{constructor(e){super(e,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Em{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const Vu=63710088e-1;class As{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new As(st(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,s=this.lat*r,l=e.lat*r,h=Math.sin(s)*Math.sin(l)+Math.cos(s)*Math.cos(l)*Math.cos((e.lng-this.lng)*r);return Vu*Math.acos(Math.min(h,1))}static convert(e){if(e instanceof As)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new As(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new As(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 [, ]")}}const xd=2*Math.PI*Vu;function vd(i){return xd*Math.cos(i*Math.PI/180)}function bd(i){return(180+i)/360}function wd(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function Td(i,e){return i/vd(e)}function Sd(i){return 360*i-180}function Nu(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class kc{constructor(e,r,s=0){this.x=+e,this.y=+r,this.z=+s}static fromLngLat(e,r=0){const s=As.convert(e);return new kc(bd(s.lng),wd(s.lat),Td(r,s.lat))}toLngLat(){return new As(Sd(this.x),Nu(this.y))}toAltitude(){return this.z*vd(Nu(this.y))}meterInMercatorCoordinateUnits(){return 1/xd*(e=Nu(this.y),1/Math.cos(e*Math.PI/180));var e}}function Id(i,e,r){var s=2*Math.PI*6378137/256/Math.pow(2,r);return[i*s-2*Math.PI*6378137/2,e*s-2*Math.PI*6378137/2]}class Uu{constructor(e,r,s){if(e<0||e>25||s<0||s>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, y=${s}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=r,this.y=s,this.key=hl(0,e,e,r,s)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,s){const l=(p=this.y,m=this.z,x=Id(256*(h=this.x),256*(p=Math.pow(2,m)-p-1),m),T=Id(256*(h+1),256*(p+1),m),x[0]+","+x[1]+","+T[0]+","+T[1]);var h,p,m,x,T;const I=function(C,P,B){let R,U="";for(let W=C;W>0;W--)R=1<1?"@2x":"").replace(/{quadkey}/g,I).replace(/{bbox-epsg-3857}/g,l)}isChildOf(e){const r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){const r=Math.pow(2,this.z);return new ge((e.x*r-this.x)*Ei,(e.y*r-this.y)*Ei)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Ad{constructor(e,r){this.wrap=e,this.canonical=r,this.key=hl(e,r.z,r.z,r.x,r.y)}}class Wr{constructor(e,r,s,l,h){if(e= z; overscaledZ = ${e}; z = ${s}`);this.overscaledZ=e,this.wrap=r,this.canonical=new Uu(s,+l,+h),this.key=hl(r,e,s,l,h)}clone(){return new Wr(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?new Wr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Wr(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const s=this.canonical.z-e;return e>this.canonical.z?hl(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):hl(this.wrap*+r,e,e,this.canonical.x>>s,this.canonical.y>>s)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new Wr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,s=2*this.canonical.x,l=2*this.canonical.y;return[new Wr(r,this.wrap,r,s,l),new Wr(r,this.wrap,r,s+1,l),new Wr(r,this.wrap,r,s,l+1),new Wr(r,this.wrap,r,s+1,l+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.ythis.max&&(this.max=C),C=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}unpack(e,r,s){return e*this.redFactor+r*this.greenFactor+s*this.blueFactor-this.baseShift}getPixels(){return new Hr({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,s){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let l=r*this.dim,h=r*this.dim+this.dim,p=s*this.dim,m=s*this.dim+this.dim;switch(r){case-1:l=h-1;break;case 1:h=l+1}switch(s){case-1:p=m-1;break;case 1:m=p+1}const x=-r*this.dim,T=-s*this.dim;for(let I=p;I=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class Cd{constructor(e,r,s,l,h){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=s,e._y=l,this.properties=e.properties,this.id=h}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(e[r]=this[r]);return e}}class Ed{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new ys(Ei,16,0),this.grid3D=new ys(Ei,16,0),this.featureIndexArray=new we,this.promoteId=r}insert(e,r,s,l,h,p){const m=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(s,l,h);const x=p?this.grid3D:this.grid;for(let T=0;T=0&&C[3]>=0&&x.insert(m,C[0],C[1],C[2],C[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Ts.VectorTile(new Cu(this.rawTileData)).layers,this.sourceLayerCoder=new kd(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,s,l){this.loadVTLayers();const h=e.params||{},p=Ei/e.tileSize/e.scale,m=Eo(h.filter),x=e.queryGeometry,T=e.queryPadding*p,I=Pd(x),C=this.grid.query(I.minX-T,I.minY-T,I.maxX+T,I.maxY+T),P=Pd(e.cameraQueryGeometry),B=this.grid3D.query(P.minX-T,P.minY-T,P.maxX+T,P.maxY+T,(W,J,se,Q)=>function(oe,he,xe,Be,Ne){for(const Pe of oe)if(he<=Pe.x&&xe<=Pe.y&&Be>=Pe.x&&Ne>=Pe.y)return!0;const De=[new ge(he,xe),new ge(he,Ne),new ge(Be,Ne),new ge(Be,xe)];if(oe.length>2){for(const Pe of De)if(Ra(oe,Pe))return!0}for(let Pe=0;Pe(Q||(Q=Ws(oe)),he.queryIntersectsFeature(x,oe,xe,Q,this.z,e.transform,p,e.pixelPosMatrix)))}return R}loadMatchingFeature(e,r,s,l,h,p,m,x,T,I,C){const P=this.bucketLayerIDs[r];if(p&&!function(W,J){for(let se=0;se=0)return!0;return!1}(p,P))return;const B=this.sourceLayerCoder.decode(s),R=this.vtLayers[B].feature(l);if(h.needGeometry){const W=Xs(R,!0);if(!h.filter(new si(this.tileID.overscaledZ),W,this.tileID.canonical))return}else if(!h.filter(new si(this.tileID.overscaledZ),R))return;const U=this.getId(R,B);for(let W=0;W{const m=e instanceof La?e.get(p):null;return m&&m.evaluate?m.evaluate(r,s,l):m})}function Pd(i){let e=1/0,r=1/0,s=-1/0,l=-1/0;for(const h of i)e=Math.min(e,h.x),r=Math.min(r,h.y),s=Math.max(s,h.x),l=Math.max(l,h.y);return{minX:e,minY:r,maxX:s,maxY:l}}function zm(i,e){return e-i}function Dd(i,e,r,s,l){const h=[];for(let p=0;p=s&&C.x>=s||(I.x>=s?I=new ge(s,I.y+(s-I.x)/(C.x-I.x)*(C.y-I.y))._round():C.x>=s&&(C=new ge(s,I.y+(s-I.x)/(C.x-I.x)*(C.y-I.y))._round()),I.y>=l&&C.y>=l||(I.y>=l?I=new ge(I.x+(l-I.y)/(C.y-I.y)*(C.x-I.x),l)._round():C.y>=l&&(C=new ge(I.x+(l-I.y)/(C.y-I.y)*(C.x-I.x),l)._round()),x&&I.equals(x[x.length-1])||(x=[I],h.push(x)),x.push(C)))))}}return h}Re("FeatureIndex",Ed,{omit:["rawTileData","sourceLayerCoder"]});class Ms extends ge{constructor(e,r,s,l){super(e,r),this.angle=s,l!==void 0&&(this.segment=l)}clone(){return new Ms(this.x,this.y,this.angle,this.segment)}}function Ld(i,e,r,s,l){if(e.segment===void 0||r===0)return!0;let h=e,p=e.segment+1,m=0;for(;m>-r/2;){if(p--,p<0)return!1;m-=i[p].dist(h),h=i[p]}m+=i[p].dist(i[p+1]),p++;const x=[];let T=0;for(;ms;)T-=x.shift().angleDelta;if(T>l)return!1;p++,m+=I.dist(C)}return!0}function Bd(i){let e=0;for(let r=0;rT){const R=(T-x)/B,U=Ar.number(C.x,P.x,R),W=Ar.number(C.y,P.y,R),J=new Ms(U,W,P.angleTo(C),I);return J._round(),!p||Ld(i,J,m,p,e)?J:void 0}x+=B}}function Dm(i,e,r,s,l,h,p,m,x){const T=Rd(s,h,p),I=Fd(s,l),C=I*p,P=i[0].x===0||i[0].x===x||i[0].y===0||i[0].y===x;return e-C=0&&oe=0&&he=0&&P+T<=I){const xe=new Ms(oe,he,se,R);xe._round(),s&&!Ld(i,xe,h,s,l)||B.push(xe)}}C+=J}return m||B.length||p||(B=Od(i,C/2,r,s,l,h,p,!0,x)),B}Re("Anchor",Ms);const Za=zr;function Vd(i,e,r,s){const l=[],h=i.image,p=h.pixelRatio,m=h.paddedRect.w-2*Za,x=h.paddedRect.h-2*Za,T=i.right-i.left,I=i.bottom-i.top,C=h.stretchX||[[0,m]],P=h.stretchY||[[0,x]],B=(Me,Fe)=>Me+Fe[1]-Fe[0],R=C.reduce(B,0),U=P.reduce(B,0),W=m-R,J=x-U;let se=0,Q=R,oe=0,he=U,xe=0,Be=W,Ne=0,De=J;if(h.content&&s){const Me=h.content;se=Cc(C,0,Me[0]),oe=Cc(P,0,Me[1]),Q=Cc(C,Me[0],Me[2]),he=Cc(P,Me[1],Me[3]),xe=Me[0]-se,Ne=Me[1]-oe,Be=Me[2]-Me[0]-Q,De=Me[3]-Me[1]-he}const Pe=(Me,Fe,Ce,Se)=>{const Ke=Ec(Me.stretch-se,Q,T,i.left),je=zc(Me.fixed-xe,Be,Me.stretch,R),wt=Ec(Fe.stretch-oe,he,I,i.top),oi=zc(Fe.fixed-Ne,De,Fe.stretch,U),hi=Ec(Ce.stretch-se,Q,T,i.left),Ri=zc(Ce.fixed-xe,Be,Ce.stretch,R),Gr=Ec(Se.stretch-oe,he,I,i.top),yr=zc(Se.fixed-Ne,De,Se.stretch,U),zi=new ge(Ke,wt),Ki=new ge(hi,wt),ir=new ge(hi,Gr),xr=new ge(Ke,Gr),vr=new ge(je/p,oi/p),Fi=new ge(Ri/p,yr/p),Oi=e*Math.PI/180;if(Oi){const cr=Math.sin(Oi),Pr=Math.cos(Oi),Dr=[Pr,-cr,cr,Pr];zi._matMult(Dr),Ki._matMult(Dr),xr._matMult(Dr),ir._matMult(Dr)}const lr=Me.stretch+Me.fixed,br=Fe.stretch+Fe.fixed;return{tl:zi,tr:Ki,bl:xr,br:ir,tex:{x:h.paddedRect.x+Za+lr,y:h.paddedRect.y+Za+br,w:Ce.stretch+Ce.fixed-lr,h:Se.stretch+Se.fixed-br},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:vr,pixelOffsetBR:Fi,minFontScaleX:Be/p/T,minFontScaleY:De/p/I,isSDF:r}};if(s&&(h.stretchX||h.stretchY)){const Me=Nd(C,W,R),Fe=Nd(P,J,U);for(let Ce=0;Ce0&&(R=Math.max(10,R),this.circleDiameter=R)}else{let C=p.top*m-x[0],P=p.bottom*m+x[2],B=p.left*m-x[3],R=p.right*m+x[1];const U=p.collisionPadding;if(U&&(B-=U[0]*m,C-=U[1]*m,R+=U[2]*m,P+=U[3]*m),I){const W=new ge(B,C),J=new ge(R,C),se=new ge(B,P),Q=new ge(R,P),oe=I*Math.PI/180;W._rotate(oe),J._rotate(oe),se._rotate(oe),Q._rotate(oe),B=Math.min(W.x,J.x,se.x,Q.x),R=Math.max(W.x,J.x,se.x,Q.x),C=Math.min(W.y,J.y,se.y,Q.y),P=Math.max(W.y,J.y,se.y,Q.y)}e.emplaceBack(r.x,r.y,B,C,R,P,s,l,h)}this.boxEndIndex=e.length}}class Lm{constructor(e=[],r=Bm){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let s=(this.length>>1)-1;s>=0;s--)this._down(s)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:s}=this,l=r[e];for(;e>0;){const h=e-1>>1,p=r[h];if(s(l,p)>=0)break;r[e]=p,e=h}r[e]=l}_down(e){const{data:r,compare:s}=this,l=this.length>>1,h=r[e];for(;e=0)break;r[e]=m,e=p}r[e]=h}}function Bm(i,e){return ie?1:0}function Rm(i,e=1,r=!1){let s=1/0,l=1/0,h=-1/0,p=-1/0;const m=i[0];for(let B=0;Bh)&&(h=R.x),(!B||R.y>p)&&(p=R.y)}const x=Math.min(h-s,p-l);let T=x/2;const I=new Lm([],Fm);if(x===0)return new ge(s,l);for(let B=s;BC.d||!C.d)&&(C=B,r&&console.log("found best %d after %d probes",Math.round(1e4*B.d)/1e4,P)),B.max-C.d<=e||(T=B.h/2,I.push(new Ga(B.p.x-T,B.p.y-T,T,i)),I.push(new Ga(B.p.x+T,B.p.y-T,T,i)),I.push(new Ga(B.p.x-T,B.p.y+T,T,i)),I.push(new Ga(B.p.x+T,B.p.y+T,T,i)),P+=4)}return r&&(console.log(`num probes: ${P}`),console.log(`best distance: ${C.d}`)),C.p}function Fm(i,e){return e.max-i.max}function Ga(i,e,r,s){this.p=new ge(i,e),this.h=r,this.d=function(l,h){let p=!1,m=1/0;for(let x=0;xl.y!=R.y>l.y&&l.x<(R.x-B.x)*(l.y-B.y)/(R.y-B.y)+B.x&&(p=!p),m=Math.min(m,wh(l,B,R))}}return(p?1:-1)*Math.sqrt(m)}(this.p,s),this.max=this.d+this.h*Math.SQRT2}var tr;o.aq=void 0,(tr=o.aq||(o.aq={}))[tr.center=1]="center",tr[tr.left=2]="left",tr[tr.right=3]="right",tr[tr.top=4]="top",tr[tr.bottom=5]="bottom",tr[tr["top-left"]=6]="top-left",tr[tr["top-right"]=7]="top-right",tr[tr["bottom-left"]=8]="bottom-left",tr[tr["bottom-right"]=9]="bottom-right";const ks=7,ju=Number.POSITIVE_INFINITY;function Ud(i,e){return e[1]!==ju?function(r,s,l){let h=0,p=0;switch(s=Math.abs(s),l=Math.abs(l),r){case"top-right":case"top-left":case"top":p=l-ks;break;case"bottom-right":case"bottom-left":case"bottom":p=-l+ks}switch(r){case"top-right":case"bottom-right":case"right":h=-s;break;case"top-left":case"bottom-left":case"left":h=s}return[h,p]}(i,e[0],e[1]):function(r,s){let l=0,h=0;s<0&&(s=0);const p=s/Math.SQRT2;switch(r){case"top-right":case"top-left":h=p-ks;break;case"bottom-right":case"bottom-left":h=-p+ks;break;case"bottom":h=-s+ks;break;case"top":h=s-ks}switch(r){case"top-right":case"bottom-right":l=-p;break;case"top-left":case"bottom-left":l=p;break;case"left":l=s;break;case"right":l=-s}return[l,h]}(i,e[0])}function jd(i,e,r){var s;const l=i.layout,h=(s=l.get("text-variable-anchor-offset"))===null||s===void 0?void 0:s.evaluate(e,{},r);if(h){const m=h.values,x=[];for(let T=0;TP*Bi);I.startsWith("top")?C[1]-=ks:I.startsWith("bottom")&&(C[1]+=ks),x[T+1]=C}return new Vr(x)}const p=l.get("text-variable-anchor");if(p){let m;m=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[l.get("text-radial-offset").evaluate(e,{},r)*Bi,ju]:l.get("text-offset").evaluate(e,{},r).map(T=>T*Bi);const x=[];for(const T of p)x.push(T,Ud(T,m));return new Vr(x)}return null}function qu(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Om(i,e,r,s,l,h,p,m,x,T,I){let C=h.textMaxSize.evaluate(e,{});C===void 0&&(C=p);const P=i.layers[0].layout,B=P.get("icon-offset").evaluate(e,{},I),R=Zd(r.horizontal),U=p/24,W=i.tilePixelRatio*U,J=i.tilePixelRatio*C/24,se=i.tilePixelRatio*m,Q=i.tilePixelRatio*P.get("symbol-spacing"),oe=P.get("text-padding")*i.tilePixelRatio,he=function(Se,Ke,je,wt=1){const oi=Se.get("icon-padding").evaluate(Ke,{},je),hi=oi&&oi.values;return[hi[0]*wt,hi[1]*wt,hi[2]*wt,hi[3]*wt]}(P,e,I,i.tilePixelRatio),xe=P.get("text-max-angle")/180*Math.PI,Be=P.get("text-rotation-alignment")!=="viewport"&&P.get("symbol-placement")!=="point",Ne=P.get("icon-rotation-alignment")==="map"&&P.get("symbol-placement")!=="point",De=P.get("symbol-placement"),Pe=Q/2,Me=P.get("icon-text-fit");let Fe;s&&Me!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(Fe=dd(s,r.vertical,Me,P.get("icon-text-fit-padding"),B,U)),R&&(s=dd(s,R,Me,P.get("icon-text-fit-padding"),B,U)));const Ce=(Se,Ke)=>{Ke.x<0||Ke.x>=Ei||Ke.y<0||Ke.y>=Ei||function(je,wt,oi,hi,Ri,Gr,yr,zi,Ki,ir,xr,vr,Fi,Oi,lr,br,cr,Pr,Dr,Vi,kt,ur,rr,Ni,dn){const Tn=je.addToLineVertexArray(wt,oi);let Sn,is,pn,Xr,Lr=0,rs=0,fl=0,Xd=0,Yu=-1,Qu=-1;const ns={};let Kd=Qn("");if(je.allowVerticalPlacement&&hi.vertical){const hr=zi.layout.get("text-rotate").evaluate(kt,{},Ni)+90;pn=new Pc(Ki,wt,ir,xr,vr,hi.vertical,Fi,Oi,lr,hr),yr&&(Xr=new Pc(Ki,wt,ir,xr,vr,yr,cr,Pr,lr,hr))}if(Ri){const hr=zi.layout.get("icon-rotate").evaluate(kt,{}),Kr=zi.layout.get("icon-text-fit")!=="none",Js=Vd(Ri,hr,rr,Kr),An=yr?Vd(yr,hr,rr,Kr):void 0;is=new Pc(Ki,wt,ir,xr,vr,Ri,cr,Pr,!1,hr),Lr=4*Js.length;const Ys=je.iconSizeData;let Vn=null;Ys.kind==="source"?(Vn=[On*zi.layout.get("icon-size").evaluate(kt,{})],Vn[0]>Is&<(`${je.layerIds[0]}: Value for "icon-size" is >= ${ul}. Reduce your "icon-size".`)):Ys.kind==="composite"&&(Vn=[On*ur.compositeIconSizes[0].evaluate(kt,{},Ni),On*ur.compositeIconSizes[1].evaluate(kt,{},Ni)],(Vn[0]>Is||Vn[1]>Is)&<(`${je.layerIds[0]}: Value for "icon-size" is >= ${ul}. Reduce your "icon-size".`)),je.addSymbols(je.icon,Js,Vn,Vi,Dr,kt,o.ai.none,wt,Tn.lineStartIndex,Tn.lineLength,-1,Ni),Yu=je.icon.placedSymbolArray.length-1,An&&(rs=4*An.length,je.addSymbols(je.icon,An,Vn,Vi,Dr,kt,o.ai.vertical,wt,Tn.lineStartIndex,Tn.lineLength,-1,Ni),Qu=je.icon.placedSymbolArray.length-1)}const Jd=Object.keys(hi.horizontal);for(const hr of Jd){const Kr=hi.horizontal[hr];if(!Sn){Kd=Qn(Kr.text);const An=zi.layout.get("text-rotate").evaluate(kt,{},Ni);Sn=new Pc(Ki,wt,ir,xr,vr,Kr,Fi,Oi,lr,An)}const Js=Kr.positionedLines.length===1;if(fl+=qd(je,wt,Kr,Gr,zi,lr,kt,br,Tn,hi.vertical?o.ai.horizontal:o.ai.horizontalOnly,Js?Jd:[hr],ns,Yu,ur,Ni),Js)break}hi.vertical&&(Xd+=qd(je,wt,hi.vertical,Gr,zi,lr,kt,br,Tn,o.ai.vertical,["vertical"],ns,Qu,ur,Ni));const Um=Sn?Sn.boxStartIndex:je.collisionBoxArray.length,jm=Sn?Sn.boxEndIndex:je.collisionBoxArray.length,qm=pn?pn.boxStartIndex:je.collisionBoxArray.length,Zm=pn?pn.boxEndIndex:je.collisionBoxArray.length,Gm=is?is.boxStartIndex:je.collisionBoxArray.length,Hm=is?is.boxEndIndex:je.collisionBoxArray.length,Wm=Xr?Xr.boxStartIndex:je.collisionBoxArray.length,Xm=Xr?Xr.boxEndIndex:je.collisionBoxArray.length;let In=-1;const Lc=(hr,Kr)=>hr&&hr.circleDiameter?Math.max(hr.circleDiameter,Kr):Kr;In=Lc(Sn,In),In=Lc(pn,In),In=Lc(is,In),In=Lc(Xr,In);const Yd=In>-1?1:0;Yd&&(In*=dn/Bi),je.glyphOffsetArray.length>=qa.MAX_GLYPHS&<("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),kt.sortKey!==void 0&&je.addToSortKeyRanges(je.symbolInstances.length,kt.sortKey);const Km=jd(zi,kt,Ni),[Jm,Ym]=function(hr,Kr){const Js=hr.length,An=Kr==null?void 0:Kr.values;if((An==null?void 0:An.length)>0)for(let Ys=0;Ys=0?ns.right:-1,ns.center>=0?ns.center:-1,ns.left>=0?ns.left:-1,ns.vertical||-1,Yu,Qu,Kd,Um,jm,qm,Zm,Gm,Hm,Wm,Xm,ir,fl,Xd,Lr,rs,Yd,0,Fi,In,Jm,Ym)}(i,Ke,Se,r,s,l,Fe,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,W,[oe,oe,oe,oe],Be,x,se,he,Ne,B,e,h,T,I,p)};if(De==="line")for(const Se of Dd(e.geometry,0,0,Ei,Ei)){const Ke=Dm(Se,Q,xe,r.vertical||R,s,24,J,i.overscaling,Ei);for(const je of Ke)R&&Vm(i,R.text,Pe,je)||Ce(Se,je)}else if(De==="line-center"){for(const Se of e.geometry)if(Se.length>1){const Ke=Pm(Se,xe,r.vertical||R,s,24,J);Ke&&Ce(Se,Ke)}}else if(e.type==="Polygon")for(const Se of bu(e.geometry,0)){const Ke=Rm(Se,16);Ce(Se[0],new Ms(Ke.x,Ke.y,0))}else if(e.type==="LineString")for(const Se of e.geometry)Ce(Se,new Ms(Se[0].x,Se[0].y,0));else if(e.type==="Point")for(const Se of e.geometry)for(const Ke of Se)Ce([Ke],new Ms(Ke.x,Ke.y,0))}function qd(i,e,r,s,l,h,p,m,x,T,I,C,P,B,R){const U=function(se,Q,oe,he,xe,Be,Ne,De){const Pe=he.layout.get("text-rotate").evaluate(Be,{})*Math.PI/180,Me=[];for(const Fe of Q.positionedLines)for(const Ce of Fe.positionedGlyphs){if(!Ce.rect)continue;const Se=Ce.rect||{};let Ke=sd+1,je=!0,wt=1,oi=0;const hi=(xe||De)&&Ce.vertical,Ri=Ce.metrics.advance*Ce.scale/2;if(De&&Q.verticalizable&&(oi=Fe.lineOffset/2-(Ce.imageName?-(Bi-Ce.metrics.width*Ce.scale)/2:(Ce.scale-1)*Bi)),Ce.imageName){const Vi=Ne[Ce.imageName];je=Vi.sdf,wt=Vi.pixelRatio,Ke=zr/wt}const Gr=xe?[Ce.x+Ri,Ce.y]:[0,0];let yr=xe?[0,0]:[Ce.x+Ri+oe[0],Ce.y+oe[1]-oi],zi=[0,0];hi&&(zi=yr,yr=[0,0]);const Ki=Ce.metrics.isDoubleResolution?2:1,ir=(Ce.metrics.left-Ke)*Ce.scale-Ri+yr[0],xr=(-Ce.metrics.top-Ke)*Ce.scale+yr[1],vr=ir+Se.w/Ki*Ce.scale/wt,Fi=xr+Se.h/Ki*Ce.scale/wt,Oi=new ge(ir,xr),lr=new ge(vr,xr),br=new ge(ir,Fi),cr=new ge(vr,Fi);if(hi){const Vi=new ge(-Ri,Ri-ll),kt=-Math.PI/2,ur=Bi/2-Ri,rr=new ge(5-ll-ur,-(Ce.imageName?ur:0)),Ni=new ge(...zi);Oi._rotateAround(kt,Vi)._add(rr)._add(Ni),lr._rotateAround(kt,Vi)._add(rr)._add(Ni),br._rotateAround(kt,Vi)._add(rr)._add(Ni),cr._rotateAround(kt,Vi)._add(rr)._add(Ni)}if(Pe){const Vi=Math.sin(Pe),kt=Math.cos(Pe),ur=[kt,-Vi,Vi,kt];Oi._matMult(ur),lr._matMult(ur),br._matMult(ur),cr._matMult(ur)}const Pr=new ge(0,0),Dr=new ge(0,0);Me.push({tl:Oi,tr:lr,bl:br,br:cr,tex:Se,writingMode:Q.writingMode,glyphOffset:Gr,sectionIndex:Ce.sectionIndex,isSDF:je,pixelOffsetTL:Pr,pixelOffsetBR:Dr,minFontScaleX:0,minFontScaleY:0})}return Me}(0,r,m,l,h,p,s,i.allowVerticalPlacement),W=i.textSizeData;let J=null;W.kind==="source"?(J=[On*l.layout.get("text-size").evaluate(p,{})],J[0]>Is&<(`${i.layerIds[0]}: Value for "text-size" is >= ${ul}. Reduce your "text-size".`)):W.kind==="composite"&&(J=[On*B.compositeTextSizes[0].evaluate(p,{},R),On*B.compositeTextSizes[1].evaluate(p,{},R)],(J[0]>Is||J[1]>Is)&<(`${i.layerIds[0]}: Value for "text-size" is >= ${ul}. Reduce your "text-size".`)),i.addSymbols(i.text,U,J,m,h,p,T,e,x.lineStartIndex,x.lineLength,P,R);for(const se of I)C[se]=i.text.placedSymbolArray.length-1;return 4*U.length}function Zd(i){for(const e in i)return i[e];return null}function Vm(i,e,r,s){const l=i.compareText;if(e in l){const h=l[e];for(let p=h.length-1;p>=0;p--)if(s.dist(h[p])>4;if(l!==1)throw new Error(`Got v${l} data when expected v1.`);const h=Gd[15&s];if(!h)throw new Error("Unrecognized array type.");const[p]=new Uint16Array(e,2,1),[m]=new Uint32Array(e,4,1);return new Zu(m,p,h,e)}constructor(e,r=64,s=Float64Array,l){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=s,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const h=Gd.indexOf(this.ArrayType),p=2*e*this.ArrayType.BYTES_PER_ELEMENT,m=e*this.IndexArrayType.BYTES_PER_ELEMENT,x=(8-m%8)%8;if(h<0)throw new Error(`Unexpected typed array class: ${s}.`);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+x,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+p+m+x),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+m+x,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+h]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=e,this.coords[this._pos++]=r,s}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Gu(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,s,l){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:h,coords:p,nodeSize:m}=this,x=[0,h.length-1,0],T=[];for(;x.length;){const I=x.pop()||0,C=x.pop()||0,P=x.pop()||0;if(C-P<=m){for(let W=P;W<=C;W++){const J=p[2*W],se=p[2*W+1];J>=e&&J<=s&&se>=r&&se<=l&&T.push(h[W])}continue}const B=P+C>>1,R=p[2*B],U=p[2*B+1];R>=e&&R<=s&&U>=r&&U<=l&&T.push(h[B]),(I===0?e<=R:r<=U)&&(x.push(P),x.push(B-1),x.push(1-I)),(I===0?s>=R:l>=U)&&(x.push(B+1),x.push(C),x.push(1-I))}return T}within(e,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:l,coords:h,nodeSize:p}=this,m=[0,l.length-1,0],x=[],T=s*s;for(;m.length;){const I=m.pop()||0,C=m.pop()||0,P=m.pop()||0;if(C-P<=p){for(let W=P;W<=C;W++)Wd(h[2*W],h[2*W+1],e,r)<=T&&x.push(l[W]);continue}const B=P+C>>1,R=h[2*B],U=h[2*B+1];Wd(R,U,e,r)<=T&&x.push(l[B]),(I===0?e-s<=R:r-s<=U)&&(m.push(P),m.push(B-1),m.push(1-I)),(I===0?e+s>=R:r+s>=U)&&(m.push(B+1),m.push(C),m.push(1-I))}return x}}function Gu(i,e,r,s,l,h){if(l-s<=r)return;const p=s+l>>1;Hd(i,e,p,s,l,h),Gu(i,e,r,s,p-1,1-h),Gu(i,e,r,p+1,l,1-h)}function Hd(i,e,r,s,l,h){for(;l>s;){if(l-s>600){const T=l-s+1,I=r-s+1,C=Math.log(T),P=.5*Math.exp(2*C/3),B=.5*Math.sqrt(C*P*(T-P)/T)*(I-T/2<0?-1:1);Hd(i,e,r,Math.max(s,Math.floor(r-I*P/T+B)),Math.min(l,Math.floor(r+(T-I)*P/T+B)),h)}const p=e[2*r+h];let m=s,x=l;for(dl(i,e,s,r),e[2*l+h]>p&&dl(i,e,s,l);mp;)x--}e[2*s+h]===p?dl(i,e,s,x):(x++,dl(i,e,x,l)),x<=r&&(s=x+1),r<=x&&(l=x-1)}}function dl(i,e,r,s){Hu(i,r,s),Hu(e,2*r,2*s),Hu(e,2*r+1,2*s+1)}function Hu(i,e,r){const s=i[e];i[e]=i[r],i[r]=s}function Wd(i,e,r,s){const l=i-r,h=e-s;return l*l+h*h}var Wu;o.bh=void 0,(Wu=o.bh||(o.bh={})).create="create",Wu.load="load",Wu.fullLoad="fullLoad";let Dc=null,pl=[];const Xu=1e3/60,Ku="loadTime",Ju="fullLoadTime",Nm={mark(i){performance.mark(i)},frame(i){const e=i;Dc!=null&&pl.push(e-Dc),Dc=e},clearMetrics(){Dc=null,pl=[],performance.clearMeasures(Ku),performance.clearMeasures(Ju);for(const i in o.bh)performance.clearMarks(o.bh[i])},getPerformanceMetrics(){performance.measure(Ku,o.bh.create,o.bh.load),performance.measure(Ju,o.bh.create,o.bh.fullLoad);const i=performance.getEntriesByName(Ku)[0].duration,e=performance.getEntriesByName(Ju)[0].duration,r=pl.length,s=1/(pl.reduce((h,p)=>h+p,0)/r/1e3),l=pl.filter(h=>h>Xu).reduce((h,p)=>h+(p-Xu)/Xu,0);return{loadTime:i,fullLoadTime:e,fps:s,percentDroppedFrames:l/(r+l)*100,totalFrames:r}}};o.$=function(i,e,r){var s,l,h,p,m,x,T,I,C,P,B,R,U=r[0],W=r[1],J=r[2];return e===i?(i[12]=e[0]*U+e[4]*W+e[8]*J+e[12],i[13]=e[1]*U+e[5]*W+e[9]*J+e[13],i[14]=e[2]*U+e[6]*W+e[10]*J+e[14],i[15]=e[3]*U+e[7]*W+e[11]*J+e[15]):(l=e[1],h=e[2],p=e[3],m=e[4],x=e[5],T=e[6],I=e[7],C=e[8],P=e[9],B=e[10],R=e[11],i[0]=s=e[0],i[1]=l,i[2]=h,i[3]=p,i[4]=m,i[5]=x,i[6]=T,i[7]=I,i[8]=C,i[9]=P,i[10]=B,i[11]=R,i[12]=s*U+m*W+C*J+e[12],i[13]=l*U+x*W+P*J+e[13],i[14]=h*U+T*W+B*J+e[14],i[15]=p*U+I*W+R*J+e[15]),i},o.A=Fa,o.B=Ar,o.C=class{constructor(i,e,r){this.receive=s=>{const l=s.data,h=l.id;if(h&&(!l.targetMapId||this.mapId===l.targetMapId))if(l.type===""){delete this.tasks[h];const p=this.cancelCallbacks[h];delete this.cancelCallbacks[h],p&&p()}else Ht()||l.mustQueue?(this.tasks[h]=l,this.taskQueue.push(h),this.invoker.trigger()):this.processTask(h,l)},this.process=()=>{if(!this.taskQueue.length)return;const s=this.taskQueue.shift(),l=this.tasks[s];delete this.tasks[s],this.taskQueue.length&&this.invoker.trigger(),l&&this.processTask(s,l)},this.target=i,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new Em(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Ht()?i:window}send(i,e,r,s,l=!1){const h=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[h]=r);const p=[],m={id:h,type:i,hasCallback:!!r,targetMapId:s,mustQueue:l,sourceMapId:this.mapId,data:Bn(e,p)};return this.target.postMessage(m,{transfer:p}),{cancel:()=>{r&&delete this.callbacks[h],this.target.postMessage({id:h,type:"",targetMapId:s,sourceMapId:this.mapId})}}}processTask(i,e){if(e.type===""){const r=this.callbacks[i];delete this.callbacks[i],r&&(e.error?r(xs(e.error)):r(null,xs(e.data)))}else{let r=!1;const s=[],l=e.hasCallback?(m,x)=>{r=!0,delete this.cancelCallbacks[i];const T={id:i,type:"",sourceMapId:this.mapId,error:m?Bn(m):null,data:Bn(x,s)};this.target.postMessage(T,{transfer:s})}:m=>{r=!0};let h=null;const p=xs(e.data);if(this.parent[e.type])h=this.parent[e.type](e.sourceMapId,p,l);else if("getWorkerSource"in this.parent){const m=e.type.split(".");h=this.parent.getWorkerSource(e.sourceMapId,m[0],p.source)[m[1]](p,l)}else l(new Error(`Could not find function ${e.type}`));!r&&h&&h.cancel&&(this.cancelCallbacks[i]=h.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},o.D=Ze,o.E=tn,o.F=function(i,e){const r={};for(let s=0;s{}}},o.Y=ke,o.Z=function(){var i=new Fa(16);return Fa!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},o._=te,o.a=Ji,o.a$=class extends L{},o.a0=function(i,e,r){var s=r[0],l=r[1],h=r[2];return i[0]=e[0]*s,i[1]=e[1]*s,i[2]=e[2]*s,i[3]=e[3]*s,i[4]=e[4]*l,i[5]=e[5]*l,i[6]=e[6]*l,i[7]=e[7]*l,i[8]=e[8]*h,i[9]=e[9]*h,i[10]=e[10]*h,i[11]=e[11]*h,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},o.a1=Ah,o.a2=function(){return mt++},o.a3=G,o.a4=qa,o.a5=function(){Cr.isLoading()||Cr.isLoaded()||Uo()!=="deferred"||oc()},o.a6=Eo,o.a7=Xs,o.a8=si,o.a9=Cd,o.aA=js,o.aB=function(i){i=i.slice();const e=Object.create(null);for(let r=0;r{s[p.source]?r.push({command:Nt.removeLayer,args:[p.id]}):h.push(p)}),r=r.concat(l),function(p,m,x){m=m||[];const T=(p=p||[]).map(En),I=m.map(En),C=p.reduce(Un,{}),P=m.reduce(Un,{}),B=T.slice(),R=Object.create(null);let U,W,J,se,Q,oe,he;for(U=0,W=0;U@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,s,l,h)=>{const p=l||h;return e[s]=!p||p.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},o.ab=function(i,e){const r=[];for(const s in i)s in e||r.push(s);return r},o.ac=function(i){if(Pt==null){const e=i.navigator?i.navigator.userAgent:null;Pt=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Pt},o.ad=zt,o.ae=function(i,e,r){var s=Math.sin(r),l=Math.cos(r),h=e[0],p=e[1],m=e[2],x=e[3],T=e[4],I=e[5],C=e[6],P=e[7];return e!==i&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=h*l+T*s,i[1]=p*l+I*s,i[2]=m*l+C*s,i[3]=x*l+P*s,i[4]=T*l-h*s,i[5]=I*l-p*s,i[6]=C*l-m*s,i[7]=P*l-x*s,i},o.af=function(i){var e=new Fa(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},o.ag=_c,o.ah=function(i,e){let r=0,s=0;if(i.kind==="constant")s=i.layoutSize;else if(i.kind!=="source"){const{interpolationType:l,minZoom:h,maxZoom:p}=i,m=l?zt(Mr.interpolationFactor(l,e,h,p),0,1):0;i.kind==="camera"?s=Ar.number(i.minSize,i.maxSize,m):r=m}return{uSizeT:r,uSize:s}},o.aj=function(i,{uSize:e,uSizeT:r},{lowerSize:s,upperSize:l}){return i.kind==="source"?s/On:i.kind==="composite"?Ar.number(s/On,l/On,r):e},o.ak=Bu,o.al=function(i,e,r,s){const l=e.y-i.y,h=e.x-i.x,p=s.y-r.y,m=s.x-r.x,x=p*h-m*l;if(x===0)return null;const T=(m*(i.y-r.y)-p*(i.x-r.x))/x;return new ge(i.x+T*h,i.y+T*l)},o.am=Dd,o.an=vh,o.ao=fu,o.ap=Bi,o.ar=Lu,o.as=function(i,e){var r=e[0],s=e[1],l=e[2],h=e[3],p=e[4],m=e[5],x=e[6],T=e[7],I=e[8],C=e[9],P=e[10],B=e[11],R=e[12],U=e[13],W=e[14],J=e[15],se=r*m-s*p,Q=r*x-l*p,oe=r*T-h*p,he=s*x-l*m,xe=s*T-h*m,Be=l*T-h*x,Ne=I*U-C*R,De=I*W-P*R,Pe=I*J-B*R,Me=C*W-P*U,Fe=C*J-B*U,Ce=P*J-B*W,Se=se*Ce-Q*Fe+oe*Me+he*Pe-xe*De+Be*Ne;return Se?(i[0]=(m*Ce-x*Fe+T*Me)*(Se=1/Se),i[1]=(l*Fe-s*Ce-h*Me)*Se,i[2]=(U*Be-W*xe+J*he)*Se,i[3]=(P*xe-C*Be-B*he)*Se,i[4]=(x*Pe-p*Ce-T*De)*Se,i[5]=(r*Ce-l*Pe+h*De)*Se,i[6]=(W*oe-R*Be-J*Q)*Se,i[7]=(I*Be-P*oe+B*Q)*Se,i[8]=(p*Fe-m*Pe+T*Ne)*Se,i[9]=(s*Pe-r*Fe-h*Ne)*Se,i[10]=(R*xe-U*oe+J*se)*Se,i[11]=(C*oe-I*xe-B*se)*Se,i[12]=(m*De-p*Me-x*Ne)*Se,i[13]=(r*Me-s*De+l*Ne)*Se,i[14]=(U*Q-R*he-W*se)*Se,i[15]=(I*he-C*Q+P*se)*Se,i):null},o.at=qu,o.au=Du,o.av=Zu,o.aw=function(){const i={},e=fe.$version;for(const r in fe.$root){const s=fe.$root[r];if(s.required){let l=null;l=r==="version"?e:s.type==="array"?[]:{},l!=null&&(i[r]=l)}}return i},o.ax=Nt,o.ay=rc,o.az=St,o.b=function(i,e){const r=new Blob([new Uint8Array(i)],{type:"image/png"});createImageBitmap(r).then(s=>{e(null,s)}).catch(s=>{e(new Error(`Could not load image because of ${s.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},o.b0=Wi,o.b1=function(i,e){var r=i[0],s=i[1],l=i[2],h=i[3],p=i[4],m=i[5],x=i[6],T=i[7],I=i[8],C=i[9],P=i[10],B=i[11],R=i[12],U=i[13],W=i[14],J=i[15],se=e[0],Q=e[1],oe=e[2],he=e[3],xe=e[4],Be=e[5],Ne=e[6],De=e[7],Pe=e[8],Me=e[9],Fe=e[10],Ce=e[11],Se=e[12],Ke=e[13],je=e[14],wt=e[15];return Math.abs(r-se)<=_r*Math.max(1,Math.abs(r),Math.abs(se))&&Math.abs(s-Q)<=_r*Math.max(1,Math.abs(s),Math.abs(Q))&&Math.abs(l-oe)<=_r*Math.max(1,Math.abs(l),Math.abs(oe))&&Math.abs(h-he)<=_r*Math.max(1,Math.abs(h),Math.abs(he))&&Math.abs(p-xe)<=_r*Math.max(1,Math.abs(p),Math.abs(xe))&&Math.abs(m-Be)<=_r*Math.max(1,Math.abs(m),Math.abs(Be))&&Math.abs(x-Ne)<=_r*Math.max(1,Math.abs(x),Math.abs(Ne))&&Math.abs(T-De)<=_r*Math.max(1,Math.abs(T),Math.abs(De))&&Math.abs(I-Pe)<=_r*Math.max(1,Math.abs(I),Math.abs(Pe))&&Math.abs(C-Me)<=_r*Math.max(1,Math.abs(C),Math.abs(Me))&&Math.abs(P-Fe)<=_r*Math.max(1,Math.abs(P),Math.abs(Fe))&&Math.abs(B-Ce)<=_r*Math.max(1,Math.abs(B),Math.abs(Ce))&&Math.abs(R-Se)<=_r*Math.max(1,Math.abs(R),Math.abs(Se))&&Math.abs(U-Ke)<=_r*Math.max(1,Math.abs(U),Math.abs(Ke))&&Math.abs(W-je)<=_r*Math.max(1,Math.abs(W),Math.abs(je))&&Math.abs(J-wt)<=_r*Math.max(1,Math.abs(J),Math.abs(wt))},o.b2=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},o.b3=function(i,e,r){return i[0]=e[0]*r[0],i[1]=e[1]*r[1],i[2]=e[2]*r[2],i[3]=e[3]*r[3],i},o.b4=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]*e[3]},o.b5=st,o.b6=Ad,o.b7=Td,o.b8=function(i,e,r,s,l){var h,p=1/Math.tan(e/2);return i[0]=p/r,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,l!=null&&l!==1/0?(i[10]=(l+s)*(h=1/(s-l)),i[14]=2*l*s*h):(i[10]=-1,i[14]=-2*s),i},o.b9=function(i,e,r){var s=Math.sin(r),l=Math.cos(r),h=e[4],p=e[5],m=e[6],x=e[7],T=e[8],I=e[9],C=e[10],P=e[11];return e!==i&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=h*l+T*s,i[5]=p*l+I*s,i[6]=m*l+C*s,i[7]=x*l+P*s,i[8]=T*l-h*s,i[9]=I*l-p*s,i[10]=C*l-m*s,i[11]=P*l-x*s,i},o.bA=ne,o.bB=Qh,o.bC=Sa,o.bD=Cr,o.ba=bt,o.bb=ht,o.bc=function(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=e[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=e[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},o.bd=class extends Hs{},o.be=Vu,o.bf=Sd,o.bg=Nm,o.bi=nt,o.bj=function(i,e,r=!1){if(mr===Ro||mr===Fo||mr===Oo)throw new Error("setRTLTextPlugin cannot be called multiple times.");Rn=ti.resolveURL(i),mr=Ro,Vo=e,No(),r||oc()},o.bk=Uo,o.bl=function(i,e){const r={};for(let l=0;lSe*Bi)}let De=p?"center":r.get("text-justify").evaluate(T,{},i.canonical);const Pe=r.get("symbol-placement"),Me=Pe==="point"?r.get("text-max-width").evaluate(T,{},i.canonical)*Bi:0,Fe=()=>{i.bucket.allowVerticalPlacement&&Do(oe)&&(R.vertical=Sc(U,i.glyphMap,i.glyphPositions,i.imagePositions,I,Me,h,Be,"left",xe,J,o.ai.vertical,!0,Pe,P,C))};if(!p&&Ne){const Ce=new Set;if(De==="auto")for(let Ke=0;Ke{e(null,r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>{r.src=dr})},r.onerror=()=>e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const s=new Blob([new Uint8Array(i)],{type:"image/png"});r.src=i.byteLength?URL.createObjectURL(s):dr},o.e=dt,o.f=function(i,e){return Yi(dt(i,{type:"json"}),e)},o.g=Jt,o.h=ti,o.i=Ht,o.j=Zi,o.k=Pi,o.l=ue,o.m=Yi,o.n=function(i){return new Cu(i).readFields(mm,[])},o.o=function(i,e,r){if(!i.length)return r(null,[]);let s=i.length;const l=new Array(i.length);let h=null;i.forEach((p,m)=>{e(p,(x,T)=>{x&&(h=x),l[m]=T,--s==0&&r(h,l)})})},o.p=ad,o.q=el,o.r=Ii,o.s=Vt,o.t=su,o.u=Le,o.v=fe,o.w=lt,o.x=za,o.y=vn,o.z=function([i,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(e)*Math.sin(r),y:i*Math.sin(e)*Math.sin(r),z:i*Math.cos(r)}}}),z(["./shared"],function(o){class te{constructor(E){this.keyCache={},E&&this.replace(E)}replace(E){this._layerConfigs={},this._layers={},this.update(E,[])}update(E,D){for(const H of E){this._layerConfigs[H.id]=H;const X=this._layers[H.id]=o.aC(H);X._featureFilter=o.a6(X.filter),this.keyCache[H.id]&&delete this.keyCache[H.id]}for(const H of D)delete this.keyCache[H],delete this._layerConfigs[H],delete this._layers[H];this.familiesBySource={};const V=o.bl(Object.values(this._layerConfigs),this.keyCache);for(const H of V){const X=H.map(_e=>this._layers[_e.id]),ae=X[0];if(ae.visibility==="none")continue;const $=ae.source||"";let Y=this.familiesBySource[$];Y||(Y=this.familiesBySource[$]={});const re=ae.sourceLayer||"_geojsonTileLayer";let me=Y[re];me||(me=Y[re]=[]),me.push(X)}}}class O{constructor(E){const D={},V=[];for(const $ in E){const Y=E[$],re=D[$]={};for(const me in Y){const _e=Y[+me];if(!_e||_e.bitmap.width===0||_e.bitmap.height===0)continue;const be={x:0,y:0,w:_e.bitmap.width+2,h:_e.bitmap.height+2};V.push(be),re[me]={rect:be,metrics:_e.metrics}}}const{w:H,h:X}=o.p(V),ae=new o.q({width:H||1,height:X||1});for(const $ in E){const Y=E[$];for(const re in Y){const me=Y[+re];if(!me||me.bitmap.width===0||me.bitmap.height===0)continue;const _e=D[$][re].rect;o.q.copy(me.bitmap,ae,{x:0,y:0},{x:_e.x+1,y:_e.y+1},me.bitmap)}}this.image=ae,this.positions=D}}o.bm("GlyphAtlas",O);class ne{constructor(E){this.tileID=new o.O(E.tileID.overscaledZ,E.tileID.wrap,E.tileID.canonical.z,E.tileID.canonical.x,E.tileID.canonical.y),this.uid=E.uid,this.zoom=E.zoom,this.pixelRatio=E.pixelRatio,this.tileSize=E.tileSize,this.source=E.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=E.showCollisionBoxes,this.collectResourceTiming=!!E.collectResourceTiming,this.returnDependencies=!!E.returnDependencies,this.promoteId=E.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(E,D,V,H,X){this.status="parsing",this.data=E,this.collisionBoxArray=new o.a3;const ae=new o.bn(Object.keys(E.layers).sort()),$=new o.bo(this.tileID,this.promoteId);$.bucketLayerIDs=[];const Y={},re={featureIndex:$,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:V},me=D.familiesBySource[this.source];for(const Ft in me){const Bt=E.layers[Ft];if(!Bt)continue;Bt.version===1&&o.w(`Vector tile source "${this.source}" layer "${Ft}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Qi=ae.encode(Ft),ri=[];for(let Ci=0;Ci=Gi.maxzoom||Gi.visibility!=="none"&&(le(Ci,this.zoom,V),(Y[Gi.id]=Gi.createBucket({index:$.bucketLayerIDs.length,layers:Ci,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Qi,sourceID:this.source})).populate(ri,re,this.tileID.canonical),$.bucketLayerIDs.push(Ci.map(Or=>Or.id)))}}let _e,be,Xe,at;const Oe=o.aH(re.glyphDependencies,Ft=>Object.keys(Ft).map(Number));this.inFlightDependencies.forEach(Ft=>Ft==null?void 0:Ft.cancel()),this.inFlightDependencies=[];const Qe=++this.dependencySentinel;Object.keys(Oe).length?this.inFlightDependencies.push(H.send("getGlyphs",{uid:this.uid,stacks:Oe,source:this.source,tileID:this.tileID,type:"glyphs"},(Ft,Bt)=>{Qe===this.dependencySentinel&&(_e||(_e=Ft,be=Bt,Yt.call(this)))})):be={};const ut=Object.keys(re.iconDependencies);ut.length?this.inFlightDependencies.push(H.send("getImages",{icons:ut,source:this.source,tileID:this.tileID,type:"icons"},(Ft,Bt)=>{Qe===this.dependencySentinel&&(_e||(_e=Ft,Xe=Bt,Yt.call(this)))})):Xe={};const Gt=Object.keys(re.patternDependencies);function Yt(){if(_e)return X(_e);if(be&&Xe&&at){const Ft=new O(be),Bt=new o.bp(Xe,at);for(const Qi in Y){const ri=Y[Qi];ri instanceof o.a4?(le(ri.layers,this.zoom,V),o.bq({bucket:ri,glyphMap:be,glyphPositions:Ft.positions,imageMap:Xe,imagePositions:Bt.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):ri.hasPattern&&(ri instanceof o.br||ri instanceof o.bs||ri instanceof o.bt)&&(le(ri.layers,this.zoom,V),ri.addFeatures(re,this.tileID.canonical,Bt.patternPositions))}this.status="done",X(null,{buckets:Object.values(Y).filter(Qi=>!Qi.isEmpty()),featureIndex:$,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Ft.image,imageAtlas:Bt,glyphMap:this.returnDependencies?be:null,iconMap:this.returnDependencies?Xe:null,glyphPositions:this.returnDependencies?Ft.positions:null})}}Gt.length?this.inFlightDependencies.push(H.send("getImages",{icons:Gt,source:this.source,tileID:this.tileID,type:"patterns"},(Ft,Bt)=>{Qe===this.dependencySentinel&&(_e||(_e=Ft,at=Bt,Yt.call(this)))})):at={},Yt.call(this)}}function le(Z,E,D){const V=new o.a8(E);for(const H of Z)H.recalculate(V,D)}function ge(Z,E){const D=o.l(Z.request,(V,H,X,ae)=>{if(V)E(V);else if(H)try{const $=new o.bw.VectorTile(new o.bv(H));E(null,{vectorTile:$,rawData:H,cacheControl:X,expires:ae})}catch($){const Y=new Uint8Array(H);let re=`Unable to parse the tile at ${Z.request.url}, `;re+=Y[0]===31&&Y[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${$.messge}`,E(new Error(re))}});return()=>{D.cancel(),E()}}class We{constructor(E,D,V,H){this.actor=E,this.layerIndex=D,this.availableImages=V,this.loadVectorData=H||ge,this.fetching={},this.loading={},this.loaded={}}loadTile(E,D){const V=E.uid;this.loading||(this.loading={});const H=!!(E&&E.request&&E.request.collectResourceTiming)&&new o.bu(E.request),X=this.loading[V]=new ne(E);X.abort=this.loadVectorData(E,(ae,$)=>{if(delete this.loading[V],ae||!$)return X.status="done",this.loaded[V]=X,D(ae);const Y=$.rawData,re={};$.expires&&(re.expires=$.expires),$.cacheControl&&(re.cacheControl=$.cacheControl);const me={};if(H){const _e=H.finish();_e&&(me.resourceTiming=JSON.parse(JSON.stringify(_e)))}X.vectorTile=$.vectorTile,X.parse($.vectorTile,this.layerIndex,this.availableImages,this.actor,(_e,be)=>{if(delete this.fetching[V],_e||!be)return D(_e);D(null,o.e({rawTileData:Y.slice(0)},be,re,me))}),this.loaded=this.loaded||{},this.loaded[V]=X,this.fetching[V]={rawTileData:Y,cacheControl:re,resourceTiming:me}})}reloadTile(E,D){const V=this.loaded,H=E.uid;if(V&&V[H]){const X=V[H];X.showCollisionBoxes=E.showCollisionBoxes,X.status==="parsing"?X.parse(X.vectorTile,this.layerIndex,this.availableImages,this.actor,(ae,$)=>{if(ae||!$)return D(ae,$);let Y;if(this.fetching[H]){const{rawTileData:re,cacheControl:me,resourceTiming:_e}=this.fetching[H];delete this.fetching[H],Y=o.e({rawTileData:re.slice(0)},$,me,_e)}else Y=$;D(null,Y)}):X.status==="done"&&(X.vectorTile?X.parse(X.vectorTile,this.layerIndex,this.availableImages,this.actor,D):D())}}abortTile(E,D){const V=this.loading,H=E.uid;V&&V[H]&&V[H].abort&&(V[H].abort(),delete V[H]),D()}removeTile(E,D){const V=this.loaded,H=E.uid;V&&V[H]&&delete V[H],D()}}class He{constructor(){this.loaded={}}loadTile(E,D){return o._(this,void 0,void 0,function*(){const{uid:V,encoding:H,rawImageData:X,redFactor:ae,greenFactor:$,blueFactor:Y,baseShift:re}=E,me=X.width+2,_e=X.height+2,be=o.a(X)?new o.R({width:me,height:_e},yield o.bx(X,-1,-1,me,_e)):X,Xe=new o.by(V,be,H,ae,$,Y,re);this.loaded=this.loaded||{},this.loaded[V]=Xe,D(null,Xe)})}removeTile(E){const D=this.loaded,V=E.uid;D&&D[V]&&delete D[V]}}function vt(Z,E){if(Z.length!==0){Ge(Z[0],E);for(var D=1;D=Math.abs($)?D-Y+$:$-Y+D,D=Y}D+V>=0!=!!E&&Z.reverse()}var et=o.bz(function Z(E,D){var V,H=E&&E.type;if(H==="FeatureCollection")for(V=0;V>31}function Ht(Z,E){for(var D=Z.loadGeometry(),V=Z.type,H=0,X=0,ae=D.length,$=0;$Z},Kt=Math.fround||(Ot=new Float32Array(1),Z=>(Ot[0]=+Z,Ot[0]));var Ot;const yt=3,Rt=5,ki=6;class ti{constructor(E){this.options=Object.assign(Object.create(dr),E),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(E){const{log:D,minZoom:V,maxZoom:H}=this.options;D&&console.time("total time");const X=`prepare ${E.length} points`;D&&console.time(X),this.points=E;const ae=[];for(let Y=0;Y=V;Y--){const re=+Date.now();$=this.trees[Y]=this._createTree(this._cluster($,Y)),D&&console.log("z%d: %d clusters in %dms",Y,$.numItems,+Date.now()-re)}return D&&console.timeEnd("total time"),this}getClusters(E,D){let V=((E[0]+180)%360+360)%360-180;const H=Math.max(-90,Math.min(90,E[1]));let X=E[2]===180?180:((E[2]+180)%360+360)%360-180;const ae=Math.max(-90,Math.min(90,E[3]));if(E[2]-E[0]>=360)V=-180,X=180;else if(V>X){const _e=this.getClusters([V,H,180,ae],D),be=this.getClusters([-180,H,X,ae],D);return _e.concat(be)}const $=this.trees[this._limitZoom(D)],Y=$.range(St(V),Jt(ae),St(X),Jt(H)),re=$.data,me=[];for(const _e of Y){const be=this.stride*_e;me.push(re[be+Rt]>1?Ie(re,be,this.clusterProps):this.points[re[be+yt]])}return me}getChildren(E){const D=this._getOriginId(E),V=this._getOriginZoom(E),H="No cluster with the specified id.",X=this.trees[V];if(!X)throw new Error(H);const ae=X.data;if(D*this.stride>=ae.length)throw new Error(H);const $=this.options.radius/(this.options.extent*Math.pow(2,V-1)),Y=X.within(ae[D*this.stride],ae[D*this.stride+1],$),re=[];for(const me of Y){const _e=me*this.stride;ae[_e+4]===E&&re.push(ae[_e+Rt]>1?Ie(ae,_e,this.clusterProps):this.points[ae[_e+yt]])}if(re.length===0)throw new Error(H);return re}getLeaves(E,D,V){const H=[];return this._appendLeaves(H,E,D=D||10,V=V||0,0),H}getTile(E,D,V){const H=this.trees[this._limitZoom(E)],X=Math.pow(2,E),{extent:ae,radius:$}=this.options,Y=$/ae,re=(V-Y)/X,me=(V+1+Y)/X,_e={features:[]};return this._addTileFeatures(H.range((D-Y)/X,re,(D+1+Y)/X,me),H.data,D,V,X,_e),D===0&&this._addTileFeatures(H.range(1-Y/X,re,1,me),H.data,X,V,X,_e),D===X-1&&this._addTileFeatures(H.range(0,re,Y/X,me),H.data,-1,V,X,_e),_e.features.length?_e:null}getClusterExpansionZoom(E){let D=this._getOriginZoom(E)-1;for(;D<=this.options.maxZoom;){const V=this.getChildren(E);if(D++,V.length!==1)break;E=V[0].properties.cluster_id}return D}_appendLeaves(E,D,V,H,X){const ae=this.getChildren(D);for(const $ of ae){const Y=$.properties;if(Y&&Y.cluster?X+Y.point_count<=H?X+=Y.point_count:X=this._appendLeaves(E,Y.cluster_id,V,H,X):X1;let me,_e,be;if(re)me=nt(D,Y,this.clusterProps),_e=D[Y],be=D[Y+1];else{const Oe=this.points[D[Y+yt]];me=Oe.properties;const[Qe,ut]=Oe.geometry.coordinates;_e=St(Qe),be=Jt(ut)}const Xe={type:1,geometry:[[Math.round(this.options.extent*(_e*X-V)),Math.round(this.options.extent*(be*X-H))]],tags:me};let at;at=re||this.options.generateId?D[Y+yt]:this.points[D[Y+yt]].id,at!==void 0&&(Xe.id=at),ae.features.push(Xe)}}_limitZoom(E){return Math.max(this.options.minZoom,Math.min(Math.floor(+E),this.options.maxZoom+1))}_cluster(E,D){const{radius:V,extent:H,reduce:X,minPoints:ae}=this.options,$=V/(H*Math.pow(2,D)),Y=E.data,re=[],me=this.stride;for(let _e=0;_eD&&(Qe+=Y[Gt+Rt])}if(Qe>Oe&&Qe>=ae){let ut,Gt=be*Oe,Yt=Xe*Oe,Ft=-1;const Bt=((_e/me|0)<<5)+(D+1)+this.points.length;for(const Qi of at){const ri=Qi*me;if(Y[ri+2]<=D)continue;Y[ri+2]=D;const Ci=Y[ri+Rt];Gt+=Y[ri]*Ci,Yt+=Y[ri+1]*Ci,Y[ri+4]=Bt,X&&(ut||(ut=this._map(Y,_e,!0),Ft=this.clusterProps.length,this.clusterProps.push(ut)),X(ut,this._map(Y,ri)))}Y[_e+4]=Bt,re.push(Gt/Qe,Yt/Qe,1/0,Bt,-1,Qe),X&&re.push(Ft)}else{for(let ut=0;ut1)for(const ut of at){const Gt=ut*me;if(!(Y[Gt+2]<=D)){Y[Gt+2]=D;for(let Yt=0;Yt>5}_getOriginZoom(E){return(E-this.points.length)%32}_map(E,D,V){if(E[D+Rt]>1){const ae=this.clusterProps[E[D+ki]];return V?Object.assign({},ae):ae}const H=this.points[E[D+yt]].properties,X=this.options.map(H);return V&&X===H?Object.assign({},X):X}}function Ie(Z,E,D){return{type:"Feature",id:Z[E+yt],properties:nt(Z,E,D),geometry:{type:"Point",coordinates:[(V=Z[E],360*(V-.5)),nr(Z[E+1])]}};var V}function nt(Z,E,D){const V=Z[E+Rt],H=V>=1e4?`${Math.round(V/1e3)}k`:V>=1e3?Math.round(V/100)/10+"k":V,X=Z[E+ki],ae=X===-1?{}:Object.assign({},D[X]);return Object.assign(ae,{cluster:!0,cluster_id:Z[E+yt],point_count:V,point_count_abbreviated:H})}function St(Z){return Z/360+.5}function Jt(Z){const E=Math.sin(Z*Math.PI/180),D=.5-.25*Math.log((1+E)/(1-E))/Math.PI;return D<0?0:D>1?1:D}function nr(Z){const E=(180-360*Z)*Math.PI/180;return 360*Math.atan(Math.exp(E))/Math.PI-90}function Yi(Z,E,D,V){for(var H,X=V,ae=D-E>>1,$=D-E,Y=Z[E],re=Z[E+1],me=Z[D],_e=Z[D+1],be=E+3;beX)H=be,X=Xe;else if(Xe===X){var at=Math.abs(be-ae);at<$&&(H=be,$=at)}}X>V&&(H-E>3&&Yi(Z,E,H,V),Z[H+2]=X,D-H>3&&Yi(Z,H,D,V))}function ue(Z,E,D,V,H,X){var ae=H-D,$=X-V;if(ae!==0||$!==0){var Y=((Z-D)*ae+(E-V)*$)/(ae*ae+$*$);Y>1?(D=H,V=X):Y>0&&(D+=ae*Y,V+=$*Y)}return(ae=Z-D)*ae+($=E-V)*$}function Vt(Z,E,D,V){var H={id:Z===void 0?null:Z,type:E,geometry:D,tags:V,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(X){var ae=X.geometry,$=X.type;if($==="Point"||$==="MultiPoint"||$==="LineString")Ui(X,ae);else if($==="Polygon"||$==="MultiLineString")for(var Y=0;Y0&&(ae+=V?(H*re-Y*X)/2:Math.sqrt(Math.pow(Y-H,2)+Math.pow(re-X,2))),H=Y,X=re}var me=E.length-3;E[2]=1,Yi(E,0,me,D),E[me+2]=1,E.size=Math.abs(ae),E.start=0,E.end=E.size}function tn(Z,E,D,V){for(var H=0;H1?1:D}function Fr(Z,E,D,V,H,X,ae,$){if(V/=E,X>=(D/=E)&&ae=V)return null;for(var Y=[],re=0;re=D&&at=V)){var Oe=[];if(be==="Point"||be==="MultiPoint")ii(_e,Oe,D,V,H);else if(be==="LineString")Nt(_e,Oe,D,V,H,!1,$.lineMetrics);else if(be==="MultiLineString")os(_e,Oe,D,V,H,!1);else if(be==="Polygon")os(_e,Oe,D,V,H,!0);else if(be==="MultiPolygon")for(var Qe=0;Qe<_e.length;Qe++){var ut=[];os(_e[Qe],ut,D,V,H,!0),ut.length&&Oe.push(ut)}if(Oe.length){if($.lineMetrics&&be==="LineString"){for(Qe=0;Qe=D&&ae<=V&&(E.push(Z[X]),E.push(Z[X+1]),E.push(Z[X+2]))}}function Nt(Z,E,D,V,H,X,ae){for(var $,Y,re=rn(Z),me=H===0?aa:ls,_e=Z.start,be=0;beD&&(Y=me(re,Xe,at,Qe,ut,D),ae&&(re.start=_e+$*Y)):Gt>V?Yt=D&&(Y=me(re,Xe,at,Qe,ut,D),Ft=!0),Yt>V&&Gt<=V&&(Y=me(re,Xe,at,Qe,ut,V),Ft=!0),!X&&Ft&&(ae&&(re.end=_e+$*Y),E.push(re),re=rn(Z)),ae&&(_e+=$)}var Bt=Z.length-3;Xe=Z[Bt],at=Z[Bt+1],Oe=Z[Bt+2],(Gt=H===0?Xe:at)>=D&&Gt<=V&&fn(re,Xe,at,Oe),Bt=re.length-3,X&&Bt>=3&&(re[Bt]!==re[0]||re[Bt+1]!==re[1])&&fn(re,re[0],re[1],re[2]),re.length&&E.push(re)}function rn(Z){var E=[];return E.size=Z.size,E.start=Z.start,E.end=Z.end,E}function os(Z,E,D,V,H,X){for(var ae=0;aeae.maxX&&(ae.maxX=me),_e>ae.maxY&&(ae.maxY=_e)}return ae}function jn(Z,E,D,V){var H=E.geometry,X=E.type,ae=[];if(X==="Point"||X==="MultiPoint")for(var $=0;$0&&E.size<(H?ae:V))D.numPoints+=E.length/3;else{for(var $=[],Y=0;Yae)&&(D.numSimplified++,$.push(E[Y]),$.push(E[Y+1])),D.numPoints++;H&&function(re,me){for(var _e=0,be=0,Xe=re.length,at=Xe-2;be0===me)for(be=0,Xe=re.length;be24)throw new Error("maxZoom should be in the 0-24 range");if(E.promoteId&&E.generateId)throw new Error("promoteId and generateId cannot be used together.");var V=function(H,X){var ae=[];if(H.type==="FeatureCollection")for(var $=0;$1&&console.time("creation"),be=this.tiles[_e]=gi(Z,E,D,V,Y),this.tileCoords.push({z:E,x:D,y:V}),re)){re>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",E,D,V,be.numFeatures,be.numPoints,be.numSimplified),console.timeEnd("creation"));var Xe="z"+E;this.stats[Xe]=(this.stats[Xe]||0)+1,this.total++}if(be.source=Z,H){if(E===Y.maxZoom||E===H)continue;var at=1<1&&console.time("clipping");var Oe,Qe,ut,Gt,Yt,Ft,Bt=.5*Y.buffer/Y.extent,Qi=.5-Bt,ri=.5+Bt,Ci=1+Bt;Oe=Qe=ut=Gt=null,Yt=Fr(Z,me,D-Bt,D+ri,0,be.minX,be.maxX,Y),Ft=Fr(Z,me,D+Qi,D+Ci,0,be.minX,be.maxX,Y),Z=null,Yt&&(Oe=Fr(Yt,me,V-Bt,V+ri,1,be.minY,be.maxY,Y),Qe=Fr(Yt,me,V+Qi,V+Ci,1,be.minY,be.maxY,Y),Yt=null),Ft&&(ut=Fr(Ft,me,V-Bt,V+ri,1,be.minY,be.maxY,Y),Gt=Fr(Ft,me,V+Qi,V+Ci,1,be.minY,be.maxY,Y),Ft=null),re>1&&console.timeEnd("clipping"),$.push(Oe||[],E+1,2*D,2*V),$.push(Qe||[],E+1,2*D,2*V+1),$.push(ut||[],E+1,2*D+1,2*V),$.push(Gt||[],E+1,2*D+1,2*V+1)}}},Ee.prototype.getTile=function(Z,E,D){var V=this.options,H=V.extent,X=V.debug;if(Z<0||Z>24)return null;var ae=1<1&&console.log("drilling down to z%d-%d-%d",Z,E,D);for(var Y,re=Z,me=E,_e=D;!Y&&re>0;)re--,me=Math.floor(me/2),_e=Math.floor(_e/2),Y=this.tiles[xt(re,me,_e)];return Y&&Y.source?(X>1&&console.log("found parent tile z%d-%d-%d",re,me,_e),X>1&&console.time("drilling down"),this.splitTile(Y.source,re,me,_e,Z,E,D),X>1&&console.timeEnd("drilling down"),this.tiles[$]?ke(this.tiles[$],H):null):null};class ft extends We{constructor(E,D,V,H){super(E,D,V),this._dataUpdateable=new Map,this.loadGeoJSON=(X,ae)=>{const{promoteId:$}=X;if(X.request)return o.f(X.request,(Y,re,me,_e)=>{this._dataUpdateable=sr(re,$)?sn(re,$):void 0,ae(Y,re,me,_e)});if(typeof X.data=="string")try{const Y=JSON.parse(X.data);this._dataUpdateable=sr(Y,$)?sn(Y,$):void 0,ae(null,Y)}catch{ae(new Error(`Input data given to '${X.source}' is not a valid GeoJSON object.`))}else X.dataDiff?this._dataUpdateable?(function(Y,re,me){var _e,be,Xe,at;if(re.removeAll&&Y.clear(),re.remove)for(const Oe of re.remove)Y.delete(Oe);if(re.add)for(const Oe of re.add){const Qe=ct(Oe,me);Qe!=null&&Y.set(Qe,Oe)}if(re.update)for(const Oe of re.update){let Qe=Y.get(Oe.id);if(Qe==null)continue;const ut=!Oe.removeAllProperties&&(((_e=Oe.removeProperties)===null||_e===void 0?void 0:_e.length)>0||((be=Oe.addOrUpdateProperties)===null||be===void 0?void 0:be.length)>0);if((Oe.newGeometry||Oe.removeAllProperties||ut)&&(Qe=Object.assign({},Qe),Y.set(Oe.id,Qe),ut&&(Qe.properties=Object.assign({},Qe.properties))),Oe.newGeometry&&(Qe.geometry=Oe.newGeometry),Oe.removeAllProperties)Qe.properties={};else if(((Xe=Oe.removeProperties)===null||Xe===void 0?void 0:Xe.length)>0)for(const Gt of Oe.removeProperties)Object.prototype.hasOwnProperty.call(Qe.properties,Gt)&&delete Qe.properties[Gt];if(((at=Oe.addOrUpdateProperties)===null||at===void 0?void 0:at.length)>0)for(const{key:Gt,value:Yt}of Oe.addOrUpdateProperties)Qe.properties[Gt]=Yt}}(this._dataUpdateable,X.dataDiff,$),ae(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):ae(new Error(`Cannot update existing geojson data in ${X.source}`)):ae(new Error(`Input data given to '${X.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},this.loadVectorData=this.loadGeoJSONTile,H&&(this.loadGeoJSON=H)}loadGeoJSONTile(E,D){const V=E.tileID.canonical;if(!this._geoJSONIndex)return D(null,null);const H=this._geoJSONIndex.getTile(V.z,V.x,V.y);if(!H)return D(null,null);const X=new class{constructor($){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=o.N,this.length=$.length,this._features=$}feature($){return new class{constructor(Y){this._feature=Y,this.extent=o.N,this.type=Y.type,this.properties=Y.tags,"id"in Y&&!isNaN(Y.id)&&(this.id=parseInt(Y.id,10))}loadGeometry(){if(this._feature.type===1){const Y=[];for(const re of this._feature.geometry)Y.push([new o.P(re[0],re[1])]);return Y}{const Y=[];for(const re of this._feature.geometry){const me=[];for(const _e of re)me.push(new o.P(_e[0],_e[1]));Y.push(me)}return Y}}toGeoJSON(Y,re,me){return Je.call(this,Y,re,me)}}(this._features[$])}}(H.features);let ae=Ji(X);ae.byteOffset===0&&ae.byteLength===ae.buffer.byteLength||(ae=new Uint8Array(ae)),D(null,{vectorTile:X,rawData:ae.buffer})}loadData(E,D){var V;(V=this._pendingRequest)===null||V===void 0||V.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const H=!!(E&&E.request&&E.request.collectResourceTiming)&&new o.bu(E.request);this._pendingCallback=D,this._pendingRequest=this.loadGeoJSON(E,(X,ae)=>{if(delete this._pendingCallback,delete this._pendingRequest,X||!ae)return D(X);if(typeof ae!="object")return D(new Error(`Input data given to '${E.source}' is not a valid GeoJSON object.`));{et(ae,!0);try{if(E.filter){const Y=o.bC(E.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Y.result==="error")throw new Error(Y.value.map(me=>`${me.key}: ${me.message}`).join(", "));ae={type:"FeatureCollection",features:ae.features.filter(me=>Y.value.evaluate({zoom:0},me))}}this._geoJSONIndex=E.cluster?new ti(function({superclusterOptions:Y,clusterProperties:re}){if(!re||!Y)return Y;const me={},_e={},be={accumulated:null,zoom:0},Xe={properties:null},at=Object.keys(re);for(const Oe of at){const[Qe,ut]=re[Oe],Gt=o.bC(ut),Yt=o.bC(typeof Qe=="string"?[Qe,["accumulated"],["get",Oe]]:Qe);me[Oe]=Gt.value,_e[Oe]=Yt.value}return Y.map=Oe=>{Xe.properties=Oe;const Qe={};for(const ut of at)Qe[ut]=me[ut].evaluate(be,Xe);return Qe},Y.reduce=(Oe,Qe)=>{Xe.properties=Qe;for(const ut of at)be.accumulated=Oe[ut],Oe[ut]=_e[ut].evaluate(be,Xe)},Y}(E)).load(ae.features):function(Y,re){return new Ee(Y,re)}(ae,E.geojsonVtOptions)}catch(Y){return D(Y)}this.loaded={};const $={};if(H){const Y=H.finish();Y&&($.resourceTiming={},$.resourceTiming[E.source]=JSON.parse(JSON.stringify(Y)))}D(null,$)}})}reloadTile(E,D){const V=this.loaded;return V&&V[E.uid]?super.reloadTile(E,D):this.loadTile(E,D)}removeSource(E,D){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),D()}getClusterExpansionZoom(E,D){try{D(null,this._geoJSONIndex.getClusterExpansionZoom(E.clusterId))}catch(V){D(V)}}getClusterChildren(E,D){try{D(null,this._geoJSONIndex.getChildren(E.clusterId))}catch(V){D(V)}}getClusterLeaves(E,D){try{D(null,this._geoJSONIndex.getLeaves(E.clusterId,E.limit,E.offset))}catch(V){D(V)}}}class gn{constructor(E){this.self=E,this.actor=new o.C(E,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:We,geojson:ft},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(D,V)=>{if(this.workerSourceTypes[D])throw new Error(`Worker source with name "${D}" already registered.`);this.workerSourceTypes[D]=V},this.self.registerRTLTextPlugin=D=>{if(o.bD.isParsed())throw new Error("RTL text plugin already registered.");o.bD.applyArabicShaping=D.applyArabicShaping,o.bD.processBidirectionalText=D.processBidirectionalText,o.bD.processStyledBidirectionalText=D.processStyledBidirectionalText}}setReferrer(E,D){this.referrer=D}setImages(E,D,V){this.availableImages[E]=D;for(const H in this.workerSources[E]){const X=this.workerSources[E][H];for(const ae in X)X[ae].availableImages=D}V()}setLayers(E,D,V){this.getLayerIndex(E).replace(D),V()}updateLayers(E,D,V){this.getLayerIndex(E).update(D.layers,D.removedIds),V()}loadTile(E,D,V){this.getWorkerSource(E,D.type,D.source).loadTile(D,V)}loadDEMTile(E,D,V){this.getDEMWorkerSource(E,D.source).loadTile(D,V)}reloadTile(E,D,V){this.getWorkerSource(E,D.type,D.source).reloadTile(D,V)}abortTile(E,D,V){this.getWorkerSource(E,D.type,D.source).abortTile(D,V)}removeTile(E,D,V){this.getWorkerSource(E,D.type,D.source).removeTile(D,V)}removeDEMTile(E,D){this.getDEMWorkerSource(E,D.source).removeTile(D)}removeSource(E,D,V){if(!this.workerSources[E]||!this.workerSources[E][D.type]||!this.workerSources[E][D.type][D.source])return;const H=this.workerSources[E][D.type][D.source];delete this.workerSources[E][D.type][D.source],H.removeSource!==void 0?H.removeSource(D,V):V()}loadWorkerSource(E,D,V){try{this.self.importScripts(D.url),V()}catch(H){V(H.toString())}}syncRTLPluginState(E,D,V){try{o.bD.setState(D);const H=o.bD.getPluginURL();if(o.bD.isLoaded()&&!o.bD.isParsed()&&H!=null){this.self.importScripts(H);const X=o.bD.isParsed();V(X?void 0:new Error(`RTL Text Plugin failed to import scripts from ${H}`),X)}}catch(H){V(H.toString())}}getAvailableImages(E){let D=this.availableImages[E];return D||(D=[]),D}getLayerIndex(E){let D=this.layerIndexes[E];return D||(D=this.layerIndexes[E]=new te),D}getWorkerSource(E,D,V){return this.workerSources[E]||(this.workerSources[E]={}),this.workerSources[E][D]||(this.workerSources[E][D]={}),this.workerSources[E][D][V]||(this.workerSources[E][D][V]=new this.workerSourceTypes[D]({send:(H,X,ae)=>{this.actor.send(H,X,ae,E)}},this.getLayerIndex(E),this.getAvailableImages(E))),this.workerSources[E][D][V]}getDEMWorkerSource(E,D){return this.demWorkerSources[E]||(this.demWorkerSources[E]={}),this.demWorkerSources[E][D]||(this.demWorkerSources[E][D]=new He),this.demWorkerSources[E][D]}}return o.i()&&(self.worker=new gn(self)),gn}),z(["./shared"],function(o){var te="3.6.2";class O{static testProp(t){if(!O.docStyle)return t[0];for(let n=0;n{window.removeEventListener("click",O.suppressClickInternal,!0)},0)}static mousePos(t,n){const a=t.getBoundingClientRect();return new o.P(n.clientX-a.left-t.clientLeft,n.clientY-a.top-t.clientTop)}static touchPos(t,n){const a=t.getBoundingClientRect(),c=[];for(let d=0;d{t=[],n=0,a=0,c={}},u.addThrottleControl=S=>{const A=a++;return c[A]=S,A},u.removeThrottleControl=S=>{delete c[S],y()},u.getImage=(S,A,k=!0)=>{ne.supported&&(S.headers||(S.headers={}),S.headers.accept="image/webp,*/*");const L={requestParameters:S,supportImageRefresh:k,callback:A,cancelled:!1,completed:!1,cancel:()=>{L.completed||L.cancelled||(L.cancelled=!0,L.innerRequest&&(L.innerRequest.cancel(),n--),y())}};return t.push(L),y(),L};const d=S=>{const{requestParameters:A,supportImageRefresh:k,callback:L}=S;return o.e(A,{type:"image"}),(k!==!1||o.i()||o.g(A.url)||A.headers&&!Object.keys(A.headers).reduce((q,j)=>q&&j==="accept",!0)?o.m:b)(A,(q,j,G,N)=>{g(S,L,q,j,G,N)})},g=(S,A,k,L,q,j)=>{k?A(k):L instanceof HTMLImageElement||o.a(L)?A(null,L):L&&((G,N)=>{typeof createImageBitmap=="function"?o.b(G,N):o.d(G,N)})(L,(G,N)=>{G!=null?A(G):N!=null&&A(null,N,{cacheControl:q,expires:j})}),S.cancelled||(S.completed=!0,n--,y())},y=()=>{const S=(()=>{const A=Object.keys(c);let k=!1;if(A.length>0){for(const L of A)if(k=c[L](),k)break}return k})()?o.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:o.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let A=n;A0;A++){const k=t.shift();if(k.cancelled){A--;continue}const L=d(k);n++,k.innerRequest=L}},b=(S,A)=>{const k=new Image,L=S.url;let q=!1;const j=S.credentials;return j&&j==="include"?k.crossOrigin="use-credentials":(j&&j==="same-origin"||!o.s(L))&&(k.crossOrigin="anonymous"),k.fetchPriority="high",k.onload=()=>{A(null,k),k.onerror=k.onload=null},k.onerror=()=>{q||A(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.")),k.onerror=k.onload=null},k.src=L,{cancel:()=>{q=!0,k.src=""}}}}(Ge||(Ge={})),Ge.resetRequestQueue(),function(u){u.Glyphs="Glyphs",u.Image="Image",u.Source="Source",u.SpriteImage="SpriteImage",u.SpriteJSON="SpriteJSON",u.Style="Style",u.Tile="Tile",u.Unknown="Unknown"}(et||(et={}));class Je{constructor(t){this._transformRequestFn=t}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}normalizeSpriteURL(t,n,a){const c=function(d){const g=d.match(Ye);if(!g)throw new Error(`Unable to parse URL "${d}"`);return{protocol:g[1],authority:g[2],path:g[3]||"/",params:g[4]?g[4].split("&"):[]}}(t);return c.path+=`${n}${a}`,function(d){const g=d.params.length?`?${d.params.join("&")}`:"";return`${d.protocol}://${d.authority}${d.path}${g}`}(c)}setTransformRequest(t){this._transformRequestFn=t}}const Ye=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function bt(u){var t=new o.A(3);return t[0]=u[0],t[1]=u[1],t[2]=u[2],t}var ht,zt=function(u,t,n){return u[0]=t[0]-n[0],u[1]=t[1]-n[1],u[2]=t[2]-n[2],u};ht=new o.A(3),o.A!=Float32Array&&(ht[0]=0,ht[1]=0,ht[2]=0);var st=function(u){var t=u[0],n=u[1];return t*t+n*n};function dt(u){const t=[];if(typeof u=="string")t.push({id:"default",url:u});else if(u&&u.length>0){const n=[];for(const{id:a,url:c}of u){const d=`${a}${c}`;n.indexOf(d)===-1&&(n.push(d),t.push({id:a,url:c}))}}return t}function mt(u,t,n,a,c){if(a)return void u(a);if(c!==Object.values(t).length||c!==Object.values(n).length)return;const d={};for(const g in t){d[g]={};const y=o.h.getImageCanvasContext(n[g]),b=t[g];for(const S in b){const{width:A,height:k,x:L,y:q,sdf:j,pixelRatio:G,stretchX:N,stretchY:ee,content:ce}=b[S];d[g][S]={data:null,pixelRatio:G,sdf:j,stretchX:N,stretchY:ee,content:ce,spriteData:{width:A,height:k,x:L,y:q,context:y}}}}u(null,d)}(function(){var u=new o.A(2);o.A!=Float32Array&&(u[0]=0,u[1]=0)})();class qe{constructor(t,n,a,c){this.context=t,this.format=a,this.texture=t.gl.createTexture(),this.update(n,c)}update(t,n,a){const{width:c,height:d}=t,g=!(this.size&&this.size[0]===c&&this.size[1]===d||a),{context:y}=this,{gl:b}=y;if(this.useMipmap=!!(n&&n.useMipmap),b.bindTexture(b.TEXTURE_2D,this.texture),y.pixelStoreUnpackFlipY.set(!1),y.pixelStoreUnpack.set(1),y.pixelStoreUnpackPremultiplyAlpha.set(this.format===b.RGBA&&(!n||n.premultiply!==!1)),g)this.size=[c,d],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||o.a(t)?b.texImage2D(b.TEXTURE_2D,0,this.format,this.format,b.UNSIGNED_BYTE,t):b.texImage2D(b.TEXTURE_2D,0,this.format,c,d,0,this.format,b.UNSIGNED_BYTE,t.data);else{const{x:S,y:A}=a||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||o.a(t)?b.texSubImage2D(b.TEXTURE_2D,0,S,A,b.RGBA,b.UNSIGNED_BYTE,t):b.texSubImage2D(b.TEXTURE_2D,0,S,A,c,d,b.RGBA,b.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&b.generateMipmap(b.TEXTURE_2D)}bind(t,n,a){const{context:c}=this,{gl:d}=c;d.bindTexture(d.TEXTURE_2D,this.texture),a!==d.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(a=d.LINEAR),t!==this.filter&&(d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,t),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,a||t),this.filter=t),n!==this.wrap&&(d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,n),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function ve(u){const{userImage:t}=u;return!!(t&&t.render&&t.render())&&(u.data.replace(new Uint8Array(t.data.buffer)),!0)}class rt extends o.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new o.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:n,callback:a}of this.requestors)this._notify(n,a);this.requestors=[]}}getImage(t){const n=this.images[t];if(n&&!n.data&&n.spriteData){const a=n.spriteData;n.data=new o.R({width:a.width,height:a.height},a.context.getImageData(a.x,a.y,a.width,a.height).data),n.spriteData=null}return n}addImage(t,n){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,n)&&(this.images[t]=n)}_validate(t,n){let a=!0;const c=n.data||n.spriteData;return this._validateStretch(n.stretchX,c&&c.width)||(this.fire(new o.j(new Error(`Image "${t}" has invalid "stretchX" value`))),a=!1),this._validateStretch(n.stretchY,c&&c.height)||(this.fire(new o.j(new Error(`Image "${t}" has invalid "stretchY" value`))),a=!1),this._validateContent(n.content,n)||(this.fire(new o.j(new Error(`Image "${t}" has invalid "content" value`))),a=!1),a}_validateStretch(t,n){if(!t)return!0;let a=0;for(const c of t){if(c[0]-1);b++,d[b]=y,g[b]=S,g[b+1]=gt}for(let y=0,b=0;y{let y=this.entries[c];y||(y=this.entries[c]={glyphs:{},requests:{},ranges:{}});let b=y.glyphs[d];if(b!==void 0)return void g(null,{stack:c,id:d,glyph:b});if(b=this._tinySDF(y,c,d),b)return y.glyphs[d]=b,void g(null,{stack:c,id:d,glyph:b});const S=Math.floor(d/256);if(256*S>65535)return void g(new Error("glyphs > 65535 not supported"));if(y.ranges[S])return void g(null,{stack:c,id:d,glyph:b});if(!this.url)return void g(new Error("glyphsUrl is not set"));let A=y.requests[S];A||(A=y.requests[S]=[],$e.loadGlyphRange(c,S,this.url,this.requestManager,(k,L)=>{if(L){for(const q in L)this._doesCharSupportLocalGlyph(+q)||(y.glyphs[+q]=L[+q]);y.ranges[S]=!0}for(const q of A)q(k,L);delete y.requests[S]})),A.push((k,L)=>{k?g(k):L&&g(null,{stack:c,id:d,glyph:L[d]||null})})},(c,d)=>{if(c)n(c);else if(d){const g={};for(const{stack:y,id:b,glyph:S}of d)(g[y]||(g[y]={}))[b]=S&&{id:S.id,bitmap:S.bitmap.clone(),metrics:S.metrics};n(null,g)}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(o.u["CJK Unified Ideographs"](t)||o.u["Hangul Syllables"](t)||o.u.Hiragana(t)||o.u.Katakana(t))}_tinySDF(t,n,a){const c=this.localIdeographFontFamily;if(!c||!this._doesCharSupportLocalGlyph(a))return;let d=t.tinySDF;if(!d){let y="400";/bold/i.test(n)?y="900":/medium/i.test(n)?y="500":/light/i.test(n)&&(y="200"),d=t.tinySDF=new $e.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:c,fontWeight:y})}const g=d.draw(String.fromCharCode(a));return{id:a,bitmap:new o.q({width:g.width||60,height:g.height||60},g.data),metrics:{width:g.glyphWidth/2||24,height:g.glyphHeight/2||24,left:g.glyphLeft/2+.5||0,top:g.glyphTop/2-27.5||-8,advance:g.glyphAdvance/2||24,isDoubleResolution:!0}}}}$e.loadGlyphRange=function(u,t,n,a,c){const d=256*t,g=d+255,y=a.transformRequest(n.replace("{fontstack}",u).replace("{range}",`${d}-${g}`),et.Glyphs);o.l(y,(b,S)=>{if(b)c(b);else if(S){const A={};for(const k of o.n(S))A[k.id]=k;c(null,A)}})},$e.TinySDF=class{constructor({fontSize:u=24,buffer:t=3,radius:n=8,cutoff:a=.25,fontFamily:c="sans-serif",fontWeight:d="normal",fontStyle:g="normal"}={}){this.buffer=t,this.cutoff=a,this.radius=n;const y=this.size=u+4*t,b=this._createCanvas(y),S=this.ctx=b.getContext("2d",{willReadFrequently:!0});S.font=`${g} ${d} ${u}px ${c}`,S.textBaseline="alphabetic",S.textAlign="left",S.fillStyle="black",this.gridOuter=new Float64Array(y*y),this.gridInner=new Float64Array(y*y),this.f=new Float64Array(y),this.z=new Float64Array(y+1),this.v=new Uint16Array(y)}_createCanvas(u){const t=document.createElement("canvas");return t.width=t.height=u,t}draw(u){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:a,actualBoundingBoxLeft:c,actualBoundingBoxRight:d}=this.ctx.measureText(u),g=Math.ceil(n),y=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(d-c))),b=Math.min(this.size-this.buffer,g+Math.ceil(a)),S=y+2*this.buffer,A=b+2*this.buffer,k=Math.max(S*A,0),L=new Uint8ClampedArray(k),q={data:L,width:S,height:A,glyphWidth:y,glyphHeight:b,glyphTop:g,glyphLeft:0,glyphAdvance:t};if(y===0||b===0)return q;const{ctx:j,buffer:G,gridInner:N,gridOuter:ee}=this;j.clearRect(G,G,y,b),j.fillText(u,G,G+g);const ce=j.getImageData(G,G,y,b);ee.fill(gt,0,k),N.fill(0,0,k);for(let K=0;K0?ye*ye:0,N[pe]=ye<0?ye*ye:0}}lt(ee,0,0,S,A,S,this.f,this.v,this.z),lt(N,G,G,y,b,S,this.f,this.v,this.z);for(let K=0;K1&&(b=t[++y]);const A=Math.abs(S-b.left),k=Math.abs(S-b.right),L=Math.min(A,k);let q;const j=d/a*(c+1);if(b.isDash){const G=c-Math.abs(j);q=Math.sqrt(L*L+G*G)}else q=c-Math.sqrt(L*L+j*j);this.data[g+S]=Math.max(0,Math.min(255,q+128))}}}addRegularDash(t){for(let y=t.length-1;y>=0;--y){const b=t[y],S=t[y+1];b.zeroLength?t.splice(y,1):S&&S.isDash===b.isDash&&(S.left=b.left,t.splice(y,1))}const n=t[0],a=t[t.length-1];n.isDash===a.isDash&&(n.left=a.left-this.width,a.right=n.right+this.width);const c=this.width*this.nextRow;let d=0,g=t[d];for(let y=0;y1&&(g=t[++d]);const b=Math.abs(y-g.left),S=Math.abs(y-g.right),A=Math.min(b,S);this.data[c+y]=Math.max(0,Math.min(255,(g.isDash?A:-A)+128))}}addDash(t,n){const a=n?7:0,c=2*a+1;if(this.nextRow+c>this.height)return o.w("LineAtlas out of space"),null;let d=0;for(let y=0;y{c.send(t,n,d)},a=a||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(n=>{n.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}}function Ot(u,t,n){const a=function(c,d){if(c)return n(c);if(d){const g=o.F(o.e(d,u),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);d.vector_layers&&(g.vectorLayers=d.vector_layers,g.vectorLayerIds=g.vectorLayers.map(y=>y.id)),n(null,g)}};return u.url?o.f(t.transformRequest(u.url,et.Source),a):o.h.frame(()=>a(null,u))}class yt{constructor(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof o.L?new o.L(t.lng,t.lat):o.L.convert(t),this}setSouthWest(t){return this._sw=t instanceof o.L?new o.L(t.lng,t.lat):o.L.convert(t),this}extend(t){const n=this._sw,a=this._ne;let c,d;if(t instanceof o.L)c=t,d=t;else{if(!(t instanceof yt))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(yt.convert(t)):this.extend(o.L.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(o.L.convert(t)):this;if(c=t._sw,d=t._ne,!c||!d)return this}return n||a?(n.lng=Math.min(c.lng,n.lng),n.lat=Math.min(c.lat,n.lat),a.lng=Math.max(d.lng,a.lng),a.lat=Math.max(d.lat,a.lat)):(this._sw=new o.L(c.lng,c.lat),this._ne=new o.L(d.lng,d.lat)),this}getCenter(){return new o.L((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new o.L(this.getWest(),this.getNorth())}getSouthEast(){return new o.L(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:n,lat:a}=o.L.convert(t);let c=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(c=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&c}static convert(t){return t instanceof yt?t:t&&new yt(t)}static fromLngLat(t,n=0){const a=360*n/40075017,c=a/Math.cos(Math.PI/180*t.lat);return new yt(new o.L(t.lng-c,t.lat-a),new o.L(t.lng+c,t.lat+a))}}class Rt{constructor(t,n,a){this.bounds=yt.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=a||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 n=Math.pow(2,t.z),a=Math.floor(o.G(this.bounds.getWest())*n),c=Math.floor(o.H(this.bounds.getNorth())*n),d=Math.ceil(o.G(this.bounds.getEast())*n),g=Math.ceil(o.H(this.bounds.getSouth())*n);return t.x>=a&&t.x=c&&t.y{this._loaded=!1,this.fire(new o.k("dataloading",{dataType:"source"})),this._tileJSONRequest=Ot(this._options,this.map._requestManager,(d,g)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),d?this.fire(new o.j(d)):g&&(o.e(this,g),g.bounds&&(this.tileBounds=new Rt(g.bounds,this.minzoom,this.maxzoom)),this.fire(new o.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.k("data",{dataType:"source",sourceDataType:"content"})))})},this.serialize=()=>o.e({},this._options),this.id=t,this.dispatcher=a,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,o.e(this,o.F(n,["url","scheme","tileSize","promoteId"])),this._options=o.e({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(c)}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}loadTile(t,n){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),c={request:this.map._requestManager.transformRequest(a,et.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function d(g,y){return delete t.request,t.aborted?n(null):g&&g.status!==404?n(g):(y&&y.resourceTiming&&(t.resourceTiming=y.resourceTiming),this.map._refreshExpiredTiles&&y&&t.setExpiryData(y),t.loadVectorData(y,this.map.painter),n(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}c.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired"?t.state==="loading"?t.reloadCallback=n:t.request=t.actor.send("reloadTile",c,d.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",c,d.bind(this)))}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},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class ti extends o.E{constructor(t,n,a,c){super(),this.id=t,this.dispatcher=a,this.setEventedParent(c),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=o.e({type:"raster"},n),o.e(this,o.F(n,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new o.k("dataloading",{dataType:"source"})),this._tileJSONRequest=Ot(this._options,this.map._requestManager,(t,n)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new o.j(t)):n&&(o.e(this,n),n.bounds&&(this.tileBounds=new Rt(n.bounds,this.minzoom,this.maxzoom)),this.fire(new o.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.k("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}serialize(){return o.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,n){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=Ge.getImage(this.map._requestManager.transformRequest(a,et.Tile),(c,d,g)=>{if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(c)t.state="errored",n(c);else if(d){this.map._refreshExpiredTiles&&g&&t.setExpiryData(g);const y=this.map.painter.context,b=y.gl;t.texture=this.map.painter.getTileTexture(d.width),t.texture?t.texture.update(d,{useMipmap:!0}):(t.texture=new qe(y,d,b.RGBA,{useMipmap:!0}),t.texture.bind(b.LINEAR,b.CLAMP_TO_EDGE,b.LINEAR_MIPMAP_NEAREST),y.extTextureFilterAnisotropic&&b.texParameterf(b.TEXTURE_2D,y.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,y.extTextureFilterAnisotropicMax)),t.state="loaded",n(null)}},this.map._refreshExpiredTiles)}abortTile(t,n){t.request&&(t.request.cancel(),delete t.request),n()}unloadTile(t,n){t.texture&&this.map.painter.saveTileTexture(t.texture),n()}hasTransition(){return!1}}class Ie extends ti{constructor(t,n,a,c){super(t,n,a,c),this.type="raster-dem",this.maxzoom=22,this._options=o.e({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(t,n){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),c=this.map._requestManager.transformRequest(a,et.Tile);function d(g,y){g&&(t.state="errored",n(g)),y&&(t.dem=y,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",n(null))}t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.request=Ge.getImage(c,(g,y,b)=>o._(this,void 0,void 0,function*(){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(g)t.state="errored",n(g);else if(y){this.map._refreshExpiredTiles&&t.setExpiryData(b);const S=o.a(y)&&o.J()?y:yield function(k){return o._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&o.K()){const L=k.width+2,q=k.height+2;try{return new o.R({width:L,height:q},yield o.M(k,-1,-1,L,q))}catch{}}return o.h.getImageData(k,1)})}(y),A={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:S,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",A,d))}}),this.map._refreshExpiredTiles)}_getNeighboringTiles(t){const n=t.canonical,a=Math.pow(2,n.z),c=(n.x-1+a)%a,d=n.x===0?t.wrap-1:t.wrap,g=(n.x+1+a)%a,y=n.x+1===a?t.wrap+1:t.wrap,b={};return b[new o.O(t.overscaledZ,d,n.z,c,n.y).key]={backfilled:!1},b[new o.O(t.overscaledZ,y,n.z,g,n.y).key]={backfilled:!1},n.y>0&&(b[new o.O(t.overscaledZ,d,n.z,c,n.y-1).key]={backfilled:!1},b[new o.O(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},b[new o.O(t.overscaledZ,y,n.z,g,n.y-1).key]={backfilled:!1}),n.y+1{this._updateWorkerData()},this.serialize=()=>o.e({},this._options,{type:this.type,data:this._data}),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=a.getActor(),this.setEventedParent(c),this._data=n.data,this._options=o.e({},n),this._collectResourceTiming=n.collectResourceTiming,n.maxzoom!==void 0&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;const d=o.N/this.tileSize;this.workerOptions=o.e({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(n.buffer!==void 0?n.buffer:128)*d,tolerance:(n.tolerance!==void 0?n.tolerance:.375)*d,extent:o.N,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:n.clusterMaxZoom!==void 0?n.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:o.N,radius:(n.clusterRadius||50)*d,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData(),this}updateData(t){return this._updateWorkerData(t),this}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(t.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),t.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(t,n){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},n),this}getClusterChildren(t,n){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},n),this}getClusterLeaves(t,n,a,c){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:n,offset:a},c),this}_updateWorkerData(t){const n=o.e({},this.workerOptions);t?n.dataDiff=t:typeof this._data=="string"?(n.request=this.map._requestManager.transformRequest(o.h.resolveURL(this._data),et.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new o.k("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,n,(a,c)=>{if(this._pendingLoads--,this._removed||c&&c.abandoned)return void this.fire(new o.k("dataabort",{dataType:"source"}));let d=null;if(c&&c.resourceTiming&&c.resourceTiming[this.id]&&(d=c.resourceTiming[this.id].slice(0)),a)return void this.fire(new o.j(a));const g={dataType:"source"};this._collectResourceTiming&&d&&d.length>0&&o.e(g,{resourceTiming:d}),this.fire(new o.k("data",Object.assign(Object.assign({},g),{sourceDataType:"metadata"}))),this.fire(new o.k("data",Object.assign(Object.assign({},g),{sourceDataType:"content"})))})}loaded(){return this._pendingLoads===0}loadTile(t,n){const a=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const c={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(a,c,(d,g)=>(delete t.request,t.unloadVectorData(),t.aborted?n(null):d?n(d):(t.loadVectorData(g,this.map.painter,a==="reloadTile"),n(null))))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}hasTransition(){return!1}}var St=o.Q([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Jt extends o.E{constructor(t,n,a,c){super(),this.load=(d,g)=>{this._loaded=!1,this.fire(new o.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=Ge.getImage(this.map._requestManager.transformRequest(this.url,et.Image),(y,b)=>{this._request=null,this._loaded=!0,y?this.fire(new o.j(y)):b&&(this.image=b,d&&(this.coordinates=d),g&&g(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||!this.image)return;const d=this.map.painter.context,g=d.gl;this.boundsBuffer||(this.boundsBuffer=d.createVertexBuffer(this._boundsArray,St.members)),this.boundsSegments||(this.boundsSegments=o.S.simpleSegment(0,0,4,2)),this.texture||(this.texture=new qe(d,this.image,g.RGBA),this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE));let y=!1;for(const b in this.tiles){const S=this.tiles[b];S.state!=="loaded"&&(S.state="loaded",S.texture=this.texture,y=!0)}y&&this.fire(new o.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"image",url:this.options.url,coordinates:this.coordinates}),this.id=t,this.dispatcher=a,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(c),this.options=n}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=t.url,this.load(t.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new o.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(t){this.coordinates=t;const n=t.map(o.U.fromLngLat);this.tileID=function(c){let d=1/0,g=1/0,y=-1/0,b=-1/0;for(const L of c)d=Math.min(d,L.x),g=Math.min(g,L.y),y=Math.max(y,L.x),b=Math.max(b,L.y);const S=Math.max(y-d,b-g),A=Math.max(0,Math.floor(-Math.log(S)/Math.LN2)),k=Math.pow(2,A);return new o.W(A,Math.floor((d+y)/2*k),Math.floor((g+b)/2*k))}(n),this.minzoom=this.maxzoom=this.tileID.z;const a=n.map(c=>this.tileID.getTilePoint(c)._round());return this._boundsArray=new o.V,this._boundsArray.emplaceBack(a[0].x,a[0].y,0,0),this._boundsArray.emplaceBack(a[1].x,a[1].y,o.N,0),this._boundsArray.emplaceBack(a[3].x,a[3].y,0,o.N),this._boundsArray.emplaceBack(a[2].x,a[2].y,o.N,o.N),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new o.k("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(t,n){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},n(null)):(t.state="errored",n(null))}hasTransition(){return!1}}class nr extends Jt{constructor(t,n,a,c){super(t,n,a,c),this.load=()=>{this._loaded=!1;const d=this.options;this.urls=[];for(const g of d.urls)this.urls.push(this.map._requestManager.transformRequest(g,et.Source).url);o.X(this.urls,(g,y)=>{this._loaded=!0,g?this.fire(new o.j(g)):y&&(this.video=y,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const d=this.map.painter.context,g=d.gl;this.boundsBuffer||(this.boundsBuffer=d.createVertexBuffer(this._boundsArray,St.members)),this.boundsSegments||(this.boundsSegments=o.S.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE),g.texSubImage2D(g.TEXTURE_2D,0,0,0,g.RGBA,g.UNSIGNED_BYTE,this.video)):(this.texture=new qe(d,this.video,g.RGBA),this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE));let y=!1;for(const b in this.tiles){const S=this.tiles[b];S.state!=="loaded"&&(S.state="loaded",S.texture=this.texture,y=!0)}y&&this.fire(new o.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"video",urls:this.urls,coordinates:this.coordinates}),this.roundZoom=!0,this.type="video",this.options=n}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const n=this.video.seekable;tn.end(0)?this.fire(new o.j(new o.Y(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}hasTransition(){return this.video&&!this.video.paused}}class Yi extends Jt{constructor(t,n,a,c){super(t,n,a,c),this.load=()=>{this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new o.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},this.prepare=()=>{let d=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,d=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,d=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const g=this.map.painter.context,y=g.gl;this.boundsBuffer||(this.boundsBuffer=g.createVertexBuffer(this._boundsArray,St.members)),this.boundsSegments||(this.boundsSegments=o.S.simpleSegment(0,0,4,2)),this.texture?(d||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new qe(g,this.canvas,y.RGBA,{premultiply:!0});let b=!1;for(const S in this.tiles){const A=this.tiles[S];A.state!=="loaded"&&(A.state="loaded",A.texture=this.texture,b=!0)}b&&this.fire(new o.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(d=>!Array.isArray(d)||d.length!==2||d.some(g=>typeof g!="number"))||this.fire(new o.j(new o.Y(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new o.j(new o.Y(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new o.j(new o.Y(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new o.j(new o.Y(`sources.${t}`,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 o.j(new o.Y(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const ue={},Vt=u=>{switch(u){case"geojson":return nt;case"image":return Jt;case"raster":return ti;case"raster-dem":return Ie;case"vector":return ki;case"video":return nr;case"canvas":return Yi}return ue[u]};function Ui(u,t){const n=o.Z();return o.$(n,n,[1,1,0]),o.a0(n,n,[.5*u.width,.5*u.height,1]),o.a1(n,n,u.calculatePosMatrix(t.toUnwrapped()))}function qi(u,t,n,a,c,d){const g=function(k,L,q){if(k)for(const j of k){const G=L[j];if(G&&G.source===q&&G.type==="fill-extrusion")return!0}else for(const j in L){const G=L[j];if(G.source===q&&G.type==="fill-extrusion")return!0}return!1}(c&&c.layers,t,u.id),y=d.maxPitchScaleFactor(),b=u.tilesIn(a,y,g);b.sort(Pi);const S=[];for(const k of b)S.push({wrappedTileID:k.tileID.wrapped().key,queryResults:k.tile.queryRenderedFeatures(t,n,u._state,k.queryGeometry,k.cameraQueryGeometry,k.scale,c,d,y,Ui(u.transform,k.tileID))});const A=function(k){const L={},q={};for(const j of k){const G=j.queryResults,N=j.wrappedTileID,ee=q[N]=q[N]||{};for(const ce in G){const K=G[ce],ie=ee[ce]=ee[ce]||{},de=L[ce]=L[ce]||[];for(const pe of K)ie[pe.featureIndex]||(ie[pe.featureIndex]=!0,de.push(pe))}}return L}(S);for(const k in A)A[k].forEach(L=>{const q=L.feature,j=u.getFeatureState(q.layer["source-layer"],q.id);q.source=q.layer.source,q.layer["source-layer"]&&(q.sourceLayer=q.layer["source-layer"]),q.state=j});return A}function Pi(u,t){const n=u.tileID,a=t.tileID;return n.overscaledZ-a.overscaledZ||n.canonical.y-a.canonical.y||n.wrap-a.wrap||n.canonical.x-a.canonical.x}class Zi{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=o.a2(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const n=t+this.timeAdded;nd.getLayer(S)).filter(Boolean);if(b.length!==0){y.layers=b,y.stateDependentLayerIds&&(y.stateDependentLayers=y.stateDependentLayerIds.map(S=>b.filter(A=>A.id===S)[0]));for(const S of b)g[S.id]=y}}return g}(t.buckets,n.style),this.hasSymbolBuckets=!1;for(const c in this.buckets){const d=this.buckets[c];if(d instanceof o.a4){if(this.hasSymbolBuckets=!0,!a)break;d.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const c in this.buckets){const d=this.buckets[c];if(d instanceof o.a4&&d.hasRTLText){this.hasRTLText=!0,o.a5();break}}this.queryPadding=0;for(const c in this.buckets){const d=this.buckets[c];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(c).queryRadius(d))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new o.a3}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const a in this.buckets){const c=this.buckets[a];c.uploadPending()&&c.upload(t)}const n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new qe(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new qe(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,a,c,d,g,y,b,S,A){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:c,cameraQueryGeometry:d,scale:g,tileSize:this.tileSize,pixelPosMatrix:A,transform:b,params:y,queryPadding:this.queryPadding*S},t,n,a):{}}querySourceFeatures(t,n){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const c=a.loadVTLayers(),d=n&&n.sourceLayer?n.sourceLayer:"",g=c._geojsonTileLayer||c[d];if(!g)return;const y=o.a6(n&&n.filter),{z:b,x:S,y:A}=this.tileID.canonical,k={z:b,x:S,y:A};for(let L=0;La)c=!1;else if(n)if(this.expirationTime{this.remove(t,d)},a)),this.data[c].push(d),this.order.push(c),this.order.length>this.max){const g=this._getAndRemoveByKey(this.order[0]);g&&this.onRemove(g)}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 n=this.data[t].shift();return n.timeout&&clearTimeout(n.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),n.value}getByKey(t){const n=this.data[t];return n?n[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,n){if(!this.has(t))return this;const a=t.wrapped().key,c=n===void 0?0:this.data[a].indexOf(n),d=this.data[a][c];return this.data[a].splice(c,1),d.timeout&&clearTimeout(d.timeout),this.data[a].length===0&&delete this.data[a],this.onRemove(d.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(t){const n=[];for(const a in this.data)for(const c of this.data[a])t(c.value)||n.push(c);for(const a of n)this.remove(a.value.tileID,a)}}class fe{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,a){const c=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][c]=this.stateChanges[t][c]||{},o.e(this.stateChanges[t][c],a),this.deletedStates[t]===null){this.deletedStates[t]={};for(const d in this.state[t])d!==c&&(this.deletedStates[t][d]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][c]===null){this.deletedStates[t][c]={};for(const d in this.state[t][c])a[d]||(this.deletedStates[t][c][d]=null)}else for(const d in a)this.deletedStates[t]&&this.deletedStates[t][c]&&this.deletedStates[t][c][d]===null&&delete this.deletedStates[t][c][d]}removeFeatureState(t,n,a){if(this.deletedStates[t]===null)return;const c=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},a&&n!==void 0)this.deletedStates[t][c]!==null&&(this.deletedStates[t][c]=this.deletedStates[t][c]||{},this.deletedStates[t][c][a]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][c])for(a in this.deletedStates[t][c]={},this.stateChanges[t][c])this.deletedStates[t][c][a]=null;else this.deletedStates[t][c]=null;else this.deletedStates[t]=null}getState(t,n){const a=String(n),c=o.e({},(this.state[t]||{})[a],(this.stateChanges[t]||{})[a]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const d=this.deletedStates[t][n];if(d===null)return{};for(const g in d)delete c[g]}return c}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){const a={};for(const c in this.stateChanges){this.state[c]=this.state[c]||{};const d={};for(const g in this.stateChanges[c])this.state[c][g]||(this.state[c][g]={}),o.e(this.state[c][g],this.stateChanges[c][g]),d[g]=this.state[c][g];a[c]=d}for(const c in this.deletedStates){this.state[c]=this.state[c]||{};const d={};if(this.deletedStates[c]===null)for(const g in this.state[c])d[g]={},this.state[c][g]={};else for(const g in this.deletedStates[c]){if(this.deletedStates[c][g]===null)this.state[c][g]={};else for(const y of Object.keys(this.deletedStates[c][g]))delete this.state[c][g][y];d[g]=this.state[c][g]}a[c]=a[c]||{},o.e(a[c],d)}if(this.stateChanges={},this.deletedStates={},Object.keys(a).length!==0)for(const c in t)t[c].setFeatureState(a,n)}}class pr extends o.E{constructor(t,n,a){super(),this.id=t,this.dispatcher=a,this.on("data",c=>{c.dataType==="source"&&c.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&c.dataType==="source"&&c.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((c,d,g,y)=>{const b=new(Vt(d.type))(c,d,g,y);if(b.id!==c)throw new Error(`Expected Source id to be ${c} instead of ${b.id}`);return b})(t,n,a,this),this._tiles={},this._cache=new tn(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new fe,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const n=this._tiles[t];if(n.state!=="loaded"&&n.state!=="errored")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,this.terrain)}_loadTile(t,n){return this._source.loadTile(t,n)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,()=>{}),this._source.fire(new o.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}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 n in this._tiles){const a=this._tiles[n];a.upload(t),a.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(Fr).map(t=>t.key)}getRenderableIds(t){const n=[];for(const a in this._tiles)this._isIdRenderable(a,t)&&n.push(this._tiles[a]);return t?n.sort((a,c)=>{const d=a.tileID,g=c.tileID,y=new o.P(d.canonical.x,d.canonical.y)._rotate(this.transform.angle),b=new o.P(g.canonical.x,g.canonical.y)._rotate(this.transform.angle);return d.overscaledZ-g.overscaledZ||b.y-y.y||b.x-y.x}).map(a=>a.tileID.key):n.map(a=>a.tileID).sort(Fr).map(a=>a.key)}hasRenderableParent(t){const n=this.findLoadedParent(t,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(t,n){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(n||!this._tiles[t].holdingForFade())}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,n){const a=this._tiles[t];a&&(a.state!=="loading"&&(a.state=n),this._loadTile(a,this._tileLoaded.bind(this,a,t,n)))}_tileLoaded(t,n,a,c){if(c)return t.state="errored",void(c.status!==404?this._source.fire(new o.j(c,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=o.h.now(),a==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new o.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const n=this.getRenderableIds();for(let c=0;c1||(Math.abs(g)>1&&(Math.abs(g+b)===1?g+=b:Math.abs(g-b)===1&&(g-=b)),d.dem&&c.dem&&(c.dem.backfillBorder(d.dem,g,y),c.neighboringTiles&&c.neighboringTiles[S]&&(c.neighboringTiles[S].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,n,a,c){for(const d in this._tiles){let g=this._tiles[d];if(c[d]||!g.hasData()||g.tileID.overscaledZ<=n||g.tileID.overscaledZ>a)continue;let y=g.tileID;for(;g&&g.tileID.overscaledZ>n+1;){const S=g.tileID.scaledTo(g.tileID.overscaledZ-1);g=this._tiles[S.key],g&&g.hasData()&&(y=S)}let b=y;for(;b.overscaledZ>n;)if(b=b.scaledTo(b.overscaledZ-1),t[b.key]){c[y.key]=y;break}}}findLoadedParent(t,n){if(t.key in this._loadedParentTiles){const a=this._loadedParentTiles[t.key];return a&&a.tileID.overscaledZ>=n?a:null}for(let a=t.overscaledZ-1;a>=n;a--){const c=t.scaledTo(a),d=this._getLoadedTile(c);if(d)return d}}_getLoadedTile(t){const n=this._tiles[t.key];return n&&n.hasData()?n:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const n=Math.ceil(t.width/this._source.tileSize)+1,a=Math.ceil(t.height/this._source.tileSize)+1,c=Math.floor(n*a*(this._maxTileCacheZoomLevels===null?o.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),d=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,c):c;this._cache.setMaxSize(d)}handleWrapJump(t){const n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,n){const a={};for(const c in this._tiles){const d=this._tiles[c];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+n),a[d.tileID.key]=d}this._tiles=a;for(const c in this._timers)clearTimeout(this._timers[c]),delete this._timers[c];for(const c in this._tiles)this._setTileReloadTimer(c,this._tiles[c])}}update(t,n){if(this.transform=t,this.terrain=n,!this._sourceLoaded||this._paused)return;let a;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?a=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(A=>new o.O(A.canonical.z,A.wrap,A.canonical.z,A.canonical.x,A.canonical.y)):(a=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n}),this._source.hasTile&&(a=a.filter(A=>this._source.hasTile(A)))):a=[];const c=t.coveringZoomLevel(this._source),d=Math.max(c-pr.maxOverzooming,this._source.minzoom),g=Math.max(c+pr.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const A={};for(const k of a)if(k.canonical.z>this._source.minzoom){const L=k.scaledTo(k.canonical.z-1);A[L.key]=L;const q=k.scaledTo(Math.max(this._source.minzoom,Math.min(k.canonical.z,5)));A[q.key]=q}a=a.concat(Object.values(A))}const y=a.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,y&&this.fire(new o.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const b=this._updateRetainedTiles(a,c);if(ii(this._source.type)){const A={},k={},L=Object.keys(b),q=o.h.now();for(const j of L){const G=b[j],N=this._tiles[j];if(!N||N.fadeEndTime!==0&&N.fadeEndTime<=q)continue;const ee=this.findLoadedParent(G,d);ee&&(this._addTile(ee.tileID),A[ee.tileID.key]=ee.tileID),k[j]=G}this._retainLoadedChildren(k,c,g,b);for(const j in A)b[j]||(this._coveredTiles[j]=!0,b[j]=A[j]);if(n){const j={},G={};for(const N of a)this._tiles[N.key].hasData()?j[N.key]=N:G[N.key]=N;for(const N in G){const ee=G[N].children(this._source.maxzoom);this._tiles[ee[0].key]&&this._tiles[ee[1].key]&&this._tiles[ee[2].key]&&this._tiles[ee[3].key]&&(j[ee[0].key]=b[ee[0].key]=ee[0],j[ee[1].key]=b[ee[1].key]=ee[1],j[ee[2].key]=b[ee[2].key]=ee[2],j[ee[3].key]=b[ee[3].key]=ee[3],delete G[N])}for(const N in G){const ee=this.findLoadedParent(G[N],this._source.minzoom);if(ee){j[ee.tileID.key]=b[ee.tileID.key]=ee.tileID;for(const ce in j)j[ce].isChildOf(ee.tileID)&&delete j[ce]}}for(const N in this._tiles)j[N]||(this._coveredTiles[N]=!0)}}for(const A in b)this._tiles[A].clearFadeHold();const S=o.ab(this._tiles,b);for(const A of S){const k=this._tiles[A];k.hasSymbolBuckets&&!k.holdingForFade()?k.setHoldDuration(this.map._fadeDuration):k.hasSymbolBuckets&&!k.symbolFadeFinished()||this._removeTile(A)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){const a={},c={},d=Math.max(n-pr.maxOverzooming,this._source.minzoom),g=Math.max(n+pr.maxUnderzooming,this._source.minzoom),y={};for(const b of t){const S=this._addTile(b);a[b.key]=b,S.hasData()||nthis._source.maxzoom){const k=b.children(this._source.maxzoom)[0],L=this.getTile(k);if(L&&L.hasData()){a[k.key]=k;continue}}else{const k=b.children(this._source.maxzoom);if(a[k[0].key]&&a[k[1].key]&&a[k[2].key]&&a[k[3].key])continue}let A=S.wasRequested();for(let k=b.overscaledZ-1;k>=d;--k){const L=b.scaledTo(k);if(c[L.key])break;if(c[L.key]=!0,S=this.getTile(L),!S&&A&&(S=this._addTile(L)),S){const q=S.hasData();if((A||q)&&(a[L.key]=L),A=S.wasRequested(),q)break}}}return a}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const n=[];let a,c=this._tiles[t].tileID;for(;c.overscaledZ>0;){if(c.key in this._loadedParentTiles){a=this._loadedParentTiles[c.key];break}n.push(c.key);const d=c.scaledTo(c.overscaledZ-1);if(a=this._getLoadedTile(d),a)break;c=d}for(const d of n)this._loadedParentTiles[d]=a}}_addTile(t){let n=this._tiles[t.key];if(n)return n;n=this._cache.getAndRemove(t),n&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));const a=n;return n||(n=new Zi(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,t.key,n.state))),n.uses++,this._tiles[t.key]=n,a||this._source.fire(new o.k("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const a=n.getExpiryTimeout();a&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},a))}_removeTile(t){const n=this._tiles[t];n&&(n.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,n,a){const c=[],d=this.transform;if(!d)return c;const g=a?d.getCameraQueryGeometry(t):t,y=t.map(j=>d.pointCoordinate(j,this.terrain)),b=g.map(j=>d.pointCoordinate(j,this.terrain)),S=this.getIds();let A=1/0,k=1/0,L=-1/0,q=-1/0;for(const j of b)A=Math.min(A,j.x),k=Math.min(k,j.y),L=Math.max(L,j.x),q=Math.max(q,j.y);for(let j=0;j=0&&K[1].y+ce>=0){const ie=y.map(pe=>N.getTilePoint(pe)),de=b.map(pe=>N.getTilePoint(pe));c.push({tile:G,tileID:N,queryGeometry:ie,cameraQueryGeometry:de,scale:ee})}}return c}getVisibleCoordinates(t){const n=this.getRenderableIds(t).map(a=>this._tiles[a].tileID);for(const a of n)a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(ii(this._source.type)){const t=o.h.now();for(const n in this._tiles)if(this._tiles[n].fadeEndTime>=t)return!0}return!1}setFeatureState(t,n,a){this._state.updateState(t=t||"_geojsonTileLayer",n,a)}removeFeatureState(t,n,a){this._state.removeFeatureState(t=t||"_geojsonTileLayer",n,a)}getFeatureState(t,n){return this._state.getState(t=t||"_geojsonTileLayer",n)}setDependencies(t,n,a){const c=this._tiles[t];c&&c.setDependencies(n,a)}reloadTilesForDependencies(t,n){for(const a in this._tiles)this._tiles[a].hasDependency(t,n)&&this._reloadTile(a,"reloading");this._cache.filter(a=>!a.hasDependency(t,n))}}function Fr(u,t){const n=Math.abs(2*u.wrap)-+(u.wrap<0),a=Math.abs(2*t.wrap)-+(t.wrap<0);return u.overscaledZ-t.overscaledZ||a-n||t.canonical.y-u.canonical.y||t.canonical.x-u.canonical.x}function ii(u){return u==="raster"||u==="image"||u==="video"}pr.maxOverzooming=10,pr.maxUnderzooming=3;const Nt="mapboxgl_preloaded_worker_pool";class rn{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Nt]}numActive(){return Object.keys(this.active).length}}const os=Math.floor(o.h.hardwareConcurrency/2);let fn;function aa(){return fn||(fn=new rn),fn}rn.workerCount=o.ac(globalThis)?Math.max(Math.min(os,3),1):1;class ls{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let a=1;a0?(c-g)/y:0;return this.points[d].mult(1-b).add(this.points[n].mult(b))}}function En(u,t){let n=!0;return u==="always"||u!=="never"&&t!=="never"||(n=!1),n}class Un{constructor(t,n,a){const c=this.boxCells=[],d=this.circleCells=[];this.xCellCount=Math.ceil(t/a),this.yCellCount=Math.ceil(n/a);for(let g=0;gthis.width||c<0||n>this.height)return[];const b=[];if(t<=0&&n<=0&&this.width<=a&&this.height<=c){if(d)return[{key:null,x1:t,y1:n,x2:a,y2:c}];for(let S=0;S0}hitTestCircle(t,n,a,c,d){const g=t-a,y=t+a,b=n-a,S=n+a;if(y<0||g>this.width||S<0||b>this.height)return!1;const A=[];return this._forEachCell(g,b,y,S,this._queryCellCircle,A,{hitTest:!0,overlapMode:c,circle:{x:t,y:n,radius:a},seenUids:{box:{},circle:{}}},d),A.length>0}_queryCell(t,n,a,c,d,g,y,b){const{seenUids:S,hitTest:A,overlapMode:k}=y,L=this.boxCells[d];if(L!==null){const j=this.bboxes;for(const G of L)if(!S.box[G]){S.box[G]=!0;const N=4*G,ee=this.boxKeys[G];if(t<=j[N+2]&&n<=j[N+3]&&a>=j[N+0]&&c>=j[N+1]&&(!b||b(ee))&&(!A||!En(k,ee.overlapMode))&&(g.push({key:ee,x1:j[N],y1:j[N+1],x2:j[N+2],y2:j[N+3]}),A))return!0}}const q=this.circleCells[d];if(q!==null){const j=this.circles;for(const G of q)if(!S.circle[G]){S.circle[G]=!0;const N=3*G,ee=this.circleKeys[G];if(this._circleAndRectCollide(j[N],j[N+1],j[N+2],t,n,a,c)&&(!b||b(ee))&&(!A||!En(k,ee.overlapMode))){const ce=j[N],K=j[N+1],ie=j[N+2];if(g.push({key:ee,x1:ce-ie,y1:K-ie,x2:ce+ie,y2:K+ie}),A)return!0}}}return!1}_queryCellCircle(t,n,a,c,d,g,y,b){const{circle:S,seenUids:A,overlapMode:k}=y,L=this.boxCells[d];if(L!==null){const j=this.bboxes;for(const G of L)if(!A.box[G]){A.box[G]=!0;const N=4*G,ee=this.boxKeys[G];if(this._circleAndRectCollide(S.x,S.y,S.radius,j[N+0],j[N+1],j[N+2],j[N+3])&&(!b||b(ee))&&!En(k,ee.overlapMode))return g.push(!0),!0}}const q=this.circleCells[d];if(q!==null){const j=this.circles;for(const G of q)if(!A.circle[G]){A.circle[G]=!0;const N=3*G,ee=this.circleKeys[G];if(this._circlesCollide(j[N],j[N+1],j[N+2],S.x,S.y,S.radius)&&(!b||b(ee))&&!En(k,ee.overlapMode))return g.push(!0),!0}}}_forEachCell(t,n,a,c,d,g,y,b){const S=this._convertToXCellCoord(t),A=this._convertToYCellCoord(n),k=this._convertToXCellCoord(a),L=this._convertToYCellCoord(c);for(let q=S;q<=k;q++)for(let j=A;j<=L;j++)if(d.call(this,t,n,a,c,this.xCellCount*j+q,g,y,b))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,n,a,c,d,g){const y=c-t,b=d-n,S=a+g;return S*S>y*y+b*b}_circleAndRectCollide(t,n,a,c,d,g,y){const b=(g-c)/2,S=Math.abs(t-(c+b));if(S>b+a)return!1;const A=(y-d)/2,k=Math.abs(n-(d+A));if(k>A+a)return!1;if(S<=b||k<=A)return!0;const L=S-b,q=k-A;return L*L+q*q<=a*a}}function ke(u,t,n,a,c){const d=o.Z();return t?(o.a0(d,d,[1/c,1/c,1]),n||o.ae(d,d,a.angle)):o.a1(d,a.labelPlaneMatrix,u),d}function nn(u,t,n,a,c){if(t){const d=o.af(u);return o.a0(d,d,[c,c,1]),n||o.ae(d,d,-a.angle),d}return a.glCoordMatrix}function gi(u,t,n){let a;n?(a=[u.x,u.y,n(u.x,u.y),1],o.ag(a,a,t)):(a=[u.x,u.y,0,1],H(a,a,t));const c=a[3];return{point:new o.P(a[0]/c,a[1]/c),signedDistanceFromCamera:c}}function jn(u,t){return .5+u/t*.5}function mn(u,t){const n=u[0]/u[3],a=u[1]/u[3];return n>=-t[0]&&n<=t[0]&&a>=-t[1]&&a<=t[1]}function Ee(u,t,n,a,c,d,g,y,b,S){const A=a?u.textSizeData:u.iconSizeData,k=o.ah(A,n.transform.zoom),L=[256/n.width*2+1,256/n.height*2+1],q=a?u.text.dynamicLayoutVertexArray:u.icon.dynamicLayoutVertexArray;q.clear();const j=u.lineVertexArray,G=a?u.text.placedSymbolArray:u.icon.placedSymbolArray,N=n.transform.width/n.transform.height;let ee=!1;for(let ce=0;ceMath.abs(n.x-t.x)*a?{useVertical:!0}:(u===o.ai.vertical?t.yn.x)?{needsFlipping:!0}:null}function sr(u,t,n,a,c,d,g,y,b,S,A,k,L,q,j,G){const N=t/24,ee=u.lineOffsetX*N,ce=u.lineOffsetY*N;let K;if(u.numGlyphs>1){const ie=u.glyphStartIndex+u.numGlyphs,de=u.lineStartIndex,pe=u.lineStartIndex+u.lineLength,ye=xt(N,y,ee,ce,n,A,k,u,b,d,L,j,G);if(!ye)return{notEnoughRoom:!0};const Te=gi(ye.first.point,g,G).point,we=gi(ye.last.point,g,G).point;if(a&&!n){const Ae=ct(u.writingMode,Te,we,q);if(Ae)return Ae}K=[ye.first];for(let Ae=u.glyphStartIndex+1;Ae0?Te.point:sn(k,ye,de,1,c,G),Ae=ct(u.writingMode,de,we,q);if(Ae)return Ae}const ie=E(N*y.getoffsetX(u.glyphStartIndex),ee,ce,n,A,k,u.segment,u.lineStartIndex,u.lineStartIndex+u.lineLength,b,d,L,j,G);if(!ie)return{notEnoughRoom:!0};K=[ie]}for(const ie of K)o.ak(S,ie.point,ie.angle);return{}}function sn(u,t,n,a,c,d){const g=gi(u.add(u.sub(t)._unit()),c,d).point,y=n.sub(g);return n.add(y._mult(a/y.mag()))}function ft(u,t){const{projectionCache:n,lineVertexArray:a,labelPlaneMatrix:c,tileAnchorPoint:d,distanceFromAnchor:g,getElevation:y,previousVertex:b,direction:S,absOffsetX:A}=t;if(n.projections[u])return n.projections[u];const k=new o.P(a.getx(u),a.gety(u)),L=gi(k,c,y);if(L.signedDistanceFromCamera>0)return n.projections[u]=L.point,L.point;const q=u-S;return sn(g===0?d:new o.P(a.getx(q),a.gety(q)),k,b,A-g+1,c,y)}function gn(u,t,n){return u._unit()._perp()._mult(t*n)}function Z(u,t,n,a,c,d,g,y){const{projectionCache:b,direction:S}=y;if(b.offsets[u])return b.offsets[u];const A=n.add(t);if(u+S=c)return b.offsets[u]=A,A;const k=ft(u+S,y),L=gn(k.sub(n),g,S),q=n.add(L),j=k.add(L);return b.offsets[u]=o.al(d,A,q,j)||A,b.offsets[u]}function E(u,t,n,a,c,d,g,y,b,S,A,k,L,q){const j=a?u-t:u+t;let G=j>0?1:-1,N=0;a&&(G*=-1,N=Math.PI),G<0&&(N+=Math.PI);let ee,ce,K=G>0?y+g:y+g+1,ie=c,de=c,pe=0,ye=0;const Te=Math.abs(j),we=[];let Ae;for(;pe+ye<=Te;){if(K+=G,K=b)return null;pe+=ye,de=ie,ce=ee;const ze={projectionCache:k,lineVertexArray:S,labelPlaneMatrix:A,tileAnchorPoint:d,distanceFromAnchor:pe,getElevation:q,previousVertex:de,direction:G,absOffsetX:Te};if(ie=ft(K,ze),n===0)we.push(de),Ae=ie.sub(de);else{let it;const Ue=ie.sub(de);it=Ue.mag()===0?gn(ft(K+G,ze).sub(ie),n,G):gn(Ue,n,G),ce||(ce=de.add(it)),ee=Z(K,it,ie,y,b,ce,n,ze),we.push(ce),Ae=ee.sub(ce)}ye=Ae.mag()}const Ve=Ae._mult((Te-pe)/ye)._add(ce||de),It=N+Math.atan2(ie.y-de.y,ie.x-de.x);return we.push(Ve),{point:Ve,angle:L?It:0,path:we}}const D=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function V(u,t){for(let n=0;n=1;_t--)Ue.push(ze.path[_t]);for(let _t=1;_tgi(At,b,j));Ue=_t.some(At=>At.signedDistanceFromCamera<=0)?[]:_t.map(At=>At.point)}let Tt=[];if(Ue.length>0){const _t=Ue[0].clone(),At=Ue[0].clone();for(let bi=1;bi=Ae.x&&At.x<=Ve.x&&_t.y>=Ae.y&&At.y<=Ve.y?[Ue]:At.xVe.x||At.yVe.y?[]:o.am([Ue],Ae.x,Ae.y,Ve.x,Ve.y)}for(const _t of Tt){It.reset(_t,.25*we);let At=0;At=It.length<=.5*we?1:Math.ceil(It.paddedLength/Xt)+1;for(let bi=0;bi=this.screenRightBoundary||cthis.screenBottomBoundary}isInsideGrid(t,n,a,c){return a>=0&&t=0&&na.collisionGroupID===n}}return this.collisionGroups[t]}}function at(u,t,n,a,c){const{horizontalAlign:d,verticalAlign:g}=o.au(u);return new o.P(-(d-.5)*t+a[0]*c,-(g-.5)*n+a[1]*c)}function Oe(u,t,n,a,c,d){const{x1:g,x2:y,y1:b,y2:S,anchorPointX:A,anchorPointY:k}=u,L=new o.P(t,n);return a&&L._rotate(c?d:-d),{x1:g+L.x,y1:b+L.y,x2:y+L.x,y2:S+L.y,anchorPointX:A,anchorPointY:k}}class Qe{constructor(t,n,a,c,d){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new ae(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=a,this.retainedQueryData={},this.collisionGroups=new Xe(c),this.collisionCircleArrays={},this.prevPlacement=d,d&&(d.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,a,c){const d=a.getBucket(n),g=a.latestFeatureIndex;if(!d||!g||n.id!==d.layerIds[0])return;const y=a.collisionBoxArray,b=d.layers[0].layout,S=Math.pow(2,this.transform.zoom-a.tileID.overscaledZ),A=a.tileSize/o.N,k=this.transform.calculatePosMatrix(a.tileID.toUnwrapped()),L=b.get("text-pitch-alignment")==="map",q=b.get("text-rotation-alignment")==="map",j=$(a,1,this.transform.zoom),G=ke(k,L,q,this.transform,j);let N=null;if(L){const ce=nn(k,L,q,this.transform,j);N=o.a1([],this.transform.labelPlaneMatrix,ce)}this.retainedQueryData[d.bucketInstanceId]=new be(d.bucketInstanceId,g,d.sourceLayerIndex,d.index,a.tileID);const ee={bucket:d,layout:b,posMatrix:k,textLabelPlaneMatrix:G,labelToScreenMatrix:N,scale:S,textPixelRatio:A,holdingForFade:a.holdingForFade(),collisionBoxArray:y,partiallyEvaluatedTextSize:o.ah(d.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(d.sourceID)};if(c)for(const ce of d.sortKeyRanges){const{sortKey:K,symbolInstanceStart:ie,symbolInstanceEnd:de}=ce;t.push({sortKey:K,symbolInstanceStart:ie,symbolInstanceEnd:de,parameters:ee})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:d.symbolInstances.length,parameters:ee})}attemptAnchorPlacement(t,n,a,c,d,g,y,b,S,A,k,L,q,j,G,N){const ee=o.aq[t.textAnchor],ce=[t.textOffset0,t.textOffset1],K=at(ee,a,c,ce,d),ie=this.collisionIndex.placeCollisionBox(Oe(n,K.x,K.y,g,y,this.transform.angle),k,b,S,A.predicate,N);if((!G||this.collisionIndex.placeCollisionBox(Oe(G,K.x,K.y,g,y,this.transform.angle),k,b,S,A.predicate,N).box.length!==0)&&ie.box.length>0){let de;if(this.prevPlacement&&this.prevPlacement.variableOffsets[L.crossTileID]&&this.prevPlacement.placements[L.crossTileID]&&this.prevPlacement.placements[L.crossTileID].text&&(de=this.prevPlacement.variableOffsets[L.crossTileID].anchor),L.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[L.crossTileID]={textOffset:ce,width:a,height:c,anchor:ee,textBoxScale:d,prevAnchor:de},this.markUsedJustification(q,ee,L,j),q.allowVerticalPlacement&&(this.markUsedOrientation(q,j,L),this.placedOrientations[L.crossTileID]=j),{shift:K,placedGlyphBoxes:ie}}}placeLayerBucketPart(t,n,a){const{bucket:c,layout:d,posMatrix:g,textLabelPlaneMatrix:y,labelToScreenMatrix:b,textPixelRatio:S,holdingForFade:A,collisionBoxArray:k,partiallyEvaluatedTextSize:L,collisionGroup:q}=t.parameters,j=d.get("text-optional"),G=d.get("icon-optional"),N=o.ar(d,"text-overlap","text-allow-overlap"),ee=N==="always",ce=o.ar(d,"icon-overlap","icon-allow-overlap"),K=ce==="always",ie=d.get("text-rotation-alignment")==="map",de=d.get("text-pitch-alignment")==="map",pe=d.get("icon-text-fit")!=="none",ye=d.get("symbol-z-order")==="viewport-y",Te=ee&&(K||!c.hasIconData()||G),we=K&&(ee||!c.hasTextData()||j);!c.collisionArrays&&k&&c.deserializeCollisionBoxes(k);const Ae=this.retainedQueryData[c.bucketInstanceId].tileID,Ve=this.terrain?(ze,it)=>this.terrain.getElevation(Ae,ze,it):null,It=(ze,it)=>{var Ue,Xt;if(n[ze.crossTileID])return;if(A)return void(this.placements[ze.crossTileID]=new me(!1,!1,!1));let Tt=!1,_t=!1,At=!0,bi=null,ni={box:null,offscreen:null},Wi={box:null,offscreen:null},Di=null,Ai=null,Er=null,ai=0,on=0,ln=0;it.textFeatureIndex?ai=it.textFeatureIndex:ze.useRuntimeCollisionCircles&&(ai=ze.featureIndex),it.verticalTextFeatureIndex&&(on=it.verticalTextFeatureIndex);const Fn=it.textBox;if(Fn){const er=wi=>{let Li=o.ai.horizontal;if(c.allowVerticalPlacement&&!wi&&this.prevPlacement){const gr=this.prevPlacement.placedOrientations[ze.crossTileID];gr&&(this.placedOrientations[ze.crossTileID]=gr,Li=gr,this.markUsedOrientation(c,Li,ze))}return Li},Xi=(wi,Li)=>{if(c.allowVerticalPlacement&&ze.numVerticalGlyphVertices>0&&it.verticalTextBox){for(const gr of c.writingModes)if(gr===o.ai.vertical?(ni=Li(),Wi=ni):ni=wi(),ni&&ni.box&&ni.box.length)break}else ni=wi()},or=ze.textAnchorOffsetStartIndex,Qn=ze.textAnchorOffsetEndIndex;if(Qn===or){const wi=(Li,gr)=>{const Ti=this.collisionIndex.placeCollisionBox(Li,N,S,g,q.predicate,Ve);return Ti&&Ti.box&&Ti.box.length&&(this.markUsedOrientation(c,gr,ze),this.placedOrientations[ze.crossTileID]=gr),Ti};Xi(()=>wi(Fn,o.ai.horizontal),()=>{const Li=it.verticalTextBox;return c.allowVerticalPlacement&&ze.numVerticalGlyphVertices>0&&Li?wi(Li,o.ai.vertical):{box:null,offscreen:null}}),er(ni&&ni.box&&ni.box.length)}else{let wi=o.aq[(Xt=(Ue=this.prevPlacement)===null||Ue===void 0?void 0:Ue.variableOffsets[ze.crossTileID])===null||Xt===void 0?void 0:Xt.anchor];const Li=(Ti,$n,Ba)=>{const dc=Ti.x2-Ti.x1,pc=Ti.y2-Ti.y1,cu=ze.textBoxScale,Jo=pe&&ce==="never"?$n:null;let cn={box:[],offscreen:!1},es=N==="never"?1:2,un="never";wi&&es++;for(let Zr=0;ZrLi(Fn,it.iconBox,o.ai.horizontal),()=>{const Ti=it.verticalTextBox;return c.allowVerticalPlacement&&!(ni&&ni.box&&ni.box.length)&&ze.numVerticalGlyphVertices>0&&Ti?Li(Ti,it.verticalIconBox,o.ai.vertical):{box:null,offscreen:null}}),ni&&(Tt=ni.box,At=ni.offscreen);const gr=er(ni&&ni.box);if(!Tt&&this.prevPlacement){const Ti=this.prevPlacement.variableOffsets[ze.crossTileID];Ti&&(this.variableOffsets[ze.crossTileID]=Ti,this.markUsedJustification(c,Ti.anchor,ze,gr))}}}if(Di=ni,Tt=Di&&Di.box&&Di.box.length>0,At=Di&&Di.offscreen,ze.useRuntimeCollisionCircles){const er=c.text.placedSymbolArray.get(ze.centerJustifiedTextSymbolIndex),Xi=o.aj(c.textSizeData,L,er),or=d.get("text-padding");Ai=this.collisionIndex.placeCollisionCircles(N,er,c.lineVertexArray,c.glyphOffsetArray,Xi,g,y,b,a,de,q.predicate,ze.collisionCircleDiameter,or,Ve),Ai.circles.length&&Ai.collisionDetected&&!a&&o.w("Collisions detected, but collision boxes are not shown"),Tt=ee||Ai.circles.length>0&&!Ai.collisionDetected,At=At&&Ai.offscreen}if(it.iconFeatureIndex&&(ln=it.iconFeatureIndex),it.iconBox){const er=Xi=>{const or=pe&&bi?Oe(Xi,bi.x,bi.y,ie,de,this.transform.angle):Xi;return this.collisionIndex.placeCollisionBox(or,ce,S,g,q.predicate,Ve)};Wi&&Wi.box&&Wi.box.length&&it.verticalIconBox?(Er=er(it.verticalIconBox),_t=Er.box.length>0):(Er=er(it.iconBox),_t=Er.box.length>0),At=At&&Er.offscreen}const Yn=j||ze.numHorizontalGlyphVertices===0&&ze.numVerticalGlyphVertices===0,ws=G||ze.numIconVertices===0;if(Yn||ws?ws?Yn||(_t=_t&&Tt):Tt=_t&&Tt:_t=Tt=_t&&Tt,Tt&&Di&&Di.box&&this.collisionIndex.insertCollisionBox(Di.box,N,d.get("text-ignore-placement"),c.bucketInstanceId,Wi&&Wi.box&&on?on:ai,q.ID),_t&&Er&&this.collisionIndex.insertCollisionBox(Er.box,ce,d.get("icon-ignore-placement"),c.bucketInstanceId,ln,q.ID),Ai&&(Tt&&this.collisionIndex.insertCollisionCircles(Ai.circles,N,d.get("text-ignore-placement"),c.bucketInstanceId,ai,q.ID),a)){const er=c.bucketInstanceId;let Xi=this.collisionCircleArrays[er];Xi===void 0&&(Xi=this.collisionCircleArrays[er]=new _e);for(let or=0;or=0;--it){const Ue=ze[it];It(c.symbolInstances.get(Ue),c.collisionArrays[Ue])}}else for(let ze=t.symbolInstanceStart;ze=0&&(t.text.placedSymbolArray.get(y).crossTileID=d>=0&&y!==d?0:a.crossTileID)}markUsedOrientation(t,n,a){const c=n===o.ai.horizontal||n===o.ai.horizontalOnly?n:0,d=n===o.ai.vertical?n:0,g=[a.leftJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.rightJustifiedTextSymbolIndex];for(const y of g)t.text.placedSymbolArray.get(y).placedOrientation=c;a.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).placedOrientation=d)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let a=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const c=n?n.symbolFadeChange(t):1,d=n?n.opacities:{},g=n?n.variableOffsets:{},y=n?n.placedOrientations:{};for(const b in this.placements){const S=this.placements[b],A=d[b];A?(this.opacities[b]=new re(A,c,S.text,S.icon),a=a||S.text!==A.text.placed||S.icon!==A.icon.placed):(this.opacities[b]=new re(null,c,S.text,S.icon,S.skipFade),a=a||S.text||S.icon)}for(const b in d){const S=d[b];if(!this.opacities[b]){const A=new re(S,c,!1,!1);A.isHidden()||(this.opacities[b]=A,a=a||S.text.placed||S.icon.placed)}}for(const b in g)this.variableOffsets[b]||!this.opacities[b]||this.opacities[b].isHidden()||(this.variableOffsets[b]=g[b]);for(const b in y)this.placedOrientations[b]||!this.opacities[b]||this.opacities[b].isHidden()||(this.placedOrientations[b]=y[b]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");a?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){const a={};for(const c of n){const d=c.getBucket(t);d&&c.latestFeatureIndex&&t.id===d.layerIds[0]&&this.updateBucketOpacities(d,a,c.collisionBoxArray)}}updateBucketOpacities(t,n,a){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const c=t.layers[0],d=c.layout,g=new re(null,0,!1,!1,!0),y=d.get("text-allow-overlap"),b=d.get("icon-allow-overlap"),S=c._unevaluatedLayout.hasValue("text-variable-anchor")||c._unevaluatedLayout.hasValue("text-variable-anchor-offset"),A=d.get("text-rotation-alignment")==="map",k=d.get("text-pitch-alignment")==="map",L=d.get("icon-text-fit")!=="none",q=new re(null,0,y&&(b||!t.hasIconData()||d.get("icon-optional")),b&&(y||!t.hasTextData()||d.get("text-optional")),!0);!t.collisionArrays&&a&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(a);const j=(G,N,ee)=>{for(let ce=0;ce0,pe=this.placedOrientations[N.crossTileID],ye=pe===o.ai.vertical,Te=pe===o.ai.horizontal||pe===o.ai.horizontalOnly;if(ee>0||ce>0){const we=Gi(ie.text);j(t.text,ee,ye?Or:we),j(t.text,ce,Te?Or:we);const Ae=ie.text.isHidden();[N.rightJustifiedTextSymbolIndex,N.centerJustifiedTextSymbolIndex,N.leftJustifiedTextSymbolIndex].forEach(ze=>{ze>=0&&(t.text.placedSymbolArray.get(ze).hidden=Ae||ye?1:0)}),N.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(N.verticalPlacedTextSymbolIndex).hidden=Ae||Te?1:0);const Ve=this.variableOffsets[N.crossTileID];Ve&&this.markUsedJustification(t,Ve.anchor,N,pe);const It=this.placedOrientations[N.crossTileID];It&&(this.markUsedJustification(t,"left",N,It),this.markUsedOrientation(t,It,N))}if(de){const we=Gi(ie.icon),Ae=!(L&&N.verticalPlacedIconSymbolIndex&&ye);N.placedIconSymbolIndex>=0&&(j(t.icon,N.numIconVertices,Ae?we:Or),t.icon.placedSymbolArray.get(N.placedIconSymbolIndex).hidden=ie.icon.isHidden()),N.verticalPlacedIconSymbolIndex>=0&&(j(t.icon,N.numVerticalIconVertices,Ae?Or:we),t.icon.placedSymbolArray.get(N.verticalPlacedIconSymbolIndex).hidden=ie.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const we=t.collisionArrays[G];if(we){let Ae=new o.P(0,0);if(we.textBox||we.verticalTextBox){let It=!0;if(S){const ze=this.variableOffsets[K];ze?(Ae=at(ze.anchor,ze.width,ze.height,ze.textOffset,ze.textBoxScale),A&&Ae._rotate(k?this.transform.angle:-this.transform.angle)):It=!1}we.textBox&&ut(t.textCollisionBox.collisionVertexArray,ie.text.placed,!It||ye,Ae.x,Ae.y),we.verticalTextBox&&ut(t.textCollisionBox.collisionVertexArray,ie.text.placed,!It||Te,Ae.x,Ae.y)}const Ve=!!(!Te&&we.verticalIconBox);we.iconBox&&ut(t.iconCollisionBox.collisionVertexArray,ie.icon.placed,Ve,L?Ae.x:0,L?Ae.y:0),we.verticalIconBox&&ut(t.iconCollisionBox.collisionVertexArray,ie.icon.placed,!Ve,L?Ae.x:0,L?Ae.y:0)}}}if(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.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const G=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=G.invProjMatrix,t.placementViewportMatrix=G.viewportMatrix,t.collisionCircleArray=G.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 ut(u,t,n,a,c){u.emplaceBack(t?1:0,n?1:0,a||0,c||0),u.emplaceBack(t?1:0,n?1:0,a||0,c||0),u.emplaceBack(t?1:0,n?1:0,a||0,c||0),u.emplaceBack(t?1:0,n?1:0,a||0,c||0)}const Gt=Math.pow(2,25),Yt=Math.pow(2,24),Ft=Math.pow(2,17),Bt=Math.pow(2,16),Qi=Math.pow(2,9),ri=Math.pow(2,8),Ci=Math.pow(2,1);function Gi(u){if(u.opacity===0&&!u.placed)return 0;if(u.opacity===1&&u.placed)return 4294967295;const t=u.placed?1:0,n=Math.floor(127*u.opacity);return n*Gt+t*Yt+n*Ft+t*Bt+n*Qi+t*ri+n*Ci+t}const Or=0;class kl{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,n,a,c,d){const g=this._bucketParts;for(;this._currentTileIndexy.sortKey-b.sortKey));this._currentPartIndex!this._forceFullPlacement&&o.h.now()-c>2;for(;this._currentPlacementIndex>=0;){const g=n[t[this._currentPlacementIndex]],y=this.placement.collisionIndex.transform.zoom;if(g.type==="symbol"&&(!g.minzoom||g.minzoom<=y)&&(!g.maxzoom||g.maxzoom>y)){if(this._inProgressLayer||(this._inProgressLayer=new kl(g)),this._inProgressLayer.continuePlacement(a[g.source],this.placement,this._showCollisionBoxes,g,d))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const us=512/o.N/2;class Hc{constructor(t,n,a){this.tileID=t,this.bucketInstanceId=a,this._symbolsByKey={};const c=new Map;for(let d=0;d({x:Math.floor(b.anchorX*us),y:Math.floor(b.anchorY*us)})),crossTileIDs:g.map(b=>b.crossTileID)};if(y.positions.length>128){const b=new o.av(y.positions.length,16,Uint16Array);for(const{x:S,y:A}of y.positions)b.add(S,A);b.finish(),delete y.positions,y.index=b}this._symbolsByKey[d]=y}}getScaledCoordinates(t,n){const{x:a,y:c,z:d}=this.tileID.canonical,{x:g,y,z:b}=n.canonical,S=us/Math.pow(2,b-d),A=(y*o.N+t.anchorY)*S,k=c*o.N*us;return{x:Math.floor((g*o.N+t.anchorX)*S-a*o.N*us),y:Math.floor(A-k)}}findMatches(t,n,a){const c=this.tileID.canonical.zt)}}class Wt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class lo{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const n=Math.round((t-this.lng)/360);if(n!==0)for(const a in this.indexes){const c=this.indexes[a],d={};for(const g in c){const y=c[g];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+n),d[y.tileID.key]=y}this.indexes[a]=d}this.lng=t}addBucket(t,n,a){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let d=0;dt.overscaledZ)for(const y in g){const b=g[y];b.tileID.isChildOf(t)&&b.findMatches(n.symbolInstances,t,c)}else{const y=g[t.scaledTo(Number(d)).key];y&&y.findMatches(n.symbolInstances,t,c)}}for(let d=0;d{n[a]=!0});for(const a in this.layerIndexes)n[a]||delete this.layerIndexes[a]}}const $i=(u,t)=>o.x(u,t&&t.filter(n=>n.identifier!=="source.canvas")),Ir=o.F(o.ax,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),Wc=o.F(o.ax,["setCenter","setZoom","setBearing","setPitch"]),Vr=o.aw();class Hi extends o.E{constructor(t,n={}){super(),this.map=t,this.dispatcher=new Kt(aa(),this,t._getMapId()),this.imageManager=new rt,this.imageManager.setEventedParent(this),this.glyphManager=new $e(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new dr(256,512),this.crossTileSymbolIndex=new oa,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new o.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",o.az());const a=this;this._rtlTextPluginCallback=Hi.registerForPluginStateChange(c=>{a.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:c.pluginStatus,pluginURL:c.pluginURL},(d,g)=>{if(o.aA(d),g&&g.every(y=>y))for(const y in a.sourceCaches){const b=a.sourceCaches[y].getSource().type;b!=="vector"&&b!=="geojson"||a.sourceCaches[y].reload()}})}),this.on("data",c=>{if(c.dataType!=="source"||c.sourceDataType!=="metadata")return;const d=this.sourceCaches[c.sourceId];if(!d)return;const g=d.getSource();if(g&&g.vectorLayerIds)for(const y in this._layers){const b=this._layers[y];b.source===g.id&&this._validateLayer(b)}})}loadURL(t,n={},a){this.fire(new o.k("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;const c=this.map._requestManager.transformRequest(t,et.Style);this._request=o.f(c,(d,g)=>{this._request=null,d?this.fire(new o.j(d)):g&&this._load(g,n,a)})}loadJSON(t,n={},a){this.fire(new o.k("dataloading",{dataType:"style"})),this._request=o.h.frame(()=>{this._request=null,n.validate=n.validate!==!1,this._load(t,n,a)})}loadEmpty(){this.fire(new o.k("dataloading",{dataType:"style"})),this._load(Vr,{validate:!1})}_load(t,n,a){var c;const d=n.transformStyle?n.transformStyle(a,t):t;if(!n.validate||!$i(this,o.y(d))){this._loaded=!0,this.stylesheet=d;for(const g in d.sources)this.addSource(g,d.sources[g],{validate:!1});d.sprite?this._loadSprite(d.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(d.glyphs),this._createLayers(),this.light=new Ji(this.stylesheet.light),this.map.setTerrain((c=this.stylesheet.terrain)!==null&&c!==void 0?c:null),this.fire(new o.k("data",{dataType:"style"})),this.fire(new o.k("style.load"))}}_createLayers(){const t=o.aB(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map(n=>n.id),this._layers={},this._serializedLayers=null;for(const n of t){const a=o.aC(n);a.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=a}}_loadSprite(t,n=!1,a=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(c,d,g,y){const b=dt(c),S=b.length,A=g>1?"@2x":"",k={},L={},q={};for(const{id:j,url:G}of b){const N=d.transformRequest(d.normalizeSpriteURL(G,A,".json"),et.SpriteJSON),ee=`${j}_${N.url}`;k[ee]=o.f(N,(ie,de)=>{delete k[ee],L[j]=de,mt(y,L,q,ie,S)});const ce=d.transformRequest(d.normalizeSpriteURL(G,A,".png"),et.SpriteImage),K=`${j}_${ce.url}`;k[K]=Ge.getImage(ce,(ie,de)=>{delete k[K],q[j]=de,mt(y,L,q,ie,S)})}return{cancel(){for(const j of Object.values(k))j.cancel()}}}(t,this.map._requestManager,this.map.getPixelRatio(),(c,d)=>{if(this._spriteRequest=null,c)this.fire(new o.j(c));else if(d)for(const g in d){this._spritesImagesIds[g]=[];const y=this._spritesImagesIds[g]?this._spritesImagesIds[g].filter(b=>!(b in d)):[];for(const b of y)this.imageManager.removeImage(b),this._changedImages[b]=!0;for(const b in d[g]){const S=g==="default"?b:`${g}:${b}`;this._spritesImagesIds[g].push(S),S in this.imageManager.images?this.imageManager.updateImage(S,d[g][b],!1):this.imageManager.addImage(S,d[g][b]),n&&(this._changedImages[S]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.k("data",{dataType:"style"})),a&&a(c)})}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.k("data",{dataType:"style"}))}_validateLayer(t){const n=this.sourceCaches[t.source];if(!n)return;const a=t.sourceLayer;if(!a)return;const c=n.getSource();(c.type==="geojson"||c.vectorLayerIds&&c.vectorLayerIds.indexOf(a)===-1)&&this.fire(new o.j(new Error(`Source layer "${a}" does not exist on source "${c.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){const n=this._serializedAllLayers();if(!t||t.length===0)return Object.values(n);const a=[];for(const c of t)n[c]&&a.push(n[c]);return a}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const n=Object.keys(this._layers);for(const a of n){const c=this._layers[a];c.type!=="custom"&&(t[a]=c.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())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}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const n=this._changed;if(this._changed){const c=Object.keys(this._updatedLayers),d=Object.keys(this._removedLayers);(c.length||d.length)&&this._updateWorkerLayers(c,d);for(const g in this._updatedSources){const y=this._updatedSources[g];if(y==="reload")this._reloadSource(g);else{if(y!=="clear")throw new Error(`Invalid action ${y}`);this._clearSource(g)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const g in this._updatedPaintProps)this._layers[g].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const a={};for(const c in this.sourceCaches){const d=this.sourceCaches[c];a[c]=d.used,d.used=!1}for(const c of this._order){const d=this._layers[c];d.recalculate(t,this._availableImages),!d.isHidden(t.zoom)&&d.source&&(this.sourceCaches[d.source].used=!0)}for(const c in a){const d=this.sourceCaches[c];a[c]!==d.used&&d.fire(new o.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:c}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new o.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,n){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,n={}){this._checkLoaded();const a=this.serialize();if(t=n.transformStyle?n.transformStyle(a,t):t,$i(this,o.y(t)))return!1;(t=o.aD(t)).layers=o.aB(t.layers);const c=o.aE(a,t).filter(g=>!(g.command in Wc));if(c.length===0)return!1;const d=c.filter(g=>!(g.command in Ir));if(d.length>0)throw new Error(`Unimplemented: ${d.map(g=>g.command).join(", ")}.`);for(const g of c)g.command!=="setTransition"&&this[g.command].apply(this,g.args);return this.stylesheet=t,this._serializedLayers=null,!0}addImage(t,n){if(this.getImage(t))return this.fire(new o.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new o.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,a={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(o.y.source,`sources.${t}`,n,null,a))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const c=this.sourceCaches[t]=new pr(t,n,this.dispatcher);c.style=this,c.setEventedParent(this,()=>({isSourceLoaded:c.loaded(),source:c.serialize(),sourceId:t})),c.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(const a in this._layers)if(this._layers[a].source===t)return this.fire(new o.j(new Error(`Source "${t}" cannot be removed while layer "${a}" is using it.`)));const n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new o.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const a=this.sourceCaches[t].getSource();if(a.type!=="geojson")throw new Error(`geojsonSource.type is ${a.type}, which is !== 'geojson`);a.setData(n),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,n,a={}){this._checkLoaded();const c=t.id;if(this.getLayer(c))return void this.fire(new o.j(new Error(`Layer "${c}" already exists on this map.`)));let d;if(t.type==="custom"){if($i(this,o.aF(t)))return;d=o.aC(t)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(c,t.source),t=o.aD(t),t=o.e(t,{source:c})),this._validate(o.y.layer,`layers.${c}`,t,{arrayIndex:-1},a))return;d=o.aC(t),this._validateLayer(d),d.setEventedParent(this,{layer:{id:c}})}const g=n?this._order.indexOf(n):this._order.length;if(n&&g===-1)this.fire(new o.j(new Error(`Cannot add layer "${c}" before non-existing layer "${n}".`)));else{if(this._order.splice(g,0,c),this._layerOrderChanged=!0,this._layers[c]=d,this._removedLayers[c]&&d.source&&d.type!=="custom"){const y=this._removedLayers[c];delete this._removedLayers[c],y.type!==d.type?this._updatedSources[d.source]="clear":(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause())}this._updateLayer(d),d.onAdd&&d.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new o.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;const a=this._order.indexOf(t);this._order.splice(a,1);const c=n?this._order.indexOf(n):this._order.length;n&&c===-1?this.fire(new o.j(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(c,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const n=this._layers[t];if(!n)return void this.fire(new o.j(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);const a=this._order.indexOf(t);this._order.splice(a,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,a){this._checkLoaded();const c=this.getLayer(t);c?c.minzoom===n&&c.maxzoom===a||(n!=null&&(c.minzoom=n),a!=null&&(c.maxzoom=a),this._updateLayer(c)):this.fire(new o.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,a={}){this._checkLoaded();const c=this.getLayer(t);if(c){if(!o.aG(c.filter,n))return n==null?(c.filter=void 0,void this._updateLayer(c)):void(this._validate(o.y.filter,`layers.${c.id}.filter`,n,null,a)||(c.filter=o.aD(n),this._updateLayer(c)))}else this.fire(new o.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return o.aD(this.getLayer(t).filter)}setLayoutProperty(t,n,a,c={}){this._checkLoaded();const d=this.getLayer(t);d?o.aG(d.getLayoutProperty(n),a)||(d.setLayoutProperty(n,a,c),this._updateLayer(d)):this.fire(new o.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){const a=this.getLayer(t);if(a)return a.getLayoutProperty(n);this.fire(new o.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,a,c={}){this._checkLoaded();const d=this.getLayer(t);d?o.aG(d.getPaintProperty(n),a)||(d.setPaintProperty(n,a,c)&&this._updateLayer(d),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new o.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();const a=t.source,c=t.sourceLayer,d=this.sourceCaches[a];if(d===void 0)return void this.fire(new o.j(new Error(`The source '${a}' does not exist in the map's style.`)));const g=d.getSource().type;g==="geojson"&&c?this.fire(new o.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):g!=="vector"||c?(t.id===void 0&&this.fire(new o.j(new Error("The feature id parameter must be provided."))),d.setFeatureState(c,t.id,n)):this.fire(new o.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();const a=t.source,c=this.sourceCaches[a];if(c===void 0)return void this.fire(new o.j(new Error(`The source '${a}' does not exist in the map's style.`)));const d=c.getSource().type,g=d==="vector"?t.sourceLayer:void 0;d!=="vector"||g?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new o.j(new Error("A feature id is required to remove its specific state property."))):c.removeFeatureState(g,t.id,n):this.fire(new o.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const n=t.source,a=t.sourceLayer,c=this.sourceCaches[n];if(c!==void 0)return c.getSource().type!=="vector"||a?(t.id===void 0&&this.fire(new o.j(new Error("The feature id parameter must be provided."))),c.getFeatureState(a,t.id)):void this.fire(new o.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new o.j(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return o.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=o.aH(this.sourceCaches,d=>d.serialize()),n=this._serializeByIds(this._order),a=this.map.getTerrain()||void 0,c=this.stylesheet;return o.aI({version:c.version,name:c.name,metadata:c.metadata,light:c.light,center:c.center,zoom:c.zoom,bearing:c.bearing,pitch:c.pitch,sprite:c.sprite,glyphs:c.glyphs,transition:c.transition,sources:t,layers:n,terrain:a},d=>d!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const n=g=>this._layers[g].type==="fill-extrusion",a={},c=[];for(let g=this._order.length-1;g>=0;g--){const y=this._order[g];if(n(y)){a[y]=g;for(const b of t){const S=b[y];if(S)for(const A of S)c.push(A)}}}c.sort((g,y)=>y.intersectionZ-g.intersectionZ);const d=[];for(let g=this._order.length-1;g>=0;g--){const y=this._order[g];if(n(y))for(let b=c.length-1;b>=0;b--){const S=c[b].feature;if(a[S.layer.id]{const Te=ee.featureSortOrder;if(Te){const we=Te.indexOf(pe.featureIndex);return Te.indexOf(ye.featureIndex)-we}return ye.featureIndex-pe.featureIndex});for(const pe of de)ie.push(pe)}}for(const ee in j)j[ee].forEach(ce=>{const K=ce.feature,ie=S[y[ee].source].getFeatureState(K.layer["source-layer"],K.id);K.source=K.layer.source,K.layer["source-layer"]&&(K.sourceLayer=K.layer["source-layer"]),K.state=ie});return j}(this._layers,g,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(d)}querySourceFeatures(t,n){n&&n.filter&&this._validate(o.y.filter,"querySourceFeatures.filter",n.filter,null,n);const a=this.sourceCaches[t];return a?function(c,d){const g=c.getRenderableIds().map(S=>c.getTileByID(S)),y=[],b={};for(let S=0;S{ue[c]=d})(t,n),n.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:n.workerSourceURL},a):a(null,null))}getLight(){return this.light.getLight()}setLight(t,n={}){this._checkLoaded();const a=this.light.getLight();let c=!1;for(const g in t)if(!o.aG(t[g],a[g])){c=!0;break}if(!c)return;const d={now:o.h.now(),transition:o.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,n),this.light.updateTransitions(d)}_validate(t,n,a,c,d={}){return(!d||d.validate!==!1)&&$i(this,t.call(o.y,o.e({key:n,style:this.serialize(),value:a,styleSpec:o.v},c)))}_remove(t=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),o.aJ.off("pluginStateChange",this._rtlTextPluginCallback);for(const n in this._layers)this._layers[n].setEventedParent(null);for(const n in this.sourceCaches){const a=this.sourceCaches[n];a.setEventedParent(null),a.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(const n in this.sourceCaches)this.sourceCaches[n].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,n,a,c,d=!1){let g=!1,y=!1;const b={};for(const S of this._order){const A=this._layers[S];if(A.type!=="symbol")continue;if(!b[A.source]){const L=this.sourceCaches[A.source];b[A.source]=L.getRenderableIds(!0).map(q=>L.getTileByID(q)).sort((q,j)=>j.tileID.overscaledZ-q.tileID.overscaledZ||(q.tileID.isLessThan(j.tileID)?-1:1))}const k=this.crossTileSymbolIndex.addLayer(A,b[A.source],t.center.lng);g=g||k}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((d=d||this._layerOrderChanged||a===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.h.now(),t.zoom))&&(this.pauseablePlacement=new cs(t,this.map.terrain,this._order,d,n,a,c,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,b),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.h.now()),y=!0),g&&this.pauseablePlacement.placement.setStale()),y||g)for(const S of this._order){const A=this._layers[S];A.type==="symbol"&&this.placement.updateLayerOpacities(A,b[A.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(o.h.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,n,a){this.imageManager.getImages(n.icons,a),this._updateTilesForChangedImages();const c=this.sourceCaches[n.source];c&&c.setDependencies(n.tileID.key,n.type,n.icons)}getGlyphs(t,n,a){this.glyphManager.getGlyphs(n.stacks,a);const c=this.sourceCaches[n.source];c&&c.setDependencies(n.tileID.key,n.type,[""])}getResource(t,n,a){return o.m(n,a)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,n={}){this._checkLoaded(),t&&this._validate(o.y.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,n,a={},c){this._checkLoaded();const d=[{id:t,url:n}],g=[...dt(this.stylesheet.sprite),...d];this._validate(o.y.sprite,"sprite",g,null,a)||(this.stylesheet.sprite=g,this._loadSprite(d,!0,c))}removeSprite(t){this._checkLoaded();const n=dt(this.stylesheet.sprite);if(n.find(a=>a.id===t)){if(this._spritesImagesIds[t])for(const a of this._spritesImagesIds[t])this.imageManager.removeImage(a),this._changedImages[a]=!0;n.splice(n.findIndex(a=>a.id===t),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.k("data",{dataType:"style"}))}else this.fire(new o.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return dt(this.stylesheet.sprite)}setSprite(t,n={},a){this._checkLoaded(),t&&this._validate(o.y.sprite,"sprite",t,null,n)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,a):(this._unloadSprite(),a&&a(null)))}}Hi.registerForPluginStateChange=o.aK;var la=o.Q([{name:"a_pos",type:"Int16",components:2}]),hs="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const di={prelude:Ut(`#ifdef GL_ES -precision mediump float; -#else -#if !defined(lowp) -#define lowp -#endif -#if !defined(mediump) -#define mediump -#endif -#if !defined(highp) -#define highp -#endif -#endif -`,`#ifdef GL_ES -precision highp float; -#else -#if !defined(lowp) -#define lowp -#endif -#if !defined(mediump) -#define mediump -#endif -#if !defined(highp) -#define highp -#endif -#endif -vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 -);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} -#ifdef TERRAIN3D -uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; -#endif -const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { -#ifdef TERRAIN3D -highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); -#else -return 1.0; -#endif -}float calculate_visibility(vec4 pos) { -#ifdef TERRAIN3D -vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; -#else -return 1.0; -#endif -}float ele(vec2 pos) { -#ifdef TERRAIN3D -vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; -#else -return 0.0; -#endif -}float get_elevation(vec2 pos) { -#ifdef TERRAIN3D -vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; -#else -return 0.0; -#endif -}`),background:Ut(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Ut(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Ut(`varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main(void) { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Ut("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Ut(`uniform highp float u_intensity;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#define GAUSS_COEF 0.3989422804014327 -void main() { -#pragma mapbox: initialize highp float weight -float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#pragma mapbox: define mediump float radius -const highp float ZERO=1.0/255.0/16.0; -#define GAUSS_COEF 0.3989422804014327 -void main(void) { -#pragma mapbox: initialize highp float weight -#pragma mapbox: initialize mediump float radius -vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Ut(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(0.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Ut("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Ut("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Ut("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:Ut(`#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_FragColor=color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Ut(`varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Ut(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Ut(`#ifdef GL_ES -precision highp float; -#endif -uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Ut(`varying vec4 v_color;void main() {gl_FragColor=v_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; -#ifdef TERRAIN3D -attribute vec2 a_centroid; -#endif -varying vec4 v_color; -#pragma mapbox: define highp float base -#pragma mapbox: define highp float height -#pragma mapbox: define highp vec4 color -void main() { -#pragma mapbox: initialize highp float base -#pragma mapbox: initialize highp float height -#pragma mapbox: initialize highp vec4 color -vec3 normal=a_normal_ed.xyz; -#ifdef TERRAIN3D -float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); -#else -float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; -#endif -base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Ut(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; -#ifdef TERRAIN3D -attribute vec2 a_centroid; -#endif -varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; -#ifdef TERRAIN3D -float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); -#else -float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; -#endif -base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 -? a_pos -: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Ut(`#ifdef GL_ES -precision highp float; -#endif -uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:Ut(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; -#define PI 3.141592653589793 -void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:Ut(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_width2=vec2(outset,inset);}`),lineGradient:Ut(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_width2=vec2(outset,inset);}`),linePattern:Ut(`#ifdef GL_ES -precision highp float; -#endif -uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Ut(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Ut(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Ut(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Ut(`#define SDF_PX 8.0 -uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Ut(`#define SDF_PX 8.0 -#define SDF 1.0 -#define ICON 0.0 -uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:Ut("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",hs),terrainDepth:Ut("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",hs),terrainCoords:Ut("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",hs)};function Ut(u,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,a=t.match(/attribute ([\w]+) ([\w]+)/g),c=u.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),d=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),g=d?d.concat(c):c,y={};return{fragmentSource:u=u.replace(n,(b,S,A,k,L)=>(y[L]=!0,S==="define"?` -#ifndef HAS_UNIFORM_u_${L} -varying ${A} ${k} ${L}; -#else -uniform ${A} ${k} u_${L}; -#endif -`:` -#ifdef HAS_UNIFORM_u_${L} - ${A} ${k} ${L} = u_${L}; -#endif -`)),vertexSource:t=t.replace(n,(b,S,A,k,L)=>{const q=k==="float"?"vec2":"vec4",j=L.match(/color/)?"color":q;return y[L]?S==="define"?` -#ifndef HAS_UNIFORM_u_${L} -uniform lowp float u_${L}_t; -attribute ${A} ${q} a_${L}; -varying ${A} ${k} ${L}; -#else -uniform ${A} ${k} u_${L}; -#endif -`:j==="vec4"?` -#ifndef HAS_UNIFORM_u_${L} - ${L} = a_${L}; -#else - ${A} ${k} ${L} = u_${L}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${L} - ${L} = unpack_mix_${j}(a_${L}, u_${L}_t); -#else - ${A} ${k} ${L} = u_${L}; -#endif -`:S==="define"?` -#ifndef HAS_UNIFORM_u_${L} -uniform lowp float u_${L}_t; -attribute ${A} ${q} a_${L}; -#else -uniform ${A} ${k} u_${L}; -#endif -`:j==="vec4"?` -#ifndef HAS_UNIFORM_u_${L} - ${A} ${k} ${L} = a_${L}; -#else - ${A} ${k} ${L} = u_${L}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${L} - ${A} ${k} ${L} = unpack_mix_${j}(a_${L}, u_${L}_t); -#else - ${A} ${k} ${L} = u_${L}; -#endif -`}),staticAttributes:a,staticUniforms:g}}class qn{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,a,c,d,g,y,b,S){this.context=t;let A=this.boundPaintVertexBuffers.length!==c.length;for(let k=0;!A&&k({u_depth:new o.aL(pe,ye.u_depth),u_terrain:new o.aL(pe,ye.u_terrain),u_terrain_dim:new o.aM(pe,ye.u_terrain_dim),u_terrain_matrix:new o.aN(pe,ye.u_terrain_matrix),u_terrain_unpack:new o.aO(pe,ye.u_terrain_unpack),u_terrain_exaggeration:new o.aM(pe,ye.u_terrain_exaggeration)}))(t,de),this.binderUniforms=a?a.getUniforms(t,de):[]}draw(t,n,a,c,d,g,y,b,S,A,k,L,q,j,G,N,ee,ce){const K=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(a),t.setStencilMode(c),t.setColorMode(d),t.setCullFace(g),b){t.activeTexture.set(K.TEXTURE2),K.bindTexture(K.TEXTURE_2D,b.depthTexture),t.activeTexture.set(K.TEXTURE3),K.bindTexture(K.TEXTURE_2D,b.texture);for(const de in this.terrainUniforms)this.terrainUniforms[de].set(b[de])}for(const de in this.fixedUniforms)this.fixedUniforms[de].set(y[de]);G&&G.setUniforms(t,this.binderUniforms,q,{zoom:j});let ie=0;switch(n){case K.LINES:ie=2;break;case K.TRIANGLES:ie=3;break;case K.LINE_STRIP:ie=1}for(const de of L.get()){const pe=de.vaos||(de.vaos={});(pe[S]||(pe[S]=new qn)).bind(t,this,A,G?G.getPaintVertexBuffers():[],k,de.vertexOffset,N,ee,ce),K.drawElements(n,de.primitiveLength*ie,K.UNSIGNED_SHORT,de.primitiveOffset*ie*2)}}}function Nr(u,t,n){const a=1/$(n,1,t.transform.tileZoom),c=Math.pow(2,n.tileID.overscaledZ),d=n.tileSize*Math.pow(2,t.transform.tileZoom)/c,g=d*(n.tileID.canonical.x+n.tileID.wrap*c),y=d*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[a,u.fromScale,u.toScale],u_fade:u.t,u_pixel_coord_upper:[g>>16,y>>16],u_pixel_coord_lower:[65535&g,65535&y]}}const co=(u,t,n,a)=>{const c=t.style.light,d=c.properties.get("position"),g=[d.x,d.y,d.z],y=function(){var S=new o.A(9);return o.A!=Float32Array&&(S[1]=0,S[2]=0,S[3]=0,S[5]=0,S[6]=0,S[7]=0),S[0]=1,S[4]=1,S[8]=1,S}();c.properties.get("anchor")==="viewport"&&function(S,A){var k=Math.sin(A),L=Math.cos(A);S[0]=L,S[1]=k,S[2]=0,S[3]=-k,S[4]=L,S[5]=0,S[6]=0,S[7]=0,S[8]=1}(y,-t.transform.angle),function(S,A,k){var L=A[0],q=A[1],j=A[2];S[0]=L*k[0]+q*k[3]+j*k[6],S[1]=L*k[1]+q*k[4]+j*k[7],S[2]=L*k[2]+q*k[5]+j*k[8]}(g,g,y);const b=c.properties.get("color");return{u_matrix:u,u_lightpos:g,u_lightintensity:c.properties.get("intensity"),u_lightcolor:[b.r,b.g,b.b],u_vertical_gradient:+n,u_opacity:a}},zn=(u,t,n,a,c,d,g)=>o.e(co(u,t,n,a),Nr(d,t,g),{u_height_factor:-Math.pow(2,c.overscaledZ)/g.tileSize/8}),Cl=u=>({u_matrix:u}),uo=(u,t,n,a)=>o.e(Cl(u),Nr(n,t,a)),ua=(u,t)=>({u_matrix:u,u_world:t}),ha=(u,t,n,a,c)=>o.e(uo(u,t,n,a),{u_world:c}),Pn=(u,t,n,a)=>{const c=u.transform;let d,g;if(a.paint.get("circle-pitch-alignment")==="map"){const y=$(n,1,c.zoom);d=!0,g=[y,y]}else d=!1,g=c.pixelsToGLUnits;return{u_camera_to_center_distance:c.cameraToCenterDistance,u_scale_with_map:+(a.paint.get("circle-pitch-scale")==="map"),u_matrix:u.translatePosMatrix(t.posMatrix,n,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_pitch_with_map:+d,u_device_pixel_ratio:u.pixelRatio,u_extrude_scale:g}},ho=(u,t,n)=>{const a=$(n,1,t.zoom),c=Math.pow(2,t.zoom-n.tileID.overscaledZ),d=n.tileID.overscaleFactor();return{u_matrix:u,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:a,u_extrude_scale:[t.pixelsToGLUnits[0]/(a*c),t.pixelsToGLUnits[1]/(a*c)],u_overscale_factor:d}},zs=(u,t,n=1)=>({u_matrix:u,u_color:t,u_overlay:0,u_overlay_scale:n}),El=u=>({u_matrix:u}),Xc=(u,t,n,a)=>({u_matrix:u,u_extrude_scale:$(t,1,n),u_intensity:a});function po(u,t){const n=Math.pow(2,t.canonical.z),a=t.canonical.y;return[new o.U(0,a/n).toLngLat().lat,new o.U(0,(a+1)/n).toLngLat().lat]}const fo=(u,t,n,a)=>{const c=u.transform;return{u_matrix:da(u,t,n,a),u_ratio:1/$(t,1,c.zoom),u_device_pixel_ratio:u.pixelRatio,u_units_to_pixels:[1/c.pixelsToGLUnits[0],1/c.pixelsToGLUnits[1]]}},zl=(u,t,n,a,c)=>o.e(fo(u,t,n,c),{u_image:0,u_image_height:a}),Kc=(u,t,n,a,c)=>{const d=u.transform,g=Dl(t,d);return{u_matrix:da(u,t,n,c),u_texsize:t.imageAtlasTexture.size,u_ratio:1/$(t,1,d.zoom),u_device_pixel_ratio:u.pixelRatio,u_image:0,u_scale:[g,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/d.pixelsToGLUnits[0],1/d.pixelsToGLUnits[1]]}},Pl=(u,t,n,a,c,d)=>{const g=u.lineAtlas,y=Dl(t,u.transform),b=n.layout.get("line-cap")==="round",S=g.getDash(a.from,b),A=g.getDash(a.to,b),k=S.width*c.fromScale,L=A.width*c.toScale;return o.e(fo(u,t,n,d),{u_patternscale_a:[y/k,-S.height/2],u_patternscale_b:[y/L,-A.height/2],u_sdfgamma:g.width/(256*Math.min(k,L)*u.pixelRatio)/2,u_image:0,u_tex_y_a:S.y,u_tex_y_b:A.y,u_mix:c.t})};function Dl(u,t){return 1/$(u,1,t.tileZoom)}function da(u,t,n,a){return u.translatePosMatrix(a?a.posMatrix:t.tileID.posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const Ll=(u,t,n,a,c)=>{return{u_matrix:u,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:a.mix,u_opacity:a.opacity*c.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:c.paint.get("raster-brightness-min"),u_brightness_high:c.paint.get("raster-brightness-max"),u_saturation_factor:(g=c.paint.get("raster-saturation"),g>0?1-1/(1.001-g):-g),u_contrast_factor:(d=c.paint.get("raster-contrast"),d>0?1/(1-d):1+d),u_spin_weights:Bl(c.paint.get("raster-hue-rotate"))};var d,g};function Bl(u){u*=Math.PI/180;const t=Math.sin(u),n=Math.cos(u);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}const mo=(u,t,n,a,c,d,g,y,b,S)=>{const A=c.transform;return{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:A.cameraToCenterDistance,u_pitch:A.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:A.width/A.height,u_fade_change:c.options.fadeDuration?c.symbolFadeChange:1,u_matrix:d,u_label_plane_matrix:g,u_coord_matrix:y,u_is_text:+b,u_pitch_with_map:+a,u_texsize:S,u_texture:0}},go=(u,t,n,a,c,d,g,y,b,S,A)=>{const k=c.transform;return o.e(mo(u,t,n,a,c,d,g,y,b,S),{u_gamma_scale:a?Math.cos(k._pitch)*k.cameraToCenterDistance:1,u_device_pixel_ratio:c.pixelRatio,u_is_halo:+A})},Zn=(u,t,n,a,c,d,g,y,b,S)=>o.e(go(u,t,n,a,c,d,g,y,!0,b,!0),{u_texsize_icon:S,u_texture_icon:1}),pa=(u,t,n)=>({u_matrix:u,u_opacity:t,u_color:n}),Ur=(u,t,n,a,c,d)=>o.e(function(g,y,b,S){const A=b.imageManager.getPattern(g.from.toString()),k=b.imageManager.getPattern(g.to.toString()),{width:L,height:q}=b.imageManager.getPixelSize(),j=Math.pow(2,S.tileID.overscaledZ),G=S.tileSize*Math.pow(2,b.transform.tileZoom)/j,N=G*(S.tileID.canonical.x+S.tileID.wrap*j),ee=G*S.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:A.tl,u_pattern_br_a:A.br,u_pattern_tl_b:k.tl,u_pattern_br_b:k.br,u_texsize:[L,q],u_mix:y.t,u_pattern_size_a:A.displaySize,u_pattern_size_b:k.displaySize,u_scale_a:y.fromScale,u_scale_b:y.toScale,u_tile_units_to_pixels:1/$(S,1,b.transform.tileZoom),u_pixel_coord_upper:[N>>16,ee>>16],u_pixel_coord_lower:[65535&N,65535&ee]}}(a,d,n,c),{u_matrix:u,u_opacity:t}),fa={fillExtrusion:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_lightpos:new o.aP(u,t.u_lightpos),u_lightintensity:new o.aM(u,t.u_lightintensity),u_lightcolor:new o.aP(u,t.u_lightcolor),u_vertical_gradient:new o.aM(u,t.u_vertical_gradient),u_opacity:new o.aM(u,t.u_opacity)}),fillExtrusionPattern:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_lightpos:new o.aP(u,t.u_lightpos),u_lightintensity:new o.aM(u,t.u_lightintensity),u_lightcolor:new o.aP(u,t.u_lightcolor),u_vertical_gradient:new o.aM(u,t.u_vertical_gradient),u_height_factor:new o.aM(u,t.u_height_factor),u_image:new o.aL(u,t.u_image),u_texsize:new o.aQ(u,t.u_texsize),u_pixel_coord_upper:new o.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new o.aQ(u,t.u_pixel_coord_lower),u_scale:new o.aP(u,t.u_scale),u_fade:new o.aM(u,t.u_fade),u_opacity:new o.aM(u,t.u_opacity)}),fill:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix)}),fillPattern:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_image:new o.aL(u,t.u_image),u_texsize:new o.aQ(u,t.u_texsize),u_pixel_coord_upper:new o.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new o.aQ(u,t.u_pixel_coord_lower),u_scale:new o.aP(u,t.u_scale),u_fade:new o.aM(u,t.u_fade)}),fillOutline:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_world:new o.aQ(u,t.u_world)}),fillOutlinePattern:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_world:new o.aQ(u,t.u_world),u_image:new o.aL(u,t.u_image),u_texsize:new o.aQ(u,t.u_texsize),u_pixel_coord_upper:new o.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new o.aQ(u,t.u_pixel_coord_lower),u_scale:new o.aP(u,t.u_scale),u_fade:new o.aM(u,t.u_fade)}),circle:(u,t)=>({u_camera_to_center_distance:new o.aM(u,t.u_camera_to_center_distance),u_scale_with_map:new o.aL(u,t.u_scale_with_map),u_pitch_with_map:new o.aL(u,t.u_pitch_with_map),u_extrude_scale:new o.aQ(u,t.u_extrude_scale),u_device_pixel_ratio:new o.aM(u,t.u_device_pixel_ratio),u_matrix:new o.aN(u,t.u_matrix)}),collisionBox:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_camera_to_center_distance:new o.aM(u,t.u_camera_to_center_distance),u_pixels_to_tile_units:new o.aM(u,t.u_pixels_to_tile_units),u_extrude_scale:new o.aQ(u,t.u_extrude_scale),u_overscale_factor:new o.aM(u,t.u_overscale_factor)}),collisionCircle:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_inv_matrix:new o.aN(u,t.u_inv_matrix),u_camera_to_center_distance:new o.aM(u,t.u_camera_to_center_distance),u_viewport_size:new o.aQ(u,t.u_viewport_size)}),debug:(u,t)=>({u_color:new o.aR(u,t.u_color),u_matrix:new o.aN(u,t.u_matrix),u_overlay:new o.aL(u,t.u_overlay),u_overlay_scale:new o.aM(u,t.u_overlay_scale)}),clippingMask:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix)}),heatmap:(u,t)=>({u_extrude_scale:new o.aM(u,t.u_extrude_scale),u_intensity:new o.aM(u,t.u_intensity),u_matrix:new o.aN(u,t.u_matrix)}),heatmapTexture:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_world:new o.aQ(u,t.u_world),u_image:new o.aL(u,t.u_image),u_color_ramp:new o.aL(u,t.u_color_ramp),u_opacity:new o.aM(u,t.u_opacity)}),hillshade:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_image:new o.aL(u,t.u_image),u_latrange:new o.aQ(u,t.u_latrange),u_light:new o.aQ(u,t.u_light),u_shadow:new o.aR(u,t.u_shadow),u_highlight:new o.aR(u,t.u_highlight),u_accent:new o.aR(u,t.u_accent)}),hillshadePrepare:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_image:new o.aL(u,t.u_image),u_dimension:new o.aQ(u,t.u_dimension),u_zoom:new o.aM(u,t.u_zoom),u_unpack:new o.aO(u,t.u_unpack)}),line:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_ratio:new o.aM(u,t.u_ratio),u_device_pixel_ratio:new o.aM(u,t.u_device_pixel_ratio),u_units_to_pixels:new o.aQ(u,t.u_units_to_pixels)}),lineGradient:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_ratio:new o.aM(u,t.u_ratio),u_device_pixel_ratio:new o.aM(u,t.u_device_pixel_ratio),u_units_to_pixels:new o.aQ(u,t.u_units_to_pixels),u_image:new o.aL(u,t.u_image),u_image_height:new o.aM(u,t.u_image_height)}),linePattern:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_texsize:new o.aQ(u,t.u_texsize),u_ratio:new o.aM(u,t.u_ratio),u_device_pixel_ratio:new o.aM(u,t.u_device_pixel_ratio),u_image:new o.aL(u,t.u_image),u_units_to_pixels:new o.aQ(u,t.u_units_to_pixels),u_scale:new o.aP(u,t.u_scale),u_fade:new o.aM(u,t.u_fade)}),lineSDF:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_ratio:new o.aM(u,t.u_ratio),u_device_pixel_ratio:new o.aM(u,t.u_device_pixel_ratio),u_units_to_pixels:new o.aQ(u,t.u_units_to_pixels),u_patternscale_a:new o.aQ(u,t.u_patternscale_a),u_patternscale_b:new o.aQ(u,t.u_patternscale_b),u_sdfgamma:new o.aM(u,t.u_sdfgamma),u_image:new o.aL(u,t.u_image),u_tex_y_a:new o.aM(u,t.u_tex_y_a),u_tex_y_b:new o.aM(u,t.u_tex_y_b),u_mix:new o.aM(u,t.u_mix)}),raster:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_tl_parent:new o.aQ(u,t.u_tl_parent),u_scale_parent:new o.aM(u,t.u_scale_parent),u_buffer_scale:new o.aM(u,t.u_buffer_scale),u_fade_t:new o.aM(u,t.u_fade_t),u_opacity:new o.aM(u,t.u_opacity),u_image0:new o.aL(u,t.u_image0),u_image1:new o.aL(u,t.u_image1),u_brightness_low:new o.aM(u,t.u_brightness_low),u_brightness_high:new o.aM(u,t.u_brightness_high),u_saturation_factor:new o.aM(u,t.u_saturation_factor),u_contrast_factor:new o.aM(u,t.u_contrast_factor),u_spin_weights:new o.aP(u,t.u_spin_weights)}),symbolIcon:(u,t)=>({u_is_size_zoom_constant:new o.aL(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new o.aL(u,t.u_is_size_feature_constant),u_size_t:new o.aM(u,t.u_size_t),u_size:new o.aM(u,t.u_size),u_camera_to_center_distance:new o.aM(u,t.u_camera_to_center_distance),u_pitch:new o.aM(u,t.u_pitch),u_rotate_symbol:new o.aL(u,t.u_rotate_symbol),u_aspect_ratio:new o.aM(u,t.u_aspect_ratio),u_fade_change:new o.aM(u,t.u_fade_change),u_matrix:new o.aN(u,t.u_matrix),u_label_plane_matrix:new o.aN(u,t.u_label_plane_matrix),u_coord_matrix:new o.aN(u,t.u_coord_matrix),u_is_text:new o.aL(u,t.u_is_text),u_pitch_with_map:new o.aL(u,t.u_pitch_with_map),u_texsize:new o.aQ(u,t.u_texsize),u_texture:new o.aL(u,t.u_texture)}),symbolSDF:(u,t)=>({u_is_size_zoom_constant:new o.aL(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new o.aL(u,t.u_is_size_feature_constant),u_size_t:new o.aM(u,t.u_size_t),u_size:new o.aM(u,t.u_size),u_camera_to_center_distance:new o.aM(u,t.u_camera_to_center_distance),u_pitch:new o.aM(u,t.u_pitch),u_rotate_symbol:new o.aL(u,t.u_rotate_symbol),u_aspect_ratio:new o.aM(u,t.u_aspect_ratio),u_fade_change:new o.aM(u,t.u_fade_change),u_matrix:new o.aN(u,t.u_matrix),u_label_plane_matrix:new o.aN(u,t.u_label_plane_matrix),u_coord_matrix:new o.aN(u,t.u_coord_matrix),u_is_text:new o.aL(u,t.u_is_text),u_pitch_with_map:new o.aL(u,t.u_pitch_with_map),u_texsize:new o.aQ(u,t.u_texsize),u_texture:new o.aL(u,t.u_texture),u_gamma_scale:new o.aM(u,t.u_gamma_scale),u_device_pixel_ratio:new o.aM(u,t.u_device_pixel_ratio),u_is_halo:new o.aL(u,t.u_is_halo)}),symbolTextAndIcon:(u,t)=>({u_is_size_zoom_constant:new o.aL(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new o.aL(u,t.u_is_size_feature_constant),u_size_t:new o.aM(u,t.u_size_t),u_size:new o.aM(u,t.u_size),u_camera_to_center_distance:new o.aM(u,t.u_camera_to_center_distance),u_pitch:new o.aM(u,t.u_pitch),u_rotate_symbol:new o.aL(u,t.u_rotate_symbol),u_aspect_ratio:new o.aM(u,t.u_aspect_ratio),u_fade_change:new o.aM(u,t.u_fade_change),u_matrix:new o.aN(u,t.u_matrix),u_label_plane_matrix:new o.aN(u,t.u_label_plane_matrix),u_coord_matrix:new o.aN(u,t.u_coord_matrix),u_is_text:new o.aL(u,t.u_is_text),u_pitch_with_map:new o.aL(u,t.u_pitch_with_map),u_texsize:new o.aQ(u,t.u_texsize),u_texsize_icon:new o.aQ(u,t.u_texsize_icon),u_texture:new o.aL(u,t.u_texture),u_texture_icon:new o.aL(u,t.u_texture_icon),u_gamma_scale:new o.aM(u,t.u_gamma_scale),u_device_pixel_ratio:new o.aM(u,t.u_device_pixel_ratio),u_is_halo:new o.aL(u,t.u_is_halo)}),background:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_opacity:new o.aM(u,t.u_opacity),u_color:new o.aR(u,t.u_color)}),backgroundPattern:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_opacity:new o.aM(u,t.u_opacity),u_image:new o.aL(u,t.u_image),u_pattern_tl_a:new o.aQ(u,t.u_pattern_tl_a),u_pattern_br_a:new o.aQ(u,t.u_pattern_br_a),u_pattern_tl_b:new o.aQ(u,t.u_pattern_tl_b),u_pattern_br_b:new o.aQ(u,t.u_pattern_br_b),u_texsize:new o.aQ(u,t.u_texsize),u_mix:new o.aM(u,t.u_mix),u_pattern_size_a:new o.aQ(u,t.u_pattern_size_a),u_pattern_size_b:new o.aQ(u,t.u_pattern_size_b),u_scale_a:new o.aM(u,t.u_scale_a),u_scale_b:new o.aM(u,t.u_scale_b),u_pixel_coord_upper:new o.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new o.aQ(u,t.u_pixel_coord_lower),u_tile_units_to_pixels:new o.aM(u,t.u_tile_units_to_pixels)}),terrain:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_texture:new o.aL(u,t.u_texture),u_ele_delta:new o.aM(u,t.u_ele_delta)}),terrainDepth:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_ele_delta:new o.aM(u,t.u_ele_delta)}),terrainCoords:(u,t)=>({u_matrix:new o.aN(u,t.u_matrix),u_texture:new o.aL(u,t.u_texture),u_terrain_coords_id:new o.aM(u,t.u_terrain_coords_id),u_ele_delta:new o.aM(u,t.u_ele_delta)})};class ma{constructor(t,n,a){this.context=t;const c=t.gl;this.buffer=c.createBuffer(),this.dynamicDraw=!!a,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?c.DYNAMIC_DRAW:c.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Ps={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class ga{constructor(t,n,a,c){this.length=n.length,this.attributes=a,this.itemSize=n.bytesPerElement,this.dynamicDraw=c,this.context=t;const d=t.gl;this.buffer=d.createBuffer(),t.bindVertexBuffer.set(this.buffer),d.bufferData(d.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?d.DYNAMIC_DRAW:d.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let a=0;a0){const Ae=o.Z(),Ve=ye;o.aU(Ae,pe.placementInvProjMatrix,u.transform.glCoordMatrix),o.aU(Ae,Ae,pe.placementViewportMatrix),A.push({circleArray:we,circleOffset:L,transform:Ve,invTransform:Ae,coord:ie}),k+=we.length/4,L=k}Te&&S.draw(y,b.LINES,Lt.disabled,fi.disabled,u.colorModeForRenderPass(),ui.disabled,ho(ye,u.transform,de),u.style.map.terrain&&u.style.map.terrain.getTerrainData(ie),n.id,Te.layoutVertexBuffer,Te.indexBuffer,Te.segments,null,u.transform.zoom,null,null,Te.collisionVertexBuffer)}if(!g||!A.length)return;const q=u.useProgram("collisionCircle"),j=new o.aV;j.resize(4*k),j._trim();let G=0;for(const K of A)for(let ie=0;ie=0&&(j[N.associatedIconIndex]={shiftedAnchor:It,angle:ze})}else V(N.numGlyphs,L)}if(S){q.clear();const G=u.icon.placedSymbolArray;for(let N=0;Nu.style.map.terrain.getElevation(Te,gr,Ti):null,Li=n.layout.get("text-rotation-alignment")==="map";Ee(Ae,Te.posMatrix,u,c,ai,on,N,S,Li,wi)}const Yn=u.translatePosMatrix(Te.posMatrix,we,d,g),ws=ee||c&&pe||Fn?Mo:ai,er=u.translatePosMatrix(on,we,d,g,!0),Xi=ze&&n.paint.get(c?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let or;or=ze?Ae.iconsInText?Zn(it.kind,Tt,ce,N,u,Yn,ws,er,At,Di):go(it.kind,Tt,ce,N,u,Yn,ws,er,c,At,!0):mo(it.kind,Tt,ce,N,u,Yn,ws,er,c,At);const Qn={program:Xt,buffers:Ve,uniformValues:or,atlasTexture:bi,atlasTextureIcon:Ai,atlasInterpolation:ni,atlasInterpolationIcon:Wi,isSDF:ze,hasHalo:Xi};if(K&&Ae.canOverlap){ie=!0;const wi=Ve.segments.get();for(const Li of wi)ye.push({segments:new o.S([Li]),sortKey:Li.sortKey,state:Qn,terrainData:_t})}else ye.push({segments:Ve.segments,sortKey:0,state:Qn,terrainData:_t})}ie&&ye.sort((Te,we)=>Te.sortKey-we.sortKey);for(const Te of ye){const we=Te.state;if(L.activeTexture.set(q.TEXTURE0),we.atlasTexture.bind(we.atlasInterpolation,q.CLAMP_TO_EDGE),we.atlasTextureIcon&&(L.activeTexture.set(q.TEXTURE1),we.atlasTextureIcon&&we.atlasTextureIcon.bind(we.atlasInterpolationIcon,q.CLAMP_TO_EDGE)),we.isSDF){const Ae=we.uniformValues;we.hasHalo&&(Ae.u_is_halo=1,Co(we.buffers,Te.segments,n,u,we.program,de,A,k,Ae,Te.terrainData)),Ae.u_is_halo=0}Co(we.buffers,Te.segments,n,u,we.program,de,A,k,we.uniformValues,Te.terrainData)}}function Co(u,t,n,a,c,d,g,y,b,S){const A=a.context;c.draw(A,A.gl.TRIANGLES,d,g,y,ui.disabled,b,S,n.id,u.layoutVertexBuffer,u.indexBuffer,t,n.paint,a.transform.zoom,u.programConfigurations.get(n.id),u.dynamicLayoutVertexBuffer,u.opacityVertexBuffer)}function Ls(u,t,n,a,c){if(!n||!a||!a.imageAtlas)return;const d=a.imageAtlas.patternPositions;let g=d[n.to.toString()],y=d[n.from.toString()];if(!g&&y&&(g=y),!y&&g&&(y=g),!g||!y){const b=c.getPaintProperty(t);g=d[b],y=d[b]}g&&y&&u.setConstantPatternPositions(g,y)}function Bs(u,t,n,a,c,d,g){const y=u.context.gl,b="fill-pattern",S=n.paint.get(b),A=S&&S.constantOr(1),k=n.getCrossfadeParameters();let L,q,j,G,N;g?(q=A&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",L=y.LINES):(q=A?"fillPattern":"fill",L=y.TRIANGLES);const ee=S.constantOr(null);for(const ce of a){const K=t.getTile(ce);if(A&&!K.patternsLoaded())continue;const ie=K.getBucket(n);if(!ie)continue;const de=ie.programConfigurations.get(n.id),pe=u.useProgram(q,de),ye=u.style.map.terrain&&u.style.map.terrain.getTerrainData(ce);A&&(u.context.activeTexture.set(y.TEXTURE0),K.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),de.updatePaintBuffers(k)),Ls(de,b,ee,K,n);const Te=ye?ce:null,we=u.translatePosMatrix(Te?Te.posMatrix:ce.posMatrix,K,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(g){G=ie.indexBuffer2,N=ie.segments2;const Ae=[y.drawingBufferWidth,y.drawingBufferHeight];j=q==="fillOutlinePattern"&&A?ha(we,u,k,K,Ae):ua(we,Ae)}else G=ie.indexBuffer,N=ie.segments,j=A?uo(we,u,k,K):Cl(we);pe.draw(u.context,L,c,u.stencilModeForClipping(ce),d,ui.disabled,j,ye,n.id,ie.layoutVertexBuffer,G,N,n.paint,u.transform.zoom,de)}}function Rs(u,t,n,a,c,d,g){const y=u.context,b=y.gl,S="fill-extrusion-pattern",A=n.paint.get(S),k=A.constantOr(1),L=n.getCrossfadeParameters(),q=n.paint.get("fill-extrusion-opacity"),j=A.constantOr(null);for(const G of a){const N=t.getTile(G),ee=N.getBucket(n);if(!ee)continue;const ce=u.style.map.terrain&&u.style.map.terrain.getTerrainData(G),K=ee.programConfigurations.get(n.id),ie=u.useProgram(k?"fillExtrusionPattern":"fillExtrusion",K);k&&(u.context.activeTexture.set(b.TEXTURE0),N.imageAtlasTexture.bind(b.LINEAR,b.CLAMP_TO_EDGE),K.updatePaintBuffers(L)),Ls(K,S,j,N,n);const de=u.translatePosMatrix(G.posMatrix,N,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),pe=n.paint.get("fill-extrusion-vertical-gradient"),ye=k?zn(de,u,pe,q,G,L,N):co(de,u,pe,q);ie.draw(y,y.gl.TRIANGLES,c,d,g,ui.backCCW,ye,ce,n.id,ee.layoutVertexBuffer,ee.indexBuffer,ee.segments,n.paint,u.transform.zoom,K,u.style.map.terrain&&ee.centroidVertexBuffer)}}function ru(u,t,n,a,c,d,g){const y=u.context,b=y.gl,S=n.fbo;if(!S)return;const A=u.useProgram("hillshade"),k=u.style.map.terrain&&u.style.map.terrain.getTerrainData(t);y.activeTexture.set(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,S.colorAttachment.get()),A.draw(y,b.TRIANGLES,c,d,g,ui.disabled,((L,q,j,G)=>{const N=j.paint.get("hillshade-shadow-color"),ee=j.paint.get("hillshade-highlight-color"),ce=j.paint.get("hillshade-accent-color");let K=j.paint.get("hillshade-illumination-direction")*(Math.PI/180);j.paint.get("hillshade-illumination-anchor")==="viewport"&&(K-=L.transform.angle);const ie=!L.options.moving;return{u_matrix:G?G.posMatrix:L.transform.calculatePosMatrix(q.tileID.toUnwrapped(),ie),u_image:0,u_latrange:po(0,q.tileID),u_light:[j.paint.get("hillshade-exaggeration"),K],u_shadow:N,u_highlight:ee,u_accent:ce}})(u,n,a,k?t:null),k,a.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments)}function Eo(u,t,n,a,c,d){const g=u.context,y=g.gl,b=t.dem;if(b&&b.data){const S=b.dim,A=b.stride,k=b.getPixels();if(g.activeTexture.set(y.TEXTURE1),g.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||u.getTileTexture(A),t.demTexture){const q=t.demTexture;q.update(k,{premultiply:!1}),q.bind(y.NEAREST,y.CLAMP_TO_EDGE)}else t.demTexture=new qe(g,k,y.RGBA,{premultiply:!1}),t.demTexture.bind(y.NEAREST,y.CLAMP_TO_EDGE);g.activeTexture.set(y.TEXTURE0);let L=t.fbo;if(!L){const q=new qe(g,{width:S,height:S,data:null},y.RGBA);q.bind(y.LINEAR,y.CLAMP_TO_EDGE),L=t.fbo=g.createFramebuffer(S,S,!0,!1),L.colorAttachment.set(q.texture)}g.bindFramebuffer.set(L.framebuffer),g.viewport.set([0,0,S,S]),u.useProgram("hillshadePrepare").draw(g,y.TRIANGLES,a,c,d,ui.disabled,((q,j)=>{const G=j.stride,N=o.Z();return o.aS(N,0,o.N,-o.N,0,0,1),o.$(N,N,[0,-o.N,0]),{u_matrix:N,u_image:1,u_dimension:[G,G],u_zoom:q.overscaledZ,u_unpack:j.getUnpackVector()}})(t.tileID,b),null,n.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function nu(u,t,n,a,c,d){const g=a.paint.get("raster-fade-duration");if(!d&&g>0){const y=o.h.now(),b=(y-u.timeAdded)/g,S=t?(y-t.timeAdded)/g:-1,A=n.getSource(),k=c.coveringZoomLevel({tileSize:A.tileSize,roundZoom:A.roundZoom}),L=!t||Math.abs(t.tileID.overscaledZ-k)>Math.abs(u.tileID.overscaledZ-k),q=L&&u.refreshedUponExpiration?1:o.ad(L?b:1-S,0,1);return u.refreshedUponExpiration&&b>=1&&(u.refreshedUponExpiration=!1),t?{opacity:1,mix:1-q}:{opacity:q,mix:0}}return{opacity:1,mix:0}}const ql=new o.aT(1,0,0,1),Aa=new o.aT(0,1,0,1),zo=new o.aT(0,0,1,1),Zl=new o.aT(1,0,1,1),Gl=new o.aT(0,1,1,1);function Fs(u,t,n,a){ka(u,0,t+n/2,u.transform.width,n,a)}function Ma(u,t,n,a){ka(u,t-n/2,0,n,u.transform.height,a)}function ka(u,t,n,a,c,d){const g=u.context,y=g.gl;y.enable(y.SCISSOR_TEST),y.scissor(t*u.pixelRatio,n*u.pixelRatio,a*u.pixelRatio,c*u.pixelRatio),g.clear({color:d}),y.disable(y.SCISSOR_TEST)}function Hl(u,t,n){const a=u.context,c=a.gl,d=n.posMatrix,g=u.useProgram("debug"),y=Lt.disabled,b=fi.disabled,S=u.colorModeForRenderPass(),A="$debug",k=u.style.map.terrain&&u.style.map.terrain.getTerrainData(n);a.activeTexture.set(c.TEXTURE0);const L=t.getTileByID(n.key).latestRawTileData,q=Math.floor((L&&L.byteLength||0)/1024),j=t.getTile(n).tileSize,G=512/Math.min(j,512)*(n.overscaledZ/u.transform.zoom)*.5;let N=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(N+=` => ${n.overscaledZ}`),function(ee,ce){ee.initDebugOverlayCanvas();const K=ee.debugOverlayCanvas,ie=ee.context.gl,de=ee.debugOverlayCanvas.getContext("2d");de.clearRect(0,0,K.width,K.height),de.shadowColor="white",de.shadowBlur=2,de.lineWidth=1.5,de.strokeStyle="white",de.textBaseline="top",de.font="bold 36px Open Sans, sans-serif",de.fillText(ce,5,5),de.strokeText(ce,5,5),ee.debugOverlayTexture.update(K),ee.debugOverlayTexture.bind(ie.LINEAR,ie.CLAMP_TO_EDGE)}(u,`${N} ${q}kB`),g.draw(a,c.TRIANGLES,y,b,pi.alphaBlended,ui.disabled,zs(d,o.aT.transparent,G),null,A,u.debugBuffer,u.quadTriangleIndexBuffer,u.debugSegments),g.draw(a,c.LINE_STRIP,y,b,S,ui.disabled,zs(d,o.aT.red),k,A,u.debugBuffer,u.tileBorderIndexBuffer,u.debugSegments)}function yi(u,t,n){const a=u.context,c=a.gl,d=u.colorModeForRenderPass(),g=new Lt(c.LEQUAL,Lt.ReadWrite,u.depthRangeFor3D),y=u.useProgram("terrain"),b=t.getTerrainMesh();a.bindFramebuffer.set(null),a.viewport.set([0,0,u.width,u.height]);for(const S of n){const A=u.renderToTexture.getTexture(S),k=t.getTerrainData(S.tileID);a.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,A.texture);const L={u_matrix:u.transform.calculatePosMatrix(S.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(u.transform.zoom)};y.draw(a,c.TRIANGLES,g,fi.disabled,d,ui.backCCW,L,k,"terrain",b.vertexBuffer,b.indexBuffer,b.segments)}}class Wn{constructor(t,n){this.context=new iu(t),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:o.Z(),renderTime:0},this.setup(),this.numSublayers=pr.maxUnderzooming+pr.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new oa}resize(t,n,a){if(this.width=Math.floor(t*a),this.height=Math.floor(n*a),this.pixelRatio=a,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const c of this.style._order)this.style._layers[c].resize()}setup(){const t=this.context,n=new o.a_;n.emplaceBack(0,0),n.emplaceBack(o.N,0),n.emplaceBack(0,o.N),n.emplaceBack(o.N,o.N),this.tileExtentBuffer=t.createVertexBuffer(n,la.members),this.tileExtentSegments=o.S.simpleSegment(0,0,4,2);const a=new o.a_;a.emplaceBack(0,0),a.emplaceBack(o.N,0),a.emplaceBack(0,o.N),a.emplaceBack(o.N,o.N),this.debugBuffer=t.createVertexBuffer(a,la.members),this.debugSegments=o.S.simpleSegment(0,0,4,5);const c=new o.V;c.emplaceBack(0,0,0,0),c.emplaceBack(o.N,0,o.N,0),c.emplaceBack(0,o.N,0,o.N),c.emplaceBack(o.N,o.N,o.N,o.N),this.rasterBoundsBuffer=t.createVertexBuffer(c,St.members),this.rasterBoundsSegments=o.S.simpleSegment(0,0,4,2);const d=new o.a_;d.emplaceBack(0,0),d.emplaceBack(1,0),d.emplaceBack(0,1),d.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(d,la.members),this.viewportSegments=o.S.simpleSegment(0,0,4,2);const g=new o.a$;g.emplaceBack(0),g.emplaceBack(1),g.emplaceBack(3),g.emplaceBack(2),g.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(g);const y=new o.b0;y.emplaceBack(0,1,2),y.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(y);const b=this.context.gl;this.stencilClearMode=new fi({func:b.ALWAYS,mask:0},0,255,b.ZERO,b.ZERO,b.ZERO)}clearStencil(){const t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const a=o.Z();o.aS(a,0,this.width,this.height,0,0,1),o.a0(a,a,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,n.TRIANGLES,Lt.disabled,this.stencilClearMode,pi.disabled,ui.disabled,El(a),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,n){if(this.currentStencilSource===t.source||!t.isTileClipped()||!n||!n.length)return;this.currentStencilSource=t.source;const a=this.context,c=a.gl;this.nextStencilID+n.length>256&&this.clearStencil(),a.setColorMode(pi.disabled),a.setDepthMode(Lt.disabled);const d=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const g of n){const y=this._tileClippingMaskIDs[g.key]=this.nextStencilID++,b=this.style.map.terrain&&this.style.map.terrain.getTerrainData(g);d.draw(a,c.TRIANGLES,Lt.disabled,new fi({func:c.ALWAYS,mask:0},y,255,c.KEEP,c.KEEP,c.REPLACE),pi.disabled,ui.disabled,El(g.posMatrix),b,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,n=this.context.gl;return new fi({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){const n=this.context.gl;return new fi({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(t){const n=this.context.gl,a=t.sort((g,y)=>y.overscaledZ-g.overscaledZ),c=a[a.length-1].overscaledZ,d=a[0].overscaledZ-c+1;if(d>1){this.currentStencilSource=void 0,this.nextStencilID+d>256&&this.clearStencil();const g={};for(let y=0;y=0;this.currentLayer--){const b=this.style._layers[a[this.currentLayer]],S=c[b.source],A=d[b.source];this._renderTileClippingMasks(b,A),this.renderLayer(this,S,b,A)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerN.source&&!N.isHidden(A)?[S.sourceCaches[N.source]]:[]),q=L.filter(N=>N.getSource().type==="vector"),j=L.filter(N=>N.getSource().type!=="vector"),G=N=>{(!k||k.getSource().maxzoomG(N)),k||j.forEach(N=>G(N)),k}(this.style,this.transform.zoom);b&&function(S,A,k){for(let L=0;Lq.style.map.terrain.getElevation(pe,it,Ue):null)}}}(b,d,y,g,y.layout.get("text-rotation-alignment"),y.layout.get("text-pitch-alignment"),S),y.paint.get("icon-opacity").constantOr(1)!==0&&Ia(d,g,y,b,!1,y.paint.get("icon-translate"),y.paint.get("icon-translate-anchor"),y.layout.get("icon-rotation-alignment"),y.layout.get("icon-pitch-alignment"),y.layout.get("icon-keep-upright"),A,k),y.paint.get("text-opacity").constantOr(1)!==0&&Ia(d,g,y,b,!0,y.paint.get("text-translate"),y.paint.get("text-translate-anchor"),y.layout.get("text-rotation-alignment"),y.layout.get("text-pitch-alignment"),y.layout.get("text-keep-upright"),A,k),g.map.showCollisionBoxes&&(jl(d,g,y,b,y.paint.get("text-translate"),y.paint.get("text-translate-anchor"),!0),jl(d,g,y,b,y.paint.get("icon-translate"),y.paint.get("icon-translate-anchor"),!1))})(t,n,a,c,this.style.placement.variableOffsets);break;case"circle":(function(d,g,y,b){if(d.renderPass!=="translucent")return;const S=y.paint.get("circle-opacity"),A=y.paint.get("circle-stroke-width"),k=y.paint.get("circle-stroke-opacity"),L=!y.layout.get("circle-sort-key").isConstant();if(S.constantOr(1)===0&&(A.constantOr(1)===0||k.constantOr(1)===0))return;const q=d.context,j=q.gl,G=d.depthModeForSublayer(0,Lt.ReadOnly),N=fi.disabled,ee=d.colorModeForRenderPass(),ce=[];for(let K=0;KK.sortKey-ie.sortKey);for(const K of ce){const{programConfiguration:ie,program:de,layoutVertexBuffer:pe,indexBuffer:ye,uniformValues:Te,terrainData:we}=K.state;de.draw(q,j.TRIANGLES,G,N,ee,ui.disabled,Te,we,y.id,pe,ye,K.segments,y.paint,d.transform.zoom,ie)}})(t,n,a,c);break;case"heatmap":(function(d,g,y,b){if(y.paint.get("heatmap-opacity")!==0)if(d.renderPass==="offscreen"){const S=d.context,A=S.gl,k=fi.disabled,L=new pi([A.ONE,A.ONE],o.aT.transparent,[!0,!0,!0,!0]);(function(q,j,G){const N=q.gl;q.activeTexture.set(N.TEXTURE1),q.viewport.set([0,0,j.width/4,j.height/4]);let ee=G.heatmapFbo;if(ee)N.bindTexture(N.TEXTURE_2D,ee.colorAttachment.get()),q.bindFramebuffer.set(ee.framebuffer);else{const ce=N.createTexture();N.bindTexture(N.TEXTURE_2D,ce),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_S,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_T,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MIN_FILTER,N.LINEAR),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MAG_FILTER,N.LINEAR),ee=G.heatmapFbo=q.createFramebuffer(j.width/4,j.height/4,!1,!1),function(K,ie,de,pe){var ye,Te;const we=K.gl,Ae=(ye=K.HALF_FLOAT)!==null&&ye!==void 0?ye:we.UNSIGNED_BYTE,Ve=(Te=K.RGBA16F)!==null&&Te!==void 0?Te:we.RGBA;we.texImage2D(we.TEXTURE_2D,0,Ve,ie.width/4,ie.height/4,0,we.RGBA,Ae,null),pe.colorAttachment.set(de)}(q,j,ce,ee)}})(S,d,y),S.clear({color:o.aT.transparent});for(let q=0;q{const K=o.Z();o.aS(K,0,G.width,G.height,0,0,1);const ie=G.context.gl;return{u_matrix:K,u_world:[ie.drawingBufferWidth,ie.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:N.paint.get("heatmap-opacity")}})(S,A),null,A.id,S.viewportBuffer,S.quadTriangleIndexBuffer,S.viewportSegments,A.paint,S.transform.zoom)}(d,y))})(t,n,a,c);break;case"line":(function(d,g,y,b){if(d.renderPass!=="translucent")return;const S=y.paint.get("line-opacity"),A=y.paint.get("line-width");if(S.constantOr(1)===0||A.constantOr(1)===0)return;const k=d.depthModeForSublayer(0,Lt.ReadOnly),L=d.colorModeForRenderPass(),q=y.paint.get("line-dasharray"),j=y.paint.get("line-pattern"),G=j.constantOr(1),N=y.paint.get("line-gradient"),ee=y.getCrossfadeParameters(),ce=G?"linePattern":q?"lineSDF":N?"lineGradient":"line",K=d.context,ie=K.gl;let de=!0;for(const pe of b){const ye=g.getTile(pe);if(G&&!ye.patternsLoaded())continue;const Te=ye.getBucket(y);if(!Te)continue;const we=Te.programConfigurations.get(y.id),Ae=d.context.program.get(),Ve=d.useProgram(ce,we),It=de||Ve.program!==Ae,ze=d.style.map.terrain&&d.style.map.terrain.getTerrainData(pe),it=j.constantOr(null);if(it&&ye.imageAtlas){const Tt=ye.imageAtlas,_t=Tt.patternPositions[it.to.toString()],At=Tt.patternPositions[it.from.toString()];_t&&At&&we.setConstantPatternPositions(_t,At)}const Ue=ze?pe:null,Xt=G?Kc(d,ye,y,ee,Ue):q?Pl(d,ye,y,q,ee,Ue):N?zl(d,ye,y,Te.lineClipsArray.length,Ue):fo(d,ye,y,Ue);if(G)K.activeTexture.set(ie.TEXTURE0),ye.imageAtlasTexture.bind(ie.LINEAR,ie.CLAMP_TO_EDGE),we.updatePaintBuffers(ee);else if(q&&(It||d.lineAtlas.dirty))K.activeTexture.set(ie.TEXTURE0),d.lineAtlas.bind(K);else if(N){const Tt=Te.gradients[y.id];let _t=Tt.texture;if(y.gradientVersion!==Tt.version){let At=256;if(y.stepInterpolant){const bi=g.getSource().maxzoom,ni=pe.canonical.z===bi?Math.ceil(1<0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const n=this.imageManager.getPattern(t.from.toString()),a=this.imageManager.getPattern(t.to.toString());return!n||!a}useProgram(t,n){this.cache=this.cache||{};const a=t+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[a]||(this.cache[a]=new ca(this.context,di[t],n,fa[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[a]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const 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 qe(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:n}=this.context.gl;return this.width!==t||this.height!==n}}class fr{constructor(t,n){this.points=t,this.planes=n}static fromInvProjectionMatrix(t,n,a){const c=Math.pow(2,a),d=[[-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(y=>{const b=1/(y=o.ag([],y,t))[3]/n*c;return o.b3(y,y,[b,b,1/y[3],b])}),g=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(y=>{const b=function(L,q){var j=q[0],G=q[1],N=q[2],ee=j*j+G*G+N*N;return ee>0&&(ee=1/Math.sqrt(ee)),L[0]=q[0]*ee,L[1]=q[1]*ee,L[2]=q[2]*ee,L}([],function(L,q,j){var G=q[0],N=q[1],ee=q[2],ce=j[0],K=j[1],ie=j[2];return L[0]=N*ie-ee*K,L[1]=ee*ce-G*ie,L[2]=G*K-N*ce,L}([],zt([],d[y[0]],d[y[1]]),zt([],d[y[2]],d[y[1]]))),S=-((A=b)[0]*(k=d[y[1]])[0]+A[1]*k[1]+A[2]*k[2]);var A,k;return b.concat(S)});return new fr(d,g)}}class gs{constructor(t,n){this.min=t,this.max=n,this.center=function(a,c,d){return a[0]=.5*c[0],a[1]=.5*c[1],a[2]=.5*c[2],a}([],function(a,c,d){return a[0]=c[0]+d[0],a[1]=c[1]+d[1],a[2]=c[2]+d[2],a}([],this.min,this.max))}quadrant(t){const n=[t%2==0,t<2],a=bt(this.min),c=bt(this.max);for(let d=0;d=0&&g++;if(g===0)return 0;g!==n.length&&(a=!1)}if(a)return 2;for(let c=0;c<3;c++){let d=Number.MAX_VALUE,g=-Number.MAX_VALUE;for(let y=0;ythis.max[c]-this.min[c])return 0}return 1}}class Os{constructor(t=0,n=0,a=0,c=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(a)||a<0||isNaN(c)||c<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=a,this.right=c}interpolate(t,n,a){return n.top!=null&&t.top!=null&&(this.top=o.B.number(t.top,n.top,a)),n.bottom!=null&&t.bottom!=null&&(this.bottom=o.B.number(t.bottom,n.bottom,a)),n.left!=null&&t.left!=null&&(this.left=o.B.number(t.left,n.left,a)),n.right!=null&&t.right!=null&&(this.right=o.B.number(t.right,n.right,a)),this}getCenter(t,n){const a=o.ad((this.left+t-this.right)/2,0,t),c=o.ad((this.top+n-this.bottom)/2,0,n);return new o.P(a,c)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Os(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Ca{constructor(t,n,a,c,d){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=d===void 0||!!d,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=a??0,this._maxPitch=c??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new o.L(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Os,this._posMatrixCache={},this._alignedPosMatrixCache={},this._minEleveationForCurrentTile=0}clone(){const t=new Ca(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this._minEleveationForCurrentTile=t._minEleveationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new o.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const n=-o.b5(t,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=function(){var a=new o.A(4);return o.A!=Float32Array&&(a[1]=0,a[2]=0),a[0]=1,a[3]=1,a}(),function(a,c,d){var g=c[0],y=c[1],b=c[2],S=c[3],A=Math.sin(d),k=Math.cos(d);a[0]=g*k+b*A,a[1]=y*k+S*A,a[2]=g*-A+b*k,a[3]=y*-A+S*k}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const n=o.ad(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const n=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.tileZoom=Math.max(0,Math.floor(n)),this.scale=this.zoomScale(n),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,n,a){this._unmodified=!1,this._edgeInsets.interpolate(t,n,a),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const n=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(t){const n=[new o.b6(0,t)];if(this._renderWorldCopies){const a=this.pointCoordinate(new o.P(0,0)),c=this.pointCoordinate(new o.P(this.width,0)),d=this.pointCoordinate(new o.P(this.width,this.height)),g=this.pointCoordinate(new o.P(0,this.height)),y=Math.floor(Math.min(a.x,c.x,d.x,g.x)),b=Math.floor(Math.max(a.x,c.x,d.x,g.x)),S=1;for(let A=y-S;A<=b+S;A++)A!==0&&n.push(new o.b6(A,t))}return n}coveringTiles(t){var n,a;let c=this.coveringZoomLevel(t);const d=c;if(t.minzoom!==void 0&&ct.maxzoom&&(c=t.maxzoom);const g=this.pointCoordinate(this.getCameraPoint()),y=o.U.fromLngLat(this.center),b=Math.pow(2,c),S=[b*g.x,b*g.y,0],A=[b*y.x,b*y.y,0],k=fr.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,c);let L=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(L=c);const q=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,j=K=>({aabb:new gs([K*b,0,0],[(K+1)*b,b,0]),zoom:0,x:0,y:0,wrap:K,fullyVisible:!1}),G=[],N=[],ee=c,ce=t.reparseOverscaled?d:c;if(this._renderWorldCopies)for(let K=1;K<=3;K++)G.push(j(-K)),G.push(j(K));for(G.push(j(0));G.length>0;){const K=G.pop(),ie=K.x,de=K.y;let pe=K.fullyVisible;if(!pe){const Ve=K.aabb.intersects(k);if(Ve===0)continue;pe=Ve===2}const ye=t.terrain?S:A,Te=K.aabb.distanceX(ye),we=K.aabb.distanceY(ye),Ae=Math.max(Math.abs(Te),Math.abs(we));if(K.zoom===ee||Ae>q+(1<=L){const Ve=ee-K.zoom,It=S[0]-.5-(ie<>1),it=K.zoom+1;let Ue=K.aabb.quadrant(Ve);if(t.terrain){const Xt=new o.O(it,K.wrap,it,It,ze),Tt=t.terrain.getMinMaxElevation(Xt),_t=(n=Tt.minElevation)!==null&&n!==void 0?n:this.elevation,At=(a=Tt.maxElevation)!==null&&a!==void 0?a:this.elevation;Ue=new gs([Ue.min[0],Ue.min[1],_t],[Ue.max[0],Ue.max[1],At])}G.push({aabb:Ue,zoom:it,x:It,y:ze,wrap:K.wrap,fullyVisible:pe})}}return N.sort((K,ie)=>K.distanceSq-ie.distanceSq).map(K=>K.tileID)}resize(t,n){this.width=t,this.height=n,this.pixelsToGLUnits=[2/t,-2/n],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 n=o.ad(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new o.P(o.G(t.lng)*this.worldSize,o.H(n)*this.worldSize)}unproject(t){return new o.U(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){const n=this.pointLocation(this.centerPoint,t),a=t.getElevationForLngLatZoom(n,this.tileZoom);if(!(this.elevation-a))return;const c=this.getCameraPosition(),d=o.U.fromLngLat(c.lngLat,c.altitude),g=o.U.fromLngLat(n,a),y=d.x-g.x,b=d.y-g.y,S=d.z-g.z,A=Math.sqrt(y*y+b*b+S*S),k=this.scaleZoom(this.cameraToCenterDistance/A/this.tileSize);this._elevation=a,this._center=n,this.zoom=k}setLocationAtPoint(t,n){const a=this.pointCoordinate(n),c=this.pointCoordinate(this.centerPoint),d=this.locationCoordinate(t),g=new o.U(d.x-(a.x-c.x),d.y-(a.y-c.y));this.center=this.coordinateLocation(g),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,n){return n?this.coordinatePoint(this.locationCoordinate(t),n.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,n){return this.coordinateLocation(this.pointCoordinate(t,n))}locationCoordinate(t){return o.U.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,n){if(n){const L=n.pointCoordinate(t);if(L!=null)return L}const a=[t.x,t.y,0,1],c=[t.x,t.y,1,1];o.ag(a,a,this.pixelMatrixInverse),o.ag(c,c,this.pixelMatrixInverse);const d=a[3],g=c[3],y=a[1]/d,b=c[1]/g,S=a[2]/d,A=c[2]/g,k=S===A?0:(0-S)/(A-S);return new o.U(o.B.number(a[0]/d,c[0]/g,k)/this.worldSize,o.B.number(y,b,k)/this.worldSize)}coordinatePoint(t,n=0,a=this.pixelMatrix){const c=[t.x*this.worldSize,t.y*this.worldSize,n,1];return o.ag(c,c,a),new o.P(c[0]/c[3],c[1]/c[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return new yt().extend(this.pointLocation(new o.P(0,t))).extend(this.pointLocation(new o.P(this.width,t))).extend(this.pointLocation(new o.P(this.width,this.height))).extend(this.pointLocation(new o.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new yt([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(t,n=!1){const a=t.key,c=n?this._alignedPosMatrixCache:this._posMatrixCache;if(c[a])return c[a];const d=t.canonical,g=this.worldSize/this.zoomScale(d.z),y=d.x+Math.pow(2,d.z)*t.wrap,b=o.ao(new Float64Array(16));return o.$(b,b,[y*g,d.y*g,0]),o.a0(b,b,[g/o.N,g/o.N,1]),o.a1(b,n?this.alignedProjMatrix:this.projMatrix,b),c[a]=new Float32Array(b),c[a]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t,n,a,c,d=-90,g=90,y=-180,b=180;const S=this.size,A=this._unmodified;if(this.latRange){const q=this.latRange;d=o.H(q[1])*this.worldSize,g=o.H(q[0])*this.worldSize,t=g-dg&&(c=g-j)}if(this.lngRange){const q=(y+b)/2,j=o.b5(k.x,q-this.worldSize/2,q+this.worldSize/2),G=S.x/2;j-Gb&&(a=b-G)}a===void 0&&c===void 0||(this.center=this.unproject(new o.P(a!==void 0?a:k.x,c!==void 0?c:k.y)).wrap()),this._unmodified=A,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,n=this.point.x,a=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=o.b7(1,this.center.lat)*this.worldSize;let c=o.ao(new Float64Array(16));o.a0(c,c,[this.width/2,-this.height/2,1]),o.$(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=o.ao(new Float64Array(16)),o.a0(c,c,[1,-1,1]),o.$(c,c,[-1,-1,0]),o.a0(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c;const d=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),g=Math.min(this.elevation,this._minEleveationForCurrentTile),y=d-g*this._pixelPerMeter/Math.cos(this._pitch),b=g<0?y:d,S=Math.PI/2+this._pitch,A=this._fov*(.5+t.y/this.height),k=Math.sin(A)*b/Math.sin(o.ad(Math.PI-S-A,.01,Math.PI-.01)),L=this.getHorizon(),q=2*Math.atan(L/this.cameraToCenterDistance)*(.5+t.y/(2*L)),j=Math.sin(q)*b/Math.sin(o.ad(Math.PI-S-q,.01,Math.PI-.01)),G=Math.min(k,j),N=1.01*(Math.cos(Math.PI/2-this._pitch)*G+b),ee=this.height/50;c=new Float64Array(16),o.b8(c,this._fov,this.width/this.height,ee,N),c[8]=2*-t.x/this.width,c[9]=2*t.y/this.height,o.a0(c,c,[1,-1,1]),o.$(c,c,[0,0,-this.cameraToCenterDistance]),o.b9(c,c,this._pitch),o.ae(c,c,this.angle),o.$(c,c,[-n,-a,0]),this.mercatorMatrix=o.a0([],c,[this.worldSize,this.worldSize,this.worldSize]),o.a0(c,c,[1,1,this._pixelPerMeter]),this.pixelMatrix=o.a1(new Float64Array(16),this.labelPlaneMatrix,c),o.$(c,c,[0,0,-this.elevation]),this.projMatrix=c,this.invProjMatrix=o.as([],c),this.pixelMatrix3D=o.a1(new Float64Array(16),this.labelPlaneMatrix,c);const ce=this.width%2/2,K=this.height%2/2,ie=Math.cos(this.angle),de=Math.sin(this.angle),pe=n-Math.round(n)+ie*ce+de*K,ye=a-Math.round(a)+ie*K+de*ce,Te=new Float64Array(c);if(o.$(Te,Te,[pe>.5?pe-1:pe,ye>.5?ye-1:ye,0]),this.alignedProjMatrix=Te,c=o.as(new Float64Array(16),this.pixelMatrix),!c)throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new o.P(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return o.ag(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new o.P(0,t))}getCameraQueryGeometry(t){const n=this.getCameraPoint();if(t.length===1)return[t[0],n];{let a=n.x,c=n.y,d=n.x,g=n.y;for(const y of t)a=Math.min(a,y.x),c=Math.min(c,y.y),d=Math.max(d,y.x),g=Math.max(g,y.y);return[new o.P(a,c),new o.P(d,c),new o.P(d,g),new o.P(a,g),new o.P(a,c)]}}}function Xn(u,t){let n,a=!1,c=null,d=null;const g=()=>{c=null,a&&(u.apply(d,n),c=setTimeout(g,t),a=!1)};return(...y)=>(a=!0,d=this,n=y,c||g(),c)}class Vs{constructor(t){this._getCurrentHash=()=>{const n=window.location.hash.replace("#","");if(this._hashName){let a;return n.split("&").map(c=>c.split("=")).forEach(c=>{c[0]===this._hashName&&(a=c)}),(a&&a[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{const n=this._getCurrentHash();if(n.length>=3&&!n.some(a=>isNaN(a))){const a=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:a,pitch:+(n[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const n=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,n)}catch{}},this._updateHash=Xn(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(t){const n=this._map.getCenter(),a=Math.round(100*this._map.getZoom())/100,c=Math.ceil((a*Math.LN2+Math.log(512/360/.5))/Math.LN10),d=Math.pow(10,c),g=Math.round(n.lng*d)/d,y=Math.round(n.lat*d)/d,b=this._map.getBearing(),S=this._map.getPitch();let A="";if(A+=t?`/${g}/${y}/${a}`:`${a}/${y}/${g}`,(b||S)&&(A+="/"+Math.round(10*b)/10),S&&(A+=`/${Math.round(S)}`),this._hashName){const k=this._hashName;let L=!1;const q=window.location.hash.slice(1).split("&").map(j=>{const G=j.split("=")[0];return G===k?(L=!0,`${G}=${A}`):j}).filter(j=>j);return L||q.push(`${k}=${A}`),`#${q.join("&")}`}return`#${A}`}}const _s={linearity:.3,easing:o.ba(0,0,.3,1)},Wl=o.e({deceleration:2500,maxSpeed:1400},_s),Xl=o.e({deceleration:20,maxSpeed:1400},_s),Kl=o.e({deceleration:1e3,maxSpeed:360},_s),Jl=o.e({deceleration:1e3,maxSpeed:90},_s);class Yl{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.h.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,n=o.h.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new o.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:d}of this._inertiaBuffer)n.zoom+=d.zoomDelta||0,n.bearing+=d.bearingDelta||0,n.pitch+=d.pitchDelta||0,d.panDelta&&n.pan._add(d.panDelta),d.around&&(n.around=d.around),d.pinchAround&&(n.pinchAround=d.pinchAround);const a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,c={};if(n.pan.mag()){const d=Ns(n.pan.mag(),a,o.e({},Wl,t||{}));c.offset=n.pan.mult(d.amount/n.pan.mag()),c.center=this._map.transform.center,an(c,d)}if(n.zoom){const d=Ns(n.zoom,a,Xl);c.zoom=this._map.transform.zoom+d.amount,an(c,d)}if(n.bearing){const d=Ns(n.bearing,a,Kl);c.bearing=this._map.transform.bearing+o.ad(d.amount,-179,179),an(c,d)}if(n.pitch){const d=Ns(n.pitch,a,Jl);c.pitch=this._map.transform.pitch+d.amount,an(c,d)}if(c.zoom||c.bearing){const d=n.pinchAround===void 0?n.around:n.pinchAround;c.around=d?this._map.unproject(d):this._map.getCenter()}return this.clear(),o.e(c,{noMoveStart:!0})}}function an(u,t){(!u.duration||u.durationn.unproject(b)),y=d.reduce((b,S,A,k)=>b.add(S.div(k.length)),new o.P(0,0));super(t,{points:d,point:y,lngLats:g,lngLat:n.unproject(y),originalEvent:a}),this._defaultPrevented=!1}}class Ql extends o.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,a){super(t,{originalEvent:a}),this._defaultPrevented=!1}}class $l{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Ql(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new kr(t.type,this._map,t))}mouseup(t){this._map.fire(new kr(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new kr(t.type,this._map,t))}dblclick(t){return this._firePreventable(new kr(t.type,this._map,t))}mouseover(t){this._map.fire(new kr(t.type,this._map,t))}mouseout(t){this._map.fire(new kr(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Us(t.type,this._map,t))}touchmove(t){this._map.fire(new Us(t.type,this._map,t))}touchend(t){this._map.fire(new Us(t.type,this._map,t))}touchcancel(t){this._map.fire(new Us(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ec{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new kr(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new kr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new kr(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class _n{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(o.P.convert(t),this._map.terrain)}}class tc{constructor(t,n){this._map=t,this._tr=new _n(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&t.button===0&&(O.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;const a=n;if(this._lastPos.equals(a)||!this._box&&a.dist(this._startPos)d.fitScreenCoordinates(a,c,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(O.remove(this._box),this._box=null),O.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new o.k(t,{originalEvent:n}))}}function jr(u,t){if(u.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${u.length}, points ${t.length}`);const n={};for(let a=0;athis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),a.length===this.numTouches&&(this.centroid=function(c){const d=new o.P(0,0);for(const g of c)d._add(g);return d.div(c.length)}(n),this.touches=jr(a,n)))}touchmove(t,n,a){if(this.aborted||!this.centroid)return;const c=jr(a,n);for(const d in this.touches){const g=c[d];(!g||g.dist(this.touches[d])>30)&&(this.aborted=!0)}}touchend(t,n,a){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),a.length===0){const c=!this.aborted&&this.centroid;if(this.reset(),c)return c}}}class Ea{constructor(t){this.singleTap=new yn(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,a){this.singleTap.touchstart(t,n,a)}touchmove(t,n,a){this.singleTap.touchmove(t,n,a)}touchend(t,n,a){const c=this.singleTap.touchend(t,n,a);if(c){const d=t.timeStamp-this.lastTime<500,g=!this.lastTap||this.lastTap.dist(c)<30;if(d&&g||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=c,this.count===this.numTaps)return this.reset(),c}}}class xn{constructor(t){this._tr=new _n(t),this._zoomIn=new Ea({numTouches:1,numTaps:2}),this._zoomOut=new Ea({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,a){this._zoomIn.touchstart(t,n,a),this._zoomOut.touchstart(t,n,a)}touchmove(t,n,a){this._zoomIn.touchmove(t,n,a),this._zoomOut.touchmove(t,n,a)}touchend(t,n,a){const c=this._zoomIn.touchend(t,n,a),d=this._zoomOut.touchend(t,n,a),g=this._tr;return c?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:g.zoom+1,around:g.unproject(c)},{originalEvent:t})}):d?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:g.zoom-1,around:g.unproject(d)},{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}}class vn{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;const a=this._lastPoint;if(!a)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const c=n.length?n[0]:n;return!this._moved&&c.dist(a){u.mousedown=u.dragStart,u.mousemoveWindow=u.dragMove,u.mouseup=u.dragEnd,u.contextmenu=function(t){t.preventDefault()}},ys=({enable:u,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>{const a=new Po({checkCorrectEvent:c=>O.mouseButton(c)===0&&c.ctrlKey||O.mouseButton(c)===2});return new vn({clickTolerance:t,move:(c,d)=>({bearingDelta:(d.x-c.x)*n}),moveStateManager:a,enable:u,assignEvents:za})},bn=({enable:u,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>{const a=new Po({checkCorrectEvent:c=>O.mouseButton(c)===0&&c.ctrlKey||O.mouseButton(c)===2});return new vn({clickTolerance:t,move:(c,d)=>({pitchDelta:(d.y-c.y)*n}),moveStateManager:a,enable:u,assignEvents:za})};class Re{constructor(t,n){this._minTouches=t.cooperativeGestures?2:1,this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new o.P(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(t,n,a){return this._calculateTransform(t,n,a)}touchmove(t,n,a){if(this._map._cooperativeGestures&&(this._minTouches===2&&a.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(t,!1,a.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(a.length0&&(this._active=!0);const c=jr(a,n),d=new o.P(0,0),g=new o.P(0,0);let y=0;for(const S in c){const A=c[S],k=this._touches[S];k&&(d._add(A),g._add(A.sub(k)),y++,c[S]=A)}if(this._touches=c,yMath.abs(u.x)}class au extends Pa{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,a){super.touchstart(t,n,a),this._currentTouchCount=a.length}_start(t){this._lastPoints=t,Lo(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,a){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const c=t[0].sub(this._lastPoints[0]),d=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(c,d,a.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(c.y+d.y)/2*-.5}):void 0}gestureBeginsVertically(t,n,a){if(this._valid!==void 0)return this._valid;const c=t.mag()>=2,d=n.mag()>=2;if(!c&&!d)return;if(!c||!d)return this._firstMove===void 0&&(this._firstMove=a),a-this._firstMove<100&&void 0;const g=t.y>0==n.y>0;return Lo(t)&&Lo(n)&&g}}const Bo={panStep:100,bearingStep:15,pitchStep:10};class nc{constructor(t){this._tr=new _n(t);const n=Bo;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,a=0,c=0,d=0,g=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?a=-1:(t.preventDefault(),d=-1);break;case 39:t.shiftKey?a=1:(t.preventDefault(),d=1);break;case 38:t.shiftKey?c=1:(t.preventDefault(),g=-1);break;case 40:t.shiftKey?c=-1:(t.preventDefault(),g=1);break;default:return}return this._rotationDisabled&&(a=0,c=0),{cameraAnimation:y=>{const b=this._tr;y.easeTo({duration:300,easeId:"keyboardHandler",easing:sc,zoom:n?Math.round(b.zoom)+n*(t.shiftKey?2:1):b.zoom,bearing:b.bearing+a*this._bearingStep,pitch:b.pitch+c*this._pitchStep,offset:[-d*this._panStep,-g*this._panStep],center:b.center},{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 sc(u){return u*(2-u)}const ac=4.000244140625;class ou{constructor(t,n){this._onTimeout=a=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(a)},this._map=t,this._tr=new _n(t),this._el=t.getCanvasContainer(),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}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")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!t[this._map._metaKey])return;t.preventDefault()}let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const a=o.h.now(),c=a-(this._lastWheelEventTime||0);this._lastWheelEventTime=a,n!==0&&n%ac==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":c>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(c*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_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 n=O.mousePos(this._el,t),a=this._tr;this._around=o.L.convert(this._aroundCenter?a.center:a.unproject(n)),this._aroundPoint=a.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._tr.transform;if(this._delta!==0){const y=this._type==="wheel"&&Math.abs(this._delta)>ac?this._wheelZoomRate:this._defaultZoomRate;let b=2/(1+Math.exp(-Math.abs(this._delta*y)));this._delta<0&&b!==0&&(b=1/b);const S=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(S*b))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,a=this._startZoom,c=this._easing;let d,g=!1;if(this._type==="wheel"&&a&&c){const y=Math.min((o.h.now()-this._lastWheelEventTime)/200,1),b=c(y);d=o.B.number(a,n,b),y<1?this._frameId||(this._frameId=!0):g=!0}else d=n,g=!0;return this._active=!0,g&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!g,zoomDelta:d-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=o.bb;if(this._prevEase){const a=this._prevEase,c=(o.h.now()-a.start)/a.duration,d=a.easing(c+.01)-a.easing(c),g=.27/Math.sqrt(d*d+1e-4)*.01,y=Math.sqrt(.0729-g*g);n=o.ba(g,y,.25,1)}return this._prevEase={start:o.h.now(),duration:t,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Ro{constructor(t,n){this._clickZoom=t,this._tapZoom=n}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 Fo{constructor(t){this._tr=new _n(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:a=>{a.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Oo{constructor(){this._tap=new Ea({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,n,a){if(!this._swipePoint)if(this._tapTime){const c=n[0],d=t.timeStamp-this._tapTime<500,g=this._tapPoint.dist(c)<30;d&&g?a.length>0&&(this._swipePoint=c,this._swipeTouch=a[0].identifier):this.reset()}else this._tap.touchstart(t,n,a)}touchmove(t,n,a){if(this._tapTime){if(this._swipePoint){if(a[0].identifier!==this._swipeTouch)return;const c=n[0],d=c.y-this._swipePoint.y;return this._swipePoint=c,t.preventDefault(),this._active=!0,{zoomDelta:d/128}}}else this._tap.touchmove(t,n,a)}touchend(t,n,a){if(this._tapTime)this._swipePoint&&a.length===0&&this.reset();else{const c=this._tap.touchend(t,n,a);c&&(this._tapTime=t.timeStamp,this._tapPoint=c)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Vo{constructor(t,n,a){this._el=t,this._mousePan=n,this._touchPan=a}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class mr{constructor(t,n,a){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=n,this._mousePitch=a}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 Rn{constructor(t,n,a,c){this._el=t,this._touchZoom=n,this._touchRotate=a,this._tapDragZoom=c,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("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const js=u=>u.zoom||u.drag||u.pitch||u.rotate;class No extends o.k{}function qs(u){return u.panDelta&&u.panDelta.mag()||u.zoomDelta||u.bearingDelta||u.pitchDelta}class Uo{constructor(t,n){this.handleWindowEvent=c=>{this.handleEvent(c,`${c.type}Window`)},this.handleEvent=(c,d)=>{if(c.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const g=c.type==="renderFrame"?void 0:c,y={needsRenderFrame:!1},b={},S={},A=c.touches,k=A?this._getMapTouches(A):void 0,L=k?O.touchPos(this._el,k):O.mousePos(this._el,c);for(const{handlerName:G,handler:N,allowed:ee}of this._handlers){if(!N.isEnabled())continue;let ce;this._blockedByActive(S,ee,G)?N.reset():N[d||c.type]&&(ce=N[d||c.type](c,L,k),this.mergeHandlerResult(y,b,ce,G,g),ce&&ce.needsRenderFrame&&this._triggerRenderFrame()),(ce||N.isActive())&&(S[G]=N)}const q={};for(const G in this._previousActiveHandlers)S[G]||(q[G]=g);this._previousActiveHandlers=S,(Object.keys(q).length||qs(y))&&(this._changes.push([y,b,q]),this._triggerRenderFrame()),(Object.keys(S).length||qs(y))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:j}=y;j&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],j(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Yl(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);const a=this._el;this._listeners=[[a,"touchstart",{passive:!0}],[a,"touchmove",{passive:!1}],[a,"touchend",void 0],[a,"touchcancel",void 0],[a,"mousedown",void 0],[a,"mousemove",void 0],[a,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[a,"mouseover",void 0],[a,"mouseout",void 0],[a,"dblclick",void 0],[a,"click",void 0],[a,"keydown",{capture:!1}],[a,"keyup",void 0],[a,"wheel",{passive:!1}],[a,"contextmenu",void 0],[window,"blur",void 0]];for(const[c,d,g]of this._listeners)O.addEventListener(c,d,c===document?this.handleWindowEvent:this.handleEvent,g)}destroy(){for(const[t,n,a]of this._listeners)O.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,a)}_addDefaultHandlers(t){const n=this._map,a=n.getCanvasContainer();this._add("mapEvent",new $l(n,t));const c=n.boxZoom=new tc(n,t);this._add("boxZoom",c),t.interactive&&t.boxZoom&&c.enable();const d=new xn(n),g=new Fo(n);n.doubleClickZoom=new Ro(g,d),this._add("tapZoom",d),this._add("clickZoom",g),t.interactive&&t.doubleClickZoom&&n.doubleClickZoom.enable();const y=new Oo;this._add("tapDragZoom",y);const b=n.touchPitch=new au(n);this._add("touchPitch",b),t.interactive&&t.touchPitch&&n.touchPitch.enable(t.touchPitch);const S=ys(t),A=bn(t);n.dragRotate=new mr(t,S,A),this._add("mouseRotate",S,["mousePitch"]),this._add("mousePitch",A,["mouseRotate"]),t.interactive&&t.dragRotate&&n.dragRotate.enable();const k=(({enable:ee,clickTolerance:ce})=>{const K=new Po({checkCorrectEvent:ie=>O.mouseButton(ie)===0&&!ie.ctrlKey});return new vn({clickTolerance:ce,move:(ie,de)=>({around:de,panDelta:de.sub(ie)}),activateOnStart:!0,moveStateManager:K,enable:ee,assignEvents:za})})(t),L=new Re(t,n);n.dragPan=new Vo(a,k,L),this._add("mousePan",k),this._add("touchPan",L,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&n.dragPan.enable(t.dragPan);const q=new Do,j=new rc;n.touchZoomRotate=new Rn(a,j,q,y),this._add("touchRotate",q,["touchPan","touchZoom"]),this._add("touchZoom",j,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&n.touchZoomRotate.enable(t.touchZoomRotate);const G=n.scrollZoom=new ou(n,()=>this._triggerRenderFrame());this._add("scrollZoom",G,["mousePan"]),t.interactive&&t.scrollZoom&&n.scrollZoom.enable(t.scrollZoom);const N=n.keyboard=new nc(n);this._add("keyboard",N),t.interactive&&t.keyboard&&n.keyboard.enable(),this._add("blockableMapEvent",new ec(n))}_add(t,n,a){this._handlers.push({handlerName:t,handler:n,allowed:a}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}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!!js(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,a){for(const c in t)if(c!==a&&(!n||n.indexOf(c)<0))return!0;return!1}_getMapTouches(t){const n=[];for(const a of t)this._el.contains(a.target)&&n.push(a);return n}mergeHandlerResult(t,n,a,c,d){if(!a)return;o.e(t,a);const g={handlerName:c,originalEvent:a.originalEvent||d};a.zoomDelta!==void 0&&(n.zoom=g),a.panDelta!==void 0&&(n.drag=g),a.pitchDelta!==void 0&&(n.pitch=g),a.bearingDelta!==void 0&&(n.rotate=g)}_applyChanges(){const t={},n={},a={};for(const[c,d,g]of this._changes)c.panDelta&&(t.panDelta=(t.panDelta||new o.P(0,0))._add(c.panDelta)),c.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+c.zoomDelta),c.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+c.bearingDelta),c.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+c.pitchDelta),c.around!==void 0&&(t.around=c.around),c.pinchAround!==void 0&&(t.pinchAround=c.pinchAround),c.noInertia&&(t.noInertia=c.noInertia),o.e(n,d),o.e(a,g);this._updateMapTransform(t,n,a),this._changes=[]}_updateMapTransform(t,n,a){const c=this._map,d=c._getTransformForUpdate(),g=c.terrain;if(!(qs(t)||g&&this._terrainMovement))return this._fireEvents(n,a,!0);let{panDelta:y,zoomDelta:b,bearingDelta:S,pitchDelta:A,around:k,pinchAround:L}=t;L!==void 0&&(k=L),c._stop(!0),k=k||c.transform.centerPoint;const q=d.pointLocation(y?k.sub(y):k);S&&(d.bearing+=S),A&&(d.pitch+=A),b&&(d.zoom+=b),g?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?d.center=d.pointLocation(d.centerPoint.sub(y)):d.setLocationAtPoint(q,k):(this._terrainMovement=!0,this._map._elevationFreeze=!0,d.setLocationAtPoint(q,k),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,d.recalculateZoom(c.terrain)})):d.setLocationAtPoint(q,k),c._applyUpdatedTransform(d),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,a,!0)}_fireEvents(t,n,a){const c=js(this._eventsInProgress),d=js(t),g={};for(const A in t){const{originalEvent:k}=t[A];this._eventsInProgress[A]||(g[`${A}start`]=k),this._eventsInProgress[A]=t[A]}!c&&d&&this._fireEvent("movestart",d.originalEvent);for(const A in g)this._fireEvent(A,g[A]);d&&this._fireEvent("move",d.originalEvent);for(const A in t){const{originalEvent:k}=t[A];this._fireEvent(A,k)}const y={};let b;for(const A in this._eventsInProgress){const{handlerName:k,originalEvent:L}=this._eventsInProgress[A];this._handlersById[k].isActive()||(delete this._eventsInProgress[A],b=n[k]||L,y[`${A}end`]=b)}for(const A in y)this._fireEvent(A,y[A]);const S=js(this._eventsInProgress);if(a&&(c||d)&&!S){this._updatingCamera=!0;const A=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),k=L=>L!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new No("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class oc extends o.E{constructor(t,n){super(),this._renderFrameCallback=()=>{const a=Math.min((o.h.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(a)),a<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new o.L(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}panBy(t,n,a){return t=o.P.convert(t).mult(-1),this.panTo(this.transform.center,o.e({offset:t},n),a)}panTo(t,n,a){return this.easeTo(o.e({center:t},n),a)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,a){return this.easeTo(o.e({zoom:t},n),a)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,a){return this.easeTo(o.e({bearing:t},n),a)}resetNorth(t,n){return this.rotateTo(0,o.e({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(o.e({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing()){if(this._zooming&&(a.zoom=o.B.number(c,b,pe)),this._rotating&&(a.bearing=o.B.number(d,S,pe)),this._pitching&&(a.pitch=o.B.number(g,A,pe)),this._padding&&(a.interpolatePadding(y,k,pe),q=a.centerPoint.add(L)),this.terrain&&!t.freezeElevation&&this._updateElevation(pe),K)a.setLocationAtPoint(K,ie);else{const ye=a.zoomScale(a.zoom-c),Te=b>c?Math.min(2,ce):Math.max(.5,ce),we=Math.pow(Te,1-pe),Ae=a.unproject(N.add(ee.mult(pe*we)).mult(ye));a.setLocationAtPoint(a.renderWorldCopies?Ae.wrap():Ae,q)}this._applyUpdatedTransform(a),this._fireMoveEvents(n)},pe=>{this.terrain&&this._finalizeElevation(),this._afterEase(n,pe)},t),this}_prepareEase(t,n,a={}){this._moving=!0,n||a.moving||this.fire(new o.k("movestart",t)),this._zooming&&!a.zooming&&this.fire(new o.k("zoomstart",t)),this._rotating&&!a.rotating&&this.fire(new o.k("rotatestart",t)),this._pitching&&!a.pitching&&this.fire(new o.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&n!==this._elevationTarget){const a=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(a-(n-(a*t+this._elevationStart))/(1-t)),this._elevationTarget=n}this.transform.elevation=o.B.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(t){if(!this.transformCameraUpdate)return;const n=t.clone(),{center:a,zoom:c,pitch:d,bearing:g,elevation:y}=this.transformCameraUpdate(n);a&&(n.center=a),c!==void 0&&(n.zoom=c),d!==void 0&&(n.pitch=d),g!==void 0&&(n.bearing=g),y!==void 0&&(n.elevation=y),this.transform.apply(n)}_fireMoveEvents(t){this.fire(new o.k("move",t)),this._zooming&&this.fire(new o.k("zoom",t)),this._rotating&&this.fire(new o.k("rotate",t)),this._pitching&&this.fire(new o.k("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const a=this._zooming,c=this._rotating,d=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,a&&this.fire(new o.k("zoomend",t)),c&&this.fire(new o.k("rotateend",t)),d&&this.fire(new o.k("pitchend",t)),this.fire(new o.k("moveend",t))}flyTo(t,n){if(!t.essential&&o.h.prefersReducedMotion){const Ue=o.F(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Ue,n)}this.stop(),t=o.e({offset:[0,0],speed:1.2,curve:1.42,easing:o.bb},t);const a=this._getTransformForUpdate(),c=this.getZoom(),d=this.getBearing(),g=this.getPitch(),y=this.getPadding(),b="zoom"in t?o.ad(+t.zoom,a.minZoom,a.maxZoom):c,S="bearing"in t?this._normalizeBearing(t.bearing,d):d,A="pitch"in t?+t.pitch:g,k="padding"in t?t.padding:a.padding,L=a.zoomScale(b-c),q=o.P.convert(t.offset);let j=a.centerPoint.add(q);const G=a.pointLocation(j),N=o.L.convert(t.center||G);this._normalizeCenter(N);const ee=a.project(G),ce=a.project(N).sub(ee);let K=t.curve;const ie=Math.max(a.width,a.height),de=ie/L,pe=ce.mag();if("minZoom"in t){const Ue=o.ad(Math.min(t.minZoom,c,b),a.minZoom,a.maxZoom),Xt=ie/a.zoomScale(Ue-c);K=Math.sqrt(Xt/pe*2)}const ye=K*K;function Te(Ue){const Xt=(de*de-ie*ie+(Ue?-1:1)*ye*ye*pe*pe)/(2*(Ue?de:ie)*ye*pe);return Math.log(Math.sqrt(Xt*Xt+1)-Xt)}function we(Ue){return(Math.exp(Ue)-Math.exp(-Ue))/2}function Ae(Ue){return(Math.exp(Ue)+Math.exp(-Ue))/2}const Ve=Te(!1);let It=function(Ue){return Ae(Ve)/Ae(Ve+K*Ue)},ze=function(Ue){return ie*((Ae(Ve)*(we(Xt=Ve+K*Ue)/Ae(Xt))-we(Ve))/ye)/pe;var Xt},it=(Te(!0)-Ve)/K;if(Math.abs(pe)<1e-6||!isFinite(it)){if(Math.abs(ie-de)<1e-6)return this.easeTo(t,n);const Ue=det.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=d!==S,this._pitching=A!==g,this._padding=!a.isPaddingEqual(k),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(N),this._ease(Ue=>{const Xt=Ue*it,Tt=1/It(Xt);a.zoom=Ue===1?b:c+a.scaleZoom(Tt),this._rotating&&(a.bearing=o.B.number(d,S,Ue)),this._pitching&&(a.pitch=o.B.number(g,A,Ue)),this._padding&&(a.interpolatePadding(y,k,Ue),j=a.centerPoint.add(q)),this.terrain&&!t.freezeElevation&&this._updateElevation(Ue);const _t=Ue===1?N:a.unproject(ee.add(ce.mult(ze(Xt))).mult(Tt));a.setLocationAtPoint(a.renderWorldCopies?_t.wrap():_t,j),this._applyUpdatedTransform(a),this._fireMoveEvents(n)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(n)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const a=this._onEaseEnd;delete this._onEaseEnd,a.call(this,n)}if(!t){const a=this.handlers;a&&a.stop(!1)}return this}_ease(t,n,a){a.animate===!1||a.duration===0?(t(1),n()):(this._easeStart=o.h.now(),this._easeOptions=a,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,n){t=o.b5(t,-180,180);const a=Math.abs(t-n);return Math.abs(t-360-n)180?-360:a<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(o.L.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}class Cr{constructor(t={}){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=n=>{!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"&&n.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options&&this.options.compact,this._container=O.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=O.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=O.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){O.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,n){const a=this._map._getUIString(`AttributionControl.${n}`);t.title=a,t.setAttribute("aria-label",a)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(c=>typeof c!="string"?"":c)):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const c=this._map.style.stylesheet;this.styleOwner=c.owner,this.styleId=c.id}const n=this._map.style.sourceCaches;for(const c in n){const d=n[c];if(d.used||d.usedForTerrain){const g=d.getSource();g.attribution&&t.indexOf(g.attribution)<0&&t.push(g.attribution)}}t=t.filter(c=>String(c).trim()),t.sort((c,d)=>c.length-d.length),t=t.filter((c,d)=>{for(let g=d+1;g=0)return!1;return!0});const a=t.join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class si{constructor(t={}){this._updateCompact=()=>{const n=this._container.children;if(n.length){const a=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&a.classList.add("maplibregl-compact"):a.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=O.create("div","maplibregl-ctrl");const n=O.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){O.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Da{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){const n=this._currentlyRunning,a=n?this._queue.concat(n):this._queue;for(const c of a)if(c.id===t)return void(c.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const a of n)if(!a.cancelled&&(a.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const jo={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var lc=o.Q([{name:"a_pos3d",type:"Int16",components:3}]);class cc extends o.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,n){this.sourceCache.update(t,n),this._renderableTilesKeys=[];const a={};for(const c of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))a[c.key]=!0,this._renderableTilesKeys.push(c.key),this._tiles[c.key]||(c.posMatrix=new Float64Array(16),o.aS(c.posMatrix,0,o.N,0,o.N,0,1),this._tiles[c.key]=new Zi(c,this.tileSize));for(const c in this._tiles)a[c]||delete this._tiles[c]}freeRtt(t){for(const n in this._tiles){const a=this._tiles[n];(!t||a.tileID.equals(t)||a.tileID.isChildOf(t)||t.isChildOf(a.tileID))&&(a.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const n={};for(const a of this._renderableTilesKeys){const c=this._tiles[a].tileID;if(c.canonical.equals(t.canonical)){const d=t.clone();d.posMatrix=new Float64Array(16),o.aS(d.posMatrix,0,o.N,0,o.N,0,1),n[a]=d}else if(c.canonical.isChildOf(t.canonical)){const d=t.clone();d.posMatrix=new Float64Array(16);const g=c.canonical.z-t.canonical.z,y=c.canonical.x-(c.canonical.x>>g<>g<>g;o.aS(d.posMatrix,0,S,0,S,0,1),o.$(d.posMatrix,d.posMatrix,[-y*S,-b*S,0]),n[a]=d}else if(t.canonical.isChildOf(c.canonical)){const d=t.clone();d.posMatrix=new Float64Array(16);const g=t.canonical.z-c.canonical.z,y=t.canonical.x-(t.canonical.x>>g<>g<>g;o.aS(d.posMatrix,0,o.N,0,o.N,0,1),o.$(d.posMatrix,d.posMatrix,[y*S,b*S,0]),o.a0(d.posMatrix,d.posMatrix,[1/2**g,1/2**g,0]),n[a]=d}}return n}getSourceTile(t,n){const a=this.sourceCache._source;let c=t.overscaledZ-this.deltaZoom;if(c>a.maxzoom&&(c=a.maxzoom),c=a.minzoom&&(!d||!d.dem);)d=this.sourceCache.getTileByID(t.scaledTo(c--).key);return d}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(n=>n.timeAdded>=t)}}class uc{constructor(t,n,a){this.painter=t,this.sourceCache=new cc(n),this.options=a,this.exaggeration=typeof a.exaggeration=="number"?a.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,n,a,c=o.N){var d;if(!(n>=0&&n=0&&at.canonical.z&&(t.canonical.z>=c?d=t.canonical.z-c:o.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const g=t.canonical.x-(t.canonical.x>>d<>d<>8<<4|d>>8,n[g+3]=0;const a=new o.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),c=new qe(t,a,t.gl.RGBA,{premultiply:!1});return c.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=c,c}pointCoordinate(t){const n=new Uint8Array(4),a=this.painter.context,c=a.gl;a.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),c.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,c.RGBA,c.UNSIGNED_BYTE,n),a.bindFramebuffer.set(null);const d=n[0]+(n[2]>>4<<8),g=n[1]+((15&n[2])<<8),y=this.coordsIndex[255-n[3]],b=y&&this.sourceCache.getTileByID(y);if(!b)return null;const S=this._coordsTextureSize,A=(1<0&&Math.sign(d)<0||!a&&Math.sign(c)<0&&Math.sign(d)>0?(c=360*Math.sign(d)+c,o.G(c)):n}}class lu{constructor(t,n,a){this._context=t,this._size=n,this._tileSize=a,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const n=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),a=new qe(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return a.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),n.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),n.colorAttachment.set(a.texture),{id:t,fbo:n,texture:a,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(n=>t.id!==n),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length!t.inUse)===!1}}const ar={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class La{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new lu(t.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(a=>!t._layers[a].isHidden(n)),this._coordsDescendingInv={};for(const a in t.sourceCaches){this._coordsDescendingInv[a]={};const c=t.sourceCaches[a].getVisibleCoordinates();for(const d of c){const g=this.terrain.sourceCache.getTerrainCoords(d);for(const y in g)this._coordsDescendingInv[a][y]||(this._coordsDescendingInv[a][y]=[]),this._coordsDescendingInv[a][y].push(g[y])}}this._coordsDescendingInvStr={};for(const a of t._order){const c=t._layers[a],d=c.source;if(ar[c.type]&&!this._coordsDescendingInvStr[d]){this._coordsDescendingInvStr[d]={};for(const g in this._coordsDescendingInv[d])this._coordsDescendingInvStr[d][g]=this._coordsDescendingInv[d][g].map(y=>y.key).sort().join()}}for(const a of this._renderableTiles)for(const c in this._coordsDescendingInvStr){const d=this._coordsDescendingInvStr[c][a.tileID.key];d&&d!==a.rttCoords[c]&&(a.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const n=t.type,a=this.painter,c=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(ar[n]&&(this._prevType&&ar[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!c))return!0;if(ar[this._prevType]||ar[n]&&c){this._prevType=n;const d=this._stacks.length-1,g=this._stacks[d]||[];for(const y of this._renderableTiles){if(this.pool.isFull()&&(yi(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(y),y.rtt[d]){const S=this.pool.getObjectForId(y.rtt[d].id);if(S.stamp===y.rtt[d].stamp){this.pool.useObject(S);continue}}const b=this.pool.getOrCreateFreeObject();this.pool.useObject(b),this.pool.stampObject(b),y.rtt[d]={id:b.id,stamp:b.stamp},a.context.bindFramebuffer.set(b.fbo.framebuffer),a.context.clear({color:o.aT.transparent,stencil:0}),a.currentStencilSource=void 0;for(let S=0;S{u.touchstart=u.dragStart,u.touchmoveWindow=u.dragMove,u.touchend=u.dragEnd},qo={showCompass:!0,showZoom:!0,visualizePitch:!1};class Zo{constructor(t,n,a=!1){this.mousedown=g=>{this.startMouse(o.e({},g,{ctrlKey:!0,preventDefault:()=>g.preventDefault()}),O.mousePos(this.element,g)),O.addEventListener(window,"mousemove",this.mousemove),O.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=g=>{this.moveMouse(g,O.mousePos(this.element,g))},this.mouseup=g=>{this.mouseRotate.dragEnd(g),this.mousePitch&&this.mousePitch.dragEnd(g),this.offTemp()},this.touchstart=g=>{g.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=O.touchPos(this.element,g.targetTouches)[0],this.startTouch(g,this._startPos),O.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),O.addEventListener(window,"touchend",this.touchend))},this.touchmove=g=>{g.targetTouches.length!==1?this.reset():(this._lastPos=O.touchPos(this.element,g.targetTouches)[0],this.moveTouch(g,this._lastPos))},this.touchend=g=>{g.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const c=t.dragRotate._mouseRotate.getClickTolerance(),d=t.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=ys({clickTolerance:c,enable:!0}),this.touchRotate=(({enable:g,clickTolerance:y,bearingDegreesPerPixelMoved:b=.8})=>{const S=new ic;return new vn({clickTolerance:y,move:(A,k)=>({bearingDelta:(k.x-A.x)*b}),moveStateManager:S,enable:g,assignEvents:Zs})})({clickTolerance:c,enable:!0}),this.map=t,a&&(this.mousePitch=bn({clickTolerance:d,enable:!0}),this.touchPitch=(({enable:g,clickTolerance:y,pitchDegreesPerPixelMoved:b=-.5})=>{const S=new ic;return new vn({clickTolerance:y,move:(A,k)=>({pitchDelta:(k.y-A.y)*b}),moveStateManager:S,enable:g,assignEvents:Zs})})({clickTolerance:d,enable:!0})),O.addEventListener(n,"mousedown",this.mousedown),O.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),O.addEventListener(n,"touchcancel",this.reset)}startMouse(t,n){this.mouseRotate.dragStart(t,n),this.mousePitch&&this.mousePitch.dragStart(t,n),O.disableDrag()}startTouch(t,n){this.touchRotate.dragStart(t,n),this.touchPitch&&this.touchPitch.dragStart(t,n),O.disableDrag()}moveMouse(t,n){const a=this.map,{bearingDelta:c}=this.mouseRotate.dragMove(t,n)||{};if(c&&a.setBearing(a.getBearing()+c),this.mousePitch){const{pitchDelta:d}=this.mousePitch.dragMove(t,n)||{};d&&a.setPitch(a.getPitch()+d)}}moveTouch(t,n){const a=this.map,{bearingDelta:c}=this.touchRotate.dragMove(t,n)||{};if(c&&a.setBearing(a.getBearing()+c),this.touchPitch){const{pitchDelta:d}=this.touchPitch.dragMove(t,n)||{};d&&a.setPitch(a.getPitch()+d)}}off(){const t=this.element;O.removeEventListener(t,"mousedown",this.mousedown),O.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),O.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),O.removeEventListener(window,"touchend",this.touchend),O.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){O.enableDrag(),O.removeEventListener(window,"mousemove",this.mousemove),O.removeEventListener(window,"mouseup",this.mouseup),O.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),O.removeEventListener(window,"touchend",this.touchend)}}let Ii;function Go(u,t,n){if(u=new o.L(u.lng,u.lat),t){const a=new o.L(u.lng-360,u.lat),c=new o.L(u.lng+360,u.lat),d=n.locationPoint(u).distSqr(t);n.locationPoint(a).distSqr(t)180;){const a=n.locationPoint(u);if(a.x>=0&&a.y>=0&&a.x<=n.width&&a.y<=n.height)break;u.lng>n.center.lng?u.lng-=360:u.lng+=360}return u}const qr={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function hc(u,t,n){const a=u.classList;for(const c in qr)a.remove(`maplibregl-${n}-anchor-${c}`);a.add(`maplibregl-${n}-anchor-${t}`)}class Kn extends o.E{constructor(t){if(super(),this._onKeyPress=n=>{const a=n.code,c=n.charCode||n.keyCode;a!=="Space"&&a!=="Enter"&&c!==32&&c!==13||this.togglePopup()},this._onMapClick=n=>{const a=n.originalEvent.target,c=this._element;this._popup&&(a===c||c.contains(a))&&this.togglePopup()},this._update=n=>{if(!this._map)return;const a=this._map.loaded()&&!this._map.isMoving();((n==null?void 0:n.type)==="terrain"||(n==null?void 0:n.type)==="render"&&!a)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=Go(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let c="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?c=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(c=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let d="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?d="rotateX(0deg)":this._pitchAlignment==="map"&&(d=`rotateX(${this._map.getPitch()}deg)`),n&&n.type!=="moveend"||(this._pos=this._pos.round()),O.setTransform(this._element,`${qr[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${d} ${c}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const g=this._map.unproject(this._pos),y=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=g.distanceTo(this._lngLat)>20*y?"0.2":"1.0",this._opacityTimeout=null},100))},this._onMove=n=>{if(!this._isDragging){const a=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=a}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new o.k("dragstart"))),this.fire(new o.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new o.k("dragend")),this._state="inactive"},this._addDragHandler=n=>{this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,t&&t.element)this._element=t.element,this._offset=o.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=O.create("div"),this._element.setAttribute("aria-label","Map marker");const n=O.createNS("http://www.w3.org/2000/svg","svg"),a=41,c=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height",`${a}px`),n.setAttributeNS(null,"width",`${c}px`),n.setAttributeNS(null,"viewBox",`0 0 ${c} ${a}`);const d=O.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"stroke","none"),d.setAttributeNS(null,"stroke-width","1"),d.setAttributeNS(null,"fill","none"),d.setAttributeNS(null,"fill-rule","evenodd");const g=O.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"fill-rule","nonzero");const y=O.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(3.0, 29.0)"),y.setAttributeNS(null,"fill","#000000");const b=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const ee of b){const ce=O.createNS("http://www.w3.org/2000/svg","ellipse");ce.setAttributeNS(null,"opacity","0.04"),ce.setAttributeNS(null,"cx","10.5"),ce.setAttributeNS(null,"cy","5.80029008"),ce.setAttributeNS(null,"rx",ee.rx),ce.setAttributeNS(null,"ry",ee.ry),y.appendChild(ce)}const S=O.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"fill",this._color);const A=O.createNS("http://www.w3.org/2000/svg","path");A.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),S.appendChild(A);const k=O.createNS("http://www.w3.org/2000/svg","g");k.setAttributeNS(null,"opacity","0.25"),k.setAttributeNS(null,"fill","#000000");const L=O.createNS("http://www.w3.org/2000/svg","path");L.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),k.appendChild(L);const q=O.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"transform","translate(6.0, 7.0)"),q.setAttributeNS(null,"fill","#FFFFFF");const j=O.createNS("http://www.w3.org/2000/svg","g");j.setAttributeNS(null,"transform","translate(8.0, 8.0)");const G=O.createNS("http://www.w3.org/2000/svg","circle");G.setAttributeNS(null,"fill","#000000"),G.setAttributeNS(null,"opacity","0.25"),G.setAttributeNS(null,"cx","5.5"),G.setAttributeNS(null,"cy","5.5"),G.setAttributeNS(null,"r","5.4999962");const N=O.createNS("http://www.w3.org/2000/svg","circle");N.setAttributeNS(null,"fill","#FFFFFF"),N.setAttributeNS(null,"cx","5.5"),N.setAttributeNS(null,"cy","5.5"),N.setAttributeNS(null,"r","5.4999962"),j.appendChild(G),j.appendChild(N),g.appendChild(y),g.appendChild(S),g.appendChild(k),g.appendChild(q),g.appendChild(j),n.appendChild(g),n.setAttributeNS(null,"height",a*this._scale+"px"),n.setAttributeNS(null,"width",c*this._scale+"px"),this._element.appendChild(n),this._offset=o.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",n=>{n.preventDefault()}),this._element.addEventListener("mousedown",n=>{n.preventDefault()}),hc(this._element,this._anchor,"marker"),t&&t.className)for(const n of t.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),O.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=o.L.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const c=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[c,-1*(38.1-13.5+c)],"bottom-right":[-c,-1*(38.1-13.5+c)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this}getOffset(){return this._offset}setOffset(t){return this._offset=o.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const xi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let mi=0,vs=!1;const Gs={maxWidth:100,unit:"metric"};function Hs(u,t,n){const a=n&&n.maxWidth||100,c=u._container.clientHeight/2,d=u.unproject([0,c]),g=u.unproject([a,c]),y=d.distanceTo(g);if(n&&n.unit==="imperial"){const b=3.2808*y;b>5280?Jn(t,a,b/5280,u._getUIString("ScaleControl.Miles")):Jn(t,a,b,u._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?Jn(t,a,y/1852,u._getUIString("ScaleControl.NauticalMiles")):y>=1e3?Jn(t,a,y/1e3,u._getUIString("ScaleControl.Kilometers")):Jn(t,a,y,u._getUIString("ScaleControl.Meters"))}function Jn(u,t,n,a){const c=function(d){const g=Math.pow(10,`${Math.floor(d)}`.length-1);let y=d/g;return y=y>=10?10:y>=5?5:y>=3?3:y>=2?2:y>=1?1:function(b){const S=Math.pow(10,Math.ceil(-Math.log(b)/Math.LN10));return Math.round(b*S)/S}(y),g*y}(n);u.style.width=t*(c/n)+"px",u.innerHTML=`${c} ${a}`}const Ho={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Wo=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function bs(u){if(u){if(typeof u=="number"){const t=Math.round(Math.abs(u)/Math.SQRT2);return{center:new o.P(0,0),top:new o.P(0,u),"top-left":new o.P(t,t),"top-right":new o.P(-t,t),bottom:new o.P(0,-u),"bottom-left":new o.P(t,-t),"bottom-right":new o.P(-t,-t),left:new o.P(u,0),right:new o.P(-u,0)}}if(u instanceof o.P||Array.isArray(u)){const t=o.P.convert(u);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:o.P.convert(u.center||[0,0]),top:o.P.convert(u.top||[0,0]),"top-left":o.P.convert(u["top-left"]||[0,0]),"top-right":o.P.convert(u["top-right"]||[0,0]),bottom:o.P.convert(u.bottom||[0,0]),"bottom-left":o.P.convert(u["bottom-left"]||[0,0]),"bottom-right":o.P.convert(u["bottom-right"]||[0,0]),left:o.P.convert(u.left||[0,0]),right:o.P.convert(u.right||[0,0])}}return bs(new o.P(0,0))}const Xo={extend:(u,...t)=>o.e(u,...t),run(u){u()},logToElement(u,t=!1,n="log"){const a=window.document.getElementById(n);a&&(t&&(a.innerHTML=""),a.innerHTML+=`
${u}`)}},Ko=te;class qt{static get version(){return Ko}static get workerCount(){return rn.workerCount}static set workerCount(t){rn.workerCount=t}static get maxParallelImageRequests(){return o.c.MAX_PARALLEL_IMAGE_REQUESTS}static set maxParallelImageRequests(t){o.c.MAX_PARALLEL_IMAGE_REQUESTS=t}static get workerUrl(){return o.c.WORKER_URL}static set workerUrl(t){o.c.WORKER_URL=t}static addProtocol(t,n){o.c.REGISTERED_PROTOCOLS[t]=n}static removeProtocol(t){delete o.c.REGISTERED_PROTOCOLS[t]}}return qt.Map=class extends oc{constructor(u){if(o.bg.mark(o.bh.create),(u=o.e({},tt,u)).minZoom!=null&&u.maxZoom!=null&&u.minZoom>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(super(new Ca(u.minZoom,u.maxZoom,u.minPitch,u.maxPitch,u.renderWorldCopies),{bearingSnap:u.bearingSnap}),this._cooperativeGesturesOnWheel=t=>{this._onCooperativeGesture(t,t[this._metaKey],1)},this._contextLost=t=>{t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new o.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new o.k("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=u.interactive,this._cooperativeGestures=u.cooperativeGestures,this._metaKey=navigator.platform.indexOf("Mac")===0?"metaKey":"ctrlKey",this._maxTileCacheSize=u.maxTileCacheSize,this._maxTileCacheZoomLevels=u.maxTileCacheZoomLevels,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._crossSourceCollisions=u.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=u.collectResourceTiming,this._renderTaskQueue=new Da,this._controls=[],this._mapId=o.a2(),this._locale=o.e({},jo,u.locale),this._clickTolerance=u.clickTolerance,this._overridePixelRatio=u.pixelRatio,this._maxCanvasSize=u.maxCanvasSize,this.transformCameraUpdate=u.transformCameraUpdate,this._imageQueueHandle=Ge.addThrottleControl(()=>this.isMoving()),this._requestManager=new Je(u.transformRequest),typeof u.container=="string"){if(this._container=document.getElementById(u.container),!this._container)throw new Error(`Container '${u.container}' not found.`)}else{if(!(u.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=u.container}if(u.maxBounds&&this.setMaxBounds(u.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let t=!1;const n=Xn(a=>{this._trackResize&&!this._removed&&this.resize(a)._update()},50);this._resizeObserver=new ResizeObserver(a=>{t?n(a):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Uo(this,u),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=u.hash&&new Vs(typeof u.hash=="string"&&u.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:u.center,zoom:u.zoom,bearing:u.bearing,pitch:u.pitch}),u.bounds&&(this.resize(),this.fitBounds(u.bounds,o.e({},u.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=u.localIdeographFontFamily,this._validateStyle=u.validateStyle,u.style&&this.setStyle(u.style,{localIdeographFontFamily:u.localIdeographFontFamily}),u.attributionControl&&this.addControl(new Cr({customAttribution:u.customAttribution})),u.maplibreLogo&&this.addControl(new si,u.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this._update(t.dataType==="style"),this.fire(new o.k(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new o.k(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new o.k("sourcedataabort",t))})}_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 o.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=u.onAdd(this);this._controls.push(u);const a=this._controlPositions[t];return t.indexOf("bottom")!==-1?a.insertBefore(n,a.firstChild):a.appendChild(n),this}removeControl(u){if(!u||!u.onRemove)return this.fire(new o.j(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}calculateCameraOptionsFromTo(u,t,n,a){return a==null&&this.terrain&&(a=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(u,t,n,a)}resize(u){var t;const n=this._containerDimensions(),a=n[0],c=n[1],d=this._getClampedPixelRatio(a,c);if(this._resizeCanvas(a,c,d),this.painter.resize(a,c,d),this.painter.overLimit()){const y=this.painter.context.gl;this._maxCanvasSize=[y.drawingBufferWidth,y.drawingBufferHeight];const b=this._getClampedPixelRatio(a,c);this._resizeCanvas(a,c,b),this.painter.resize(a,c,b)}this.transform.resize(a,c),(t=this._requestedCameraState)===null||t===void 0||t.resize(a,c);const g=!this._moving;return g&&(this.stop(),this.fire(new o.k("movestart",u)).fire(new o.k("move",u))),this.fire(new o.k("resize",u)),g&&this.fire(new o.k("moveend",u)),this}_getClampedPixelRatio(u,t){const{0:n,1:a}=this._maxCanvasSize,c=this.getPixelRatio(),d=u*c,g=t*c;return Math.min(d>n?n/d:1,g>a?a/g:1)*c}getPixelRatio(){var u;return(u=this._overridePixelRatio)!==null&&u!==void 0?u:devicePixelRatio}setPixelRatio(u){this._overridePixelRatio=u,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(u){return this.transform.setMaxBounds(yt.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;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;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(u){return this.transform.renderWorldCopies=u,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(u){return this._cooperativeGestures=u,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(u){return this.transform.locationPoint(o.L.convert(u),this.style&&this.terrain)}unproject(u){return this.transform.pointLocation(o.P.convert(u),this.terrain)}isMoving(){var u;return this._moving||((u=this.handlers)===null||u===void 0?void 0:u.isMoving())}isZooming(){var u;return this._zooming||((u=this.handlers)===null||u===void 0?void 0:u.isZooming())}isRotating(){var u;return this._rotating||((u=this.handlers)===null||u===void 0?void 0:u.isRotating())}_createDelegatedListener(u,t,n){if(u==="mouseenter"||u==="mouseover"){let a=!1;return{layer:t,listener:n,delegates:{mousemove:d=>{const g=this.getLayer(t)?this.queryRenderedFeatures(d.point,{layers:[t]}):[];g.length?a||(a=!0,n.call(this,new kr(u,this,d.originalEvent,{features:g}))):a=!1},mouseout:()=>{a=!1}}}}if(u==="mouseleave"||u==="mouseout"){let a=!1;return{layer:t,listener:n,delegates:{mousemove:g=>{(this.getLayer(t)?this.queryRenderedFeatures(g.point,{layers:[t]}):[]).length?a=!0:a&&(a=!1,n.call(this,new kr(u,this,g.originalEvent)))},mouseout:g=>{a&&(a=!1,n.call(this,new kr(u,this,g.originalEvent)))}}}}{const a=c=>{const d=this.getLayer(t)?this.queryRenderedFeatures(c.point,{layers:[t]}):[];d.length&&(c.features=d,n.call(this,c),delete c.features)};return{layer:t,listener:n,delegates:{[u]:a}}}}on(u,t,n){if(n===void 0)return super.on(u,t);const a=this._createDelegatedListener(u,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[u]=this._delegatedListeners[u]||[],this._delegatedListeners[u].push(a);for(const c in a.delegates)this.on(c,a.delegates[c]);return this}once(u,t,n){if(n===void 0)return super.once(u,t);const a=this._createDelegatedListener(u,t,n);for(const c in a.delegates)this.once(c,a.delegates[c]);return this}off(u,t,n){return n===void 0?super.off(u,t):(this._delegatedListeners&&this._delegatedListeners[u]&&(a=>{const c=this._delegatedListeners[u];for(let d=0;dthis._updateStyle(u,t));const n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!u)),u?(this.style=new Hi(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof u=="string"?this.style.loadURL(u,t,n):this.style.loadJSON(u,t,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Hi(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(u,t){if(typeof u=="string"){const n=this._requestManager.transformRequest(u,et.Style);o.f(n,(a,c)=>{a?this.fire(new o.j(a)):c&&this._updateDiff(c,t)})}else typeof u=="object"&&this._updateDiff(u,t)}_updateDiff(u,t){try{this.style.setState(u,t)&&this._update(!0)}catch(n){o.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(u,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():o.w("There is no style added to the map.")}addSource(u,t){return this._lazyInitEmptyStyle(),this.style.addSource(u,t),this._update(!0)}isSourceLoaded(u){const t=this.style&&this.style.sourceCaches[u];if(t!==void 0)return t.loaded();this.fire(new o.j(new Error(`There is no source with ID '${u}'`)))}setTerrain(u){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),u){const t=this.style.sourceCaches[u.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${u.source}`);for(const n in this.style._layers){const a=this.style._layers[n];a.type==="hillshade"&&a.source===u.source&&o.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new uc(this.painter,t,u),this.painter.renderToTexture=new La(this.painter,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=n=>{n.dataType==="style"?this.terrain.sourceCache.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId!==u.source||this._elevationFreeze||(this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0;return this.fire(new o.k("terrain",{terrain:u})),this}getTerrain(){var u,t;return(t=(u=this.terrain)===null||u===void 0?void 0:u.options)!==null&&t!==void 0?t:null}areTilesLoaded(){const u=this.style&&this.style.sourceCaches;for(const t in u){const n=u[t]._tiles;for(const a in n){const c=n[a];if(c.state!=="loaded"&&c.state!=="errored")return!1}}return!0}addSourceType(u,t,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(u,t,n)}removeSource(u){return this.style.removeSource(u),this._update(!0)}getSource(u){return this.style.getSource(u)}addImage(u,t,n={}){const{pixelRatio:a=1,sdf:c=!1,stretchX:d,stretchY:g,content:y}=n;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||o.a(t))){if(t.width===void 0||t.height===void 0)return this.fire(new o.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:b,height:S,data:A}=t,k=t;return this.style.addImage(u,{data:new o.R({width:b,height:S},new Uint8Array(A)),pixelRatio:a,stretchX:d,stretchY:g,content:y,sdf:c,version:0,userImage:k}),k.onAdd&&k.onAdd(this,u),this}}{const{width:b,height:S,data:A}=o.h.getImageData(t);this.style.addImage(u,{data:new o.R({width:b,height:S},A),pixelRatio:a,stretchX:d,stretchY:g,content:y,sdf:c,version:0})}}updateImage(u,t){const n=this.style.getImage(u);if(!n)return this.fire(new o.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const a=t instanceof HTMLImageElement||o.a(t)?o.h.getImageData(t):t,{width:c,height:d,data:g}=a;if(c===void 0||d===void 0)return this.fire(new o.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(c!==n.data.width||d!==n.data.height)return this.fire(new o.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const y=!(t instanceof HTMLImageElement||o.a(t));return n.data.replace(g,y),this.style.updateImage(u,n),this}getImage(u){return this.style.getImage(u)}hasImage(u){return u?!!this.style.getImage(u):(this.fire(new o.j(new Error("Missing required image id"))),!1)}removeImage(u){this.style.removeImage(u)}loadImage(u,t){Ge.getImage(this._requestManager.transformRequest(u,et.Image),t)}listImages(){return this.style.listImages()}addLayer(u,t){return this._lazyInitEmptyStyle(),this.style.addLayer(u,t),this._update(!0)}moveLayer(u,t){return this.style.moveLayer(u,t),this._update(!0)}removeLayer(u){return this.style.removeLayer(u),this._update(!0)}getLayer(u){return this.style.getLayer(u)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(u,t,n){return this.style.setLayerZoomRange(u,t,n),this._update(!0)}setFilter(u,t,n={}){return this.style.setFilter(u,t,n),this._update(!0)}getFilter(u){return this.style.getFilter(u)}setPaintProperty(u,t,n,a={}){return this.style.setPaintProperty(u,t,n,a),this._update(!0)}getPaintProperty(u,t){return this.style.getPaintProperty(u,t)}setLayoutProperty(u,t,n,a={}){return this.style.setLayoutProperty(u,t,n,a),this._update(!0)}getLayoutProperty(u,t){return this.style.getLayoutProperty(u,t)}setGlyphs(u,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(u,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(u,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(u,t,n,a=>{a||this._update(!0)}),this}removeSprite(u){return this._lazyInitEmptyStyle(),this.style.removeSprite(u),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(u,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(u,t,n=>{n||this._update(!0)}),this}setLight(u,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(u,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(u,t){return this.style.setFeatureState(u,t),this._update()}removeFeatureState(u,t){return this.style.removeFeatureState(u,t),this._update()}getFeatureState(u){return this.style.getFeatureState(u)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let u=0,t=0;return this._container&&(u=this._container.clientWidth||400,t=this._container.clientHeight||300),[u,t]}_setupContainer(){const u=this._container;u.classList.add("maplibregl-map");const t=this._canvasContainer=O.create("div","maplibregl-canvas-container",u);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=O.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const n=this._containerDimensions(),a=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],a);const c=this._controlContainer=O.create("div","maplibregl-control-container",u),d=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(g=>{d[g]=O.create("div",`maplibregl-ctrl-${g} `,c)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){this._cooperativeGesturesScreen=O.create("div","maplibregl-cooperative-gesture-screen",this._container);let u=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(u=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use ⌘ + scroll to zoom the map"),this._cooperativeGesturesScreen.innerHTML=` -
${u}
-
${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
- `,this._cooperativeGesturesScreen.setAttribute("aria-hidden","true"),this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){O.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(u,t,n){this._canvas.width=Math.floor(n*u),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${u}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const u={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",a=>{t={requestedAttributes:u},a&&(t.statusMessage=a.statusMessage,t.type=a.type)},{once:!0});const n=this._canvas.getContext("webgl2",u)||this._canvas.getContext("webgl",u);if(!n){const a="Failed to initialize WebGL";throw t?(t.message=a,new Error(JSON.stringify(t))):new Error(a)}this.painter=new Wn(n,this.transform),ne.testSupport(n)}_onCooperativeGesture(u,t,n){return!t&&n<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(u){return this.style&&this.style._loaded?(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)}_render(u){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(u),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const c=this.transform.zoom,d=o.h.now();this.style.zoomHistory.update(c,d);const g=new o.a8(c,{now:d,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),y=g.crossFadingFactor();y===1&&y===this._crossFadingFactor||(n=!0,this._crossFadingFactor=y),this.style.update(g)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new o.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,o.bg.mark(o.bh.load),this.fire(new o.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const a=this._sourcesDirty||this._styleDirty||this._placementDirty;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new o.k("idle")),!this._loaded||this._fullyLoaded||a||(this._fullyLoaded=!0,o.bg.mark(o.bh.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var u;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),Ge.removeThrottleControl(this._imageQueueHandle),(u=this._resizeObserver)===null||u===void 0||u.disconnect();const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),O.remove(this._canvasContainer),O.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),o.bg.clearMetrics(),this._removed=!0,this.fire(new o.k("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=o.h.frame(u=>{o.bg.frame(u),this._frame=null,this._render(u)}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(u){this._showTileBoundaries!==u&&(this._showTileBoundaries=u,this._update())}get showPadding(){return!!this._showPadding}set showPadding(u){this._showPadding!==u&&(this._showPadding=u,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(u){this._showCollisionBoxes!==u&&(this._showCollisionBoxes=u,u?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(u){this._showOverdrawInspector!==u&&(this._showOverdrawInspector=u,this._update())}get repaint(){return!!this._repaint}set repaint(u){this._repaint!==u&&(this._repaint=u,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(u){this._vertices=u,this._update()}get version(){return Ze}getCameraTargetElevation(){return this.transform.elevation}},qt.NavigationControl=class{constructor(u){this._updateZoomButtons=()=>{const t=this._map.getZoom(),n=t===this._map.getMaxZoom(),a=t===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=a,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",a.toString())},this._rotateCompassArrow=()=>{const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t},this._setButtonTitle=(t,n)=>{const a=this._map._getUIString(`NavigationControl.${n}`);t.title=a,t.setAttribute("aria-label",a)},this.options=o.e({},qo,u),this._container=O.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),O.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),O.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=O.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(u){return this._map=u,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Zo(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){O.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(u,t){const n=O.create("button",u,this._container);return n.type="button",n.addEventListener("click",t),n}},qt.GeolocateControl=class extends o.E{constructor(u){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new o.k("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(t),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new o.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const n=new o.L(t.coords.longitude,t.coords.latitude),a=t.coords.accuracy,c=this._map.getBearing(),d=o.e({bearing:c},this.options.fitBoundsOptions),g=yt.fromLngLat(n,a);this._map.fitBounds(g,d,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const n=new o.L(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)if(t.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&vs)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new o.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=t=>{if(this._map){if(this._container.addEventListener("contextmenu",n=>n.preventDefault()),this._geolocateButton=O.create("button","maplibregl-ctrl-geolocate",this._container),O.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!1){o.w("Geolocation support is not available so the GeolocateControl will be disabled.");const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{const n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=O.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Kn({element:this._dotElement}),this._circleElement=O.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Kn({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",n=>{n.geolocateSource||this._watchState!=="ACTIVE_LOCK"||n.originalEvent&&n.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new o.k("trackuserlocationend")))})}},this.options=o.e({},xi,u)}onAdd(u){return this._map=u,this._container=O.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(t,n=!1){Ii===void 0||n?window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(a=>{Ii=a.state!=="denied",t(Ii)}).catch(()=>{Ii=!!window.navigator.geolocation,t(Ii)}):(Ii=!!window.navigator.geolocation,t(Ii)):t(Ii)}(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),O.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,mi=0,vs=!1}_isOutOfMapMaxBounds(u){const t=this._map.getMaxBounds(),n=u.coords;return t&&(n.longitudet.getEast()||n.latitudet.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const u=this._map.getBounds(),t=u.getSouthEast(),n=u.getNorthEast(),a=t.distanceTo(n),c=Math.ceil(this._accuracy/(a/this._map._container.clientHeight)*2);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}trigger(){if(!this._setup)return o.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 o.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":mi--,vs=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new o.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new o.k("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let u;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),mi++,mi>1?(u={maximumAge:6e5,timeout:0},vs=!0):(u=this.options.positionOptions,vs=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,u)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},qt.AttributionControl=Cr,qt.LogoControl=si,qt.ScaleControl=class{constructor(u){this._onMove=()=>{Hs(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Hs(this._map,this._container,this.options)},this.options=o.e({},Gs,u)}getDefaultPosition(){return"bottom-left"}onAdd(u){return this._map=u,this._container=O.create("div","maplibregl-ctrl maplibregl-ctrl-scale",u.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){O.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},qt.FullscreenControl=class extends o.E{constructor(u={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,u&&u.container&&(u.container instanceof HTMLElement?this._container=u.container:o.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(u){return this._map=u,this._container||(this._container=this._map.getContainer()),this._controlContainer=O.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){O.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const u=this._fullscreenButton=O.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);O.create("span","maplibregl-ctrl-icon",u).setAttribute("aria-hidden","true"),u.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const u=this._getTitle();this._fullscreenButton.setAttribute("aria-label",u),this._fullscreenButton.title=u}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new o.k("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new o.k("fullscreenend")),this._prevCooperativeGestures&&(this._map.setCooperativeGestures(this._prevCooperativeGestures),delete this._prevCooperativeGestures))}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},qt.TerrainControl=class{constructor(u){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))},this.options=u}onAdd(u){return this._map=u,this._container=O.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=O.create("button","maplibregl-ctrl-terrain",this._container),O.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){O.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},qt.Popup=class extends o.E{constructor(u){super(),this.remove=()=>(this._content&&O.remove(this._content),this._container&&(O.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new o.k("close")),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=O.create("div","maplibregl-popup",this._map.getContainer()),this._tip=O.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const g of this.options.className.split(" "))this._container.classList.add(g);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Go(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!t)return;const n=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);let a=this.options.anchor;const c=bs(this.options.offset);if(!a){const g=this._container.offsetWidth,y=this._container.offsetHeight;let b;b=n.y+c.bottom.ythis._map.transform.height-y?["bottom"]:[],n.xthis._map.transform.width-g/2&&b.push("right"),a=b.length===0?"bottom":b.join("-")}const d=n.add(c[a]).round();O.setTransform(this._container,`${qr[a]} translate(${d.x}px,${d.y}px)`),hc(this._container,a,"popup")},this._onClose=()=>{this.remove()},this.options=o.e(Object.create(Ho),u)}addTo(u){return this._map&&this.remove(),this._map=u,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new o.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(u){return this._lngLat=o.L.convert(u),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(u){return this.setDOMContent(document.createTextNode(u))}setHTML(u){const t=document.createDocumentFragment(),n=document.createElement("body");let a;for(n.innerHTML=u;a=n.firstChild,a;)t.appendChild(a);return this.setDOMContent(t)}getMaxWidth(){var u;return(u=this._container)===null||u===void 0?void 0:u.style.maxWidth}setMaxWidth(u){return this.options.maxWidth=u,this._update(),this}setDOMContent(u){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=O.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(u),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(u){this._container&&this._container.classList.add(u)}removeClassName(u){this._container&&this._container.classList.remove(u)}setOffset(u){return this.options.offset=u,this._update(),this}toggleClassName(u){if(this._container)return this._container.classList.toggle(u)}_createCloseButton(){this.options.closeButton&&(this._closeButton=O.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const u=this._container.querySelector(Wo);u&&u.focus()}},qt.Marker=Kn,qt.Style=Hi,qt.LngLat=o.L,qt.LngLatBounds=yt,qt.Point=o.P,qt.MercatorCoordinate=o.U,qt.Evented=o.E,qt.AJAXError=o.bi,qt.config=o.c,qt.CanvasSource=Yi,qt.GeoJSONSource=nt,qt.ImageSource=Jt,qt.RasterDEMTileSource=Ie,qt.RasterTileSource=ti,qt.VectorTileSource=ki,qt.VideoSource=nr,qt.setRTLTextPlugin=o.bj,qt.getRTLTextPluginStatus=o.bk,qt.prewarm=function(){aa().acquire(Nt)},qt.clearPrewarmedResources=function(){const u=fn;u&&(u.isPreloaded()&&u.numActive()===1?(u.release(Nt),fn=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},Xo.extend(qt,{isSafari:o.ac,getPerformanceMetrics:o.bg.getPerformanceMetrics}),qt});var F=M;return F})})(ef);var m_=ef.exports;const Cn=f_(m_);function lp(f){let _;return v=>{if(v)for(let w in v){let M=_==null?void 0:_[w],z=v[w];M!==z&&f(w,z,M)}else if(_)for(let w in _)f(w,void 0,_[w]);_=v}}function g_(f,..._){let v=[f];for(let w of _)if(w)Array.isArray(w)&&w[0]===f?v.push(...w.slice(1)):v.push(w);else continue;if(v.length!==1)return v.length===2?v[1]:v}function __(f){return f===!0?["has","point_count"]:f===!1?["!",["has","point_count"]]:void 0}function _y(f,_){return["case",["boolean",["feature-state","hover"],!1],_,f]}var rf=y_;function y_(f){var _,v,w;if(f){if(Array.isArray(f)){for(_=[],v=f.length,w=0;w{w=null}),ao())},i(M){v||(ei(w),v=!0)},o(M){vi(w),v=!1},d(M){M&&Mt(_),w&&w.d(M)}}}function v_(f,_,v){let w,M,z,F,o,te,O,ne,le,ge,We,He,{$$slots:vt={},$$scope:Ge}=_,{id:et=$p("layer")}=_,{source:Je=void 0}=_,{sourceLayer:Ye=void 0}=_,{beforeId:bt=void 0}=_,{beforeLayerType:ht=void 0}=_,{type:zt}=_,{paint:st=void 0}=_,{layout:dt=void 0}=_,{filter:mt=void 0}=_,{applyToClusters:qe=void 0}=_,{minzoom:ve=void 0}=_,{maxzoom:rt=void 0}=_,{manageHoverState:gt=!1}=_,{hovered:lt=null}=_,{interactive:pt=!0}=_,{hoverCursor:$e=void 0}=_,{eventsIfTopMost:Ht=!1}=_;const Pt=Lp(),{map:Ji,source:dr,self:Kt,minzoom:Ot,maxzoom:yt,eventTopMost:Rt,layerInfo:ki}=h_();Br(f,Ji,ue=>v(31,le=ue)),Br(f,dr,ue=>v(32,ge=ue)),Br(f,Kt,ue=>v(0,ne=ue)),Br(f,Ot,ue=>v(34,He=ue)),Br(f,yt,ue=>v(33,We=ue)),sa(()=>{ne&&le&&(ki.delete(ne),le==null||le.removeLayer(ne))});let ti;function Ie(ue){var Pi,Zi;if(!pt||!ne||!le||Ht&&Rt(ue)!==ne)return;let Vt=ue.features??[],Ui=(Zi=(Pi=Vt[0])==null?void 0:Pi.properties)==null?void 0:Zi.cluster_id,qi={event:ue,map:le,clusterId:Ui,layer:ne,source:o,features:Vt};Pt(ue.type,qi)}function nt(ue){var Pi,Zi;if(!pt||!ne||!le||Ht&&Rt(ue)!==ne)return;$e&&(le.getCanvas().style.cursor=$e);let Vt=ue.features??[];v(6,lt=Vt[0]??null);let Ui=(Zi=(Pi=Vt[0])==null?void 0:Pi.properties)==null?void 0:Zi.cluster_id;Pt("mouseenter",{event:ue,map:le,clusterId:Ui,layer:ne,source:o,features:Vt})}function St(ue){var Pi,Zi,tn;if(!pt||!le)return;if(Ht&&Rt(ue)!==ne){v(6,lt=null),gt&&ti!==void 0&&(le==null||le.setFeatureState({source:o,sourceLayer:Ye,id:ti},{hover:!1}),ti=void 0);return}le.getCanvas().style.cursor=$e;let Vt=ue.features??[],Ui=(Zi=(Pi=Vt[0])==null?void 0:Pi.properties)==null?void 0:Zi.cluster_id,qi=(tn=Vt[0])==null?void 0:tn.id;qi!==ti&&(gt&&(ti!==void 0&&(le==null||le.setFeatureState({source:o,id:ti,sourceLayer:Ye},{hover:!1})),le==null||le.setFeatureState({source:o,id:qi,sourceLayer:Ye},{hover:!0})),ti=qi,v(6,lt=Vt[0]??null)),Pt("mousemove",{event:ue,map:le,clusterId:Ui,layer:ne,source:o,features:Vt})}function Jt(ue){if(!(!pt||!ne||!le)){if($e&&(le.getCanvas().style.cursor=""),v(6,lt=null),gt&&ti!==void 0){const Vt={source:o,id:ti,sourceLayer:Ye};le==null||le.setFeatureState(Vt,{hover:!1}),ti=void 0}Pt("mouseleave",{map:le,layer:ne,source:o})}}let nr=!0;function Yi(ue){le&&(le.off("click",ue,Ie),le.off("dblclick",ue,Ie),le.off("contextmenu",ue,Ie),le.off("mouseenter",ue,nt),le.off("mousemove",ue,St),le.off("mouseleave",ue,Jt))}return sa(()=>{le&&ne&&Yi(ne)}),f.$$set=ue=>{"id"in ue&&v(7,et=ue.id),"source"in ue&&v(8,Je=ue.source),"sourceLayer"in ue&&v(9,Ye=ue.sourceLayer),"beforeId"in ue&&v(10,bt=ue.beforeId),"beforeLayerType"in ue&&v(11,ht=ue.beforeLayerType),"type"in ue&&v(12,zt=ue.type),"paint"in ue&&v(13,st=ue.paint),"layout"in ue&&v(14,dt=ue.layout),"filter"in ue&&v(15,mt=ue.filter),"applyToClusters"in ue&&v(16,qe=ue.applyToClusters),"minzoom"in ue&&v(17,ve=ue.minzoom),"maxzoom"in ue&&v(18,rt=ue.maxzoom),"manageHoverState"in ue&&v(19,gt=ue.manageHoverState),"hovered"in ue&&v(6,lt=ue.hovered),"interactive"in ue&&v(20,pt=ue.interactive),"hoverCursor"in ue&&v(21,$e=ue.hoverCursor),"eventsIfTopMost"in ue&&v(22,Ht=ue.eventsIfTopMost),"$$scope"in ue&&v(35,Ge=ue.$$scope)},f.$$.update=()=>{if(f.$$.dirty[0]&65536&&v(30,w=__(qe)),f.$$.dirty[0]&1073774592&&v(24,M=g_("all",w,mt)),f.$$.dirty[0]&131072|f.$$.dirty[1]&8&&v(26,z=ve??He),f.$$.dirty[0]&262144|f.$$.dirty[1]&4&&v(25,F=rt??We),f.$$.dirty[0]&256|f.$$.dirty[1]&2&&v(29,o=Je||ge),f.$$.dirty[0]&654343809|f.$$.dirty[1]&1&&le&&ne!==et&&o){ne&&(Yi(ne),ki.delete(ne));let ue=bt;if(!bt&&ht){let Vt=le.getStyle().layers,Ui=typeof ht=="function"?ht:Pi=>Pi.type===ht,qi=Vt==null?void 0:Vt.find(Ui);qi&&(ue=qi.id)}Uc(Kt,ne=et,ne),le.addLayer(rf({id:ne,type:zt,source:o,"source-layer":Ye,filter:M,paint:st,layout:dt,minzoom:z,maxzoom:F}),ue),v(23,nr=!0),le.on("click",ne,Ie),le.on("dblclick",ne,Ie),le.on("contextmenu",ne,Ie),le.on("mouseenter",ne,nt),le.on("mousemove",ne,St),le.on("mouseleave",ne,Jt)}f.$$.dirty[0]&1048577&&ne&&ki.set(ne,{interactive:pt}),f.$$.dirty[0]&1|f.$$.dirty[1]&1&&v(28,te=ne?lp((ue,Vt)=>le==null?void 0:le.setPaintProperty(ne,ue,Vt)):void 0),f.$$.dirty[0]&1|f.$$.dirty[1]&1&&v(27,O=ne?lp((ue,Vt)=>le==null?void 0:le.setLayoutProperty(ne,ue,Vt)):void 0),f.$$.dirty[0]&268443648&&(te==null||te(st)),f.$$.dirty[0]&134234112&&(O==null||O(dt)),f.$$.dirty[0]&100663297|f.$$.dirty[1]&1&&ne&&(le==null||le.setLayerZoomRange(ne,z,F)),f.$$.dirty[0]&25165825|f.$$.dirty[1]&1&&ne&&(nr?v(23,nr=!1):le==null||le.setFilter(ne,M))},[ne,Ji,dr,Kt,Ot,yt,lt,et,Je,Ye,bt,ht,zt,st,dt,mt,qe,ve,rt,gt,pt,$e,Ht,nr,M,F,z,O,te,o,w,le,ge,We,He,Ge,vt]}class b_ extends en{constructor(_){super(),$r(this,_,v_,x_,Rr,{id:7,source:8,sourceLayer:9,beforeId:10,beforeLayerType:11,type:12,paint:13,layout:14,filter:15,applyToClusters:16,minzoom:17,maxzoom:18,manageHoverState:19,hovered:6,interactive:20,hoverCursor:21,eventsIfTopMost:22},null,[-1,-1])}}function w_(f,_,v){let w;const{map:M}=oo();Br(f,M,te=>v(4,w=te));let{position:z="top-left"}=_,{container:F=void 0}=_,o=null;return sa(()=>{w!=null&&w.loaded()&&o&&w.removeControl(o)}),f.$$set=te=>{"position"in te&&v(1,z=te.position),"container"in te&&v(2,F=te.container)},f.$$.update=()=>{if(f.$$.dirty&30&&w&&!o){let te;typeof F=="string"?te=document.querySelector(F)??void 0:te=F,v(3,o=new Cn.FullscreenControl({container:te})),w.addControl(o,z)}},[M,z,F,o,w]}class T_ extends en{constructor(_){super(),$r(this,_,w_,null,Rr,{position:1,container:2})}}function S_(f,_,v){let w;const{map:M}=oo();Br(f,M,ge=>v(8,w=ge));let{position:z="top-left"}=_,{positionOptions:F=void 0}=_,{fitBoundsOptions:o=void 0}=_,{trackUserLocation:te=!1}=_,{showAccuracyCircle:O=!0}=_,{showUserLocation:ne=!0}=_,le=null;return sa(()=>{w!=null&&w.loaded()&&le&&w.removeControl(le)}),f.$$set=ge=>{"position"in ge&&v(1,z=ge.position),"positionOptions"in ge&&v(2,F=ge.positionOptions),"fitBoundsOptions"in ge&&v(3,o=ge.fitBoundsOptions),"trackUserLocation"in ge&&v(4,te=ge.trackUserLocation),"showAccuracyCircle"in ge&&v(5,O=ge.showAccuracyCircle),"showUserLocation"in ge&&v(6,ne=ge.showUserLocation)},f.$$.update=()=>{f.$$.dirty&510&&w&&!le&&(v(7,le=new Cn.GeolocateControl({positionOptions:F,fitBoundsOptions:o,trackUserLocation:te,showAccuracyCircle:O,showUserLocation:ne})),w.addControl(le,z))},[M,z,F,o,te,O,ne,le,w]}class I_ extends en{constructor(_){super(),$r(this,_,S_,null,Rr,{position:1,positionOptions:2,fitBoundsOptions:3,trackUserLocation:4,showAccuracyCircle:5,showUserLocation:6})}}function A_(f){let _;const v=f[15].default,w=ta(v,f,f[23],null);return{c(){w&&w.c()},m(M,z){w&&w.m(M,z),_=!0},p(M,z){w&&w.p&&(!_||z&8388608)&&ra(w,v,M,M[23],_?ia(v,M[23],z,null):na(M[23]),null)},i(M){_||(ei(w,M),_=!0)},o(M){vi(w,M),_=!1},d(M){w&&w.d(M)}}}function M_(f){let _,v,w;function M(F){f[16](F)}let z={id:f[1],type:"line",source:f[2],sourceLayer:f[3],beforeId:f[4],beforeLayerType:f[5],paint:f[6],layout:f[7],filter:f[8],minzoom:f[9],maxzoom:f[10],hoverCursor:f[11],manageHoverState:f[12],eventsIfTopMost:f[13],interactive:f[14],$$slots:{default:[A_]},$$scope:{ctx:f}};return f[0]!==void 0&&(z.hovered=f[0]),_=new b_({props:z}),Il.push(()=>pg(_,"hovered",M)),_.$on("click",f[17]),_.$on("dblclick",f[18]),_.$on("contextmenu",f[19]),_.$on("mouseenter",f[20]),_.$on("mousemove",f[21]),_.$on("mouseleave",f[22]),{c(){Qa(_.$$.fragment)},m(F,o){$s(_,F,o),w=!0},p(F,[o]){const te={};o&2&&(te.id=F[1]),o&4&&(te.source=F[2]),o&8&&(te.sourceLayer=F[3]),o&16&&(te.beforeId=F[4]),o&32&&(te.beforeLayerType=F[5]),o&64&&(te.paint=F[6]),o&128&&(te.layout=F[7]),o&256&&(te.filter=F[8]),o&512&&(te.minzoom=F[9]),o&1024&&(te.maxzoom=F[10]),o&2048&&(te.hoverCursor=F[11]),o&4096&&(te.manageHoverState=F[12]),o&8192&&(te.eventsIfTopMost=F[13]),o&16384&&(te.interactive=F[14]),o&8388608&&(te.$$scope={dirty:o,ctx:F}),!v&&o&1&&(v=!0,te.hovered=F[0],ug(()=>v=!1)),_.$set(te)},i(F){w||(ei(_.$$.fragment,F),w=!0)},o(F){vi(_.$$.fragment,F),w=!1},d(F){ea(_,F)}}}function k_(f,_,v){let{$$slots:w={},$$scope:M}=_,{id:z=$p("line")}=_,{source:F=void 0}=_,{sourceLayer:o=void 0}=_,{beforeId:te=void 0}=_,{beforeLayerType:O=void 0}=_,{paint:ne}=_,{layout:le=void 0}=_,{filter:ge=void 0}=_,{minzoom:We=void 0}=_,{maxzoom:He=void 0}=_,{hoverCursor:vt=void 0}=_,{manageHoverState:Ge=!1}=_,{hovered:et=null}=_,{eventsIfTopMost:Je=!1}=_,{interactive:Ye=!0}=_;function bt(ve){et=ve,v(0,et)}function ht(ve){Ha.call(this,f,ve)}function zt(ve){Ha.call(this,f,ve)}function st(ve){Ha.call(this,f,ve)}function dt(ve){Ha.call(this,f,ve)}function mt(ve){Ha.call(this,f,ve)}function qe(ve){Ha.call(this,f,ve)}return f.$$set=ve=>{"id"in ve&&v(1,z=ve.id),"source"in ve&&v(2,F=ve.source),"sourceLayer"in ve&&v(3,o=ve.sourceLayer),"beforeId"in ve&&v(4,te=ve.beforeId),"beforeLayerType"in ve&&v(5,O=ve.beforeLayerType),"paint"in ve&&v(6,ne=ve.paint),"layout"in ve&&v(7,le=ve.layout),"filter"in ve&&v(8,ge=ve.filter),"minzoom"in ve&&v(9,We=ve.minzoom),"maxzoom"in ve&&v(10,He=ve.maxzoom),"hoverCursor"in ve&&v(11,vt=ve.hoverCursor),"manageHoverState"in ve&&v(12,Ge=ve.manageHoverState),"hovered"in ve&&v(0,et=ve.hovered),"eventsIfTopMost"in ve&&v(13,Je=ve.eventsIfTopMost),"interactive"in ve&&v(14,Ye=ve.interactive),"$$scope"in ve&&v(23,M=ve.$$scope)},[et,z,F,o,te,O,ne,le,ge,We,He,vt,Ge,Je,Ye,w,bt,ht,zt,st,dt,mt,qe,M]}class yy extends en{constructor(_){super(),$r(this,_,k_,M_,Rr,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function C_(f){let _=f.getCenter(),v=Math.round(f.getZoom()*100)/100,w=Math.ceil((v*Math.LN2+Math.log(512/360/.5))/Math.LN10),M=Math.pow(10,w),z=Math.round(_.lat*M)/M,F=Math.round(_.lng*M)/M,o=`${v}/${z}/${F}`,te=f.getBearing(),O=f.getPitch();return(te||O)&&(o+=`/${Math.round(te*10)/10}`),O&&(o+=`/${Math.round(O)}`),`#${o}`}function E_(f){return f.replace("#","").split("/").map(parseFloat)}var Fc=_h;function _h(f,_){return f===_||f!==f&&_!==_?!0:typeof f!=typeof _||{}.toString.call(f)!={}.toString.call(_)||f!==Object(f)||!f?!1:Array.isArray(f)?hp(f,_):{}.toString.call(f)=="[object Set]"?hp(Array.from(f),Array.from(_)):{}.toString.call(f)=="[object Object]"?P_(f,_):z_(f,_)}function z_(f,_){return f.toString()===_.toString()}function hp(f,_){var v=f.length;if(v!=_.length)return!1;for(var w=0;wv(6,w=ne));let{position:z="top-left"}=_,{showCompass:F=!0}=_,{showZoom:o=!0}=_,{visualizePitch:te=!1}=_,O=null;return sa(()=>{w!=null&&w.loaded()&&O&&w.removeControl(O)}),f.$$set=ne=>{"position"in ne&&v(1,z=ne.position),"showCompass"in ne&&v(2,F=ne.showCompass),"showZoom"in ne&&v(3,o=ne.showZoom),"visualizePitch"in ne&&v(4,te=ne.visualizePitch)},f.$$.update=()=>{f.$$.dirty&126&&w&&!O&&(v(5,O=new Cn.NavigationControl({showCompass:F,showZoom:o,visualizePitch:te})),w.addControl(O,z))},[M,z,F,o,te,O,w]}class L_ extends en{constructor(_){super(),$r(this,_,D_,null,Rr,{position:1,showCompass:2,showZoom:3,visualizePitch:4})}}function B_(f,_,v){let w;const{map:M}=oo();Br(f,M,O=>v(5,w=O));let{position:z="bottom-left"}=_,{maxWidth:F=void 0}=_,{unit:o="metric"}=_,te=null;return sa(()=>{w!=null&&w.loaded()&&te&&w.removeControl(te)}),f.$$set=O=>{"position"in O&&v(1,z=O.position),"maxWidth"in O&&v(2,F=O.maxWidth),"unit"in O&&v(3,o=O.unit)},f.$$.update=()=>{f.$$.dirty&62&&w&&!te&&(v(4,te=new Cn.ScaleControl({maxWidth:F,unit:o})),w.addControl(te,z))},[M,z,F,o,te,w]}class R_ extends en{constructor(_){super(),$r(this,_,B_,null,Rr,{position:1,maxWidth:2,unit:3})}}const F_=f=>({map:f[0]&8,loadedImages:f[0]&16,allImagesLoaded:f[0]&32}),dp=f=>({map:f[3],loadedImages:f[4],allImagesLoaded:f[5]});function pp(f){let _,v,w=f[2]&&fp(f);const M=f[34].default,z=ta(M,f,f[33],dp);return{c(){w&&w.c(),_=Si(),z&&z.c()},m(F,o){w&&w.m(F,o),Et(F,_,o),z&&z.m(F,o),v=!0},p(F,o){F[2]?w?(w.p(F,o),o[0]&4&&ei(w,1)):(w=fp(F),w.c(),ei(w,1),w.m(_.parentNode,_)):w&&(so(),vi(w,1,1,()=>{w=null}),ao()),z&&z.p&&(!v||o[0]&56|o[1]&4)&&ra(z,M,F,F[33],v?ia(M,F[33],o,F_):na(F[33]),dp)},i(F){v||(ei(w),ei(z,F),v=!0)},o(F){vi(w),vi(z,F),v=!1},d(F){F&&Mt(_),w&&w.d(F),z&&z.d(F)}}}function fp(f){let _,v,w,M,z,F,o,te;return _=new L_({props:{position:f[6]}}),w=new I_({props:{position:f[6],fitBoundsOptions:{maxZoom:12}}}),z=new T_({props:{position:f[6]}}),o=new R_({props:{position:f[6]}}),{c(){Qa(_.$$.fragment),v=Si(),Qa(w.$$.fragment),M=Si(),Qa(z.$$.fragment),F=Si(),Qa(o.$$.fragment)},m(O,ne){$s(_,O,ne),Et(O,v,ne),$s(w,O,ne),Et(O,M,ne),$s(z,O,ne),Et(O,F,ne),$s(o,O,ne),te=!0},p(O,ne){const le={};ne[0]&64&&(le.position=O[6]),_.$set(le);const ge={};ne[0]&64&&(ge.position=O[6]),w.$set(ge);const We={};ne[0]&64&&(We.position=O[6]),z.$set(We);const He={};ne[0]&64&&(He.position=O[6]),o.$set(He)},i(O){te||(ei(_.$$.fragment,O),ei(w.$$.fragment,O),ei(z.$$.fragment,O),ei(o.$$.fragment,O),te=!0)},o(O){vi(_.$$.fragment,O),vi(w.$$.fragment,O),vi(z.$$.fragment,O),vi(o.$$.fragment,O),te=!1},d(O){O&&(Mt(v),Mt(M),Mt(F)),ea(_,O),ea(w,O),ea(z,O),ea(o,O)}}}function O_(f){let _,v,w,M,z,F=f[3]&&f[0]&&pp(f);return{c(){_=Ct("div"),F&&F.c(),li(_,"class",v=ep(f[1])+" svelte-p00lfq"),ip(_,"expand-map",!f[1])},m(o,te){Et(o,_,te),F&&F.m(_,null),w=!0,M||(z=rg(f[9].call(null,_)),M=!0)},p(o,te){o[3]&&o[0]?F?(F.p(o,te),te[0]&9&&ei(F,1)):(F=pp(o),F.c(),ei(F,1),F.m(_,null)):F&&(so(),vi(F,1,1,()=>{F=null}),ao()),(!w||te[0]&2&&v!==(v=ep(o[1])+" svelte-p00lfq"))&&li(_,"class",v),(!w||te[0]&2)&&ip(_,"expand-map",!o[1])},i(o){w||(ei(F),w=!0)},o(o){vi(F),w=!1},d(o){o&&Mt(_),F&&F.d(),M=!1,z()}}}function V_(f,_,v){let w,M,z,F,{$$slots:o={},$$scope:te}=_,{map:O=null}=_,{class:ne=void 0}=_,{style:le}=_,{diffStyleUpdates:ge=!1}=_,{center:We=void 0}=_,{zoom:He=void 0}=_,{pitch:vt=0}=_,{bearing:Ge=0}=_,{bounds:et=void 0}=_,{hash:Je=!1}=_,{loaded:Ye=!1}=_,{minZoom:bt=0}=_,{maxZoom:ht=22}=_,{zoomOnDoubleClick:zt=!0}=_,{interactive:st=!0}=_,{attributionControl:dt=!0}=_,{cooperativeGestures:mt=!1}=_,{preserveDrawingBuffer:qe=!1}=_,{maxBounds:ve=void 0}=_,{images:rt=[]}=_,{standardControls:gt=!1}=_,{filterLayers:lt=void 0}=_,{transformRequest:pt=void 0}=_;const $e=Lp(),{map:Ht,loadedImages:Pt}=u_();Br(f,Ht,Ie=>v(3,z=Ie)),Br(f,Pt,Ie=>v(4,F=Ie));let Ji=new Set;function dr(Ie){z!=null&&z.loaded()&&("url"in Ie?(Ji.add(Ie.id),z.loadImage(Ie.url,(nt,St)=>{Ji.delete(Ie.id),nt?$e("error",nt):St&&(z==null||z.addImage(Ie.id,St,Ie.options),F.add(Ie.id),Pt.set(F))})):(z.addImage(Ie.id,Ie.data,Ie.options),F.add(Ie.id),Pt.set(F)))}let Kt,Ot,yt,Rt;function ki(Ie){if(Je){let nt=E_(window.location.hash);nt.length>=3&&(v(11,He=nt[0]),v(10,We=[nt[2],nt[1]])),nt.length==5&&(v(15,Ge=nt[3]),v(14,vt=nt[4]))}return Uc(Ht,z=new Cn.Map(rf({container:Ie,style:le,center:We,zoom:He,pitch:vt,bearing:Ge,minZoom:bt,maxZoom:ht,interactive:st,preserveDrawingBuffer:qe,maxBounds:ve,bounds:et,attributionControl:dt,transformRequest:pt,cooperativeGestures:mt})),z),z.on("load",nt=>{v(0,Ye=!0),$e("load",z)}),z.on("error",nt=>$e("error",{...nt,map:z})),z.on("movestart",nt=>$e("movestart",{...nt,map:z})),z.on("moveend",nt=>{if(v(10,We=nt.target.getCenter()),v(11,He=nt.target.getZoom()),v(12,et=nt.target.getBounds()),$e("moveend",{...nt,map:z}),Je){let St=window.location.href.replace(/(#.+)?$/,C_(z));window.history.replaceState(window.history.state,"",St)}}),z.on("zoomstart",nt=>$e("zoomstart",{...nt,map:z})),z.on("zoom",nt=>{v(11,He=nt.target.getZoom()),$e("zoom",{...nt,map:z})}),z.on("zoomend",nt=>{v(11,He=nt.target.getZoom()),$e("zoomend",{...nt,map:z})}),z.on("style.load",()=>{if(z){const nt=z.getStyle();if(v(30,Kt=nt.layers.map(St=>St.id)),v(31,Ot=Object.keys(nt.sources)),Rt)for(const[St,Jt]of Object.entries(Rt))z.addSource(St,Jt);if(yt)for(const St of yt)z.addLayer(St)}}),z.on("styledata",nt=>{if(z&<){const St=z.getStyle().layers;if(St)for(let Jt of St)lt(Jt)||z.setLayoutProperty(Jt.id,"visibility","none")}$e("styledata",{...nt,map:z})}),{destroy(){v(0,Ye=!1),z==null||z.remove(),Uc(Ht,z=null,z)}}}let ti=le;return f.$$set=Ie=>{"map"in Ie&&v(13,O=Ie.map),"class"in Ie&&v(1,ne=Ie.class),"style"in Ie&&v(16,le=Ie.style),"diffStyleUpdates"in Ie&&v(17,ge=Ie.diffStyleUpdates),"center"in Ie&&v(10,We=Ie.center),"zoom"in Ie&&v(11,He=Ie.zoom),"pitch"in Ie&&v(14,vt=Ie.pitch),"bearing"in Ie&&v(15,Ge=Ie.bearing),"bounds"in Ie&&v(12,et=Ie.bounds),"hash"in Ie&&v(18,Je=Ie.hash),"loaded"in Ie&&v(0,Ye=Ie.loaded),"minZoom"in Ie&&v(19,bt=Ie.minZoom),"maxZoom"in Ie&&v(20,ht=Ie.maxZoom),"zoomOnDoubleClick"in Ie&&v(21,zt=Ie.zoomOnDoubleClick),"interactive"in Ie&&v(22,st=Ie.interactive),"attributionControl"in Ie&&v(23,dt=Ie.attributionControl),"cooperativeGestures"in Ie&&v(24,mt=Ie.cooperativeGestures),"preserveDrawingBuffer"in Ie&&v(25,qe=Ie.preserveDrawingBuffer),"maxBounds"in Ie&&v(26,ve=Ie.maxBounds),"images"in Ie&&v(27,rt=Ie.images),"standardControls"in Ie&&v(2,gt=Ie.standardControls),"filterLayers"in Ie&&v(28,lt=Ie.filterLayers),"transformRequest"in Ie&&v(29,pt=Ie.transformRequest),"$$scope"in Ie&&v(33,te=Ie.$$scope)},f.$$.update=()=>{if(f.$$.dirty[0]&4&&v(6,w=typeof gt=="boolean"?void 0:gt),f.$$.dirty[0]&8&&v(13,O=z),f.$$.dirty[0]&134217737&&Ye&&z!=null&&z.loaded())for(let Ie of rt)!Ji.has(Ie.id)&&!z.hasImage(Ie.id)&&dr(Ie);if(f.$$.dirty[0]&134217744&&v(5,M=rt.every(Ie=>F.has(Ie.id))),f.$$.dirty[0]&1073938440|f.$$.dirty[1]&3&&z&&!Fc(le,ti)){const Ie=z.getStyle();if(Kt&&(yt=Ie.layers.filter(nt=>!Kt.includes(nt.id))),Ot){const nt=Object.keys(Ie.sources).filter(St=>!Ot.includes(St));Rt={};for(const St of nt)Rt[St]=Ie.sources[St]}v(32,ti=le),z.setStyle(le,{diff:ge})}f.$$.dirty[0]&1032&&We&&!Fc(We,z==null?void 0:z.getCenter())&&(z==null||z.panTo(We)),f.$$.dirty[0]&2056&&He&&!Fc(He,z==null?void 0:z.getZoom())&&(z==null||z.zoomTo(He)),f.$$.dirty[0]&4104&&et&&!Fc(et,z==null?void 0:z.getBounds())&&(z==null||z.fitBounds(et)),f.$$.dirty[0]&2097160&&(zt?z==null||z.doubleClickZoom.enable():z==null||z.doubleClickZoom.disable())},[Ye,ne,gt,z,F,M,w,Ht,Pt,ki,We,He,et,O,vt,Ge,le,ge,Je,bt,ht,zt,st,dt,mt,qe,ve,rt,lt,pt,Kt,Ot,ti,te,o]}class xy extends en{constructor(_){super(),$r(this,_,V_,O_,Rr,{map:13,class:1,style:16,diffStyleUpdates:17,center:10,zoom:11,pitch:14,bearing:15,bounds:12,hash:18,loaded:0,minZoom:19,maxZoom:20,zoomOnDoubleClick:21,interactive:22,attributionControl:23,cooperativeGestures:24,preserveDrawingBuffer:25,maxBounds:26,images:27,standardControls:2,filterLayers:28,transformRequest:29},null,[-1,-1])}}const N_=f=>({features:f[0]&16,data:f[0]&16,map:f[0]&4,close:f[0]&1}),mp=f=>{var _;return{features:f[4],data:(_=f[4])==null?void 0:_[0],map:f[2],close:f[31]}};function gp(f){let _,v,w=(f[4]||f[3]instanceof Cn.Marker)&&_p(f);return{c(){_=Ct("div"),w&&w.c()},m(M,z){Et(M,_,z),w&&w.m(_,null),f[32](_),v=!0},p(M,z){M[4]||M[3]instanceof Cn.Marker?w?(w.p(M,z),z[0]&24&&ei(w,1)):(w=_p(M),w.c(),ei(w,1),w.m(_,null)):w&&(so(),vi(w,1,1,()=>{w=null}),ao())},i(M){v||(ei(w),v=!0)},o(M){vi(w),v=!1},d(M){M&&Mt(_),w&&w.d(),f[32](null)}}}function _p(f){let _;const v=f[30].default,w=ta(v,f,f[29],mp);return{c(){w&&w.c()},m(M,z){w&&w.m(M,z),_=!0},p(M,z){w&&w.p&&(!_||z[0]&536870933)&&ra(w,v,M,M[29],_?ia(v,M[29],z,N_):na(M[29]),mp)},i(M){_||(ei(w,M),_=!0)},o(M){vi(w,M),_=!1},d(M){w&&w.d(M)}}}function U_(f){let _,v,w=f[9].default&&gp(f);return{c(){w&&w.c(),_=Gc()},m(M,z){w&&w.m(M,z),Et(M,_,z),v=!0},p(M,z){M[9].default?w?(w.p(M,z),z[0]&512&&ei(w,1)):(w=gp(M),w.c(),ei(w,1),w.m(_.parentNode,_)):w&&(so(),vi(w,1,1,()=>{w=null}),ao())},i(M){v||(ei(w),v=!0)},o(M){vi(w),v=!1},d(M){M&&Mt(_),w&&w.d(M)}}}function j_(f,_,v){let w,M,z,F,o,te,{$$slots:O={},$$scope:ne}=_;const le=ig(O);let{closeButton:ge=void 0}=_,{closeOnClickOutside:We=!0}=_,{closeOnClickInside:He=!1}=_,{closeOnMove:vt=!1}=_,{openOn:Ge="click"}=_,{openIfTopMost:et=!0}=_,{focusAfterOpen:Je=!0}=_,{anchor:Ye=void 0}=_,{offset:bt=void 0}=_,{popupClass:ht=void 0}=_,{maxWidth:zt=void 0}=_,{lngLat:st=void 0}=_,{html:dt=void 0}=_,{open:mt=!1}=_;const{map:qe,popupTarget:ve,layerEvent:rt,layer:gt,eventTopMost:lt}=oo();Br(f,qe,ue=>v(2,z=ue)),Br(f,ve,ue=>v(3,o=ue)),Br(f,rt,ue=>v(28,F=ue)),Br(f,gt,ue=>v(35,te=ue));const pt=["click","dblclick","contextmenu"];let $e,Ht=!1,Pt;function Ji(){if(!$e)return;let ue=$e.getElement();!ue||ue===Pt||(Pt=ue,Ge==="hover"&&(Pt.style.pointerEvents="none"),Pt.addEventListener("mouseenter",()=>{v(24,Ht=!0)},{passive:!0}),Pt.addEventListener("mouseleave",()=>{v(24,Ht=!1)},{passive:!0}),Pt.addEventListener("click",()=>{He&&v(0,mt=!1)},{passive:!0}))}lg(()=>{if(z)return z.on("click",St),z.on("contextmenu",St),typeof o=="string"&&(z.on("click",o,yt),z.on("dblclick",o,yt),z.on("contextmenu",o,yt),z.on("mousemove",o,nt),z.on("mouseleave",o,Ie),z.on("touchstart",o,ki),z.on("touchend",o,ti)),()=>{z!=null&&z.loaded()&&($e==null||$e.remove(),z.off("click",St),z.off("contextmenu",St),o instanceof Cn.Marker?o.getPopup()===$e&&o.setPopup(void 0):typeof o=="string"&&(z.off("click",o,yt),z.off("dblclick",o,yt),z.off("contextmenu",o,yt),z.off("mousemove",o,nt),z.off("mouseleave",o,Ie),z.off("touchstart",o,ki),z.off("touchend",o,ti)))}});function dr(ue){return et?!("marker"in ue)&&!d_(ue)&<(ue)!==te:!1}let Kt=null,Ot="normal";function yt(ue){ue.type===Ge&&(dr(ue)||("layerType"in ue?ue.layerType==="deckgl"?(v(10,st=ue.coordinate),v(4,Kt=ue.object?[ue.object]:null)):(v(10,st=ue.lngLat),v(4,Kt=ue.features??[])):(v(10,st=ue.lngLat),v(4,Kt=ue.features??[])),setTimeout(()=>v(0,mt=!0))))}let Rt=null;function ki(ue){Rt=ue.point}function ti(ue){if(!Rt||Ge!=="hover")return;let Vt=Rt.dist(ue.point);Rt=null,Vt<3&&(v(10,st=ue.lngLat),v(4,Kt=ue.features??[]),$e.isOpen()?v(25,Ot="justOpened"):(v(25,Ot="opening"),v(0,mt=!0)))}function Ie(ue){Ge!=="hover"||Rt||Ot!=="normal"||(v(0,mt=!1),v(4,Kt=null))}function nt(ue){if(!(Ge!=="hover"||Rt||Ot!=="normal")){if(dr(ue)){v(0,mt=!1),v(4,Kt=null);return}v(0,mt=!0),v(4,Kt=ue.features??[]),v(10,st=ue.lngLat)}}function St(ue){if(Ot==="justOpened"){v(25,Ot="normal");return}if(!We)return;let Vt=[Pt,o instanceof Cn.Marker?o==null?void 0:o.getElement():null];mt&&$e.isOpen()&&!Vt.some(Ui=>Ui==null?void 0:Ui.contains(ue.originalEvent.target))&&(ue.type==="contextmenu"&&Ge==="contextmenu"||ue.type!=="contextmenu")&&v(0,mt=!1)}sa(()=>{z&&($e!=null&&$e.isOpen())&&$e.remove()});let Jt;const nr=()=>v(0,mt=!1);function Yi(ue){Il[ue?"unshift":"push"](()=>{Jt=ue,v(1,Jt)})}return f.$$set=ue=>{"closeButton"in ue&&v(11,ge=ue.closeButton),"closeOnClickOutside"in ue&&v(12,We=ue.closeOnClickOutside),"closeOnClickInside"in ue&&v(13,He=ue.closeOnClickInside),"closeOnMove"in ue&&v(14,vt=ue.closeOnMove),"openOn"in ue&&v(15,Ge=ue.openOn),"openIfTopMost"in ue&&v(16,et=ue.openIfTopMost),"focusAfterOpen"in ue&&v(17,Je=ue.focusAfterOpen),"anchor"in ue&&v(18,Ye=ue.anchor),"offset"in ue&&v(19,bt=ue.offset),"popupClass"in ue&&v(20,ht=ue.popupClass),"maxWidth"in ue&&v(21,zt=ue.maxWidth),"lngLat"in ue&&v(10,st=ue.lngLat),"html"in ue&&v(22,dt=ue.html),"open"in ue&&v(0,mt=ue.open),"$$scope"in ue&&v(29,ne=ue.$$scope)},f.$$.update=()=>{if(f.$$.dirty[0]&14336&&v(27,w=ge??(!We&&!He)),f.$$.dirty[0]&146685952&&($e||(v(23,$e=new Cn.Popup({closeButton:w,closeOnClick:!1,closeOnMove:vt,focusAfterOpen:Je,maxWidth:zt,className:ht,anchor:Ye,offset:bt})),Pt=$e.getElement(),$e.on("open",()=>{v(0,mt=!0),Ji()}),$e.on("close",ue=>{v(0,mt=!1)}))),f.$$.dirty[0]&8421384&&$e&&o instanceof Cn.Marker&&(Ge==="click"?o.setPopup($e):o.getPopup()===$e&&o.setPopup(void 0)),f.$$.dirty[0]&268468224&&pt.includes(Ge)&&(F==null?void 0:F.type)===Ge&&(yt(F),Uc(rt,F=null,F)),f.$$.dirty[0]&268468224&&v(26,M=Ge==="hover"&&((F==null?void 0:F.type)==="mousemove"||(F==null?void 0:F.type)==="mouseenter")),f.$$.dirty[0]&352354304&&Ge==="hover"&&rt&&(M&&F&&(F.layerType==="deckgl"?(v(10,st=F.coordinate),v(4,Kt=F.object?[F.object]:null)):(v(10,st=F.lngLat),v(4,Kt=F.features??[]))),v(0,mt=(M||Ht)??!1)),f.$$.dirty[0]&12582914&&(Jt?$e.setDOMContent(Jt):dt&&$e.setHTML(dt)),f.$$.dirty[0]&8389632&&st&&$e.setLngLat(st),f.$$.dirty[0]&41943045&&z){let ue=$e.isOpen();mt&&!ue?($e.addTo(z),Ot==="opening"&&v(25,Ot="justOpened")):!mt&&ue&&$e.remove()}},[mt,Jt,z,o,Kt,qe,ve,rt,gt,le,st,ge,We,He,vt,Ge,et,Je,Ye,bt,ht,zt,dt,$e,Ht,Ot,M,w,F,ne,O,nr,Yi]}class q_ extends en{constructor(_){super(),$r(this,_,j_,U_,Rr,{closeButton:11,closeOnClickOutside:12,closeOnClickInside:13,closeOnMove:14,openOn:15,openIfTopMost:16,focusAfterOpen:17,anchor:18,offset:19,popupClass:20,maxWidth:21,lngLat:10,html:22,open:0},null,[-1,-1])}}let _l={origins:"blue",destinations:"purple",lts1:"#009e73",lts2:"#56b4e9",lts3:"#e69f00",lts4:"#d55e00",lts_not_allowed:"red"},vy=["match",["get","lts"],0,_l.lts_not_allowed,1,_l.lts1,2,_l.lts2,3,_l.lts3,4,_l.lts4,"red"];function by(f,_,v){let w=["step",f];for(let M=1;M<_.length;M++)w.push(v[M-1]),w.push(_[M]);return w.push(v[v.length-1]),w}let wy=["#CDE594","#80C6A3","#1F9EB7","#186290","#080C54"],Ty={lts1:"LTS 1 - suitable for children",lts2:"LTS 2 - low stress",lts3:"LTS 3 - medium stress",lts4:"LTS 4 - high stress",lts_not_allowed:"Cyclists not allowed"};const yp="/od2net/assets/logo-fbff26ba.png";function Z_(f){let _,v,w,M,z,F,o,te,O,ne,le,ge,We,He,vt,Ge,et,Je,Ye,bt,ht,zt,st,dt,mt,qe,ve,rt,gt;return{c(){_=Ct("div"),v=Ct("img"),M=Si(),z=Ct("select"),F=Ct("option"),F.textContent="Pre-built route networks",o=Ct("option"),o.textContent="Interactively generate route networks",te=Ct("option"),te.textContent="Explore edge costs",O=Si(),ne=Ct("dialog"),le=Ct("div"),ge=Ct("h1"),ge.textContent="About od2net",We=Si(),He=Ct("button"),He.textContent="Close",vt=Si(),Ge=Ct("img"),Je=Si(),Ye=Ct("p"),Ye.innerHTML=`od2net is an open-source project - by - Dustin Carlino - , part of the - Urban Analytics Technology Platform - . It wouldn't be possible without:`,bt=Si(),ht=Ct("ul"),ht.innerHTML=`
  • BikeOttawa's Level of Traffic Stress definition
  • GeoRust
  • svelte-maplibre
  • MapLibre GL JS
  • ChartJS
  • OpenStreetMap
  • fast-paths
  • Propensity to Cycle Tool
  • PMTiles
  • Special thanks to - Hadrien Salat - for the logo and - Stuart Lynn - for feedback and help with pmtiles, both from - the Alan Turing Institute
  • `,zt=Si(),st=Ct("button"),st.textContent="About",dt=Si(),mt=Ct("br"),qe=Si(),ve=Ct("br"),$d(v.src,w=yp)||li(v,"src",w),li(v,"width","100"),li(v,"alt","od2net logo by Hadrien Salat"),li(v,"class","svelte-1ey54bq"),F.__value="main",$u(F,F.__value),li(F,"class","svelte-1ey54bq"),o.__value="interactive",$u(o,o.__value),li(o,"class","svelte-1ey54bq"),te.__value="costs",$u(te,te.__value),li(te,"class","svelte-1ey54bq"),li(z,"class","svelte-1ey54bq"),f[0]===void 0&&jc(()=>f[3].call(z)),Ya(_,"display","flex"),Ya(_,"justify-content","space-between"),li(_,"class","svelte-1ey54bq"),li(ge,"class","svelte-1ey54bq"),li(He,"class","svelte-1ey54bq"),Ya(le,"display","flex"),Ya(le,"justify-content","space-between"),li(le,"class","svelte-1ey54bq"),$d(Ge.src,et=yp)||li(Ge,"src",et),li(Ge,"width","300"),li(Ge,"alt","od2net logo by Hadrien Salat"),li(Ge,"class","svelte-1ey54bq"),li(Ye,"class","svelte-1ey54bq"),li(ht,"class","svelte-1ey54bq"),li(ne,"class","svelte-1ey54bq"),li(st,"class","svelte-1ey54bq"),li(mt,"class","svelte-1ey54bq"),li(ve,"class","svelte-1ey54bq")},m(lt,pt){Et(lt,_,pt),ot(_,v),ot(_,M),ot(_,z),ot(z,F),ot(z,o),ot(z,te),tp(z,f[0],!0),Et(lt,O,pt),Et(lt,ne,pt),ot(ne,le),ot(le,ge),ot(le,We),ot(le,He),ot(ne,vt),ot(ne,Ge),ot(ne,Je),ot(ne,Ye),ot(ne,bt),ot(ne,ht),f[5](ne),Et(lt,zt,pt),Et(lt,st,pt),Et(lt,dt,pt),Et(lt,mt,pt),Et(lt,qe,pt),Et(lt,ve,pt),rt||(gt=[Rc(z,"change",f[3]),Rc(z,"change",f[2]),Rc(He,"click",f[4]),Rc(st,"click",f[6])],rt=!0)},p(lt,[pt]){pt&1&&tp(z,lt[0])},i:Sr,o:Sr,d(lt){lt&&(Mt(_),Mt(O),Mt(ne),Mt(zt),Mt(st),Mt(dt),Mt(mt),Mt(qe),Mt(ve)),f[5](null),rt=!1,no(gt)}}}function G_(f,_,v){let{app:w}=_,M;function z(){w=="main"?window.location.href="index.html":w=="interactive"?window.location.href="interactive.html":w=="costs"&&(window.location.href="edge_cost.html")}function F(){w=ag(this),v(0,w)}const o=()=>M.close();function te(ne){Il[ne?"unshift":"push"](()=>{M=ne,v(1,M)})}const O=()=>M.showModal();return f.$$set=ne=>{"app"in ne&&v(0,w=ne.app)},[w,M,z,F,o,te,O]}class Sy extends en{constructor(_){super(),$r(this,_,G_,Z_,Rr,{app:0})}}const H_=f=>({props:f&8}),xp=f=>({props:K_(f[3])});function W_(f){let _;const v=f[1].default,w=ta(v,f,f[2],xp);return{c(){w&&w.c()},m(M,z){w&&w.m(M,z),_=!0},p(M,z){w&&w.p&&(!_||z&12)&&ra(w,v,M,M[2],_?ia(v,M[2],z,H_):na(M[2]),xp)},i(M){_||(ei(w,M),_=!0)},o(M){vi(w,M),_=!1},d(M){w&&w.d(M)}}}function X_(f){let _,v;return _=new q_({props:{openOn:f[0],$$slots:{default:[W_,({features:w})=>({3:w}),({features:w})=>w?8:0]},$$scope:{ctx:f}}}),{c(){Qa(_.$$.fragment)},m(w,M){$s(_,w,M),v=!0},p(w,[M]){const z={};M&1&&(z.openOn=w[0]),M&12&&(z.$$scope={dirty:M,ctx:w}),_.$set(z)},i(w){v||(ei(_.$$.fragment,w),v=!0)},o(w){vi(_.$$.fragment,w),v=!1},d(w){ea(_,w)}}}function K_(f){return f?f[0].properties??{}:(console.log("A Popup with null features should be impossible"),{})}function J_(f,_,v){let{$$slots:w={},$$scope:M}=_,{openOn:z="hover"}=_;return f.$$set=F=>{"openOn"in F&&v(0,z=F.openOn),"$$scope"in F&&v(2,M=F.$$scope)},[z,w,M]}class Iy extends en{constructor(_){super(),$r(this,_,J_,X_,Rr,{openOn:0})}}function vp(f,_,v){const w=f.slice();return w[3]=_[v][0],w[4]=_[v][1],w}function bp(f,_,v){const w=f.slice();return w[7]=_[v],w}function wp(f){let _,v,w,M=f[0].count.toFixed(2)+"",z;return{c(){_=Ct("div"),v=ci("Count: "),w=Ct("b"),z=ci(M)},m(F,o){Et(F,_,o),ot(_,v),ot(_,w),ot(w,z)},p(F,o){o&1&&M!==(M=F[0].count.toFixed(2)+"")&&Qr(z,M)},d(F){F&&Mt(_)}}}function Tp(f){let _,v,w=f[0].forward_cost+"",M,z,F=f[0].backward_cost+"",o,te,O,ne,le=(f[0].forward_cost/f[0].length).toFixed(2)+"",ge,We,He=(f[0].backward_cost/f[0].length).toFixed(2)+"",vt,Ge,et;return{c(){_=Ct("div"),v=ci("Cost: ["),M=ci(w),z=ci(", "),o=ci(F),te=ci(`] ( - `),O=Ct("b"),ne=ci("["),ge=ci(le),We=ci(", "),vt=ci(He),Ge=ci("]"),et=ci(` - x the length)`)},m(Je,Ye){Et(Je,_,Ye),ot(_,v),ot(_,M),ot(_,z),ot(_,o),ot(_,te),ot(_,O),ot(O,ne),ot(O,ge),ot(O,We),ot(O,vt),ot(O,Ge),ot(_,et)},p(Je,Ye){Ye&1&&w!==(w=Je[0].forward_cost+"")&&Qr(M,w),Ye&1&&F!==(F=Je[0].backward_cost+"")&&Qr(o,F),Ye&1&&le!==(le=(Je[0].forward_cost/Je[0].length).toFixed(2)+"")&&Qr(ge,le),Ye&1&&He!==(He=(Je[0].backward_cost/Je[0].length).toFixed(2)+"")&&Qr(vt,He)},d(Je){Je&&Mt(_)}}}function Sp(f){let _,v,w=f[0].slope.toFixed(2)+"",M,z,F=-f[0].slope.toFixed(2)+"",o,te;return{c(){_=Ct("div"),v=ci("Slope: ["),M=ci(w),z=ci(", "),o=ci(F),te=ci("]")},m(O,ne){Et(O,_,ne),ot(_,v),ot(_,M),ot(_,z),ot(_,o),ot(_,te)},p(O,ne){ne&1&&w!==(w=O[0].slope.toFixed(2)+"")&&Qr(M,w),ne&1&&F!==(F=-O[0].slope.toFixed(2)+"")&&Qr(o,F)},d(O){O&&Mt(_)}}}function Ip(f){let _,v=f[7]+"",w;return{c(){_=Ct("li"),w=ci(v)},m(M,z){Et(M,_,z),ot(_,w)},p(M,z){z&2&&v!==(v=M[7]+"")&&Qr(w,v)},d(M){M&&Mt(_)}}}function Y_(f){let _;return{c(){_=Ct("p"),_.textContent="OSM tags weren't kept"},m(v,w){Et(v,_,w)},p:Sr,d(v){v&&Mt(_)}}}function Q_(f){let _,v,w=ro(Object.entries(f[2])),M=[];for(let z=0;z{"properties"in F&&v(0,w=F.properties)},[w,M,z]}class Ay extends en{constructor(_){super(),$r(this,_,ey,$_,Rr,{properties:0})}}const ty=f=>({}),Mp=f=>({}),iy=f=>({}),kp=f=>({});function ry(f){let _,v,w,M;const z=f[1].left,F=ta(z,f,f[0],kp),o=f[1].main,te=ta(o,f,f[0],Mp);return{c(){_=Ct("div"),F&&F.c(),v=Si(),w=Ct("div"),te&&te.c(),li(_,"class","left svelte-6kzmjs"),li(w,"class","main svelte-6kzmjs")},m(O,ne){Et(O,_,ne),F&&F.m(_,null),Et(O,v,ne),Et(O,w,ne),te&&te.m(w,null),M=!0},p(O,[ne]){F&&F.p&&(!M||ne&1)&&ra(F,z,O,O[0],M?ia(z,O[0],ne,iy):na(O[0]),kp),te&&te.p&&(!M||ne&1)&&ra(te,o,O,O[0],M?ia(o,O[0],ne,ty):na(O[0]),Mp)},i(O){M||(ei(F,O),ei(te,O),M=!0)},o(O){vi(F,O),vi(te,O),M=!1},d(O){O&&(Mt(_),Mt(v),Mt(w)),F&&F.d(O),te&&te.d(O)}}}function ny(f,_,v){let{$$slots:w={},$$scope:M}=_;return f.$$set=z=>{"$$scope"in z&&v(0,M=z.$$scope)},[M,w]}class My extends en{constructor(_){super(),$r(this,_,ny,ry,Rr,{})}}function Cp(f,_,v){const w=f.slice();return w[1]=_[v][0],w[2]=_[v][1],w}function Ep(f){let _,v,w,M=f[1]+"",z,F;return{c(){_=Ct("li"),v=Ct("span"),w=Si(),z=ci(M),F=Si(),li(v,"class","svelte-kzgqtg"),Ya(v,"background",f[2])},m(o,te){Et(o,_,te),ot(_,v),ot(_,w),ot(_,z),ot(_,F)},p(o,te){te&1&&Ya(v,"background",o[2]),te&1&&M!==(M=o[1]+"")&&Qr(z,M)},d(o){o&&Mt(_)}}}function sy(f){let _,v=ro(f[0]),w=[];for(let M=0;M{"rows"in M&&v(0,w=M.rows)},[w]}class ky extends en{constructor(_){super(),$r(this,_,ay,sy,Rr,{rows:0})}}export{Ha as $,ug as A,ap as B,ag as C,Gc as D,Sr as E,fy as F,ta as G,Sy as H,rg as I,ra as J,na as K,My as L,xy as M,ia as N,dh as O,py as P,Lp as Q,gy as R,en as S,Br as T,Uc as U,uy as V,Qr as W,hy as X,b_ as Y,$p as Z,Tg as _,$s as a,Nn as a0,vy as a1,_y as a2,eg as a3,yy as a4,_l as a5,Iy as a6,Ay as a7,sa as a8,cy as a9,ky as aa,Ty as ab,ro as ac,ph as ad,by as ae,wy as af,dy as ag,ly as ah,my as ai,rf as aj,p_ as ak,f_ as al,vi as b,Qa as c,ea as d,Ct as e,Si as f,ci as g,li as h,$r as i,$u as j,jc as k,Et as l,Cn as m,ot as n,lg as o,tp as p,Rc as q,so as r,Rr as s,ei as t,ao as u,Mt as v,no as w,Il as x,pg as y,Ya as z}; diff --git a/assets/Legend-3dfd8dca.css b/assets/Legend-3dfd8dca.css deleted file mode 100644 index 3380ff2..0000000 --- a/assets/Legend-3dfd8dca.css +++ /dev/null @@ -1 +0,0 @@ -.ctrl-btn-center.svelte-1s83zbq{display:grid!important;height:100%;width:100%;place-items:center}.maplibregl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23999' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-ms-high-contrast:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:#0000000d}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:#0000000d}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;top:0;right:0;bottom:0;left:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}.expand-map.svelte-p00lfq{position:absolute;top:0;bottom:0;left:0;right:0}.svelte-1ey54bq::backdrop{background-color:#000;opacity:.5}table.svelte-lh2o9l{border:solid}.svelte-6kzmjs{box-sizing:border-box}body{margin:0}div.svelte-6kzmjs{float:left}.left.svelte-6kzmjs{width:25%;height:100vh;overflow:scroll;padding:8px}.main.svelte-6kzmjs{width:75%}span.svelte-kzgqtg{display:block;float:left;height:16px;width:30px;margin-right:5px;border:1px solid #999} diff --git a/assets/Legend-7e8105f0.js b/assets/Legend-7e8105f0.js new file mode 100644 index 0000000..2516f0a --- /dev/null +++ b/assets/Legend-7e8105f0.js @@ -0,0 +1,593 @@ +var qm=Object.defineProperty;var Zm=(f,g,v)=>g in f?qm(f,g,{enumerable:!0,configurable:!0,writable:!0,value:v}):f[g]=v;var vs=(f,g,v)=>(Zm(f,typeof g!="symbol"?g+"":g,v),v);(function(){const g=document.createElement("link").relList;if(g&&g.supports&&g.supports("modulepreload"))return;for(const k of document.querySelectorAll('link[rel="modulepreload"]'))w(k);new MutationObserver(k=>{for(const P of k)if(P.type==="childList")for(const S of P.addedNodes)S.tagName==="LINK"&&S.rel==="modulepreload"&&w(S)}).observe(document,{childList:!0,subtree:!0});function v(k){const P={};return k.integrity&&(P.integrity=k.integrity),k.referrerPolicy&&(P.referrerPolicy=k.referrerPolicy),k.crossOrigin==="use-credentials"?P.credentials="include":k.crossOrigin==="anonymous"?P.credentials="omit":P.credentials="same-origin",P}function w(k){if(k.ep)return;k.ep=!0;const P=v(k);fetch(k.href,P)}})();function Ar(){}function Gm(f,g){for(const v in g)f[v]=g[v];return f}function Ip(f){return f()}function Hd(){return Object.create(null)}function uo(f){f.forEach(Ip)}function hh(f){return typeof f=="function"}function Br(f,g){return f!=f?g==g:f!==g||f&&typeof f=="object"||typeof f=="function"}let Rc;function Wd(f,g){return f===g?!0:(Rc||(Rc=document.createElement("a")),Rc.href=g,f===Rc.href)}function Hm(f){return Object.keys(f).length===0}function Ap(f,...g){if(f==null){for(const w of g)w(void 0);return Ar}const v=f.subscribe(...g);return v.unsubscribe?()=>v.unsubscribe():v}function ey(f){let g;return Ap(f,v=>g=v)(),g}function Rr(f,g,v){f.$$.on_destroy.push(Ap(g,v))}function Qs(f,g,v,w){if(f){const k=Cp(f,g,v,w);return f[0](k)}}function Cp(f,g,v,w){return f[1]&&w?Gm(v.ctx.slice(),f[1](w(g))):v.ctx}function $s(f,g,v,w){if(f[2]&&w){const k=f[2](w(v));if(g.dirty===void 0)return k;if(typeof k=="object"){const P=[],S=Math.max(g.dirty.length,k.length);for(let c=0;c32){const g=[],v=f.ctx.length/32;for(let w=0;wf.removeEventListener(g,v,w)}function ai(f,g,v){v==null?f.removeAttribute(g):f.getAttribute(g)!==v&&f.setAttribute(g,v)}function ty(f){let g;return{p(...v){g=v,g.forEach(w=>f.push(w))},r(){g.forEach(v=>f.splice(f.indexOf(v),1))}}}function iy(f){return f===""?null:+f}function Jm(f){return Array.from(f.childNodes)}function Yr(f,g){g=""+g,f.data!==g&&(f.data=g)}function Yu(f,g){f.value=g??""}function ro(f,g,v,w){v==null?f.style.removeProperty(g):f.style.setProperty(g,v,w?"important":"")}function Kd(f,g,v){for(let w=0;w{const k=f.$$.callbacks[g];if(k){const P=Qm(g,v,{cancelable:w});return k.slice().forEach(S=>{S.call(f,P)}),!P.defaultPrevented}return!0}}function Ep(f,g){return Cl().$$.context.set(f,g),g}function eg(f){return Cl().$$.context.get(f)}function Qa(f,g){const v=f.$$.callbacks[g.type];v&&v.slice().forEach(w=>w.call(this,g))}const io=[],Al=[];let oo=[];const sh=[],Mp=Promise.resolve();let ah=!1;function Pp(){ah||(ah=!0,Mp.then(zp))}function ny(){return Pp(),Mp}function jc(f){oo.push(f)}function tg(f){sh.push(f)}const Qu=new Set;let $a=0;function zp(){if($a!==0)return;const f=Il;do{try{for(;$af.indexOf(w)===-1?g.push(w):v.push(w)),v.forEach(w=>w()),oo=g}const Oc=new Set;let Ks;function ho(){Ks={r:0,c:[],p:Ks}}function po(){Ks.r||uo(Ks.c),Ks=Ks.p}function Qt(f,g){f&&f.i&&(Oc.delete(f),f.i(g))}function _i(f,g,v,w){if(f&&f.o){if(Oc.has(f))return;Oc.add(f),Ks.c.push(()=>{Oc.delete(f),w&&(v&&f.d(1),w())}),f.o(g)}else w&&w()}function co(f){return(f==null?void 0:f.length)!==void 0?f:Array.from(f)}function ng(f,g,v){const w=f.$$.props[g];w!==void 0&&(f.$$.bound[w]=v,v(f.$$.ctx[w]))}function no(f){f&&f.c()}function Js(f,g,v){const{fragment:w,after_update:k}=f.$$;w&&w.m(g,v),jc(()=>{const P=f.$$.on_mount.map(Ip).filter(hh);f.$$.on_destroy?f.$$.on_destroy.push(...P):uo(P),f.$$.on_mount=[]}),k.forEach(jc)}function Ys(f,g){const v=f.$$;v.fragment!==null&&(rg(v.after_update),uo(v.on_destroy),v.fragment&&v.fragment.d(g),v.on_destroy=v.fragment=null,v.ctx=[])}function sg(f,g){f.$$.dirty[0]===-1&&(io.push(f),Pp(),f.$$.dirty.fill(0)),f.$$.dirty[g/31|0]|=1<{const qe=We.length?We[0]:$;return ie.ctx&&k(ie.ctx[X],ie.ctx[X]=qe)&&(!ie.skip_bound&&ie.bound[X]&&ie.bound[X](qe),re&&sg(f,X)),$}):[],ie.update(),re=!0,uo(ie.before_update),ie.fragment=w?w(ie.ctx):!1,g.target){if(g.hydrate){const X=Jm(g.target);ie.fragment&&ie.fragment.l(X),X.forEach(It)}else ie.fragment&&ie.fragment.c();g.intro&&Qt(f.$$.fragment),Js(f,g.target,g.anchor),zp()}wl(ne)}class $r{constructor(){vs(this,"$$");vs(this,"$$set")}$destroy(){Ys(this,1),this.$destroy=Ar}$on(g,v){if(!hh(v))return Ar;const w=this.$$.callbacks[g]||(this.$$.callbacks[g]=[]);return w.push(v),()=>{const k=w.indexOf(v);k!==-1&&w.splice(k,1)}}$set(g){this.$$set&&!Hm(g)&&(this.$$.skip_bound=!0,this.$$set(g),this.$$.skip_bound=!1)}}const ag="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(ag);let Ir;const Yn=new Array(128).fill(void 0);Yn.push(void 0,null,!0,!1);function Ut(f){return Yn[f]}let qc=0,xl=null;function Vc(){return(xl===null||xl.byteLength===0)&&(xl=new Uint8Array(Ir.memory.buffer)),xl}const Uc=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},og=typeof Uc.encodeInto=="function"?function(f,g){return Uc.encodeInto(f,g)}:function(f,g){const v=Uc.encode(f);return g.set(v),{read:f.length,written:v.length}};function Yd(f,g,v){if(v===void 0){const c=Uc.encode(f),ne=g(c.length,1)>>>0;return Vc().subarray(ne,ne+c.length).set(c),qc=c.length,ne}let w=f.length,k=g(w,1)>>>0;const P=Vc();let S=0;for(;S127)break;P[k+S]=c}if(S!==w){S!==0&&(f=f.slice(S)),k=v(k,w,w=S+f.length*3,1)>>>0;const c=Vc().subarray(k+S,k+w),ne=og(f,c);S+=ne.written}return qc=S,k}function $u(f){return f==null}let vl=null;function bs(){return(vl===null||vl.byteLength===0)&&(vl=new Int32Array(Ir.memory.buffer)),vl}let Tl=Yn.length;function lg(f){f<132||(Yn[f]=Tl,Tl=f)}function so(f){const g=Ut(f);return lg(f),g}const Dp=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Dp.decode();function eh(f,g){return f=f>>>0,Dp.decode(Vc().subarray(f,f+g))}function Gi(f){Tl===Yn.length&&Yn.push(Yn.length+1);const g=Tl;return Tl=Yn[g],Yn[g]=f,g}let bl=null;function cg(){return(bl===null||bl.byteLength===0)&&(bl=new Float64Array(Ir.memory.buffer)),bl}function oh(f){const g=typeof f;if(g=="number"||g=="boolean"||f==null)return`${f}`;if(g=="string")return`"${f}"`;if(g=="symbol"){const k=f.description;return k==null?"Symbol":`Symbol(${k})`}if(g=="function"){const k=f.name;return typeof k=="string"&&k.length>0?`Function(${k})`:"Function"}if(Array.isArray(f)){const k=f.length;let P="[";k>0&&(P+=oh(f[0]));for(let S=1;S1)w=v[1];else return toString.call(f);if(w=="Object")try{return"Object("+JSON.stringify(f)+")"}catch{return"Object"}return f instanceof Error?`${f.name}: ${f.message} +${f.stack}`:w}function ug(f){try{const k=Ir.__wbindgen_add_to_stack_pointer(-16);Ir.calculate(k,Gi(f));var g=bs()[k/4+0],v=bs()[k/4+1],w=bs()[k/4+2];if(w)throw so(v);return so(g)}finally{Ir.__wbindgen_add_to_stack_pointer(16)}}function th(f,g){try{return f.apply(this,g)}catch(v){Ir.__wbindgen_exn_store(Gi(v))}}async function hg(f,g){if(typeof Response=="function"&&f instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(f,g)}catch(w){if(f.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",w);else throw w}const v=await f.arrayBuffer();return await WebAssembly.instantiate(v,g)}else{const v=await WebAssembly.instantiate(f,g);return v instanceof WebAssembly.Instance?{instance:v,module:f}:v}}function dg(){const f={};return f.wbg={},f.wbg.__wbindgen_string_get=function(g,v){const w=Ut(v),k=typeof w=="string"?w:void 0;var P=$u(k)?0:Yd(k,Ir.__wbindgen_malloc,Ir.__wbindgen_realloc),S=qc;bs()[g/4+1]=S,bs()[g/4+0]=P},f.wbg.__wbindgen_object_drop_ref=function(g){so(g)},f.wbg.__wbindgen_is_object=function(g){const v=Ut(g);return typeof v=="object"&&v!==null},f.wbg.__wbindgen_is_undefined=function(g){return Ut(g)===void 0},f.wbg.__wbindgen_in=function(g,v){return Ut(g)in Ut(v)},f.wbg.__wbindgen_error_new=function(g,v){const w=new Error(eh(g,v));return Gi(w)},f.wbg.__wbindgen_jsval_loose_eq=function(g,v){return Ut(g)==Ut(v)},f.wbg.__wbindgen_boolean_get=function(g){const v=Ut(g);return typeof v=="boolean"?v?1:0:2},f.wbg.__wbindgen_number_get=function(g,v){const w=Ut(v),k=typeof w=="number"?w:void 0;cg()[g/8+1]=$u(k)?0:k,bs()[g/4+0]=!$u(k)},f.wbg.__wbindgen_number_new=function(g){return Gi(g)},f.wbg.__wbindgen_object_clone_ref=function(g){const v=Ut(g);return Gi(v)},f.wbg.__wbindgen_string_new=function(g,v){const w=eh(g,v);return Gi(w)},f.wbg.__wbg_getwithrefkey_5e6d9547403deab8=function(g,v){const w=Ut(g)[Ut(v)];return Gi(w)},f.wbg.__wbg_set_841ac57cff3d672b=function(g,v,w){Ut(g)[so(v)]=so(w)},f.wbg.__wbg_get_44be0491f933a435=function(g,v){const w=Ut(g)[v>>>0];return Gi(w)},f.wbg.__wbg_length_fff51ee6522a1a18=function(g){return Ut(g).length},f.wbg.__wbg_new_898a68150f225f2e=function(){const g=new Array;return Gi(g)},f.wbg.__wbindgen_is_function=function(g){return typeof Ut(g)=="function"},f.wbg.__wbg_next_526fc47e980da008=function(g){const v=Ut(g).next;return Gi(v)},f.wbg.__wbg_next_ddb3312ca1c4e32a=function(){return th(function(g){const v=Ut(g).next();return Gi(v)},arguments)},f.wbg.__wbg_done_5c1f01fb660d73b5=function(g){return Ut(g).done},f.wbg.__wbg_value_1695675138684bd5=function(g){const v=Ut(g).value;return Gi(v)},f.wbg.__wbg_iterator_97f0c81209c6c35a=function(){return Gi(Symbol.iterator)},f.wbg.__wbg_get_97b561fb56f034b5=function(){return th(function(g,v){const w=Reflect.get(Ut(g),Ut(v));return Gi(w)},arguments)},f.wbg.__wbg_call_cb65541d95d71282=function(){return th(function(g,v){const w=Ut(g).call(Ut(v));return Gi(w)},arguments)},f.wbg.__wbg_new_b51585de1b234aff=function(){const g=new Object;return Gi(g)},f.wbg.__wbg_set_502d29070ea18557=function(g,v,w){Ut(g)[v>>>0]=so(w)},f.wbg.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb=function(g){let v;try{v=Ut(g)instanceof ArrayBuffer}catch{v=!1}return v},f.wbg.__wbg_entries_e51f29c7bba0c054=function(g){const v=Object.entries(Ut(g));return Gi(v)},f.wbg.__wbg_buffer_085ec1f694018c4f=function(g){const v=Ut(g).buffer;return Gi(v)},f.wbg.__wbg_new_8125e318e6245eed=function(g){const v=new Uint8Array(Ut(g));return Gi(v)},f.wbg.__wbg_set_5cf90238115182c3=function(g,v,w){Ut(g).set(Ut(v),w>>>0)},f.wbg.__wbg_length_72e2208bbc0efc61=function(g){return Ut(g).length},f.wbg.__wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4=function(g){let v;try{v=Ut(g)instanceof Uint8Array}catch{v=!1}return v},f.wbg.__wbindgen_debug_string=function(g,v){const w=oh(Ut(v)),k=Yd(w,Ir.__wbindgen_malloc,Ir.__wbindgen_realloc),P=qc;bs()[g/4+1]=P,bs()[g/4+0]=k},f.wbg.__wbindgen_throw=function(g,v){throw new Error(eh(g,v))},f.wbg.__wbindgen_memory=function(){const g=Ir.memory;return Gi(g)},f}function pg(f,g){return Ir=f.exports,fg.__wbindgen_wasm_module=g,bl=null,vl=null,xl=null,Ir}async function fg(f){if(Ir!==void 0)return Ir;typeof f>"u"&&(f="/od2net/assets/lts_bg.wasm");const g=dg();(typeof f=="string"||typeof Request=="function"&&f instanceof Request||typeof URL=="function"&&f instanceof URL)&&(f=fetch(f));const{instance:v,module:w}=await hg(await f,g);return pg(v,w)}var lo=Math.pow,mr=(f,g,v)=>new Promise((w,k)=>{var P=ne=>{try{c(v.next(ne))}catch(ie){k(ie)}},S=ne=>{try{c(v.throw(ne))}catch(ie){k(ie)}},c=ne=>ne.done?w(ne.value):Promise.resolve(ne.value).then(P,S);c((v=v.apply(f,g)).next())}),Jr=Uint8Array,ao=Uint16Array,mg=Int32Array,Lp=new Jr([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]),Rp=new Jr([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]),gg=new Jr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Bp=function(f,g){for(var v=new ao(31),w=0;w<31;++w)v[w]=g+=1<>1|(Yt&21845)<<1,Jn=(Jn&52428)>>2|(Jn&13107)<<2,Jn=(Jn&61680)>>4|(Jn&3855)<<4,lh[Yt]=((Jn&65280)>>8|(Jn&255)<<8)>>1;var Jn,Yt,Sl=function(f,g,v){for(var w=f.length,k=0,P=new ao(g);k>ne]=ie}else for(c=new ao(w),k=0;k>15-f[k]);return c},kl=new Jr(288);for(Yt=0;Yt<144;++Yt)kl[Yt]=8;var Yt;for(Yt=144;Yt<256;++Yt)kl[Yt]=9;var Yt;for(Yt=256;Yt<280;++Yt)kl[Yt]=7;var Yt;for(Yt=280;Yt<288;++Yt)kl[Yt]=8;var Yt,Vp=new Jr(32);for(Yt=0;Yt<32;++Yt)Vp[Yt]=5;var Yt,vg=Sl(kl,9,1),bg=Sl(Vp,5,1),ih=function(f){for(var g=f[0],v=1;vg&&(g=f[v]);return g},gn=function(f,g,v){var w=g/8|0;return(f[w]|f[w+1]<<8)>>(g&7)&v},rh=function(f,g){var v=g/8|0;return(f[v]|f[v+1]<<8|f[v+2]<<16)>>(g&7)},wg=function(f){return(f+7)/8|0},Tg=function(f,g,v){(g==null||g<0)&&(g=0),(v==null||v>f.length)&&(v=f.length);var w=new Jr(v-g);return w.set(f.subarray(g,v)),w},Sg=["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"],Kr=function(f,g,v){var w=new Error(g||Sg[f]);if(w.code=f,Error.captureStackTrace&&Error.captureStackTrace(w,Kr),!v)throw w;return w},ph=function(f,g,v,w){var k=f.length,P=w?w.length:0;if(!k||g.f&&!g.l)return v||new Jr(0);var S=!v||g.i!=2,c=g.i;v||(v=new Jr(k*3));var ne=function(Lt){var Mi=v.length;if(Lt>Mi){var Ji=new Jr(Math.max(Mi*2,Lt));Ji.set(v),v=Ji}},ie=g.f||0,re=g.p||0,X=g.b||0,$=g.l,We=g.d,qe=g.m,ut=g.n,et=k*8;do{if(!$){ie=gn(f,re,1);var pt=gn(f,re+1,3);if(re+=3,pt)if(pt==1)$=vg,We=bg,qe=9,ut=5;else if(pt==2){var ot=gn(f,re,31)+257,Bt=gn(f,re+10,15)+4,Ke=ot+gn(f,re+5,31)+1;re+=14;for(var Dt=new Jr(Ke),ct=new Jr(19),_t=0;_t>4;if(Xe<16)Dt[_t++]=Xe;else{var bt=0,st=0;for(Xe==16?(st=3+gn(f,re,3),re+=2,bt=Dt[_t-1]):Xe==17?(st=3+gn(f,re,7),re+=3):Xe==18&&(st=11+gn(f,re,127),re+=7);st--;)Dt[_t++]=bt}}var qt=Dt.subarray(0,ot),wt=Dt.subarray(ot);qe=ih(qt),ut=ih(wt),$=Sl(qt,qe,1),We=Sl(wt,ut,1)}else Kr(1);else{var Xe=wg(re)+4,Ge=f[Xe-4]|f[Xe-3]<<8,rt=Xe+Ge;if(rt>k){c&&Kr(0);break}S&&ne(X+Ge),v.set(f.subarray(Xe,rt),X),g.b=X+=Ge,g.p=re=rt*8,g.f=ie;continue}if(re>et){c&&Kr(0);break}}S&&ne(X+131072);for(var Hi=(1<>4;if(re+=bt&15,re>et){c&&Kr(0);break}if(bt||Kr(2),At<256)v[X++]=At;else if(At==256){Ft=re,$=null;break}else{var ei=At-254;if(At>264){var _t=At-257,Nt=Lp[_t];ei=gn(f,re,(1<>4;hi||Kr(3),re+=hi&15;var wt=xg[Ht];if(Ht>3){var Nt=Rp[Ht];wt+=rh(f,re)&(1<et){c&&Kr(0);break}S&&ne(X+131072);var Wt=X+ei;if(X>3&1)+(g>>4&1);w>0;w-=!f[v++]);return v+(g&2)},Cg=function(f){var g=f.length;return(f[g-4]|f[g-3]<<8|f[g-2]<<16|f[g-1]<<24)>>>0},kg=function(f,g){return((f[0]&15)!=8||f[0]>>4>7||(f[0]<<8|f[1])%31)&&Kr(6,"invalid zlib data"),(f[1]>>5&1)==+!g&&Kr(6,"invalid zlib data: "+(f[1]&32?"need":"unexpected")+" dictionary"),(f[1]>>3&4)+2};function Eg(f,g){return ph(f,{i:2},g&&g.out,g&&g.dictionary)}function Mg(f,g){var v=Ag(f);return v+8>f.length&&Kr(6,"invalid gzip data"),ph(f.subarray(v,-8),{i:2},g&&g.out||new Jr(Cg(f)),g&&g.dictionary)}function Pg(f,g){return ph(f.subarray(kg(f,g&&g.dictionary),-4),{i:2},g&&g.out,g&&g.dictionary)}function ch(f,g){return f[0]==31&&f[1]==139&&f[2]==8?Mg(f,g):(f[0]&15)!=8||f[0]>>4>7||(f[0]<<8|f[1])%31?Eg(f,g):Pg(f,g)}var zg=typeof TextDecoder<"u"&&new TextDecoder,Dg=0;try{zg.decode(Ig,{stream:!0}),Dg=1}catch{}var Up=(f,g)=>f*lo(2,g),gl=(f,g)=>Math.floor(f/lo(2,g)),Zc=(f,g)=>Up(f.getUint16(g+1,!0),8)+f.getUint8(g),Np=(f,g)=>Up(f.getUint32(g+2,!0),16)+f.getUint16(g,!0),Lg=(f,g,v,w,k)=>{if(f!==w.getUint8(k))return f-w.getUint8(k);const P=Zc(w,k+1);if(g!==P)return g-P;const S=Zc(w,k+4);return v!==S?v-S:0},Rg=(f,g,v,w)=>{const k=jp(f,g|128,v,w);return k?{z:g,x:v,y:w,offset:k[0],length:k[1],isDir:!0}:null},Qd=(f,g,v,w)=>{const k=jp(f,g,v,w);return k?{z:g,x:v,y:w,offset:k[0],length:k[1],isDir:!1}:null},jp=(f,g,v,w)=>{let k=0,P=f.byteLength/17-1;for(;k<=P;){const S=P+k>>1,c=Lg(g,v,w,f,S*17);if(c>0)k=S+1;else if(c<0)P=S-1;else return[Np(f,S*17+7),f.getUint32(S*17+13,!0)]}return null},Bg=(f,g)=>f.isDir&&!g.isDir?1:!f.isDir&&g.isDir?-1:f.z!==g.z?f.z-g.z:f.x!==g.x?f.x-g.x:f.y-g.y,qp=(f,g)=>{const v=f.getUint8(g*17);return{z:v&127,x:Zc(f,g*17+1),y:Zc(f,g*17+4),offset:Np(f,g*17+7),length:f.getUint32(g*17+13,!0),isDir:v>>7===1}},$d=f=>{const g=[],v=new DataView(f);for(let w=0;w{f.sort(Bg);const g=new ArrayBuffer(17*f.length),v=new Uint8Array(g);for(let w=0;w>8&255,v[w*17+3]=k.x>>16&255,v[w*17+4]=k.y&255,v[w*17+5]=k.y>>8&255,v[w*17+6]=k.y>>16&255,v[w*17+7]=k.offset&255,v[w*17+8]=gl(k.offset,8)&255,v[w*17+9]=gl(k.offset,16)&255,v[w*17+10]=gl(k.offset,24)&255,v[w*17+11]=gl(k.offset,32)&255,v[w*17+12]=gl(k.offset,48)&255,v[w*17+13]=k.length&255,v[w*17+14]=k.length>>8&255,v[w*17+15]=k.length>>16&255,v[w*17+16]=k.length>>24&255}return g},Og=(f,g)=>{if(f.byteLength<17)return null;const v=f.byteLength/17,w=qp(f,v-1);if(w.isDir){const k=w.z,P=g.z-k,S=Math.trunc(g.x/(1<(g,v)=>{if(v instanceof AbortController)return f(g,v);const w=new AbortController;return f(g,w).then(k=>v(void 0,k.data,k.cacheControl||"",k.expires||""),k=>v(k)).catch(k=>v(k)),{cancel:()=>w.abort()}},sy=class{constructor(){this.tilev4=(f,g)=>mr(this,null,function*(){if(f.type==="json"){const X=f.url.substr(10);let $=this.tiles.get(X);$||($=new ep(X),this.tiles.set(X,$));const We=yield $.getHeader();return{data:{tiles:[`${f.url}/{z}/{x}/{y}`],minzoom:We.minZoom,maxzoom:We.maxZoom,bounds:[We.minLon,We.minLat,We.maxLon,We.maxLat]}}}const v=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),w=f.url.match(v);if(!w)throw new Error("Invalid PMTiles protocol URL");const k=w[1];let P=this.tiles.get(k);P||(P=new ep(k),this.tiles.set(k,P));const S=w[2],c=w[3],ne=w[4],ie=yield P.getHeader(),re=yield P==null?void 0:P.getZxy(+S,+c,+ne,g.signal);return re?{data:new Uint8Array(re.data),cacheControl:re.cacheControl,expires:re.expires}:ie.tileType===1?{data:new Uint8Array}:{data:null}}),this.tile=Ng(this.tilev4),this.tiles=new Map}add(f){this.tiles.set(f.source.getKey(),f)}get(f){return this.tiles.get(f)}};function eo(f,g){return(g>>>0)*4294967296+(f>>>0)}function jg(f,g){const v=g.buf;let w=v[g.pos++],k=(w&112)>>4;if(w<128||(w=v[g.pos++],k|=(w&127)<<3,w<128)||(w=v[g.pos++],k|=(w&127)<<10,w<128)||(w=v[g.pos++],k|=(w&127)<<17,w<128)||(w=v[g.pos++],k|=(w&127)<<24,w<128)||(w=v[g.pos++],k|=(w&1)<<31,w<128))return eo(f,k);throw new Error("Expected varint not more than 10 bytes")}function _l(f){const g=f.buf;let v=g[f.pos++],w=v&127;return v<128||(v=g[f.pos++],w|=(v&127)<<7,v<128)||(v=g[f.pos++],w|=(v&127)<<14,v<128)||(v=g[f.pos++],w|=(v&127)<<21,v<128)?w:(v=g[f.pos],w|=(v&15)<<28,jg(w,f))}function qg(f,g,v,w){if(w===0){v===1&&(g[0]=f-1-g[0],g[1]=f-1-g[1]);const k=g[0];g[0]=g[1],g[1]=k}}var Zg=[0,1,5,21,85,341,1365,5461,21845,87381,349525,1398101,5592405,22369621,89478485,357913941,1431655765,5726623061,22906492245,91625968981,366503875925,1466015503701,5864062014805,23456248059221,93824992236885,375299968947541,0x5555555555555];function Gg(f,g,v){if(f>26)throw Error("Tile zoom level exceeds max safe number limit (26)");if(g>lo(2,f)-1||v>lo(2,f)-1)throw Error("tile x/y outside zoom level bounds");const w=Zg[f],k=lo(2,f);let P=0,S=0,c=0;const ne=[g,v];let ie=k/2;for(;ie>0;)P=(ne[0]&ie)>0?1:0,S=(ne[1]&ie)>0?1:0,c+=ie*ie*(3*P^S),qg(ie,ne,P,S),ie=ie/2;return w+c}function Gp(f,g){return mr(this,null,function*(){if(g===1||g===0)return f;if(g===2){if(typeof globalThis.DecompressionStream>"u")return ch(new Uint8Array(f));const v=new Response(f).body;if(!v)throw Error("Failed to read response stream");const w=v.pipeThrough(new globalThis.DecompressionStream("gzip"));return new Response(w).arrayBuffer()}throw Error("Compression method not supported")})}var Hg=127;function Wg(f,g){let v=0,w=f.length-1;for(;v<=w;){const k=w+v>>1,P=g-f[k].tileId;if(P>0)v=k+1;else if(P<0)w=k-1;else return f[k]}return w>=0&&(f[w].runLength===0||g-f[w].tileId=300)throw Error(`Bad response code: ${ne.status}`);const re=ne.headers.get("Content-Length");if(ne.status===200&&(!re||+re>g))throw k&&k.abort(),Error("Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.");return{data:yield ne.arrayBuffer(),etag:ie||void 0,cacheControl:ne.headers.get("Cache-Control")||void 0,expires:ne.headers.get("Expires")||void 0}})}};function _n(f,g){const v=f.getUint32(g+4,!0),w=f.getUint32(g+0,!0);return v*lo(2,32)+w}function Kg(f,g){const v=new DataView(f),w=v.getUint8(7);if(w>3)throw Error(`Archive is spec version ${w} but this library supports up to spec version 3`);return{specVersion:w,rootDirectoryOffset:_n(v,8),rootDirectoryLength:_n(v,16),jsonMetadataOffset:_n(v,24),jsonMetadataLength:_n(v,32),leafDirectoryOffset:_n(v,40),leafDirectoryLength:_n(v,48),tileDataOffset:_n(v,56),tileDataLength:_n(v,64),numAddressedTiles:_n(v,72),numTileEntries:_n(v,80),numTileContents:_n(v,88),clustered:v.getUint8(96)===1,internalCompression:v.getUint8(97),tileCompression:v.getUint8(98),tileType:v.getUint8(99),minZoom:v.getUint8(100),maxZoom:v.getUint8(101),minLon:v.getInt32(102,!0)/1e7,minLat:v.getInt32(106,!0)/1e7,maxLon:v.getInt32(110,!0)/1e7,maxLat:v.getInt32(114,!0)/1e7,centerZoom:v.getUint8(118),centerLon:v.getInt32(119,!0)/1e7,centerLat:v.getInt32(123,!0)/1e7,etag:g}}function Hp(f){const g={buf:new Uint8Array(f),pos:0},v=_l(g),w=[];let k=0;for(let P=0;P0?w[P].offset=w[P-1].offset+w[P-1].length:w[P].offset=S-1}return w}function Jg(f){const g=new DataView(f);return g.getUint16(2,!0)===2?(console.warn("PMTiles spec version 2 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),2):g.getUint16(2,!0)===1?(console.warn("PMTiles spec version 1 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),1):3}var uh=class extends Error{};function Yg(f,g){return mr(this,null,function*(){const v=yield f.getBytes(0,16384);if(new DataView(v.data).getUint16(0,!0)!==19792)throw new Error("Wrong magic number for PMTiles archive");if(Jg(v.data)<3)return[yield Zp.getHeader(f)];const k=v.data.slice(0,Hg),P=Kg(k,v.etag),S=v.data.slice(P.rootDirectoryOffset,P.rootDirectoryOffset+P.rootDirectoryLength),c=`${f.getKey()}|${P.etag||""}|${P.rootDirectoryOffset}|${P.rootDirectoryLength}`,ne=Hp(yield g(S,P.internalCompression));return[P,[c,ne.length,ne]]})}function Qg(f,g,v,w,k){return mr(this,null,function*(){const P=yield f.getBytes(v,w,void 0,k.etag),S=yield g(P.data,k.internalCompression),c=Hp(S);if(c.length===0)throw new Error("Empty directory is invalid");return c})}var $g=class{constructor(f=100,g=!0,v=Gp){this.cache=new Map,this.invalidations=new Map,this.maxCacheEntries=f,this.counter=1,this.decompress=v}getHeader(f){return mr(this,null,function*(){const g=f.getKey(),v=this.cache.get(g);if(v)return v.lastUsed=this.counter++,yield v.data;const w=new Promise((k,P)=>{Yg(f,this.decompress).then(S=>{S[1]&&this.cache.set(S[1][0],{lastUsed:this.counter++,data:Promise.resolve(S[1][2])}),k(S[0]),this.prune()}).catch(S=>{P(S)})});return this.cache.set(g,{lastUsed:this.counter++,data:w}),w})}getDirectory(f,g,v,w){return mr(this,null,function*(){const k=`${f.getKey()}|${w.etag||""}|${g}|${v}`,P=this.cache.get(k);if(P)return P.lastUsed=this.counter++,yield P.data;const S=new Promise((c,ne)=>{Qg(f,this.decompress,g,v,w).then(ie=>{c(ie),this.prune()}).catch(ie=>{ne(ie)})});return this.cache.set(k,{lastUsed:this.counter++,data:S}),S})}getArrayBuffer(f,g,v,w){return mr(this,null,function*(){const k=`${f.getKey()}|${w.etag||""}|${g}|${v}`,P=this.cache.get(k);if(P)return P.lastUsed=this.counter++,yield P.data;const S=new Promise((c,ne)=>{f.getBytes(g,v,void 0,w.etag).then(ie=>{c(ie.data),this.cache.has(k),this.prune()}).catch(ie=>{ne(ie)})});return this.cache.set(k,{lastUsed:this.counter++,data:S}),S})}prune(){if(this.cache.size>=this.maxCacheEntries){let f=1/0,g;this.cache.forEach((v,w)=>{v.lastUsed{this.getHeader(f).then(P=>{w(),this.invalidations.delete(g)}).catch(P=>{k(P)})});this.invalidations.set(g,v)})}},ep=class{constructor(f,g,v){typeof f=="string"?this.source=new Xg(f):this.source=f,v?this.decompress=v:this.decompress=Gp,g?this.cache=g:this.cache=new $g}getHeader(){return mr(this,null,function*(){return yield this.cache.getHeader(this.source)})}getZxyAttempt(f,g,v,w){return mr(this,null,function*(){const k=Gg(f,g,v),P=yield this.cache.getHeader(this.source);if(P.specVersion<3)return Zp.getZxy(P,this.source,this.cache,f,g,v,w);if(fP.maxZoom)return;let S=P.rootDirectoryOffset,c=P.rootDirectoryLength;for(let ne=0;ne<=3;ne++){const ie=yield this.cache.getDirectory(this.source,S,c,P),re=Wg(ie,k);if(re){if(re.runLength>0){const X=yield this.source.getBytes(P.tileDataOffset+re.offset,re.length,w,P.etag);return{data:yield this.decompress(X.data,P.tileCompression),cacheControl:X.cacheControl,expires:X.expires}}S=P.leafDirectoryOffset+re.offset,c=re.length}else return}throw Error("Maximum directory depth exceeded")})}getZxy(f,g,v,w){return mr(this,null,function*(){try{return yield this.getZxyAttempt(f,g,v,w)}catch(k){if(k instanceof uh)return this.cache.invalidate(this.source),yield this.getZxyAttempt(f,g,v,w);throw k}})}getMetadataAttempt(){return mr(this,null,function*(){const f=yield this.cache.getHeader(this.source),g=yield this.source.getBytes(f.jsonMetadataOffset,f.jsonMetadataLength,void 0,f.etag),v=yield this.decompress(g.data,f.internalCompression),w=new TextDecoder("utf-8");return JSON.parse(w.decode(v))})}getMetadata(){return mr(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(f){if(f instanceof uh)return this.cache.invalidate(this.source),yield this.getMetadataAttempt();throw f}})}};const to=[];function nh(f,g){return{subscribe:En(f,g).subscribe}}function En(f,g=Ar){let v;const w=new Set;function k(c){if(Br(f,c)&&(f=c,v)){const ne=!to.length;for(const ie of w)ie[1](),to.push(ie,f);if(ne){for(let ie=0;ie{w.delete(ie),w.size===0&&v&&(v(),v=null)}}return{set:k,update:P,subscribe:S}}let e_=Date.now();function Wp(f){return`${f}-${e_++}`}const fh=Symbol.for("svelte-maplibre");function fo(){return eg(fh)}function t_(f){let g=new WeakMap;return v=>{var S;let w=g.get(v.originalEvent);if(w!==void 0)return w;let P=(S=v.target.queryRenderedFeatures(v.point).find(c=>{var ne;return(ne=f.get(c.layer.id))==null?void 0:ne.interactive}))==null?void 0:S.layer.id;return g.set(v.originalEvent,P),P}}function i_(){let f=new Map;return Ep(fh,{map:En(null),source:nh(null),layer:nh(null),popupTarget:nh(null),cluster:En(),loadedImages:En(new Set),minzoom:En(0),maxzoom:En(24),layerEvent:En(null),layerInfo:f,eventTopMost:t_(f)})}function tp(f){return{subscribe:f.subscribe}}function mh({key:f,setPopupTarget:g=!1,setCluster:v=!1,setMouseEvent:w=!1}){let k=fo(),P=En(null),S=tp(P),c={...k,[f]:tp(P)};if(g&&(c.popupTarget=S),w){let ne=En(null);c.layerEvent=ne,k.layerEvent=ne}return v&&(c.cluster=En()),Ep(fh,c),{...k,self:P}}function oy(){return mh({key:"source",setCluster:!0})}function r_(f=!0){return mh({key:"layer",setPopupTarget:f,setMouseEvent:f})}function ly(){return mh({key:"popupTarget",setPopupTarget:!0,setMouseEvent:!0})}function n_(f){return"layerType"in f&&f.layerType==="deckgl"}var s_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function a_(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var Xp={exports:{}};/** + * MapLibre GL JS + * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.0.2/LICENSE.txt + */(function(f,g){(function(v,w){f.exports=w()})(s_,function(){var v={},w={};function k(S,c,ne){if(w[S]=ne,S==="index"){var ie="var sharedModule = {}; ("+w.shared+")(sharedModule); ("+w.worker+")(sharedModule);",re={};return w.shared(re),w.index(v,re),typeof window<"u"&&v.setWorkerUrl(window.URL.createObjectURL(new Blob([ie],{type:"text/javascript"}))),v}}k("shared",["exports"],function(S){function c(i,e,r,s){return new(r||(r=Promise))(function(o,d){function p(T){try{y(s.next(T))}catch(A){d(A)}}function m(T){try{y(s.throw(T))}catch(A){d(A)}}function y(T){var A;T.done?o(T.value):(A=T.value,A instanceof r?A:new r(function(C){C(A)})).then(p,m)}y((s=s.apply(i,e||[])).next())})}function ne(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var ie=re;function re(i,e){this.x=i,this.y=e}re.prototype={clone:function(){return new re(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),s=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=s,this},_rotateAround:function(i,e){var r=Math.cos(i),s=Math.sin(i),o=e.y+s*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-s*(this.y-e.y),this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},re.convert=function(i){return i instanceof re?i:Array.isArray(i)?new re(i[0],i[1]):i};var X=ne(ie),$=We;function We(i,e,r,s){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(s-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=s}We.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,s=0;s<8;s++){var o=this.sampleCurveX(r)-i;if(Math.abs(o)o?p=r:m=r,r=.5*(m-p)+p;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var qe=ne($);let ut,et;function pt(){return ut==null&&(ut=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ut}function Xe(){if(et==null&&(et=!1,pt())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let s=0;s<5*5;s++){const o=4*s;e.fillStyle=`rgb(${o},${o+1},${o+2})`,e.fillRect(s%5,Math.floor(s/5),1,1)}const r=e.getImageData(0,0,5,5).data;for(let s=0;s<5*5*4;s++)if(s%4!=3&&r[s]!==s){et=!0;break}}}return et||!1}function Ge(i,e,r,s){const o=new qe(i,e,r,s);return function(d){return o.solve(d)}}const rt=Ge(.25,.1,.25,1);function ot(i,e,r){return Math.min(r,Math.max(e,i))}function Bt(i,e,r){const s=r-e,o=((i-e)%s+s)%s+e;return o===e?r:o}function Ke(i,...e){for(const r of e)for(const s in r)i[s]=r[s];return i}let Dt=1;function ct(i,e,r){const s={};for(const o in i)s[o]=e.call(r||this,i[o],o,i);return s}function _t(i,e,r){const s={};for(const o in i)e.call(r||this,i[o],o,i)&&(s[o]=i[o]);return s}function _e(i){return Array.isArray(i)?i.map(_e):typeof i=="object"&&i?ct(i,_e):i}const Ze={};function nt(i){Ze[i]||(typeof console<"u"&&console.warn(i),Ze[i]=!0)}function yt(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function bt(i){let e=0;for(let r,s,o=0,d=i.length,p=d-1;o"u")throw new Error("VideoFrame not supported");const d=new VideoFrame(i,{timestamp:0});try{const p=d==null?void 0:d.format;if(!p||!p.startsWith("BGR")&&!p.startsWith("RGB"))throw new Error(`Unrecognized format ${p}`);const m=p.startsWith("BGR"),y=new Uint8ClampedArray(s*o*4);if(yield d.copyTo(y,function(T,A,C,D,R){const F=4*Math.max(-A,0),V=(Math.max(0,C)-C)*D*4+F,Z=4*D,K=Math.max(0,A),le=Math.max(0,C);return{rect:{x:K,y:le,width:Math.min(T.width,A+D)-K,height:Math.min(T.height,C+R)-le},layout:[{offset:V,stride:Z}]}}(i,e,r,s,o)),m)for(let T=0;Tst(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Lt=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){const s=Ht(i.url);if(s)return s(i,e);if(st(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"getResource",data:i,targetMapId:Wt},e)}if(!(/^file:/.test(r=i.url)||/^file:/.test(it())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(s,o){return c(this,void 0,void 0,function*(){const d=new Request(s.url,{method:s.method||"GET",body:s.body,credentials:s.credentials,headers:s.headers,cache:s.cache,referrer:it(),signal:o.signal});s.type==="json"&&d.headers.set("Accept","application/json");const p=yield fetch(d);if(!p.ok){const T=yield p.blob();throw new Ae(p.status,p.statusText,s.url,T)}const m=s.type==="arrayBuffer"||s.type==="image"?p.arrayBuffer():s.type==="json"?p.json():p.text(),y=yield m;if(o.signal.aborted)throw Nt();return{data:y,cacheControl:p.headers.get("Cache-Control"),expires:p.headers.get("Expires")}})}(i,e);if(st(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"getResource",data:i,mustQueue:!0,targetMapId:Wt},e)}var r;return function(s,o){return new Promise((d,p)=>{const m=new XMLHttpRequest;m.open(s.method||"GET",s.url,!0),s.type!=="arrayBuffer"&&s.type!=="image"||(m.responseType="arraybuffer");for(const y in s.headers)m.setRequestHeader(y,s.headers[y]);s.type==="json"&&(m.responseType="text",m.setRequestHeader("Accept","application/json")),m.withCredentials=s.credentials==="include",m.onerror=()=>{p(new Error(m.statusText))},m.onload=()=>{if(!o.signal.aborted)if((m.status>=200&&m.status<300||m.status===0)&&m.response!==null){let y=m.response;if(s.type==="json")try{y=JSON.parse(m.response)}catch(T){return void p(T)}d({data:y,cacheControl:m.getResponseHeader("Cache-Control"),expires:m.getResponseHeader("Expires")})}else{const y=new Blob([m.response],{type:m.getResponseHeader("Content-Type")});p(new Ae(m.status,m.statusText,s.url,y))}},o.signal.addEventListener("abort",()=>{m.abort(),p(Nt())}),m.send(s.body)})}(i,e)};function Mi(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const e=new URL(i),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function Ji(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function he(i,e,r){if(r&&r[i]){const s=r[i].indexOf(e);s!==-1&&r[i].splice(s,1)}}class Ot{constructor(e,r={}){Ke(this,r),this.type=e}}class jt extends Ot{constructor(e,r={}){super("error",Ke({error:e},r))}}class Wi{on(e,r){return this._listeners=this._listeners||{},Ji(e,r,this._listeners),this}off(e,r){return he(e,r,this._listeners),he(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Ji(e,r,this._oneTimeListeners),this):new Promise(s=>this.once(e,s))}fire(e,r){typeof e=="string"&&(e=new Ot(e,r||{}));const s=e.type;if(this.listens(s)){e.target=this;const o=this._listeners&&this._listeners[s]?this._listeners[s].slice():[];for(const m of o)m.call(this,e);const d=this._oneTimeListeners&&this._oneTimeListeners[s]?this._oneTimeListeners[s].slice():[];for(const m of d)he(s,m,this._oneTimeListeners),m.call(this,e);const p=this._eventedParent;p&&(Ke(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(e))}else e instanceof jt&&console.error(e.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,r){return this._eventedParent=e,this._eventedParentData=r,this}}var fe={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const Yi=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function xn(i,e){const r={};for(const s in i)s!=="ref"&&(r[s]=i[s]);return Yi.forEach(s=>{s in e&&(r[s]=e[s])}),r}function Mt(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let r=0;r`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const ee=[Qi,Me,xt,ft,Ai,Pi,rn,O(ht),G,z,L];function te(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!te(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of ee)if(!te(r,e))return null}}return`Expected ${N(i)} but found ${N(e)} instead.`}function oe(i,e){return e.some(r=>r.kind===i.kind)}function Y(i,e){return e.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function ce(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}const be=.96422,ge=.82521,ye=4/29,He=6/29,Ye=3*He*He,dt=He*He*He,lt=Math.PI/180,Pt=180/Math.PI;function Xt(i){return(i%=360)<0&&(i+=360),i}function li([i,e,r,s]){let o,d;const p=mt((.2225045*(i=Ci(i))+.7168786*(e=Ci(e))+.0606169*(r=Ci(r)))/1);i===e&&e===r?o=d=p:(o=mt((.4360747*i+.3850649*e+.1430804*r)/be),d=mt((.0139322*i+.0971045*e+.7141733*r)/ge));const m=116*p-16;return[m<0?0:m,500*(o-p),200*(p-d),s]}function Ci(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function mt(i){return i>dt?Math.pow(i,1/3):i/Ye+ye}function di([i,e,r,s]){let o=(i+16)/116,d=isNaN(e)?o:o+e/500,p=isNaN(r)?o:o-r/200;return o=1*sr(o),d=be*sr(d),p=ge*sr(p),[zi(3.1338561*d-1.6168667*o-.4906146*p),zi(-.9787684*d+1.9161415*o+.033454*p),zi(.0719453*d-.2289914*o+1.4052427*p),s]}function zi(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function sr(i){return i>He?i*i*i:Ye*(i-ye)}function gr(i){return parseInt(i.padEnd(2,i),16)/255}function ji(i,e){return nn(e?i/100:i,0,1)}function nn(i,e,r){return Math.min(Math.max(e,i),r)}function El(i){return!i.some(Number.isNaN)}const Hc={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Zt{constructor(e,r,s,o=1,d=!0){this.r=e,this.g=r,this.b=s,this.a=o,d||(this.r*=o,this.g*=o,this.b*=o,o||this.overwriteGetter("rgb",[e,r,s,o]))}static parse(e){if(e instanceof Zt)return e;if(typeof e!="string")return;const r=function(s){if((s=s.toLowerCase().trim())==="transparent")return[0,0,0,0];const o=Hc[s];if(o){const[p,m,y]=o;return[p/255,m/255,y/255,1]}if(s.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(s)){const p=s.length<6?1:2;let m=1;return[gr(s.slice(m,m+=p)),gr(s.slice(m,m+=p)),gr(s.slice(m,m+=p)),gr(s.slice(m,m+p)||"ff")]}if(s.startsWith("rgb")){const p=s.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){const[m,y,T,A,C,D,R,F,V,Z,K,le]=p,J=[A||" ",R||" ",Z].join("");if(J===" "||J===" /"||J===",,"||J===",,,"){const se=[T,D,V].join(""),me=se==="%%%"?100:se===""?255:0;if(me){const ve=[nn(+y/me,0,1),nn(+C/me,0,1),nn(+F/me,0,1),K?ji(+K,le):1];if(El(ve))return ve}}return}}const d=s.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[p,m,y,T,A,C,D,R,F]=d,V=[y||" ",A||" ",D].join("");if(V===" "||V===" /"||V===",,"||V===",,,"){const Z=[+m,nn(+T,0,100),nn(+C,0,100),R?ji(+R,F):1];if(El(Z))return function([K,le,J,se]){function me(ve){const Re=(ve+K/30)%12,Ue=le*Math.min(J,1-J);return J-Ue*Math.max(-1,Math.min(Re-3,9-Re,1))}return K=Xt(K),le/=100,J/=100,[me(0),me(8),me(4),se]}(Z)}}}(e);return r?new Zt(...r,!1):void 0}get rgb(){const{r:e,g:r,b:s,a:o}=this,d=o||1/0;return this.overwriteGetter("rgb",[e/d,r/d,s/d,o])}get hcl(){return this.overwriteGetter("hcl",function(e){const[r,s,o,d]=li(e),p=Math.sqrt(s*s+o*o);return[Math.round(1e4*p)?Xt(Math.atan2(o,s)*Pt):NaN,p,r,d]}(this.rgb))}get lab(){return this.overwriteGetter("lab",li(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){const[e,r,s,o]=this.rgb;return`rgba(${[e,r,s].map(d=>Math.round(255*d)).join(",")},${o})`}}Zt.black=new Zt(0,0,0,1),Zt.white=new Zt(1,1,1,1),Zt.transparent=new Zt(0,0,0,0),Zt.red=new Zt(1,0,0,1);class mo{constructor(e,r,s){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=s,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class go{constructor(e,r,s,o,d){this.text=e,this.image=r,this.scale=s,this.fontStack=o,this.textColor=d}}class kr{constructor(e){this.sections=e}static fromString(e){return new kr([new go(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof kr?e:kr.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class _r{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof _r)return e;if(typeof e=="number")return new _r([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new _r(e)}}toString(){return JSON.stringify(this.values)}}const Ts=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Fr{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Fr)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let r=0;r=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?s===void 0||typeof s=="number"&&s>=0&&s<=1?null:`Invalid rgba value [${[i,e,r,s].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof s=="number"?[i,e,r,s]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function na(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof Zt||i instanceof mo||i instanceof kr||i instanceof _r||i instanceof Fr||i instanceof Or)return!0;if(Array.isArray(i)){for(const e of i)if(!na(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!na(i[e]))return!1;return!0}return!1}function ki(i){if(i===null)return Qi;if(typeof i=="string")return xt;if(typeof i=="boolean")return ft;if(typeof i=="number")return Me;if(i instanceof Zt)return Ai;if(i instanceof mo)return zn;if(i instanceof kr)return Pi;if(i instanceof _r)return G;if(i instanceof Fr)return L;if(i instanceof Or)return z;if(Array.isArray(i)){const e=i.length;let r;for(const s of i){const o=ki(s);if(r){if(r===o)continue;r=ht;break}r=o}return O(r||ht,e)}return rn}function Ss(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof Zt||i instanceof kr||i instanceof _r||i instanceof Fr||i instanceof Or?i.toString():JSON.stringify(i)}class vn{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!na(e[1]))return r.error("invalid value");const s=e[1];let o=ki(s);const d=r.expectedType;return o.kind!=="array"||o.N!==0||!d||d.kind!=="array"||typeof d.N=="number"&&d.N!==0||(o=d),new vn(o,s)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ui{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const sa={string:xt,number:Me,boolean:ft,object:rn};class Er{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let s,o=1;const d=e[0];if(d==="array"){let m,y;if(e.length>2){const T=e[1];if(typeof T!="string"||!(T in sa)||T==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);m=sa[T],o++}else m=ht;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);y=e[2],o++}s=O(m,y)}else{if(!sa[d])throw new Error(`Types doesn't contain name = ${d}`);s=sa[d]}const p=[];for(;oe.outputDefined())}}const aa={"to-boolean":ft,"to-color":Ai,"to-number":Me,"to-string":xt};class sn{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const s=e[0];if(!aa[s])throw new Error(`Can't parse ${s} as it is not part of the known types`);if((s==="to-boolean"||s==="to-string")&&e.length!==2)return r.error("Expected one argument.");const o=aa[s],d=[];for(let p=1;p4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:ts(r[0],r[1],r[2],r[3]),!s))return new Zt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new ui(s||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const s of this.args){r=s.evaluate(e);const o=_r.parse(r);if(o)return o}throw new ui(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const s of this.args){r=s.evaluate(e);const o=Fr.parse(r);if(o)return o}throw new ui(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const s of this.args){if(r=s.evaluate(e),r===null)return 0;const o=Number(r);if(!isNaN(o))return o}throw new ui(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return kr.fromString(Ss(this.args[0].evaluate(e)));case"resolvedImage":return Or.fromString(Ss(this.args[0].evaluate(e)));default:return Ss(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const Is=["Unknown","Point","LineString","Polygon"];class Gt{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Is[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=Zt.parse(e)),r}}class oa{constructor(e,r,s=[],o,d=new ws,p=[]){this.registry=e,this.path=s,this.key=s.map(m=>`[${m}]`).join(""),this.scope=d,this.errors=p,this.expectedType=o,this._isConstant=r}parse(e,r,s,o,d={}){return r?this.concat(r,s,o)._parse(e,d):this._parse(e,d)}_parse(e,r){function s(o,d,p){return p==="assert"?new Er(d,[o]):p==="coerce"?new sn(d,[o]):o}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 o=e[0];if(typeof o!="string")return this.error(`Expression name must be a string, but found ${typeof o} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const d=this.registry[o];if(d){let p=d.parse(e,this);if(!p)return null;if(this.expectedType){const m=this.expectedType,y=p.type;if(m.kind!=="string"&&m.kind!=="number"&&m.kind!=="boolean"&&m.kind!=="object"&&m.kind!=="array"||y.kind!=="value")if(m.kind!=="color"&&m.kind!=="formatted"&&m.kind!=="resolvedImage"||y.kind!=="value"&&y.kind!=="string")if(m.kind!=="padding"||y.kind!=="value"&&y.kind!=="number"&&y.kind!=="array")if(m.kind!=="variableAnchorOffsetCollection"||y.kind!=="value"&&y.kind!=="array"){if(this.checkSubtype(m,y))return null}else p=s(p,m,r.typeAnnotation||"coerce");else p=s(p,m,r.typeAnnotation||"coerce");else p=s(p,m,r.typeAnnotation||"coerce");else p=s(p,m,r.typeAnnotation||"assert")}if(!(p instanceof vn)&&p.type.kind!=="resolvedImage"&&this._isConstant(p)){const m=new Gt;try{p=new vn(p.type,p.evaluate(m))}catch(y){return this.error(y.message),null}}return p}return this.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0)}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,r,s){const o=typeof e=="number"?this.path.concat(e):this.path,d=s?this.scope.concat(s):this.scope;return new oa(this.registry,this._isConstant,o,r||null,d,this.errors)}error(e,...r){const s=`${this.key}${r.map(o=>`[${o}]`).join("")}`;this.errors.push(new Cr(s,e))}checkSubtype(e,r){const s=te(e,r);return s&&this.error(s),s}}class is{constructor(e,r,s){this.type=zn,this.locale=s,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const s=e[1];if(typeof s!="object"||Array.isArray(s))return r.error("Collator options argument must be an object.");const o=r.parse(s["case-sensitive"]!==void 0&&s["case-sensitive"],1,ft);if(!o)return null;const d=r.parse(s["diacritic-sensitive"]!==void 0&&s["diacritic-sensitive"],1,ft);if(!d)return null;let p=null;return s.locale&&(p=r.parse(s.locale,1,xt),!p)?null:new is(o,d,p)}evaluate(e){return new mo(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}const bn=8192;function la(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function As(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function Wc(i,e){const r=(180+i[0])/360,s=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,o=Math.pow(2,e.z);return[Math.round(r*o*bn),Math.round(s*o*bn)]}function Ml(i,e,r){const s=i[0]-e[0],o=i[1]-e[1],d=i[0]-r[0],p=i[1]-r[1];return s*p-d*o==0&&s*d<=0&&o*p<=0}function ca(i,e){let r=!1;for(let p=0,m=e.length;p(s=i)[1]!=(d=y[T+1])[1]>s[1]&&s[0]<(d[0]-o[0])*(s[1]-o[1])/(d[1]-o[1])+o[0]&&(r=!r)}}var s,o,d;return r}function Xc(i,e){for(let r=0;r0&&m<0||p<0&&m>0}function Kc(i,e,r){for(const T of r)for(let A=0;Ar[2]){const o=.5*s;let d=i[0]-r[0]>o?-s:r[0]-i[0]>o?s:0;d===0&&(d=i[0]-r[2]>o?-s:r[2]-i[0]>o?s:0),i[0]+=d}la(e,i)}function ha(i,e,r,s){const o=Math.pow(2,s.z)*bn,d=[s.x*bn,s.y*bn],p=[];for(const m of i)for(const y of m){const T=[y.x+d[0],y.y+d[1]];Rl(T,e,r,o),p.push(T)}return p}function Bl(i,e,r,s){const o=Math.pow(2,s.z)*bn,d=[s.x*bn,s.y*bn],p=[];for(const y of i){const T=[];for(const A of y){const C=[A.x+d[0],A.y+d[1]];la(e,C),T.push(C)}p.push(T)}if(e[2]-e[0]<=o/2){(m=e)[0]=m[1]=1/0,m[2]=m[3]=-1/0;for(const y of p)for(const T of y)Rl(T,e,r,o)}var m;return p}class Dn{constructor(e,r){this.type=ft,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(na(e[1])){const s=e[1];if(s.type==="FeatureCollection"){const o=[];for(const d of s.features){const{type:p,coordinates:m}=d.geometry;p==="Polygon"&&o.push(m),p==="MultiPolygon"&&o.push(...m)}if(o.length)return new Dn(s,{type:"MultiPolygon",coordinates:o})}else if(s.type==="Feature"){const o=s.geometry.type;if(o==="Polygon"||o==="MultiPolygon")return new Dn(s,s.geometry)}else if(s.type==="Polygon"||s.type==="MultiPolygon")return new Dn(s,s)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(r,s){const o=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],p=r.canonicalID();if(s.type==="Polygon"){const m=ua(s.coordinates,d,p),y=ha(r.geometry(),o,d,p);if(!As(o,d))return!1;for(const T of y)if(!ca(T,m))return!1}if(s.type==="MultiPolygon"){const m=Ll(s.coordinates,d,p),y=ha(r.geometry(),o,d,p);if(!As(o,d))return!1;for(const T of y)if(!Xc(T,m))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(r,s){const o=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],p=r.canonicalID();if(s.type==="Polygon"){const m=ua(s.coordinates,d,p),y=Bl(r.geometry(),o,d,p);if(!As(o,d))return!1;for(const T of y)if(!zl(T,m))return!1}if(s.type==="MultiPolygon"){const m=Ll(s.coordinates,d,p),y=Bl(r.geometry(),o,d,p);if(!As(o,d))return!1;for(const T of y)if(!Dl(T,m))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class da{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");const s=e[1];return r.scope.has(s)?new da(s,r.scope.get(s)):r.error(`Unknown variable "${s}". Make sure "${s}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class Mr{constructor(e,r,s,o){this.name=e,this.type=r,this._evaluate=s,this.args=o}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){const s=e[0],o=Mr.definitions[s];if(!o)return r.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0);const d=Array.isArray(o)?o[0]:o.type,p=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,m=p.filter(([T])=>!Array.isArray(T)||T.length===e.length-1);let y=null;for(const[T,A]of m){y=new oa(r.registry,Cs,r.path,null,r.scope);const C=[];let D=!1;for(let R=1;R{return D=C,Array.isArray(D)?`(${D.map(N).join(", ")})`:`(${N(D.type)}...)`;var D}).join(" | "),A=[];for(let C=1;C{r=e?r&&Cs(s):r&&s instanceof vn}),!!r&&pa(i)&&Es(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function pa(i){if(i instanceof Mr&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof Dn)return!1;let e=!0;return i.eachChild(r=>{e&&!pa(r)&&(e=!1)}),e}function ks(i){if(i instanceof Mr&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!ks(r)&&(e=!1)}),e}function Es(i,e){if(i instanceof Mr&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(s=>{r&&!Es(s,e)&&(r=!1)}),r}function Ms(i,e){const r=i.length-1;let s,o,d=0,p=r,m=0;for(;d<=p;)if(m=Math.floor((d+p)/2),s=i[m],o=i[m+1],s<=e){if(m===r||ee))throw new ui("Input is not a number.");p=m-1}return 0}class Ps{constructor(e,r,s){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[o,d]of s)this.labels.push(o),this.outputs.push(d)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const s=r.parse(e[1],1,Me);if(!s)return null;const o=[];let d=null;r.expectedType&&r.expectedType.kind!=="value"&&(d=r.expectedType);for(let p=1;p=m)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',T);const C=r.parse(y,A,d);if(!C)return null;d=d||C.type,o.push([m,C])}return new Ps(d,s,o)}evaluate(e){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(e);const o=this.input.evaluate(e);if(o<=r[0])return s[0].evaluate(e);const d=r.length;return o>=r[d-1]?s[d-1].evaluate(e):s[Ms(r,o)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Jc(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Yc=Fl;function Fl(i,e,r,s){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(s-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=s}Fl.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,s=0;s<8;s++){var o=this.sampleCurveX(r)-i;if(Math.abs(o)o?p=r:m=r,r=.5*(m-p)+p;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var Qc=Jc(Yc);function Ln(i,e,r){return i+r*(e-i)}function fa(i,e,r){return i.map((s,o)=>Ln(s,e[o],r))}const ar={number:Ln,color:function(i,e,r,s="rgb"){switch(s){case"rgb":{const[o,d,p,m]=fa(i.rgb,e.rgb,r);return new Zt(o,d,p,m,!1)}case"hcl":{const[o,d,p,m]=i.hcl,[y,T,A,C]=e.hcl;let D,R;if(isNaN(o)||isNaN(y))isNaN(o)?isNaN(y)?D=NaN:(D=y,p!==1&&p!==0||(R=T)):(D=o,A!==1&&A!==0||(R=d));else{let le=y-o;y>o&&le>180?le-=360:y180&&(le+=360),D=o+r*le}const[F,V,Z,K]=function([le,J,se,me]){return le=isNaN(le)?0:le*lt,di([se,Math.cos(le)*J,Math.sin(le)*J,me])}([D,R??Ln(d,T,r),Ln(p,A,r),Ln(m,C,r)]);return new Zt(F,V,Z,K,!1)}case"lab":{const[o,d,p,m]=di(fa(i.lab,e.lab,r));return new Zt(o,d,p,m,!1)}}},array:fa,padding:function(i,e,r){return new _r(fa(i.values,e.values,r))},variableAnchorOffsetCollection:function(i,e,r){const s=i.values,o=e.values;if(s.length!==o.length)throw new ui(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${e.toString()}`);const d=[];for(let p=0;ptypeof A!="number"||A<0||A>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:T}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(d=r.parse(d,2,Me),!d)return null;const m=[];let y=null;s==="interpolate-hcl"||s==="interpolate-lab"?y=Ai:r.expectedType&&r.expectedType.kind!=="value"&&(y=r.expectedType);for(let T=0;T=A)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',D);const F=r.parse(C,R,y);if(!F)return null;y=y||F.type,m.push([A,F])}return ce(y,Me)||ce(y,Ai)||ce(y,G)||ce(y,L)||ce(y,O(Me))?new $i(y,s,o,d,m):r.error(`Type ${N(y)} is not interpolatable.`)}evaluate(e){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(e);const o=this.input.evaluate(e);if(o<=r[0])return s[0].evaluate(e);const d=r.length;if(o>=r[d-1])return s[d-1].evaluate(e);const p=Ms(r,o),m=$i.interpolationFactor(this.interpolation,o,r[p],r[p+1]),y=s[p].evaluate(e),T=s[p+1].evaluate(e);switch(this.operator){case"interpolate":return ar[this.type.kind](y,T,m);case"interpolate-hcl":return ar.color(y,T,m,"hcl");case"interpolate-lab":return ar.color(y,T,m,"lab")}}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Vt(i,e,r,s){const o=s-r,d=i-r;return o===0?0:e===1?d/o:(Math.pow(e,d)-1)/(Math.pow(e,o)-1)}class ma{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let s=null;const o=r.expectedType;o&&o.kind!=="value"&&(s=o);const d=[];for(const m of e.slice(1)){const y=r.parse(m,1+d.length,s,void 0,{typeAnnotation:"omit"});if(!y)return null;s=s||y.type,d.push(y)}if(!s)throw new Error("No output type");const p=o&&d.some(m=>te(o,m.type));return new ma(p?ht:s,d)}evaluate(e){let r,s=null,o=0;for(const d of this.args)if(o++,s=d.evaluate(e),s&&s instanceof Or&&!s.available&&(r||(r=s.name),s=null,o===this.args.length&&(s=r)),s!==null)break;return s}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class ga{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const s=[];for(let d=1;d=s.length)throw new ui(`Array index out of bounds: ${r} > ${s.length-1}.`);if(r!==Math.floor(r))throw new ui(`Array index must be an integer, but found ${r} instead.`);return s[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class yo{constructor(e,r){this.type=ft,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,ht),o=r.parse(e[2],2,ht);return s&&o?oe(s.type,[ft,xt,Me,Qi,ht])?new yo(s,o):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(s.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!s)return!1;if(!Y(r,["boolean","string","number","null"]))throw new ui(`Expected first argument to be of type boolean, string, number or null, but found ${N(ki(r))} instead.`);if(!Y(s,["string","array"]))throw new ui(`Expected second argument to be of type array or string, but found ${N(ki(s))} instead.`);return s.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class _a{constructor(e,r,s){this.type=Me,this.needle=e,this.haystack=r,this.fromIndex=s}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,ht),o=r.parse(e[2],2,ht);if(!s||!o)return null;if(!oe(s.type,[ft,xt,Me,Qi,ht]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(s.type)} instead`);if(e.length===4){const d=r.parse(e[3],3,Me);return d?new _a(s,o,d):null}return new _a(s,o)}evaluate(e){const r=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!Y(r,["boolean","string","number","null"]))throw new ui(`Expected first argument to be of type boolean, string, number or null, but found ${N(ki(r))} instead.`);if(!Y(s,["string","array"]))throw new ui(`Expected second argument to be of type array or string, but found ${N(ki(s))} instead.`);if(this.fromIndex){const o=this.fromIndex.evaluate(e);return s.indexOf(r,o)}return s.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class xo{constructor(e,r,s,o,d,p){this.inputType=e,this.type=r,this.input=s,this.cases=o,this.outputs=d,this.otherwise=p}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let s,o;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);const d={},p=[];for(let T=2;TNumber.MAX_SAFE_INTEGER)return D.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof F=="number"&&Math.floor(F)!==F)return D.error("Numeric branch labels must be integer values.");if(s){if(D.checkSubtype(s,ki(F)))return null}else s=ki(F);if(d[String(F)]!==void 0)return D.error("Branch labels must be unique.");d[String(F)]=p.length}const R=r.parse(C,T,o);if(!R)return null;o=o||R.type,p.push(R)}const m=r.parse(e[1],1,ht);if(!m)return null;const y=r.parse(e[e.length-1],e.length-1,o);return y?m.type.kind!=="value"&&r.concat(1).checkSubtype(s,m.type)?null:new xo(s,o,m,d,p,y):null}evaluate(e){const r=this.input.evaluate(e);return(ki(r)===this.inputType&&this.outputs[this.cases[r]]||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()}}class vo{constructor(e,r,s){this.type=e,this.branches=r,this.otherwise=s}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let s;r.expectedType&&r.expectedType.kind!=="value"&&(s=r.expectedType);const o=[];for(let p=1;pr.outputDefined())&&this.otherwise.outputDefined()}}class ya{constructor(e,r,s,o){this.type=e,this.input=r,this.beginIndex=s,this.endIndex=o}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,ht),o=r.parse(e[2],2,Me);if(!s||!o)return null;if(!oe(s.type,[O(ht),xt,ht]))return r.error(`Expected first argument to be of type array or string, but found ${N(s.type)} instead`);if(e.length===4){const d=r.parse(e[3],3,Me);return d?new ya(s.type,s,o,d):null}return new ya(s.type,s,o)}evaluate(e){const r=this.input.evaluate(e),s=this.beginIndex.evaluate(e);if(!Y(r,["string","array"]))throw new ui(`Expected first argument to be of type array or string, but found ${N(ki(r))} instead.`);if(this.endIndex){const o=this.endIndex.evaluate(e);return r.slice(s,o)}return r.slice(s)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Ol(i,e){return i==="=="||i==="!="?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 Vl(i,e,r,s){return s.compare(e,r)===0}function rs(i,e,r){const s=i!=="=="&&i!=="!=";return class Kp{constructor(d,p,m){this.type=ft,this.lhs=d,this.rhs=p,this.collator=m,this.hasUntypedArgument=d.type.kind==="value"||p.type.kind==="value"}static parse(d,p){if(d.length!==3&&d.length!==4)return p.error("Expected two or three arguments.");const m=d[0];let y=p.parse(d[1],1,ht);if(!y)return null;if(!Ol(m,y.type))return p.concat(1).error(`"${m}" comparisons are not supported for type '${N(y.type)}'.`);let T=p.parse(d[2],2,ht);if(!T)return null;if(!Ol(m,T.type))return p.concat(2).error(`"${m}" comparisons are not supported for type '${N(T.type)}'.`);if(y.type.kind!==T.type.kind&&y.type.kind!=="value"&&T.type.kind!=="value")return p.error(`Cannot compare types '${N(y.type)}' and '${N(T.type)}'.`);s&&(y.type.kind==="value"&&T.type.kind!=="value"?y=new Er(T.type,[y]):y.type.kind!=="value"&&T.type.kind==="value"&&(T=new Er(y.type,[T])));let A=null;if(d.length===4){if(y.type.kind!=="string"&&T.type.kind!=="string"&&y.type.kind!=="value"&&T.type.kind!=="value")return p.error("Cannot use collator to compare non-string types.");if(A=p.parse(d[3],3,zn),!A)return null}return new Kp(y,T,A)}evaluate(d){const p=this.lhs.evaluate(d),m=this.rhs.evaluate(d);if(s&&this.hasUntypedArgument){const y=ki(p),T=ki(m);if(y.kind!==T.kind||y.kind!=="string"&&y.kind!=="number")throw new ui(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${y.kind}, ${T.kind}) instead.`)}if(this.collator&&!s&&this.hasUntypedArgument){const y=ki(p),T=ki(m);if(y.kind!=="string"||T.kind!=="string")return e(d,p,m)}return this.collator?r(d,p,m,this.collator.evaluate(d)):e(d,p,m)}eachChild(d){d(this.lhs),d(this.rhs),this.collator&&d(this.collator)}outputDefined(){return!0}}}const $c=rs("==",function(i,e,r){return e===r},Vl),eu=rs("!=",function(i,e,r){return e!==r},function(i,e,r,s){return!Vl(0,e,r,s)}),tu=rs("<",function(i,e,r){return e",function(i,e,r){return e>r},function(i,e,r,s){return s.compare(e,r)>0}),ru=rs("<=",function(i,e,r){return e<=r},function(i,e,r,s){return s.compare(e,r)<=0}),nu=rs(">=",function(i,e,r){return e>=r},function(i,e,r,s){return s.compare(e,r)>=0});class bo{constructor(e,r,s,o,d){this.type=xt,this.number=e,this.locale=r,this.currency=s,this.minFractionDigits=o,this.maxFractionDigits=d}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const s=r.parse(e[1],1,Me);if(!s)return null;const o=e[2];if(typeof o!="object"||Array.isArray(o))return r.error("NumberFormat options argument must be an object.");let d=null;if(o.locale&&(d=r.parse(o.locale,1,xt),!d))return null;let p=null;if(o.currency&&(p=r.parse(o.currency,1,xt),!p))return null;let m=null;if(o["min-fraction-digits"]&&(m=r.parse(o["min-fraction-digits"],1,Me),!m))return null;let y=null;return o["max-fraction-digits"]&&(y=r.parse(o["max-fraction-digits"],1,Me),!y)?null:new bo(s,d,p,m,y)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.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.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class xa{constructor(e){this.type=Pi,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const s=e[1];if(!Array.isArray(s)&&typeof s=="object")return r.error("First argument must be an image or text section.");const o=[];let d=!1;for(let p=1;p<=e.length-1;++p){const m=e[p];if(d&&typeof m=="object"&&!Array.isArray(m)){d=!1;let y=null;if(m["font-scale"]&&(y=r.parse(m["font-scale"],1,Me),!y))return null;let T=null;if(m["text-font"]&&(T=r.parse(m["text-font"],1,O(xt)),!T))return null;let A=null;if(m["text-color"]&&(A=r.parse(m["text-color"],1,Ai),!A))return null;const C=o[o.length-1];C.scale=y,C.font=T,C.textColor=A}else{const y=r.parse(e[p],1,ht);if(!y)return null;const T=y.type.kind;if(T!=="string"&&T!=="value"&&T!=="null"&&T!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");d=!0,o.push({content:y,scale:null,font:null,textColor:null})}}return new xa(o)}evaluate(e){return new kr(this.sections.map(r=>{const s=r.content.evaluate(e);return ki(s)===z?new go("",s,null,null,null):new go(Ss(s),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class wo{constructor(e){this.type=z,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const s=r.parse(e[1],1,xt);return s?new wo(s):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),s=Or.fromString(r);return s&&e.availableImages&&(s.available=e.availableImages.indexOf(r)>-1),s}eachChild(e){e(this.input)}outputDefined(){return!1}}class To{constructor(e){this.type=Me,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const s=r.parse(e[1],1);return s?s.type.kind!=="array"&&s.type.kind!=="string"&&s.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${N(s.type)} instead.`):new To(s):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new ui(`Expected value to be of type string or array, but found ${N(ki(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const ns={"==":$c,"!=":eu,">":iu,"<":tu,">=":nu,"<=":ru,array:Er,at:_o,boolean:Er,case:vo,coalesce:ma,collator:is,format:xa,image:wo,in:yo,"index-of":_a,interpolate:$i,"interpolate-hcl":$i,"interpolate-lab":$i,length:To,let:ga,literal:vn,match:xo,number:Er,"number-format":bo,object:Er,slice:ya,step:Ps,string:Er,"to-boolean":sn,"to-color":sn,"to-number":sn,"to-string":sn,var:da,within:Dn};function Ul(i,[e,r,s,o]){e=e.evaluate(i),r=r.evaluate(i),s=s.evaluate(i);const d=o?o.evaluate(i):1,p=ts(e,r,s,d);if(p)throw new ui(p);return new Zt(e/255,r/255,s/255,d,!1)}function Nl(i,e){return i in e}function So(i,e){const r=e[i];return r===void 0?null:r}function Rn(i){return{type:i}}function jl(i){return{result:"success",value:i}}function ss(i){return{result:"error",value:i}}function as(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function ql(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Io(i){return!!i.expression&&i.expression.interpolated}function Rt(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function va(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function su(i){return i}function Zl(i,e){const r=e.type==="color",s=i.stops&&typeof i.stops[0][0]=="object",o=s||!(s||i.property!==void 0),d=i.type||(Io(e)?"exponential":"interval");if(r||e.type==="padding"){const A=r?Zt.parse:_r.parse;(i=tn({},i)).stops&&(i.stops=i.stops.map(C=>[C[0],A(C[1])])),i.default=A(i.default?i.default:e.default)}if(i.colorSpace&&(p=i.colorSpace)!=="rgb"&&p!=="hcl"&&p!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var p;let m,y,T;if(d==="exponential")m=zt;else if(d==="interval")m=au;else if(d==="categorical"){m=vi,y=Object.create(null);for(const A of i.stops)y[A[0]]=A[1];T=typeof i.stops[0][0]}else{if(d!=="identity")throw new Error(`Unknown function type "${d}"`);m=Ao}if(s){const A={},C=[];for(let F=0;FF[0]),evaluate:({zoom:F},V)=>zt({stops:D,base:i.base},e,F).evaluate(F,V)}}if(o){const A=d==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:A,interpolationFactor:$i.interpolationFactor.bind(void 0,A),zoomStops:i.stops.map(C=>C[0]),evaluate:({zoom:C})=>m(i,e,C,y,T)}}return{kind:"source",evaluate(A,C){const D=C&&C.properties?C.properties[i.property]:void 0;return D===void 0?zs(i.default,e.default):m(i,e,D,y,T)}}}function zs(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function vi(i,e,r,s,o){return zs(typeof r===o?s[r]:void 0,i.default,e.default)}function au(i,e,r){if(Rt(r)!=="number")return zs(i.default,e.default);const s=i.stops.length;if(s===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[s-1][0])return i.stops[s-1][1];const o=Ms(i.stops.map(d=>d[0]),r);return i.stops[o][1]}function zt(i,e,r){const s=i.base!==void 0?i.base:1;if(Rt(r)!=="number")return zs(i.default,e.default);const o=i.stops.length;if(o===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[o-1][0])return i.stops[o-1][1];const d=Ms(i.stops.map(A=>A[0]),r),p=function(A,C,D,R){const F=R-D,V=A-D;return F===0?0:C===1?V/F:(Math.pow(C,V)-1)/(Math.pow(C,F)-1)}(r,s,i.stops[d][0],i.stops[d+1][0]),m=i.stops[d][1],y=i.stops[d+1][1],T=ar[e.type]||su;return typeof m.evaluate=="function"?{evaluate(...A){const C=m.evaluate.apply(void 0,A),D=y.evaluate.apply(void 0,A);if(C!==void 0&&D!==void 0)return T(C,D,p,i.colorSpace)}}:T(m,y,p,i.colorSpace)}function Ao(i,e,r){switch(e.type){case"color":r=Zt.parse(r);break;case"formatted":r=kr.fromString(r.toString());break;case"resolvedImage":r=Or.fromString(r.toString());break;case"padding":r=_r.parse(r);break;default:Rt(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return zs(r,i.default,e.default)}Mr.register(ns,{error:[{kind:"error"},[xt],(i,[e])=>{throw new ui(e.evaluate(i))}],typeof:[xt,[ht],(i,[e])=>N(ki(e.evaluate(i)))],"to-rgba":[O(Me,4),[Ai],(i,[e])=>{const[r,s,o,d]=e.evaluate(i).rgb;return[255*r,255*s,255*o,d]}],rgb:[Ai,[Me,Me,Me],Ul],rgba:[Ai,[Me,Me,Me,Me],Ul],has:{type:ft,overloads:[[[xt],(i,[e])=>Nl(e.evaluate(i),i.properties())],[[xt,rn],(i,[e,r])=>Nl(e.evaluate(i),r.evaluate(i))]]},get:{type:ht,overloads:[[[xt],(i,[e])=>So(e.evaluate(i),i.properties())],[[xt,rn],(i,[e,r])=>So(e.evaluate(i),r.evaluate(i))]]},"feature-state":[ht,[xt],(i,[e])=>So(e.evaluate(i),i.featureState||{})],properties:[rn,[],i=>i.properties()],"geometry-type":[xt,[],i=>i.geometryType()],id:[ht,[],i=>i.id()],zoom:[Me,[],i=>i.globals.zoom],"heatmap-density":[Me,[],i=>i.globals.heatmapDensity||0],"line-progress":[Me,[],i=>i.globals.lineProgress||0],accumulated:[ht,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[Me,Rn(Me),(i,e)=>{let r=0;for(const s of e)r+=s.evaluate(i);return r}],"*":[Me,Rn(Me),(i,e)=>{let r=1;for(const s of e)r*=s.evaluate(i);return r}],"-":{type:Me,overloads:[[[Me,Me],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[Me],(i,[e])=>-e.evaluate(i)]]},"/":[Me,[Me,Me],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[Me,[Me,Me],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[Me,[],()=>Math.LN2],pi:[Me,[],()=>Math.PI],e:[Me,[],()=>Math.E],"^":[Me,[Me,Me],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[Me,[Me],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[Me,[Me],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[Me,[Me],(i,[e])=>Math.log(e.evaluate(i))],log2:[Me,[Me],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[Me,[Me],(i,[e])=>Math.sin(e.evaluate(i))],cos:[Me,[Me],(i,[e])=>Math.cos(e.evaluate(i))],tan:[Me,[Me],(i,[e])=>Math.tan(e.evaluate(i))],asin:[Me,[Me],(i,[e])=>Math.asin(e.evaluate(i))],acos:[Me,[Me],(i,[e])=>Math.acos(e.evaluate(i))],atan:[Me,[Me],(i,[e])=>Math.atan(e.evaluate(i))],min:[Me,Rn(Me),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[Me,Rn(Me),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[Me,[Me],(i,[e])=>Math.abs(e.evaluate(i))],round:[Me,[Me],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[Me,[Me],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[Me,[Me],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[ft,[xt,ht],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[ft,[ht],(i,[e])=>i.id()===e.value],"filter-type-==":[ft,[xt],(i,[e])=>i.geometryType()===e.value],"filter-<":[ft,[xt,ht],(i,[e,r])=>{const s=i.properties()[e.value],o=r.value;return typeof s==typeof o&&s{const r=i.id(),s=e.value;return typeof r==typeof s&&r":[ft,[xt,ht],(i,[e,r])=>{const s=i.properties()[e.value],o=r.value;return typeof s==typeof o&&s>o}],"filter-id->":[ft,[ht],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r>s}],"filter-<=":[ft,[xt,ht],(i,[e,r])=>{const s=i.properties()[e.value],o=r.value;return typeof s==typeof o&&s<=o}],"filter-id-<=":[ft,[ht],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r<=s}],"filter->=":[ft,[xt,ht],(i,[e,r])=>{const s=i.properties()[e.value],o=r.value;return typeof s==typeof o&&s>=o}],"filter-id->=":[ft,[ht],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r>=s}],"filter-has":[ft,[ht],(i,[e])=>e.value in i.properties()],"filter-has-id":[ft,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[ft,[O(xt)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[ft,[O(ht)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[ft,[xt,O(ht)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[ft,[xt,O(ht)],(i,[e,r])=>function(s,o,d,p){for(;d<=p;){const m=d+p>>1;if(o[m]===s)return!0;o[m]>s?p=m-1:d=m+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:ft,overloads:[[[ft,ft],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[Rn(ft),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:ft,overloads:[[[ft,ft],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[Rn(ft),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[ft,[ft],(i,[e])=>!e.evaluate(i)],"is-supported-script":[ft,[xt],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[xt,[xt],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[xt,[xt],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[xt,Rn(ht),(i,e)=>e.map(r=>Ss(r.evaluate(i))).join("")],"resolved-locale":[xt,[zn],(i,[e])=>e.evaluate(i).resolvedLocale()]});class ti{constructor(e,r){var s;this.expression=e,this._warningHistory={},this._evaluator=new Gt,this._defaultValue=r?(s=r).type==="color"&&va(s.default)?new Zt(0,0,0,0):s.type==="color"?Zt.parse(s.default)||null:s.type==="padding"?_r.parse(s.default)||null:s.type==="variableAnchorOffsetCollection"?Fr.parse(s.default)||null:s.default===void 0?null:s.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,s,o,d,p){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=s,this._evaluator.canonical=o,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=p,this.expression.evaluate(this._evaluator)}evaluate(e,r,s,o,d,p){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=s||null,this._evaluator.canonical=o,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=p||null;try{const m=this.expression.evaluate(this._evaluator);if(m==null||typeof m=="number"&&m!=m)return this._defaultValue;if(this._enumValues&&!(m in this._enumValues))throw new ui(`Expected value to be one of ${Object.keys(this._enumValues).map(y=>JSON.stringify(y)).join(", ")}, but found ${JSON.stringify(m)} instead.`);return m}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}}}function $t(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in ns}function Bn(i,e){const r=new oa(ns,Cs,[],e?function(o){const d={color:Ai,string:xt,number:Me,enum:xt,boolean:ft,formatted:Pi,padding:G,resolvedImage:z,variableAnchorOffsetCollection:L};return o.type==="array"?O(d[o.value]||ht,o.length):d[o.type]}(e):void 0),s=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return s?jl(new ti(s,e)):ss(r.errors)}class ba{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!ks(r.expression)}evaluateWithoutErrorHandling(e,r,s,o,d,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,s,o,d,p)}evaluate(e,r,s,o,d,p){return this._styleExpression.evaluate(e,r,s,o,d,p)}}class Co{constructor(e,r,s,o){this.kind=e,this.zoomStops=s,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!ks(r.expression),this.interpolationType=o}evaluateWithoutErrorHandling(e,r,s,o,d,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,s,o,d,p)}evaluate(e,r,s,o,d,p){return this._styleExpression.evaluate(e,r,s,o,d,p)}interpolationFactor(e,r,s){return this.interpolationType?$i.interpolationFactor(this.interpolationType,e,r,s):0}}function Gl(i,e){const r=Bn(i,e);if(r.result==="error")return r;const s=r.value.expression,o=pa(s);if(!o&&!as(e))return ss([new Cr("","data expressions not supported")]);const d=Es(s,["zoom"]);if(!d&&!ql(e))return ss([new Cr("","zoom expressions not supported")]);const p=Ta(s);return p||d?p instanceof Cr?ss([p]):p instanceof $i&&!Io(e)?ss([new Cr("",'"interpolate" expressions cannot be used with this property')]):jl(p?new Co(o?"camera":"composite",r.value,p.labels,p instanceof $i?p.interpolation:void 0):new ba(o?"constant":"source",r.value)):ss([new Cr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class wa{constructor(e,r){this._parameters=e,this._specification=r,tn(this,Zl(this._parameters,this._specification))}static deserialize(e){return new wa(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Ta(i){let e=null;if(i instanceof ga)e=Ta(i.result);else if(i instanceof ma){for(const r of i.args)if(e=Ta(r),e)break}else(i instanceof Ps||i instanceof $i)&&i.input instanceof Mr&&i.input.name==="zoom"&&(e=i);return e instanceof Cr||i.eachChild(r=>{const s=Ta(r);s instanceof Cr?e=s:!e&&s?e=new Cr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&s&&e!==s&&(e=new Cr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Sa(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!Sa(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const Hl={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ia(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Sa(i)||(i=Ca(i));const e=Bn(i,Hl);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,s,o)=>e.value.evaluate(r,s,{},o),needGeometry:Aa(i)}}function Wl(i,e){return ie?1:0}function Aa(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?ko(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(Ca))):e==="all"?["all"].concat(i.slice(1).map(Ca)):e==="none"?["all"].concat(i.slice(1).map(Ca).map(ka)):e==="in"?Xl(i[1],i.slice(2)):e==="!in"?ka(Xl(i[1],i.slice(2))):e==="has"?Kl(i[1]):e==="!has"?ka(Kl(i[1])):e!=="within"||i;var r}function ko(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function Xl(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",i,["literal",e.sort(Wl)]]:["filter-in-small",i,["literal",e]]}}function Kl(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function ka(i){return["!",i]}function Eo(i){const e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let o="[";for(const d of i)o+=`${Eo(d)},`;return`${o}]`}const r=Object.keys(i).sort();let s="{";for(let o=0;os.maximum?[new Ce(e,r,`${r} is greater than the maximum value ${s.maximum}`)]:[]}function Yl(i){const e=i.valueSpec,r=pi(i.value.type);let s,o,d,p={};const m=r!=="categorical"&&i.value.property===void 0,y=!m,T=Rt(i.value.stops)==="array"&&Rt(i.value.stops[0])==="array"&&Rt(i.value.stops[0][0])==="object",A=or({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(R){if(r==="identity")return[new Ce(R.key,R.value,'identity function may not have a "stops" property')];let F=[];const V=R.value;return F=F.concat(Mo({key:R.key,value:V,valueSpec:R.valueSpec,validateSpec:R.validateSpec,style:R.style,styleSpec:R.styleSpec,arrayElementValidator:C})),Rt(V)==="array"&&V.length===0&&F.push(new Ce(R.key,V,"array must have at least one stop")),F},default:function(R){return R.validateSpec({key:R.key,value:R.value,valueSpec:e,validateSpec:R.validateSpec,style:R.style,styleSpec:R.styleSpec})}}});return r==="identity"&&m&&A.push(new Ce(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||A.push(new Ce(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!Io(i.valueSpec)&&A.push(new Ce(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(y&&!as(i.valueSpec)?A.push(new Ce(i.key,i.value,"property functions not supported")):m&&!ql(i.valueSpec)&&A.push(new Ce(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!T||i.value.property!==void 0||A.push(new Ce(i.key,i.value,'"property" property is required')),A;function C(R){let F=[];const V=R.value,Z=R.key;if(Rt(V)!=="array")return[new Ce(Z,V,`array expected, ${Rt(V)} found`)];if(V.length!==2)return[new Ce(Z,V,`array length 2 expected, length ${V.length} found`)];if(T){if(Rt(V[0])!=="object")return[new Ce(Z,V,`object expected, ${Rt(V[0])} found`)];if(V[0].zoom===void 0)return[new Ce(Z,V,"object stop key must have zoom")];if(V[0].value===void 0)return[new Ce(Z,V,"object stop key must have value")];if(d&&d>pi(V[0].zoom))return[new Ce(Z,V[0].zoom,"stop zoom values must appear in ascending order")];pi(V[0].zoom)!==d&&(d=pi(V[0].zoom),o=void 0,p={}),F=F.concat(or({key:`${Z}[0]`,value:V[0],valueSpec:{zoom:{}},validateSpec:R.validateSpec,style:R.style,styleSpec:R.styleSpec,objectElementValidators:{zoom:Ea,value:D}}))}else F=F.concat(D({key:`${Z}[0]`,value:V[0],valueSpec:{},validateSpec:R.validateSpec,style:R.style,styleSpec:R.styleSpec},V));return $t(wn(V[1]))?F.concat([new Ce(`${Z}[1]`,V[1],"expressions are not allowed in function stops.")]):F.concat(R.validateSpec({key:`${Z}[1]`,value:V[1],valueSpec:e,validateSpec:R.validateSpec,style:R.style,styleSpec:R.styleSpec}))}function D(R,F){const V=Rt(R.value),Z=pi(R.value),K=R.value!==null?R.value:F;if(s){if(V!==s)return[new Ce(R.key,K,`${V} stop domain type must match previous stop domain type ${s}`)]}else s=V;if(V!=="number"&&V!=="string"&&V!=="boolean")return[new Ce(R.key,K,"stop domain value must be a number, string, or boolean")];if(V!=="number"&&r!=="categorical"){let le=`number expected, ${V} found`;return as(e)&&r===void 0&&(le+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ce(R.key,K,le)]}return r!=="categorical"||V!=="number"||isFinite(Z)&&Math.floor(Z)===Z?r!=="categorical"&&V==="number"&&o!==void 0&&Znew Ce(`${i.key}${s.key}`,i.value,s.message));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new Ce(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!ks(r))return[new Ce(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!ks(r))return[new Ce(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!Es(r,["zoom","feature-state"]))return[new Ce(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!pa(r))return[new Ce(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Sn(i){const e=i.key,r=i.value,s=i.valueSpec,o=[];return Array.isArray(s.values)?s.values.indexOf(pi(r))===-1&&o.push(new Ce(e,r,`expected one of [${s.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(s.values).indexOf(pi(r))===-1&&o.push(new Ce(e,r,`expected one of [${Object.keys(s.values).join(", ")}], ${JSON.stringify(r)} found`)),o}function os(i){return Sa(wn(i.value))?Tn(tn({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Ma(i)}function Ma(i){const e=i.value,r=i.key;if(Rt(e)!=="array")return[new Ce(r,e,`array expected, ${Rt(e)} found`)];const s=i.styleSpec;let o,d=[];if(e.length<1)return[new Ce(r,e,"filter array must have at least 1 element")];switch(d=d.concat(Sn({key:`${r}[0]`,value:e[0],valueSpec:s.filter_operator,style:i.style,styleSpec:i.styleSpec})),pi(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&pi(e[1])==="$type"&&d.push(new Ce(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&d.push(new Ce(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(o=Rt(e[1]),o!=="string"&&d.push(new Ce(`${r}[1]`,e[1],`string expected, ${o} found`)));for(let p=2;p{T in r&&e.push(new Ce(s,r[T],`"${T}" is prohibited for ref layers`))}),o.layers.forEach(T=>{pi(T.id)===m&&(y=T)}),y?y.ref?e.push(new Ce(s,r.ref,"ref cannot reference another ref layer")):p=pi(y.type):e.push(new Ce(s,r.ref,`ref layer "${m}" not found`))}else if(p!=="background")if(r.source){const y=o.sources&&o.sources[r.source],T=y&&pi(y.type);y?T==="vector"&&p==="raster"?e.push(new Ce(s,r.source,`layer "${r.id}" requires a raster source`)):T!=="raster-dem"&&p==="hillshade"?e.push(new Ce(s,r.source,`layer "${r.id}" requires a raster-dem source`)):T==="raster"&&p!=="raster"?e.push(new Ce(s,r.source,`layer "${r.id}" requires a vector source`)):T!=="vector"||r["source-layer"]?T==="raster-dem"&&p!=="hillshade"?e.push(new Ce(s,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):p!=="line"||!r.paint||!r.paint["line-gradient"]||T==="geojson"&&y.lineMetrics||e.push(new Ce(s,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Ce(s,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new Ce(s,r.source,`source "${r.source}" not found`))}else e.push(new Ce(s,r,'missing required property "source"'));return e=e.concat(or({key:s,value:r,valueSpec:d.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${s}.type`,value:r.type,valueSpec:d.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:os,layout:y=>or({layer:r,key:y.key,value:y.value,style:y.style,styleSpec:y.styleSpec,validateSpec:y.validateSpec,objectElementValidators:{"*":T=>Ds(tn({layerType:p},T))}}),paint:y=>or({layer:r,key:y.key,value:y.value,style:y.style,styleSpec:y.styleSpec,validateSpec:y.validateSpec,objectElementValidators:{"*":T=>zo(tn({layerType:p},T))}})}})),e}function Fn(i){const e=i.value,r=i.key,s=Rt(e);return s!=="string"?[new Ce(r,e,`string expected, ${s} found`)]:[]}const $l={promoteId:function({key:i,value:e}){if(Rt(e)==="string")return Fn({key:i,value:e});{const r=[];for(const s in e)r.push(...Fn({key:`${i}.${s}`,value:e[s]}));return r}}};function ec(i){const e=i.value,r=i.key,s=i.styleSpec,o=i.style,d=i.validateSpec;if(!e.type)return[new Ce(r,e,'"type" is required')];const p=pi(e.type);let m;switch(p){case"vector":case"raster":return m=or({key:r,value:e,valueSpec:s[`source_${p.replace("-","_")}`],style:i.style,styleSpec:s,objectElementValidators:$l,validateSpec:d}),m;case"raster-dem":return m=function(y){var T;const A=(T=y.sourceName)!==null&&T!==void 0?T:"",C=y.value,D=y.styleSpec,R=D.source_raster_dem,F=y.style;let V=[];const Z=Rt(C);if(C===void 0)return V;if(Z!=="object")return V.push(new Ce("source_raster_dem",C,`object expected, ${Z} found`)),V;const K=pi(C.encoding)==="custom",le=["redFactor","greenFactor","blueFactor","baseShift"],J=y.value.encoding?`"${y.value.encoding}"`:"Default";for(const se in C)!K&&le.includes(se)?V.push(new Ce(se,C[se],`In "${A}": "${se}" is only valid when "encoding" is set to "custom". ${J} encoding found`)):R[se]?V=V.concat(y.validateSpec({key:se,value:C[se],valueSpec:R[se],validateSpec:y.validateSpec,style:F,styleSpec:D})):V.push(new Ce(se,C[se],`unknown property "${se}"`));return V}({sourceName:r,value:e,style:i.style,styleSpec:s,validateSpec:d}),m;case"geojson":if(m=or({key:r,value:e,valueSpec:s.source_geojson,style:o,styleSpec:s,validateSpec:d,objectElementValidators:$l}),e.cluster)for(const y in e.clusterProperties){const[T,A]=e.clusterProperties[y],C=typeof T=="string"?[T,["accumulated"],["get",y]]:T;m.push(...Tn({key:`${r}.${y}.map`,value:A,validateSpec:d,expressionContext:"cluster-map"})),m.push(...Tn({key:`${r}.${y}.reduce`,value:C,validateSpec:d,expressionContext:"cluster-reduce"}))}return m;case"video":return or({key:r,value:e,valueSpec:s.source_video,style:o,validateSpec:d,styleSpec:s});case"image":return or({key:r,value:e,valueSpec:s.source_image,style:o,validateSpec:d,styleSpec:s});case"canvas":return[new Ce(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Sn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:o,validateSpec:d,styleSpec:s})}}function tc(i){const e=i.value,r=i.styleSpec,s=r.light,o=i.style;let d=[];const p=Rt(e);if(e===void 0)return d;if(p!=="object")return d=d.concat([new Ce("light",e,`object expected, ${p} found`)]),d;for(const m in e){const y=m.match(/^(.*)-transition$/);d=d.concat(y&&s[y[1]]&&s[y[1]].transition?i.validateSpec({key:m,value:e[m],valueSpec:r.transition,validateSpec:i.validateSpec,style:o,styleSpec:r}):s[m]?i.validateSpec({key:m,value:e[m],valueSpec:s[m],validateSpec:i.validateSpec,style:o,styleSpec:r}):[new Ce(m,e[m],`unknown property "${m}"`)])}return d}function Ls(i){const e=i.value,r=i.styleSpec,s=r.sky,o=i.style,d=Rt(e);if(e===void 0)return[];if(d!=="object")return[new Ce("sky",e,`object expected, ${d} found`)];let p=[];for(const m in e)p=p.concat(s[m]?On({key:m,value:e[m],valueSpec:s[m],style:o,styleSpec:r}):[new Ce(m,e[m],`unknown property "${m}"`)]);return p}function Rs(i){const e=i.value,r=i.styleSpec,s=r.terrain,o=i.style;let d=[];const p=Rt(e);if(e===void 0)return d;if(p!=="object")return d=d.concat([new Ce("terrain",e,`object expected, ${p} found`)]),d;for(const m in e)d=d.concat(s[m]?i.validateSpec({key:m,value:e[m],valueSpec:s[m],validateSpec:i.validateSpec,style:o,styleSpec:r}):[new Ce(m,e[m],`unknown property "${m}"`)]);return d}function yr(i){let e=[];const r=i.value,s=i.key;if(Array.isArray(r)){const o=[],d=[];for(const p in r)r[p].id&&o.includes(r[p].id)&&e.push(new Ce(s,r,`all the sprites' ids must be unique, but ${r[p].id} is duplicated`)),o.push(r[p].id),r[p].url&&d.includes(r[p].url)&&e.push(new Ce(s,r,`all the sprites' URLs must be unique, but ${r[p].url} is duplicated`)),d.push(r[p].url),e=e.concat(or({key:`${s}[${p}]`,value:r[p],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return Fn({key:s,value:r})}const ls={"*":()=>[],array:Mo,boolean:function(i){const e=i.value,r=i.key,s=Rt(e);return s!=="boolean"?[new Ce(r,e,`boolean expected, ${s} found`)]:[]},number:Ea,color:function(i){const e=i.key,r=i.value,s=Rt(r);return s!=="string"?[new Ce(e,r,`color expected, ${s} found`)]:Zt.parse(String(r))?[]:[new Ce(e,r,`color expected, "${r}" found`)]},constants:Jl,enum:Sn,filter:os,function:Yl,layer:Ql,object:or,source:ec,light:tc,sky:Ls,terrain:Rs,string:Fn,formatted:function(i){return Fn(i).length===0?[]:Tn(i)},resolvedImage:function(i){return Fn(i).length===0?[]:Tn(i)},padding:function(i){const e=i.key,r=i.value;if(Rt(r)==="array"){if(r.length<1||r.length>4)return[new Ce(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const s={type:"number"};let o=[];for(let d=0;d[]}})),i.constants&&(r=r.concat(Jl({key:"constants",value:i.constants,style:i,styleSpec:e,validateSpec:On}))),Do(r)}function xr(i){return function(e){return i({...e,validateSpec:On})}}function Do(i){return[].concat(i).sort((e,r)=>e.line-r.line)}function Vr(i){return function(...e){return Do(i.apply(this,e))}}jr.source=Vr(xr(ec)),jr.sprite=Vr(xr(yr)),jr.glyphs=Vr(xr(ic)),jr.light=Vr(xr(tc)),jr.sky=Vr(xr(Ls)),jr.terrain=Vr(xr(Rs)),jr.layer=Vr(xr(Ql)),jr.filter=Vr(xr(os)),jr.paintProperty=Vr(xr(zo)),jr.layoutProperty=Vr(xr(Ds));const Bs=jr,Lo=Bs.light,lu=Bs.paintProperty,Fs=Bs.layoutProperty;function rc(i,e){let r=!1;if(e&&e.length)for(const s of e)i.fire(new jt(new Error(s.message))),r=!0;return r}class Vn{constructor(e,r,s){const o=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const p=new Int32Array(this.arrayBuffer);e=p[0],this.d=(r=p[1])+2*(s=p[2]);for(let y=0;y=C[F+0]&&o>=C[F+1])?(m[R]=!0,p.push(A[R])):m[R]=!1}}}}_forEachCell(e,r,s,o,d,p,m,y){const T=this._convertToCellCoord(e),A=this._convertToCellCoord(r),C=this._convertToCellCoord(s),D=this._convertToCellCoord(o);for(let R=T;R<=C;R++)for(let F=A;F<=D;F++){const V=this.d*F+R;if((!y||y(this._convertFromCellCoord(R),this._convertFromCellCoord(F),this._convertFromCellCoord(R+1),this._convertFromCellCoord(F+1)))&&d.call(this,e,r,s,o,V,p,m,y))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,r=3+this.cells.length+1+1;let s=0;for(let p=0;p=0)continue;const p=i[d];o[d]=cn[s].shallow.indexOf(d)>=0?p:cs(p,e)}i instanceof Error&&(o.message=i.message)}if(o.$name)throw new Error("$name property is reserved for worker serialization logic.");return s!=="Object"&&(o.$name=s),o}throw new Error("can't serialize object of type "+typeof i)}function Os(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||i instanceof Error||Ro(i)||wt(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(Os);if(typeof i=="object"){const e=i.$name||"Object";if(!cn[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=cn[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);const s=Object.create(r.prototype);for(const o of Object.keys(i)){if(o==="$name")continue;const d=i[o];s[o]=cn[e].shallow.indexOf(o)>=0?d:Os(d)}return s}throw new Error("can't deserialize object of type "+typeof i)}class Pa{constructor(){this.first=!0}update(e,r){const s=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=s,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=s,!0):(this.lastFloorZoom>s?(this.lastIntegerZoom=s+1,this.lastIntegerZoomTime=r):this.lastFloorZoomi>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function za(i){for(const e of i)if(Da(e.charCodeAt(0)))return!0;return!1}function nc(i){for(const e of i)if(!sc(e.charCodeAt(0)))return!1;return!0}function sc(i){return!(De.Arabic(i)||De["Arabic Supplement"](i)||De["Arabic Extended-A"](i)||De["Arabic Presentation Forms-A"](i)||De["Arabic Presentation Forms-B"](i))}function Da(i){return!(i!==746&&i!==747&&(i<4352||!(De["Bopomofo Extended"](i)||De.Bopomofo(i)||De["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||De["CJK Compatibility Ideographs"](i)||De["CJK Compatibility"](i)||De["CJK Radicals Supplement"](i)||De["CJK Strokes"](i)||!(!De["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||De["CJK Unified Ideographs Extension A"](i)||De["CJK Unified Ideographs"](i)||De["Enclosed CJK Letters and Months"](i)||De["Hangul Compatibility Jamo"](i)||De["Hangul Jamo Extended-A"](i)||De["Hangul Jamo Extended-B"](i)||De["Hangul Jamo"](i)||De["Hangul Syllables"](i)||De.Hiragana(i)||De["Ideographic Description Characters"](i)||De.Kanbun(i)||De["Kangxi Radicals"](i)||De["Katakana Phonetic Extensions"](i)||De.Katakana(i)&&i!==12540||!(!De["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!De["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||De["Unified Canadian Aboriginal Syllabics"](i)||De["Unified Canadian Aboriginal Syllabics Extended"](i)||De["Vertical Forms"](i)||De["Yijing Hexagram Symbols"](i)||De["Yi Syllables"](i)||De["Yi Radicals"](i))))}function La(i){return!(Da(i)||function(e){return!!(De["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||De["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)||De["Letterlike Symbols"](e)||De["Number Forms"](e)||De["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)||De["Control Pictures"](e)&&e!==9251||De["Optical Character Recognition"](e)||De["Enclosed Alphanumerics"](e)||De["Geometric Shapes"](e)||De["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||De["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||De["CJK Symbols and Punctuation"](e)||De.Katakana(e)||De["Private Use Area"](e)||De["CJK Compatibility Forms"](e)||De["Small Form Variants"](e)||De["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}function Bo(i){return i>=1424&&i<=2303||De["Arabic Presentation Forms-A"](i)||De["Arabic Presentation Forms-B"](i)}function cu(i,e){return!(!e&&Bo(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||De.Khmer(i))}function ac(i){for(const e of i)if(Bo(e.charCodeAt(0)))return!0;return!1}const Un=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(i){this.pluginStatus=i.pluginStatus,this.pluginURL=i.pluginURL}setMethods(i){this.applyArabicShaping=i.applyArabicShaping,this.processBidirectionalText=i.processBidirectionalText,this.processStyledBidirectionalText=i.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class ii{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Pa,this.transition={})}isSupportedScript(e){return function(r,s){for(const o of r)if(!cu(o.charCodeAt(0),s))return!1;return!0}(e,Un.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,r=e-Math.floor(e),s=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*s}:{fromScale:.5,toScale:1,t:1-(1-s)*r}}}class Vs{constructor(e,r){this.property=e,this.value=r,this.expression=function(s,o){if(va(s))return new wa(s,o);if($t(s)){const d=Gl(s,o);if(d.result==="error")throw new Error(d.value.map(p=>`${p.key}: ${p.message}`).join(", "));return d.value}{let d=s;return o.type==="color"&&typeof s=="string"?d=Zt.parse(s):o.type!=="padding"||typeof s!="number"&&!Array.isArray(s)?o.type==="variableAnchorOffsetCollection"&&Array.isArray(s)&&(d=Fr.parse(s)):d=_r.parse(s),{kind:"constant",evaluate:()=>d}}}(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,s){return this.property.possiblyEvaluate(this,e,r,s)}}class Ra{constructor(e){this.property=e,this.value=new Vs(e,void 0)}transitioned(e,r){return new lc(this.property,this.value,r,Ke({},e.transition,this.transition),e.now)}untransitioned(){return new lc(this.property,this.value,null,{},0)}}class oc{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return _e(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Ra(this._values[e].property)),this._values[e].value=new Vs(this._values[e].property,r===null?void 0:_e(r))}getTransition(e){return _e(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Ra(this._values[e].property)),this._values[e].transition=_e(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(e[r]=s);const o=this.getTransition(r);o!==void 0&&(e[`${r}-transition`]=o)}return e}transitioned(e,r){const s=new Fo(this._properties);for(const o of Object.keys(this._values))s._values[o]=this._values[o].transitioned(e,r._values[o]);return s}untransitioned(){const e=new Fo(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class lc{constructor(e,r,s,o,d){this.property=e,this.value=r,this.begin=d+o.delay||0,this.end=this.begin+o.duration||0,e.specification.transition&&(o.delay||o.duration)&&(this.prior=s)}possiblyEvaluate(e,r,s){const o=e.now||0,d=this.value.possiblyEvaluate(e,r,s),p=this.prior;if(p){if(o>this.end)return this.prior=null,d;if(this.value.isDataDriven())return this.prior=null,d;if(o=1)return 1;const T=y*y,A=T*y;return 4*(y<.5?A:3*(y-T)+A-.75)}(m))}}return d}}class Fo{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,s){const o=new Us(this._properties);for(const d of Object.keys(this._values))o._values[d]=this._values[d].possiblyEvaluate(e,r,s);return o}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class cc{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return _e(this._values[e].value)}setValue(e,r){this._values[e]=new Vs(this._values[e].property,r===null?void 0:_e(r))}serialize(){const e={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(e[r]=s)}return e}possiblyEvaluate(e,r,s){const o=new Us(this._properties);for(const d of Object.keys(this._values))o._values[d]=this._values[d].possiblyEvaluate(e,r,s);return o}}class qr{constructor(e,r,s){this.property=e,this.value=r,this.parameters=s}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,s,o){return this.property.evaluate(this.value,this.parameters,e,r,s,o)}}class Us{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Ne{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,s){const o=ar[this.specification.type];return o?o(e,r,s):e}}class tt{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,s,o){return new qr(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},s,o)}:e.expression,r)}interpolate(e,r,s){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new qr(this,{kind:"constant",value:void 0},e.parameters);const o=ar[this.specification.type];if(o){const d=o(e.value.value,r.value.value,s);return new qr(this,{kind:"constant",value:d},e.parameters)}return e}evaluate(e,r,s,o,d,p){return e.kind==="constant"?e.value:e.evaluate(r,s,o,d,p)}}class us extends tt{possiblyEvaluate(e,r,s,o){if(e.value===void 0)return new qr(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){const d=e.expression.evaluate(r,null,{},s,o),p=e.property.specification.type==="resolvedImage"&&typeof d!="string"?d.name:d,m=this._calculate(p,p,p,r);return new qr(this,{kind:"constant",value:m},r)}if(e.expression.kind==="camera"){const d=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new qr(this,{kind:"constant",value:d},r)}return new qr(this,e.expression,r)}evaluate(e,r,s,o,d,p){if(e.kind==="source"){const m=e.evaluate(r,s,o,d,p);return this._calculate(m,m,m,r)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},s,o),e.evaluate({zoom:Math.floor(r.zoom)},s,o),e.evaluate({zoom:Math.floor(r.zoom)+1},s,o),r):e.value}_calculate(e,r,s,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:s,to:r}}interpolate(e){return e}}class Oo{constructor(e){this.specification=e}possiblyEvaluate(e,r,s,o){if(e.value!==void 0){if(e.expression.kind==="constant"){const d=e.expression.evaluate(r,null,{},s,o);return this._calculate(d,d,d,r)}return this._calculate(e.expression.evaluate(new ii(Math.floor(r.zoom-1),r)),e.expression.evaluate(new ii(Math.floor(r.zoom),r)),e.expression.evaluate(new ii(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,s,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:s,to:r}}interpolate(e){return e}}class Vo{constructor(e){this.specification=e}possiblyEvaluate(e,r,s,o){return!!e.expression.evaluate(r,null,{},s,o)}interpolate(){return!1}}class lr{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){const s=e[r];s.specification.overridable&&this.overridableProperties.push(r);const o=this.defaultPropertyValues[r]=new Vs(s,void 0),d=this.defaultTransitionablePropertyValues[r]=new Ra(s);this.defaultTransitioningPropertyValues[r]=d.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=o.possiblyEvaluate({})}}}Be("DataDrivenProperty",tt),Be("DataConstantProperty",Ne),Be("CrossFadedDataDrivenProperty",us),Be("CrossFadedProperty",Oo),Be("ColorRampProperty",Vo);const Uo="-transition";class Zr extends Wi{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new cc(r.layout)),r.paint)){this._transitionablePaint=new oc(r.paint);for(const s in e.paint)this.setPaintProperty(s,e.paint[s],{validate:!1});for(const s in e.layout)this.setLayoutProperty(s,e.layout[s],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Us(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,s={}){r!=null&&this._validate(Fs,`layers.${this.id}.layout.${e}`,e,r,s)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith(Uo)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,s={}){if(r!=null&&this._validate(lu,`layers.${this.id}.paint.${e}`,e,r,s))return!1;if(e.endsWith(Uo))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{const o=this._transitionablePaint._values[e],d=o.property.specification["property-type"]==="cross-faded-data-driven",p=o.value.isDataDriven(),m=o.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const y=this._transitionablePaint._values[e].value;return y.isDataDriven()||p||d||this._handleOverridablePaintPropertyUpdate(e,m,y)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,s){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,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),_t(e,(r,s)=>!(r===void 0||s==="layout"&&!Object.keys(r).length||s==="paint"&&!Object.keys(r).length))}_validate(e,r,s,o,d={}){return(!d||d.validate!==!1)&&rc(this,e.call(Bs,{key:r,layerType:this.type,objectKey:s,value:o,styleSpec:fe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof qr&&as(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const uu={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ns{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class fi{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_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 r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function bi(i,e=1){let r=0,s=0;return{members:i.map(o=>{const d=uu[o.type].BYTES_PER_ELEMENT,p=r=uc(r,Math.max(e,d)),m=o.components||1;return s=Math.max(s,d),r+=d*m,{name:o.name,type:o.type,components:m,offset:p}}),size:uc(r,Math.max(s,e)),alignment:e}}function uc(i,e){return Math.ceil(i/e)*e}class an extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const o=2*e;return this.int16[o+0]=r,this.int16[o+1]=s,e}}an.prototype.bytesPerElement=4,Be("StructArrayLayout2i4",an);class Ba extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,s)}emplace(e,r,s,o){const d=3*e;return this.int16[d+0]=r,this.int16[d+1]=s,this.int16[d+2]=o,e}}Ba.prototype.bytesPerElement=6,Be("StructArrayLayout3i6",Ba);class No extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,o){const d=this.length;return this.resize(d+1),this.emplace(d,e,r,s,o)}emplace(e,r,s,o,d){const p=4*e;return this.int16[p+0]=r,this.int16[p+1]=s,this.int16[p+2]=o,this.int16[p+3]=d,e}}No.prototype.bytesPerElement=8,Be("StructArrayLayout4i8",No);class jo extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,o,d,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,s,o,d,p)}emplace(e,r,s,o,d,p,m){const y=6*e;return this.int16[y+0]=r,this.int16[y+1]=s,this.int16[y+2]=o,this.int16[y+3]=d,this.int16[y+4]=p,this.int16[y+5]=m,e}}jo.prototype.bytesPerElement=12,Be("StructArrayLayout2i4i12",jo);class qo extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,o,d,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,s,o,d,p)}emplace(e,r,s,o,d,p,m){const y=4*e,T=8*e;return this.int16[y+0]=r,this.int16[y+1]=s,this.uint8[T+4]=o,this.uint8[T+5]=d,this.uint8[T+6]=p,this.uint8[T+7]=m,e}}qo.prototype.bytesPerElement=8,Be("StructArrayLayout2i4ub8",qo);class hs extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const o=2*e;return this.float32[o+0]=r,this.float32[o+1]=s,e}}hs.prototype.bytesPerElement=8,Be("StructArrayLayout2f8",hs);class Zo extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,o,d,p,m,y,T,A){const C=this.length;return this.resize(C+1),this.emplace(C,e,r,s,o,d,p,m,y,T,A)}emplace(e,r,s,o,d,p,m,y,T,A,C){const D=10*e;return this.uint16[D+0]=r,this.uint16[D+1]=s,this.uint16[D+2]=o,this.uint16[D+3]=d,this.uint16[D+4]=p,this.uint16[D+5]=m,this.uint16[D+6]=y,this.uint16[D+7]=T,this.uint16[D+8]=A,this.uint16[D+9]=C,e}}Zo.prototype.bytesPerElement=20,Be("StructArrayLayout10ui20",Zo);class Go extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,o,d,p,m,y,T,A,C,D){const R=this.length;return this.resize(R+1),this.emplace(R,e,r,s,o,d,p,m,y,T,A,C,D)}emplace(e,r,s,o,d,p,m,y,T,A,C,D,R){const F=12*e;return this.int16[F+0]=r,this.int16[F+1]=s,this.int16[F+2]=o,this.int16[F+3]=d,this.uint16[F+4]=p,this.uint16[F+5]=m,this.uint16[F+6]=y,this.uint16[F+7]=T,this.int16[F+8]=A,this.int16[F+9]=C,this.int16[F+10]=D,this.int16[F+11]=R,e}}Go.prototype.bytesPerElement=24,Be("StructArrayLayout4i4ui4i24",Go);class un extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,s)}emplace(e,r,s,o){const d=3*e;return this.float32[d+0]=r,this.float32[d+1]=s,this.float32[d+2]=o,e}}un.prototype.bytesPerElement=12,Be("StructArrayLayout3f12",un);class Fa extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}Fa.prototype.bytesPerElement=4,Be("StructArrayLayout1ul4",Fa);class js extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,o,d,p,m,y,T){const A=this.length;return this.resize(A+1),this.emplace(A,e,r,s,o,d,p,m,y,T)}emplace(e,r,s,o,d,p,m,y,T,A){const C=10*e,D=5*e;return this.int16[C+0]=r,this.int16[C+1]=s,this.int16[C+2]=o,this.int16[C+3]=d,this.int16[C+4]=p,this.int16[C+5]=m,this.uint32[D+3]=y,this.uint16[C+8]=T,this.uint16[C+9]=A,e}}js.prototype.bytesPerElement=20,Be("StructArrayLayout6i1ul2ui20",js);class Oa extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,o,d,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,s,o,d,p)}emplace(e,r,s,o,d,p,m){const y=6*e;return this.int16[y+0]=r,this.int16[y+1]=s,this.int16[y+2]=o,this.int16[y+3]=d,this.int16[y+4]=p,this.int16[y+5]=m,e}}Oa.prototype.bytesPerElement=12,Be("StructArrayLayout2i2i2i12",Oa);class qs extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,o,d){const p=this.length;return this.resize(p+1),this.emplace(p,e,r,s,o,d)}emplace(e,r,s,o,d,p){const m=4*e,y=8*e;return this.float32[m+0]=r,this.float32[m+1]=s,this.float32[m+2]=o,this.int16[y+6]=d,this.int16[y+7]=p,e}}qs.prototype.bytesPerElement=16,Be("StructArrayLayout2f1f2i16",qs);class Ho extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,o){const d=this.length;return this.resize(d+1),this.emplace(d,e,r,s,o)}emplace(e,r,s,o,d){const p=12*e,m=3*e;return this.uint8[p+0]=r,this.uint8[p+1]=s,this.float32[m+1]=o,this.float32[m+2]=d,e}}Ho.prototype.bytesPerElement=12,Be("StructArrayLayout2ub2f12",Ho);class Nn extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,s)}emplace(e,r,s,o){const d=3*e;return this.uint16[d+0]=r,this.uint16[d+1]=s,this.uint16[d+2]=o,e}}Nn.prototype.bytesPerElement=6,Be("StructArrayLayout3ui6",Nn);class jn extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,o,d,p,m,y,T,A,C,D,R,F,V,Z,K){const le=this.length;return this.resize(le+1),this.emplace(le,e,r,s,o,d,p,m,y,T,A,C,D,R,F,V,Z,K)}emplace(e,r,s,o,d,p,m,y,T,A,C,D,R,F,V,Z,K,le){const J=24*e,se=12*e,me=48*e;return this.int16[J+0]=r,this.int16[J+1]=s,this.uint16[J+2]=o,this.uint16[J+3]=d,this.uint32[se+2]=p,this.uint32[se+3]=m,this.uint32[se+4]=y,this.uint16[J+10]=T,this.uint16[J+11]=A,this.uint16[J+12]=C,this.float32[se+7]=D,this.float32[se+8]=R,this.uint8[me+36]=F,this.uint8[me+37]=V,this.uint8[me+38]=Z,this.uint32[se+10]=K,this.int16[J+22]=le,e}}jn.prototype.bytesPerElement=48,Be("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",jn);class Wo extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,o,d,p,m,y,T,A,C,D,R,F,V,Z,K,le,J,se,me,ve,Re,Ue,Le,ze,ke,Oe){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,e,r,s,o,d,p,m,y,T,A,C,D,R,F,V,Z,K,le,J,se,me,ve,Re,Ue,Le,ze,ke,Oe)}emplace(e,r,s,o,d,p,m,y,T,A,C,D,R,F,V,Z,K,le,J,se,me,ve,Re,Ue,Le,ze,ke,Oe,Ee){const Se=32*e,Je=16*e;return this.int16[Se+0]=r,this.int16[Se+1]=s,this.int16[Se+2]=o,this.int16[Se+3]=d,this.int16[Se+4]=p,this.int16[Se+5]=m,this.int16[Se+6]=y,this.int16[Se+7]=T,this.uint16[Se+8]=A,this.uint16[Se+9]=C,this.uint16[Se+10]=D,this.uint16[Se+11]=R,this.uint16[Se+12]=F,this.uint16[Se+13]=V,this.uint16[Se+14]=Z,this.uint16[Se+15]=K,this.uint16[Se+16]=le,this.uint16[Se+17]=J,this.uint16[Se+18]=se,this.uint16[Se+19]=me,this.uint16[Se+20]=ve,this.uint16[Se+21]=Re,this.uint16[Se+22]=Ue,this.uint32[Je+12]=Le,this.float32[Je+13]=ze,this.float32[Je+14]=ke,this.uint16[Se+30]=Oe,this.uint16[Se+31]=Ee,e}}Wo.prototype.bytesPerElement=64,Be("StructArrayLayout8i15ui1ul2f2ui64",Wo);class Zs extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}Zs.prototype.bytesPerElement=4,Be("StructArrayLayout1f4",Zs);class qn extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,s)}emplace(e,r,s,o){const d=3*e;return this.uint16[6*e+0]=r,this.float32[d+1]=s,this.float32[d+2]=o,e}}qn.prototype.bytesPerElement=12,Be("StructArrayLayout1ui2f12",qn);class Xo extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,s)}emplace(e,r,s,o){const d=4*e;return this.uint32[2*e+0]=r,this.uint16[d+2]=s,this.uint16[d+3]=o,e}}Xo.prototype.bytesPerElement=8,Be("StructArrayLayout1ul2ui8",Xo);class Ko extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const o=2*e;return this.uint16[o+0]=r,this.uint16[o+1]=s,e}}Ko.prototype.bytesPerElement=4,Be("StructArrayLayout2ui4",Ko);class Va extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}Va.prototype.bytesPerElement=2,Be("StructArrayLayout1ui2",Va);class Jo extends fi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,o){const d=this.length;return this.resize(d+1),this.emplace(d,e,r,s,o)}emplace(e,r,s,o,d){const p=4*e;return this.float32[p+0]=r,this.float32[p+1]=s,this.float32[p+2]=o,this.float32[p+3]=d,e}}Jo.prototype.bytesPerElement=16,Be("StructArrayLayout4f16",Jo);class u extends Ns{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new X(this.anchorPointX,this.anchorPointY)}}u.prototype.size=20;class t extends js{get(e){return new u(this,e)}}Be("CollisionBoxArray",t);class n extends Ns{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}n.prototype.size=48;class a extends jn{get(e){return new n(this,e)}}Be("PlacedSymbolArray",a);class l extends Ns{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}l.prototype.size=64;class h extends Wo{get(e){return new l(this,e)}}Be("SymbolInstanceArray",h);class _ extends Zs{getoffsetX(e){return this.float32[1*e+0]}}Be("GlyphOffsetArray",_);class x extends Ba{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Be("SymbolLineVertexArray",x);class b extends Ns{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}b.prototype.size=12;class I extends qn{get(e){return new b(this,e)}}Be("TextAnchorOffsetArray",I);class E extends Ns{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]}}E.prototype.size=8;class M extends Xo{get(e){return new E(this,e)}}Be("FeatureIndexArray",M);class B extends an{}class j extends an{}class q extends an{}class H extends jo{}class U extends qo{}class Q extends hs{}class ue extends Zo{}class W extends Go{}class ae extends un{}class pe extends Fa{}class de extends Oa{}class xe extends Ho{}class Te extends Nn{}class we extends Ko{}const Ie=bi([{name:"a_pos",components:2,type:"Int16"}],4),{members:Fe}=Ie;class $e{constructor(e=[]){this.segments=e}prepareSegment(e,r,s,o){let d=this.segments[this.segments.length-1];return e>$e.MAX_VERTEX_ARRAY_LENGTH&&nt(`Max vertices per segment is ${$e.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!d||d.vertexLength+e>$e.MAX_VERTEX_ARRAY_LENGTH||d.sortKey!==o)&&(d={vertexOffset:r.length,primitiveOffset:s.length,vertexLength:0,primitiveLength:0},o!==void 0&&(d.sortKey=o),this.segments.push(d)),d}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,s,o){return new $e([{vertexOffset:e,primitiveOffset:r,vertexLength:s,primitiveLength:o,vaos:{},sortKey:0}])}}function Pe(i,e){return 256*(i=ot(Math.floor(i),0,255))+ot(Math.floor(e),0,255)}$e.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Be("SegmentVector",$e);const Qe=bi([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Ve={exports:{}},ri={exports:{}};ri.exports=function(i,e){var r,s,o,d,p,m,y,T;for(s=i.length-(r=3&i.length),o=e,p=3432918353,m=461845907,T=0;T>>16)*p&65535)<<16)&4294967295)<<15|y>>>17))*m+(((y>>>16)*m&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(d>>>16)&65535)<<16);switch(y=0,r){case 3:y^=(255&i.charCodeAt(T+2))<<16;case 2:y^=(255&i.charCodeAt(T+1))<<8;case 1:o^=y=(65535&(y=(y=(65535&(y^=255&i.charCodeAt(T)))*p+(((y>>>16)*p&65535)<<16)&4294967295)<<15|y>>>17))*m+(((y>>>16)*m&65535)<<16)&4294967295}return o^=i.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0};var Tt=ri.exports,gt={exports:{}};gt.exports=function(i,e){for(var r,s=i.length,o=e^s,d=0;s>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(d)|(255&i.charCodeAt(++d))<<8|(255&i.charCodeAt(++d))<<16|(255&i.charCodeAt(++d))<<24))+((1540483477*(r>>>16)&65535)<<16),o=1540483477*(65535&o)+((1540483477*(o>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),s-=4,++d;switch(s){case 3:o^=(255&i.charCodeAt(d+2))<<16;case 2:o^=(255&i.charCodeAt(d+1))<<8;case 1:o=1540483477*(65535&(o^=255&i.charCodeAt(d)))+((1540483477*(o>>>16)&65535)<<16)}return o=1540483477*(65535&(o^=o>>>13))+((1540483477*(o>>>16)&65535)<<16),(o^=o>>>15)>>>0};var St=Tt,wi=gt.exports;Ve.exports=St,Ve.exports.murmur3=St,Ve.exports.murmur2=wi;var Kt=ne(Ve.exports);class cr{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,s,o){this.ids.push(qi(e)),this.positions.push(r,s,o)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=qi(e);let s=0,o=this.ids.length-1;for(;s>1;this.ids[p]>=r?o=p:s=p+1}const d=[];for(;this.ids[s]===r;)d.push({index:this.positions[3*s],start:this.positions[3*s+1],end:this.positions[3*s+2]}),s++;return d}static serialize(e,r){const s=new Float64Array(e.ids),o=new Uint32Array(e.positions);return mi(s,o,0,s.length-1),r&&r.push(s.buffer,o.buffer),{ids:s,positions:o}}static deserialize(e){const r=new cr;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function qi(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Kt(String(i))}function mi(i,e,r,s){for(;r>1];let d=r-1,p=s+1;for(;;){do d++;while(i[d]o);if(d>=p)break;er(i,d,p),er(e,3*d,3*p),er(e,3*d+1,3*p+1),er(e,3*d+2,3*p+2)}p-r`u_${o}`),this.type=s}setUniform(e,r,s){e.set(s.constantOr(this.value))}getBinding(e,r,s){return this.type==="color"?new ds(e,r):new Ur(e,r)}}class Ti{constructor(e,r){this.uniformNames=r.map(s=>`u_${s}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,s,o){const d=o==="u_pattern_to"?this.patternTo:o==="u_pattern_from"?this.patternFrom:o==="u_pixel_ratio_to"?this.pixelRatioTo:o==="u_pixel_ratio_from"?this.pixelRatioFrom:null;d&&e.set(d)}getBinding(e,r,s){return s.substr(0,9)==="u_pattern"?new In(e,r):new Ur(e,r)}}class gi{constructor(e,r,s,o){this.expression=e,this.type=s,this.maxValue=0,this.paintVertexAttributes=r.map(d=>({name:`a_${d}`,type:"Float32",components:s==="color"?2:1,offset:0})),this.paintVertexArray=new o}populatePaintArray(e,r,s,o,d){const p=this.paintVertexArray.length,m=this.expression.evaluate(new ii(0),r,{},o,[],d);this.paintVertexArray.resize(e),this._setPaintValue(p,e,m)}updatePaintArray(e,r,s,o){const d=this.expression.evaluate({zoom:0},s,o);this._setPaintValue(e,r,d)}_setPaintValue(e,r,s){if(this.type==="color"){const o=An(s);for(let d=e;d`u_${m}_t`),this.type=s,this.useIntegerZoom=o,this.zoom=d,this.maxValue=0,this.paintVertexAttributes=r.map(m=>({name:`a_${m}`,type:"Float32",components:s==="color"?4:2,offset:0})),this.paintVertexArray=new p}populatePaintArray(e,r,s,o,d){const p=this.expression.evaluate(new ii(this.zoom),r,{},o,[],d),m=this.expression.evaluate(new ii(this.zoom+1),r,{},o,[],d),y=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(y,e,p,m)}updatePaintArray(e,r,s,o){const d=this.expression.evaluate({zoom:this.zoom},s,o),p=this.expression.evaluate({zoom:this.zoom+1},s,o);this._setPaintValue(e,r,d,p)}_setPaintValue(e,r,s,o){if(this.type==="color"){const d=An(s),p=An(o);for(let m=e;m`#define HAS_UNIFORM_${o}`))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const s=this.binders[r];if(s instanceof gi||s instanceof ur)for(let o=0;o!0){this.programConfigurations={};for(const o of e)this.programConfigurations[o.id]=new Li(o,r,s);this.needsUpload=!1,this._featureMap=new cr,this._bufferOffset=0}populatePaintArrays(e,r,s,o,d,p){for(const m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(e,r,o,d,p);r.id!==void 0&&this._featureMap.add(r.id,s,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,s,o){for(const d of s)this.needsUpload=this.programConfigurations[d.id].updatePaintArrays(e,this._featureMap,r,d,o)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Ri(i,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function hc(i,e,r){const s={color:{source:hs,composite:Jo},number:{source:Zs,composite:hs}},o=function(d){return{"line-pattern":{source:ue,composite:ue},"fill-pattern":{source:ue,composite:ue},"fill-extrusion-pattern":{source:ue,composite:ue}}[d]}(i);return o&&o[r]||s[e][r]}Be("ConstantBinder",Di),Be("CrossFadedConstantBinder",Ti),Be("SourceExpressionBinder",gi),Be("CrossFadedCompositeBinder",ni),Be("CompositeExpressionBinder",ur),Be("ProgramConfiguration",Li,{omit:["_buffers"]}),Be("ProgramConfigurationSet",Zi);const yi=8192,Yo=Math.pow(2,14)-1,dc=-Yo-1;function Zn(i){const e=yi/i.extent,r=i.loadGeometry();for(let s=0;sp.x+1||yp.y+1)&&nt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function Gn(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?Zn(i):[]}}function hn(i,e,r,s,o){i.emplaceBack(2*e+(s+1)/2,2*r+(o+1)/2)}class Ua{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new j,this.indexArray=new Te,this.segments=new $e,this.programConfigurations=new Zi(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){const o=this.layers[0],d=[];let p=null,m=!1;o.type==="circle"&&(p=o.layout.get("circle-sort-key"),m=!p.isConstant());for(const{feature:y,id:T,index:A,sourceLayerIndex:C}of e){const D=this.layers[0]._featureFilter.needGeometry,R=Gn(y,D);if(!this.layers[0]._featureFilter.filter(new ii(this.zoom),R,s))continue;const F=m?p.evaluate(R,{},s):void 0,V={id:T,properties:y.properties,type:y.type,sourceLayerIndex:C,index:A,geometry:D?R.geometry:Zn(y),patterns:{},sortKey:F};d.push(V)}m&&d.sort((y,T)=>y.sortKey-T.sortKey);for(const y of d){const{geometry:T,index:A,sourceLayerIndex:C}=y,D=e[A].feature;this.addFeature(y,T,A,s),r.featureIndex.insert(D,T,A,C,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Fe),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,s,o){for(const d of r)for(const p of d){const m=p.x,y=p.y;if(m<0||m>=yi||y<0||y>=yi)continue;const T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),A=T.vertexLength;hn(this.layoutVertexArray,m,y,-1,-1),hn(this.layoutVertexArray,m,y,1,-1),hn(this.layoutVertexArray,m,y,1,1),hn(this.layoutVertexArray,m,y,-1,1),this.indexArray.emplaceBack(A,A+1,A+2),this.indexArray.emplaceBack(A,A+3,A+2),T.vertexLength+=4,T.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,{},o)}}function Qo(i,e){for(let r=0;r1){if(Gs(i,e))return!0;for(let s=0;s1?r:r.sub(e)._mult(o)._add(e))}function yh(i,e){let r,s,o,d=!1;for(let p=0;pe.y!=o.y>e.y&&e.x<(o.x-s.x)*(e.y-s.y)/(o.y-s.y)+s.x&&(d=!d)}return d}function ja(i,e){let r=!1;for(let s=0,o=i.length-1;se.y!=p.y>e.y&&e.x<(p.x-d.x)*(e.y-d.y)/(p.y-d.y)+d.x&&(r=!r)}return r}function Qp(i,e,r){const s=r[0],o=r[2];if(i.xo.x&&e.x>o.x||i.yo.y&&e.y>o.y)return!1;const d=yt(i,e,r[0]);return d!==yt(i,e,r[1])||d!==yt(i,e,r[2])||d!==yt(i,e,r[3])}function $o(i,e,r){const s=e.paint.get(i).value;return s.kind==="constant"?s.value:r.programConfigurations.get(e.id).getMaxValue(i)}function mc(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function gc(i,e,r,s,o){if(!e[0]&&!e[1])return i;const d=X.convert(e)._mult(o);r==="viewport"&&d._rotate(-s);const p=[];for(let m=0;mwh(Z,V))}(T,y),R=C?A*m:A;for(const F of o)for(const V of F){const Z=C?V:wh(V,y);let K=R;const le=_c([],[V.x,V.y,0,1],y);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?K*=le[3]/p.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(K*=p.cameraToCenterDistance/le[3]),pc(D,Z,K))return!0}return!1}}function wh(i,e){const r=_c([],[i.x,i.y,0,1],e);return new X(r[0]/r[3],r[1]/r[3])}class Th extends Ua{}let Sh;Be("HeatmapBucket",Th,{omit:["layers"]});var rf={get paint(){return Sh=Sh||new lr({"heatmap-radius":new tt(fe.paint_heatmap["heatmap-radius"]),"heatmap-weight":new tt(fe.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ne(fe.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Vo(fe.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ne(fe.paint_heatmap["heatmap-opacity"])})}};function pu(i,{width:e,height:r},s,o){if(o){if(o instanceof Uint8ClampedArray)o=new Uint8Array(o.buffer);else if(o.length!==e*r*s)throw new RangeError(`mismatched image size. expected: ${o.length} but got: ${e*r*s}`)}else o=new Uint8Array(e*r*s);return i.width=e,i.height=r,i.data=o,i}function Ih(i,{width:e,height:r},s){if(e===i.width&&r===i.height)return;const o=pu({},{width:e,height:r},s);fu(i,o,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,r)},s),i.width=e,i.height=r,i.data=o.data}function fu(i,e,r,s,o,d){if(o.width===0||o.height===0)return e;if(o.width>i.width||o.height>i.height||r.x>i.width-o.width||r.y>i.height-o.height)throw new RangeError("out of range source coordinates for image copy");if(o.width>e.width||o.height>e.height||s.x>e.width-o.width||s.y>e.height-o.height)throw new RangeError("out of range destination coordinates for image copy");const p=i.data,m=e.data;if(p===m)throw new Error("srcData equals dstData, so image is already copied");for(let y=0;y{e[i.evaluationKey]=y;const T=i.expression.evaluate(e);o.data[p+m+0]=Math.floor(255*T.r/T.a),o.data[p+m+1]=Math.floor(255*T.g/T.a),o.data[p+m+2]=Math.floor(255*T.b/T.a),o.data[p+m+3]=Math.floor(255*T.a)};if(i.clips)for(let p=0,m=0;p80*r){s=d=i[0],o=p=i[1];for(var F=r;Fd&&(d=m),y>p&&(p=y);T=(T=Math.max(d-s,p-o))!==0?32767/T:0}return il(D,R,r,s,o,T,0),R}function kh(i,e,r,s,o){var d,p;if(o===yu(i,e,r,s)>0)for(d=e;d=e;d-=s)p=Ph(d,i[d],i[d+1],p);return p&&xc(p,p.next)&&(nl(p),p=p.next),p}function Hs(i,e){if(!i)return i;e||(e=i);var r,s=i;do if(r=!1,s.steiner||!xc(s,s.next)&&Si(s.prev,s,s.next)!==0)s=s.next;else{if(nl(s),(s=e=s.prev)===s.next)break;r=!0}while(r||s!==e);return e}function il(i,e,r,s,o,d,p){if(i){!p&&d&&function(A,C,D,R){var F=A;do F.z===0&&(F.z=gu(F.x,F.y,C,D,R)),F.prevZ=F.prev,F.nextZ=F.next,F=F.next;while(F!==A);F.prevZ.nextZ=null,F.prevZ=null,function(V){var Z,K,le,J,se,me,ve,Re,Ue=1;do{for(K=V,V=null,se=null,me=0;K;){for(me++,le=K,ve=0,Z=0;Z0||Re>0&≤)ve!==0&&(Re===0||!le||K.z<=le.z)?(J=K,K=K.nextZ,ve--):(J=le,le=le.nextZ,Re--),se?se.nextZ=J:V=J,J.prevZ=se,se=J;K=le}se.nextZ=null,Ue*=2}while(me>1)}(F)}(i,s,o,d);for(var m,y,T=i;i.prev!==i.next;)if(m=i.prev,y=i.next,d?uf(i,s,o,d):cf(i))e.push(m.i/r|0),e.push(i.i/r|0),e.push(y.i/r|0),nl(i),i=y.next,T=y.next;else if((i=y)===T){p?p===1?il(i=hf(Hs(i),e,r),e,r,s,o,d,2):p===2&&df(i,e,r,s,o,d):il(Hs(i),e,r,s,o,d,1);break}}}function cf(i){var e=i.prev,r=i,s=i.next;if(Si(e,r,s)>=0)return!1;for(var o=e.x,d=r.x,p=s.x,m=e.y,y=r.y,T=s.y,A=od?o>p?o:p:d>p?d:p,R=m>y?m>T?m:T:y>T?y:T,F=s.next;F!==e;){if(F.x>=A&&F.x<=D&&F.y>=C&&F.y<=R&&Za(o,m,d,y,p,T,F.x,F.y)&&Si(F.prev,F,F.next)>=0)return!1;F=F.next}return!0}function uf(i,e,r,s){var o=i.prev,d=i,p=i.next;if(Si(o,d,p)>=0)return!1;for(var m=o.x,y=d.x,T=p.x,A=o.y,C=d.y,D=p.y,R=my?m>T?m:T:y>T?y:T,Z=A>C?A>D?A:D:C>D?C:D,K=gu(R,F,e,r,s),le=gu(V,Z,e,r,s),J=i.prevZ,se=i.nextZ;J&&J.z>=K&&se&&se.z<=le;){if(J.x>=R&&J.x<=V&&J.y>=F&&J.y<=Z&&J!==o&&J!==p&&Za(m,A,y,C,T,D,J.x,J.y)&&Si(J.prev,J,J.next)>=0||(J=J.prevZ,se.x>=R&&se.x<=V&&se.y>=F&&se.y<=Z&&se!==o&&se!==p&&Za(m,A,y,C,T,D,se.x,se.y)&&Si(se.prev,se,se.next)>=0))return!1;se=se.nextZ}for(;J&&J.z>=K;){if(J.x>=R&&J.x<=V&&J.y>=F&&J.y<=Z&&J!==o&&J!==p&&Za(m,A,y,C,T,D,J.x,J.y)&&Si(J.prev,J,J.next)>=0)return!1;J=J.prevZ}for(;se&&se.z<=le;){if(se.x>=R&&se.x<=V&&se.y>=F&&se.y<=Z&&se!==o&&se!==p&&Za(m,A,y,C,T,D,se.x,se.y)&&Si(se.prev,se,se.next)>=0)return!1;se=se.nextZ}return!0}function hf(i,e,r){var s=i;do{var o=s.prev,d=s.next.next;!xc(o,d)&&Eh(o,s,s.next,d)&&rl(o,d)&&rl(d,o)&&(e.push(o.i/r|0),e.push(s.i/r|0),e.push(d.i/r|0),nl(s),nl(s.next),s=i=d),s=s.next}while(s!==i);return Hs(s)}function df(i,e,r,s,o,d){var p=i;do{for(var m=p.next.next;m!==p.prev;){if(p.i!==m.i&&_f(p,m)){var y=Mh(p,m);return p=Hs(p,p.next),y=Hs(y,y.next),il(p,e,r,s,o,d,0),void il(y,e,r,s,o,d,0)}m=m.next}p=p.next}while(p!==i)}function pf(i,e){return i.x-e.x}function ff(i,e){var r=function(o,d){var p,m=d,y=o.x,T=o.y,A=-1/0;do{if(T<=m.y&&T>=m.next.y&&m.next.y!==m.y){var C=m.x+(T-m.y)*(m.next.x-m.x)/(m.next.y-m.y);if(C<=y&&C>A&&(A=C,p=m.x=m.x&&m.x>=F&&y!==m.x&&Za(Tp.x||m.x===p.x&&mf(p,m)))&&(p=m,Z=D)),m=m.next;while(m!==R);return p}(i,e);if(!r)return e;var s=Mh(r,i);return Hs(s,s.next),Hs(r,r.next)}function mf(i,e){return Si(i.prev,i,e.prev)<0&&Si(e.next,i,i.next)<0}function gu(i,e,r,s,o){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*o|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function gf(i){var e=i,r=i;do(e.x=(i-p)*(d-m)&&(i-p)*(s-m)>=(r-p)*(e-m)&&(r-p)*(d-m)>=(o-p)*(s-m)}function _f(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(r,s){var o=r;do{if(o.i!==r.i&&o.next.i!==r.i&&o.i!==s.i&&o.next.i!==s.i&&Eh(o,o.next,r,s))return!0;o=o.next}while(o!==r);return!1}(i,e)&&(rl(i,e)&&rl(e,i)&&function(r,s){var o=r,d=!1,p=(r.x+s.x)/2,m=(r.y+s.y)/2;do o.y>m!=o.next.y>m&&o.next.y!==o.y&&p<(o.next.x-o.x)*(m-o.y)/(o.next.y-o.y)+o.x&&(d=!d),o=o.next;while(o!==r);return d}(i,e)&&(Si(i.prev,i,e.prev)||Si(i,e.prev,e))||xc(i,e)&&Si(i.prev,i,i.next)>0&&Si(e.prev,e,e.next)>0)}function Si(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function xc(i,e){return i.x===e.x&&i.y===e.y}function Eh(i,e,r,s){var o=bc(Si(i,e,r)),d=bc(Si(i,e,s)),p=bc(Si(r,s,i)),m=bc(Si(r,s,e));return o!==d&&p!==m||!(o!==0||!vc(i,r,e))||!(d!==0||!vc(i,s,e))||!(p!==0||!vc(r,i,s))||!(m!==0||!vc(r,e,s))}function vc(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function bc(i){return i>0?1:i<0?-1:0}function rl(i,e){return Si(i.prev,i,i.next)<0?Si(i,e,i.next)>=0&&Si(i,i.prev,e)>=0:Si(i,e,i.prev)<0||Si(i,i.next,e)<0}function Mh(i,e){var r=new _u(i.i,i.x,i.y),s=new _u(e.i,e.x,e.y),o=i.next,d=e.prev;return i.next=e,e.prev=i,r.next=o,o.prev=r,s.next=r,r.prev=s,d.next=s,s.prev=d,s}function Ph(i,e,r,s){var o=new _u(i,e,r);return s?(o.next=s.next,o.prev=s,s.next.prev=o,s.next=o):(o.prev=o,o.next=o),o}function nl(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function _u(i,e,r){this.i=i,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function yu(i,e,r,s){for(var o=0,d=e,p=r-s;d0&&r.holes.push(s+=i[o-1].length)}return r};var zh=ne(mu.exports);function yf(i,e,r,s,o){Dh(i,e,r||0,s||i.length-1,o||xf)}function Dh(i,e,r,s,o){for(;s>r;){if(s-r>600){var d=s-r+1,p=e-r+1,m=Math.log(d),y=.5*Math.exp(2*m/3),T=.5*Math.sqrt(m*y*(d-y)/d)*(p-d/2<0?-1:1);Dh(i,e,Math.max(r,Math.floor(e-p*y/d+T)),Math.min(s,Math.floor(e+(d-p)*y/d+T)),o)}var A=i[e],C=r,D=s;for(sl(i,r,e),o(i[s],A)>0&&sl(i,r,s);C0;)D--}o(i[r],A)===0?sl(i,r,D):sl(i,++D,s),D<=e&&(r=D+1),e<=D&&(s=D-1)}}function sl(i,e,r){var s=i[e];i[e]=i[r],i[r]=s}function xf(i,e){return ie?1:0}function xu(i,e){const r=i.length;if(r<=1)return[i];const s=[];let o,d;for(let p=0;p1)for(let p=0;pr.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new q,this.indexArray=new Te,this.indexArray2=new we,this.programConfigurations=new Zi(e.layers,e.zoom),this.segments=new $e,this.segments2=new $e,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.hasPattern=vu("fill",this.layers,r);const o=this.layers[0].layout.get("fill-sort-key"),d=!o.isConstant(),p=[];for(const{feature:m,id:y,index:T,sourceLayerIndex:A}of e){const C=this.layers[0]._featureFilter.needGeometry,D=Gn(m,C);if(!this.layers[0]._featureFilter.filter(new ii(this.zoom),D,s))continue;const R=d?o.evaluate(D,{},s,r.availableImages):void 0,F={id:y,properties:m.properties,type:m.type,sourceLayerIndex:A,index:T,geometry:C?D.geometry:Zn(m),patterns:{},sortKey:R};p.push(F)}d&&p.sort((m,y)=>m.sortKey-y.sortKey);for(const m of p){const{geometry:y,index:T,sourceLayerIndex:A}=m;if(this.hasPattern){const C=bu("fill",this.layers,m,this.zoom,r);this.patternFeatures.push(C)}else this.addFeature(m,y,T,s,{});r.featureIndex.insert(e[T].feature,y,T,A,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}addFeatures(e,r,s){for(const o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,lf),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,s,o,d){for(const p of xu(r,500)){let m=0;for(const R of p)m+=R.length;const y=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),T=y.vertexLength,A=[],C=[];for(const R of p){if(R.length===0)continue;R!==p[0]&&C.push(A.length/2);const F=this.segments2.prepareSegment(R.length,this.layoutVertexArray,this.indexArray2),V=F.vertexLength;this.layoutVertexArray.emplaceBack(R[0].x,R[0].y),this.indexArray2.emplaceBack(V+R.length-1,V),A.push(R[0].x),A.push(R[0].y);for(let Z=1;Z>3}if(o--,s===1||s===2)d+=i.readSVarint(),p+=i.readSVarint(),s===1&&(e&&m.push(e),e=[]),e.push(new Af(d,p));else{if(s!==7)throw new Error("unknown command "+s);e&&e.push(e[0].clone())}}return e&&m.push(e),m},Ga.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,r=1,s=0,o=0,d=0,p=1/0,m=-1/0,y=1/0,T=-1/0;i.pos>3}if(s--,r===1||r===2)(o+=i.readSVarint())m&&(m=o),(d+=i.readSVarint())T&&(T=d);else if(r!==7)throw new Error("unknown command "+r)}return[p,y,m,T]},Ga.prototype.toGeoJSON=function(i,e,r){var s,o,d=this.extent*Math.pow(2,r),p=this.extent*i,m=this.extent*e,y=this.loadGeometry(),T=Ga.types[this.type];function A(R){for(var F=0;F>3;o=p===1?s.readString():p===2?s.readFloat():p===3?s.readDouble():p===4?s.readVarint64():p===5?s.readVarint():p===6?s.readSVarint():p===7?s.readBoolean():null}return o}(r))}Oh.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new Ef(this._pbf,e,this.extent,this._keys,this._values)};var Pf=Fh;function zf(i,e,r){if(i===3){var s=new Pf(r,r.readVarint()+r.pos);s.length&&(e[s.name]=s)}}fs.VectorTile=function(i,e){this.layers=i.readFields(zf,{},e)},fs.VectorTileFeature=Bh,fs.VectorTileLayer=Fh;const Df=fs.VectorTileFeature.types,Tu=Math.pow(2,13);function al(i,e,r,s,o,d,p,m){i.emplaceBack(e,r,2*Math.floor(s*Tu)+p,o*Tu*2,d*Tu*2,Math.round(m))}class Su{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new H,this.centroidVertexArray=new B,this.indexArray=new Te,this.programConfigurations=new Zi(e.layers,e.zoom),this.segments=new $e,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.features=[],this.hasPattern=vu("fill-extrusion",this.layers,r);for(const{feature:o,id:d,index:p,sourceLayerIndex:m}of e){const y=this.layers[0]._featureFilter.needGeometry,T=Gn(o,y);if(!this.layers[0]._featureFilter.filter(new ii(this.zoom),T,s))continue;const A={id:d,sourceLayerIndex:m,index:p,geometry:y?T.geometry:Zn(o),properties:o.properties,type:o.type,patterns:{}};this.hasPattern?this.features.push(bu("fill-extrusion",this.layers,A,this.zoom,r)):this.addFeature(A,A.geometry,p,s,{}),r.featureIndex.insert(o,A.geometry,p,m,this.index,!0)}}addFeatures(e,r,s){for(const o of this.features){const{geometry:d}=o;this.addFeature(o,d,o.index,r,s)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,If),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Sf.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,s,o,d){const p={x:0,y:0,vertexCount:0};for(const m of xu(r,500)){let y=0;for(const F of m)y+=F.length;let T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const F of m){if(F.length===0||Rf(F))continue;let V=0;for(let Z=0;Z=1){const le=F[Z-1];if(!Lf(K,le)){T.vertexLength+4>$e.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const J=K.sub(le)._perp()._unit(),se=le.dist(K);V+se>32768&&(V=0),al(this.layoutVertexArray,K.x,K.y,J.x,J.y,0,0,V),al(this.layoutVertexArray,K.x,K.y,J.x,J.y,0,1,V),p.x+=2*K.x,p.y+=2*K.y,p.vertexCount+=2,V+=se,al(this.layoutVertexArray,le.x,le.y,J.x,J.y,0,0,V),al(this.layoutVertexArray,le.x,le.y,J.x,J.y,0,1,V),p.x+=2*le.x,p.y+=2*le.y,p.vertexCount+=2;const me=T.vertexLength;this.indexArray.emplaceBack(me,me+2,me+1),this.indexArray.emplaceBack(me+1,me+2,me+3),T.vertexLength+=4,T.primitiveLength+=2}}}}if(T.vertexLength+y>$e.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(y,this.layoutVertexArray,this.indexArray)),Df[e.type]!=="Polygon")continue;const A=[],C=[],D=T.vertexLength;for(const F of m)if(F.length!==0){F!==m[0]&&C.push(A.length/2);for(let V=0;Vyi)||i.y===e.y&&(i.y<0||i.y>yi)}function Rf(i){return i.every(e=>e.x<0)||i.every(e=>e.x>yi)||i.every(e=>e.y<0)||i.every(e=>e.y>yi)}let Vh;Be("FillExtrusionBucket",Su,{omit:["layers","features"]});var Bf={get paint(){return Vh=Vh||new lr({"fill-extrusion-opacity":new Ne(fe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new tt(fe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ne(fe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ne(fe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new us(fe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new tt(fe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new tt(fe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ne(fe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Ff extends Zr{constructor(e){super(e,Bf)}createBucket(e){return new Su(e)}queryRadius(){return mc(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,r,s,o,d,p,m,y){const T=gc(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),p.angle,m),A=this.paint.get("fill-extrusion-height").evaluate(r,s),C=this.paint.get("fill-extrusion-base").evaluate(r,s),D=function(F,V,Z,K){const le=[];for(const J of F){const se=[J.x,J.y,0,1];_c(se,se,V),le.push(new X(se[0]/se[3],se[1]/se[3]))}return le}(T,y),R=function(F,V,Z,K){const le=[],J=[],se=K[8]*V,me=K[9]*V,ve=K[10]*V,Re=K[11]*V,Ue=K[8]*Z,Le=K[9]*Z,ze=K[10]*Z,ke=K[11]*Z;for(const Oe of F){const Ee=[],Se=[];for(const Je of Oe){const je=Je.x,vt=Je.y,si=K[0]*je+K[4]*vt+K[12],ci=K[1]*je+K[5]*vt+K[13],Fi=K[2]*je+K[6]*vt+K[14],Nr=K[3]*je+K[7]*vt+K[15],br=Fi+ve,Ei=Nr+Re,Ki=si+Ue,rr=ci+Le,wr=Fi+ze,Tr=Nr+ke,Oi=new X((si+se)/Ei,(ci+me)/Ei);Oi.z=br/Ei,Ee.push(Oi);const Vi=new X(Ki/Tr,rr/Tr);Vi.z=wr/Tr,Se.push(Vi)}le.push(Ee),J.push(Se)}return[le,J]}(o,C,A,y);return function(F,V,Z){let K=1/0;Na(Z,V)&&(K=Uh(Z,V[0]));for(let le=0;ler.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new U,this.layoutVertexArray2=new Q,this.indexArray=new Te,this.programConfigurations=new Zi(e.layers,e.zoom),this.segments=new $e,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.hasPattern=vu("line",this.layers,r);const o=this.layers[0].layout.get("line-sort-key"),d=!o.isConstant(),p=[];for(const{feature:m,id:y,index:T,sourceLayerIndex:A}of e){const C=this.layers[0]._featureFilter.needGeometry,D=Gn(m,C);if(!this.layers[0]._featureFilter.filter(new ii(this.zoom),D,s))continue;const R=d?o.evaluate(D,{},s):void 0,F={id:y,properties:m.properties,type:m.type,sourceLayerIndex:A,index:T,geometry:C?D.geometry:Zn(m),patterns:{},sortKey:R};p.push(F)}d&&p.sort((m,y)=>m.sortKey-y.sortKey);for(const m of p){const{geometry:y,index:T,sourceLayerIndex:A}=m;if(this.hasPattern){const C=bu("line",this.layers,m,this.zoom,r);this.patternFeatures.push(C)}else this.addFeature(m,y,T,s,{});r.featureIndex.insert(e[T].feature,y,T,A,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}addFeatures(e,r,s){for(const o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,s)}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,Nf)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Vf),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,s,o,d){const p=this.layers[0].layout,m=p.get("line-join").evaluate(e,{}),y=p.get("line-cap"),T=p.get("line-miter-limit"),A=p.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const C of r)this.addLine(C,e,m,y,T,A);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,d,o)}addLine(e,r,s,o,d,p){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let K=0;K=2&&e[y-1].equals(e[y-2]);)y--;let T=0;for(;T0;if(Re&&K>T){const ke=D.dist(R);if(ke>2*A){const Oe=D.sub(D.sub(R)._mult(A/ke)._round());this.updateDistance(R,Oe),this.addCurrentVertex(Oe,V,0,0,C),R=Oe}}const Le=R&&F;let ze=Le?s:m?"butt":o;if(Le&&ze==="round"&&(med&&(ze="bevel"),ze==="bevel"&&(me>2&&(ze="flipbevel"),me100)le=Z.mult(-1);else{const ke=me*V.add(Z).mag()/V.sub(Z).mag();le._perp()._mult(ke*(Ue?-1:1))}this.addCurrentVertex(D,le,0,0,C),this.addCurrentVertex(D,le.mult(-1),0,0,C)}else if(ze==="bevel"||ze==="fakeround"){const ke=-Math.sqrt(me*me-1),Oe=Ue?ke:0,Ee=Ue?0:ke;if(R&&this.addCurrentVertex(D,V,Oe,Ee,C),ze==="fakeround"){const Se=Math.round(180*ve/Math.PI/20);for(let Je=1;Je2*A){const Oe=D.add(F.sub(D)._mult(A/ke)._round());this.updateDistance(D,Oe),this.addCurrentVertex(Oe,Z,0,0,C),D=Oe}}}}addCurrentVertex(e,r,s,o,d,p=!1){const m=r.y*o-r.x,y=-r.y-r.x*o;this.addHalfVertex(e,r.x+r.y*s,r.y-r.x*s,p,!1,s,d),this.addHalfVertex(e,m,y,p,!0,-o,d),this.distance>Nh/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,s,o,d,p))}addHalfVertex({x:e,y:r},s,o,d,p,m,y){const T=.5*(this.lineClips?this.scaledDistance*(Nh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(d?1:0),(r<<1)+(p?1:0),Math.round(63*s)+128,Math.round(63*o)+128,1+(m===0?0:m<0?-1:1)|(63&T)<<2,T>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const A=y.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,A),y.primitiveLength++),p?this.e2=A:this.e1=A}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}let jh,qh;Be("LineBucket",Iu,{omit:["layers","patternFeatures"]});var Zh={get paint(){return qh=qh||new lr({"line-opacity":new tt(fe.paint_line["line-opacity"]),"line-color":new tt(fe.paint_line["line-color"]),"line-translate":new Ne(fe.paint_line["line-translate"]),"line-translate-anchor":new Ne(fe.paint_line["line-translate-anchor"]),"line-width":new tt(fe.paint_line["line-width"]),"line-gap-width":new tt(fe.paint_line["line-gap-width"]),"line-offset":new tt(fe.paint_line["line-offset"]),"line-blur":new tt(fe.paint_line["line-blur"]),"line-dasharray":new Oo(fe.paint_line["line-dasharray"]),"line-pattern":new us(fe.paint_line["line-pattern"]),"line-gradient":new Vo(fe.paint_line["line-gradient"])})},get layout(){return jh=jh||new lr({"line-cap":new Ne(fe.layout_line["line-cap"]),"line-join":new tt(fe.layout_line["line-join"]),"line-miter-limit":new Ne(fe.layout_line["line-miter-limit"]),"line-round-limit":new Ne(fe.layout_line["line-round-limit"]),"line-sort-key":new tt(fe.layout_line["line-sort-key"])})}};class Zf extends tt{possiblyEvaluate(e,r){return r=new ii(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,s,o){return r=Ke({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,s,o)}}let wc;class Gf extends Zr{constructor(e){super(e,Zh),this.gradientVersion=0,wc||(wc=new Zf(Zh.paint.properties["line-width"].specification),wc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){const r=this.gradientExpression();this.stepInterpolant=!!function(s){return s._styleExpression!==void 0}(r)&&r._styleExpression.expression instanceof Ps,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=wc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Iu(e)}queryRadius(e){const r=e,s=Gh($o("line-width",this,r),$o("line-gap-width",this,r)),o=$o("line-offset",this,r);return s/2+Math.abs(o)+mc(this.paint.get("line-translate"))}queryIntersectsFeature(e,r,s,o,d,p,m){const y=gc(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),p.angle,m),T=m/2*Gh(this.paint.get("line-width").evaluate(r,s),this.paint.get("line-gap-width").evaluate(r,s)),A=this.paint.get("line-offset").evaluate(r,s);return A&&(o=function(C,D){const R=[];for(let F=0;F=3){for(let Z=0;Z0?e+2*i:i}const Hf=bi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Wf=bi([{name:"a_projected_pos",components:3,type:"Float32"}],4);bi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Xf=bi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);bi([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Hh=bi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Kf=bi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Jf(i,e,r){return i.sections.forEach(s=>{s.text=function(o,d,p){const m=d.layout.get("text-transform").evaluate(p,{});return m==="uppercase"?o=o.toLocaleUpperCase():m==="lowercase"&&(o=o.toLocaleLowerCase()),Un.applyArabicShaping&&(o=Un.applyArabicShaping(o)),o}(s.text,e,r)}),i}bi([{name:"triangle",components:3,type:"Uint16"}]),bi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),bi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),bi([{type:"Float32",name:"offsetX"}]),bi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),bi([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const ll={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Bi=24,Wh=Jt,Xh=function(i,e,r,s,o){var d,p,m=8*o-s-1,y=(1<>1,A=-7,C=r?o-1:0,D=r?-1:1,R=i[e+C];for(C+=D,d=R&(1<<-A)-1,R>>=-A,A+=m;A>0;d=256*d+i[e+C],C+=D,A-=8);for(p=d&(1<<-A)-1,d>>=-A,A+=s;A>0;p=256*p+i[e+C],C+=D,A-=8);if(d===0)d=1-T;else{if(d===y)return p?NaN:1/0*(R?-1:1);p+=Math.pow(2,s),d-=T}return(R?-1:1)*p*Math.pow(2,d-s)},Kh=function(i,e,r,s,o,d){var p,m,y,T=8*d-o-1,A=(1<>1,D=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=s?0:d-1,F=s?1:-1,V=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(m=isNaN(e)?1:0,p=A):(p=Math.floor(Math.log(e)/Math.LN2),e*(y=Math.pow(2,-p))<1&&(p--,y*=2),(e+=p+C>=1?D/y:D*Math.pow(2,1-C))*y>=2&&(p++,y/=2),p+C>=A?(m=0,p=A):p+C>=1?(m=(e*y-1)*Math.pow(2,o),p+=C):(m=e*Math.pow(2,C-1)*Math.pow(2,o),p=0));o>=8;i[r+R]=255&m,R+=F,m/=256,o-=8);for(p=p<0;i[r+R]=255&p,R+=F,p/=256,T-=8);i[r+R-F]|=128*V};function Jt(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}Jt.Varint=0,Jt.Fixed64=1,Jt.Bytes=2,Jt.Fixed32=5;var Au=4294967296,Jh=1/Au,Yh=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Hn(i){return i.type===Jt.Bytes?i.readVarint()+i.pos:i.pos+1}function Ha(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function Qh(i,e,r){var s=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(s);for(var o=r.pos-1;o>=i;o--)r.buf[o+s]=r.buf[o]}function Yf(i,e){for(var r=0;r>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function $h(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}Jt.prototype={destroy:function(){this.buf=null},readFields:function(i,e,r){for(r=r||this.length;this.pos>3,d=this.pos;this.type=7&s,i(o,e,this),this.pos===d&&this.skip(s)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=Tc(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=$h(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Tc(this.buf,this.pos)+Tc(this.buf,this.pos+4)*Au;return this.pos+=8,i},readSFixed64:function(){var i=Tc(this.buf,this.pos)+$h(this.buf,this.pos+4)*Au;return this.pos+=8,i},readFloat:function(){var i=Xh(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=Xh(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,r,s=this.buf;return e=127&(r=s[this.pos++]),r<128?e:(e|=(127&(r=s[this.pos++]))<<7,r<128?e:(e|=(127&(r=s[this.pos++]))<<14,r<128?e:(e|=(127&(r=s[this.pos++]))<<21,r<128?e:function(o,d,p){var m,y,T=p.buf;if(m=(112&(y=T[p.pos++]))>>4,y<128||(m|=(127&(y=T[p.pos++]))<<3,y<128)||(m|=(127&(y=T[p.pos++]))<<10,y<128)||(m|=(127&(y=T[p.pos++]))<<17,y<128)||(m|=(127&(y=T[p.pos++]))<<24,y<128)||(m|=(1&(y=T[p.pos++]))<<31,y<128))return Ha(o,m,d);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=s[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&Yh?function(r,s,o){return Yh.decode(r.subarray(s,o))}(this.buf,e,i):function(r,s,o){for(var d="",p=s;p239?4:A>223?3:A>191?2:1;if(p+D>o)break;D===1?A<128&&(C=A):D===2?(192&(m=r[p+1]))==128&&(C=(31&A)<<6|63&m)<=127&&(C=null):D===3?(y=r[p+2],(192&(m=r[p+1]))==128&&(192&y)==128&&((C=(15&A)<<12|(63&m)<<6|63&y)<=2047||C>=55296&&C<=57343)&&(C=null)):D===4&&(y=r[p+2],T=r[p+3],(192&(m=r[p+1]))==128&&(192&y)==128&&(192&T)==128&&((C=(15&A)<<18|(63&m)<<12|(63&y)<<6|63&T)<=65535||C>=1114112)&&(C=null)),C===null?(C=65533,D=1):C>65535&&(C-=65536,d+=String.fromCharCode(C>>>10&1023|55296),C=56320|1023&C),d+=String.fromCharCode(C),p+=D}return d}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==Jt.Bytes)return i.push(this.readVarint(e));var r=Hn(this);for(i=i||[];this.pos127;);else if(e===Jt.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Jt.Fixed32)this.pos+=4;else{if(e!==Jt.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e268435455||i<0?function(e,r){var s,o;if(e>=0?(s=e%4294967296|0,o=e/4294967296|0):(o=~(-e/4294967296),4294967295^(s=~(-e%4294967296))?s=s+1|0:(s=0,o=o+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(d,p,m){m.buf[m.pos++]=127&d|128,d>>>=7,m.buf[m.pos++]=127&d|128,d>>>=7,m.buf[m.pos++]=127&d|128,d>>>=7,m.buf[m.pos++]=127&d|128,m.buf[m.pos]=127&(d>>>=7)}(s,0,r),function(d,p){var m=(7&d)<<4;p.buf[p.pos++]|=m|((d>>>=3)?128:0),d&&(p.buf[p.pos++]=127&d|((d>>>=7)?128:0),d&&(p.buf[p.pos++]=127&d|((d>>>=7)?128:0),d&&(p.buf[p.pos++]=127&d|((d>>>=7)?128:0),d&&(p.buf[p.pos++]=127&d|((d>>>=7)?128:0),d&&(p.buf[p.pos++]=127&d)))))}(o,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(s,o,d){for(var p,m,y=0;y55295&&p<57344){if(!m){p>56319||y+1===o.length?(s[d++]=239,s[d++]=191,s[d++]=189):m=p;continue}if(p<56320){s[d++]=239,s[d++]=191,s[d++]=189,m=p;continue}p=m-55296<<10|p-56320|65536,m=null}else m&&(s[d++]=239,s[d++]=191,s[d++]=189,m=null);p<128?s[d++]=p:(p<2048?s[d++]=p>>6|192:(p<65536?s[d++]=p>>12|224:(s[d++]=p>>18|240,s[d++]=p>>12&63|128),s[d++]=p>>6&63|128),s[d++]=63&p|128)}return d}(this.buf,i,this.pos);var r=this.pos-e;r>=128&&Qh(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),Kh(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),Kh(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&Qh(r,s,this),this.pos=r-1,this.writeVarint(s),this.pos+=s},writeMessage:function(i,e,r){this.writeTag(i,Jt.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,Yf,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,Qf,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,tm,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,$f,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,em,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,im,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,rm,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,nm,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,sm,e)},writeBytesField:function(i,e){this.writeTag(i,Jt.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,Jt.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,Jt.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,Jt.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,Jt.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,Jt.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,Jt.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,Jt.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,Jt.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,Jt.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,!!e)}};var Cu=ne(Wh);const ku=3;function am(i,e,r){i===1&&r.readMessage(om,e)}function om(i,e,r){if(i===3){const{id:s,bitmap:o,width:d,height:p,left:m,top:y,advance:T}=r.readMessage(lm,{});e.push({id:s,bitmap:new tl({width:d+2*ku,height:p+2*ku},o),metrics:{width:d,height:p,left:m,top:y,advance:T}})}}function lm(i,e,r){i===1?e.id=r.readVarint():i===2?e.bitmap=r.readBytes():i===3?e.width=r.readVarint():i===4?e.height=r.readVarint():i===5?e.left=r.readSVarint():i===6?e.top=r.readSVarint():i===7&&(e.advance=r.readVarint())}const ed=ku;function td(i){let e=0,r=0;for(const p of i)e+=p.w*p.h,r=Math.max(r,p.w);i.sort((p,m)=>m.h-p.h);const s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let o=0,d=0;for(const p of i)for(let m=s.length-1;m>=0;m--){const y=s[m];if(!(p.w>y.w||p.h>y.h)){if(p.x=y.x,p.y=y.y,d=Math.max(d,p.y+p.h),o=Math.max(o,p.x+p.w),p.w===y.w&&p.h===y.h){const T=s.pop();m=0&&s>=e&&Ic[this.text.charCodeAt(s)];s--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const s=new Xa;return s.text=this.text.substring(e,r),s.sectionIndex=this.sectionIndex.slice(e,r),s.sections=this.sections,s}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(ul.forText(e.scale,e.fontStack||r));const s=this.sections.length-1;for(let o=0;o=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Sc(i,e,r,s,o,d,p,m,y,T,A,C,D,R,F,V){const Z=Xa.fromFeature(i,o);let K;C===S.ah.vertical&&Z.verticalizePunctuation();const{processBidirectionalText:le,processStyledBidirectionalText:J}=Un;if(le&&Z.sections.length===1){K=[];const ve=le(Z.toString(),Mu(Z,T,d,e,s,R,F));for(const Re of ve){const Ue=new Xa;Ue.text=Re,Ue.sections=Z.sections;for(let Le=0;Le0&&Xn>zr&&(zr=Xn)}else{const Wr=Ue[Ct.fontStack],Lr=Wr&&Wr[nr];if(Lr&&Lr.rect)dn=Lr.rect,on=Lr.metrics;else{const Xn=Re[Ct.fontStack],ml=Xn&&Xn[nr];if(!ml)continue;on=ml.metrics}Ni=(Vi-Ct.scale)*Bi}ln?(ve.verticalizable=!0,dr.push({glyph:nr,imageName:pn,x:si,y:ci+Ni,vertical:ln,scale:Ct.scale,fontStack:Ct.fontStack,sectionIndex:pr,metrics:on,rect:dn}),si+=Wn*Ct.scale+Je):(dr.push({glyph:nr,imageName:pn,x:si,y:ci+Ni,vertical:ln,scale:Ct.scale,fontStack:Ct.fontStack,sectionIndex:pr,metrics:on,rect:dn}),si+=on.advance*Ct.scale+Je)}dr.length!==0&&(Fi=Math.max(si-Je,Fi),hm(dr,0,dr.length-1,br,zr)),si=0;const Dr=ke*Vi+zr;Sr.lineOffset=Math.max(zr,hr),ci+=Dr,Nr=Math.max(Dr,Nr),++Ei}var Ki;const rr=ci-cl,{horizontalAlign:wr,verticalAlign:Tr}=Pu(Oe);(function(Oi,Vi,hr,Sr,dr,zr,Dr,Ui,Ct){const pr=(Vi-hr)*dr;let nr=0;nr=zr!==Dr?-Ui*Sr-cl:(-Sr*Ct+.5)*Dr;for(const Ni of Oi)for(const on of Ni.positionedGlyphs)on.x+=pr,on.y+=nr})(ve.positionedLines,br,wr,Tr,Fi,Nr,ke,rr,ze.length),ve.top+=-Tr*rr,ve.bottom=ve.top+rr,ve.left+=-wr*Fi,ve.right=ve.left+Fi}(me,e,r,s,K,p,m,y,C,T,D,V),!function(ve){for(const Re of ve)if(Re.positionedGlyphs.length!==0)return!1;return!0}(se)&&me}const Ic={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},cm={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function rd(i,e,r,s,o,d){if(e.imageName){const p=s[e.imageName];return p?p.displaySize[0]*e.scale*Bi/d+o:0}{const p=r[e.fontStack],m=p&&p[i];return m?m.metrics.advance*e.scale+o:0}}function nd(i,e,r,s){const o=Math.pow(i-e,2);return s?i=0;let A=0;for(let D=0;Dp.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=du([]),this.placementViewportMatrix=du([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ld(this.zoom,r["text-size"]),this.iconSizeData=ld(this.zoom,r["icon-size"]);const s=this.layers[0].layout,o=s.get("symbol-sort-key"),d=s.get("symbol-z-order");this.canOverlap=zu(s,"text-overlap","text-allow-overlap")!=="never"||zu(s,"icon-overlap","icon-allow-overlap")!=="never"||s.get("text-ignore-placement")||s.get("icon-ignore-placement"),this.sortFeaturesByKey=d!=="viewport-y"&&!o.isConstant(),this.sortFeaturesByY=(d==="viewport-y"||d==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,s.get("symbol-placement")==="point"&&(this.writingModes=s.get("text-writing-mode").map(p=>S.ah[p])),this.stateDependentLayerIds=this.layers.filter(p=>p.isStateDependent()).map(p=>p.id),this.sourceID=e.sourceID}createArrays(){this.text=new Lu(new Zi(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Lu(new Zi(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new _,this.lineVertexArray=new x,this.symbolInstances=new h,this.textAnchorOffsets=new I}calculateGlyphDependencies(e,r,s,o,d){for(let p=0;p0)&&(p.value.kind!=="constant"||p.value.value.length>0),A=y.value.kind!=="constant"||!!y.value.value||Object.keys(y.parameters).length>0,C=d.get("symbol-sort-key");if(this.features=[],!T&&!A)return;const D=r.iconDependencies,R=r.glyphDependencies,F=r.availableImages,V=new ii(this.zoom);for(const{feature:Z,id:K,index:le,sourceLayerIndex:J}of e){const se=o._featureFilter.needGeometry,me=Gn(Z,se);if(!o._featureFilter.filter(V,me,s))continue;let ve,Re;if(se||(me.geometry=Zn(Z)),T){const Le=o.getValueAndResolveTokens("text-field",me,s,F),ze=kr.factory(Le);mm(ze)&&(this.hasRTLText=!0),(!this.hasRTLText||Un.getRTLTextPluginStatus()==="unavailable"||this.hasRTLText&&Un.isParsed())&&(ve=Jf(ze,o,me))}if(A){const Le=o.getValueAndResolveTokens("icon-image",me,s,F);Re=Le instanceof Or?Le:Or.fromString(Le)}if(!ve&&!Re)continue;const Ue=this.sortFeaturesByKey?C.evaluate(me,{},s):void 0;if(this.features.push({id:K,text:ve,icon:Re,index:le,sourceLayerIndex:J,geometry:me.geometry,properties:Z.properties,type:pm[Z.type],sortKey:Ue}),Re&&(D[Re.name]=!0),ve){const Le=p.evaluate(me,{},s).join(","),ze=d.get("text-rotation-alignment")!=="viewport"&&d.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(S.ah.vertical)>=0;for(const ke of ve.sections)if(ke.image)D[ke.image.name]=!0;else{const Oe=za(ve.toString()),Ee=ke.fontStack||Le,Se=R[Ee]=R[Ee]||{};this.calculateGlyphDependencies(ke.text,Se,ze,this.allowVerticalPlacement,Oe)}}}d.get("symbol-placement")==="line"&&(this.features=function(Z){const K={},le={},J=[];let se=0;function me(Le){J.push(Z[Le]),se++}function ve(Le,ze,ke){const Oe=le[Le];return delete le[Le],le[ze]=Oe,J[Oe].geometry[0].pop(),J[Oe].geometry[0]=J[Oe].geometry[0].concat(ke[0]),Oe}function Re(Le,ze,ke){const Oe=K[ze];return delete K[ze],K[Le]=Oe,J[Oe].geometry[0].shift(),J[Oe].geometry[0]=ke[0].concat(J[Oe].geometry[0]),Oe}function Ue(Le,ze,ke){const Oe=ke?ze[0][ze[0].length-1]:ze[0][0];return`${Le}:${Oe.x}:${Oe.y}`}for(let Le=0;LeLe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Z,K)=>Z.sortKey-K.sortKey)}update(e,r,s){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,s),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,s))}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.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){const s=this.lineVertexArray.length;if(e.segment!==void 0){let o=e.dist(r[e.segment+1]),d=e.dist(r[e.segment]);const p={};for(let m=e.segment+1;m=0;m--)p[m]={x:r[m].x,y:r[m].y,tileUnitDistanceFromAnchor:d},m>0&&(d+=r[m-1].dist(r[m]));for(let m=0;m0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,r){const s=e.placedSymbolArray.get(r),o=s.vertexStartIndex+4*s.numGlyphs;for(let d=s.vertexStartIndex;do[m]-o[y]||d[y]-d[m]),p}addToSortKeyRanges(e,r){const s=this.sortKeyRanges[this.sortKeyRanges.length-1];s&&s.sortKey===r?s.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,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 r of this.symbolInstanceIndexes){const s=this.symbolInstances.get(r);this.featureSortOrder.push(s.featureIndex),[s.rightJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.leftJustifiedTextSymbolIndex].forEach((o,d,p)=>{o>=0&&p.indexOf(o)===d&&this.addIndicesForPlacedSymbol(this.text,o)}),s.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,s.verticalPlacedTextSymbolIndex),s.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.placedIconSymbolIndex),s.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let cd,ud;Be("SymbolBucket",Ka,{omit:["layers","collisionBoxArray","features","compareText"]}),Ka.MAX_GLYPHS=65535,Ka.addDynamicAttributes=Du;var Bu={get paint(){return ud=ud||new lr({"icon-opacity":new tt(fe.paint_symbol["icon-opacity"]),"icon-color":new tt(fe.paint_symbol["icon-color"]),"icon-halo-color":new tt(fe.paint_symbol["icon-halo-color"]),"icon-halo-width":new tt(fe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new tt(fe.paint_symbol["icon-halo-blur"]),"icon-translate":new Ne(fe.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ne(fe.paint_symbol["icon-translate-anchor"]),"text-opacity":new tt(fe.paint_symbol["text-opacity"]),"text-color":new tt(fe.paint_symbol["text-color"],{runtimeType:Ai,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new tt(fe.paint_symbol["text-halo-color"]),"text-halo-width":new tt(fe.paint_symbol["text-halo-width"]),"text-halo-blur":new tt(fe.paint_symbol["text-halo-blur"]),"text-translate":new Ne(fe.paint_symbol["text-translate"]),"text-translate-anchor":new Ne(fe.paint_symbol["text-translate-anchor"])})},get layout(){return cd=cd||new lr({"symbol-placement":new Ne(fe.layout_symbol["symbol-placement"]),"symbol-spacing":new Ne(fe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ne(fe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new tt(fe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ne(fe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ne(fe.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ne(fe.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ne(fe.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ne(fe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ne(fe.layout_symbol["icon-rotation-alignment"]),"icon-size":new tt(fe.layout_symbol["icon-size"]),"icon-text-fit":new Ne(fe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ne(fe.layout_symbol["icon-text-fit-padding"]),"icon-image":new tt(fe.layout_symbol["icon-image"]),"icon-rotate":new tt(fe.layout_symbol["icon-rotate"]),"icon-padding":new tt(fe.layout_symbol["icon-padding"]),"icon-keep-upright":new Ne(fe.layout_symbol["icon-keep-upright"]),"icon-offset":new tt(fe.layout_symbol["icon-offset"]),"icon-anchor":new tt(fe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ne(fe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ne(fe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ne(fe.layout_symbol["text-rotation-alignment"]),"text-field":new tt(fe.layout_symbol["text-field"]),"text-font":new tt(fe.layout_symbol["text-font"]),"text-size":new tt(fe.layout_symbol["text-size"]),"text-max-width":new tt(fe.layout_symbol["text-max-width"]),"text-line-height":new Ne(fe.layout_symbol["text-line-height"]),"text-letter-spacing":new tt(fe.layout_symbol["text-letter-spacing"]),"text-justify":new tt(fe.layout_symbol["text-justify"]),"text-radial-offset":new tt(fe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ne(fe.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new tt(fe.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new tt(fe.layout_symbol["text-anchor"]),"text-max-angle":new Ne(fe.layout_symbol["text-max-angle"]),"text-writing-mode":new Ne(fe.layout_symbol["text-writing-mode"]),"text-rotate":new tt(fe.layout_symbol["text-rotate"]),"text-padding":new Ne(fe.layout_symbol["text-padding"]),"text-keep-upright":new Ne(fe.layout_symbol["text-keep-upright"]),"text-transform":new tt(fe.layout_symbol["text-transform"]),"text-offset":new tt(fe.layout_symbol["text-offset"]),"text-allow-overlap":new Ne(fe.layout_symbol["text-allow-overlap"]),"text-overlap":new Ne(fe.layout_symbol["text-overlap"]),"text-ignore-placement":new Ne(fe.layout_symbol["text-ignore-placement"]),"text-optional":new Ne(fe.layout_symbol["text-optional"])})}};class hd{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Qi,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.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}}Be("FormatSectionOverride",hd,{omit:["defaultValue"]});class Cc extends Zr{constructor(e){super(e,Bu)}recalculate(e,r){if(super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const s=this.layout.get("text-writing-mode");if(s){const o=[];for(const d of s)o.indexOf(d)<0&&o.push(d);this.layout._values["text-writing-mode"]=o}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,s,o){const d=this.layout.get(e).evaluate(r,{},s,o),p=this._unevaluatedLayout._values[e];return p.isDataDriven()||$t(p.value)||!d?d:function(m,y){return y.replace(/{([^{}]+)}/g,(T,A)=>m&&A in m?String(m[A]):"")}(r.properties,d)}createBucket(e){return new Ka(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of Bu.paint.overridableProperties){if(!Cc.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),s=new hd(r),o=new ti(s,r.property.specification);let d=null;d=r.value.kind==="constant"||r.value.kind==="source"?new ba("source",o):new Co("composite",o,r.value.zoomStops),this.paint._values[e]=new qr(r.property,d,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,s){return!(!this.layout||r.isDataDriven()||s.isDataDriven())&&Cc.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const s=e.get("text-field"),o=Bu.paint.properties[r];let d=!1;const p=m=>{for(const y of m)if(o.overrides&&o.overrides.hasOverride(y))return void(d=!0)};if(s.value.kind==="constant"&&s.value.value instanceof kr)p(s.value.value.sections);else if(s.value.kind==="source"){const m=T=>{d||(T instanceof vn&&ki(T.value)===Pi?p(T.value.sections):T instanceof xa?p(T.sections):T.eachChild(m))},y=s.value;y._styleExpression&&m(y._styleExpression.expression)}return d}}let dd;var gm={get paint(){return dd=dd||new lr({"background-color":new Ne(fe.paint_background["background-color"]),"background-pattern":new Oo(fe.paint_background["background-pattern"]),"background-opacity":new Ne(fe.paint_background["background-opacity"])})}};class _m extends Zr{constructor(e){super(e,gm)}}let pd;var ym={get paint(){return pd=pd||new lr({"raster-opacity":new Ne(fe.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ne(fe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ne(fe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ne(fe.paint_raster["raster-brightness-max"]),"raster-saturation":new Ne(fe.paint_raster["raster-saturation"]),"raster-contrast":new Ne(fe.paint_raster["raster-contrast"]),"raster-resampling":new Ne(fe.paint_raster["raster-resampling"]),"raster-fade-duration":new Ne(fe.paint_raster["raster-fade-duration"])})}};class xm extends Zr{constructor(e){super(e,ym)}}class vm extends Zr{constructor(e){super(e,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class bm{constructor(e){this._methodToThrottle=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const Fu=63710088e-1;class _s{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new _s(Bt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,s=this.lat*r,o=e.lat*r,d=Math.sin(s)*Math.sin(o)+Math.cos(s)*Math.cos(o)*Math.cos((e.lng-this.lng)*r);return Fu*Math.acos(Math.min(d,1))}static convert(e){if(e instanceof _s)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new _s(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new _s(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 [, ]")}}const fd=2*Math.PI*Fu;function md(i){return fd*Math.cos(i*Math.PI/180)}function gd(i){return(180+i)/360}function _d(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function yd(i,e){return i/md(e)}function Ou(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class kc{constructor(e,r,s=0){this.x=+e,this.y=+r,this.z=+s}static fromLngLat(e,r=0){const s=_s.convert(e);return new kc(gd(s.lng),_d(s.lat),yd(r,s.lat))}toLngLat(){return new _s(360*this.x-180,Ou(this.y))}toAltitude(){return this.z*md(Ou(this.y))}meterInMercatorCoordinateUnits(){return 1/fd*(e=Ou(this.y),1/Math.cos(e*Math.PI/180));var e}}function xd(i,e,r){var s=2*Math.PI*6378137/256/Math.pow(2,r);return[i*s-2*Math.PI*6378137/2,e*s-2*Math.PI*6378137/2]}class Vu{constructor(e,r,s){if(e<0||e>25||s<0||s>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, y=${s}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=r,this.y=s,this.key=dl(0,e,e,r,s)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,s){const o=(p=this.y,m=this.z,y=xd(256*(d=this.x),256*(p=Math.pow(2,m)-p-1),m),T=xd(256*(d+1),256*(p+1),m),y[0]+","+y[1]+","+T[0]+","+T[1]);var d,p,m,y,T;const A=function(C,D,R){let F,V="";for(let Z=C;Z>0;Z--)F=1<1?"@2x":"").replace(/{quadkey}/g,A).replace(/{bbox-epsg-3857}/g,o)}isChildOf(e){const r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){const r=Math.pow(2,this.z);return new X((e.x*r-this.x)*yi,(e.y*r-this.y)*yi)}toString(){return`${this.z}/${this.x}/${this.y}`}}class vd{constructor(e,r){this.wrap=e,this.canonical=r,this.key=dl(e,r.z,r.z,r.x,r.y)}}class Hr{constructor(e,r,s,o,d){if(e= z; overscaledZ = ${e}; z = ${s}`);this.overscaledZ=e,this.wrap=r,this.canonical=new Vu(s,+o,+d),this.key=dl(r,e,s,o,d)}clone(){return new Hr(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?new Hr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Hr(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const s=this.canonical.z-e;return e>this.canonical.z?dl(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):dl(this.wrap*+r,e,e,this.canonical.x>>s,this.canonical.y>>s)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new Hr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,s=2*this.canonical.x,o=2*this.canonical.y;return[new Hr(r,this.wrap,r,s,o),new Hr(r,this.wrap,r,s+1,o),new Hr(r,this.wrap,r,s,o+1),new Hr(r,this.wrap,r,s+1,o+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.ythis.max&&(this.max=C),C=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}unpack(e,r,s){return e*this.redFactor+r*this.greenFactor+s*this.blueFactor-this.baseShift}getPixels(){return new Gr({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,s){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let o=r*this.dim,d=r*this.dim+this.dim,p=s*this.dim,m=s*this.dim+this.dim;switch(r){case-1:o=d-1;break;case 1:d=o+1}switch(s){case-1:p=m-1;break;case 1:m=p+1}const y=-r*this.dim,T=-s*this.dim;for(let A=p;A=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class Td{constructor(e,r,s,o,d){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=s,e._y=o,this.properties=e.properties,this.id=d}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(e[r]=this[r]);return e}}class Sd{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Vn(yi,16,0),this.grid3D=new Vn(yi,16,0),this.featureIndexArray=new M,this.promoteId=r}insert(e,r,s,o,d,p){const m=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(s,o,d);const y=p?this.grid3D:this.grid;for(let T=0;T=0&&C[3]>=0&&y.insert(m,C[0],C[1],C[2],C[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new fs.VectorTile(new Cu(this.rawTileData)).layers,this.sourceLayerCoder=new wd(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,s,o){this.loadVTLayers();const d=e.params||{},p=yi/e.tileSize/e.scale,m=Ia(d.filter),y=e.queryGeometry,T=e.queryPadding*p,A=Ad(y),C=this.grid.query(A.minX-T,A.minY-T,A.maxX+T,A.maxY+T),D=Ad(e.cameraQueryGeometry),R=this.grid3D.query(D.minX-T,D.minY-T,D.maxX+T,D.maxY+T,(Z,K,le,J)=>function(se,me,ve,Re,Ue){for(const ze of se)if(me<=ze.x&&ve<=ze.y&&Re>=ze.x&&Ue>=ze.y)return!0;const Le=[new X(me,ve),new X(me,Ue),new X(Re,Ue),new X(Re,ve)];if(se.length>2){for(const ze of Le)if(ja(se,ze))return!0}for(let ze=0;ze(J||(J=Zn(se)),me.queryIntersectsFeature(y,se,ve,J,this.z,e.transform,p,e.pixelPosMatrix)))}return F}loadMatchingFeature(e,r,s,o,d,p,m,y,T,A,C){const D=this.bucketLayerIDs[r];if(p&&!function(Z,K){for(let le=0;le=0)return!0;return!1}(p,D))return;const R=this.sourceLayerCoder.decode(s),F=this.vtLayers[R].feature(o);if(d.needGeometry){const Z=Gn(F,!0);if(!d.filter(new ii(this.tileID.overscaledZ),Z,this.tileID.canonical))return}else if(!d.filter(new ii(this.tileID.overscaledZ),F))return;const V=this.getId(F,R);for(let Z=0;Z{const m=e instanceof Us?e.get(p):null;return m&&m.evaluate?m.evaluate(r,s,o):m})}function Ad(i){let e=1/0,r=1/0,s=-1/0,o=-1/0;for(const d of i)e=Math.min(e,d.x),r=Math.min(r,d.y),s=Math.max(s,d.x),o=Math.max(o,d.y);return{minX:e,minY:r,maxX:s,maxY:o}}function wm(i,e){return e-i}function Cd(i,e,r,s,o){const d=[];for(let p=0;p=s&&C.x>=s||(A.x>=s?A=new X(s,A.y+(s-A.x)/(C.x-A.x)*(C.y-A.y))._round():C.x>=s&&(C=new X(s,A.y+(s-A.x)/(C.x-A.x)*(C.y-A.y))._round()),A.y>=o&&C.y>=o||(A.y>=o?A=new X(A.x+(o-A.y)/(C.y-A.y)*(C.x-A.x),o)._round():C.y>=o&&(C=new X(A.x+(o-A.y)/(C.y-A.y)*(C.x-A.x),o)._round()),y&&A.equals(y[y.length-1])||(y=[A],d.push(y)),y.push(C)))))}}return d}Be("FeatureIndex",Sd,{omit:["rawTileData","sourceLayerCoder"]});class ys extends X{constructor(e,r,s,o){super(e,r),this.angle=s,o!==void 0&&(this.segment=o)}clone(){return new ys(this.x,this.y,this.angle,this.segment)}}function kd(i,e,r,s,o){if(e.segment===void 0||r===0)return!0;let d=e,p=e.segment+1,m=0;for(;m>-r/2;){if(p--,p<0)return!1;m-=i[p].dist(d),d=i[p]}m+=i[p].dist(i[p+1]),p++;const y=[];let T=0;for(;ms;)T-=y.shift().angleDelta;if(T>o)return!1;p++,m+=A.dist(C)}return!0}function Ed(i){let e=0;for(let r=0;rT){const F=(T-y)/R,V=ar.number(C.x,D.x,F),Z=ar.number(C.y,D.y,F),K=new ys(V,Z,D.angleTo(C),A);return K._round(),!p||kd(i,K,m,p,e)?K:void 0}y+=R}}function Sm(i,e,r,s,o,d,p,m,y){const T=Md(s,d,p),A=Pd(s,o),C=A*p,D=i[0].x===0||i[0].x===y||i[0].y===0||i[0].y===y;return e-C=0&&se=0&&me=0&&D+T<=A){const ve=new ys(se,me,le,F);ve._round(),s&&!kd(i,ve,d,s,o)||R.push(ve)}}C+=K}return m||R.length||p||(R=zd(i,C/2,r,s,o,d,p,!0,y)),R}Be("Anchor",ys);const Ja=Pr;function Dd(i,e,r,s){const o=[],d=i.image,p=d.pixelRatio,m=d.paddedRect.w-2*Ja,y=d.paddedRect.h-2*Ja,T=i.right-i.left,A=i.bottom-i.top,C=d.stretchX||[[0,m]],D=d.stretchY||[[0,y]],R=(ke,Oe)=>ke+Oe[1]-Oe[0],F=C.reduce(R,0),V=D.reduce(R,0),Z=m-F,K=y-V;let le=0,J=F,se=0,me=V,ve=0,Re=Z,Ue=0,Le=K;if(d.content&&s){const ke=d.content;le=Ec(C,0,ke[0]),se=Ec(D,0,ke[1]),J=Ec(C,ke[0],ke[2]),me=Ec(D,ke[1],ke[3]),ve=ke[0]-le,Ue=ke[1]-se,Re=ke[2]-ke[0]-J,Le=ke[3]-ke[1]-me}const ze=(ke,Oe,Ee,Se)=>{const Je=Mc(ke.stretch-le,J,T,i.left),je=Pc(ke.fixed-ve,Re,ke.stretch,F),vt=Mc(Oe.stretch-se,me,A,i.top),si=Pc(Oe.fixed-Ue,Le,Oe.stretch,V),ci=Mc(Ee.stretch-le,J,T,i.left),Fi=Pc(Ee.fixed-ve,Re,Ee.stretch,F),Nr=Mc(Se.stretch-se,me,A,i.top),br=Pc(Se.fixed-Ue,Le,Se.stretch,V),Ei=new X(Je,vt),Ki=new X(ci,vt),rr=new X(ci,Nr),wr=new X(Je,Nr),Tr=new X(je/p,si/p),Oi=new X(Fi/p,br/p),Vi=e*Math.PI/180;if(Vi){const dr=Math.sin(Vi),zr=Math.cos(Vi),Dr=[zr,-dr,dr,zr];Ei._matMult(Dr),Ki._matMult(Dr),wr._matMult(Dr),rr._matMult(Dr)}const hr=ke.stretch+ke.fixed,Sr=Oe.stretch+Oe.fixed;return{tl:Ei,tr:Ki,bl:wr,br:rr,tex:{x:d.paddedRect.x+Ja+hr,y:d.paddedRect.y+Ja+Sr,w:Ee.stretch+Ee.fixed-hr,h:Se.stretch+Se.fixed-Sr},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Tr,pixelOffsetBR:Oi,minFontScaleX:Re/p/T,minFontScaleY:Le/p/A,isSDF:r}};if(s&&(d.stretchX||d.stretchY)){const ke=Ld(C,Z,F),Oe=Ld(D,K,V);for(let Ee=0;Ee0&&(F=Math.max(10,F),this.circleDiameter=F)}else{let C=p.top*m-y[0],D=p.bottom*m+y[2],R=p.left*m-y[3],F=p.right*m+y[1];const V=p.collisionPadding;if(V&&(R-=V[0]*m,C-=V[1]*m,F+=V[2]*m,D+=V[3]*m),A){const Z=new X(R,C),K=new X(F,C),le=new X(R,D),J=new X(F,D),se=A*Math.PI/180;Z._rotate(se),K._rotate(se),le._rotate(se),J._rotate(se),R=Math.min(Z.x,K.x,le.x,J.x),F=Math.max(Z.x,K.x,le.x,J.x),C=Math.min(Z.y,K.y,le.y,J.y),D=Math.max(Z.y,K.y,le.y,J.y)}e.emplaceBack(r.x,r.y,R,C,F,D,s,o,d)}this.boxEndIndex=e.length}}class Im{constructor(e=[],r=Am){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let s=(this.length>>1)-1;s>=0;s--)this._down(s)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:s}=this,o=r[e];for(;e>0;){const d=e-1>>1,p=r[d];if(s(o,p)>=0)break;r[e]=p,e=d}r[e]=o}_down(e){const{data:r,compare:s}=this,o=this.length>>1,d=r[e];for(;e=0)break;r[e]=m,e=p}r[e]=d}}function Am(i,e){return ie?1:0}function Cm(i,e=1,r=!1){let s=1/0,o=1/0,d=-1/0,p=-1/0;const m=i[0];for(let R=0;Rd)&&(d=F.x),(!R||F.y>p)&&(p=F.y)}const y=Math.min(d-s,p-o);let T=y/2;const A=new Im([],km);if(y===0)return new X(s,o);for(let R=s;RC.d||!C.d)&&(C=R,r&&console.log("found best %d after %d probes",Math.round(1e4*R.d)/1e4,D)),R.max-C.d<=e||(T=R.h/2,A.push(new Ya(R.p.x-T,R.p.y-T,T,i)),A.push(new Ya(R.p.x+T,R.p.y-T,T,i)),A.push(new Ya(R.p.x-T,R.p.y+T,T,i)),A.push(new Ya(R.p.x+T,R.p.y+T,T,i)),D+=4)}return r&&(console.log(`num probes: ${D}`),console.log(`best distance: ${C.d}`)),C.p}function km(i,e){return e.max-i.max}function Ya(i,e,r,s){this.p=new X(i,e),this.h=r,this.d=function(o,d){let p=!1,m=1/0;for(let y=0;yo.y!=F.y>o.y&&o.x<(F.x-R.x)*(o.y-R.y)/(F.y-R.y)+R.x&&(p=!p),m=Math.min(m,_h(o,R,F))}}return(p?1:-1)*Math.sqrt(m)}(this.p,s),this.max=this.d+this.h*Math.SQRT2}var ir;S.ap=void 0,(ir=S.ap||(S.ap={}))[ir.center=1]="center",ir[ir.left=2]="left",ir[ir.right=3]="right",ir[ir.top=4]="top",ir[ir.bottom=5]="bottom",ir[ir["top-left"]=6]="top-left",ir[ir["top-right"]=7]="top-right",ir[ir["bottom-left"]=8]="bottom-left",ir[ir["bottom-right"]=9]="bottom-right";const xs=7,Uu=Number.POSITIVE_INFINITY;function Rd(i,e){return e[1]!==Uu?function(r,s,o){let d=0,p=0;switch(s=Math.abs(s),o=Math.abs(o),r){case"top-right":case"top-left":case"top":p=o-xs;break;case"bottom-right":case"bottom-left":case"bottom":p=-o+xs}switch(r){case"top-right":case"bottom-right":case"right":d=-s;break;case"top-left":case"bottom-left":case"left":d=s}return[d,p]}(i,e[0],e[1]):function(r,s){let o=0,d=0;s<0&&(s=0);const p=s/Math.SQRT2;switch(r){case"top-right":case"top-left":d=p-xs;break;case"bottom-right":case"bottom-left":d=-p+xs;break;case"bottom":d=-s+xs;break;case"top":d=s-xs}switch(r){case"top-right":case"bottom-right":o=-p;break;case"top-left":case"bottom-left":o=p;break;case"left":o=s;break;case"right":o=-s}return[o,d]}(i,e[0])}function Bd(i,e,r){var s;const o=i.layout,d=(s=o.get("text-variable-anchor-offset"))===null||s===void 0?void 0:s.evaluate(e,{},r);if(d){const m=d.values,y=[];for(let T=0;TD*Bi);A.startsWith("top")?C[1]-=xs:A.startsWith("bottom")&&(C[1]+=xs),y[T+1]=C}return new Fr(y)}const p=o.get("text-variable-anchor");if(p){let m;m=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[o.get("text-radial-offset").evaluate(e,{},r)*Bi,Uu]:o.get("text-offset").evaluate(e,{},r).map(T=>T*Bi);const y=[];for(const T of p)y.push(T,Rd(T,m));return new Fr(y)}return null}function Nu(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Em(i,e,r,s,o,d,p,m,y,T,A){let C=d.textMaxSize.evaluate(e,{});C===void 0&&(C=p);const D=i.layers[0].layout,R=D.get("icon-offset").evaluate(e,{},A),F=Od(r.horizontal),V=p/24,Z=i.tilePixelRatio*V,K=i.tilePixelRatio*C/24,le=i.tilePixelRatio*m,J=i.tilePixelRatio*D.get("symbol-spacing"),se=D.get("text-padding")*i.tilePixelRatio,me=function(Se,Je,je,vt=1){const si=Se.get("icon-padding").evaluate(Je,{},je),ci=si&&si.values;return[ci[0]*vt,ci[1]*vt,ci[2]*vt,ci[3]*vt]}(D,e,A,i.tilePixelRatio),ve=D.get("text-max-angle")/180*Math.PI,Re=D.get("text-rotation-alignment")!=="viewport"&&D.get("symbol-placement")!=="point",Ue=D.get("icon-rotation-alignment")==="map"&&D.get("symbol-placement")!=="point",Le=D.get("symbol-placement"),ze=J/2,ke=D.get("icon-text-fit");let Oe;s&&ke!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(Oe=od(s,r.vertical,ke,D.get("icon-text-fit-padding"),R,V)),F&&(s=od(s,F,ke,D.get("icon-text-fit-padding"),R,V)));const Ee=(Se,Je)=>{Je.x<0||Je.x>=yi||Je.y<0||Je.y>=yi||function(je,vt,si,ci,Fi,Nr,br,Ei,Ki,rr,wr,Tr,Oi,Vi,hr,Sr,dr,zr,Dr,Ui,Ct,pr,nr,Ni,on){const dn=je.addToLineVertexArray(vt,si);let pn,Wn,ln,Wr,Lr=0,Xn=0,ml=0,jd=0,Ku=-1,Ju=-1;const Kn={};let qd=Kt("");if(je.allowVerticalPlacement&&ci.vertical){const fr=Ei.layout.get("text-rotate").evaluate(Ct,{},Ni)+90;ln=new zc(Ki,vt,rr,wr,Tr,ci.vertical,Oi,Vi,hr,fr),br&&(Wr=new zc(Ki,vt,rr,wr,Tr,br,dr,zr,hr,fr))}if(Fi){const fr=Ei.layout.get("icon-rotate").evaluate(Ct,{}),Xr=Ei.layout.get("icon-text-fit")!=="none",Ws=Dd(Fi,fr,nr,Xr),mn=br?Dd(br,fr,nr,Xr):void 0;Wn=new zc(Ki,vt,rr,wr,Tr,Fi,dr,zr,!1,fr),Lr=4*Ws.length;const Xs=je.iconSizeData;let kn=null;Xs.kind==="source"?(kn=[Cn*Ei.layout.get("icon-size").evaluate(Ct,{})],kn[0]>gs&&nt(`${je.layerIds[0]}: Value for "icon-size" is >= ${hl}. Reduce your "icon-size".`)):Xs.kind==="composite"&&(kn=[Cn*pr.compositeIconSizes[0].evaluate(Ct,{},Ni),Cn*pr.compositeIconSizes[1].evaluate(Ct,{},Ni)],(kn[0]>gs||kn[1]>gs)&&nt(`${je.layerIds[0]}: Value for "icon-size" is >= ${hl}. Reduce your "icon-size".`)),je.addSymbols(je.icon,Ws,kn,Ui,Dr,Ct,S.ah.none,vt,dn.lineStartIndex,dn.lineLength,-1,Ni),Ku=je.icon.placedSymbolArray.length-1,mn&&(Xn=4*mn.length,je.addSymbols(je.icon,mn,kn,Ui,Dr,Ct,S.ah.vertical,vt,dn.lineStartIndex,dn.lineLength,-1,Ni),Ju=je.icon.placedSymbolArray.length-1)}const Zd=Object.keys(ci.horizontal);for(const fr of Zd){const Xr=ci.horizontal[fr];if(!pn){qd=Kt(Xr.text);const mn=Ei.layout.get("text-rotate").evaluate(Ct,{},Ni);pn=new zc(Ki,vt,rr,wr,Tr,Xr,Oi,Vi,hr,mn)}const Ws=Xr.positionedLines.length===1;if(ml+=Fd(je,vt,Xr,Nr,Ei,hr,Ct,Sr,dn,ci.vertical?S.ah.horizontal:S.ah.horizontalOnly,Ws?Zd:[fr],Kn,Ku,pr,Ni),Ws)break}ci.vertical&&(jd+=Fd(je,vt,ci.vertical,Nr,Ei,hr,Ct,Sr,dn,S.ah.vertical,["vertical"],Kn,Ju,pr,Ni));const zm=pn?pn.boxStartIndex:je.collisionBoxArray.length,Dm=pn?pn.boxEndIndex:je.collisionBoxArray.length,Lm=ln?ln.boxStartIndex:je.collisionBoxArray.length,Rm=ln?ln.boxEndIndex:je.collisionBoxArray.length,Bm=Wn?Wn.boxStartIndex:je.collisionBoxArray.length,Fm=Wn?Wn.boxEndIndex:je.collisionBoxArray.length,Om=Wr?Wr.boxStartIndex:je.collisionBoxArray.length,Vm=Wr?Wr.boxEndIndex:je.collisionBoxArray.length;let fn=-1;const Lc=(fr,Xr)=>fr&&fr.circleDiameter?Math.max(fr.circleDiameter,Xr):Xr;fn=Lc(pn,fn),fn=Lc(ln,fn),fn=Lc(Wn,fn),fn=Lc(Wr,fn);const Gd=fn>-1?1:0;Gd&&(fn*=on/Bi),je.glyphOffsetArray.length>=Ka.MAX_GLYPHS&&nt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ct.sortKey!==void 0&&je.addToSortKeyRanges(je.symbolInstances.length,Ct.sortKey);const Um=Bd(Ei,Ct,Ni),[Nm,jm]=function(fr,Xr){const Ws=fr.length,mn=Xr==null?void 0:Xr.values;if((mn==null?void 0:mn.length)>0)for(let Xs=0;Xs=0?Kn.right:-1,Kn.center>=0?Kn.center:-1,Kn.left>=0?Kn.left:-1,Kn.vertical||-1,Ku,Ju,qd,zm,Dm,Lm,Rm,Bm,Fm,Om,Vm,rr,ml,jd,Lr,Xn,Gd,0,Oi,fn,Nm,jm)}(i,Je,Se,r,s,o,Oe,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,Z,[se,se,se,se],Re,y,le,me,Ue,R,e,d,T,A,p)};if(Le==="line")for(const Se of Cd(e.geometry,0,0,yi,yi)){const Je=Sm(Se,J,ve,r.vertical||F,s,24,K,i.overscaling,yi);for(const je of Je)F&&Mm(i,F.text,ze,je)||Ee(Se,je)}else if(Le==="line-center"){for(const Se of e.geometry)if(Se.length>1){const Je=Tm(Se,ve,r.vertical||F,s,24,K);Je&&Ee(Se,Je)}}else if(e.type==="Polygon")for(const Se of xu(e.geometry,0)){const Je=Cm(Se,16);Ee(Se[0],new ys(Je.x,Je.y,0))}else if(e.type==="LineString")for(const Se of e.geometry)Ee(Se,new ys(Se[0].x,Se[0].y,0));else if(e.type==="Point")for(const Se of e.geometry)for(const Je of Se)Ee([Je],new ys(Je.x,Je.y,0))}function Fd(i,e,r,s,o,d,p,m,y,T,A,C,D,R,F){const V=function(le,J,se,me,ve,Re,Ue,Le){const ze=me.layout.get("text-rotate").evaluate(Re,{})*Math.PI/180,ke=[];for(const Oe of J.positionedLines)for(const Ee of Oe.positionedGlyphs){if(!Ee.rect)continue;const Se=Ee.rect||{};let Je=ed+1,je=!0,vt=1,si=0;const ci=(ve||Le)&&Ee.vertical,Fi=Ee.metrics.advance*Ee.scale/2;if(Le&&J.verticalizable&&(si=Oe.lineOffset/2-(Ee.imageName?-(Bi-Ee.metrics.width*Ee.scale)/2:(Ee.scale-1)*Bi)),Ee.imageName){const Ui=Ue[Ee.imageName];je=Ui.sdf,vt=Ui.pixelRatio,Je=Pr/vt}const Nr=ve?[Ee.x+Fi,Ee.y]:[0,0];let br=ve?[0,0]:[Ee.x+Fi+se[0],Ee.y+se[1]-si],Ei=[0,0];ci&&(Ei=br,br=[0,0]);const Ki=Ee.metrics.isDoubleResolution?2:1,rr=(Ee.metrics.left-Je)*Ee.scale-Fi+br[0],wr=(-Ee.metrics.top-Je)*Ee.scale+br[1],Tr=rr+Se.w/Ki*Ee.scale/vt,Oi=wr+Se.h/Ki*Ee.scale/vt,Vi=new X(rr,wr),hr=new X(Tr,wr),Sr=new X(rr,Oi),dr=new X(Tr,Oi);if(ci){const Ui=new X(-Fi,Fi-cl),Ct=-Math.PI/2,pr=Bi/2-Fi,nr=new X(5-cl-pr,-(Ee.imageName?pr:0)),Ni=new X(...Ei);Vi._rotateAround(Ct,Ui)._add(nr)._add(Ni),hr._rotateAround(Ct,Ui)._add(nr)._add(Ni),Sr._rotateAround(Ct,Ui)._add(nr)._add(Ni),dr._rotateAround(Ct,Ui)._add(nr)._add(Ni)}if(ze){const Ui=Math.sin(ze),Ct=Math.cos(ze),pr=[Ct,-Ui,Ui,Ct];Vi._matMult(pr),hr._matMult(pr),Sr._matMult(pr),dr._matMult(pr)}const zr=new X(0,0),Dr=new X(0,0);ke.push({tl:Vi,tr:hr,bl:Sr,br:dr,tex:Se,writingMode:J.writingMode,glyphOffset:Nr,sectionIndex:Ee.sectionIndex,isSDF:je,pixelOffsetTL:zr,pixelOffsetBR:Dr,minFontScaleX:0,minFontScaleY:0})}return ke}(0,r,m,o,d,p,s,i.allowVerticalPlacement),Z=i.textSizeData;let K=null;Z.kind==="source"?(K=[Cn*o.layout.get("text-size").evaluate(p,{})],K[0]>gs&&nt(`${i.layerIds[0]}: Value for "text-size" is >= ${hl}. Reduce your "text-size".`)):Z.kind==="composite"&&(K=[Cn*R.compositeTextSizes[0].evaluate(p,{},F),Cn*R.compositeTextSizes[1].evaluate(p,{},F)],(K[0]>gs||K[1]>gs)&&nt(`${i.layerIds[0]}: Value for "text-size" is >= ${hl}. Reduce your "text-size".`)),i.addSymbols(i.text,V,K,m,d,p,T,e,y.lineStartIndex,y.lineLength,D,F);for(const le of A)C[le]=i.text.placedSymbolArray.length-1;return 4*V.length}function Od(i){for(const e in i)return i[e];return null}function Mm(i,e,r,s){const o=i.compareText;if(e in o){const d=o[e];for(let p=d.length-1;p>=0;p--)if(s.dist(d[p])>4;if(o!==1)throw new Error(`Got v${o} data when expected v1.`);const d=Vd[15&s];if(!d)throw new Error("Unrecognized array type.");const[p]=new Uint16Array(e,2,1),[m]=new Uint32Array(e,4,1);return new ju(m,p,d,e)}constructor(e,r=64,s=Float64Array,o){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=s,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const d=Vd.indexOf(this.ArrayType),p=2*e*this.ArrayType.BYTES_PER_ELEMENT,m=e*this.IndexArrayType.BYTES_PER_ELEMENT,y=(8-m%8)%8;if(d<0)throw new Error(`Unexpected typed array class: ${s}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+m+y,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+p+m+y),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+m+y,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+d]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=e,this.coords[this._pos++]=r,s}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return qu(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,s,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:d,coords:p,nodeSize:m}=this,y=[0,d.length-1,0],T=[];for(;y.length;){const A=y.pop()||0,C=y.pop()||0,D=y.pop()||0;if(C-D<=m){for(let Z=D;Z<=C;Z++){const K=p[2*Z],le=p[2*Z+1];K>=e&&K<=s&&le>=r&&le<=o&&T.push(d[Z])}continue}const R=D+C>>1,F=p[2*R],V=p[2*R+1];F>=e&&F<=s&&V>=r&&V<=o&&T.push(d[R]),(A===0?e<=F:r<=V)&&(y.push(D),y.push(R-1),y.push(1-A)),(A===0?s>=F:o>=V)&&(y.push(R+1),y.push(C),y.push(1-A))}return T}within(e,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:d,nodeSize:p}=this,m=[0,o.length-1,0],y=[],T=s*s;for(;m.length;){const A=m.pop()||0,C=m.pop()||0,D=m.pop()||0;if(C-D<=p){for(let Z=D;Z<=C;Z++)Nd(d[2*Z],d[2*Z+1],e,r)<=T&&y.push(o[Z]);continue}const R=D+C>>1,F=d[2*R],V=d[2*R+1];Nd(F,V,e,r)<=T&&y.push(o[R]),(A===0?e-s<=F:r-s<=V)&&(m.push(D),m.push(R-1),m.push(1-A)),(A===0?e+s>=F:r+s>=V)&&(m.push(R+1),m.push(C),m.push(1-A))}return y}}function qu(i,e,r,s,o,d){if(o-s<=r)return;const p=s+o>>1;Ud(i,e,p,s,o,d),qu(i,e,r,s,p-1,1-d),qu(i,e,r,p+1,o,1-d)}function Ud(i,e,r,s,o,d){for(;o>s;){if(o-s>600){const T=o-s+1,A=r-s+1,C=Math.log(T),D=.5*Math.exp(2*C/3),R=.5*Math.sqrt(C*D*(T-D)/T)*(A-T/2<0?-1:1);Ud(i,e,r,Math.max(s,Math.floor(r-A*D/T+R)),Math.min(o,Math.floor(r+(T-A)*D/T+R)),d)}const p=e[2*r+d];let m=s,y=o;for(pl(i,e,s,r),e[2*o+d]>p&&pl(i,e,s,o);mp;)y--}e[2*s+d]===p?pl(i,e,s,y):(y++,pl(i,e,y,o)),y<=r&&(s=y+1),r<=y&&(o=y-1)}}function pl(i,e,r,s){Zu(i,r,s),Zu(e,2*r,2*s),Zu(e,2*r+1,2*s+1)}function Zu(i,e,r){const s=i[e];i[e]=i[r],i[r]=s}function Nd(i,e,r,s){const o=i-r,d=e-s;return o*o+d*d}var Gu;S.bc=void 0,(Gu=S.bc||(S.bc={})).create="create",Gu.load="load",Gu.fullLoad="fullLoad";let Dc=null,fl=[];const Hu=1e3/60,Wu="loadTime",Xu="fullLoadTime",Pm={mark(i){performance.mark(i)},frame(i){const e=i;Dc!=null&&fl.push(e-Dc),Dc=e},clearMetrics(){Dc=null,fl=[],performance.clearMeasures(Wu),performance.clearMeasures(Xu);for(const i in S.bc)performance.clearMarks(S.bc[i])},getPerformanceMetrics(){performance.measure(Wu,S.bc.create,S.bc.load),performance.measure(Xu,S.bc.create,S.bc.fullLoad);const i=performance.getEntriesByName(Wu)[0].duration,e=performance.getEntriesByName(Xu)[0].duration,r=fl.length,s=1/(fl.reduce((d,p)=>d+p,0)/r/1e3),o=fl.filter(d=>d>Hu).reduce((d,p)=>d+(p-Hu)/Hu,0);return{loadTime:i,fullLoadTime:e,fps:s,percentDroppedFrames:o/(r+o)*100,totalFrames:r}}};S.$=$e,S.A=qa,S.B=function(i){if(qt==null){const e=i.navigator?i.navigator.userAgent:null;qt=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return qt},S.C=class{constructor(i,e){this.target=i,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new bm(()=>this.process()),this.subscription=function(r,s,o,d){return r.addEventListener(s,o,!1),{unsubscribe:()=>{r.removeEventListener(s,o,!1)}}}(this.target,"message",r=>this.receive(r)),this.globalScope=st(self)?i:window}registerMessageHandler(i,e){this.messageHandlers[i]=e}sendAsync(i,e){return new Promise((r,s)=>{const o=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[o]={resolve:r,reject:s},e&&e.signal.addEventListener("abort",()=>{delete this.resolveRejects[o];const m={id:o,type:"",origin:location.origin,targetMapId:i.targetMapId,sourceMapId:this.mapId};this.target.postMessage(m)},{once:!0});const d=[],p=Object.assign(Object.assign({},i),{id:o,sourceMapId:this.mapId,origin:location.origin,data:cs(i.data,d)});this.target.postMessage(p,{transfer:d})})}receive(i){const e=i.data,r=e.id;if(!(e.origin!=="file://"&&location.origin!=="file://"&&e.origin!==location.origin||e.targetMapId&&this.mapId!==e.targetMapId)){if(e.type===""){delete this.tasks[r];const s=this.abortControllers[r];return delete this.abortControllers[r],void(s&&s.abort())}if(st(self)||e.mustQueue)return this.tasks[r]=e,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,e)}}process(){if(this.taskQueue.length===0)return;const i=this.taskQueue.shift(),e=this.tasks[i];delete this.tasks[i],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(i,e)}processTask(i,e){return c(this,void 0,void 0,function*(){if(e.type===""){const o=this.resolveRejects[i];return delete this.resolveRejects[i],o?void(e.error?o.reject(Os(e.error)):o.resolve(Os(e.data))):void 0}if(!this.messageHandlers[e.type])return void this.completeTask(i,new Error(`Could not find a registered handler for ${e.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const r=Os(e.data),s=new AbortController;this.abortControllers[i]=s;try{const o=yield this.messageHandlers[e.type](e.sourceMapId,r,s);this.completeTask(i,null,o)}catch(o){this.completeTask(i,o)}})}completeTask(i,e,r){const s=[];delete this.abortControllers[i];const o={id:i,type:"",sourceMapId:this.mapId,origin:location.origin,error:e?cs(e):null,data:cs(r,s)};this.target.postMessage(o,{transfer:s})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},S.D=Ne,S.E=Wi,S.F=function(){var i=new qa(16);return qa!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},S.G=Wt,S.H=function(i,e,r){var s,o,d,p,m,y,T,A,C,D,R,F,V=r[0],Z=r[1],K=r[2];return e===i?(i[12]=e[0]*V+e[4]*Z+e[8]*K+e[12],i[13]=e[1]*V+e[5]*Z+e[9]*K+e[13],i[14]=e[2]*V+e[6]*Z+e[10]*K+e[14],i[15]=e[3]*V+e[7]*Z+e[11]*K+e[15]):(o=e[1],d=e[2],p=e[3],m=e[4],y=e[5],T=e[6],A=e[7],C=e[8],D=e[9],R=e[10],F=e[11],i[0]=s=e[0],i[1]=o,i[2]=d,i[3]=p,i[4]=m,i[5]=y,i[6]=T,i[7]=A,i[8]=C,i[9]=D,i[10]=R,i[11]=F,i[12]=s*V+m*Z+C*K+e[12],i[13]=o*V+y*Z+D*K+e[13],i[14]=d*V+T*Z+R*K+e[14],i[15]=p*V+A*Z+F*K+e[15]),i},S.I=Eu,S.J=function(i,e,r){var s=r[0],o=r[1],d=r[2];return i[0]=e[0]*s,i[1]=e[1]*s,i[2]=e[2]*s,i[3]=e[3]*s,i[4]=e[4]*o,i[5]=e[5]*o,i[6]=e[6]*o,i[7]=e[7]*o,i[8]=e[8]*d,i[9]=e[9]*d,i[10]=e[10]*d,i[11]=e[11]*d,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},S.K=bh,S.L=function(i,e){const r={};for(let s=0;s{const e=window.document.createElement("video");return e.muted=!0,new Promise(r=>{e.onloadstart=()=>{r(e)};for(const s of i){const o=window.document.createElement("source");Mi(s)||(e.crossOrigin="Anonymous"),o.src=s,e.appendChild(o)}})},S.a3=function(){return Dt++},S.a4=t,S.a5=Ka,S.a6=Ia,S.a7=Gn,S.a8=ii,S.a9=Td,S.aA=_e,S.aB=function(i,e){if(!i)return[{command:"setStyle",args:[e]}];let r=[];try{if(!Mt(i.version,e.version))return[{command:"setStyle",args:[e]}];Mt(i.center,e.center)||r.push({command:"setCenter",args:[e.center]}),Mt(i.zoom,e.zoom)||r.push({command:"setZoom",args:[e.zoom]}),Mt(i.bearing,e.bearing)||r.push({command:"setBearing",args:[e.bearing]}),Mt(i.pitch,e.pitch)||r.push({command:"setPitch",args:[e.pitch]}),Mt(i.sprite,e.sprite)||r.push({command:"setSprite",args:[e.sprite]}),Mt(i.glyphs,e.glyphs)||r.push({command:"setGlyphs",args:[e.glyphs]}),Mt(i.transition,e.transition)||r.push({command:"setTransition",args:[e.transition]}),Mt(i.light,e.light)||r.push({command:"setLight",args:[e.light]}),Mt(i.terrain,e.terrain)||r.push({command:"setTerrain",args:[e.terrain]}),Mt(i.sky,e.sky)||r.push({command:"setSky",args:[e.sky]});const s={},o=[];(function(p,m,y,T){let A;for(A in m=m||{},p=p||{})Object.prototype.hasOwnProperty.call(p,A)&&(Object.prototype.hasOwnProperty.call(m,A)||Qn(A,y,T));for(A in m)Object.prototype.hasOwnProperty.call(m,A)&&(Object.prototype.hasOwnProperty.call(p,A)?Mt(p[A],m[A])||(p[A].type==="geojson"&&m[A].type==="geojson"&&es(p,m,A)?Xi(y,{command:"setGeoJSONSourceData",args:[A,m[A].data]}):$n(A,m,y,T)):en(A,m,y))})(i.sources,e.sources,o,s);const d=[];i.layers&&i.layers.forEach(p=>{"source"in p&&s[p.source]?r.push({command:"removeLayer",args:[p.id]}):d.push(p)}),r=r.concat(o),function(p,m,y){m=m||[];const T=(p=p||[]).map(ra),A=m.map(ra),C=p.reduce(Pn,{}),D=m.reduce(Pn,{}),R=T.slice(),F=Object.create(null);let V,Z,K,le,J;for(let se=0,me=0;se@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,s,o,d)=>{const p=o||d;return e[s]=!p||p.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},S.ab=function(i,e){const r=[];for(const s in i)s in e||r.push(s);return r},S.ac=ot,S.ad=function(i,e,r){var s=Math.sin(r),o=Math.cos(r),d=e[0],p=e[1],m=e[2],y=e[3],T=e[4],A=e[5],C=e[6],D=e[7];return e!==i&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=d*o+T*s,i[1]=p*o+A*s,i[2]=m*o+C*s,i[3]=y*o+D*s,i[4]=T*o-d*s,i[5]=A*o-p*s,i[6]=C*o-m*s,i[7]=D*o-y*s,i},S.ae=function(i){var e=new qa(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},S.af=_c,S.ag=function(i,e){let r=0,s=0;if(i.kind==="constant")s=i.layoutSize;else if(i.kind!=="source"){const{interpolationType:o,minZoom:d,maxZoom:p}=i,m=o?ot($i.interpolationFactor(o,e,d,p),0,1):0;i.kind==="camera"?s=ar.number(i.minSize,i.maxSize,m):r=m}return{uSizeT:r,uSize:s}},S.ai=function(i,{uSize:e,uSizeT:r},{lowerSize:s,upperSize:o}){return i.kind==="source"?s/Cn:i.kind==="composite"?ar.number(s/Cn,o/Cn,r):e},S.aj=Du,S.ak=function(i,e,r,s){const o=e.y-i.y,d=e.x-i.x,p=s.y-r.y,m=s.x-r.x,y=p*d-m*o;if(y===0)return null;const T=(m*(i.y-r.y)-p*(i.x-r.x))/y;return new X(i.x+T*d,i.y+T*o)},S.al=Cd,S.am=Qo,S.an=du,S.ao=Bi,S.aq=zu,S.ar=function(i,e){var r=e[0],s=e[1],o=e[2],d=e[3],p=e[4],m=e[5],y=e[6],T=e[7],A=e[8],C=e[9],D=e[10],R=e[11],F=e[12],V=e[13],Z=e[14],K=e[15],le=r*m-s*p,J=r*y-o*p,se=r*T-d*p,me=s*y-o*m,ve=s*T-d*m,Re=o*T-d*y,Ue=A*V-C*F,Le=A*Z-D*F,ze=A*K-R*F,ke=C*Z-D*V,Oe=C*K-R*V,Ee=D*K-R*Z,Se=le*Ee-J*Oe+se*ke+me*ze-ve*Le+Re*Ue;return Se?(i[0]=(m*Ee-y*Oe+T*ke)*(Se=1/Se),i[1]=(o*Oe-s*Ee-d*ke)*Se,i[2]=(V*Re-Z*ve+K*me)*Se,i[3]=(D*ve-C*Re-R*me)*Se,i[4]=(y*ze-p*Ee-T*Le)*Se,i[5]=(r*Ee-o*ze+d*Le)*Se,i[6]=(Z*se-F*Re-K*J)*Se,i[7]=(A*Re-D*se+R*J)*Se,i[8]=(p*Oe-m*ze+T*Ue)*Se,i[9]=(s*ze-r*Oe-d*Ue)*Se,i[10]=(F*ve-V*se+K*le)*Se,i[11]=(C*se-A*ve-R*le)*Se,i[12]=(m*Le-p*ke-y*Ue)*Se,i[13]=(r*ke-s*Le+o*Ue)*Se,i[14]=(V*J-F*me-Z*le)*Se,i[15]=(A*me-C*J+D*le)*Se,i):null},S.as=Nu,S.at=Pu,S.au=ju,S.av=function(){const i={},e=fe.$version;for(const r in fe.$root){const s=fe.$root[r];if(s.required){let o=null;o=r==="version"?e:s.type==="array"?[]:{},o!=null&&(i[r]=o)}}return i},S.aw=Pa,S.ax=it,S.ay=function(i){i=i.slice();const e=Object.create(null);for(let r=0;rSe*Bi)}let Le=p?"center":r.get("text-justify").evaluate(T,{},i.canonical);const ze=r.get("symbol-placement"),ke=ze==="point"?r.get("text-max-width").evaluate(T,{},i.canonical)*Bi:0,Oe=()=>{i.bucket.allowVerticalPlacement&&za(se)&&(F.vertical=Sc(V,i.glyphMap,i.glyphPositions,i.imagePositions,A,ke,d,Re,"left",ve,K,S.ah.vertical,!0,ze,D,C))};if(!p&&Ue){const Ee=new Set;if(Le==="auto")for(let Je=0;Jec(void 0,void 0,void 0,function*(){if(i.byteLength===0)return createImageBitmap(new ImageData(1,1));const e=new Blob([new Uint8Array(i)],{type:"image/png"});try{return createImageBitmap(e)}catch(r){throw new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),S.e=Ke,S.f=i=>new Promise((e,r)=>{const s=new Image;s.onload=()=>{e(s),URL.revokeObjectURL(s.src),s.onload=null,window.requestAnimationFrame(()=>{s.src=Hi})},s.onerror=()=>r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const o=new Blob([new Uint8Array(i)],{type:"image/png"});s.src=i.byteLength?URL.createObjectURL(o):Hi}),S.g=Ht,S.h=(i,e)=>Lt(Ke(i,{type:"json"}),e),S.i=st,S.j=jt,S.k=Ot,S.l=(i,e)=>Lt(Ke(i,{type:"arrayBuffer"}),e),S.m=Lt,S.n=function(i){return new Cu(i).readFields(am,[])},S.o=tl,S.p=td,S.q=lr,S.r=Lo,S.s=Mi,S.t=rc,S.u=De,S.v=fe,S.w=nt,S.x=Bs,S.y=function([i,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(e)*Math.sin(r),y:i*Math.sin(e)*Math.sin(r),z:i*Math.cos(r)}},S.z=ar}),k("worker",["./shared"],function(S){class c{constructor(z){this.keyCache={},z&&this.replace(z)}replace(z){this._layerConfigs={},this._layers={},this.update(z,[])}update(z,L){for(const N of z){this._layerConfigs[N.id]=N;const ee=this._layers[N.id]=S.az(N);ee._featureFilter=S.a6(ee.filter),this.keyCache[N.id]&&delete this.keyCache[N.id]}for(const N of L)delete this.keyCache[N],delete this._layerConfigs[N],delete this._layers[N];this.familiesBySource={};const O=S.bg(Object.values(this._layerConfigs),this.keyCache);for(const N of O){const ee=N.map(ge=>this._layers[ge.id]),te=ee[0];if(te.visibility==="none")continue;const oe=te.source||"";let Y=this.familiesBySource[oe];Y||(Y=this.familiesBySource[oe]={});const ce=te.sourceLayer||"_geojsonTileLayer";let be=Y[ce];be||(be=Y[ce]=[]),be.push(ee)}}}class ne{constructor(z){const L={},O=[];for(const oe in z){const Y=z[oe],ce=L[oe]={};for(const be in Y){const ge=Y[+be];if(!ge||ge.bitmap.width===0||ge.bitmap.height===0)continue;const ye={x:0,y:0,w:ge.bitmap.width+2,h:ge.bitmap.height+2};O.push(ye),ce[be]={rect:ye,metrics:ge.metrics}}}const{w:N,h:ee}=S.p(O),te=new S.o({width:N||1,height:ee||1});for(const oe in z){const Y=z[oe];for(const ce in Y){const be=Y[+ce];if(!be||be.bitmap.width===0||be.bitmap.height===0)continue;const ge=L[oe][ce].rect;S.o.copy(be.bitmap,te,{x:0,y:0},{x:ge.x+1,y:ge.y+1},be.bitmap)}}this.image=te,this.positions=L}}S.bh("GlyphAtlas",ne);class ie{constructor(z){this.tileID=new S.Q(z.tileID.overscaledZ,z.tileID.wrap,z.tileID.canonical.z,z.tileID.canonical.x,z.tileID.canonical.y),this.uid=z.uid,this.zoom=z.zoom,this.pixelRatio=z.pixelRatio,this.tileSize=z.tileSize,this.source=z.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=z.showCollisionBoxes,this.collectResourceTiming=!!z.collectResourceTiming,this.returnDependencies=!!z.returnDependencies,this.promoteId=z.promoteId,this.inFlightDependencies=[]}parse(z,L,O,N){return S._(this,void 0,void 0,function*(){this.status="parsing",this.data=z,this.collisionBoxArray=new S.a4;const ee=new S.bi(Object.keys(z.layers).sort()),te=new S.bj(this.tileID,this.promoteId);te.bucketLayerIDs=[];const oe={},Y={featureIndex:te,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:O},ce=L.familiesBySource[this.source];for(const mt in ce){const di=z.layers[mt];if(!di)continue;di.version===1&&S.w(`Vector tile source "${this.source}" layer "${mt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const zi=ee.encode(mt),sr=[];for(let gr=0;gr=ji.maxzoom||ji.visibility!=="none"&&(re(gr,this.zoom,O),(oe[ji.id]=ji.createBucket({index:te.bucketLayerIDs.length,layers:gr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:zi,sourceID:this.source})).populate(sr,Y,this.tileID.canonical),te.bucketLayerIDs.push(gr.map(nn=>nn.id)))}}const be=S.aE(Y.glyphDependencies,mt=>Object.keys(mt).map(Number));this.inFlightDependencies.forEach(mt=>mt==null?void 0:mt.abort()),this.inFlightDependencies=[];let ge=Promise.resolve({});if(Object.keys(be).length){const mt=new AbortController;this.inFlightDependencies.push(mt),ge=N.sendAsync({type:"getGlyphs",data:{stacks:be,source:this.source,tileID:this.tileID,type:"glyphs"}},mt)}const ye=Object.keys(Y.iconDependencies);let He=Promise.resolve({});if(ye.length){const mt=new AbortController;this.inFlightDependencies.push(mt),He=N.sendAsync({type:"getImages",data:{icons:ye,source:this.source,tileID:this.tileID,type:"icons"}},mt)}const Ye=Object.keys(Y.patternDependencies);let dt=Promise.resolve({});if(Ye.length){const mt=new AbortController;this.inFlightDependencies.push(mt),dt=N.sendAsync({type:"getImages",data:{icons:Ye,source:this.source,tileID:this.tileID,type:"patterns"}},mt)}const[lt,Pt,Xt]=yield Promise.all([ge,He,dt]),li=new ne(lt),Ci=new S.bk(Pt,Xt);for(const mt in oe){const di=oe[mt];di instanceof S.a5?(re(di.layers,this.zoom,O),S.bl({bucket:di,glyphMap:lt,glyphPositions:li.positions,imageMap:Pt,imagePositions:Ci.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):di.hasPattern&&(di instanceof S.bm||di instanceof S.bn||di instanceof S.bo)&&(re(di.layers,this.zoom,O),di.addFeatures(Y,this.tileID.canonical,Ci.patternPositions))}return this.status="done",{buckets:Object.values(oe).filter(mt=>!mt.isEmpty()),featureIndex:te,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:li.image,imageAtlas:Ci,glyphMap:this.returnDependencies?lt:null,iconMap:this.returnDependencies?Pt:null,glyphPositions:this.returnDependencies?li.positions:null}})}}function re(G,z,L){const O=new S.a8(z);for(const N of G)N.recalculate(O,L)}class X{constructor(z,L,O){this.actor=z,this.layerIndex=L,this.availableImages=O,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(z,L){return S._(this,void 0,void 0,function*(){const O=yield S.l(z.request,L);try{return{vectorTile:new S.bp.VectorTile(new S.bq(O.data)),rawData:O.data,cacheControl:O.cacheControl,expires:O.expires}}catch(N){const ee=new Uint8Array(O.data);let te=`Unable to parse the tile at ${z.request.url}, `;throw te+=ee[0]===31&&ee[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${N.messge}`,new Error(te)}})}loadTile(z){return S._(this,void 0,void 0,function*(){const L=z.uid,O=!!(z&&z.request&&z.request.collectResourceTiming)&&new S.br(z.request),N=new ie(z);this.loading[L]=N;const ee=new AbortController;N.abort=ee;try{const te=yield this.loadVectorTile(z,ee);if(delete this.loading[L],!te)return null;const oe=te.rawData,Y={};te.expires&&(Y.expires=te.expires),te.cacheControl&&(Y.cacheControl=te.cacheControl);const ce={};if(O){const ge=O.finish();ge&&(ce.resourceTiming=JSON.parse(JSON.stringify(ge)))}N.vectorTile=te.vectorTile;const be=N.parse(te.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[L]=N,this.fetching[L]={rawTileData:oe,cacheControl:Y,resourceTiming:ce};try{const ge=yield be;return S.e({rawTileData:oe.slice(0)},ge,Y,ce)}finally{delete this.fetching[L]}}catch(te){throw delete this.loading[L],N.status="done",this.loaded[L]=N,te}})}reloadTile(z){return S._(this,void 0,void 0,function*(){const L=z.uid;if(!this.loaded||!this.loaded[L])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const O=this.loaded[L];if(O.showCollisionBoxes=z.showCollisionBoxes,O.status==="parsing"){const N=yield O.parse(O.vectorTile,this.layerIndex,this.availableImages,this.actor);let ee;if(this.fetching[L]){const{rawTileData:te,cacheControl:oe,resourceTiming:Y}=this.fetching[L];delete this.fetching[L],ee=S.e({rawTileData:te.slice(0)},N,oe,Y)}else ee=N;return ee}if(O.status==="done"&&O.vectorTile)return O.parse(O.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(z){return S._(this,void 0,void 0,function*(){const L=this.loading,O=z.uid;L&&L[O]&&L[O].abort&&(L[O].abort.abort(),delete L[O])})}removeTile(z){return S._(this,void 0,void 0,function*(){this.loaded&&this.loaded[z.uid]&&delete this.loaded[z.uid]})}}class ${constructor(){this.loaded={}}loadTile(z){return S._(this,void 0,void 0,function*(){const{uid:L,encoding:O,rawImageData:N,redFactor:ee,greenFactor:te,blueFactor:oe,baseShift:Y}=z,ce=N.width+2,be=N.height+2,ge=S.b(N)?new S.R({width:ce,height:be},yield S.bs(N,-1,-1,ce,be)):N,ye=new S.bt(L,ge,O,ee,te,oe,Y);return this.loaded=this.loaded||{},this.loaded[L]=ye,ye})}removeTile(z){const L=this.loaded,O=z.uid;L&&L[O]&&delete L[O]}}function We(G,z){if(G.length!==0){qe(G[0],z);for(var L=1;L=Math.abs(oe)?L-Y+oe:oe-Y+L,L=Y}L+O>=0!=!!z&&G.reverse()}var ut=S.bu(function G(z,L){var O,N=z&&z.type;if(N==="FeatureCollection")for(O=0;O>31}function bt(G,z){for(var L=G.loadGeometry(),O=G.type,N=0,ee=0,te=L.length,oe=0;oeG},Hi=Math.fround||(Ii=new Float32Array(1),G=>(Ii[0]=+G,Ii[0]));var Ii;const Ft=3,At=5,ei=6;class Nt{constructor(z){this.options=Object.assign(Object.create(wt),z),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(z){const{log:L,minZoom:O,maxZoom:N}=this.options;L&&console.time("total time");const ee=`prepare ${z.length} points`;L&&console.time(ee),this.points=z;const te=[];for(let Y=0;Y=O;Y--){const ce=+Date.now();oe=this.trees[Y]=this._createTree(this._cluster(oe,Y)),L&&console.log("z%d: %d clusters in %dms",Y,oe.numItems,+Date.now()-ce)}return L&&console.timeEnd("total time"),this}getClusters(z,L){let O=((z[0]+180)%360+360)%360-180;const N=Math.max(-90,Math.min(90,z[1]));let ee=z[2]===180?180:((z[2]+180)%360+360)%360-180;const te=Math.max(-90,Math.min(90,z[3]));if(z[2]-z[0]>=360)O=-180,ee=180;else if(O>ee){const ge=this.getClusters([O,N,180,te],L),ye=this.getClusters([-180,N,ee,te],L);return ge.concat(ye)}const oe=this.trees[this._limitZoom(L)],Y=oe.range(Wt(O),Ae(te),Wt(ee),Ae(N)),ce=oe.data,be=[];for(const ge of Y){const ye=this.stride*ge;be.push(ce[ye+At]>1?hi(ce,ye,this.clusterProps):this.points[ce[ye+Ft]])}return be}getChildren(z){const L=this._getOriginId(z),O=this._getOriginZoom(z),N="No cluster with the specified id.",ee=this.trees[O];if(!ee)throw new Error(N);const te=ee.data;if(L*this.stride>=te.length)throw new Error(N);const oe=this.options.radius/(this.options.extent*Math.pow(2,O-1)),Y=ee.within(te[L*this.stride],te[L*this.stride+1],oe),ce=[];for(const be of Y){const ge=be*this.stride;te[ge+4]===z&&ce.push(te[ge+At]>1?hi(te,ge,this.clusterProps):this.points[te[ge+Ft]])}if(ce.length===0)throw new Error(N);return ce}getLeaves(z,L,O){const N=[];return this._appendLeaves(N,z,L=L||10,O=O||0,0),N}getTile(z,L,O){const N=this.trees[this._limitZoom(z)],ee=Math.pow(2,z),{extent:te,radius:oe}=this.options,Y=oe/te,ce=(O-Y)/ee,be=(O+1+Y)/ee,ge={features:[]};return this._addTileFeatures(N.range((L-Y)/ee,ce,(L+1+Y)/ee,be),N.data,L,O,ee,ge),L===0&&this._addTileFeatures(N.range(1-Y/ee,ce,1,be),N.data,ee,O,ee,ge),L===ee-1&&this._addTileFeatures(N.range(0,ce,Y/ee,be),N.data,-1,O,ee,ge),ge.features.length?ge:null}getClusterExpansionZoom(z){let L=this._getOriginZoom(z)-1;for(;L<=this.options.maxZoom;){const O=this.getChildren(z);if(L++,O.length!==1)break;z=O[0].properties.cluster_id}return L}_appendLeaves(z,L,O,N,ee){const te=this.getChildren(L);for(const oe of te){const Y=oe.properties;if(Y&&Y.cluster?ee+Y.point_count<=N?ee+=Y.point_count:ee=this._appendLeaves(z,Y.cluster_id,O,N,ee):ee1;let be,ge,ye;if(ce)be=Ht(L,Y,this.clusterProps),ge=L[Y],ye=L[Y+1];else{const dt=this.points[L[Y+Ft]];be=dt.properties;const[lt,Pt]=dt.geometry.coordinates;ge=Wt(lt),ye=Ae(Pt)}const He={type:1,geometry:[[Math.round(this.options.extent*(ge*ee-O)),Math.round(this.options.extent*(ye*ee-N))]],tags:be};let Ye;Ye=ce||this.options.generateId?L[Y+Ft]:this.points[L[Y+Ft]].id,Ye!==void 0&&(He.id=Ye),te.features.push(He)}}_limitZoom(z){return Math.max(this.options.minZoom,Math.min(Math.floor(+z),this.options.maxZoom+1))}_cluster(z,L){const{radius:O,extent:N,reduce:ee,minPoints:te}=this.options,oe=O/(N*Math.pow(2,L)),Y=z.data,ce=[],be=this.stride;for(let ge=0;geL&&(lt+=Y[Xt+At])}if(lt>dt&<>=te){let Pt,Xt=ye*dt,li=He*dt,Ci=-1;const mt=((ge/be|0)<<5)+(L+1)+this.points.length;for(const di of Ye){const zi=di*be;if(Y[zi+2]<=L)continue;Y[zi+2]=L;const sr=Y[zi+At];Xt+=Y[zi]*sr,li+=Y[zi+1]*sr,Y[zi+4]=mt,ee&&(Pt||(Pt=this._map(Y,ge,!0),Ci=this.clusterProps.length,this.clusterProps.push(Pt)),ee(Pt,this._map(Y,zi)))}Y[ge+4]=mt,ce.push(Xt/lt,li/lt,1/0,mt,-1,lt),ee&&ce.push(Ci)}else{for(let Pt=0;Pt1)for(const Pt of Ye){const Xt=Pt*be;if(!(Y[Xt+2]<=L)){Y[Xt+2]=L;for(let li=0;li>5}_getOriginZoom(z){return(z-this.points.length)%32}_map(z,L,O){if(z[L+At]>1){const te=this.clusterProps[z[L+ei]];return O?Object.assign({},te):te}const N=this.points[z[L+Ft]].properties,ee=this.options.map(N);return O&&ee===N?Object.assign({},ee):ee}}function hi(G,z,L){return{type:"Feature",id:G[z+Ft],properties:Ht(G,z,L),geometry:{type:"Point",coordinates:[(O=G[z],360*(O-.5)),it(G[z+1])]}};var O}function Ht(G,z,L){const O=G[z+At],N=O>=1e4?`${Math.round(O/1e3)}k`:O>=1e3?Math.round(O/100)/10+"k":O,ee=G[z+ei],te=ee===-1?{}:Object.assign({},L[ee]);return Object.assign(te,{cluster:!0,cluster_id:G[z+Ft],point_count:O,point_count_abbreviated:N})}function Wt(G){return G/360+.5}function Ae(G){const z=Math.sin(G*Math.PI/180),L=.5-.25*Math.log((1+z)/(1-z))/Math.PI;return L<0?0:L>1?1:L}function it(G){const z=(180-360*G)*Math.PI/180;return 360*Math.atan(Math.exp(z))/Math.PI-90}function Lt(G,z,L,O){for(var N,ee=O,te=L-z>>1,oe=L-z,Y=G[z],ce=G[z+1],be=G[L],ge=G[L+1],ye=z+3;yeee)N=ye,ee=He;else if(He===ee){var Ye=Math.abs(ye-te);YeO&&(N-z>3&&Lt(G,z,N,O),G[N+2]=ee,L-N>3&&Lt(G,N,L,O))}function Mi(G,z,L,O,N,ee){var te=N-L,oe=ee-O;if(te!==0||oe!==0){var Y=((G-L)*te+(z-O)*oe)/(te*te+oe*oe);Y>1?(L=N,O=ee):Y>0&&(L+=te*Y,O+=oe*Y)}return(te=G-L)*te+(oe=z-O)*oe}function Ji(G,z,L,O){var N={id:G===void 0?null:G,type:z,geometry:L,tags:O,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(ee){var te=ee.geometry,oe=ee.type;if(oe==="Point"||oe==="MultiPoint"||oe==="LineString")he(ee,te);else if(oe==="Polygon"||oe==="MultiLineString")for(var Y=0;Y0&&(te+=O?(N*ce-Y*ee)/2:Math.sqrt(Math.pow(Y-N,2)+Math.pow(ce-ee,2))),N=Y,ee=ce}var be=z.length-3;z[2]=1,Lt(z,0,be,L),z[be+2]=1,z.size=Math.abs(te),z.start=0,z.end=z.size}function fe(G,z,L,O){for(var N=0;N1?1:L}function Mt(G,z,L,O,N,ee,te,oe){if(O/=z,ee>=(L/=z)&&te=O)return null;for(var Y=[],ce=0;ce=L&&Ye=O)){var dt=[];if(ye==="Point"||ye==="MultiPoint")Xi(ge,dt,L,O,N);else if(ye==="LineString")en(ge,dt,L,O,N,!1,oe.lineMetrics);else if(ye==="MultiLineString")$n(ge,dt,L,O,N,!1);else if(ye==="Polygon")$n(ge,dt,L,O,N,!0);else if(ye==="MultiPolygon")for(var lt=0;lt=L&&te<=O&&(z.push(G[ee]),z.push(G[ee+1]),z.push(G[ee+2]))}}function en(G,z,L,O,N,ee,te){for(var oe,Y,ce=Qn(G),be=N===0?Mn:ra,ge=G.start,ye=0;yeL&&(Y=be(ce,He,Ye,lt,Pt,L),te&&(ce.start=ge+oe*Y)):Xt>O?li=L&&(Y=be(ce,He,Ye,lt,Pt,L),Ci=!0),li>O&&Xt<=O&&(Y=be(ce,He,Ye,lt,Pt,O),Ci=!0),!ee&&Ci&&(te&&(ce.end=ge+oe*Y),z.push(ce),ce=Qn(G)),te&&(ge+=oe)}var mt=G.length-3;He=G[mt],Ye=G[mt+1],dt=G[mt+2],(Xt=N===0?He:Ye)>=L&&Xt<=O&&es(ce,He,Ye,dt),mt=ce.length-3,ee&&mt>=3&&(ce[mt]!==ce[0]||ce[mt+1]!==ce[1])&&es(ce,ce[0],ce[1],ce[2]),ce.length&&z.push(ce)}function Qn(G){var z=[];return z.size=G.size,z.start=G.start,z.end=G.end,z}function $n(G,z,L,O,N,ee){for(var te=0;tete.maxX&&(te.maxX=be),ge>te.maxY&&(te.maxY=ge)}return te}function Qi(G,z,L,O){var N=z.geometry,ee=z.type,te=[];if(ee==="Point"||ee==="MultiPoint")for(var oe=0;oe0&&z.size<(N?te:O))L.numPoints+=z.length/3;else{for(var oe=[],Y=0;Yte)&&(L.numSimplified++,oe.push(z[Y]),oe.push(z[Y+1])),L.numPoints++;N&&function(ce,be){for(var ge=0,ye=0,He=ce.length,Ye=He-2;ye0===be)for(ye=0,He=ce.length;ye24)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.");var O=function(N,ee){var te=[];if(N.type==="FeatureCollection")for(var oe=0;oe1&&console.time("creation"),ye=this.tiles[ge]=ws(G,z,L,O,Y),this.tileCoords.push({z,x:L,y:O}),ce)){ce>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",z,L,O,ye.numFeatures,ye.numPoints,ye.numSimplified),console.timeEnd("creation"));var He="z"+z;this.stats[He]=(this.stats[He]||0)+1,this.total++}if(ye.source=G,N){if(z===Y.maxZoom||z===N)continue;var Ye=1<1&&console.time("clipping");var dt,lt,Pt,Xt,li,Ci,mt=.5*Y.buffer/Y.extent,di=.5-mt,zi=.5+mt,sr=1+mt;dt=lt=Pt=Xt=null,li=Mt(G,be,L-mt,L+zi,0,ye.minX,ye.maxX,Y),Ci=Mt(G,be,L+di,L+sr,0,ye.minX,ye.maxX,Y),G=null,li&&(dt=Mt(li,be,O-mt,O+zi,1,ye.minY,ye.maxY,Y),lt=Mt(li,be,O+di,O+sr,1,ye.minY,ye.maxY,Y),li=null),Ci&&(Pt=Mt(Ci,be,O-mt,O+zi,1,ye.minY,ye.maxY,Y),Xt=Mt(Ci,be,O+di,O+sr,1,ye.minY,ye.maxY,Y),Ci=null),ce>1&&console.timeEnd("clipping"),oe.push(dt||[],z+1,2*L,2*O),oe.push(lt||[],z+1,2*L,2*O+1),oe.push(Pt||[],z+1,2*L+1,2*O),oe.push(Xt||[],z+1,2*L+1,2*O+1)}}},xt.prototype.getTile=function(G,z,L){var O=this.options,N=O.extent,ee=O.debug;if(G<0||G>24)return null;var te=1<1&&console.log("drilling down to z%d-%d-%d",G,z,L);for(var Y,ce=G,be=z,ge=L;!Y&&ce>0;)ce--,be=Math.floor(be/2),ge=Math.floor(ge/2),Y=this.tiles[ft(ce,be,ge)];return Y&&Y.source?(ee>1&&console.log("found parent tile z%d-%d-%d",ce,be,ge),ee>1&&console.time("drilling down"),this.splitTile(Y.source,ce,be,ge,G,z,L),ee>1&&console.timeEnd("drilling down"),this.tiles[oe]?tn(this.tiles[oe],N):null):null};class zn extends X{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(z,L){return S._(this,void 0,void 0,function*(){const O=z.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const N=this._geoJSONIndex.getTile(O.z,O.x,O.y);if(!N)return null;const ee=new class{constructor(oe){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=S.W,this.length=oe.length,this._features=oe}feature(oe){return new class{constructor(Y){this._feature=Y,this.extent=S.W,this.type=Y.type,this.properties=Y.tags,"id"in Y&&!isNaN(Y.id)&&(this.id=parseInt(Y.id,10))}loadGeometry(){if(this._feature.type===1){const Y=[];for(const ce of this._feature.geometry)Y.push([new S.P(ce[0],ce[1])]);return Y}{const Y=[];for(const ce of this._feature.geometry){const be=[];for(const ge of ce)be.push(new S.P(ge[0],ge[1]));Y.push(be)}return Y}}toGeoJSON(Y,ce,be){return et.call(this,Y,ce,be)}}(this._features[oe])}}(N.features);let te=qt(ee);return te.byteOffset===0&&te.byteLength===te.buffer.byteLength||(te=new Uint8Array(te)),{vectorTile:ee,rawData:te.buffer}})}loadData(z){var L;return S._(this,void 0,void 0,function*(){(L=this._pendingRequest)===null||L===void 0||L.abort();const O=!!(z&&z.request&&z.request.collectResourceTiming)&&new S.br(z.request);this._pendingRequest=new AbortController;try{let N=yield this.loadGeoJSON(z,this._pendingRequest);if(delete this._pendingRequest,typeof N!="object")throw new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`);if(ut(N,!0),z.filter){const te=S.bx(z.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(te.result==="error")throw new Error(te.value.map(Y=>`${Y.key}: ${Y.message}`).join(", "));N={type:"FeatureCollection",features:N.features.filter(Y=>te.value.evaluate({zoom:0},Y))}}this._geoJSONIndex=z.cluster?new Nt(function({superclusterOptions:te,clusterProperties:oe}){if(!oe||!te)return te;const Y={},ce={},be={accumulated:null,zoom:0},ge={properties:null},ye=Object.keys(oe);for(const He of ye){const[Ye,dt]=oe[He],lt=S.bx(dt),Pt=S.bx(typeof Ye=="string"?[Ye,["accumulated"],["get",He]]:Ye);Y[He]=lt.value,ce[He]=Pt.value}return te.map=He=>{ge.properties=He;const Ye={};for(const dt of ye)Ye[dt]=Y[dt].evaluate(be,ge);return Ye},te.reduce=(He,Ye)=>{ge.properties=Ye;for(const dt of ye)be.accumulated=He[dt],He[dt]=ce[dt].evaluate(be,ge)},te}(z)).load(N.features):function(te,oe){return new xt(te,oe)}(N,z.geojsonVtOptions),this.loaded={};const ee={};if(O){const te=O.finish();te&&(ee.resourceTiming={},ee.resourceTiming[z.source]=JSON.parse(JSON.stringify(te)))}return ee}catch(N){if(delete this._pendingRequest,S.by(N))return{abandoned:!0};throw N}})}reloadTile(z){const L=this.loaded;return L&&L[z.uid]?super.reloadTile(z):this.loadTile(z)}loadGeoJSON(z,L){return S._(this,void 0,void 0,function*(){const{promoteId:O}=z;if(z.request){const N=yield S.h(z.request,L);return this._dataUpdateable=rn(N.data,O)?ht(N.data,O):void 0,N.data}if(typeof z.data=="string")try{const N=JSON.parse(z.data);return this._dataUpdateable=rn(N,O)?ht(N,O):void 0,N}catch{throw new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`)}if(!z.dataDiff)throw new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${z.source}`);return function(N,ee,te){var oe,Y,ce,be;if(ee.removeAll&&N.clear(),ee.remove)for(const ge of ee.remove)N.delete(ge);if(ee.add)for(const ge of ee.add){const ye=Ai(ge,te);ye!=null&&N.set(ye,ge)}if(ee.update)for(const ge of ee.update){let ye=N.get(ge.id);if(ye==null)continue;const He=!ge.removeAllProperties&&(((oe=ge.removeProperties)===null||oe===void 0?void 0:oe.length)>0||((Y=ge.addOrUpdateProperties)===null||Y===void 0?void 0:Y.length)>0);if((ge.newGeometry||ge.removeAllProperties||He)&&(ye=Object.assign({},ye),N.set(ge.id,ye),He&&(ye.properties=Object.assign({},ye.properties))),ge.newGeometry&&(ye.geometry=ge.newGeometry),ge.removeAllProperties)ye.properties={};else if(((ce=ge.removeProperties)===null||ce===void 0?void 0:ce.length)>0)for(const Ye of ge.removeProperties)Object.prototype.hasOwnProperty.call(ye.properties,Ye)&&delete ye.properties[Ye];if(((be=ge.addOrUpdateProperties)===null||be===void 0?void 0:be.length)>0)for(const{key:Ye,value:dt}of ge.addOrUpdateProperties)ye.properties[Ye]=dt}}(this._dataUpdateable,z.dataDiff,O),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(z){return S._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(z){return this._geoJSONIndex.getClusterExpansionZoom(z.clusterId)}getClusterChildren(z){return this._geoJSONIndex.getChildren(z.clusterId)}getClusterLeaves(z){return this._geoJSONIndex.getLeaves(z.clusterId,z.limit,z.offset)}}class Pi{constructor(z){this.self=z,this.actor=new S.C(z),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(L,O)=>{if(this.externalWorkerSourceTypes[L])throw new Error(`Worker source with name "${L}" already registered.`);this.externalWorkerSourceTypes[L]=O},this.self.addProtocol=S.be,this.self.removeProtocol=S.bf,this.self.registerRTLTextPlugin=L=>{if(S.bz.isParsed())throw new Error("RTL text plugin already registered.");S.bz.setMethods(L)},this.actor.registerMessageHandler("loadDEMTile",(L,O)=>this._getDEMWorkerSource(L,O.source).loadTile(O)),this.actor.registerMessageHandler("removeDEMTile",(L,O)=>S._(this,void 0,void 0,function*(){this._getDEMWorkerSource(L,O.source).removeTile(O)})),this.actor.registerMessageHandler("getClusterExpansionZoom",(L,O)=>S._(this,void 0,void 0,function*(){return this._getWorkerSource(L,O.type,O.source).getClusterExpansionZoom(O)})),this.actor.registerMessageHandler("getClusterChildren",(L,O)=>S._(this,void 0,void 0,function*(){return this._getWorkerSource(L,O.type,O.source).getClusterChildren(O)})),this.actor.registerMessageHandler("getClusterLeaves",(L,O)=>S._(this,void 0,void 0,function*(){return this._getWorkerSource(L,O.type,O.source).getClusterLeaves(O)})),this.actor.registerMessageHandler("loadData",(L,O)=>this._getWorkerSource(L,O.type,O.source).loadData(O)),this.actor.registerMessageHandler("loadTile",(L,O)=>this._getWorkerSource(L,O.type,O.source).loadTile(O)),this.actor.registerMessageHandler("reloadTile",(L,O)=>this._getWorkerSource(L,O.type,O.source).reloadTile(O)),this.actor.registerMessageHandler("abortTile",(L,O)=>this._getWorkerSource(L,O.type,O.source).abortTile(O)),this.actor.registerMessageHandler("removeTile",(L,O)=>this._getWorkerSource(L,O.type,O.source).removeTile(O)),this.actor.registerMessageHandler("removeSource",(L,O)=>S._(this,void 0,void 0,function*(){if(!this.workerSources[L]||!this.workerSources[L][O.type]||!this.workerSources[L][O.type][O.source])return;const N=this.workerSources[L][O.type][O.source];delete this.workerSources[L][O.type][O.source],N.removeSource!==void 0&&N.removeSource(O)})),this.actor.registerMessageHandler("setReferrer",(L,O)=>S._(this,void 0,void 0,function*(){this.referrer=O})),this.actor.registerMessageHandler("syncRTLPluginState",(L,O)=>this._syncRTLPluginState(L,O)),this.actor.registerMessageHandler("importScript",(L,O)=>S._(this,void 0,void 0,function*(){this.self.importScripts(O)})),this.actor.registerMessageHandler("setImages",(L,O)=>this._setImages(L,O)),this.actor.registerMessageHandler("updateLayers",(L,O)=>S._(this,void 0,void 0,function*(){this._getLayerIndex(L).update(O.layers,O.removedIds)})),this.actor.registerMessageHandler("setLayers",(L,O)=>S._(this,void 0,void 0,function*(){this._getLayerIndex(L).replace(O)}))}_setImages(z,L){return S._(this,void 0,void 0,function*(){this.availableImages[z]=L;for(const O in this.workerSources[z]){const N=this.workerSources[z][O];for(const ee in N)N[ee].availableImages=L}})}_syncRTLPluginState(z,L){return S._(this,void 0,void 0,function*(){S.bz.setState(L);const O=S.bz.getPluginURL();if(L.pluginStatus==="loaded"&&!S.bz.isParsed()&&O!=null){this.self.importScripts(O);const N=S.bz.isParsed();if(N)return N;throw new Error(`RTL Text Plugin failed to import scripts from ${O}`)}return!1})}_getAvailableImages(z){let L=this.availableImages[z];return L||(L=[]),L}_getLayerIndex(z){let L=this.layerIndexes[z];return L||(L=this.layerIndexes[z]=new c),L}_getWorkerSource(z,L,O){if(this.workerSources[z]||(this.workerSources[z]={}),this.workerSources[z][L]||(this.workerSources[z][L]={}),!this.workerSources[z][L][O]){const N={sendAsync:(ee,te)=>(ee.targetMapId=z,this.actor.sendAsync(ee,te))};switch(L){case"vector":this.workerSources[z][L][O]=new X(N,this._getLayerIndex(z),this._getAvailableImages(z));break;case"geojson":this.workerSources[z][L][O]=new zn(N,this._getLayerIndex(z),this._getAvailableImages(z));break;default:this.workerSources[z][L][O]=new this.externalWorkerSourceTypes[L](N,this._getLayerIndex(z),this._getAvailableImages(z))}}return this.workerSources[z][L][O]}_getDEMWorkerSource(z,L){return this.demWorkerSources[z]||(this.demWorkerSources[z]={}),this.demWorkerSources[z][L]||(this.demWorkerSources[z][L]=new $),this.demWorkerSources[z][L]}}return S.i(self)&&(self.worker=new Pi(self)),Pi}),k("index",["exports","./shared"],function(S,c){var ne="4.0.2";let ie,re;const X={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:u=>new Promise((t,n)=>{const a=requestAnimationFrame(t);u.signal.addEventListener("abort",()=>{cancelAnimationFrame(a),n(c.c())})}),getImageData(u,t=0){return this.getImageCanvasContext(u).getImageData(-t,-t,u.width+2*t,u.height+2*t)},getImageCanvasContext(u){const t=window.document.createElement("canvas"),n=t.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas 2d context");return t.width=u.width,t.height=u.height,n.drawImage(u,0,0,u.width,u.height),n},resolveURL:u=>(ie||(ie=document.createElement("a")),ie.href=u,ie.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(re==null&&(re=matchMedia("(prefers-reduced-motion: reduce)")),re.matches)}};class ${static testProp(t){if(!$.docStyle)return t[0];for(let n=0;n{window.removeEventListener("click",$.suppressClickInternal,!0)},0)}static getScale(t){const n=t.getBoundingClientRect();return{x:n.width/t.offsetWidth||1,y:n.height/t.offsetHeight||1,boundingClientRect:n}}static getPoint(t,n,a){const l=n.boundingClientRect;return new c.P((a.clientX-l.left)/n.x-t.clientLeft,(a.clientY-l.top)/n.y-t.clientTop)}static mousePos(t,n){const a=$.getScale(t);return $.getPoint(t,a,n)}static touchPos(t,n){const a=[],l=$.getScale(t);for(let h=0;h{t=[],n=0,a=0,l={}},u.addThrottleControl=b=>{const I=a++;return l[I]=b,I},u.removeThrottleControl=b=>{delete l[b],_()},u.getImage=(b,I,E=!0)=>new Promise((M,B)=>{We.supported&&(b.headers||(b.headers={}),b.headers.accept="image/webp,*/*"),c.e(b,{type:"image"}),t.push({abortController:I,requestParameters:b,supportImageRefresh:E,state:"queued",onError:j=>{B(j)},onSuccess:j=>{M(j)}}),_()});const h=b=>c._(this,void 0,void 0,function*(){b.state="running";const{requestParameters:I,supportImageRefresh:E,onError:M,onSuccess:B,abortController:j}=b,q=E===!1&&!c.i(self)&&!c.g(I.url)&&(!I.headers||Object.keys(I.headers).reduce((Q,ue)=>Q&&ue==="accept",!0));n++;const H=q?x(I,j):c.m(I,j);try{const Q=yield H;delete b.abortController,b.state="completed",Q.data instanceof HTMLImageElement||c.b(Q.data)?B(Q):Q.data&&B({data:yield(U=Q.data,typeof createImageBitmap=="function"?c.d(U):c.f(U)),cacheControl:Q.cacheControl,expires:Q.expires})}catch(Q){delete b.abortController,M(Q)}finally{n--,_()}var U}),_=()=>{const b=(()=>{for(const I of Object.keys(l))if(l[I]())return!0;return!1})()?c.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:c.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let I=n;I0;I++){const E=t.shift();E.abortController.signal.aborted?I--:h(E)}},x=(b,I)=>new Promise((E,M)=>{const B=new Image,j=b.url,q=b.credentials;q&&q==="include"?B.crossOrigin="use-credentials":(q&&q==="same-origin"||!c.s(j))&&(B.crossOrigin="anonymous"),I.signal.addEventListener("abort",()=>{B.src="",M(c.c())}),B.fetchPriority="high",B.onload=()=>{B.onerror=B.onload=null,E({data:B})},B.onerror=()=>{B.onerror=B.onload=null,I.signal.aborted||M(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."))},B.src=j})}(Ge||(Ge={})),Ge.resetRequestQueue(),function(u){u.Glyphs="Glyphs",u.Image="Image",u.Source="Source",u.SpriteImage="SpriteImage",u.SpriteJSON="SpriteJSON",u.Style="Style",u.Tile="Tile",u.Unknown="Unknown"}(rt||(rt={}));class ot{constructor(t){this._transformRequestFn=t}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}normalizeSpriteURL(t,n,a){const l=function(h){const _=h.match(Bt);if(!_)throw new Error(`Unable to parse URL "${h}"`);return{protocol:_[1],authority:_[2],path:_[3]||"/",params:_[4]?_[4].split("&"):[]}}(t);return l.path+=`${n}${a}`,function(h){const _=h.params.length?`?${h.params.join("&")}`:"";return`${h.protocol}://${h.authority}${h.path}${_}`}(l)}setTransformRequest(t){this._transformRequestFn=t}}const Bt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Ke(u){var t=new c.A(3);return t[0]=u[0],t[1]=u[1],t[2]=u[2],t}var Dt,ct=function(u,t,n){return u[0]=t[0]-n[0],u[1]=t[1]-n[1],u[2]=t[2]-n[2],u};Dt=new c.A(3),c.A!=Float32Array&&(Dt[0]=0,Dt[1]=0,Dt[2]=0);var _t=function(u){var t=u[0],n=u[1];return t*t+n*n};function _e(u){const t=[];if(typeof u=="string")t.push({id:"default",url:u});else if(u&&u.length>0){const n=[];for(const{id:a,url:l}of u){const h=`${a}${l}`;n.indexOf(h)===-1&&(n.push(h),t.push({id:a,url:l}))}}return t}(function(){var u=new c.A(2);c.A!=Float32Array&&(u[0]=0,u[1]=0)})();class Ze{constructor(t,n,a,l){this.context=t,this.format=a,this.texture=t.gl.createTexture(),this.update(n,l)}update(t,n,a){const{width:l,height:h}=t,_=!(this.size&&this.size[0]===l&&this.size[1]===h||a),{context:x}=this,{gl:b}=x;if(this.useMipmap=!!(n&&n.useMipmap),b.bindTexture(b.TEXTURE_2D,this.texture),x.pixelStoreUnpackFlipY.set(!1),x.pixelStoreUnpack.set(1),x.pixelStoreUnpackPremultiplyAlpha.set(this.format===b.RGBA&&(!n||n.premultiply!==!1)),_)this.size=[l,h],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||c.b(t)?b.texImage2D(b.TEXTURE_2D,0,this.format,this.format,b.UNSIGNED_BYTE,t):b.texImage2D(b.TEXTURE_2D,0,this.format,l,h,0,this.format,b.UNSIGNED_BYTE,t.data);else{const{x:I,y:E}=a||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||c.b(t)?b.texSubImage2D(b.TEXTURE_2D,0,I,E,b.RGBA,b.UNSIGNED_BYTE,t):b.texSubImage2D(b.TEXTURE_2D,0,I,E,l,h,b.RGBA,b.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&b.generateMipmap(b.TEXTURE_2D)}bind(t,n,a){const{context:l}=this,{gl:h}=l;h.bindTexture(h.TEXTURE_2D,this.texture),a!==h.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(a=h.LINEAR),t!==this.filter&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,t),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,a||t),this.filter=t),n!==this.wrap&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,n),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function nt(u){const{userImage:t}=u;return!!(t&&t.render&&t.render())&&(u.data.replace(new Uint8Array(t.data.buffer)),!0)}class yt extends c.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new c.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:n,promiseResolve:a}of this.requestors)a(this._getImagesForIds(n));this.requestors=[]}}getImage(t){const n=this.images[t];if(n&&!n.data&&n.spriteData){const a=n.spriteData;n.data=new c.R({width:a.width,height:a.height},a.context.getImageData(a.x,a.y,a.width,a.height).data),n.spriteData=null}return n}addImage(t,n){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,n)&&(this.images[t]=n)}_validate(t,n){let a=!0;const l=n.data||n.spriteData;return this._validateStretch(n.stretchX,l&&l.width)||(this.fire(new c.j(new Error(`Image "${t}" has invalid "stretchX" value`))),a=!1),this._validateStretch(n.stretchY,l&&l.height)||(this.fire(new c.j(new Error(`Image "${t}" has invalid "stretchY" value`))),a=!1),this._validateContent(n.content,n)||(this.fire(new c.j(new Error(`Image "${t}" has invalid "content" value`))),a=!1),a}_validateStretch(t,n){if(!t)return!0;let a=0;for(const l of t){if(l[0]{let l=!0;if(!this.isLoaded())for(const h of t)this.images[h]||(l=!1);this.isLoaded()||l?n(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:n})})}_getImagesForIds(t){const n={};for(const a of t){let l=this.getImage(a);l||(this.fire(new c.k("styleimagemissing",{id:a})),l=this.getImage(a)),l?n[a]={data:l.data.clone(),pixelRatio:l.pixelRatio,sdf:l.sdf,version:l.version,stretchX:l.stretchX,stretchY:l.stretchY,content:l.content,hasRenderCallback:!!(l.userImage&&l.userImage.render)}:c.w(`Image "${a}" 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.`)}return n}getPixelSize(){const{width:t,height:n}=this.atlasImage;return{width:t,height:n}}getPattern(t){const n=this.patterns[t],a=this.getImage(t);if(!a)return null;if(n&&n.position.version===a.version)return n.position;if(n)n.position.version=a.version;else{const l={w:a.data.width+2,h:a.data.height+2,x:0,y:0},h=new c.I(l,a);this.patterns[t]={bin:l,position:h}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const n=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new Ze(t,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const h in this.patterns)t.push(this.patterns[h].bin);const{w:n,h:a}=c.p(t),l=this.atlasImage;l.resize({width:n||1,height:a||1});for(const h in this.patterns){const{bin:_}=this.patterns[h],x=_.x+1,b=_.y+1,I=this.getImage(h).data,E=I.width,M=I.height;c.R.copy(I,l,{x:0,y:0},{x,y:b},{width:E,height:M}),c.R.copy(I,l,{x:0,y:M-1},{x,y:b-1},{width:E,height:1}),c.R.copy(I,l,{x:0,y:0},{x,y:b+M},{width:E,height:1}),c.R.copy(I,l,{x:E-1,y:0},{x:x-1,y:b},{width:1,height:M}),c.R.copy(I,l,{x:0,y:0},{x:x+E,y:b},{width:1,height:M})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const n of t){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;const a=this.getImage(n);a||c.w(`Image with ID: "${n}" was not found`),nt(a)&&this.updateImage(n,a)}}}const bt=1e20;function st(u,t,n,a,l,h,_,x,b){for(let I=t;I-1);b++,h[b]=x,_[b]=I,_[b+1]=bt}for(let x=0,b=0;x65535)throw new Error("glyphs > 65535 not supported");if(a.ranges[h])return{stack:t,id:n,glyph:l};if(!this.url)throw new Error("glyphsUrl is not set");if(!a.requests[h]){const x=wt.loadGlyphRange(t,h,this.url,this.requestManager);a.requests[h]=x}const _=yield a.requests[h];for(const x in _)this._doesCharSupportLocalGlyph(+x)||(a.glyphs[+x]=_[+x]);return a.ranges[h]=!0,{stack:t,id:n,glyph:_[n]||null}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(c.u["CJK Unified Ideographs"](t)||c.u["Hangul Syllables"](t)||c.u.Hiragana(t)||c.u.Katakana(t))}_tinySDF(t,n,a){const l=this.localIdeographFontFamily;if(!l||!this._doesCharSupportLocalGlyph(a))return;let h=t.tinySDF;if(!h){let x="400";/bold/i.test(n)?x="900":/medium/i.test(n)?x="500":/light/i.test(n)&&(x="200"),h=t.tinySDF=new wt.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:l,fontWeight:x})}const _=h.draw(String.fromCharCode(a));return{id:a,bitmap:new c.o({width:_.width||60,height:_.height||60},_.data),metrics:{width:_.glyphWidth/2||24,height:_.glyphHeight/2||24,left:_.glyphLeft/2+.5||0,top:_.glyphTop/2-27.5||-8,advance:_.glyphAdvance/2||24,isDoubleResolution:!0}}}}wt.loadGlyphRange=function(u,t,n,a){return c._(this,void 0,void 0,function*(){const l=256*t,h=l+255,_=a.transformRequest(n.replace("{fontstack}",u).replace("{range}",`${l}-${h}`),rt.Glyphs),x=yield c.l(_,new AbortController);if(!x||!x.data)throw new Error(`Could not load glyph range. range: ${t}, ${l}-${h}`);const b={};for(const I of c.n(x.data))b[I.id]=I;return b})},wt.TinySDF=class{constructor({fontSize:u=24,buffer:t=3,radius:n=8,cutoff:a=.25,fontFamily:l="sans-serif",fontWeight:h="normal",fontStyle:_="normal"}={}){this.buffer=t,this.cutoff=a,this.radius=n;const x=this.size=u+4*t,b=this._createCanvas(x),I=this.ctx=b.getContext("2d",{willReadFrequently:!0});I.font=`${_} ${h} ${u}px ${l}`,I.textBaseline="alphabetic",I.textAlign="left",I.fillStyle="black",this.gridOuter=new Float64Array(x*x),this.gridInner=new Float64Array(x*x),this.f=new Float64Array(x),this.z=new Float64Array(x+1),this.v=new Uint16Array(x)}_createCanvas(u){const t=document.createElement("canvas");return t.width=t.height=u,t}draw(u){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:a,actualBoundingBoxLeft:l,actualBoundingBoxRight:h}=this.ctx.measureText(u),_=Math.ceil(n),x=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(h-l))),b=Math.min(this.size-this.buffer,_+Math.ceil(a)),I=x+2*this.buffer,E=b+2*this.buffer,M=Math.max(I*E,0),B=new Uint8ClampedArray(M),j={data:B,width:I,height:E,glyphWidth:x,glyphHeight:b,glyphTop:_,glyphLeft:0,glyphAdvance:t};if(x===0||b===0)return j;const{ctx:q,buffer:H,gridInner:U,gridOuter:Q}=this;q.clearRect(H,H,x,b),q.fillText(u,H,H+_);const ue=q.getImageData(H,H,x,b);Q.fill(bt,0,M),U.fill(0,0,M);for(let W=0;W0?xe*xe:0,U[de]=xe<0?xe*xe:0}}st(Q,0,0,I,E,I,this.f,this.v,this.z),st(U,H,H,x,b,I,this.f,this.v,this.z);for(let W=0;W1&&(b=t[++x]);const E=Math.abs(I-b.left),M=Math.abs(I-b.right),B=Math.min(E,M);let j;const q=h/a*(l+1);if(b.isDash){const H=l-Math.abs(q);j=Math.sqrt(B*B+H*H)}else j=l-Math.sqrt(B*B+q*q);this.data[_+I]=Math.max(0,Math.min(255,j+128))}}}addRegularDash(t){for(let x=t.length-1;x>=0;--x){const b=t[x],I=t[x+1];b.zeroLength?t.splice(x,1):I&&I.isDash===b.isDash&&(I.left=b.left,t.splice(x,1))}const n=t[0],a=t[t.length-1];n.isDash===a.isDash&&(n.left=a.left-this.width,a.right=n.right+this.width);const l=this.width*this.nextRow;let h=0,_=t[h];for(let x=0;x1&&(_=t[++h]);const b=Math.abs(x-_.left),I=Math.abs(x-_.right),E=Math.min(b,I);this.data[l+x]=Math.max(0,Math.min(255,(_.isDash?E:-E)+128))}}addDash(t,n){const a=n?7:0,l=2*a+1;if(this.nextRow+l>this.height)return c.w("LineAtlas out of space"),null;let h=0;for(let x=0;x{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[ei]}numActive(){return Object.keys(this.active).length}}const hi=Math.floor(X.hardwareConcurrency/2);let Ht,Wt;function Ae(){return Ht||(Ht=new Nt),Ht}Nt.workerCount=c.B(globalThis)?Math.max(Math.min(hi,3),1):1;class it{constructor(t,n){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=n;const a=this.workerPool.acquire(n);for(let l=0;l{n.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,n){for(const a of this.actors)a.registerMessageHandler(t,n)}}function Lt(){return Wt||(Wt=new it(Ae(),c.G),Wt.registerMessageHandler("getResource",(u,t,n)=>c.m(t,n))),Wt}function Mi(u,t){const n=c.F();return c.H(n,n,[1,1,0]),c.J(n,n,[.5*u.width,.5*u.height,1]),c.K(n,n,u.calculatePosMatrix(t.toUnwrapped()))}function Ji(u,t,n,a,l,h){const _=function(M,B,j){if(M)for(const q of M){const H=B[q];if(H&&H.source===j&&H.type==="fill-extrusion")return!0}else for(const q in B){const H=B[q];if(H.source===j&&H.type==="fill-extrusion")return!0}return!1}(l&&l.layers,t,u.id),x=h.maxPitchScaleFactor(),b=u.tilesIn(a,x,_);b.sort(he);const I=[];for(const M of b)I.push({wrappedTileID:M.tileID.wrapped().key,queryResults:M.tile.queryRenderedFeatures(t,n,u._state,M.queryGeometry,M.cameraQueryGeometry,M.scale,l,h,x,Mi(u.transform,M.tileID))});const E=function(M){const B={},j={};for(const q of M){const H=q.queryResults,U=q.wrappedTileID,Q=j[U]=j[U]||{};for(const ue in H){const W=H[ue],ae=Q[ue]=Q[ue]||{},pe=B[ue]=B[ue]||[];for(const de of W)ae[de.featureIndex]||(ae[de.featureIndex]=!0,pe.push(de))}}return B}(I);for(const M in E)E[M].forEach(B=>{const j=B.feature,q=u.getFeatureState(j.layer["source-layer"],j.id);j.source=j.layer.source,j.layer["source-layer"]&&(j.sourceLayer=j.layer["source-layer"]),j.state=q});return E}function he(u,t){const n=u.tileID,a=t.tileID;return n.overscaledZ-a.overscaledZ||n.canonical.y-a.canonical.y||n.wrap-a.wrap||n.canonical.x-a.canonical.x}function Ot(u,t,n){return c._(this,void 0,void 0,function*(){let a=u;if(u.url?a=(yield c.h(t.transformRequest(u.url,rt.Source),n)).data:yield X.frameAsync(n),!a)return null;const l=c.L(c.e(a,u),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in a&&a.vector_layers&&(l.vectorLayerIds=a.vector_layers.map(h=>h.id)),l})}class jt{constructor(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof c.M?new c.M(t.lng,t.lat):c.M.convert(t),this}setSouthWest(t){return this._sw=t instanceof c.M?new c.M(t.lng,t.lat):c.M.convert(t),this}extend(t){const n=this._sw,a=this._ne;let l,h;if(t instanceof c.M)l=t,h=t;else{if(!(t instanceof jt))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(jt.convert(t)):this.extend(c.M.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(c.M.convert(t)):this;if(l=t._sw,h=t._ne,!l||!h)return this}return n||a?(n.lng=Math.min(l.lng,n.lng),n.lat=Math.min(l.lat,n.lat),a.lng=Math.max(h.lng,a.lng),a.lat=Math.max(h.lat,a.lat)):(this._sw=new c.M(l.lng,l.lat),this._ne=new c.M(h.lng,h.lat)),this}getCenter(){return new c.M((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 c.M(this.getWest(),this.getNorth())}getSouthEast(){return new c.M(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(t){const{lng:n,lat:a}=c.M.convert(t);let l=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&l}static convert(t){return t instanceof jt?t:t&&new jt(t)}static fromLngLat(t,n=0){const a=360*n/40075017,l=a/Math.cos(Math.PI/180*t.lat);return new jt(new c.M(t.lng-l,t.lat-a),new c.M(t.lng+l,t.lat+a))}}class Wi{constructor(t,n,a){this.bounds=jt.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=a||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 n=Math.pow(2,t.z),a=Math.floor(c.N(this.bounds.getWest())*n),l=Math.floor(c.O(this.bounds.getNorth())*n),h=Math.ceil(c.N(this.bounds.getEast())*n),_=Math.ceil(c.O(this.bounds.getSouth())*n);return t.x>=a&&t.x=l&&t.y<_}}class fe extends c.E{constructor(t,n,a,l){if(super(),this.id=t,this.dispatcher=a,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,c.e(this,c.L(n,["url","scheme","tileSize","promoteId"])),this._options=c.e({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(l)}load(){return c._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield Ot(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t&&(c.e(this,t),t.bounds&&(this.tileBounds=new Wi(t.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new c.j(t))}})}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.abort(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return c.e({},this._options)}loadTile(t){return c._(this,void 0,void 0,function*(){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),a={request:this.map._requestManager.transformRequest(n,rt.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};a.request.collectResourceTiming=this._collectResourceTiming;let l="reloadTile";if(t.actor&&t.state!=="expired"){if(t.state==="loading")return new Promise((h,_)=>{t.reloadPromise={resolve:h,reject:_}})}else t.actor=this.dispatcher.getActor(),l="loadTile";t.abortController=new AbortController;try{const h=yield t.actor.sendAsync({type:l,data:a},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,h)}catch(h){if(delete t.abortController,t.aborted)return;if(h&&h.status!==404)throw h;this._afterTileLoadWorkerResponse(t,null)}})}_afterTileLoadWorkerResponse(t,n){if(n&&n.resourceTiming&&(t.resourceTiming=n.resourceTiming),n&&this.map._refreshExpiredTiles&&t.setExpiryData(n),t.loadVectorData(n,this.map.painter),t.reloadPromise){const a=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(a.resolve).catch(a.reject)}}abortTile(t){return c._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"abortTile",data:{uid:t.uid,type:this.type,source:this.id}}))})}unloadTile(t){return c._(this,void 0,void 0,function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"removeTile",data:{uid:t.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Yi extends c.E{constructor(t,n,a,l){super(),this.id=t,this.dispatcher=a,this.setEventedParent(l),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=c.e({type:"raster"},n),c.e(this,c.L(n,["url","scheme","tileSize"]))}load(){return c._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield Ot(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,t&&(c.e(this,t),t.bounds&&(this.tileBounds=new Wi(t.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new c.j(t))}})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}serialize(){return c.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return c._(this,void 0,void 0,function*(){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{const a=yield Ge.getImage(this.map._requestManager.transformRequest(n,rt.Tile),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(a&&a.data){this.map._refreshExpiredTiles&&a.cacheControl&&a.expires&&t.setExpiryData({cacheControl:a.cacheControl,expires:a.expires});const l=this.map.painter.context,h=l.gl,_=a.data;t.texture=this.map.painter.getTileTexture(_.width),t.texture?t.texture.update(_,{useMipmap:!0}):(t.texture=new Ze(l,_,h.RGBA,{useMipmap:!0}),t.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE,h.LINEAR_MIPMAP_NEAREST),l.extTextureFilterAnisotropic&&h.texParameterf(h.TEXTURE_2D,l.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,l.extTextureFilterAnisotropicMax)),t.state="loaded"}}catch(a){if(delete t.abortController,t.aborted)t.state="unloaded";else if(a)throw t.state="errored",a}})}abortTile(t){return c._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)})}unloadTile(t){return c._(this,void 0,void 0,function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)})}hasTransition(){return!1}}class xn extends Yi{constructor(t,n,a,l){super(t,n,a,l),this.type="raster-dem",this.maxzoom=22,this._options=c.e({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(t){return c._(this,void 0,void 0,function*(){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),a=this.map._requestManager.transformRequest(n,rt.Tile);t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{const l=yield Ge.getImage(a,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(l&&l.data){const h=l.data;this.map._refreshExpiredTiles&&l.cacheControl&&l.expires&&t.setExpiryData({cacheControl:l.cacheControl,expires:l.expires});const _=c.b(h)&&c.S()?h:yield this.readImageNow(h),x={type:this.type,uid:t.uid,source:this.id,rawImageData:_,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||t.state==="expired"){t.actor=this.dispatcher.getActor();const b=yield t.actor.sendAsync({type:"loadDEMTile",data:x});t.dem=b,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}catch(l){if(delete t.abortController,t.aborted)t.state="unloaded";else if(l)throw t.state="errored",l}})}readImageNow(t){return c._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&c.U()){const n=t.width+2,a=t.height+2;try{return new c.R({width:n,height:a},yield c.V(t,-1,-1,n,a))}catch{}}return X.getImageData(t,1)})}_getNeighboringTiles(t){const n=t.canonical,a=Math.pow(2,n.z),l=(n.x-1+a)%a,h=n.x===0?t.wrap-1:t.wrap,_=(n.x+1+a)%a,x=n.x+1===a?t.wrap+1:t.wrap,b={};return b[new c.Q(t.overscaledZ,h,n.z,l,n.y).key]={backfilled:!1},b[new c.Q(t.overscaledZ,x,n.z,_,n.y).key]={backfilled:!1},n.y>0&&(b[new c.Q(t.overscaledZ,h,n.z,l,n.y-1).key]={backfilled:!1},b[new c.Q(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},b[new c.Q(t.overscaledZ,x,n.z,_,n.y-1).key]={backfilled:!1}),n.y+10&&c.e(h,{resourceTiming:l}),this.fire(new c.k("data",Object.assign(Object.assign({},h),{sourceDataType:"metadata"}))),this.fire(new c.k("data",Object.assign(Object.assign({},h),{sourceDataType:"content"})))}catch(a){if(this._pendingLoads--,this._removed)return void this.fire(new c.k("dataabort",{dataType:"source"}));this.fire(new c.j(a))}})}loaded(){return this._pendingLoads===0}loadTile(t){return c._(this,void 0,void 0,function*(){const n=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const a={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.abortController=new AbortController;const l=yield this.actor.sendAsync({type:n,data:a},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(l,this.map.painter,n==="reloadTile")})}abortTile(t){return c._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0})}unloadTile(t){return c._(this,void 0,void 0,function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"removeTile",data:{uid:t.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"removeSource",data:{type:this.type,source:this.id}})}serialize(){return c.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Xi=c.X([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class en extends c.E{constructor(t,n,a,l){super(),this.id=t,this.dispatcher=a,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(l),this.options=n}load(t){return c._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const n=yield Ge.getImage(this.map._requestManager.transformRequest(this.url,rt.Image),this._request);this._request=null,this._loaded=!0,n&&n.data&&(this.image=n.data,t&&(this.coordinates=t),this._finishLoading())}catch(n){this._request=null,this.fire(new c.j(n))}})}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;const n=t.map(c.Y.fromLngLat);this.tileID=function(l){let h=1/0,_=1/0,x=-1/0,b=-1/0;for(const B of l)h=Math.min(h,B.x),_=Math.min(_,B.y),x=Math.max(x,B.x),b=Math.max(b,B.y);const I=Math.max(x-h,b-_),E=Math.max(0,Math.floor(-Math.log(I)/Math.LN2)),M=Math.pow(2,E);return new c.a0(E,Math.floor((h+x)/2*M),Math.floor((_+b)/2*M))}(n),this.minzoom=this.maxzoom=this.tileID.z;const a=n.map(l=>this.tileID.getTilePoint(l)._round());return this._boundsArray=new c.Z,this._boundsArray.emplaceBack(a[0].x,a[0].y,0,0),this._boundsArray.emplaceBack(a[1].x,a[1].y,c.W,0),this._boundsArray.emplaceBack(a[3].x,a[3].y,0,c.W),this._boundsArray.emplaceBack(a[2].x,a[2].y,c.W,c.W),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Xi.members)),this.boundsSegments||(this.boundsSegments=c.$.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Ze(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let a=!1;for(const l in this.tiles){const h=this.tiles[l];h.state!=="loaded"&&(h.state="loaded",h.texture=this.texture,a=!0)}a&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return c._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Qn extends en{constructor(t,n,a,l){super(t,n,a,l),this.roundZoom=!0,this.type="video",this.options=n}load(){return c._(this,void 0,void 0,function*(){this._loaded=!1;const t=this.options;this.urls=[];for(const n of t.urls)this.urls.push(this.map._requestManager.transformRequest(n,rt.Source).url);try{const n=yield c.a2(this.urls);if(this._loaded=!0,!n)return;this.video=n,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(n){this.fire(new c.j(n))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const n=this.video.seekable;tn.end(0)?this.fire(new c.j(new c.a1(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,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 t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Xi.members)),this.boundsSegments||(this.boundsSegments=c.$.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new Ze(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let a=!1;for(const l in this.tiles){const h=this.tiles[l];h.state!=="loaded"&&(h.state="loaded",h.texture=this.texture,a=!0)}a&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class $n extends en{constructor(t,n,a,l){super(t,n,a,l),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(h=>!Array.isArray(h)||h.length!==2||h.some(_=>typeof _!="number"))||this.fire(new c.j(new c.a1(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new c.j(new c.a1(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new c.j(new c.a1(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new c.j(new c.a1(`sources.${t}`,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 c.j(new c.a1(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){return c._(this,void 0,void 0,function*(){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 c.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const n=this.map.painter.context,a=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Xi.members)),this.boundsSegments||(this.boundsSegments=c.$.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Ze(n,this.canvas,a.RGBA,{premultiply:!0});let l=!1;for(const h in this.tiles){const _=this.tiles[h];_.state!=="loaded"&&(_.state="loaded",_.texture=this.texture,l=!0)}l&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const es={},Mn=u=>{switch(u){case"geojson":return Mt;case"image":return en;case"raster":return Yi;case"raster-dem":return xn;case"vector":return fe;case"video":return Qn;case"canvas":return $n}return es[u]};class ra extends c.E{constructor(){super(...arguments),this.pluginStatus="unavailable",this.pluginURL=null,this.dispatcher=Lt(),this.queue=[]}_sendPluginStateToWorker(){return c._(this,void 0,void 0,function*(){yield this.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}),this.fire(new c.k("pluginStateChange",{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}))})}getRTLTextPluginStatus(){return this.pluginStatus}clearRTLTextPlugin(){this.pluginStatus="unavailable",this.pluginURL=null}setRTLTextPlugin(t,n=!1){return c._(this,void 0,void 0,function*(){if(this.pluginStatus==="deferred"||this.pluginStatus==="loading"||this.pluginStatus==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");this.pluginURL=X.resolveURL(t),this.pluginStatus="deferred",yield this._sendPluginStateToWorker(),n||(yield this._downloadRTLTextPlugin())})}_downloadRTLTextPlugin(){return c._(this,void 0,void 0,function*(){if(this.pluginStatus!=="deferred"||!this.pluginURL)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");try{this.pluginStatus="loading",yield this._sendPluginStateToWorker(),yield c.l({url:this.pluginURL},new AbortController),this.pluginStatus="loaded"}catch{this.pluginStatus="error"}yield this._sendPluginStateToWorker()})}lazyLoadRTLTextPlugin(){return c._(this,void 0,void 0,function*(){this.pluginStatus==="deferred"&&(yield this._downloadRTLTextPlugin())})}}let Pn=null;function Ce(){return Pn||(Pn=new ra),Pn}class tn{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=c.a3(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const n=t+this.timeAdded;nh.getLayer(I)).filter(Boolean);if(b.length!==0){x.layers=b,x.stateDependentLayerIds&&(x.stateDependentLayers=x.stateDependentLayerIds.map(I=>b.filter(E=>E.id===I)[0]));for(const I of b)_[I.id]=x}}return _}(t.buckets,n.style),this.hasSymbolBuckets=!1;for(const l in this.buckets){const h=this.buckets[l];if(h instanceof c.a5){if(this.hasSymbolBuckets=!0,!a)break;h.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const l in this.buckets){const h=this.buckets[l];if(h instanceof c.a5&&h.hasRTLText){this.hasRTLText=!0,Ce().lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const l in this.buckets){const h=this.buckets[l];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(l).queryRadius(h))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new c.a4}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const a in this.buckets){const l=this.buckets[a];l.uploadPending()&&l.upload(t)}const n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Ze(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Ze(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,a,l,h,_,x,b,I,E){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:l,cameraQueryGeometry:h,scale:_,tileSize:this.tileSize,pixelPosMatrix:E,transform:b,params:x,queryPadding:this.queryPadding*I},t,n,a):{}}querySourceFeatures(t,n){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const l=a.loadVTLayers(),h=n&&n.sourceLayer?n.sourceLayer:"",_=l._geojsonTileLayer||l[h];if(!_)return;const x=c.a6(n&&n.filter),{z:b,x:I,y:E}=this.tileID.canonical,M={z:b,x:I,y:E};for(let B=0;B<_.length;B++){const j=_.feature(B);if(x.needGeometry){const U=c.a7(j,!0);if(!x.filter(new c.a8(this.tileID.overscaledZ),U,this.tileID.canonical))continue}else if(!x.filter(new c.a8(this.tileID.overscaledZ),j))continue;const q=a.getId(j,h),H=new c.a9(j,b,I,E,q);H.tile=M,t.push(H)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const n=this.expirationTime;if(t.cacheControl){const a=c.aa(t.cacheControl);a["max-age"]&&(this.expirationTime=Date.now()+1e3*a["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const a=Date.now();let l=!1;if(this.expirationTime>a)l=!1;else if(n)if(this.expirationTime{this.remove(t,h)},a)),this.data[l].push(h),this.order.push(l),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 n=this.data[t].shift();return n.timeout&&clearTimeout(n.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),n.value}getByKey(t){const n=this.data[t];return n?n[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,n){if(!this.has(t))return this;const a=t.wrapped().key,l=n===void 0?0:this.data[a].indexOf(n),h=this.data[a][l];return this.data[a].splice(l,1),h.timeout&&clearTimeout(h.timeout),this.data[a].length===0&&delete this.data[a],this.onRemove(h.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(t){const n=[];for(const a in this.data)for(const l of this.data[a])t(l.value)||n.push(l);for(const a of n)this.remove(a.value.tileID,a)}}class ws{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,a){const l=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][l]=this.stateChanges[t][l]||{},c.e(this.stateChanges[t][l],a),this.deletedStates[t]===null){this.deletedStates[t]={};for(const h in this.state[t])h!==l&&(this.deletedStates[t][h]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][l]===null){this.deletedStates[t][l]={};for(const h in this.state[t][l])a[h]||(this.deletedStates[t][l][h]=null)}else for(const h in a)this.deletedStates[t]&&this.deletedStates[t][l]&&this.deletedStates[t][l][h]===null&&delete this.deletedStates[t][l][h]}removeFeatureState(t,n,a){if(this.deletedStates[t]===null)return;const l=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},a&&n!==void 0)this.deletedStates[t][l]!==null&&(this.deletedStates[t][l]=this.deletedStates[t][l]||{},this.deletedStates[t][l][a]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][l])for(a in this.deletedStates[t][l]={},this.stateChanges[t][l])this.deletedStates[t][l][a]=null;else this.deletedStates[t][l]=null;else this.deletedStates[t]=null}getState(t,n){const a=String(n),l=c.e({},(this.state[t]||{})[a],(this.stateChanges[t]||{})[a]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const h=this.deletedStates[t][n];if(h===null)return{};for(const _ in h)delete l[_]}return l}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){const a={};for(const l in this.stateChanges){this.state[l]=this.state[l]||{};const h={};for(const _ in this.stateChanges[l])this.state[l][_]||(this.state[l][_]={}),c.e(this.state[l][_],this.stateChanges[l][_]),h[_]=this.state[l][_];a[l]=h}for(const l in this.deletedStates){this.state[l]=this.state[l]||{};const h={};if(this.deletedStates[l]===null)for(const _ in this.state[l])h[_]={},this.state[l][_]={};else for(const _ in this.deletedStates[l]){if(this.deletedStates[l][_]===null)this.state[l][_]={};else for(const x of Object.keys(this.deletedStates[l][_]))delete this.state[l][_][x];h[_]=this.state[l][_]}a[l]=a[l]||{},c.e(a[l],h)}if(this.stateChanges={},this.deletedStates={},Object.keys(a).length!==0)for(const l in t)t[l].setFeatureState(a,n)}}class Qi extends c.E{constructor(t,n,a){super(),this.id=t,this.dispatcher=a,this.on("data",l=>{l.dataType==="source"&&l.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&l.dataType==="source"&&l.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((l,h,_,x)=>{const b=new(Mn(h.type))(l,h,_,x);if(b.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${b.id}`);return b})(t,n,a,this),this._tiles={},this._cache=new Cr(0,l=>this._unloadTile(l)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ws,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const n=this._tiles[t];if(n.state!=="loaded"&&n.state!=="errored")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,this.terrain)}_loadTile(t,n,a){return c._(this,void 0,void 0,function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,n,a)}catch(l){t.state="errored",l.status!==404?this._source.fire(new c.j(l,{tile:t})):this.update(this.transform,this.terrain)}})}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new c.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}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 n in this._tiles){const a=this._tiles[n];a.upload(t),a.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(Me).map(t=>t.key)}getRenderableIds(t){const n=[];for(const a in this._tiles)this._isIdRenderable(a,t)&&n.push(this._tiles[a]);return t?n.sort((a,l)=>{const h=a.tileID,_=l.tileID,x=new c.P(h.canonical.x,h.canonical.y)._rotate(this.transform.angle),b=new c.P(_.canonical.x,_.canonical.y)._rotate(this.transform.angle);return h.overscaledZ-_.overscaledZ||b.y-x.y||b.x-x.x}).map(a=>a.tileID.key):n.map(a=>a.tileID).sort(Me).map(a=>a.key)}hasRenderableParent(t){const n=this.findLoadedParent(t,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(t,n){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(n||!this._tiles[t].holdingForFade())}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,n){return c._(this,void 0,void 0,function*(){const a=this._tiles[t];a&&(a.state!=="loading"&&(a.state=n),yield this._loadTile(a,t,n))})}_tileLoaded(t,n,a){t.timeAdded=X.now(),a==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new c.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const n=this.getRenderableIds();for(let l=0;l1||(Math.abs(_)>1&&(Math.abs(_+b)===1?_+=b:Math.abs(_-b)===1&&(_-=b)),h.dem&&l.dem&&(l.dem.backfillBorder(h.dem,_,x),l.neighboringTiles&&l.neighboringTiles[I]&&(l.neighboringTiles[I].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,n,a,l){for(const h in this._tiles){let _=this._tiles[h];if(l[h]||!_.hasData()||_.tileID.overscaledZ<=n||_.tileID.overscaledZ>a)continue;let x=_.tileID;for(;_&&_.tileID.overscaledZ>n+1;){const I=_.tileID.scaledTo(_.tileID.overscaledZ-1);_=this._tiles[I.key],_&&_.hasData()&&(x=I)}let b=x;for(;b.overscaledZ>n;)if(b=b.scaledTo(b.overscaledZ-1),t[b.key]){l[x.key]=x;break}}}findLoadedParent(t,n){if(t.key in this._loadedParentTiles){const a=this._loadedParentTiles[t.key];return a&&a.tileID.overscaledZ>=n?a:null}for(let a=t.overscaledZ-1;a>=n;a--){const l=t.scaledTo(a),h=this._getLoadedTile(l);if(h)return h}}_getLoadedTile(t){const n=this._tiles[t.key];return n&&n.hasData()?n:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const n=Math.ceil(t.width/this._source.tileSize)+1,a=Math.ceil(t.height/this._source.tileSize)+1,l=Math.floor(n*a*(this._maxTileCacheZoomLevels===null?c.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),h=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,l):l;this._cache.setMaxSize(h)}handleWrapJump(t){const n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,n){const a={};for(const l in this._tiles){const h=this._tiles[l];h.tileID=h.tileID.unwrapTo(h.tileID.wrap+n),a[h.tileID.key]=h}this._tiles=a;for(const l in this._timers)clearTimeout(this._timers[l]),delete this._timers[l];for(const l in this._tiles)this._setTileReloadTimer(l,this._tiles[l])}}update(t,n){if(this.transform=t,this.terrain=n,!this._sourceLoaded||this._paused)return;let a;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?a=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(E=>new c.Q(E.canonical.z,E.wrap,E.canonical.z,E.canonical.x,E.canonical.y)):(a=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n}),this._source.hasTile&&(a=a.filter(E=>this._source.hasTile(E)))):a=[];const l=t.coveringZoomLevel(this._source),h=Math.max(l-Qi.maxOverzooming,this._source.minzoom),_=Math.max(l+Qi.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const E={};for(const M of a)if(M.canonical.z>this._source.minzoom){const B=M.scaledTo(M.canonical.z-1);E[B.key]=B;const j=M.scaledTo(Math.max(this._source.minzoom,Math.min(M.canonical.z,5)));E[j.key]=j}a=a.concat(Object.values(E))}const x=a.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,x&&this.fire(new c.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const b=this._updateRetainedTiles(a,l);if(xt(this._source.type)){const E={},M={},B=Object.keys(b),j=X.now();for(const q of B){const H=b[q],U=this._tiles[q];if(!U||U.fadeEndTime!==0&&U.fadeEndTime<=j)continue;const Q=this.findLoadedParent(H,h);Q&&(this._addTile(Q.tileID),E[Q.tileID.key]=Q.tileID),M[q]=H}this._retainLoadedChildren(M,l,_,b);for(const q in E)b[q]||(this._coveredTiles[q]=!0,b[q]=E[q]);if(n){const q={},H={};for(const U of a)this._tiles[U.key].hasData()?q[U.key]=U:H[U.key]=U;for(const U in H){const Q=H[U].children(this._source.maxzoom);this._tiles[Q[0].key]&&this._tiles[Q[1].key]&&this._tiles[Q[2].key]&&this._tiles[Q[3].key]&&(q[Q[0].key]=b[Q[0].key]=Q[0],q[Q[1].key]=b[Q[1].key]=Q[1],q[Q[2].key]=b[Q[2].key]=Q[2],q[Q[3].key]=b[Q[3].key]=Q[3],delete H[U])}for(const U in H){const Q=this.findLoadedParent(H[U],this._source.minzoom);if(Q){q[Q.tileID.key]=b[Q.tileID.key]=Q.tileID;for(const ue in q)q[ue].isChildOf(Q.tileID)&&delete q[ue]}}for(const U in this._tiles)q[U]||(this._coveredTiles[U]=!0)}}for(const E in b)this._tiles[E].clearFadeHold();const I=c.ab(this._tiles,b);for(const E of I){const M=this._tiles[E];M.hasSymbolBuckets&&!M.holdingForFade()?M.setHoldDuration(this.map._fadeDuration):M.hasSymbolBuckets&&!M.symbolFadeFinished()||this._removeTile(E)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){const a={},l={},h=Math.max(n-Qi.maxOverzooming,this._source.minzoom),_=Math.max(n+Qi.maxUnderzooming,this._source.minzoom),x={};for(const b of t){const I=this._addTile(b);a[b.key]=b,I.hasData()||nthis._source.maxzoom){const M=b.children(this._source.maxzoom)[0],B=this.getTile(M);if(B&&B.hasData()){a[M.key]=M;continue}}else{const M=b.children(this._source.maxzoom);if(a[M[0].key]&&a[M[1].key]&&a[M[2].key]&&a[M[3].key])continue}let E=I.wasRequested();for(let M=b.overscaledZ-1;M>=h;--M){const B=b.scaledTo(M);if(l[B.key])break;if(l[B.key]=!0,I=this.getTile(B),!I&&E&&(I=this._addTile(B)),I){const j=I.hasData();if((E||j)&&(a[B.key]=B),E=I.wasRequested(),j)break}}}return a}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const n=[];let a,l=this._tiles[t].tileID;for(;l.overscaledZ>0;){if(l.key in this._loadedParentTiles){a=this._loadedParentTiles[l.key];break}n.push(l.key);const h=l.scaledTo(l.overscaledZ-1);if(a=this._getLoadedTile(h),a)break;l=h}for(const h of n)this._loadedParentTiles[h]=a}}_addTile(t){let n=this._tiles[t.key];if(n)return n;n=this._cache.getAndRemove(t),n&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));const a=n;return n||(n=new tn(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,t.key,n.state)),n.uses++,this._tiles[t.key]=n,a||this._source.fire(new c.k("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const a=n.getExpiryTimeout();a&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},a))}_removeTile(t){const n=this._tiles[t];n&&(n.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,n,a){const l=[],h=this.transform;if(!h)return l;const _=a?h.getCameraQueryGeometry(t):t,x=t.map(q=>h.pointCoordinate(q,this.terrain)),b=_.map(q=>h.pointCoordinate(q,this.terrain)),I=this.getIds();let E=1/0,M=1/0,B=-1/0,j=-1/0;for(const q of b)E=Math.min(E,q.x),M=Math.min(M,q.y),B=Math.max(B,q.x),j=Math.max(j,q.y);for(let q=0;q=0&&W[1].y+ue>=0){const ae=x.map(de=>U.getTilePoint(de)),pe=b.map(de=>U.getTilePoint(de));l.push({tile:H,tileID:U,queryGeometry:ae,cameraQueryGeometry:pe,scale:Q})}}return l}getVisibleCoordinates(t){const n=this.getRenderableIds(t).map(a=>this._tiles[a].tileID);for(const a of n)a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(xt(this._source.type)){const t=X.now();for(const n in this._tiles)if(this._tiles[n].fadeEndTime>=t)return!0}return!1}setFeatureState(t,n,a){this._state.updateState(t=t||"_geojsonTileLayer",n,a)}removeFeatureState(t,n,a){this._state.removeFeatureState(t=t||"_geojsonTileLayer",n,a)}getFeatureState(t,n){return this._state.getState(t=t||"_geojsonTileLayer",n)}setDependencies(t,n,a){const l=this._tiles[t];l&&l.setDependencies(n,a)}reloadTilesForDependencies(t,n){for(const a in this._tiles)this._tiles[a].hasDependency(t,n)&&this._reloadTile(a,"reloading");this._cache.filter(a=>!a.hasDependency(t,n))}}function Me(u,t){const n=Math.abs(2*u.wrap)-+(u.wrap<0),a=Math.abs(2*t.wrap)-+(t.wrap<0);return u.overscaledZ-t.overscaledZ||a-n||t.canonical.y-u.canonical.y||t.canonical.x-u.canonical.x}function xt(u){return u==="raster"||u==="image"||u==="video"}Qi.maxOverzooming=10,Qi.maxUnderzooming=3;class ft{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let a=1;a0?(l-_)/x:0;return this.points[h].mult(1-b).add(this.points[n].mult(b))}}function Ai(u,t){let n=!0;return u==="always"||u!=="never"&&t!=="never"||(n=!1),n}class rn{constructor(t,n,a){const l=this.boxCells=[],h=this.circleCells=[];this.xCellCount=Math.ceil(t/a),this.yCellCount=Math.ceil(n/a);for(let _=0;_this.width||l<0||n>this.height)return[];const b=[];if(t<=0&&n<=0&&this.width<=a&&this.height<=l){if(h)return[{key:null,x1:t,y1:n,x2:a,y2:l}];for(let I=0;I0}hitTestCircle(t,n,a,l,h){const _=t-a,x=t+a,b=n-a,I=n+a;if(x<0||_>this.width||I<0||b>this.height)return!1;const E=[];return this._forEachCell(_,b,x,I,this._queryCellCircle,E,{hitTest:!0,overlapMode:l,circle:{x:t,y:n,radius:a},seenUids:{box:{},circle:{}}},h),E.length>0}_queryCell(t,n,a,l,h,_,x,b){const{seenUids:I,hitTest:E,overlapMode:M}=x,B=this.boxCells[h];if(B!==null){const q=this.bboxes;for(const H of B)if(!I.box[H]){I.box[H]=!0;const U=4*H,Q=this.boxKeys[H];if(t<=q[U+2]&&n<=q[U+3]&&a>=q[U+0]&&l>=q[U+1]&&(!b||b(Q))&&(!E||!Ai(M,Q.overlapMode))&&(_.push({key:Q,x1:q[U],y1:q[U+1],x2:q[U+2],y2:q[U+3]}),E))return!0}}const j=this.circleCells[h];if(j!==null){const q=this.circles;for(const H of j)if(!I.circle[H]){I.circle[H]=!0;const U=3*H,Q=this.circleKeys[H];if(this._circleAndRectCollide(q[U],q[U+1],q[U+2],t,n,a,l)&&(!b||b(Q))&&(!E||!Ai(M,Q.overlapMode))){const ue=q[U],W=q[U+1],ae=q[U+2];if(_.push({key:Q,x1:ue-ae,y1:W-ae,x2:ue+ae,y2:W+ae}),E)return!0}}}return!1}_queryCellCircle(t,n,a,l,h,_,x,b){const{circle:I,seenUids:E,overlapMode:M}=x,B=this.boxCells[h];if(B!==null){const q=this.bboxes;for(const H of B)if(!E.box[H]){E.box[H]=!0;const U=4*H,Q=this.boxKeys[H];if(this._circleAndRectCollide(I.x,I.y,I.radius,q[U+0],q[U+1],q[U+2],q[U+3])&&(!b||b(Q))&&!Ai(M,Q.overlapMode))return _.push(!0),!0}}const j=this.circleCells[h];if(j!==null){const q=this.circles;for(const H of j)if(!E.circle[H]){E.circle[H]=!0;const U=3*H,Q=this.circleKeys[H];if(this._circlesCollide(q[U],q[U+1],q[U+2],I.x,I.y,I.radius)&&(!b||b(Q))&&!Ai(M,Q.overlapMode))return _.push(!0),!0}}}_forEachCell(t,n,a,l,h,_,x,b){const I=this._convertToXCellCoord(t),E=this._convertToYCellCoord(n),M=this._convertToXCellCoord(a),B=this._convertToYCellCoord(l);for(let j=I;j<=M;j++)for(let q=E;q<=B;q++)if(h.call(this,t,n,a,l,this.xCellCount*q+j,_,x,b))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,n,a,l,h,_){const x=l-t,b=h-n,I=a+_;return I*I>x*x+b*b}_circleAndRectCollide(t,n,a,l,h,_,x){const b=(_-l)/2,I=Math.abs(t-(l+b));if(I>b+a)return!1;const E=(x-h)/2,M=Math.abs(n-(h+E));if(M>E+a)return!1;if(I<=b||M<=E)return!0;const B=I-b,j=M-E;return B*B+j*j<=a*a}}function ht(u,t,n,a,l){const h=c.F();return t?(c.J(h,h,[1/l,1/l,1]),n||c.ad(h,h,a.angle)):c.K(h,a.labelPlaneMatrix,u),h}function zn(u,t,n,a,l){if(t){const h=c.ae(u);return c.J(h,h,[l,l,1]),n||c.ad(h,h,-a.angle),h}return a.glCoordMatrix}function Pi(u,t,n){let a;n?(a=[u.x,u.y,n(u.x,u.y),1],c.af(a,a,t)):(a=[u.x,u.y,0,1],He(a,a,t));const l=a[3];return{point:new c.P(a[0]/l,a[1]/l),signedDistanceFromCamera:l}}function G(u,t){return .5+u/t*.5}function z(u,t){const n=u[0]/u[3],a=u[1]/u[3];return n>=-t[0]&&n<=t[0]&&a>=-t[1]&&a<=t[1]}function L(u,t,n,a,l,h,_,x,b,I){const E=a?u.textSizeData:u.iconSizeData,M=c.ag(E,n.transform.zoom),B=[256/n.width*2+1,256/n.height*2+1],j=a?u.text.dynamicLayoutVertexArray:u.icon.dynamicLayoutVertexArray;j.clear();const q=u.lineVertexArray,H=a?u.text.placedSymbolArray:u.icon.placedSymbolArray,U=n.transform.width/n.transform.height;let Q=!1;for(let ue=0;ueMath.abs(n.x-t.x)*a?{useVertical:!0}:(u===c.ah.vertical?t.yn.x)?{needsFlipping:!0}:null}function ee(u,t,n,a,l,h,_,x,b,I,E,M,B,j,q,H){const U=t/24,Q=u.lineOffsetX*U,ue=u.lineOffsetY*U;let W;if(u.numGlyphs>1){const ae=u.glyphStartIndex+u.numGlyphs,pe=u.lineStartIndex,de=u.lineStartIndex+u.lineLength,xe=O(U,x,Q,ue,n,E,M,u,b,h,B,q,H);if(!xe)return{notEnoughRoom:!0};const Te=Pi(xe.first.point,_,H).point,we=Pi(xe.last.point,_,H).point;if(a&&!n){const Ie=N(u.writingMode,Te,we,j);if(Ie)return Ie}W=[xe.first];for(let Ie=u.glyphStartIndex+1;Ie0?Te.point:te(M,xe,pe,1,l,H),Ie=N(u.writingMode,pe,we,j);if(Ie)return Ie}const ae=be(U*x.getoffsetX(u.glyphStartIndex),Q,ue,n,E,M,u.segment,u.lineStartIndex,u.lineStartIndex+u.lineLength,b,h,B,q,H);if(!ae)return{notEnoughRoom:!0};W=[ae]}for(const ae of W)c.aj(I,ae.point,ae.angle);return{}}function te(u,t,n,a,l,h){const _=Pi(u.add(u.sub(t)._unit()),l,h).point,x=n.sub(_);return n.add(x._mult(a/x.mag()))}function oe(u,t){const{projectionCache:n,lineVertexArray:a,labelPlaneMatrix:l,tileAnchorPoint:h,distanceFromAnchor:_,getElevation:x,previousVertex:b,direction:I,absOffsetX:E}=t;if(n.projections[u])return n.projections[u];const M=new c.P(a.getx(u),a.gety(u)),B=Pi(M,l,x);if(B.signedDistanceFromCamera>0)return n.projections[u]=B.point,B.point;const j=u-I;return te(_===0?h:new c.P(a.getx(j),a.gety(j)),M,b,E-_+1,l,x)}function Y(u,t,n){return u._unit()._perp()._mult(t*n)}function ce(u,t,n,a,l,h,_,x){const{projectionCache:b,direction:I}=x;if(b.offsets[u])return b.offsets[u];const E=n.add(t);if(u+I=l)return b.offsets[u]=E,E;const M=oe(u+I,x),B=Y(M.sub(n),_,I),j=n.add(B),q=M.add(B);return b.offsets[u]=c.ak(h,E,j,q)||E,b.offsets[u]}function be(u,t,n,a,l,h,_,x,b,I,E,M,B,j){const q=a?u-t:u+t;let H=q>0?1:-1,U=0;a&&(H*=-1,U=Math.PI),H<0&&(U+=Math.PI);let Q,ue,W=H>0?x+_:x+_+1,ae=l,pe=l,de=0,xe=0;const Te=Math.abs(q),we=[];let Ie;for(;de+xe<=Te;){if(W+=H,W=b)return null;de+=xe,pe=ae,ue=Q;const Pe={projectionCache:M,lineVertexArray:I,labelPlaneMatrix:E,tileAnchorPoint:h,distanceFromAnchor:de,getElevation:j,previousVertex:pe,direction:H,absOffsetX:Te};if(ae=oe(W,Pe),n===0)we.push(pe),Ie=ae.sub(pe);else{let Qe;const Ve=ae.sub(pe);Qe=Ve.mag()===0?Y(oe(W+H,Pe).sub(ae),n,H):Y(Ve,n,H),ue||(ue=pe.add(Qe)),Q=ce(W,Qe,ae,x,b,ue,n,Pe),we.push(ue),Ie=Q.sub(ue)}xe=Ie.mag()}const Fe=Ie._mult((Te-de)/xe)._add(ue||pe),$e=U+Math.atan2(ae.y-pe.y,ae.x-pe.x);return we.push(Fe),{point:Fe,angle:B?$e:0,path:we}}const ge=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ye(u,t){for(let n=0;n=1;gt--)Ve.push(Pe.path[gt]);for(let gt=1;gtPi(St,b,q));Ve=gt.some(St=>St.signedDistanceFromCamera<=0)?[]:gt.map(St=>St.point)}let Tt=[];if(Ve.length>0){const gt=Ve[0].clone(),St=Ve[0].clone();for(let wi=1;wi=Ie.x&&St.x<=Fe.x&>.y>=Ie.y&&St.y<=Fe.y?[Ve]:St.xFe.x||St.yFe.y?[]:c.al([Ve],Ie.x,Ie.y,Fe.x,Fe.y)}for(const gt of Tt){$e.reset(gt,.25*we);let St=0;St=$e.length<=.5*we?1:Math.ceil($e.paddedLength/ri)+1;for(let wi=0;wi=this.screenRightBoundary||lthis.screenBottomBoundary}isInsideGrid(t,n,a,l){return a>=0&&t=0&&na.collisionGroupID===n}}return this.collisionGroups[t]}}function zi(u,t,n,a,l){const{horizontalAlign:h,verticalAlign:_}=c.at(u);return new c.P(-(h-.5)*t+a[0]*l,-(_-.5)*n+a[1]*l)}function sr(u,t,n,a,l,h){const{x1:_,x2:x,y1:b,y2:I,anchorPointX:E,anchorPointY:M}=u,B=new c.P(t,n);return a&&B._rotate(l?h:-h),{x1:_+B.x,y1:b+B.y,x2:x+B.x,y2:I+B.y,anchorPointX:E,anchorPointY:M}}class gr{constructor(t,n,a,l,h){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new dt(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=a,this.retainedQueryData={},this.collisionGroups=new di(l),this.collisionCircleArrays={},this.prevPlacement=h,h&&(h.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,a,l){const h=a.getBucket(n),_=a.latestFeatureIndex;if(!h||!_||n.id!==h.layerIds[0])return;const x=a.collisionBoxArray,b=h.layers[0].layout,I=Math.pow(2,this.transform.zoom-a.tileID.overscaledZ),E=a.tileSize/c.W,M=this.transform.calculatePosMatrix(a.tileID.toUnwrapped()),B=b.get("text-pitch-alignment")==="map",j=b.get("text-rotation-alignment")==="map",q=lt(a,1,this.transform.zoom),H=ht(M,B,j,this.transform,q);let U=null;if(B){const ue=zn(M,B,j,this.transform,q);U=c.K([],this.transform.labelPlaneMatrix,ue)}this.retainedQueryData[h.bucketInstanceId]=new mt(h.bucketInstanceId,_,h.sourceLayerIndex,h.index,a.tileID);const Q={bucket:h,layout:b,posMatrix:M,textLabelPlaneMatrix:H,labelToScreenMatrix:U,scale:I,textPixelRatio:E,holdingForFade:a.holdingForFade(),collisionBoxArray:x,partiallyEvaluatedTextSize:c.ag(h.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(h.sourceID)};if(l)for(const ue of h.sortKeyRanges){const{sortKey:W,symbolInstanceStart:ae,symbolInstanceEnd:pe}=ue;t.push({sortKey:W,symbolInstanceStart:ae,symbolInstanceEnd:pe,parameters:Q})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:h.symbolInstances.length,parameters:Q})}attemptAnchorPlacement(t,n,a,l,h,_,x,b,I,E,M,B,j,q,H,U){const Q=c.ap[t.textAnchor],ue=[t.textOffset0,t.textOffset1],W=zi(Q,a,l,ue,h),ae=this.collisionIndex.placeCollisionBox(sr(n,W.x,W.y,_,x,this.transform.angle),M,b,I,E.predicate,U);if((!H||this.collisionIndex.placeCollisionBox(sr(H,W.x,W.y,_,x,this.transform.angle),M,b,I,E.predicate,U).box.length!==0)&&ae.box.length>0){let pe;if(this.prevPlacement&&this.prevPlacement.variableOffsets[B.crossTileID]&&this.prevPlacement.placements[B.crossTileID]&&this.prevPlacement.placements[B.crossTileID].text&&(pe=this.prevPlacement.variableOffsets[B.crossTileID].anchor),B.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[B.crossTileID]={textOffset:ue,width:a,height:l,anchor:Q,textBoxScale:h,prevAnchor:pe},this.markUsedJustification(j,Q,B,q),j.allowVerticalPlacement&&(this.markUsedOrientation(j,q,B),this.placedOrientations[B.crossTileID]=q),{shift:W,placedGlyphBoxes:ae}}}placeLayerBucketPart(t,n,a){const{bucket:l,layout:h,posMatrix:_,textLabelPlaneMatrix:x,labelToScreenMatrix:b,textPixelRatio:I,holdingForFade:E,collisionBoxArray:M,partiallyEvaluatedTextSize:B,collisionGroup:j}=t.parameters,q=h.get("text-optional"),H=h.get("icon-optional"),U=c.aq(h,"text-overlap","text-allow-overlap"),Q=U==="always",ue=c.aq(h,"icon-overlap","icon-allow-overlap"),W=ue==="always",ae=h.get("text-rotation-alignment")==="map",pe=h.get("text-pitch-alignment")==="map",de=h.get("icon-text-fit")!=="none",xe=h.get("symbol-z-order")==="viewport-y",Te=Q&&(W||!l.hasIconData()||H),we=W&&(Q||!l.hasTextData()||q);!l.collisionArrays&&M&&l.deserializeCollisionBoxes(M);const Ie=this.retainedQueryData[l.bucketInstanceId].tileID,Fe=this.terrain?(Pe,Qe)=>this.terrain.getElevation(Ie,Pe,Qe):null,$e=(Pe,Qe)=>{var Ve,ri;if(n[Pe.crossTileID])return;if(E)return void(this.placements[Pe.crossTileID]=new li(!1,!1,!1));let Tt=!1,gt=!1,St=!0,wi=null,Kt={box:null,offscreen:null},cr={box:null,offscreen:null},qi=null,mi=null,er=null,tr=0,Ur=0,In=0;Qe.textFeatureIndex?tr=Qe.textFeatureIndex:Pe.useRuntimeCollisionCircles&&(tr=Pe.featureIndex),Qe.verticalTextFeatureIndex&&(Ur=Qe.verticalTextFeatureIndex);const ds=Qe.textBox;if(ds){const Di=ni=>{let Li=c.ah.horizontal;if(l.allowVerticalPlacement&&!ni&&this.prevPlacement){const Zi=this.prevPlacement.placedOrientations[Pe.crossTileID];Zi&&(this.placedOrientations[Pe.crossTileID]=Zi,Li=Zi,this.markUsedOrientation(l,Li,Pe))}return Li},Ti=(ni,Li)=>{if(l.allowVerticalPlacement&&Pe.numVerticalGlyphVertices>0&&Qe.verticalTextBox){for(const Zi of l.writingModes)if(Zi===c.ah.vertical?(Kt=Li(),cr=Kt):Kt=ni(),Kt&&Kt.box&&Kt.box.length)break}else Kt=ni()},gi=Pe.textAnchorOffsetStartIndex,ur=Pe.textAnchorOffsetEndIndex;if(ur===gi){const ni=(Li,Zi)=>{const Ri=this.collisionIndex.placeCollisionBox(Li,U,I,_,j.predicate,Fe);return Ri&&Ri.box&&Ri.box.length&&(this.markUsedOrientation(l,Zi,Pe),this.placedOrientations[Pe.crossTileID]=Zi),Ri};Ti(()=>ni(ds,c.ah.horizontal),()=>{const Li=Qe.verticalTextBox;return l.allowVerticalPlacement&&Pe.numVerticalGlyphVertices>0&&Li?ni(Li,c.ah.vertical):{box:null,offscreen:null}}),Di(Kt&&Kt.box&&Kt.box.length)}else{let ni=c.ap[(ri=(Ve=this.prevPlacement)===null||Ve===void 0?void 0:Ve.variableOffsets[Pe.crossTileID])===null||ri===void 0?void 0:ri.anchor];const Li=(Ri,hc,yi)=>{const Yo=Ri.x2-Ri.x1,dc=Ri.y2-Ri.y1,Zn=Pe.textBoxScale,Gn=de&&ue==="never"?hc:null;let hn={box:[],offscreen:!1},Ua=U==="never"?1:2,Qo="never";ni&&Ua++;for(let pc=0;pcLi(ds,Qe.iconBox,c.ah.horizontal),()=>{const Ri=Qe.verticalTextBox;return l.allowVerticalPlacement&&!(Kt&&Kt.box&&Kt.box.length)&&Pe.numVerticalGlyphVertices>0&&Ri?Li(Ri,Qe.verticalIconBox,c.ah.vertical):{box:null,offscreen:null}}),Kt&&(Tt=Kt.box,St=Kt.offscreen);const Zi=Di(Kt&&Kt.box);if(!Tt&&this.prevPlacement){const Ri=this.prevPlacement.variableOffsets[Pe.crossTileID];Ri&&(this.variableOffsets[Pe.crossTileID]=Ri,this.markUsedJustification(l,Ri.anchor,Pe,Zi))}}}if(qi=Kt,Tt=qi&&qi.box&&qi.box.length>0,St=qi&&qi.offscreen,Pe.useRuntimeCollisionCircles){const Di=l.text.placedSymbolArray.get(Pe.centerJustifiedTextSymbolIndex),Ti=c.ai(l.textSizeData,B,Di),gi=h.get("text-padding");mi=this.collisionIndex.placeCollisionCircles(U,Di,l.lineVertexArray,l.glyphOffsetArray,Ti,_,x,b,a,pe,j.predicate,Pe.collisionCircleDiameter,gi,Fe),mi.circles.length&&mi.collisionDetected&&!a&&c.w("Collisions detected, but collision boxes are not shown"),Tt=Q||mi.circles.length>0&&!mi.collisionDetected,St=St&&mi.offscreen}if(Qe.iconFeatureIndex&&(In=Qe.iconFeatureIndex),Qe.iconBox){const Di=Ti=>{const gi=de&&wi?sr(Ti,wi.x,wi.y,ae,pe,this.transform.angle):Ti;return this.collisionIndex.placeCollisionBox(gi,ue,I,_,j.predicate,Fe)};cr&&cr.box&&cr.box.length&&Qe.verticalIconBox?(er=Di(Qe.verticalIconBox),gt=er.box.length>0):(er=Di(Qe.iconBox),gt=er.box.length>0),St=St&&er.offscreen}const ps=q||Pe.numHorizontalGlyphVertices===0&&Pe.numVerticalGlyphVertices===0,An=H||Pe.numIconVertices===0;if(ps||An?An?ps||(gt=gt&&Tt):Tt=gt&&Tt:gt=Tt=gt&&Tt,Tt&&qi&&qi.box&&this.collisionIndex.insertCollisionBox(qi.box,U,h.get("text-ignore-placement"),l.bucketInstanceId,cr&&cr.box&&Ur?Ur:tr,j.ID),gt&&er&&this.collisionIndex.insertCollisionBox(er.box,ue,h.get("icon-ignore-placement"),l.bucketInstanceId,In,j.ID),mi&&(Tt&&this.collisionIndex.insertCollisionCircles(mi.circles,U,h.get("text-ignore-placement"),l.bucketInstanceId,tr,j.ID),a)){const Di=l.bucketInstanceId;let Ti=this.collisionCircleArrays[Di];Ti===void 0&&(Ti=this.collisionCircleArrays[Di]=new Ci);for(let gi=0;gi=0;--Qe){const Ve=Pe[Qe];$e(l.symbolInstances.get(Ve),l.collisionArrays[Ve])}}else for(let Pe=t.symbolInstanceStart;Pe=0&&(t.text.placedSymbolArray.get(x).crossTileID=h>=0&&x!==h?0:a.crossTileID)}markUsedOrientation(t,n,a){const l=n===c.ah.horizontal||n===c.ah.horizontalOnly?n:0,h=n===c.ah.vertical?n:0,_=[a.leftJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.rightJustifiedTextSymbolIndex];for(const x of _)t.text.placedSymbolArray.get(x).placedOrientation=l;a.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).placedOrientation=h)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let a=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const l=n?n.symbolFadeChange(t):1,h=n?n.opacities:{},_=n?n.variableOffsets:{},x=n?n.placedOrientations:{};for(const b in this.placements){const I=this.placements[b],E=h[b];E?(this.opacities[b]=new Xt(E,l,I.text,I.icon),a=a||I.text!==E.text.placed||I.icon!==E.icon.placed):(this.opacities[b]=new Xt(null,l,I.text,I.icon,I.skipFade),a=a||I.text||I.icon)}for(const b in h){const I=h[b];if(!this.opacities[b]){const E=new Xt(I,l,!1,!1);E.isHidden()||(this.opacities[b]=E,a=a||I.text.placed||I.icon.placed)}}for(const b in _)this.variableOffsets[b]||!this.opacities[b]||this.opacities[b].isHidden()||(this.variableOffsets[b]=_[b]);for(const b in x)this.placedOrientations[b]||!this.opacities[b]||this.opacities[b].isHidden()||(this.placedOrientations[b]=x[b]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");a?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){const a={};for(const l of n){const h=l.getBucket(t);h&&l.latestFeatureIndex&&t.id===h.layerIds[0]&&this.updateBucketOpacities(h,a,l.collisionBoxArray)}}updateBucketOpacities(t,n,a){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const l=t.layers[0],h=l.layout,_=new Xt(null,0,!1,!1,!0),x=h.get("text-allow-overlap"),b=h.get("icon-allow-overlap"),I=l._unevaluatedLayout.hasValue("text-variable-anchor")||l._unevaluatedLayout.hasValue("text-variable-anchor-offset"),E=h.get("text-rotation-alignment")==="map",M=h.get("text-pitch-alignment")==="map",B=h.get("icon-text-fit")!=="none",j=new Xt(null,0,x&&(b||!t.hasIconData()||h.get("icon-optional")),b&&(x||!t.hasTextData()||h.get("text-optional")),!0);!t.collisionArrays&&a&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(a);const q=(H,U,Q)=>{for(let ue=0;ue0,de=this.placedOrientations[U.crossTileID],xe=de===c.ah.vertical,Te=de===c.ah.horizontal||de===c.ah.horizontalOnly;if(Q>0||ue>0){const we=_r(ae.text);q(t.text,Q,xe?Ts:we),q(t.text,ue,Te?Ts:we);const Ie=ae.text.isHidden();[U.rightJustifiedTextSymbolIndex,U.centerJustifiedTextSymbolIndex,U.leftJustifiedTextSymbolIndex].forEach(Pe=>{Pe>=0&&(t.text.placedSymbolArray.get(Pe).hidden=Ie||xe?1:0)}),U.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(U.verticalPlacedTextSymbolIndex).hidden=Ie||Te?1:0);const Fe=this.variableOffsets[U.crossTileID];Fe&&this.markUsedJustification(t,Fe.anchor,U,de);const $e=this.placedOrientations[U.crossTileID];$e&&(this.markUsedJustification(t,"left",U,$e),this.markUsedOrientation(t,$e,U))}if(pe){const we=_r(ae.icon),Ie=!(B&&U.verticalPlacedIconSymbolIndex&&xe);U.placedIconSymbolIndex>=0&&(q(t.icon,U.numIconVertices,Ie?we:Ts),t.icon.placedSymbolArray.get(U.placedIconSymbolIndex).hidden=ae.icon.isHidden()),U.verticalPlacedIconSymbolIndex>=0&&(q(t.icon,U.numVerticalIconVertices,Ie?Ts:we),t.icon.placedSymbolArray.get(U.verticalPlacedIconSymbolIndex).hidden=ae.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const we=t.collisionArrays[H];if(we){let Ie=new c.P(0,0);if(we.textBox||we.verticalTextBox){let $e=!0;if(I){const Pe=this.variableOffsets[W];Pe?(Ie=zi(Pe.anchor,Pe.width,Pe.height,Pe.textOffset,Pe.textBoxScale),E&&Ie._rotate(M?this.transform.angle:-this.transform.angle)):$e=!1}we.textBox&&ji(t.textCollisionBox.collisionVertexArray,ae.text.placed,!$e||xe,Ie.x,Ie.y),we.verticalTextBox&&ji(t.textCollisionBox.collisionVertexArray,ae.text.placed,!$e||Te,Ie.x,Ie.y)}const Fe=!!(!Te&&we.verticalIconBox);we.iconBox&&ji(t.iconCollisionBox.collisionVertexArray,ae.icon.placed,Fe,B?Ie.x:0,B?Ie.y:0),we.verticalIconBox&&ji(t.iconCollisionBox.collisionVertexArray,ae.icon.placed,!Fe,B?Ie.x:0,B?Ie.y:0)}}}if(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.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const H=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=H.invProjMatrix,t.placementViewportMatrix=H.viewportMatrix,t.collisionCircleArray=H.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 ji(u,t,n,a,l){u.emplaceBack(t?1:0,n?1:0,a||0,l||0),u.emplaceBack(t?1:0,n?1:0,a||0,l||0),u.emplaceBack(t?1:0,n?1:0,a||0,l||0),u.emplaceBack(t?1:0,n?1:0,a||0,l||0)}const nn=Math.pow(2,25),El=Math.pow(2,24),Hc=Math.pow(2,17),Zt=Math.pow(2,16),mo=Math.pow(2,9),go=Math.pow(2,8),kr=Math.pow(2,1);function _r(u){if(u.opacity===0&&!u.placed)return 0;if(u.opacity===1&&u.placed)return 4294967295;const t=u.placed?1:0,n=Math.floor(127*u.opacity);return n*nn+t*El+n*Hc+t*Zt+n*mo+t*go+n*kr+t}const Ts=0;class Fr{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,n,a,l,h){const _=this._bucketParts;for(;this._currentTileIndexx.sortKey-b.sortKey));this._currentPartIndex<_.length;)if(n.placeLayerBucketPart(_[this._currentPartIndex],this._seenCrossTileIDs,a),this._currentPartIndex++,h())return!0;return!1}}class Or{constructor(t,n,a,l,h,_,x,b){this.placement=new gr(t,n,_,x,b),this._currentPlacementIndex=a.length-1,this._forceFullPlacement=l,this._showCollisionBoxes=h,this._done=!1}isDone(){return this._done}continuePlacement(t,n,a){const l=X.now(),h=()=>!this._forceFullPlacement&&X.now()-l>2;for(;this._currentPlacementIndex>=0;){const _=n[t[this._currentPlacementIndex]],x=this.placement.collisionIndex.transform.zoom;if(_.type==="symbol"&&(!_.minzoom||_.minzoom<=x)&&(!_.maxzoom||_.maxzoom>x)){if(this._inProgressLayer||(this._inProgressLayer=new Fr(_)),this._inProgressLayer.continuePlacement(a[_.source],this.placement,this._showCollisionBoxes,_,h))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const ts=512/c.W/2;class na{constructor(t,n,a){this.tileID=t,this.bucketInstanceId=a,this._symbolsByKey={};const l=new Map;for(let h=0;h({x:Math.floor(b.anchorX*ts),y:Math.floor(b.anchorY*ts)})),crossTileIDs:_.map(b=>b.crossTileID)};if(x.positions.length>128){const b=new c.au(x.positions.length,16,Uint16Array);for(const{x:I,y:E}of x.positions)b.add(I,E);b.finish(),delete x.positions,x.index=b}this._symbolsByKey[h]=x}}getScaledCoordinates(t,n){const{x:a,y:l,z:h}=this.tileID.canonical,{x:_,y:x,z:b}=n.canonical,I=ts/Math.pow(2,b-h),E=(x*c.W+t.anchorY)*I,M=l*c.W*ts;return{x:Math.floor((_*c.W+t.anchorX)*I-a*c.W*ts),y:Math.floor(E-M)}}findMatches(t,n,a){const l=this.tileID.canonical.zt)}}class ki{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Ss{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const n=Math.round((t-this.lng)/360);if(n!==0)for(const a in this.indexes){const l=this.indexes[a],h={};for(const _ in l){const x=l[_];x.tileID=x.tileID.unwrapTo(x.tileID.wrap+n),h[x.tileID.key]=x}this.indexes[a]=h}this.lng=t}addBucket(t,n,a){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let h=0;ht.overscaledZ)for(const x in _){const b=_[x];b.tileID.isChildOf(t)&&b.findMatches(n.symbolInstances,t,l)}else{const x=_[t.scaledTo(Number(h)).key];x&&x.findMatches(n.symbolInstances,t,l)}}for(let h=0;h{n[a]=!0});for(const a in this.layerIndexes)n[a]||delete this.layerIndexes[a]}}const ui=(u,t)=>c.t(u,t&&t.filter(n=>n.identifier!=="source.canvas")),sa=c.av();class Er extends c.E{constructor(t,n={}){super(),this._rtlTextPluginStateChange=()=>{for(const a in this.sourceCaches){const l=this.sourceCaches[a].getSource().type;l!=="vector"&&l!=="geojson"||this.sourceCaches[a].reload()}},this.map=t,this.dispatcher=new it(Ae(),t._getMapId()),this.dispatcher.registerMessageHandler("getGlyphs",(a,l)=>this.getGlyphs(a,l)),this.dispatcher.registerMessageHandler("getImages",(a,l)=>this.getImages(a,l)),this.imageManager=new yt,this.imageManager.setEventedParent(this),this.glyphManager=new wt(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new At(256,512),this.crossTileSymbolIndex=new vn,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new c.aw,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",c.ax()),Ce().on("pluginStateChange",this._rtlTextPluginStateChange),this.on("data",a=>{if(a.dataType!=="source"||a.sourceDataType!=="metadata")return;const l=this.sourceCaches[a.sourceId];if(!l)return;const h=l.getSource();if(h&&h.vectorLayerIds)for(const _ in this._layers){const x=this._layers[_];x.source===h.id&&this._validateLayer(x)}})}loadURL(t,n={},a){this.fire(new c.k("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;const l=this.map._requestManager.transformRequest(t,rt.Style);this._loadStyleRequest=new AbortController,c.h(l,this._loadStyleRequest).then(h=>{this._loadStyleRequest=null,this._load(h.data,n,a)}).catch(h=>{this._loadStyleRequest=null,h&&this.fire(new c.j(h))})}loadJSON(t,n={},a){this.fire(new c.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,X.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,n.validate=n.validate!==!1,this._load(t,n,a)}).catch(()=>{})}loadEmpty(){this.fire(new c.k("dataloading",{dataType:"style"})),this._load(sa,{validate:!1})}_load(t,n,a){var l;const h=n.transformStyle?n.transformStyle(a,t):t;if(!n.validate||!ui(this,c.x(h))){this._loaded=!0,this.stylesheet=h;for(const _ in h.sources)this.addSource(_,h.sources[_],{validate:!1});h.sprite?this._loadSprite(h.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(h.glyphs),this._createLayers(),this.light=new Ft(this.stylesheet.light),this.map.setTerrain((l=this.stylesheet.terrain)!==null&&l!==void 0?l:null),this.fire(new c.k("data",{dataType:"style"})),this.fire(new c.k("style.load"))}}_createLayers(){const t=c.ay(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map(n=>n.id),this._layers={},this._serializedLayers=null;for(const n of t){const a=c.az(n);a.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=a}}_loadSprite(t,n=!1,a=void 0){let l;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(h,_,x,b){return c._(this,void 0,void 0,function*(){const I=_e(h),E=x>1?"@2x":"",M={},B={};for(const{id:j,url:q}of I){const H=_.transformRequest(_.normalizeSpriteURL(q,E,".json"),rt.SpriteJSON);M[j]=c.h(H,b);const U=_.transformRequest(_.normalizeSpriteURL(q,E,".png"),rt.SpriteImage);B[j]=Ge.getImage(U,b)}return yield Promise.all([...Object.values(M),...Object.values(B)]),function(j,q){return c._(this,void 0,void 0,function*(){const H={};for(const U in j){H[U]={};const Q=X.getImageCanvasContext((yield q[U]).data),ue=(yield j[U]).data;for(const W in ue){const{width:ae,height:pe,x:de,y:xe,sdf:Te,pixelRatio:we,stretchX:Ie,stretchY:Fe,content:$e}=ue[W];H[U][W]={data:null,pixelRatio:we,sdf:Te,stretchX:Ie,stretchY:Fe,content:$e,spriteData:{width:ae,height:pe,x:de,y:xe,context:Q}}}}return H})}(M,B)})}(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(h=>{if(this._spriteRequest=null,h)for(const _ in h){this._spritesImagesIds[_]=[];const x=this._spritesImagesIds[_]?this._spritesImagesIds[_].filter(b=>!(b in h)):[];for(const b of x)this.imageManager.removeImage(b),this._changedImages[b]=!0;for(const b in h[_]){const I=_==="default"?b:`${_}:${b}`;this._spritesImagesIds[_].push(I),I in this.imageManager.images?this.imageManager.updateImage(I,h[_][b],!1):this.imageManager.addImage(I,h[_][b]),n&&(this._changedImages[I]=!0)}}}).catch(h=>{this._spriteRequest=null,l=h,this.fire(new c.j(l))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"})),a&&a(l)})}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}_validateLayer(t){const n=this.sourceCaches[t.source];if(!n)return;const a=t.sourceLayer;if(!a)return;const l=n.getSource();(l.type==="geojson"||l.vectorLayerIds&&l.vectorLayerIds.indexOf(a)===-1)&&this.fire(new c.j(new Error(`Source layer "${a}" does not exist on source "${l.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){const n=this._serializedAllLayers();if(!t||t.length===0)return Object.values(n);const a=[];for(const l of t)n[l]&&a.push(n[l]);return a}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const n=Object.keys(this._layers);for(const a of n){const l=this._layers[a];l.type!=="custom"&&(t[a]=l.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())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}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const n=this._changed;if(this._changed){const l=Object.keys(this._updatedLayers),h=Object.keys(this._removedLayers);(l.length||h.length)&&this._updateWorkerLayers(l,h);for(const _ in this._updatedSources){const x=this._updatedSources[_];if(x==="reload")this._reloadSource(_);else{if(x!=="clear")throw new Error(`Invalid action ${x}`);this._clearSource(_)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const _ in this._updatedPaintProps)this._layers[_].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const a={};for(const l in this.sourceCaches){const h=this.sourceCaches[l];a[l]=h.used,h.used=!1}for(const l of this._order){const h=this._layers[l];h.recalculate(t,this._availableImages),!h.isHidden(t.zoom)&&h.source&&(this.sourceCaches[h.source].used=!0)}for(const l in a){const h=this.sourceCaches[l];a[l]!==h.used&&h.fire(new c.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:l}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new c.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,n){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,n={}){var a;this._checkLoaded();const l=this.serialize();if(t=n.transformStyle?n.transformStyle(l,t):t,((a=n.validate)===null||a===void 0||a)&&ui(this,c.x(t)))return!1;(t=c.aA(t)).layers=c.ay(t.layers);const h=c.aB(l,t),_=this._getOperationsToPerform(h);if(_.unimplemented.length>0)throw new Error(`Unimplemented: ${_.unimplemented.join(", ")}.`);if(_.operations.length===0)return!1;for(const x of _.operations)x();return this.stylesheet=t,this._serializedLayers=null,!0}_getOperationsToPerform(t){const n=[],a=[];for(const l of t)switch(l.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":n.push(()=>this.addLayer.apply(this,l.args));break;case"removeLayer":n.push(()=>this.removeLayer.apply(this,l.args));break;case"setPaintProperty":n.push(()=>this.setPaintProperty.apply(this,l.args));break;case"setLayoutProperty":n.push(()=>this.setLayoutProperty.apply(this,l.args));break;case"setFilter":n.push(()=>this.setFilter.apply(this,l.args));break;case"addSource":n.push(()=>this.addSource.apply(this,l.args));break;case"removeSource":n.push(()=>this.removeSource.apply(this,l.args));break;case"setLayerZoomRange":n.push(()=>this.setLayerZoomRange.apply(this,l.args));break;case"setLight":n.push(()=>this.setLight.apply(this,l.args));break;case"setGeoJSONSourceData":n.push(()=>this.setGeoJSONSourceData.apply(this,l.args));break;case"setGlyphs":n.push(()=>this.setGlyphs.apply(this,l.args));break;case"setSprite":n.push(()=>this.setSprite.apply(this,l.args));break;case"setTerrain":n.push(()=>this.map.setTerrain.apply(this,l.args));break;case"setTransition":n.push(()=>{});break;default:a.push(l.command)}return{operations:n,unimplemented:a}}addImage(t,n){if(this.getImage(t))return this.fire(new c.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new c.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,a={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(c.x.source,`sources.${t}`,n,null,a))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const l=this.sourceCaches[t]=new Qi(t,n,this.dispatcher);l.style=this,l.setEventedParent(this,()=>({isSourceLoaded:l.loaded(),source:l.serialize(),sourceId:t})),l.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(const a in this._layers)if(this._layers[a].source===t)return this.fire(new c.j(new Error(`Source "${t}" cannot be removed while layer "${a}" is using it.`)));const n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new c.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const a=this.sourceCaches[t].getSource();if(a.type!=="geojson")throw new Error(`geojsonSource.type is ${a.type}, which is !== 'geojson`);a.setData(n),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,n,a={}){this._checkLoaded();const l=t.id;if(this.getLayer(l))return void this.fire(new c.j(new Error(`Layer "${l}" already exists on this map.`)));let h;if(t.type==="custom"){if(ui(this,c.aC(t)))return;h=c.az(t)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(l,t.source),t=c.aA(t),t=c.e(t,{source:l})),this._validate(c.x.layer,`layers.${l}`,t,{arrayIndex:-1},a))return;h=c.az(t),this._validateLayer(h),h.setEventedParent(this,{layer:{id:l}})}const _=n?this._order.indexOf(n):this._order.length;if(n&&_===-1)this.fire(new c.j(new Error(`Cannot add layer "${l}" before non-existing layer "${n}".`)));else{if(this._order.splice(_,0,l),this._layerOrderChanged=!0,this._layers[l]=h,this._removedLayers[l]&&h.source&&h.type!=="custom"){const x=this._removedLayers[l];delete this._removedLayers[l],x.type!==h.type?this._updatedSources[h.source]="clear":(this._updatedSources[h.source]="reload",this.sourceCaches[h.source].pause())}this._updateLayer(h),h.onAdd&&h.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new c.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;const a=this._order.indexOf(t);this._order.splice(a,1);const l=n?this._order.indexOf(n):this._order.length;n&&l===-1?this.fire(new c.j(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(l,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const n=this._layers[t];if(!n)return void this.fire(new c.j(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);const a=this._order.indexOf(t);this._order.splice(a,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,a){this._checkLoaded();const l=this.getLayer(t);l?l.minzoom===n&&l.maxzoom===a||(n!=null&&(l.minzoom=n),a!=null&&(l.maxzoom=a),this._updateLayer(l)):this.fire(new c.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,a={}){this._checkLoaded();const l=this.getLayer(t);if(l){if(!c.aD(l.filter,n))return n==null?(l.filter=void 0,void this._updateLayer(l)):void(this._validate(c.x.filter,`layers.${l.id}.filter`,n,null,a)||(l.filter=c.aA(n),this._updateLayer(l)))}else this.fire(new c.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return c.aA(this.getLayer(t).filter)}setLayoutProperty(t,n,a,l={}){this._checkLoaded();const h=this.getLayer(t);h?c.aD(h.getLayoutProperty(n),a)||(h.setLayoutProperty(n,a,l),this._updateLayer(h)):this.fire(new c.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){const a=this.getLayer(t);if(a)return a.getLayoutProperty(n);this.fire(new c.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,a,l={}){this._checkLoaded();const h=this.getLayer(t);h?c.aD(h.getPaintProperty(n),a)||(h.setPaintProperty(n,a,l)&&this._updateLayer(h),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new c.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();const a=t.source,l=t.sourceLayer,h=this.sourceCaches[a];if(h===void 0)return void this.fire(new c.j(new Error(`The source '${a}' does not exist in the map's style.`)));const _=h.getSource().type;_==="geojson"&&l?this.fire(new c.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):_!=="vector"||l?(t.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),h.setFeatureState(l,t.id,n)):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();const a=t.source,l=this.sourceCaches[a];if(l===void 0)return void this.fire(new c.j(new Error(`The source '${a}' does not exist in the map's style.`)));const h=l.getSource().type,_=h==="vector"?t.sourceLayer:void 0;h!=="vector"||_?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new c.j(new Error("A feature id is required to remove its specific state property."))):l.removeFeatureState(_,t.id,n):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const n=t.source,a=t.sourceLayer,l=this.sourceCaches[n];if(l!==void 0)return l.getSource().type!=="vector"||a?(t.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),l.getFeatureState(a,t.id)):void this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new c.j(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return c.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=c.aE(this.sourceCaches,h=>h.serialize()),n=this._serializeByIds(this._order),a=this.map.getTerrain()||void 0,l=this.stylesheet;return c.aF({version:l.version,name:l.name,metadata:l.metadata,light:l.light,center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch,sprite:l.sprite,glyphs:l.glyphs,transition:l.transition,sources:t,layers:n,terrain:a},h=>h!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const n=_=>this._layers[_].type==="fill-extrusion",a={},l=[];for(let _=this._order.length-1;_>=0;_--){const x=this._order[_];if(n(x)){a[x]=_;for(const b of t){const I=b[x];if(I)for(const E of I)l.push(E)}}}l.sort((_,x)=>x.intersectionZ-_.intersectionZ);const h=[];for(let _=this._order.length-1;_>=0;_--){const x=this._order[_];if(n(x))for(let b=l.length-1;b>=0;b--){const I=l[b].feature;if(a[I.layer.id]<_)break;h.push(I),l.pop()}else for(const b of t){const I=b[x];if(I)for(const E of I)h.push(E.feature)}}return h}queryRenderedFeatures(t,n,a){n&&n.filter&&this._validate(c.x.filter,"queryRenderedFeatures.filter",n.filter,null,n);const l={};if(n&&n.layers){if(!Array.isArray(n.layers))return this.fire(new c.j(new Error("parameters.layers must be an Array."))),[];for(const x of n.layers){const b=this._layers[x];if(!b)return this.fire(new c.j(new Error(`The layer '${x}' does not exist in the map's style and cannot be queried for features.`))),[];l[b.source]=!0}}const h=[];n.availableImages=this._availableImages;const _=this._serializedAllLayers();for(const x in this.sourceCaches)n.layers&&!l[x]||h.push(Ji(this.sourceCaches[x],this._layers,_,t,n,a));return this.placement&&h.push(function(x,b,I,E,M,B,j){const q={},H=B.queryRenderedSymbols(E),U=[];for(const Q of Object.keys(H).map(Number))U.push(j[Q]);U.sort(he);for(const Q of U){const ue=Q.featureIndex.lookupSymbolFeatures(H[Q.bucketInstanceId],b,Q.bucketIndex,Q.sourceLayerIndex,M.filter,M.layers,M.availableImages,x);for(const W in ue){const ae=q[W]=q[W]||[],pe=ue[W];pe.sort((de,xe)=>{const Te=Q.featureSortOrder;if(Te){const we=Te.indexOf(de.featureIndex);return Te.indexOf(xe.featureIndex)-we}return xe.featureIndex-de.featureIndex});for(const de of pe)ae.push(de)}}for(const Q in q)q[Q].forEach(ue=>{const W=ue.feature,ae=I[x[Q].source].getFeatureState(W.layer["source-layer"],W.id);W.source=W.layer.source,W.layer["source-layer"]&&(W.sourceLayer=W.layer["source-layer"]),W.state=ae});return q}(this._layers,_,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(h)}querySourceFeatures(t,n){n&&n.filter&&this._validate(c.x.filter,"querySourceFeatures.filter",n.filter,null,n);const a=this.sourceCaches[t];return a?function(l,h){const _=l.getRenderableIds().map(I=>l.getTileByID(I)),x=[],b={};for(let I=0;I<_.length;I++){const E=_[I],M=E.tileID.canonical.key;b[M]||(b[M]=!0,E.querySourceFeatures(x,h))}return x}(a,n):[]}getLight(){return this.light.getLight()}setLight(t,n={}){this._checkLoaded();const a=this.light.getLight();let l=!1;for(const _ in t)if(!c.aD(t[_],a[_])){l=!0;break}if(!l)return;const h={now:X.now(),transition:c.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,n),this.light.updateTransitions(h)}_validate(t,n,a,l,h={}){return(!h||h.validate!==!1)&&ui(this,t.call(c.x,c.e({key:n,style:this.serialize(),value:a,styleSpec:c.v},l)))}_remove(t=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),Ce().off("pluginStateChange",this._rtlTextPluginStateChange);for(const n in this._layers)this._layers[n].setEventedParent(null);for(const n in this.sourceCaches){const a=this.sourceCaches[n];a.setEventedParent(null),a.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(const n in this.sourceCaches)this.sourceCaches[n].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,n,a,l,h=!1){let _=!1,x=!1;const b={};for(const I of this._order){const E=this._layers[I];if(E.type!=="symbol")continue;if(!b[E.source]){const B=this.sourceCaches[E.source];b[E.source]=B.getRenderableIds(!0).map(j=>B.getTileByID(j)).sort((j,q)=>q.tileID.overscaledZ-j.tileID.overscaledZ||(j.tileID.isLessThan(q.tileID)?-1:1))}const M=this.crossTileSymbolIndex.addLayer(E,b[E.source],t.center.lng);_=_||M}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((h=h||this._layerOrderChanged||a===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(X.now(),t.zoom))&&(this.pauseablePlacement=new Or(t,this.map.terrain,this._order,h,n,a,l,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,b),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(X.now()),x=!0),_&&this.pauseablePlacement.placement.setStale()),x||_)for(const I of this._order){const E=this._layers[I];E.type==="symbol"&&this.placement.updateLayerOpacities(E,b[E.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(X.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,n){return c._(this,void 0,void 0,function*(){const a=yield this.imageManager.getImages(n.icons);this._updateTilesForChangedImages();const l=this.sourceCaches[n.source];return l&&l.setDependencies(n.tileID.key,n.type,n.icons),a})}getGlyphs(t,n){return c._(this,void 0,void 0,function*(){const a=yield this.glyphManager.getGlyphs(n.stacks),l=this.sourceCaches[n.source];return l&&l.setDependencies(n.tileID.key,n.type,[""]),a})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,n={}){this._checkLoaded(),t&&this._validate(c.x.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,n,a={},l){this._checkLoaded();const h=[{id:t,url:n}],_=[..._e(this.stylesheet.sprite),...h];this._validate(c.x.sprite,"sprite",_,null,a)||(this.stylesheet.sprite=_,this._loadSprite(h,!0,l))}removeSprite(t){this._checkLoaded();const n=_e(this.stylesheet.sprite);if(n.find(a=>a.id===t)){if(this._spritesImagesIds[t])for(const a of this._spritesImagesIds[t])this.imageManager.removeImage(a),this._changedImages[a]=!0;n.splice(n.findIndex(a=>a.id===t),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}else this.fire(new c.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return _e(this.stylesheet.sprite)}setSprite(t,n={},a){this._checkLoaded(),t&&this._validate(c.x.sprite,"sprite",t,null,n)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,a):(this._unloadSprite(),a&&a(null)))}}var aa=c.X([{name:"a_pos",type:"Int16",components:2}]),sn="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const Is={prelude:Gt(`#ifdef GL_ES +precision mediump float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +`,`#ifdef GL_ES +precision highp float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 +);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} +#ifdef TERRAIN3D +uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; +#endif +const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { +#ifdef TERRAIN3D +highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); +#else +return 1.0; +#endif +}float calculate_visibility(vec4 pos) { +#ifdef TERRAIN3D +vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; +#else +return 1.0; +#endif +}float ele(vec2 pos) { +#ifdef TERRAIN3D +vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; +#else +return 0.0; +#endif +}float get_elevation(vec2 pos) { +#ifdef TERRAIN3D +vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; +#else +return 0.0; +#endif +}`),background:Gt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Gt(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Gt(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Gt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Gt(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Gt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Gt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Gt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Gt("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:Gt(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_FragColor=color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Gt(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Gt(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Gt(`#ifdef GL_ES +precision highp float; +#endif +uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Gt(`varying vec4 v_color;void main() {gl_FragColor=v_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec4 v_color; +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec3 normal=a_normal_ed.xyz; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Gt(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 +? a_pos +: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Gt(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:Gt(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; +#define PI 3.141592653589793 +void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:Gt(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_width2=vec2(outset,inset);}`),lineGradient:Gt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_width2=vec2(outset,inset);}`),linePattern:Gt(`#ifdef GL_ES +precision highp float; +#endif +uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Gt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Gt(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Gt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Gt(`#define SDF_PX 8.0 +uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Gt(`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:Gt("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",sn),terrainDepth:Gt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",sn),terrainCoords:Gt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",sn)};function Gt(u,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,a=t.match(/attribute ([\w]+) ([\w]+)/g),l=u.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),h=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),_=h?h.concat(l):l,x={};return{fragmentSource:u=u.replace(n,(b,I,E,M,B)=>(x[B]=!0,I==="define"?` +#ifndef HAS_UNIFORM_u_${B} +varying ${E} ${M} ${B}; +#else +uniform ${E} ${M} u_${B}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${B} + ${E} ${M} ${B} = u_${B}; +#endif +`)),vertexSource:t=t.replace(n,(b,I,E,M,B)=>{const j=M==="float"?"vec2":"vec4",q=B.match(/color/)?"color":j;return x[B]?I==="define"?` +#ifndef HAS_UNIFORM_u_${B} +uniform lowp float u_${B}_t; +attribute ${E} ${j} a_${B}; +varying ${E} ${M} ${B}; +#else +uniform ${E} ${M} u_${B}; +#endif +`:q==="vec4"?` +#ifndef HAS_UNIFORM_u_${B} + ${B} = a_${B}; +#else + ${E} ${M} ${B} = u_${B}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${B} + ${B} = unpack_mix_${q}(a_${B}, u_${B}_t); +#else + ${E} ${M} ${B} = u_${B}; +#endif +`:I==="define"?` +#ifndef HAS_UNIFORM_u_${B} +uniform lowp float u_${B}_t; +attribute ${E} ${j} a_${B}; +#else +uniform ${E} ${M} u_${B}; +#endif +`:q==="vec4"?` +#ifndef HAS_UNIFORM_u_${B} + ${E} ${M} ${B} = a_${B}; +#else + ${E} ${M} ${B} = u_${B}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${B} + ${E} ${M} ${B} = unpack_mix_${q}(a_${B}, u_${B}_t); +#else + ${E} ${M} ${B} = u_${B}; +#endif +`}),staticAttributes:a,staticUniforms:_}}class oa{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,a,l,h,_,x,b,I){this.context=t;let E=this.boundPaintVertexBuffers.length!==l.length;for(let M=0;!E&&M({u_depth:new c.aG(de,xe.u_depth),u_terrain:new c.aG(de,xe.u_terrain),u_terrain_dim:new c.aH(de,xe.u_terrain_dim),u_terrain_matrix:new c.aI(de,xe.u_terrain_matrix),u_terrain_unpack:new c.aJ(de,xe.u_terrain_unpack),u_terrain_exaggeration:new c.aH(de,xe.u_terrain_exaggeration)}))(t,pe),this.binderUniforms=a?a.getUniforms(t,pe):[]}draw(t,n,a,l,h,_,x,b,I,E,M,B,j,q,H,U,Q,ue){const W=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(a),t.setStencilMode(l),t.setColorMode(h),t.setCullFace(_),b){t.activeTexture.set(W.TEXTURE2),W.bindTexture(W.TEXTURE_2D,b.depthTexture),t.activeTexture.set(W.TEXTURE3),W.bindTexture(W.TEXTURE_2D,b.texture);for(const pe in this.terrainUniforms)this.terrainUniforms[pe].set(b[pe])}for(const pe in this.fixedUniforms)this.fixedUniforms[pe].set(x[pe]);H&&H.setUniforms(t,this.binderUniforms,j,{zoom:q});let ae=0;switch(n){case W.LINES:ae=2;break;case W.TRIANGLES:ae=3;break;case W.LINE_STRIP:ae=1}for(const pe of B.get()){const de=pe.vaos||(pe.vaos={});(de[I]||(de[I]=new oa)).bind(t,this,E,H?H.getPaintVertexBuffers():[],M,pe.vertexOffset,U,Q,ue),W.drawElements(n,pe.primitiveLength*ae,W.UNSIGNED_SHORT,pe.primitiveOffset*ae*2)}}}function la(u,t,n){const a=1/lt(n,1,t.transform.tileZoom),l=Math.pow(2,n.tileID.overscaledZ),h=n.tileSize*Math.pow(2,t.transform.tileZoom)/l,_=h*(n.tileID.canonical.x+n.tileID.wrap*l),x=h*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[a,u.fromScale,u.toScale],u_fade:u.t,u_pixel_coord_upper:[_>>16,x>>16],u_pixel_coord_lower:[65535&_,65535&x]}}const As=(u,t,n,a)=>{const l=t.style.light,h=l.properties.get("position"),_=[h.x,h.y,h.z],x=function(){var I=new c.A(9);return c.A!=Float32Array&&(I[1]=0,I[2]=0,I[3]=0,I[5]=0,I[6]=0,I[7]=0),I[0]=1,I[4]=1,I[8]=1,I}();l.properties.get("anchor")==="viewport"&&function(I,E){var M=Math.sin(E),B=Math.cos(E);I[0]=B,I[1]=M,I[2]=0,I[3]=-M,I[4]=B,I[5]=0,I[6]=0,I[7]=0,I[8]=1}(x,-t.transform.angle),function(I,E,M){var B=E[0],j=E[1],q=E[2];I[0]=B*M[0]+j*M[3]+q*M[6],I[1]=B*M[1]+j*M[4]+q*M[7],I[2]=B*M[2]+j*M[5]+q*M[8]}(_,_,x);const b=l.properties.get("color");return{u_matrix:u,u_lightpos:_,u_lightintensity:l.properties.get("intensity"),u_lightcolor:[b.r,b.g,b.b],u_vertical_gradient:+n,u_opacity:a}},Wc=(u,t,n,a,l,h,_)=>c.e(As(u,t,n,a),la(h,t,_),{u_height_factor:-Math.pow(2,l.overscaledZ)/_.tileSize/8}),Ml=u=>({u_matrix:u}),ca=(u,t,n,a)=>c.e(Ml(u),la(n,t,a)),Xc=(u,t)=>({u_matrix:u,u_world:t}),Pl=(u,t,n,a,l)=>c.e(ca(u,t,n,a),{u_world:l}),Kc=(u,t,n,a)=>{const l=u.transform;let h,_;if(a.paint.get("circle-pitch-alignment")==="map"){const x=lt(n,1,l.zoom);h=!0,_=[x,x]}else h=!1,_=l.pixelsToGLUnits;return{u_camera_to_center_distance:l.cameraToCenterDistance,u_scale_with_map:+(a.paint.get("circle-pitch-scale")==="map"),u_matrix:u.translatePosMatrix(t.posMatrix,n,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_pitch_with_map:+h,u_device_pixel_ratio:u.pixelRatio,u_extrude_scale:_}},zl=(u,t,n)=>{const a=lt(n,1,t.zoom),l=Math.pow(2,t.zoom-n.tileID.overscaledZ),h=n.tileID.overscaleFactor();return{u_matrix:u,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:a,u_extrude_scale:[t.pixelsToGLUnits[0]/(a*l),t.pixelsToGLUnits[1]/(a*l)],u_overscale_factor:h}},Dl=(u,t,n=1)=>({u_matrix:u,u_color:t,u_overlay:0,u_overlay_scale:n}),ua=u=>({u_matrix:u}),Ll=(u,t,n,a)=>({u_matrix:u,u_extrude_scale:lt(t,1,n),u_intensity:a});function Rl(u,t){const n=Math.pow(2,t.canonical.z),a=t.canonical.y;return[new c.Y(0,a/n).toLngLat().lat,new c.Y(0,(a+1)/n).toLngLat().lat]}const ha=(u,t,n,a)=>{const l=u.transform;return{u_matrix:Cs(u,t,n,a),u_ratio:1/lt(t,1,l.zoom),u_device_pixel_ratio:u.pixelRatio,u_units_to_pixels:[1/l.pixelsToGLUnits[0],1/l.pixelsToGLUnits[1]]}},Bl=(u,t,n,a,l)=>c.e(ha(u,t,n,l),{u_image:0,u_image_height:a}),Dn=(u,t,n,a,l)=>{const h=u.transform,_=Mr(t,h);return{u_matrix:Cs(u,t,n,l),u_texsize:t.imageAtlasTexture.size,u_ratio:1/lt(t,1,h.zoom),u_device_pixel_ratio:u.pixelRatio,u_image:0,u_scale:[_,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/h.pixelsToGLUnits[0],1/h.pixelsToGLUnits[1]]}},da=(u,t,n,a,l,h)=>{const _=u.lineAtlas,x=Mr(t,u.transform),b=n.layout.get("line-cap")==="round",I=_.getDash(a.from,b),E=_.getDash(a.to,b),M=I.width*l.fromScale,B=E.width*l.toScale;return c.e(ha(u,t,n,h),{u_patternscale_a:[x/M,-I.height/2],u_patternscale_b:[x/B,-E.height/2],u_sdfgamma:_.width/(256*Math.min(M,B)*u.pixelRatio)/2,u_image:0,u_tex_y_a:I.y,u_tex_y_b:E.y,u_mix:l.t})};function Mr(u,t){return 1/lt(u,1,t.tileZoom)}function Cs(u,t,n,a){return u.translatePosMatrix(a?a.posMatrix:t.tileID.posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const pa=(u,t,n,a,l)=>{return{u_matrix:u,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:a.mix,u_opacity:a.opacity*l.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:l.paint.get("raster-brightness-min"),u_brightness_high:l.paint.get("raster-brightness-max"),u_saturation_factor:(_=l.paint.get("raster-saturation"),_>0?1-1/(1.001-_):-_),u_contrast_factor:(h=l.paint.get("raster-contrast"),h>0?1/(1-h):1+h),u_spin_weights:ks(l.paint.get("raster-hue-rotate"))};var h,_};function ks(u){u*=Math.PI/180;const t=Math.sin(u),n=Math.cos(u);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}const Es=(u,t,n,a,l,h,_,x,b,I)=>{const E=l.transform;return{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:E.cameraToCenterDistance,u_pitch:E.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:E.width/E.height,u_fade_change:l.options.fadeDuration?l.symbolFadeChange:1,u_matrix:h,u_label_plane_matrix:_,u_coord_matrix:x,u_is_text:+b,u_pitch_with_map:+a,u_texsize:I,u_texture:0}},Ms=(u,t,n,a,l,h,_,x,b,I,E)=>{const M=l.transform;return c.e(Es(u,t,n,a,l,h,_,x,b,I),{u_gamma_scale:a?Math.cos(M._pitch)*M.cameraToCenterDistance:1,u_device_pixel_ratio:l.pixelRatio,u_is_halo:+E})},Ps=(u,t,n,a,l,h,_,x,b,I)=>c.e(Ms(u,t,n,a,l,h,_,x,!0,b,!0),{u_texsize_icon:I,u_texture_icon:1}),Jc=(u,t,n)=>({u_matrix:u,u_opacity:t,u_color:n}),Yc=(u,t,n,a,l,h)=>c.e(function(_,x,b,I){const E=b.imageManager.getPattern(_.from.toString()),M=b.imageManager.getPattern(_.to.toString()),{width:B,height:j}=b.imageManager.getPixelSize(),q=Math.pow(2,I.tileID.overscaledZ),H=I.tileSize*Math.pow(2,b.transform.tileZoom)/q,U=H*(I.tileID.canonical.x+I.tileID.wrap*q),Q=H*I.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:E.tl,u_pattern_br_a:E.br,u_pattern_tl_b:M.tl,u_pattern_br_b:M.br,u_texsize:[B,j],u_mix:x.t,u_pattern_size_a:E.displaySize,u_pattern_size_b:M.displaySize,u_scale_a:x.fromScale,u_scale_b:x.toScale,u_tile_units_to_pixels:1/lt(I,1,b.transform.tileZoom),u_pixel_coord_upper:[U>>16,Q>>16],u_pixel_coord_lower:[65535&U,65535&Q]}}(a,h,n,l),{u_matrix:u,u_opacity:t}),Fl={fillExtrusion:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_lightpos:new c.aK(u,t.u_lightpos),u_lightintensity:new c.aH(u,t.u_lightintensity),u_lightcolor:new c.aK(u,t.u_lightcolor),u_vertical_gradient:new c.aH(u,t.u_vertical_gradient),u_opacity:new c.aH(u,t.u_opacity)}),fillExtrusionPattern:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_lightpos:new c.aK(u,t.u_lightpos),u_lightintensity:new c.aH(u,t.u_lightintensity),u_lightcolor:new c.aK(u,t.u_lightcolor),u_vertical_gradient:new c.aH(u,t.u_vertical_gradient),u_height_factor:new c.aH(u,t.u_height_factor),u_image:new c.aG(u,t.u_image),u_texsize:new c.aL(u,t.u_texsize),u_pixel_coord_upper:new c.aL(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aL(u,t.u_pixel_coord_lower),u_scale:new c.aK(u,t.u_scale),u_fade:new c.aH(u,t.u_fade),u_opacity:new c.aH(u,t.u_opacity)}),fill:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix)}),fillPattern:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_image:new c.aG(u,t.u_image),u_texsize:new c.aL(u,t.u_texsize),u_pixel_coord_upper:new c.aL(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aL(u,t.u_pixel_coord_lower),u_scale:new c.aK(u,t.u_scale),u_fade:new c.aH(u,t.u_fade)}),fillOutline:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_world:new c.aL(u,t.u_world)}),fillOutlinePattern:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_world:new c.aL(u,t.u_world),u_image:new c.aG(u,t.u_image),u_texsize:new c.aL(u,t.u_texsize),u_pixel_coord_upper:new c.aL(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aL(u,t.u_pixel_coord_lower),u_scale:new c.aK(u,t.u_scale),u_fade:new c.aH(u,t.u_fade)}),circle:(u,t)=>({u_camera_to_center_distance:new c.aH(u,t.u_camera_to_center_distance),u_scale_with_map:new c.aG(u,t.u_scale_with_map),u_pitch_with_map:new c.aG(u,t.u_pitch_with_map),u_extrude_scale:new c.aL(u,t.u_extrude_scale),u_device_pixel_ratio:new c.aH(u,t.u_device_pixel_ratio),u_matrix:new c.aI(u,t.u_matrix)}),collisionBox:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_camera_to_center_distance:new c.aH(u,t.u_camera_to_center_distance),u_pixels_to_tile_units:new c.aH(u,t.u_pixels_to_tile_units),u_extrude_scale:new c.aL(u,t.u_extrude_scale),u_overscale_factor:new c.aH(u,t.u_overscale_factor)}),collisionCircle:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_inv_matrix:new c.aI(u,t.u_inv_matrix),u_camera_to_center_distance:new c.aH(u,t.u_camera_to_center_distance),u_viewport_size:new c.aL(u,t.u_viewport_size)}),debug:(u,t)=>({u_color:new c.aM(u,t.u_color),u_matrix:new c.aI(u,t.u_matrix),u_overlay:new c.aG(u,t.u_overlay),u_overlay_scale:new c.aH(u,t.u_overlay_scale)}),clippingMask:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix)}),heatmap:(u,t)=>({u_extrude_scale:new c.aH(u,t.u_extrude_scale),u_intensity:new c.aH(u,t.u_intensity),u_matrix:new c.aI(u,t.u_matrix)}),heatmapTexture:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_world:new c.aL(u,t.u_world),u_image:new c.aG(u,t.u_image),u_color_ramp:new c.aG(u,t.u_color_ramp),u_opacity:new c.aH(u,t.u_opacity)}),hillshade:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_image:new c.aG(u,t.u_image),u_latrange:new c.aL(u,t.u_latrange),u_light:new c.aL(u,t.u_light),u_shadow:new c.aM(u,t.u_shadow),u_highlight:new c.aM(u,t.u_highlight),u_accent:new c.aM(u,t.u_accent)}),hillshadePrepare:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_image:new c.aG(u,t.u_image),u_dimension:new c.aL(u,t.u_dimension),u_zoom:new c.aH(u,t.u_zoom),u_unpack:new c.aJ(u,t.u_unpack)}),line:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_ratio:new c.aH(u,t.u_ratio),u_device_pixel_ratio:new c.aH(u,t.u_device_pixel_ratio),u_units_to_pixels:new c.aL(u,t.u_units_to_pixels)}),lineGradient:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_ratio:new c.aH(u,t.u_ratio),u_device_pixel_ratio:new c.aH(u,t.u_device_pixel_ratio),u_units_to_pixels:new c.aL(u,t.u_units_to_pixels),u_image:new c.aG(u,t.u_image),u_image_height:new c.aH(u,t.u_image_height)}),linePattern:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_texsize:new c.aL(u,t.u_texsize),u_ratio:new c.aH(u,t.u_ratio),u_device_pixel_ratio:new c.aH(u,t.u_device_pixel_ratio),u_image:new c.aG(u,t.u_image),u_units_to_pixels:new c.aL(u,t.u_units_to_pixels),u_scale:new c.aK(u,t.u_scale),u_fade:new c.aH(u,t.u_fade)}),lineSDF:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_ratio:new c.aH(u,t.u_ratio),u_device_pixel_ratio:new c.aH(u,t.u_device_pixel_ratio),u_units_to_pixels:new c.aL(u,t.u_units_to_pixels),u_patternscale_a:new c.aL(u,t.u_patternscale_a),u_patternscale_b:new c.aL(u,t.u_patternscale_b),u_sdfgamma:new c.aH(u,t.u_sdfgamma),u_image:new c.aG(u,t.u_image),u_tex_y_a:new c.aH(u,t.u_tex_y_a),u_tex_y_b:new c.aH(u,t.u_tex_y_b),u_mix:new c.aH(u,t.u_mix)}),raster:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_tl_parent:new c.aL(u,t.u_tl_parent),u_scale_parent:new c.aH(u,t.u_scale_parent),u_buffer_scale:new c.aH(u,t.u_buffer_scale),u_fade_t:new c.aH(u,t.u_fade_t),u_opacity:new c.aH(u,t.u_opacity),u_image0:new c.aG(u,t.u_image0),u_image1:new c.aG(u,t.u_image1),u_brightness_low:new c.aH(u,t.u_brightness_low),u_brightness_high:new c.aH(u,t.u_brightness_high),u_saturation_factor:new c.aH(u,t.u_saturation_factor),u_contrast_factor:new c.aH(u,t.u_contrast_factor),u_spin_weights:new c.aK(u,t.u_spin_weights)}),symbolIcon:(u,t)=>({u_is_size_zoom_constant:new c.aG(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aG(u,t.u_is_size_feature_constant),u_size_t:new c.aH(u,t.u_size_t),u_size:new c.aH(u,t.u_size),u_camera_to_center_distance:new c.aH(u,t.u_camera_to_center_distance),u_pitch:new c.aH(u,t.u_pitch),u_rotate_symbol:new c.aG(u,t.u_rotate_symbol),u_aspect_ratio:new c.aH(u,t.u_aspect_ratio),u_fade_change:new c.aH(u,t.u_fade_change),u_matrix:new c.aI(u,t.u_matrix),u_label_plane_matrix:new c.aI(u,t.u_label_plane_matrix),u_coord_matrix:new c.aI(u,t.u_coord_matrix),u_is_text:new c.aG(u,t.u_is_text),u_pitch_with_map:new c.aG(u,t.u_pitch_with_map),u_texsize:new c.aL(u,t.u_texsize),u_texture:new c.aG(u,t.u_texture)}),symbolSDF:(u,t)=>({u_is_size_zoom_constant:new c.aG(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aG(u,t.u_is_size_feature_constant),u_size_t:new c.aH(u,t.u_size_t),u_size:new c.aH(u,t.u_size),u_camera_to_center_distance:new c.aH(u,t.u_camera_to_center_distance),u_pitch:new c.aH(u,t.u_pitch),u_rotate_symbol:new c.aG(u,t.u_rotate_symbol),u_aspect_ratio:new c.aH(u,t.u_aspect_ratio),u_fade_change:new c.aH(u,t.u_fade_change),u_matrix:new c.aI(u,t.u_matrix),u_label_plane_matrix:new c.aI(u,t.u_label_plane_matrix),u_coord_matrix:new c.aI(u,t.u_coord_matrix),u_is_text:new c.aG(u,t.u_is_text),u_pitch_with_map:new c.aG(u,t.u_pitch_with_map),u_texsize:new c.aL(u,t.u_texsize),u_texture:new c.aG(u,t.u_texture),u_gamma_scale:new c.aH(u,t.u_gamma_scale),u_device_pixel_ratio:new c.aH(u,t.u_device_pixel_ratio),u_is_halo:new c.aG(u,t.u_is_halo)}),symbolTextAndIcon:(u,t)=>({u_is_size_zoom_constant:new c.aG(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aG(u,t.u_is_size_feature_constant),u_size_t:new c.aH(u,t.u_size_t),u_size:new c.aH(u,t.u_size),u_camera_to_center_distance:new c.aH(u,t.u_camera_to_center_distance),u_pitch:new c.aH(u,t.u_pitch),u_rotate_symbol:new c.aG(u,t.u_rotate_symbol),u_aspect_ratio:new c.aH(u,t.u_aspect_ratio),u_fade_change:new c.aH(u,t.u_fade_change),u_matrix:new c.aI(u,t.u_matrix),u_label_plane_matrix:new c.aI(u,t.u_label_plane_matrix),u_coord_matrix:new c.aI(u,t.u_coord_matrix),u_is_text:new c.aG(u,t.u_is_text),u_pitch_with_map:new c.aG(u,t.u_pitch_with_map),u_texsize:new c.aL(u,t.u_texsize),u_texsize_icon:new c.aL(u,t.u_texsize_icon),u_texture:new c.aG(u,t.u_texture),u_texture_icon:new c.aG(u,t.u_texture_icon),u_gamma_scale:new c.aH(u,t.u_gamma_scale),u_device_pixel_ratio:new c.aH(u,t.u_device_pixel_ratio),u_is_halo:new c.aG(u,t.u_is_halo)}),background:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_opacity:new c.aH(u,t.u_opacity),u_color:new c.aM(u,t.u_color)}),backgroundPattern:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_opacity:new c.aH(u,t.u_opacity),u_image:new c.aG(u,t.u_image),u_pattern_tl_a:new c.aL(u,t.u_pattern_tl_a),u_pattern_br_a:new c.aL(u,t.u_pattern_br_a),u_pattern_tl_b:new c.aL(u,t.u_pattern_tl_b),u_pattern_br_b:new c.aL(u,t.u_pattern_br_b),u_texsize:new c.aL(u,t.u_texsize),u_mix:new c.aH(u,t.u_mix),u_pattern_size_a:new c.aL(u,t.u_pattern_size_a),u_pattern_size_b:new c.aL(u,t.u_pattern_size_b),u_scale_a:new c.aH(u,t.u_scale_a),u_scale_b:new c.aH(u,t.u_scale_b),u_pixel_coord_upper:new c.aL(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aL(u,t.u_pixel_coord_lower),u_tile_units_to_pixels:new c.aH(u,t.u_tile_units_to_pixels)}),terrain:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_texture:new c.aG(u,t.u_texture),u_ele_delta:new c.aH(u,t.u_ele_delta)}),terrainDepth:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_ele_delta:new c.aH(u,t.u_ele_delta)}),terrainCoords:(u,t)=>({u_matrix:new c.aI(u,t.u_matrix),u_texture:new c.aG(u,t.u_texture),u_terrain_coords_id:new c.aH(u,t.u_terrain_coords_id),u_ele_delta:new c.aH(u,t.u_ele_delta)})};class Qc{constructor(t,n,a){this.context=t;const l=t.gl;this.buffer=l.createBuffer(),this.dynamicDraw=!!a,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),l.bufferData(l.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?l.DYNAMIC_DRAW:l.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Ln={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class fa{constructor(t,n,a,l){this.length=n.length,this.attributes=a,this.itemSize=n.bytesPerElement,this.dynamicDraw=l,this.context=t;const h=t.gl;this.buffer=h.createBuffer(),t.bindVertexBuffer.set(this.buffer),h.bufferData(h.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?h.DYNAMIC_DRAW:h.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let a=0;a0){const Ie=c.F(),Fe=xe;c.aP(Ie,de.placementInvProjMatrix,u.transform.glCoordMatrix),c.aP(Ie,Ie,de.placementViewportMatrix),E.push({circleArray:we,circleOffset:B,transform:Fe,invTransform:Ie,coord:ae}),M+=we.length/4,B=M}Te&&I.draw(x,b.LINES,zt.disabled,ti.disabled,u.colorModeForRenderPass(),$t.disabled,zl(xe,u.transform,pe),u.style.map.terrain&&u.style.map.terrain.getTerrainData(ae),n.id,Te.layoutVertexBuffer,Te.indexBuffer,Te.segments,null,u.transform.zoom,null,null,Te.collisionVertexBuffer)}if(!_||!E.length)return;const j=u.useProgram("collisionCircle"),q=new c.aQ;q.resize(4*M),q._trim();let H=0;for(const W of E)for(let ae=0;ae=0&&(q[U.associatedIconIndex]={shiftedAnchor:$e,angle:Pe})}else ye(U.numGlyphs,B)}if(I){j.clear();const H=u.icon.placedSymbolArray;for(let U=0;Uu.style.map.terrain.getElevation(Te,Zi,Ri):null,Li=n.layout.get("text-rotation-alignment")==="map";L(Ie,Te.posMatrix,u,l,tr,Ur,U,I,Li,ni)}const ps=u.translatePosMatrix(Te.posMatrix,we,h,_),An=Q||l&&de||ds?Co:tr,Di=u.translatePosMatrix(Ur,we,h,_,!0),Ti=Pe&&n.paint.get(l?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let gi;gi=Pe?Ie.iconsInText?Ps(Qe.kind,Tt,ue,U,u,ps,An,Di,St,qi):Ms(Qe.kind,Tt,ue,U,u,ps,An,Di,l,St,!0):Es(Qe.kind,Tt,ue,U,u,ps,An,Di,l,St);const ur={program:ri,buffers:Fe,uniformValues:gi,atlasTexture:wi,atlasTextureIcon:mi,atlasInterpolation:Kt,atlasInterpolationIcon:cr,isSDF:Pe,hasHalo:Ti};if(W&&Ie.canOverlap){ae=!0;const ni=Fe.segments.get();for(const Li of ni)xe.push({segments:new c.$([Li]),sortKey:Li.sortKey,state:ur,terrainData:gt})}else xe.push({segments:Fe.segments,sortKey:0,state:ur,terrainData:gt})}ae&&xe.sort((Te,we)=>Te.sortKey-we.sortKey);for(const Te of xe){const we=Te.state;if(B.activeTexture.set(j.TEXTURE0),we.atlasTexture.bind(we.atlasInterpolation,j.CLAMP_TO_EDGE),we.atlasTextureIcon&&(B.activeTexture.set(j.TEXTURE1),we.atlasTextureIcon&&we.atlasTextureIcon.bind(we.atlasInterpolationIcon,j.CLAMP_TO_EDGE)),we.isSDF){const Ie=we.uniformValues;we.hasHalo&&(Ie.u_is_halo=1,Hl(we.buffers,Te.segments,n,u,we.program,pe,E,M,Ie,Te.terrainData)),Ie.u_is_halo=0}Hl(we.buffers,Te.segments,n,u,we.program,pe,E,M,we.uniformValues,Te.terrainData)}}function Hl(u,t,n,a,l,h,_,x,b,I){const E=a.context;l.draw(E,E.gl.TRIANGLES,h,_,x,$t.disabled,b,I,n.id,u.layoutVertexBuffer,u.indexBuffer,t,n.paint,a.transform.zoom,u.programConfigurations.get(n.id),u.dynamicLayoutVertexBuffer,u.opacityVertexBuffer)}function Ia(u,t,n,a,l){if(!n||!a||!a.imageAtlas)return;const h=a.imageAtlas.patternPositions;let _=h[n.to.toString()],x=h[n.from.toString()];if(!_&&x&&(_=x),!x&&_&&(x=_),!_||!x){const b=l.getPaintProperty(t);_=h[b],x=h[b]}_&&x&&u.setConstantPatternPositions(_,x)}function Wl(u,t,n,a,l,h,_){const x=u.context.gl,b="fill-pattern",I=n.paint.get(b),E=I&&I.constantOr(1),M=n.getCrossfadeParameters();let B,j,q,H,U;_?(j=E&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",B=x.LINES):(j=E?"fillPattern":"fill",B=x.TRIANGLES);const Q=I.constantOr(null);for(const ue of a){const W=t.getTile(ue);if(E&&!W.patternsLoaded())continue;const ae=W.getBucket(n);if(!ae)continue;const pe=ae.programConfigurations.get(n.id),de=u.useProgram(j,pe),xe=u.style.map.terrain&&u.style.map.terrain.getTerrainData(ue);E&&(u.context.activeTexture.set(x.TEXTURE0),W.imageAtlasTexture.bind(x.LINEAR,x.CLAMP_TO_EDGE),pe.updatePaintBuffers(M)),Ia(pe,b,Q,W,n);const Te=xe?ue:null,we=u.translatePosMatrix(Te?Te.posMatrix:ue.posMatrix,W,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(_){H=ae.indexBuffer2,U=ae.segments2;const Ie=[x.drawingBufferWidth,x.drawingBufferHeight];q=j==="fillOutlinePattern"&&E?Pl(we,u,M,W,Ie):Xc(we,Ie)}else H=ae.indexBuffer,U=ae.segments,q=E?ca(we,u,M,W):Ml(we);de.draw(u.context,B,l,u.stencilModeForClipping(ue),h,$t.disabled,q,xe,n.id,ae.layoutVertexBuffer,H,U,n.paint,u.transform.zoom,pe)}}function Aa(u,t,n,a,l,h,_){const x=u.context,b=x.gl,I="fill-extrusion-pattern",E=n.paint.get(I),M=E.constantOr(1),B=n.getCrossfadeParameters(),j=n.paint.get("fill-extrusion-opacity"),q=E.constantOr(null);for(const H of a){const U=t.getTile(H),Q=U.getBucket(n);if(!Q)continue;const ue=u.style.map.terrain&&u.style.map.terrain.getTerrainData(H),W=Q.programConfigurations.get(n.id),ae=u.useProgram(M?"fillExtrusionPattern":"fillExtrusion",W);M&&(u.context.activeTexture.set(b.TEXTURE0),U.imageAtlasTexture.bind(b.LINEAR,b.CLAMP_TO_EDGE),W.updatePaintBuffers(B)),Ia(W,I,q,U,n);const pe=u.translatePosMatrix(H.posMatrix,U,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),de=n.paint.get("fill-extrusion-vertical-gradient"),xe=M?Wc(pe,u,de,j,H,B,U):As(pe,u,de,j);ae.draw(x,x.gl.TRIANGLES,l,h,_,$t.backCCW,xe,ue,n.id,Q.layoutVertexBuffer,Q.indexBuffer,Q.segments,n.paint,u.transform.zoom,W,u.style.map.terrain&&Q.centroidVertexBuffer)}}function Ca(u,t,n,a,l,h,_){const x=u.context,b=x.gl,I=n.fbo;if(!I)return;const E=u.useProgram("hillshade"),M=u.style.map.terrain&&u.style.map.terrain.getTerrainData(t);x.activeTexture.set(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,I.colorAttachment.get()),E.draw(x,b.TRIANGLES,l,h,_,$t.disabled,((B,j,q,H)=>{const U=q.paint.get("hillshade-shadow-color"),Q=q.paint.get("hillshade-highlight-color"),ue=q.paint.get("hillshade-accent-color");let W=q.paint.get("hillshade-illumination-direction")*(Math.PI/180);q.paint.get("hillshade-illumination-anchor")==="viewport"&&(W-=B.transform.angle);const ae=!B.options.moving;return{u_matrix:H?H.posMatrix:B.transform.calculatePosMatrix(j.tileID.toUnwrapped(),ae),u_image:0,u_latrange:Rl(0,j.tileID),u_light:[q.paint.get("hillshade-exaggeration"),W],u_shadow:U,u_highlight:Q,u_accent:ue}})(u,n,a,M?t:null),M,a.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments)}function ko(u,t,n,a,l,h){const _=u.context,x=_.gl,b=t.dem;if(b&&b.data){const I=b.dim,E=b.stride,M=b.getPixels();if(_.activeTexture.set(x.TEXTURE1),_.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||u.getTileTexture(E),t.demTexture){const j=t.demTexture;j.update(M,{premultiply:!1}),j.bind(x.NEAREST,x.CLAMP_TO_EDGE)}else t.demTexture=new Ze(_,M,x.RGBA,{premultiply:!1}),t.demTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE);_.activeTexture.set(x.TEXTURE0);let B=t.fbo;if(!B){const j=new Ze(_,{width:I,height:I,data:null},x.RGBA);j.bind(x.LINEAR,x.CLAMP_TO_EDGE),B=t.fbo=_.createFramebuffer(I,I,!0,!1),B.colorAttachment.set(j.texture)}_.bindFramebuffer.set(B.framebuffer),_.viewport.set([0,0,I,I]),u.useProgram("hillshadePrepare").draw(_,x.TRIANGLES,a,l,h,$t.disabled,((j,q)=>{const H=q.stride,U=c.F();return c.aN(U,0,c.W,-c.W,0,0,1),c.H(U,U,[0,-c.W,0]),{u_matrix:U,u_image:1,u_dimension:[H,H],u_zoom:j.overscaledZ,u_unpack:q.getUnpackVector()}})(t.tileID,b),null,n.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function Xl(u,t,n,a,l,h){const _=a.paint.get("raster-fade-duration");if(!h&&_>0){const x=X.now(),b=(x-u.timeAdded)/_,I=t?(x-t.timeAdded)/_:-1,E=n.getSource(),M=l.coveringZoomLevel({tileSize:E.tileSize,roundZoom:E.roundZoom}),B=!t||Math.abs(t.tileID.overscaledZ-M)>Math.abs(u.tileID.overscaledZ-M),j=B&&u.refreshedUponExpiration?1:c.ac(B?b:1-I,0,1);return u.refreshedUponExpiration&&b>=1&&(u.refreshedUponExpiration=!1),t?{opacity:1,mix:1-j}:{opacity:j,mix:0}}return{opacity:1,mix:0}}const Kl=new c.aO(1,0,0,1),ka=new c.aO(0,1,0,1),Eo=new c.aO(0,0,1,1),ou=new c.aO(1,0,1,1),Jl=new c.aO(0,1,1,1);function pi(u,t,n,a){or(u,0,t+n/2,u.transform.width,n,a)}function wn(u,t,n,a){or(u,t-n/2,0,n,u.transform.height,a)}function or(u,t,n,a,l,h){const _=u.context,x=_.gl;x.enable(x.SCISSOR_TEST),x.scissor(t*u.pixelRatio,n*u.pixelRatio,a*u.pixelRatio,l*u.pixelRatio),_.clear({color:h}),x.disable(x.SCISSOR_TEST)}function Mo(u,t,n){const a=u.context,l=a.gl,h=n.posMatrix,_=u.useProgram("debug"),x=zt.disabled,b=ti.disabled,I=u.colorModeForRenderPass(),E="$debug",M=u.style.map.terrain&&u.style.map.terrain.getTerrainData(n);a.activeTexture.set(l.TEXTURE0);const B=t.getTileByID(n.key).latestRawTileData,j=Math.floor((B&&B.byteLength||0)/1024),q=t.getTile(n).tileSize,H=512/Math.min(q,512)*(n.overscaledZ/u.transform.zoom)*.5;let U=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(U+=` => ${n.overscaledZ}`),function(Q,ue){Q.initDebugOverlayCanvas();const W=Q.debugOverlayCanvas,ae=Q.context.gl,pe=Q.debugOverlayCanvas.getContext("2d");pe.clearRect(0,0,W.width,W.height),pe.shadowColor="white",pe.shadowBlur=2,pe.lineWidth=1.5,pe.strokeStyle="white",pe.textBaseline="top",pe.font="bold 36px Open Sans, sans-serif",pe.fillText(ue,5,5),pe.strokeText(ue,5,5),Q.debugOverlayTexture.update(W),Q.debugOverlayTexture.bind(ae.LINEAR,ae.CLAMP_TO_EDGE)}(u,`${U} ${j}kB`),_.draw(a,l.TRIANGLES,x,b,vi.alphaBlended,$t.disabled,Dl(h,c.aO.transparent,H),null,E,u.debugBuffer,u.quadTriangleIndexBuffer,u.debugSegments),_.draw(a,l.LINE_STRIP,x,b,I,$t.disabled,Dl(h,c.aO.red),M,E,u.debugBuffer,u.tileBorderIndexBuffer,u.debugSegments)}function Ea(u,t,n){const a=u.context,l=a.gl,h=u.colorModeForRenderPass(),_=new zt(l.LEQUAL,zt.ReadWrite,u.depthRangeFor3D),x=u.useProgram("terrain"),b=t.getTerrainMesh();a.bindFramebuffer.set(null),a.viewport.set([0,0,u.width,u.height]);for(const I of n){const E=u.renderToTexture.getTexture(I),M=t.getTerrainData(I.tileID);a.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,E.texture);const B={u_matrix:u.transform.calculatePosMatrix(I.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(u.transform.zoom)};x.draw(a,l.TRIANGLES,_,ti.disabled,h,$t.backCCW,B,M,"terrain",b.vertexBuffer,b.indexBuffer,b.segments)}}class Yl{constructor(t,n){this.context=new au(t),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:c.F(),renderTime:0},this.setup(),this.numSublayers=Qi.maxUnderzooming+Qi.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new vn}resize(t,n,a){if(this.width=Math.floor(t*a),this.height=Math.floor(n*a),this.pixelRatio=a,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const l of this.style._order)this.style._layers[l].resize()}setup(){const t=this.context,n=new c.aV;n.emplaceBack(0,0),n.emplaceBack(c.W,0),n.emplaceBack(0,c.W),n.emplaceBack(c.W,c.W),this.tileExtentBuffer=t.createVertexBuffer(n,aa.members),this.tileExtentSegments=c.$.simpleSegment(0,0,4,2);const a=new c.aV;a.emplaceBack(0,0),a.emplaceBack(c.W,0),a.emplaceBack(0,c.W),a.emplaceBack(c.W,c.W),this.debugBuffer=t.createVertexBuffer(a,aa.members),this.debugSegments=c.$.simpleSegment(0,0,4,5);const l=new c.Z;l.emplaceBack(0,0,0,0),l.emplaceBack(c.W,0,c.W,0),l.emplaceBack(0,c.W,0,c.W),l.emplaceBack(c.W,c.W,c.W,c.W),this.rasterBoundsBuffer=t.createVertexBuffer(l,Xi.members),this.rasterBoundsSegments=c.$.simpleSegment(0,0,4,2);const h=new c.aV;h.emplaceBack(0,0),h.emplaceBack(1,0),h.emplaceBack(0,1),h.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(h,aa.members),this.viewportSegments=c.$.simpleSegment(0,0,4,2);const _=new c.aW;_.emplaceBack(0),_.emplaceBack(1),_.emplaceBack(3),_.emplaceBack(2),_.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(_);const x=new c.aX;x.emplaceBack(0,1,2),x.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(x);const b=this.context.gl;this.stencilClearMode=new ti({func:b.ALWAYS,mask:0},0,255,b.ZERO,b.ZERO,b.ZERO)}clearStencil(){const t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const a=c.F();c.aN(a,0,this.width,this.height,0,0,1),c.J(a,a,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,n.TRIANGLES,zt.disabled,this.stencilClearMode,vi.disabled,$t.disabled,ua(a),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,n){if(this.currentStencilSource===t.source||!t.isTileClipped()||!n||!n.length)return;this.currentStencilSource=t.source;const a=this.context,l=a.gl;this.nextStencilID+n.length>256&&this.clearStencil(),a.setColorMode(vi.disabled),a.setDepthMode(zt.disabled);const h=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const _ of n){const x=this._tileClippingMaskIDs[_.key]=this.nextStencilID++,b=this.style.map.terrain&&this.style.map.terrain.getTerrainData(_);h.draw(a,l.TRIANGLES,zt.disabled,new ti({func:l.ALWAYS,mask:0},x,255,l.KEEP,l.KEEP,l.REPLACE),vi.disabled,$t.disabled,ua(_.posMatrix),b,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,n=this.context.gl;return new ti({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){const n=this.context.gl;return new ti({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(t){const n=this.context.gl,a=t.sort((_,x)=>x.overscaledZ-_.overscaledZ),l=a[a.length-1].overscaledZ,h=a[0].overscaledZ-l+1;if(h>1){this.currentStencilSource=void 0,this.nextStencilID+h>256&&this.clearStencil();const _={};for(let x=0;x=0;this.currentLayer--){const b=this.style._layers[a[this.currentLayer]],I=l[b.source],E=h[b.source];this._renderTileClippingMasks(b,E),this.renderLayer(this,I,b,E)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerU.source&&!U.isHidden(E)?[I.sourceCaches[U.source]]:[]),j=B.filter(U=>U.getSource().type==="vector"),q=B.filter(U=>U.getSource().type!=="vector"),H=U=>{(!M||M.getSource().maxzoomH(U)),M||q.forEach(U=>H(U)),M}(this.style,this.transform.zoom);b&&function(I,E,M){for(let B=0;Bj.style.map.terrain.getElevation(de,Qe,Ve):null)}}}(b,h,x,_,x.layout.get("text-rotation-alignment"),x.layout.get("text-pitch-alignment"),I),x.paint.get("icon-opacity").constantOr(1)!==0&&Sa(h,_,x,b,!1,x.paint.get("icon-translate"),x.paint.get("icon-translate-anchor"),x.layout.get("icon-rotation-alignment"),x.layout.get("icon-pitch-alignment"),x.layout.get("icon-keep-upright"),E,M),x.paint.get("text-opacity").constantOr(1)!==0&&Sa(h,_,x,b,!0,x.paint.get("text-translate"),x.paint.get("text-translate-anchor"),x.layout.get("text-rotation-alignment"),x.layout.get("text-pitch-alignment"),x.layout.get("text-keep-upright"),E,M),_.map.showCollisionBoxes&&(ba(h,_,x,b,x.paint.get("text-translate"),x.paint.get("text-translate-anchor"),!0),ba(h,_,x,b,x.paint.get("icon-translate"),x.paint.get("icon-translate-anchor"),!1))})(t,n,a,l,this.style.placement.variableOffsets);break;case"circle":(function(h,_,x,b){if(h.renderPass!=="translucent")return;const I=x.paint.get("circle-opacity"),E=x.paint.get("circle-stroke-width"),M=x.paint.get("circle-stroke-opacity"),B=!x.layout.get("circle-sort-key").isConstant();if(I.constantOr(1)===0&&(E.constantOr(1)===0||M.constantOr(1)===0))return;const j=h.context,q=j.gl,H=h.depthModeForSublayer(0,zt.ReadOnly),U=ti.disabled,Q=h.colorModeForRenderPass(),ue=[];for(let W=0;WW.sortKey-ae.sortKey);for(const W of ue){const{programConfiguration:ae,program:pe,layoutVertexBuffer:de,indexBuffer:xe,uniformValues:Te,terrainData:we}=W.state;pe.draw(j,q.TRIANGLES,H,U,Q,$t.disabled,Te,we,x.id,de,xe,W.segments,x.paint,h.transform.zoom,ae)}})(t,n,a,l);break;case"heatmap":(function(h,_,x,b){if(x.paint.get("heatmap-opacity")!==0)if(h.renderPass==="offscreen"){const I=h.context,E=I.gl,M=ti.disabled,B=new vi([E.ONE,E.ONE],c.aO.transparent,[!0,!0,!0,!0]);(function(j,q,H){const U=j.gl;j.activeTexture.set(U.TEXTURE1),j.viewport.set([0,0,q.width/4,q.height/4]);let Q=H.heatmapFbo;if(Q)U.bindTexture(U.TEXTURE_2D,Q.colorAttachment.get()),j.bindFramebuffer.set(Q.framebuffer);else{const ue=U.createTexture();U.bindTexture(U.TEXTURE_2D,ue),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_WRAP_S,U.CLAMP_TO_EDGE),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_WRAP_T,U.CLAMP_TO_EDGE),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_MIN_FILTER,U.LINEAR),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_MAG_FILTER,U.LINEAR),Q=H.heatmapFbo=j.createFramebuffer(q.width/4,q.height/4,!1,!1),function(W,ae,pe,de){var xe,Te;const we=W.gl,Ie=(xe=W.HALF_FLOAT)!==null&&xe!==void 0?xe:we.UNSIGNED_BYTE,Fe=(Te=W.RGBA16F)!==null&&Te!==void 0?Te:we.RGBA;we.texImage2D(we.TEXTURE_2D,0,Fe,ae.width/4,ae.height/4,0,we.RGBA,Ie,null),de.colorAttachment.set(pe)}(j,q,ue,Q)}})(I,h,x),I.clear({color:c.aO.transparent});for(let j=0;j{const W=c.F();c.aN(W,0,H.width,H.height,0,0,1);const ae=H.context.gl;return{u_matrix:W,u_world:[ae.drawingBufferWidth,ae.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:U.paint.get("heatmap-opacity")}})(I,E),null,E.id,I.viewportBuffer,I.quadTriangleIndexBuffer,I.viewportSegments,E.paint,I.transform.zoom)}(h,x))})(t,n,a,l);break;case"line":(function(h,_,x,b){if(h.renderPass!=="translucent")return;const I=x.paint.get("line-opacity"),E=x.paint.get("line-width");if(I.constantOr(1)===0||E.constantOr(1)===0)return;const M=h.depthModeForSublayer(0,zt.ReadOnly),B=h.colorModeForRenderPass(),j=x.paint.get("line-dasharray"),q=x.paint.get("line-pattern"),H=q.constantOr(1),U=x.paint.get("line-gradient"),Q=x.getCrossfadeParameters(),ue=H?"linePattern":j?"lineSDF":U?"lineGradient":"line",W=h.context,ae=W.gl;let pe=!0;for(const de of b){const xe=_.getTile(de);if(H&&!xe.patternsLoaded())continue;const Te=xe.getBucket(x);if(!Te)continue;const we=Te.programConfigurations.get(x.id),Ie=h.context.program.get(),Fe=h.useProgram(ue,we),$e=pe||Fe.program!==Ie,Pe=h.style.map.terrain&&h.style.map.terrain.getTerrainData(de),Qe=q.constantOr(null);if(Qe&&xe.imageAtlas){const Tt=xe.imageAtlas,gt=Tt.patternPositions[Qe.to.toString()],St=Tt.patternPositions[Qe.from.toString()];gt&&St&&we.setConstantPatternPositions(gt,St)}const Ve=Pe?de:null,ri=H?Dn(h,xe,x,Q,Ve):j?da(h,xe,x,j,Q,Ve):U?Bl(h,xe,x,Te.lineClipsArray.length,Ve):ha(h,xe,x,Ve);if(H)W.activeTexture.set(ae.TEXTURE0),xe.imageAtlasTexture.bind(ae.LINEAR,ae.CLAMP_TO_EDGE),we.updatePaintBuffers(Q);else if(j&&($e||h.lineAtlas.dirty))W.activeTexture.set(ae.TEXTURE0),h.lineAtlas.bind(W);else if(U){const Tt=Te.gradients[x.id];let gt=Tt.texture;if(x.gradientVersion!==Tt.version){let St=256;if(x.stepInterpolant){const wi=_.getSource().maxzoom,Kt=de.canonical.z===wi?Math.ceil(1<0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const n=this.imageManager.getPattern(t.from.toString()),a=this.imageManager.getPattern(t.to.toString());return!n||!a}useProgram(t,n){this.cache=this.cache||{};const a=t+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[a]||(this.cache[a]=new bn(this.context,Is[t],n,Fl[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[a]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const 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 Ze(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:n}=this.context.gl;return this.width!==t||this.height!==n}}class Tn{constructor(t,n){this.points=t,this.planes=n}static fromInvProjectionMatrix(t,n,a){const l=Math.pow(2,a),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(x=>{const b=1/(x=c.af([],x,t))[3]/n*l;return c.a_(x,x,[b,b,1/x[3],b])}),_=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(x=>{const b=function(B,j){var q=j[0],H=j[1],U=j[2],Q=q*q+H*H+U*U;return Q>0&&(Q=1/Math.sqrt(Q)),B[0]=j[0]*Q,B[1]=j[1]*Q,B[2]=j[2]*Q,B}([],function(B,j,q){var H=j[0],U=j[1],Q=j[2],ue=q[0],W=q[1],ae=q[2];return B[0]=U*ae-Q*W,B[1]=Q*ue-H*ae,B[2]=H*W-U*ue,B}([],ct([],h[x[0]],h[x[1]]),ct([],h[x[2]],h[x[1]]))),I=-((E=b)[0]*(M=h[x[1]])[0]+E[1]*M[1]+E[2]*M[2]);var E,M;return b.concat(I)});return new Tn(h,_)}}class Sn{constructor(t,n){this.min=t,this.max=n,this.center=function(a,l,h){return a[0]=.5*l[0],a[1]=.5*l[1],a[2]=.5*l[2],a}([],function(a,l,h){return a[0]=l[0]+h[0],a[1]=l[1]+h[1],a[2]=l[2]+h[2],a}([],this.min,this.max))}quadrant(t){const n=[t%2==0,t<2],a=Ke(this.min),l=Ke(this.max);for(let h=0;h=0&&_++;if(_===0)return 0;_!==n.length&&(a=!1)}if(a)return 2;for(let l=0;l<3;l++){let h=Number.MAX_VALUE,_=-Number.MAX_VALUE;for(let x=0;xthis.max[l]-this.min[l])return 0}return 1}}class os{constructor(t=0,n=0,a=0,l=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(a)||a<0||isNaN(l)||l<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=a,this.right=l}interpolate(t,n,a){return n.top!=null&&t.top!=null&&(this.top=c.z.number(t.top,n.top,a)),n.bottom!=null&&t.bottom!=null&&(this.bottom=c.z.number(t.bottom,n.bottom,a)),n.left!=null&&t.left!=null&&(this.left=c.z.number(t.left,n.left,a)),n.right!=null&&t.right!=null&&(this.right=c.z.number(t.right,n.right,a)),this}getCenter(t,n){const a=c.ac((this.left+t-this.right)/2,0,t),l=c.ac((this.top+n-this.bottom)/2,0,n);return new c.P(a,l)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new os(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Ma{constructor(t,n,a,l,h){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=h===void 0||!!h,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=a??0,this._maxPitch=l??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new c.M(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new os,this._posMatrixCache={},this._alignedPosMatrixCache={},this.minElevationForCurrentTile=0}clone(){const t=new Ma(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.minElevationForCurrentTile=t.minElevationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new c.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const n=-c.b0(t,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=function(){var a=new c.A(4);return c.A!=Float32Array&&(a[1]=0,a[2]=0),a[0]=1,a[3]=1,a}(),function(a,l,h){var _=l[0],x=l[1],b=l[2],I=l[3],E=Math.sin(h),M=Math.cos(h);a[0]=_*M+b*E,a[1]=x*M+I*E,a[2]=_*-E+b*M,a[3]=x*-E+I*M}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const n=c.ac(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const n=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.tileZoom=Math.max(0,Math.floor(n)),this.scale=this.zoomScale(n),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,n,a){this._unmodified=!1,this._edgeInsets.interpolate(t,n,a),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const n=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(t){const n=[new c.b1(0,t)];if(this._renderWorldCopies){const a=this.pointCoordinate(new c.P(0,0)),l=this.pointCoordinate(new c.P(this.width,0)),h=this.pointCoordinate(new c.P(this.width,this.height)),_=this.pointCoordinate(new c.P(0,this.height)),x=Math.floor(Math.min(a.x,l.x,h.x,_.x)),b=Math.floor(Math.max(a.x,l.x,h.x,_.x)),I=1;for(let E=x-I;E<=b+I;E++)E!==0&&n.push(new c.b1(E,t))}return n}coveringTiles(t){var n,a;let l=this.coveringZoomLevel(t);const h=l;if(t.minzoom!==void 0&&lt.maxzoom&&(l=t.maxzoom);const _=this.pointCoordinate(this.getCameraPoint()),x=c.Y.fromLngLat(this.center),b=Math.pow(2,l),I=[b*_.x,b*_.y,0],E=[b*x.x,b*x.y,0],M=Tn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,l);let B=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(B=l);const j=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,q=W=>({aabb:new Sn([W*b,0,0],[(W+1)*b,b,0]),zoom:0,x:0,y:0,wrap:W,fullyVisible:!1}),H=[],U=[],Q=l,ue=t.reparseOverscaled?h:l;if(this._renderWorldCopies)for(let W=1;W<=3;W++)H.push(q(-W)),H.push(q(W));for(H.push(q(0));H.length>0;){const W=H.pop(),ae=W.x,pe=W.y;let de=W.fullyVisible;if(!de){const Fe=W.aabb.intersects(M);if(Fe===0)continue;de=Fe===2}const xe=t.terrain?I:E,Te=W.aabb.distanceX(xe),we=W.aabb.distanceY(xe),Ie=Math.max(Math.abs(Te),Math.abs(we));if(W.zoom===Q||Ie>j+(1<=B){const Fe=Q-W.zoom,$e=I[0]-.5-(ae<>1),Qe=W.zoom+1;let Ve=W.aabb.quadrant(Fe);if(t.terrain){const ri=new c.Q(Qe,W.wrap,Qe,$e,Pe),Tt=t.terrain.getMinMaxElevation(ri),gt=(n=Tt.minElevation)!==null&&n!==void 0?n:this.elevation,St=(a=Tt.maxElevation)!==null&&a!==void 0?a:this.elevation;Ve=new Sn([Ve.min[0],Ve.min[1],gt],[Ve.max[0],Ve.max[1],St])}H.push({aabb:Ve,zoom:Qe,x:$e,y:Pe,wrap:W.wrap,fullyVisible:de})}}return U.sort((W,ae)=>W.distanceSq-ae.distanceSq).map(W=>W.tileID)}resize(t,n){this.width=t,this.height=n,this.pixelsToGLUnits=[2/t,-2/n],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 n=c.ac(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new c.P(c.N(t.lng)*this.worldSize,c.O(n)*this.worldSize)}unproject(t){return new c.Y(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){const n=this.pointLocation(this.centerPoint,t),a=t.getElevationForLngLatZoom(n,this.tileZoom);if(!(this.elevation-a))return;const l=this.getCameraPosition(),h=c.Y.fromLngLat(l.lngLat,l.altitude),_=c.Y.fromLngLat(n,a),x=h.x-_.x,b=h.y-_.y,I=h.z-_.z,E=Math.sqrt(x*x+b*b+I*I),M=this.scaleZoom(this.cameraToCenterDistance/E/this.tileSize);this._elevation=a,this._center=n,this.zoom=M}setLocationAtPoint(t,n){const a=this.pointCoordinate(n),l=this.pointCoordinate(this.centerPoint),h=this.locationCoordinate(t),_=new c.Y(h.x-(a.x-l.x),h.y-(a.y-l.y));this.center=this.coordinateLocation(_),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,n){return n?this.coordinatePoint(this.locationCoordinate(t),n.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,n){return this.coordinateLocation(this.pointCoordinate(t,n))}locationCoordinate(t){return c.Y.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,n){if(n){const B=n.pointCoordinate(t);if(B!=null)return B}const a=[t.x,t.y,0,1],l=[t.x,t.y,1,1];c.af(a,a,this.pixelMatrixInverse),c.af(l,l,this.pixelMatrixInverse);const h=a[3],_=l[3],x=a[1]/h,b=l[1]/_,I=a[2]/h,E=l[2]/_,M=I===E?0:(0-I)/(E-I);return new c.Y(c.z.number(a[0]/h,l[0]/_,M)/this.worldSize,c.z.number(x,b,M)/this.worldSize)}coordinatePoint(t,n=0,a=this.pixelMatrix){const l=[t.x*this.worldSize,t.y*this.worldSize,n,1];return c.af(l,l,a),new c.P(l[0]/l[3],l[1]/l[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return new jt().extend(this.pointLocation(new c.P(0,t))).extend(this.pointLocation(new c.P(this.width,t))).extend(this.pointLocation(new c.P(this.width,this.height))).extend(this.pointLocation(new c.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new jt([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(t,n=!1){const a=t.key,l=n?this._alignedPosMatrixCache:this._posMatrixCache;if(l[a])return l[a];const h=t.canonical,_=this.worldSize/this.zoomScale(h.z),x=h.x+Math.pow(2,h.z)*t.wrap,b=c.an(new Float64Array(16));return c.H(b,b,[x*_,h.y*_,0]),c.J(b,b,[_/c.W,_/c.W,1]),c.K(b,n?this.alignedProjMatrix:this.projMatrix,b),l[a]=new Float32Array(b),l[a]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t,n,a,l,h=-90,_=90,x=-180,b=180;const I=this.size,E=this._unmodified;if(this.latRange){const j=this.latRange;h=c.O(j[1])*this.worldSize,_=c.O(j[0])*this.worldSize,t=_-h_&&(l=_-q)}if(this.lngRange){const j=(x+b)/2,q=c.b0(M.x,j-this.worldSize/2,j+this.worldSize/2),H=I.x/2;q-Hb&&(a=b-H)}a===void 0&&l===void 0||(this.center=this.unproject(new c.P(a!==void 0?a:M.x,l!==void 0?l:M.y)).wrap()),this._unmodified=E,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,n=this.point.x,a=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=c.b2(1,this.center.lat)*this.worldSize;let l=c.an(new Float64Array(16));c.J(l,l,[this.width/2,-this.height/2,1]),c.H(l,l,[1,-1,0]),this.labelPlaneMatrix=l,l=c.an(new Float64Array(16)),c.J(l,l,[1,-1,1]),c.H(l,l,[-1,-1,0]),c.J(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l;const h=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),_=Math.min(this.elevation,this.minElevationForCurrentTile),x=h-_*this._pixelPerMeter/Math.cos(this._pitch),b=_<0?x:h,I=Math.PI/2+this._pitch,E=this._fov*(.5+t.y/this.height),M=Math.sin(E)*b/Math.sin(c.ac(Math.PI-I-E,.01,Math.PI-.01)),B=this.getHorizon(),j=2*Math.atan(B/this.cameraToCenterDistance)*(.5+t.y/(2*B)),q=Math.sin(j)*b/Math.sin(c.ac(Math.PI-I-j,.01,Math.PI-.01)),H=Math.min(M,q),U=1.01*(Math.cos(Math.PI/2-this._pitch)*H+b),Q=this.height/50;l=new Float64Array(16),c.b3(l,this._fov,this.width/this.height,Q,U),l[8]=2*-t.x/this.width,l[9]=2*t.y/this.height,c.J(l,l,[1,-1,1]),c.H(l,l,[0,0,-this.cameraToCenterDistance]),c.b4(l,l,this._pitch),c.ad(l,l,this.angle),c.H(l,l,[-n,-a,0]),this.mercatorMatrix=c.J([],l,[this.worldSize,this.worldSize,this.worldSize]),c.J(l,l,[1,1,this._pixelPerMeter]),this.pixelMatrix=c.K(new Float64Array(16),this.labelPlaneMatrix,l),c.H(l,l,[0,0,-this.elevation]),this.projMatrix=l,this.invProjMatrix=c.ar([],l),this.pixelMatrix3D=c.K(new Float64Array(16),this.labelPlaneMatrix,l);const ue=this.width%2/2,W=this.height%2/2,ae=Math.cos(this.angle),pe=Math.sin(this.angle),de=n-Math.round(n)+ae*ue+pe*W,xe=a-Math.round(a)+ae*W+pe*ue,Te=new Float64Array(l);if(c.H(Te,Te,[de>.5?de-1:de,xe>.5?xe-1:xe,0]),this.alignedProjMatrix=Te,l=c.ar(new Float64Array(16),this.pixelMatrix),!l)throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new c.P(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return c.af(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new c.P(0,t))}getCameraQueryGeometry(t){const n=this.getCameraPoint();if(t.length===1)return[t[0],n];{let a=n.x,l=n.y,h=n.x,_=n.y;for(const x of t)a=Math.min(a,x.x),l=Math.min(l,x.y),h=Math.max(h,x.x),_=Math.max(_,x.y);return[new c.P(a,l),new c.P(h,l),new c.P(h,_),new c.P(a,_),new c.P(a,l)]}}lngLatToCameraDepth(t,n){const a=this.locationCoordinate(t),l=[a.x*this.worldSize,a.y*this.worldSize,n,1];return c.af(l,l,this.projMatrix),l[2]/l[3]}}function Po(u,t){let n,a=!1,l=null,h=null;const _=()=>{l=null,a&&(u.apply(h,n),l=setTimeout(_,t),a=!1)};return(...x)=>(a=!0,h=this,n=x,l||_(),l)}class zo{constructor(t){this._getCurrentHash=()=>{const n=window.location.hash.replace("#","");if(this._hashName){let a;return n.split("&").map(l=>l.split("=")).forEach(l=>{l[0]===this._hashName&&(a=l)}),(a&&a[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{const n=this._getCurrentHash();if(n.length>=3&&!n.some(a=>isNaN(a))){const a=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:a,pitch:+(n[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const n=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,n)}catch{}},this._updateHash=Po(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(t){const n=this._map.getCenter(),a=Math.round(100*this._map.getZoom())/100,l=Math.ceil((a*Math.LN2+Math.log(512/360/.5))/Math.LN10),h=Math.pow(10,l),_=Math.round(n.lng*h)/h,x=Math.round(n.lat*h)/h,b=this._map.getBearing(),I=this._map.getPitch();let E="";if(E+=t?`/${_}/${x}/${a}`:`${a}/${x}/${_}`,(b||I)&&(E+="/"+Math.round(10*b)/10),I&&(E+=`/${Math.round(I)}`),this._hashName){const M=this._hashName;let B=!1;const j=window.location.hash.slice(1).split("&").map(q=>{const H=q.split("=")[0];return H===M?(B=!0,`${H}=${E}`):q}).filter(q=>q);return B||j.push(`${M}=${E}`),`#${j.join("&")}`}return`#${E}`}}const Ds={linearity:.3,easing:c.b5(0,0,.3,1)},Ql=c.e({deceleration:2500,maxSpeed:1400},Ds),Fn=c.e({deceleration:20,maxSpeed:1400},Ds),$l=c.e({deceleration:1e3,maxSpeed:360},Ds),ec=c.e({deceleration:1e3,maxSpeed:90},Ds);class tc{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:X.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,n=X.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new c.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:h}of this._inertiaBuffer)n.zoom+=h.zoomDelta||0,n.bearing+=h.bearingDelta||0,n.pitch+=h.pitchDelta||0,h.panDelta&&n.pan._add(h.panDelta),h.around&&(n.around=h.around),h.pinchAround&&(n.pinchAround=h.pinchAround);const a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};if(n.pan.mag()){const h=Rs(n.pan.mag(),a,c.e({},Ql,t||{}));l.offset=n.pan.mult(h.amount/n.pan.mag()),l.center=this._map.transform.center,Ls(l,h)}if(n.zoom){const h=Rs(n.zoom,a,Fn);l.zoom=this._map.transform.zoom+h.amount,Ls(l,h)}if(n.bearing){const h=Rs(n.bearing,a,$l);l.bearing=this._map.transform.bearing+c.ac(h.amount,-179,179),Ls(l,h)}if(n.pitch){const h=Rs(n.pitch,a,ec);l.pitch=this._map.transform.pitch+h.amount,Ls(l,h)}if(l.zoom||l.bearing){const h=n.pinchAround===void 0?n.around:n.pinchAround;l.around=h?this._map.unproject(h):this._map.getCenter()}return this.clear(),c.e(l,{noMoveStart:!0})}}function Ls(u,t){(!u.duration||u.durationn.unproject(b)),x=h.reduce((b,I,E,M)=>b.add(I.div(M.length)),new c.P(0,0));super(t,{points:h,point:x,lngLats:_,lngLat:n.unproject(x),originalEvent:a}),this._defaultPrevented=!1}}class On extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,a){super(t,{originalEvent:a}),this._defaultPrevented=!1}}class ic{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new On(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new yr(t.type,this._map,t))}mouseup(t){this._map.fire(new yr(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new yr(t.type,this._map,t))}dblclick(t){return this._firePreventable(new yr(t.type,this._map,t))}mouseover(t){this._map.fire(new yr(t.type,this._map,t))}mouseout(t){this._map.fire(new yr(t.type,this._map,t))}touchstart(t){return this._firePreventable(new ls(t.type,this._map,t))}touchmove(t){this._map.fire(new ls(t.type,this._map,t))}touchend(t){this._map.fire(new ls(t.type,this._map,t))}touchcancel(t){this._map.fire(new ls(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class jr{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new yr(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new yr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new yr(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class xr{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(c.P.convert(t),this._map.terrain)}}class Do{constructor(t,n){this._map=t,this._tr=new xr(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&t.button===0&&($.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;const a=n;if(this._lastPos.equals(a)||!this._box&&a.dist(this._startPos)h.fitScreenCoordinates(a,l,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&($.remove(this._box),this._box=null),$.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new c.k(t,{originalEvent:n}))}}function Vr(u,t){if(u.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${u.length}, points ${t.length}`);const n={};for(let a=0;athis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),a.length===this.numTouches&&(this.centroid=function(l){const h=new c.P(0,0);for(const _ of l)h._add(_);return h.div(l.length)}(n),this.touches=Vr(a,n)))}touchmove(t,n,a){if(this.aborted||!this.centroid)return;const l=Vr(a,n);for(const h in this.touches){const _=l[h];(!_||_.dist(this.touches[h])>30)&&(this.aborted=!0)}}touchend(t,n,a){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),a.length===0){const l=!this.aborted&&this.centroid;if(this.reset(),l)return l}}}class Lo{constructor(t){this.singleTap=new Bs(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,a){this.singleTap.touchstart(t,n,a)}touchmove(t,n,a){this.singleTap.touchmove(t,n,a)}touchend(t,n,a){const l=this.singleTap.touchend(t,n,a);if(l){const h=t.timeStamp-this.lastTime<500,_=!this.lastTap||this.lastTap.dist(l)<30;if(h&&_||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=l,this.count===this.numTaps)return this.reset(),l}}}class lu{constructor(t){this._tr=new xr(t),this._zoomIn=new Lo({numTouches:1,numTaps:2}),this._zoomOut=new Lo({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,a){this._zoomIn.touchstart(t,n,a),this._zoomOut.touchstart(t,n,a)}touchmove(t,n,a){this._zoomIn.touchmove(t,n,a),this._zoomOut.touchmove(t,n,a)}touchend(t,n,a){const l=this._zoomIn.touchend(t,n,a),h=this._zoomOut.touchend(t,n,a),_=this._tr;return l?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:x=>x.easeTo({duration:300,zoom:_.zoom+1,around:_.unproject(l)},{originalEvent:t})}):h?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:x=>x.easeTo({duration:300,zoom:_.zoom-1,around:_.unproject(h)},{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}}class Fs{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;const a=this._lastPoint;if(!a)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const l=n.length?n[0]:n;return!this._moved&&l.dist(a){u.mousedown=u.dragStart,u.mousemoveWindow=u.dragMove,u.mouseup=u.dragEnd,u.contextmenu=function(t){t.preventDefault()}},Ro=({enable:u,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>{const a=new Vn({checkCorrectEvent:l=>$.mouseButton(l)===0&&l.ctrlKey||$.mouseButton(l)===2});return new Fs({clickTolerance:t,move:(l,h)=>({bearingDelta:(h.x-l.x)*n}),moveStateManager:a,enable:u,assignEvents:Be})},cs=({enable:u,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>{const a=new Vn({checkCorrectEvent:l=>$.mouseButton(l)===0&&l.ctrlKey||$.mouseButton(l)===2});return new Fs({clickTolerance:t,move:(l,h)=>({pitchDelta:(h.y-l.y)*n}),moveStateManager:a,enable:u,assignEvents:Be})};class Os{constructor(t,n){this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new c.P(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(t,n,a){return this._calculateTransform(t,n,a)}touchmove(t,n,a){if(this._active&&!(a.length0&&(this._active=!0);const l=Vr(a,n),h=new c.P(0,0),_=new c.P(0,0);let x=0;for(const I in l){const E=l[I],M=this._touches[I];M&&(h._add(E),_._add(E.sub(M)),x++,l[I]=E)}if(this._touches=l,xMath.abs(u.x)}class Bo extends Pa{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,a){super.touchstart(t,n,a),this._currentTouchCount=a.length}_start(t){this._lastPoints=t,La(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,a){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const l=t[0].sub(this._lastPoints[0]),h=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(l,h,a.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(l.y+h.y)/2*-.5}):void 0}gestureBeginsVertically(t,n,a){if(this._valid!==void 0)return this._valid;const l=t.mag()>=2,h=n.mag()>=2;if(!l&&!h)return;if(!l||!h)return this._firstMove===void 0&&(this._firstMove=a),a-this._firstMove<100&&void 0;const _=t.y>0==n.y>0;return La(t)&&La(n)&&_}}const cu={panStep:100,bearingStep:15,pitchStep:10};class ac{constructor(t){this._tr=new xr(t);const n=cu;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,a=0,l=0,h=0,_=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?a=-1:(t.preventDefault(),h=-1);break;case 39:t.shiftKey?a=1:(t.preventDefault(),h=1);break;case 38:t.shiftKey?l=1:(t.preventDefault(),_=-1);break;case 40:t.shiftKey?l=-1:(t.preventDefault(),_=1);break;default:return}return this._rotationDisabled&&(a=0,l=0),{cameraAnimation:x=>{const b=this._tr;x.easeTo({duration:300,easeId:"keyboardHandler",easing:Un,zoom:n?Math.round(b.zoom)+n*(t.shiftKey?2:1):b.zoom,bearing:b.bearing+a*this._bearingStep,pitch:b.pitch+l*this._pitchStep,offset:[-h*this._panStep,-_*this._panStep],center:b.center},{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 Un(u){return u*(2-u)}const ii=4.000244140625;class Vs{constructor(t,n){this._onTimeout=a=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(a)},this._map=t,this._tr=new xr(t),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}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")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(t){if(!this.isEnabled()||this._map.cooperativeGestures.isEnabled()&&!t[this._map.cooperativeGestures._bypassKey])return;let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const a=X.now(),l=a-(this._lastWheelEventTime||0);this._lastWheelEventTime=a,n!==0&&n%ii==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":l>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(l*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_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 n=$.mousePos(this._map.getCanvas(),t),a=this._tr;this._around=n.y>a.transform.height/2-a.transform.getHorizon()?c.M.convert(this._aroundCenter?a.center:a.unproject(n)):c.M.convert(a.center),this._aroundPoint=a.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._tr.transform;if(this._delta!==0){const x=this._type==="wheel"&&Math.abs(this._delta)>ii?this._wheelZoomRate:this._defaultZoomRate;let b=2/(1+Math.exp(-Math.abs(this._delta*x)));this._delta<0&&b!==0&&(b=1/b);const I=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(I*b))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,a=this._startZoom,l=this._easing;let h,_=!1;if(this._type==="wheel"&&a&&l){const x=Math.min((X.now()-this._lastWheelEventTime)/200,1),b=l(x);h=c.z.number(a,n,b),x<1?this._frameId||(this._frameId=!0):_=!0}else h=n,_=!0;return this._active=!0,_&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!_,zoomDelta:h-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=c.b6;if(this._prevEase){const a=this._prevEase,l=(X.now()-a.start)/a.duration,h=a.easing(l+.01)-a.easing(l),_=.27/Math.sqrt(h*h+1e-4)*.01,x=Math.sqrt(.0729-_*_);n=c.b5(_,x,.25,1)}return this._prevEase={start:X.now(),duration:t,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Ra{constructor(t,n){this._clickZoom=t,this._tapZoom=n}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 oc{constructor(t){this._tr=new xr(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:a=>{a.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class lc{constructor(){this._tap=new Lo({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,n,a){if(!this._swipePoint)if(this._tapTime){const l=n[0],h=t.timeStamp-this._tapTime<500,_=this._tapPoint.dist(l)<30;h&&_?a.length>0&&(this._swipePoint=l,this._swipeTouch=a[0].identifier):this.reset()}else this._tap.touchstart(t,n,a)}touchmove(t,n,a){if(this._tapTime){if(this._swipePoint){if(a[0].identifier!==this._swipeTouch)return;const l=n[0],h=l.y-this._swipePoint.y;return this._swipePoint=l,t.preventDefault(),this._active=!0,{zoomDelta:h/128}}}else this._tap.touchmove(t,n,a)}touchend(t,n,a){if(this._tapTime)this._swipePoint&&a.length===0&&this.reset();else{const l=this._tap.touchend(t,n,a);l&&(this._tapTime=t.timeStamp,this._tapPoint=l)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Fo{constructor(t,n,a){this._el=t,this._mousePan=n,this._touchPan=a}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class cc{constructor(t,n,a){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=n,this._mousePitch=a}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 qr{constructor(t,n,a,l){this._el=t,this._touchZoom=n,this._touchRotate=a,this._tapDragZoom=l,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("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Us{constructor(t,n){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=t,this._options=n,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=$.create("div","maplibregl-cooperative-gesture-screen",t);let n=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(n=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const a=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),l=document.createElement("div");l.className="maplibregl-desktop-message",l.textContent=n,this._container.appendChild(l);const h=document.createElement("div");h.className="maplibregl-mobile-message",h.textContent=a,this._container.appendChild(h),this._container.setAttribute("aria-hidden","true")}_destoryUI(){this._container&&($.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destoryUI()}isEnabled(){return this._enabled}touchmove(t){this._onCooperativeGesture(t.touches.length===1)}wheel(t){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!t[this._bypassKey])}_onCooperativeGesture(t){this._enabled&&t&&(this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Ne=u=>u.zoom||u.drag||u.pitch||u.rotate;class tt extends c.k{}function us(u){return u.panDelta&&u.panDelta.mag()||u.zoomDelta||u.bearingDelta||u.pitchDelta}class Oo{constructor(t,n){this.handleWindowEvent=l=>{this.handleEvent(l,`${l.type}Window`)},this.handleEvent=(l,h)=>{if(l.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const _=l.type==="renderFrame"?void 0:l,x={needsRenderFrame:!1},b={},I={},E=l.touches,M=E?this._getMapTouches(E):void 0,B=M?$.touchPos(this._map.getCanvas(),M):$.mousePos(this._map.getCanvas(),l);for(const{handlerName:H,handler:U,allowed:Q}of this._handlers){if(!U.isEnabled())continue;let ue;this._blockedByActive(I,Q,H)?U.reset():U[h||l.type]&&(ue=U[h||l.type](l,B,M),this.mergeHandlerResult(x,b,ue,H,_),ue&&ue.needsRenderFrame&&this._triggerRenderFrame()),(ue||U.isActive())&&(I[H]=U)}const j={};for(const H in this._previousActiveHandlers)I[H]||(j[H]=_);this._previousActiveHandlers=I,(Object.keys(j).length||us(x))&&(this._changes.push([x,b,j]),this._triggerRenderFrame()),(Object.keys(I).length||us(x))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:q}=x;q&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],q(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new tc(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);const a=this._el;this._listeners=[[a,"touchstart",{passive:!0}],[a,"touchmove",{passive:!1}],[a,"touchend",void 0],[a,"touchcancel",void 0],[a,"mousedown",void 0],[a,"mousemove",void 0],[a,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[a,"mouseover",void 0],[a,"mouseout",void 0],[a,"dblclick",void 0],[a,"click",void 0],[a,"keydown",{capture:!1}],[a,"keyup",void 0],[a,"wheel",{passive:!1}],[a,"contextmenu",void 0],[window,"blur",void 0]];for(const[l,h,_]of this._listeners)$.addEventListener(l,h,l===document?this.handleWindowEvent:this.handleEvent,_)}destroy(){for(const[t,n,a]of this._listeners)$.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,a)}_addDefaultHandlers(t){const n=this._map,a=n.getCanvasContainer();this._add("mapEvent",new ic(n,t));const l=n.boxZoom=new Do(n,t);this._add("boxZoom",l),t.interactive&&t.boxZoom&&l.enable();const h=n.cooperativeGestures=new Us(n,t.cooperativeGestures);this._add("cooperativeGestures",h),t.cooperativeGestures&&h.enable();const _=new lu(n),x=new oc(n);n.doubleClickZoom=new Ra(x,_),this._add("tapZoom",_),this._add("clickZoom",x),t.interactive&&t.doubleClickZoom&&n.doubleClickZoom.enable();const b=new lc;this._add("tapDragZoom",b);const I=n.touchPitch=new Bo(n);this._add("touchPitch",I),t.interactive&&t.touchPitch&&n.touchPitch.enable(t.touchPitch);const E=Ro(t),M=cs(t);n.dragRotate=new cc(t,E,M),this._add("mouseRotate",E,["mousePitch"]),this._add("mousePitch",M,["mouseRotate"]),t.interactive&&t.dragRotate&&n.dragRotate.enable();const B=(({enable:ue,clickTolerance:W})=>{const ae=new Vn({checkCorrectEvent:pe=>$.mouseButton(pe)===0&&!pe.ctrlKey});return new Fs({clickTolerance:W,move:(pe,de)=>({around:de,panDelta:de.sub(pe)}),activateOnStart:!0,moveStateManager:ae,enable:ue,assignEvents:Be})})(t),j=new Os(t,n);n.dragPan=new Fo(a,B,j),this._add("mousePan",B),this._add("touchPan",j,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&n.dragPan.enable(t.dragPan);const q=new Da,H=new nc;n.touchZoomRotate=new qr(a,H,q,b),this._add("touchRotate",q,["touchPan","touchZoom"]),this._add("touchZoom",H,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&n.touchZoomRotate.enable(t.touchZoomRotate);const U=n.scrollZoom=new Vs(n,()=>this._triggerRenderFrame());this._add("scrollZoom",U,["mousePan"]),t.interactive&&t.scrollZoom&&n.scrollZoom.enable(t.scrollZoom);const Q=n.keyboard=new ac(n);this._add("keyboard",Q),t.interactive&&t.keyboard&&n.keyboard.enable(),this._add("blockableMapEvent",new jr(n))}_add(t,n,a){this._handlers.push({handlerName:t,handler:n,allowed:a}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}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!!Ne(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,a){for(const l in t)if(l!==a&&(!n||n.indexOf(l)<0))return!0;return!1}_getMapTouches(t){const n=[];for(const a of t)this._el.contains(a.target)&&n.push(a);return n}mergeHandlerResult(t,n,a,l,h){if(!a)return;c.e(t,a);const _={handlerName:l,originalEvent:a.originalEvent||h};a.zoomDelta!==void 0&&(n.zoom=_),a.panDelta!==void 0&&(n.drag=_),a.pitchDelta!==void 0&&(n.pitch=_),a.bearingDelta!==void 0&&(n.rotate=_)}_applyChanges(){const t={},n={},a={};for(const[l,h,_]of this._changes)l.panDelta&&(t.panDelta=(t.panDelta||new c.P(0,0))._add(l.panDelta)),l.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+l.zoomDelta),l.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+l.bearingDelta),l.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+l.pitchDelta),l.around!==void 0&&(t.around=l.around),l.pinchAround!==void 0&&(t.pinchAround=l.pinchAround),l.noInertia&&(t.noInertia=l.noInertia),c.e(n,h),c.e(a,_);this._updateMapTransform(t,n,a),this._changes=[]}_updateMapTransform(t,n,a){const l=this._map,h=l._getTransformForUpdate(),_=l.terrain;if(!(us(t)||_&&this._terrainMovement))return this._fireEvents(n,a,!0);let{panDelta:x,zoomDelta:b,bearingDelta:I,pitchDelta:E,around:M,pinchAround:B}=t;B!==void 0&&(M=B),l._stop(!0),M=M||l.transform.centerPoint;const j=h.pointLocation(x?M.sub(x):M);I&&(h.bearing+=I),E&&(h.pitch+=E),b&&(h.zoom+=b),_?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?h.center=h.pointLocation(h.centerPoint.sub(x)):h.setLocationAtPoint(j,M):(this._terrainMovement=!0,this._map._elevationFreeze=!0,h.setLocationAtPoint(j,M),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,h.recalculateZoom(l.terrain)})):h.setLocationAtPoint(j,M),l._applyUpdatedTransform(h),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,a,!0)}_fireEvents(t,n,a){const l=Ne(this._eventsInProgress),h=Ne(t),_={};for(const E in t){const{originalEvent:M}=t[E];this._eventsInProgress[E]||(_[`${E}start`]=M),this._eventsInProgress[E]=t[E]}!l&&h&&this._fireEvent("movestart",h.originalEvent);for(const E in _)this._fireEvent(E,_[E]);h&&this._fireEvent("move",h.originalEvent);for(const E in t){const{originalEvent:M}=t[E];this._fireEvent(E,M)}const x={};let b;for(const E in this._eventsInProgress){const{handlerName:M,originalEvent:B}=this._eventsInProgress[E];this._handlersById[M].isActive()||(delete this._eventsInProgress[E],b=n[M]||B,x[`${E}end`]=b)}for(const E in x)this._fireEvent(E,x[E]);const I=Ne(this._eventsInProgress);if(a&&(l||h)&&!I){this._updatingCamera=!0;const E=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),M=B=>B!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new tt("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Vo extends c.E{constructor(t,n){super(),this._renderFrameCallback=()=>{const a=Math.min((X.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(a)),a<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new c.M(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}panBy(t,n,a){return t=c.P.convert(t).mult(-1),this.panTo(this.transform.center,c.e({offset:t},n),a)}panTo(t,n,a){return this.easeTo(c.e({center:t},n),a)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,a){return this.easeTo(c.e({zoom:t},n),a)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,a){return this.easeTo(c.e({bearing:t},n),a)}resetNorth(t,n){return this.rotateTo(0,c.e({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(c.e({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing()){if(this._zooming&&(a.zoom=c.z.number(l,b,de)),this._rotating&&(a.bearing=c.z.number(h,I,de)),this._pitching&&(a.pitch=c.z.number(_,E,de)),this._padding&&(a.interpolatePadding(x,M,de),j=a.centerPoint.add(B)),this.terrain&&!t.freezeElevation&&this._updateElevation(de),W)a.setLocationAtPoint(W,ae);else{const xe=a.zoomScale(a.zoom-l),Te=b>l?Math.min(2,ue):Math.max(.5,ue),we=Math.pow(Te,1-de),Ie=a.unproject(U.add(Q.mult(de*we)).mult(xe));a.setLocationAtPoint(a.renderWorldCopies?Ie.wrap():Ie,j)}this._applyUpdatedTransform(a),this._fireMoveEvents(n)},de=>{this.terrain&&this._finalizeElevation(),this._afterEase(n,de)},t),this}_prepareEase(t,n,a={}){this._moving=!0,n||a.moving||this.fire(new c.k("movestart",t)),this._zooming&&!a.zooming&&this.fire(new c.k("zoomstart",t)),this._rotating&&!a.rotating&&this.fire(new c.k("rotatestart",t)),this._pitching&&!a.pitching&&this.fire(new c.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&n!==this._elevationTarget){const a=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(a-(n-(a*t+this._elevationStart))/(1-t)),this._elevationTarget=n}this.transform.elevation=c.z.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(t){if(!this.transformCameraUpdate)return;const n=t.clone(),{center:a,zoom:l,pitch:h,bearing:_,elevation:x}=this.transformCameraUpdate(n);a&&(n.center=a),l!==void 0&&(n.zoom=l),h!==void 0&&(n.pitch=h),_!==void 0&&(n.bearing=_),x!==void 0&&(n.elevation=x),this.transform.apply(n)}_fireMoveEvents(t){this.fire(new c.k("move",t)),this._zooming&&this.fire(new c.k("zoom",t)),this._rotating&&this.fire(new c.k("rotate",t)),this._pitching&&this.fire(new c.k("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const a=this._zooming,l=this._rotating,h=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,a&&this.fire(new c.k("zoomend",t)),l&&this.fire(new c.k("rotateend",t)),h&&this.fire(new c.k("pitchend",t)),this.fire(new c.k("moveend",t))}flyTo(t,n){if(!t.essential&&X.prefersReducedMotion){const Ve=c.L(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Ve,n)}this.stop(),t=c.e({offset:[0,0],speed:1.2,curve:1.42,easing:c.b6},t);const a=this._getTransformForUpdate(),l=this.getZoom(),h=this.getBearing(),_=this.getPitch(),x=this.getPadding(),b="zoom"in t?c.ac(+t.zoom,a.minZoom,a.maxZoom):l,I="bearing"in t?this._normalizeBearing(t.bearing,h):h,E="pitch"in t?+t.pitch:_,M="padding"in t?t.padding:a.padding,B=a.zoomScale(b-l),j=c.P.convert(t.offset);let q=a.centerPoint.add(j);const H=a.pointLocation(q),U=c.M.convert(t.center||H);this._normalizeCenter(U);const Q=a.project(H),ue=a.project(U).sub(Q);let W=t.curve;const ae=Math.max(a.width,a.height),pe=ae/B,de=ue.mag();if("minZoom"in t){const Ve=c.ac(Math.min(t.minZoom,l,b),a.minZoom,a.maxZoom),ri=ae/a.zoomScale(Ve-l);W=Math.sqrt(ri/de*2)}const xe=W*W;function Te(Ve){const ri=(pe*pe-ae*ae+(Ve?-1:1)*xe*xe*de*de)/(2*(Ve?pe:ae)*xe*de);return Math.log(Math.sqrt(ri*ri+1)-ri)}function we(Ve){return(Math.exp(Ve)-Math.exp(-Ve))/2}function Ie(Ve){return(Math.exp(Ve)+Math.exp(-Ve))/2}const Fe=Te(!1);let $e=function(Ve){return Ie(Fe)/Ie(Fe+W*Ve)},Pe=function(Ve){return ae*((Ie(Fe)*(we(ri=Fe+W*Ve)/Ie(ri))-we(Fe))/xe)/de;var ri},Qe=(Te(!0)-Fe)/W;if(Math.abs(de)<1e-6||!isFinite(Qe)){if(Math.abs(ae-pe)<1e-6)return this.easeTo(t,n);const Ve=pet.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=h!==I,this._pitching=E!==_,this._padding=!a.isPaddingEqual(M),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(U),this._ease(Ve=>{const ri=Ve*Qe,Tt=1/$e(ri);a.zoom=Ve===1?b:l+a.scaleZoom(Tt),this._rotating&&(a.bearing=c.z.number(h,I,Ve)),this._pitching&&(a.pitch=c.z.number(_,E,Ve)),this._padding&&(a.interpolatePadding(x,M,Ve),q=a.centerPoint.add(j)),this.terrain&&!t.freezeElevation&&this._updateElevation(Ve);const gt=Ve===1?U:a.unproject(Q.add(ue.mult(Pe(ri))).mult(Tt));a.setLocationAtPoint(a.renderWorldCopies?gt.wrap():gt,q),this._applyUpdatedTransform(a),this._fireMoveEvents(n)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(n)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const a=this._onEaseEnd;delete this._onEaseEnd,a.call(this,n)}if(!t){const a=this.handlers;a&&a.stop(!1)}return this}_ease(t,n,a){a.animate===!1||a.duration===0?(t(1),n()):(this._easeStart=X.now(),this._easeOptions=a,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,n){t=c.b0(t,-180,180);const a=Math.abs(t-n);return Math.abs(t-360-n)180?-360:a<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(c.M.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}const lr={compact:!0,customAttribution:'MapLibre'};class Uo{constructor(t=lr){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=n=>{!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"&&n.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=$.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=$.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=$.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){$.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,n){const a=this._map._getUIString(`AttributionControl.${n}`);t.title=a,t.setAttribute("aria-label",a)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(l=>typeof l!="string"?"":l)):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const l=this._map.style.stylesheet;this.styleOwner=l.owner,this.styleId=l.id}const n=this._map.style.sourceCaches;for(const l in n){const h=n[l];if(h.used||h.usedForTerrain){const _=h.getSource();_.attribution&&t.indexOf(_.attribution)<0&&t.push(_.attribution)}}t=t.filter(l=>String(l).trim()),t.sort((l,h)=>l.length-h.length),t=t.filter((l,h)=>{for(let _=h+1;_=0)return!1;return!0});const a=t.join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Zr{constructor(t={}){this._updateCompact=()=>{const n=this._container.children;if(n.length){const a=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&a.classList.add("maplibregl-compact"):a.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=$.create("div","maplibregl-ctrl");const n=$.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){$.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class uu{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){const n=this._currentlyRunning,a=n?this._queue.concat(n):this._queue;for(const l of a)if(l.id===t)return void(l.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const a of n)if(!a.cancelled&&(a.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ns=c.X([{name:"a_pos3d",type:"Int16",components:3}]);class fi extends c.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,n){this.sourceCache.update(t,n),this._renderableTilesKeys=[];const a={};for(const l of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))a[l.key]=!0,this._renderableTilesKeys.push(l.key),this._tiles[l.key]||(l.posMatrix=new Float64Array(16),c.aN(l.posMatrix,0,c.W,0,c.W,0,1),this._tiles[l.key]=new tn(l,this.tileSize));for(const l in this._tiles)a[l]||delete this._tiles[l]}freeRtt(t){for(const n in this._tiles){const a=this._tiles[n];(!t||a.tileID.equals(t)||a.tileID.isChildOf(t)||t.isChildOf(a.tileID))&&(a.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const n={};for(const a of this._renderableTilesKeys){const l=this._tiles[a].tileID;if(l.canonical.equals(t.canonical)){const h=t.clone();h.posMatrix=new Float64Array(16),c.aN(h.posMatrix,0,c.W,0,c.W,0,1),n[a]=h}else if(l.canonical.isChildOf(t.canonical)){const h=t.clone();h.posMatrix=new Float64Array(16);const _=l.canonical.z-t.canonical.z,x=l.canonical.x-(l.canonical.x>>_<<_),b=l.canonical.y-(l.canonical.y>>_<<_),I=c.W>>_;c.aN(h.posMatrix,0,I,0,I,0,1),c.H(h.posMatrix,h.posMatrix,[-x*I,-b*I,0]),n[a]=h}else if(t.canonical.isChildOf(l.canonical)){const h=t.clone();h.posMatrix=new Float64Array(16);const _=t.canonical.z-l.canonical.z,x=t.canonical.x-(t.canonical.x>>_<<_),b=t.canonical.y-(t.canonical.y>>_<<_),I=c.W>>_;c.aN(h.posMatrix,0,c.W,0,c.W,0,1),c.H(h.posMatrix,h.posMatrix,[x*I,b*I,0]),c.J(h.posMatrix,h.posMatrix,[1/2**_,1/2**_,0]),n[a]=h}}return n}getSourceTile(t,n){const a=this.sourceCache._source;let l=t.overscaledZ-this.deltaZoom;if(l>a.maxzoom&&(l=a.maxzoom),l=a.minzoom&&(!h||!h.dem);)h=this.sourceCache.getTileByID(t.scaledTo(l--).key);return h}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(n=>n.timeAdded>=t)}}class bi{constructor(t,n,a){this.painter=t,this.sourceCache=new fi(n),this.options=a,this.exaggeration=typeof a.exaggeration=="number"?a.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,n,a,l=c.W){var h;if(!(n>=0&&n=0&&at.canonical.z&&(t.canonical.z>=l?h=t.canonical.z-l:c.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const _=t.canonical.x-(t.canonical.x>>h<>h<>8<<4|h>>8,n[_+3]=0;const a=new c.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),l=new Ze(t,a,t.gl.RGBA,{premultiply:!1});return l.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=l,l}pointCoordinate(t){const n=new Uint8Array(4),a=this.painter.context,l=a.gl;a.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),l.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,n),a.bindFramebuffer.set(null);const h=n[0]+(n[2]>>4<<8),_=n[1]+((15&n[2])<<8),x=this.coordsIndex[255-n[3]],b=x&&this.sourceCache.getTileByID(x);if(!b)return null;const I=this._coordsTextureSize,E=(1<t.id!==n),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length!t.inUse)===!1}}const an={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Ba{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new uc(t.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(a=>!t._layers[a].isHidden(n)),this._coordsDescendingInv={};for(const a in t.sourceCaches){this._coordsDescendingInv[a]={};const l=t.sourceCaches[a].getVisibleCoordinates();for(const h of l){const _=this.terrain.sourceCache.getTerrainCoords(h);for(const x in _)this._coordsDescendingInv[a][x]||(this._coordsDescendingInv[a][x]=[]),this._coordsDescendingInv[a][x].push(_[x])}}this._coordsDescendingInvStr={};for(const a of t._order){const l=t._layers[a],h=l.source;if(an[l.type]&&!this._coordsDescendingInvStr[h]){this._coordsDescendingInvStr[h]={};for(const _ in this._coordsDescendingInv[h])this._coordsDescendingInvStr[h][_]=this._coordsDescendingInv[h][_].map(x=>x.key).sort().join()}}for(const a of this._renderableTiles)for(const l in this._coordsDescendingInvStr){const h=this._coordsDescendingInvStr[l][a.tileID.key];h&&h!==a.rttCoords[l]&&(a.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const n=t.type,a=this.painter,l=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(an[n]&&(this._prevType&&an[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!l))return!0;if(an[this._prevType]||an[n]&&l){this._prevType=n;const h=this._stacks.length-1,_=this._stacks[h]||[];for(const x of this._renderableTiles){if(this.pool.isFull()&&(Ea(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(x),x.rtt[h]){const I=this.pool.getObjectForId(x.rtt[h].id);if(I.stamp===x.rtt[h].stamp){this.pool.useObject(I);continue}}const b=this.pool.getOrCreateFreeObject();this.pool.useObject(b),this.pool.stampObject(b),x.rtt[h]={id:b.id,stamp:b.stamp},a.context.bindFramebuffer.set(b.fbo.framebuffer),a.context.clear({color:c.aO.transparent,stencil:0}),a.currentStencilSource=void 0;for(let I=0;I<_.length;I++){const E=a.style._layers[_[I]],M=E.source?this._coordsDescendingInv[E.source][x.tileID.key]:[x.tileID];a.context.viewport.set([0,0,b.fbo.width,b.fbo.height]),a._renderTileClippingMasks(E,M),a.renderLayer(a,a.style.sourceCaches[E.source],E,M),E.source&&(x.rttCoords[E.source]=this._coordsDescendingInvStr[E.source][x.tileID.key])}}return Ea(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),an[n]}return!1}}const No={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},jo=ne,qo={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:lr,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:c.a.MAX_TILE_CACHE_ZOOM_LEVELS,localIdeographFontFamily:"sans-serif",transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,validateStyle:!0,maxCanvasSize:[4096,4096]},hs=u=>{u.touchstart=u.dragStart,u.touchmoveWindow=u.dragMove,u.touchend=u.dragEnd},Zo={showCompass:!0,showZoom:!0,visualizePitch:!1};class Go{constructor(t,n,a=!1){this.mousedown=_=>{this.startMouse(c.e({},_,{ctrlKey:!0,preventDefault:()=>_.preventDefault()}),$.mousePos(this.element,_)),$.addEventListener(window,"mousemove",this.mousemove),$.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=_=>{this.moveMouse(_,$.mousePos(this.element,_))},this.mouseup=_=>{this.mouseRotate.dragEnd(_),this.mousePitch&&this.mousePitch.dragEnd(_),this.offTemp()},this.touchstart=_=>{_.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=$.touchPos(this.element,_.targetTouches)[0],this.startTouch(_,this._startPos),$.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),$.addEventListener(window,"touchend",this.touchend))},this.touchmove=_=>{_.targetTouches.length!==1?this.reset():(this._lastPos=$.touchPos(this.element,_.targetTouches)[0],this.moveTouch(_,this._lastPos))},this.touchend=_=>{_.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const l=t.dragRotate._mouseRotate.getClickTolerance(),h=t.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=Ro({clickTolerance:l,enable:!0}),this.touchRotate=(({enable:_,clickTolerance:x,bearingDegreesPerPixelMoved:b=.8})=>{const I=new cn;return new Fs({clickTolerance:x,move:(E,M)=>({bearingDelta:(M.x-E.x)*b}),moveStateManager:I,enable:_,assignEvents:hs})})({clickTolerance:l,enable:!0}),this.map=t,a&&(this.mousePitch=cs({clickTolerance:h,enable:!0}),this.touchPitch=(({enable:_,clickTolerance:x,pitchDegreesPerPixelMoved:b=-.5})=>{const I=new cn;return new Fs({clickTolerance:x,move:(E,M)=>({pitchDelta:(M.y-E.y)*b}),moveStateManager:I,enable:_,assignEvents:hs})})({clickTolerance:h,enable:!0})),$.addEventListener(n,"mousedown",this.mousedown),$.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),$.addEventListener(n,"touchcancel",this.reset)}startMouse(t,n){this.mouseRotate.dragStart(t,n),this.mousePitch&&this.mousePitch.dragStart(t,n),$.disableDrag()}startTouch(t,n){this.touchRotate.dragStart(t,n),this.touchPitch&&this.touchPitch.dragStart(t,n),$.disableDrag()}moveMouse(t,n){const a=this.map,{bearingDelta:l}=this.mouseRotate.dragMove(t,n)||{};if(l&&a.setBearing(a.getBearing()+l),this.mousePitch){const{pitchDelta:h}=this.mousePitch.dragMove(t,n)||{};h&&a.setPitch(a.getPitch()+h)}}moveTouch(t,n){const a=this.map,{bearingDelta:l}=this.touchRotate.dragMove(t,n)||{};if(l&&a.setBearing(a.getBearing()+l),this.touchPitch){const{pitchDelta:h}=this.touchPitch.dragMove(t,n)||{};h&&a.setPitch(a.getPitch()+h)}}off(){const t=this.element;$.removeEventListener(t,"mousedown",this.mousedown),$.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),$.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),$.removeEventListener(window,"touchend",this.touchend),$.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){$.enableDrag(),$.removeEventListener(window,"mousemove",this.mousemove),$.removeEventListener(window,"mouseup",this.mouseup),$.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),$.removeEventListener(window,"touchend",this.touchend)}}let un;function Fa(u,t,n){const a=new c.M(u.lng,u.lat);if(u=new c.M(u.lng,u.lat),t){const l=new c.M(u.lng-360,u.lat),h=new c.M(u.lng+360,u.lat),_=n.locationPoint(u).distSqr(t);n.locationPoint(l).distSqr(t)<_?u=l:n.locationPoint(h).distSqr(t)<_&&(u=h)}for(;Math.abs(u.lng-n.center.lng)>180;){const l=n.locationPoint(u);if(l.x>=0&&l.y>=0&&l.x<=n.width&&l.y<=n.height)break;u.lng>n.center.lng?u.lng-=360:u.lng+=360}return u.lng!==a.lng&&n.locationPoint(u).y>n.height/2-n.getHorizon()?u:a}const js={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Oa(u,t,n){const a=u.classList;for(const l in js)a.remove(`maplibregl-${n}-anchor-${l}`);a.add(`maplibregl-${n}-anchor-${t}`)}class qs extends c.E{constructor(t){if(super(),this._onKeyPress=n=>{const a=n.code,l=n.charCode||n.keyCode;a!=="Space"&&a!=="Enter"&&l!==32&&l!==13||this.togglePopup()},this._onMapClick=n=>{const a=n.originalEvent.target,l=this._element;this._popup&&(a===l||l.contains(a))&&this.togglePopup()},this._update=n=>{if(!this._map)return;const a=this._map.loaded()&&!this._map.isMoving();((n==null?void 0:n.type)==="terrain"||(n==null?void 0:n.type)==="render"&&!a)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=Fa(this._lngLat,this._flatPos,this._map.transform)),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let l="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?l=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(l=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let h="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?h="rotateX(0deg)":this._pitchAlignment==="map"&&(h=`rotateX(${this._map.getPitch()}deg)`),n&&n.type!=="moveend"||(this._pos=this._pos.round()),$.setTransform(this._element,`${js[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${h} ${l}`),X.frameAsync(new AbortController).then(()=>{this._updateOpacity(n&&n.type==="moveend")}).catch(()=>{})},this._onMove=n=>{if(!this._isDragging){const a=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=a}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new c.k("dragstart"))),this.fire(new c.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new c.k("dragend")),this._state="inactive"},this._addDragHandler=n=>{this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(t==null?void 0:t.opacity,t==null?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=c.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=$.create("div"),this._element.setAttribute("aria-label","Map marker");const n=$.createNS("http://www.w3.org/2000/svg","svg"),a=41,l=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height",`${a}px`),n.setAttributeNS(null,"width",`${l}px`),n.setAttributeNS(null,"viewBox",`0 0 ${l} ${a}`);const h=$.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"stroke","none"),h.setAttributeNS(null,"stroke-width","1"),h.setAttributeNS(null,"fill","none"),h.setAttributeNS(null,"fill-rule","evenodd");const _=$.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"fill-rule","nonzero");const x=$.createNS("http://www.w3.org/2000/svg","g");x.setAttributeNS(null,"transform","translate(3.0, 29.0)"),x.setAttributeNS(null,"fill","#000000");const b=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const Q of b){const ue=$.createNS("http://www.w3.org/2000/svg","ellipse");ue.setAttributeNS(null,"opacity","0.04"),ue.setAttributeNS(null,"cx","10.5"),ue.setAttributeNS(null,"cy","5.80029008"),ue.setAttributeNS(null,"rx",Q.rx),ue.setAttributeNS(null,"ry",Q.ry),x.appendChild(ue)}const I=$.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"fill",this._color);const E=$.createNS("http://www.w3.org/2000/svg","path");E.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),I.appendChild(E);const M=$.createNS("http://www.w3.org/2000/svg","g");M.setAttributeNS(null,"opacity","0.25"),M.setAttributeNS(null,"fill","#000000");const B=$.createNS("http://www.w3.org/2000/svg","path");B.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),M.appendChild(B);const j=$.createNS("http://www.w3.org/2000/svg","g");j.setAttributeNS(null,"transform","translate(6.0, 7.0)"),j.setAttributeNS(null,"fill","#FFFFFF");const q=$.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"transform","translate(8.0, 8.0)");const H=$.createNS("http://www.w3.org/2000/svg","circle");H.setAttributeNS(null,"fill","#000000"),H.setAttributeNS(null,"opacity","0.25"),H.setAttributeNS(null,"cx","5.5"),H.setAttributeNS(null,"cy","5.5"),H.setAttributeNS(null,"r","5.4999962");const U=$.createNS("http://www.w3.org/2000/svg","circle");U.setAttributeNS(null,"fill","#FFFFFF"),U.setAttributeNS(null,"cx","5.5"),U.setAttributeNS(null,"cy","5.5"),U.setAttributeNS(null,"r","5.4999962"),q.appendChild(H),q.appendChild(U),_.appendChild(x),_.appendChild(I),_.appendChild(M),_.appendChild(j),_.appendChild(q),n.appendChild(_),n.setAttributeNS(null,"height",a*this._scale+"px"),n.setAttributeNS(null,"width",l*this._scale+"px"),this._element.appendChild(n),this._offset=c.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",n=>{n.preventDefault()}),this._element.addEventListener("mousedown",n=>{n.preventDefault()}),Oa(this._element,this._anchor,"marker"),t&&t.className)for(const n of t.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),$.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=c.M.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const l=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[l,-1*(38.1-13.5+l)],"bottom-right":[-l,-1*(38.1-13.5+l)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this}_updateOpacity(t=!1){var n;if(!(!((n=this._map)===null||n===void 0)&&n.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const a=this._map,l=a.terrain.depthAtPoint(this._pos),h=a.terrain.getElevationForLngLatZoom(this._lngLat,a.transform.tileZoom);if(a.transform.lngLatToCameraDepth(this._lngLat,h)-l<.006)return void(this._element.style.opacity=this._opacity);const _=-this._offset.y/a.transform._pixelPerMeter,x=Math.sin(a.getPitch()*Math.PI/180)*_,b=a.terrain.depthAtPoint(new c.P(this._pos.x,this._pos.y-this._offset.y)),I=a.transform.lngLatToCameraDepth(this._lngLat,h+x);this._element.style.opacity=I-b>.006?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=c.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,n){return t===void 0&&n===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),t!==void 0&&(this._opacity=t),n!==void 0&&(this._opacityWhenCovered=n),this._map&&this._updateOpacity(!0),this}}const Ho={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Nn=0,jn=!1;const Wo={maxWidth:100,unit:"metric"};function Zs(u,t,n){const a=n&&n.maxWidth||100,l=u._container.clientHeight/2,h=u.unproject([0,l]),_=u.unproject([a,l]),x=h.distanceTo(_);if(n&&n.unit==="imperial"){const b=3.2808*x;b>5280?qn(t,a,b/5280,u._getUIString("ScaleControl.Miles")):qn(t,a,b,u._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?qn(t,a,x/1852,u._getUIString("ScaleControl.NauticalMiles")):x>=1e3?qn(t,a,x/1e3,u._getUIString("ScaleControl.Kilometers")):qn(t,a,x,u._getUIString("ScaleControl.Meters"))}function qn(u,t,n,a){const l=function(h){const _=Math.pow(10,`${Math.floor(h)}`.length-1);let x=h/_;return x=x>=10?10:x>=5?5:x>=3?3:x>=2?2:x>=1?1:function(b){const I=Math.pow(10,Math.ceil(-Math.log(b)/Math.LN10));return Math.round(b*I)/I}(x),_*x}(n);u.style.width=t*(l/n)+"px",u.innerHTML=`${l} ${a}`}const Xo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Ko=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Va(u){if(u){if(typeof u=="number"){const t=Math.round(Math.abs(u)/Math.SQRT2);return{center:new c.P(0,0),top:new c.P(0,u),"top-left":new c.P(t,t),"top-right":new c.P(-t,t),bottom:new c.P(0,-u),"bottom-left":new c.P(t,-t),"bottom-right":new c.P(-t,-t),left:new c.P(u,0),right:new c.P(-u,0)}}if(u instanceof c.P||Array.isArray(u)){const t=c.P.convert(u);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:c.P.convert(u.center||[0,0]),top:c.P.convert(u.top||[0,0]),"top-left":c.P.convert(u["top-left"]||[0,0]),"top-right":c.P.convert(u["top-right"]||[0,0]),bottom:c.P.convert(u.bottom||[0,0]),"bottom-left":c.P.convert(u["bottom-left"]||[0,0]),"bottom-right":c.P.convert(u["bottom-right"]||[0,0]),left:c.P.convert(u.left||[0,0]),right:c.P.convert(u.right||[0,0])}}return Va(new c.P(0,0))}const Jo=ne;S.AJAXError=c.bd,S.Evented=c.E,S.LngLat=c.M,S.MercatorCoordinate=c.Y,S.Point=c.P,S.addProtocol=c.be,S.config=c.a,S.removeProtocol=c.bf,S.AttributionControl=Uo,S.BoxZoomHandler=Do,S.CanvasSource=$n,S.CooperativeGesturesHandler=Us,S.DoubleClickZoomHandler=Ra,S.DragPanHandler=Fo,S.DragRotateHandler=cc,S.EdgeInsets=os,S.FullscreenControl=class extends c.E{constructor(u={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,u&&u.container&&(u.container instanceof HTMLElement?this._container=u.container:c.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(u){return this._map=u,this._container||(this._container=this._map.getContainer()),this._controlContainer=$.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){$.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const u=this._fullscreenButton=$.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);$.create("span","maplibregl-ctrl-icon",u).setAttribute("aria-hidden","true"),u.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const u=this._getTitle();this._fullscreenButton.setAttribute("aria-label",u),this._fullscreenButton.title=u}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new c.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new c.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},S.GeoJSONSource=Mt,S.GeolocateControl=class extends c.E{constructor(u){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new c.k("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(t),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new c.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const n=new c.M(t.coords.longitude,t.coords.latitude),a=t.coords.accuracy,l=this._map.getBearing(),h=c.e({bearing:l},this.options.fitBoundsOptions),_=jt.fromLngLat(n,a);this._map.fitBounds(_,h,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const n=new c.M(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)if(t.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&jn)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new c.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=t=>{if(this._map){if(this._container.addEventListener("contextmenu",n=>n.preventDefault()),this._geolocateButton=$.create("button","maplibregl-ctrl-geolocate",this._container),$.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!1){c.w("Geolocation support is not available so the GeolocateControl will be disabled.");const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{const n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=$.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new qs({element:this._dotElement}),this._circleElement=$.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new qs({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",n=>{n.geolocateSource||this._watchState!=="ACTIVE_LOCK"||n.originalEvent&&n.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new c.k("trackuserlocationend")))})}},this.options=c.e({},Ho,u)}onAdd(u){return this._map=u,this._container=$.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(t=!1){return c._(this,void 0,void 0,function*(){if(un!==void 0&&!t)return un;if(window.navigator.permissions===void 0)return un=!!window.navigator.geolocation,un;try{un=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{un=!!window.navigator.geolocation}return un})}().then(t=>this._setupUI(t)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),$.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Nn=0,jn=!1}_isOutOfMapMaxBounds(u){const t=this._map.getMaxBounds(),n=u.coords;return t&&(n.longitudet.getEast()||n.latitudet.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const u=this._map.getBounds(),t=u.getSouthEast(),n=u.getNorthEast(),a=t.distanceTo(n),l=Math.ceil(this._accuracy/(a/this._map._container.clientHeight)*2);this._circleElement.style.width=`${l}px`,this._circleElement.style.height=`${l}px`}trigger(){if(!this._setup)return c.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 c.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Nn--,jn=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new c.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new c.k("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let u;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Nn++,Nn>1?(u={maximumAge:6e5,timeout:0},jn=!0):(u=this.options.positionOptions,jn=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,u)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},S.Hash=zo,S.ImageSource=en,S.KeyboardHandler=ac,S.LngLatBounds=jt,S.LogoControl=Zr,S.Map=class extends Vo{constructor(u){if(c.bb.mark(c.bc.create),(u=c.e({},qo,u)).minZoom!=null&&u.maxZoom!=null&&u.minZoom>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(super(new Ma(u.minZoom,u.maxZoom,u.minPitch,u.maxPitch,u.renderWorldCopies),{bearingSnap:u.bearingSnap}),this._contextLost=t=>{t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new c.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new c.k("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=u.interactive,this._maxTileCacheSize=u.maxTileCacheSize,this._maxTileCacheZoomLevels=u.maxTileCacheZoomLevels,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._crossSourceCollisions=u.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=u.collectResourceTiming,this._renderTaskQueue=new uu,this._controls=[],this._mapId=c.a3(),this._locale=c.e({},No,u.locale),this._clickTolerance=u.clickTolerance,this._overridePixelRatio=u.pixelRatio,this._maxCanvasSize=u.maxCanvasSize,this.transformCameraUpdate=u.transformCameraUpdate,this._imageQueueHandle=Ge.addThrottleControl(()=>this.isMoving()),this._requestManager=new ot(u.transformRequest),typeof u.container=="string"){if(this._container=document.getElementById(u.container),!this._container)throw new Error(`Container '${u.container}' not found.`)}else{if(!(u.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=u.container}if(u.maxBounds&&this.setMaxBounds(u.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let t=!1;const n=Po(a=>{this._trackResize&&!this._removed&&this.resize(a)._update()},50);this._resizeObserver=new ResizeObserver(a=>{t?n(a):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Oo(this,u),this._hash=u.hash&&new zo(typeof u.hash=="string"&&u.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:u.center,zoom:u.zoom,bearing:u.bearing,pitch:u.pitch}),u.bounds&&(this.resize(),this.fitBounds(u.bounds,c.e({},u.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=u.localIdeographFontFamily,this._validateStyle=u.validateStyle,u.style&&this.setStyle(u.style,{localIdeographFontFamily:u.localIdeographFontFamily}),u.attributionControl&&this.addControl(new Uo(typeof u.attributionControl=="boolean"?void 0:u.attributionControl)),u.maplibreLogo&&this.addControl(new Zr,u.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this._update(t.dataType==="style"),this.fire(new c.k(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new c.k(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new c.k("sourcedataabort",t))})}_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 c.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=u.onAdd(this);this._controls.push(u);const a=this._controlPositions[t];return t.indexOf("bottom")!==-1?a.insertBefore(n,a.firstChild):a.appendChild(n),this}removeControl(u){if(!u||!u.onRemove)return this.fire(new c.j(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}calculateCameraOptionsFromTo(u,t,n,a){return a==null&&this.terrain&&(a=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(u,t,n,a)}resize(u){var t;const n=this._containerDimensions(),a=n[0],l=n[1],h=this._getClampedPixelRatio(a,l);if(this._resizeCanvas(a,l,h),this.painter.resize(a,l,h),this.painter.overLimit()){const x=this.painter.context.gl;this._maxCanvasSize=[x.drawingBufferWidth,x.drawingBufferHeight];const b=this._getClampedPixelRatio(a,l);this._resizeCanvas(a,l,b),this.painter.resize(a,l,b)}this.transform.resize(a,l),(t=this._requestedCameraState)===null||t===void 0||t.resize(a,l);const _=!this._moving;return _&&(this.stop(),this.fire(new c.k("movestart",u)).fire(new c.k("move",u))),this.fire(new c.k("resize",u)),_&&this.fire(new c.k("moveend",u)),this}_getClampedPixelRatio(u,t){const{0:n,1:a}=this._maxCanvasSize,l=this.getPixelRatio(),h=u*l,_=t*l;return Math.min(h>n?n/h:1,_>a?a/_:1)*l}getPixelRatio(){var u;return(u=this._overridePixelRatio)!==null&&u!==void 0?u:devicePixelRatio}setPixelRatio(u){this._overridePixelRatio=u,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(u){return this.transform.setMaxBounds(jt.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;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;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(u){return this.transform.renderWorldCopies=u,this._update()}project(u){return this.transform.locationPoint(c.M.convert(u),this.style&&this.terrain)}unproject(u){return this.transform.pointLocation(c.P.convert(u),this.terrain)}isMoving(){var u;return this._moving||((u=this.handlers)===null||u===void 0?void 0:u.isMoving())}isZooming(){var u;return this._zooming||((u=this.handlers)===null||u===void 0?void 0:u.isZooming())}isRotating(){var u;return this._rotating||((u=this.handlers)===null||u===void 0?void 0:u.isRotating())}_createDelegatedListener(u,t,n){if(u==="mouseenter"||u==="mouseover"){let a=!1;return{layer:t,listener:n,delegates:{mousemove:h=>{const _=this.getLayer(t)?this.queryRenderedFeatures(h.point,{layers:[t]}):[];_.length?a||(a=!0,n.call(this,new yr(u,this,h.originalEvent,{features:_}))):a=!1},mouseout:()=>{a=!1}}}}if(u==="mouseleave"||u==="mouseout"){let a=!1;return{layer:t,listener:n,delegates:{mousemove:_=>{(this.getLayer(t)?this.queryRenderedFeatures(_.point,{layers:[t]}):[]).length?a=!0:a&&(a=!1,n.call(this,new yr(u,this,_.originalEvent)))},mouseout:_=>{a&&(a=!1,n.call(this,new yr(u,this,_.originalEvent)))}}}}{const a=l=>{const h=this.getLayer(t)?this.queryRenderedFeatures(l.point,{layers:[t]}):[];h.length&&(l.features=h,n.call(this,l),delete l.features)};return{layer:t,listener:n,delegates:{[u]:a}}}}on(u,t,n){if(n===void 0)return super.on(u,t);const a=this._createDelegatedListener(u,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[u]=this._delegatedListeners[u]||[],this._delegatedListeners[u].push(a);for(const l in a.delegates)this.on(l,a.delegates[l]);return this}once(u,t,n){if(n===void 0)return super.once(u,t);const a=this._createDelegatedListener(u,t,n);for(const l in a.delegates)this.once(l,a.delegates[l]);return this}off(u,t,n){return n===void 0?super.off(u,t):(this._delegatedListeners&&this._delegatedListeners[u]&&(a=>{const l=this._delegatedListeners[u];for(let h=0;hthis._updateStyle(u,t));const n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!u)),u?(this.style=new Er(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof u=="string"?this.style.loadURL(u,t,n):this.style.loadJSON(u,t,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Er(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(u,t){if(typeof u=="string"){const n=this._requestManager.transformRequest(u,rt.Style);c.h(n,new AbortController).then(a=>{this._updateDiff(a.data,t)}).catch(a=>{a&&this.fire(new c.j(a))})}else typeof u=="object"&&this._updateDiff(u,t)}_updateDiff(u,t){try{this.style.setState(u,t)&&this._update(!0)}catch(n){c.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(u,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():c.w("There is no style added to the map.")}addSource(u,t){return this._lazyInitEmptyStyle(),this.style.addSource(u,t),this._update(!0)}isSourceLoaded(u){const t=this.style&&this.style.sourceCaches[u];if(t!==void 0)return t.loaded();this.fire(new c.j(new Error(`There is no source with ID '${u}'`)))}setTerrain(u){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),u){const t=this.style.sourceCaches[u.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${u.source}`);this.terrain===null&&t.reload();for(const n in this.style._layers){const a=this.style._layers[n];a.type==="hillshade"&&a.source===u.source&&c.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new bi(this.painter,t,u),this.painter.renderToTexture=new Ba(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=n=>{n.dataType==="style"?this.terrain.sourceCache.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId!==u.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new c.k("terrain",{terrain:u})),this}getTerrain(){var u,t;return(t=(u=this.terrain)===null||u===void 0?void 0:u.options)!==null&&t!==void 0?t:null}areTilesLoaded(){const u=this.style&&this.style.sourceCaches;for(const t in u){const n=u[t]._tiles;for(const a in n){const l=n[a];if(l.state!=="loaded"&&l.state!=="errored")return!1}}return!0}removeSource(u){return this.style.removeSource(u),this._update(!0)}getSource(u){return this.style.getSource(u)}addImage(u,t,n={}){const{pixelRatio:a=1,sdf:l=!1,stretchX:h,stretchY:_,content:x}=n;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||c.b(t))){if(t.width===void 0||t.height===void 0)return this.fire(new c.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:b,height:I,data:E}=t,M=t;return this.style.addImage(u,{data:new c.R({width:b,height:I},new Uint8Array(E)),pixelRatio:a,stretchX:h,stretchY:_,content:x,sdf:l,version:0,userImage:M}),M.onAdd&&M.onAdd(this,u),this}}{const{width:b,height:I,data:E}=X.getImageData(t);this.style.addImage(u,{data:new c.R({width:b,height:I},E),pixelRatio:a,stretchX:h,stretchY:_,content:x,sdf:l,version:0})}}updateImage(u,t){const n=this.style.getImage(u);if(!n)return this.fire(new c.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const a=t instanceof HTMLImageElement||c.b(t)?X.getImageData(t):t,{width:l,height:h,data:_}=a;if(l===void 0||h===void 0)return this.fire(new c.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(l!==n.data.width||h!==n.data.height)return this.fire(new c.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const x=!(t instanceof HTMLImageElement||c.b(t));return n.data.replace(_,x),this.style.updateImage(u,n),this}getImage(u){return this.style.getImage(u)}hasImage(u){return u?!!this.style.getImage(u):(this.fire(new c.j(new Error("Missing required image id"))),!1)}removeImage(u){this.style.removeImage(u)}loadImage(u){return Ge.getImage(this._requestManager.transformRequest(u,rt.Image),new AbortController)}listImages(){return this.style.listImages()}addLayer(u,t){return this._lazyInitEmptyStyle(),this.style.addLayer(u,t),this._update(!0)}moveLayer(u,t){return this.style.moveLayer(u,t),this._update(!0)}removeLayer(u){return this.style.removeLayer(u),this._update(!0)}getLayer(u){return this.style.getLayer(u)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(u,t,n){return this.style.setLayerZoomRange(u,t,n),this._update(!0)}setFilter(u,t,n={}){return this.style.setFilter(u,t,n),this._update(!0)}getFilter(u){return this.style.getFilter(u)}setPaintProperty(u,t,n,a={}){return this.style.setPaintProperty(u,t,n,a),this._update(!0)}getPaintProperty(u,t){return this.style.getPaintProperty(u,t)}setLayoutProperty(u,t,n,a={}){return this.style.setLayoutProperty(u,t,n,a),this._update(!0)}getLayoutProperty(u,t){return this.style.getLayoutProperty(u,t)}setGlyphs(u,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(u,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(u,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(u,t,n,a=>{a||this._update(!0)}),this}removeSprite(u){return this._lazyInitEmptyStyle(),this.style.removeSprite(u),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(u,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(u,t,n=>{n||this._update(!0)}),this}setLight(u,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(u,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(u,t){return this.style.setFeatureState(u,t),this._update()}removeFeatureState(u,t){return this.style.removeFeatureState(u,t),this._update()}getFeatureState(u){return this.style.getFeatureState(u)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let u=0,t=0;return this._container&&(u=this._container.clientWidth||400,t=this._container.clientHeight||300),[u,t]}_setupContainer(){const u=this._container;u.classList.add("maplibregl-map");const t=this._canvasContainer=$.create("div","maplibregl-canvas-container",u);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=$.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const n=this._containerDimensions(),a=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],a);const l=this._controlContainer=$.create("div","maplibregl-control-container",u),h=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(_=>{h[_]=$.create("div",`maplibregl-ctrl-${_} `,l)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(u,t,n){this._canvas.width=Math.floor(n*u),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${u}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const u={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",a=>{t={requestedAttributes:u},a&&(t.statusMessage=a.statusMessage,t.type=a.type)},{once:!0});const n=this._canvas.getContext("webgl2",u)||this._canvas.getContext("webgl",u);if(!n){const a="Failed to initialize WebGL";throw t?(t.message=a,new Error(JSON.stringify(t))):new Error(a)}this.painter=new Yl(n,this.transform),We.testSupport(n)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(u){return this.style&&this.style._loaded?(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)}_render(u){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(u),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const l=this.transform.zoom,h=X.now();this.style.zoomHistory.update(l,h);const _=new c.a8(l,{now:h,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),x=_.crossFadingFactor();x===1&&x===this._crossFadingFactor||(n=!0,this._crossFadingFactor=x),this.style.update(_)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new c.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,c.bb.mark(c.bc.load),this.fire(new c.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const a=this._sourcesDirty||this._styleDirty||this._placementDirty;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new c.k("idle")),!this._loaded||this._fullyLoaded||a||(this._fullyLoaded=!0,c.bb.mark(c.bc.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var u;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),Ge.removeThrottleControl(this._imageQueueHandle),(u=this._resizeObserver)===null||u===void 0||u.disconnect();const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),$.remove(this._canvasContainer),$.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),c.bb.clearMetrics(),this._removed=!0,this.fire(new c.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,X.frameAsync(this._frameRequest).then(u=>{c.bb.frame(u),this._frameRequest=null,this._render(u)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(u){this._showTileBoundaries!==u&&(this._showTileBoundaries=u,this._update())}get showPadding(){return!!this._showPadding}set showPadding(u){this._showPadding!==u&&(this._showPadding=u,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(u){this._showCollisionBoxes!==u&&(this._showCollisionBoxes=u,u?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(u){this._showOverdrawInspector!==u&&(this._showOverdrawInspector=u,this._update())}get repaint(){return!!this._repaint}set repaint(u){this._repaint!==u&&(this._repaint=u,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(u){this._vertices=u,this._update()}get version(){return jo}getCameraTargetElevation(){return this.transform.elevation}},S.MapMouseEvent=yr,S.MapTouchEvent=ls,S.MapWheelEvent=On,S.Marker=qs,S.NavigationControl=class{constructor(u){this._updateZoomButtons=()=>{const t=this._map.getZoom(),n=t===this._map.getMaxZoom(),a=t===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=a,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",a.toString())},this._rotateCompassArrow=()=>{const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t},this._setButtonTitle=(t,n)=>{const a=this._map._getUIString(`NavigationControl.${n}`);t.title=a,t.setAttribute("aria-label",a)},this.options=c.e({},Zo,u),this._container=$.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),$.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),$.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=$.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(u){return this._map=u,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Go(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){$.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(u,t){const n=$.create("button",u,this._container);return n.type="button",n.addEventListener("click",t),n}},S.Popup=class extends c.E{constructor(u){super(),this.remove=()=>(this._content&&$.remove(this._content),this._container&&($.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map),this.fire(new c.k("close")),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=$.create("div","maplibregl-popup",this._map.getContainer()),this._tip=$.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const _ of this.options.className.split(" "))this._container.classList.add(_);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Fa(this._lngLat,this._flatPos,this._map.transform)),this._trackPointer&&!t)return;const n=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationPoint(this._lngLat));let a=this.options.anchor;const l=Va(this.options.offset);if(!a){const _=this._container.offsetWidth,x=this._container.offsetHeight;let b;b=n.y+l.bottom.ythis._map.transform.height-x?["bottom"]:[],n.x<_/2?b.push("left"):n.x>this._map.transform.width-_/2&&b.push("right"),a=b.length===0?"bottom":b.join("-")}const h=n.add(l[a]).round();$.setTransform(this._container,`${js[a]} translate(${h.x}px,${h.y}px)`),Oa(this._container,a,"popup")},this._onClose=()=>{this.remove()},this.options=c.e(Object.create(Xo),u)}addTo(u){return this._map&&this.remove(),this._map=u,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new c.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(u){return this._lngLat=c.M.convert(u),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(u){return this.setDOMContent(document.createTextNode(u))}setHTML(u){const t=document.createDocumentFragment(),n=document.createElement("body");let a;for(n.innerHTML=u;a=n.firstChild,a;)t.appendChild(a);return this.setDOMContent(t)}getMaxWidth(){var u;return(u=this._container)===null||u===void 0?void 0:u.style.maxWidth}setMaxWidth(u){return this.options.maxWidth=u,this._update(),this}setDOMContent(u){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=$.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(u),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(u){this._container&&this._container.classList.add(u)}removeClassName(u){this._container&&this._container.classList.remove(u)}setOffset(u){return this.options.offset=u,this._update(),this}toggleClassName(u){if(this._container)return this._container.classList.toggle(u)}_createCloseButton(){this.options.closeButton&&(this._closeButton=$.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const u=this._container.querySelector(Ko);u&&u.focus()}},S.RasterDEMTileSource=xn,S.RasterTileSource=Yi,S.ScaleControl=class{constructor(u){this._onMove=()=>{Zs(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Zs(this._map,this._container,this.options)},this.options=c.e({},Wo,u)}getDefaultPosition(){return"bottom-left"}onAdd(u){return this._map=u,this._container=$.create("div","maplibregl-ctrl maplibregl-ctrl-scale",u.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){$.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},S.ScrollZoomHandler=Vs,S.Style=Er,S.TerrainControl=class{constructor(u){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=u}onAdd(u){return this._map=u,this._container=$.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=$.create("button","maplibregl-ctrl-terrain",this._container),$.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){$.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},S.TwoFingersTouchPitchHandler=Bo,S.TwoFingersTouchRotateHandler=Da,S.TwoFingersTouchZoomHandler=nc,S.TwoFingersTouchZoomRotateHandler=qr,S.VectorTileSource=fe,S.VideoSource=Qn,S.addSourceType=(u,t)=>c._(void 0,void 0,void 0,function*(){if(Mn(u))throw new Error(`A source type called "${u}" already exists.`);((n,a)=>{es[n]=a})(u,t)}),S.clearPrewarmedResources=function(){const u=Ht;u&&(u.isPreloaded()&&u.numActive()===1?(u.release(ei),Ht=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.getMaxParallelImageRequests=function(){return c.a.MAX_PARALLEL_IMAGE_REQUESTS},S.getRTLTextPluginStatus=function(){return Ce().getRTLTextPluginStatus()},S.getVersion=function(){return Jo},S.getWorkerCount=function(){return Nt.workerCount},S.getWorkerUrl=function(){return c.a.WORKER_URL},S.importScriptInWorkers=function(u){return Lt().broadcast("importScript",u)},S.prewarm=function(){Ae().acquire(ei)},S.setMaxParallelImageRequests=function(u){c.a.MAX_PARALLEL_IMAGE_REQUESTS=u},S.setRTLTextPlugin=function(u,t){return Ce().setRTLTextPlugin(u,t)},S.setWorkerCount=function(u){Nt.workerCount=u},S.setWorkerUrl=function(u){c.a.WORKER_URL=u}});var P=v;return P})})(Xp);var o_=Xp.exports;const yn=a_(o_);function ip(f){let g;return v=>{if(v)for(let w in v){let k=g==null?void 0:g[w],P=v[w];k!==P&&f(w,P,k)}else if(g)for(let w in g)f(w,void 0,g[w]);g=v}}function l_(f,...g){let v=[f];for(let w of g)if(w)Array.isArray(w)&&w[0]===f?v.push(...w.slice(1)):v.push(w);else continue;if(v.length!==1)return v.length===2?v[1]:v}function c_(f){return f===!0?["has","point_count"]:f===!1?["!",["has","point_count"]]:void 0}function cy(f,g){return["case",["boolean",["feature-state","hover"],!1],g,f]}var Jp=u_;function u_(f){var g,v,w;if(f){if(Array.isArray(f)){for(g=[],v=f.length,w=0;w{w=null}),po())},i(k){v||(Qt(w),v=!0)},o(k){_i(w),v=!1},d(k){k&&It(g),w&&w.d(k)}}}function d_(f,g,v){let w,k,P,S,c,ne,ie,re,X,$,We,qe,{$$slots:ut={},$$scope:et}=g,{id:pt=Wp("layer")}=g,{source:Xe=void 0}=g,{sourceLayer:Ge=void 0}=g,{beforeId:rt=void 0}=g,{beforeLayerType:ot=void 0}=g,{type:Bt}=g,{paint:Ke=void 0}=g,{layout:Dt=void 0}=g,{filter:ct=void 0}=g,{applyToClusters:_t=void 0}=g,{minzoom:_e=void 0}=g,{maxzoom:Ze=void 0}=g,{manageHoverState:nt=!1}=g,{hovered:yt=null}=g,{interactive:bt=!0}=g,{hoverCursor:st=void 0}=g,{eventsIfTopMost:qt=!1}=g;const wt=kp(),{map:Hi,source:Ii,self:Ft,minzoom:At,maxzoom:ei,eventTopMost:Nt,layerInfo:hi}=r_();Rr(f,Hi,he=>v(31,X=he)),Rr(f,Ii,he=>v(32,$=he)),Rr(f,Ft,he=>v(0,re=he)),Rr(f,At,he=>v(34,qe=he)),Rr(f,ei,he=>v(33,We=he)),ia(()=>{re&&X&&(hi.delete(re),X==null||X.removeLayer(re))});let Ht;function Wt(he){var fe,Yi;if(!bt||!re||!X||qt&&Nt(he)!==re)return;let Ot=he.features??[],jt=(Yi=(fe=Ot[0])==null?void 0:fe.properties)==null?void 0:Yi.cluster_id,Wi={event:he,map:X,clusterId:jt,layer:re,source:c,features:Ot};wt(he.type,Wi)}function Ae(he){var fe,Yi;if(!bt||!re||!X||qt&&Nt(he)!==re)return;st&&(X.getCanvas().style.cursor=st);let Ot=he.features??[];v(6,yt=Ot[0]??null);let jt=(Yi=(fe=Ot[0])==null?void 0:fe.properties)==null?void 0:Yi.cluster_id;wt("mouseenter",{event:he,map:X,clusterId:jt,layer:re,source:c,features:Ot})}function it(he){var fe,Yi,xn;if(!bt||!X)return;if(qt&&Nt(he)!==re){v(6,yt=null),nt&&Ht!==void 0&&(X==null||X.setFeatureState({source:c,sourceLayer:Ge,id:Ht},{hover:!1}),Ht=void 0);return}X.getCanvas().style.cursor=st;let Ot=he.features??[],jt=(Yi=(fe=Ot[0])==null?void 0:fe.properties)==null?void 0:Yi.cluster_id,Wi=(xn=Ot[0])==null?void 0:xn.id;Wi!==Ht&&(nt&&(Ht!==void 0&&(X==null||X.setFeatureState({source:c,id:Ht,sourceLayer:Ge},{hover:!1})),X==null||X.setFeatureState({source:c,id:Wi,sourceLayer:Ge},{hover:!0})),Ht=Wi,v(6,yt=Ot[0]??null)),wt("mousemove",{event:he,map:X,clusterId:jt,layer:re,source:c,features:Ot})}function Lt(he){if(!(!bt||!re||!X)){if(st&&(X.getCanvas().style.cursor=""),v(6,yt=null),nt&&Ht!==void 0){const Ot={source:c,id:Ht,sourceLayer:Ge};X==null||X.setFeatureState(Ot,{hover:!1}),Ht=void 0}wt("mouseleave",{map:X,layer:re,source:c})}}let Mi=!0;function Ji(he){X&&(X.off("click",he,Wt),X.off("dblclick",he,Wt),X.off("contextmenu",he,Wt),X.off("mouseenter",he,Ae),X.off("mousemove",he,it),X.off("mouseleave",he,Lt))}return ia(()=>{X&&re&&Ji(re)}),f.$$set=he=>{"id"in he&&v(7,pt=he.id),"source"in he&&v(8,Xe=he.source),"sourceLayer"in he&&v(9,Ge=he.sourceLayer),"beforeId"in he&&v(10,rt=he.beforeId),"beforeLayerType"in he&&v(11,ot=he.beforeLayerType),"type"in he&&v(12,Bt=he.type),"paint"in he&&v(13,Ke=he.paint),"layout"in he&&v(14,Dt=he.layout),"filter"in he&&v(15,ct=he.filter),"applyToClusters"in he&&v(16,_t=he.applyToClusters),"minzoom"in he&&v(17,_e=he.minzoom),"maxzoom"in he&&v(18,Ze=he.maxzoom),"manageHoverState"in he&&v(19,nt=he.manageHoverState),"hovered"in he&&v(6,yt=he.hovered),"interactive"in he&&v(20,bt=he.interactive),"hoverCursor"in he&&v(21,st=he.hoverCursor),"eventsIfTopMost"in he&&v(22,qt=he.eventsIfTopMost),"$$scope"in he&&v(35,et=he.$$scope)},f.$$.update=()=>{if(f.$$.dirty[0]&65536&&v(30,w=c_(_t)),f.$$.dirty[0]&1073774592&&v(24,k=l_("all",w,ct)),f.$$.dirty[0]&131072|f.$$.dirty[1]&8&&v(26,P=_e??qe),f.$$.dirty[0]&262144|f.$$.dirty[1]&4&&v(25,S=Ze??We),f.$$.dirty[0]&256|f.$$.dirty[1]&2&&v(29,c=Xe||$),f.$$.dirty[0]&654343809|f.$$.dirty[1]&1&&X&&re!==pt&&c){re&&(Ji(re),hi.delete(re));let he=rt;if(!rt&&ot){let Ot=X.getStyle().layers,jt=typeof ot=="function"?ot:fe=>fe.type===ot,Wi=Ot==null?void 0:Ot.find(jt);Wi&&(he=Wi.id)}Nc(Ft,re=pt,re),X.addLayer(Jp({id:re,type:Bt,source:c,"source-layer":Ge,filter:k,paint:Ke,layout:Dt,minzoom:P,maxzoom:S}),he),v(23,Mi=!0),X.on("click",re,Wt),X.on("dblclick",re,Wt),X.on("contextmenu",re,Wt),X.on("mouseenter",re,Ae),X.on("mousemove",re,it),X.on("mouseleave",re,Lt)}f.$$.dirty[0]&1048577&&re&&hi.set(re,{interactive:bt}),f.$$.dirty[0]&1|f.$$.dirty[1]&1&&v(28,ne=re?ip((he,Ot)=>X==null?void 0:X.setPaintProperty(re,he,Ot)):void 0),f.$$.dirty[0]&1|f.$$.dirty[1]&1&&v(27,ie=re?ip((he,Ot)=>X==null?void 0:X.setLayoutProperty(re,he,Ot)):void 0),f.$$.dirty[0]&268443648&&(ne==null||ne(Ke)),f.$$.dirty[0]&134234112&&(ie==null||ie(Dt)),f.$$.dirty[0]&100663297|f.$$.dirty[1]&1&&re&&(X==null||X.setLayerZoomRange(re,P,S)),f.$$.dirty[0]&25165825|f.$$.dirty[1]&1&&re&&(Mi?v(23,Mi=!1):X==null||X.setFilter(re,k))},[re,Hi,Ii,Ft,At,ei,yt,pt,Xe,Ge,rt,ot,Bt,Ke,Dt,ct,_t,_e,Ze,nt,bt,st,qt,Mi,k,S,P,ie,ne,c,w,X,$,We,qe,et,ut]}class p_ extends $r{constructor(g){super(),Qr(this,g,d_,h_,Br,{id:7,source:8,sourceLayer:9,beforeId:10,beforeLayerType:11,type:12,paint:13,layout:14,filter:15,applyToClusters:16,minzoom:17,maxzoom:18,manageHoverState:19,hovered:6,interactive:20,hoverCursor:21,eventsIfTopMost:22},null,[-1,-1])}}function f_(f,g,v){let w;const{map:k}=fo();Rr(f,k,ne=>v(4,w=ne));let{position:P="top-left"}=g,{container:S=void 0}=g,c=null;return ia(()=>{w!=null&&w.loaded()&&c&&w.removeControl(c)}),f.$$set=ne=>{"position"in ne&&v(1,P=ne.position),"container"in ne&&v(2,S=ne.container)},f.$$.update=()=>{if(f.$$.dirty&30&&w&&!c){let ne;typeof S=="string"?ne=document.querySelector(S)??void 0:ne=S,v(3,c=new yn.FullscreenControl({container:ne})),w.addControl(c,P)}},[k,P,S,c,w]}class m_ extends $r{constructor(g){super(),Qr(this,g,f_,null,Br,{position:1,container:2})}}function g_(f,g,v){let w;const{map:k}=fo();Rr(f,k,$=>v(8,w=$));let{position:P="top-left"}=g,{positionOptions:S=void 0}=g,{fitBoundsOptions:c=void 0}=g,{trackUserLocation:ne=!1}=g,{showAccuracyCircle:ie=!0}=g,{showUserLocation:re=!0}=g,X=null;return ia(()=>{w!=null&&w.loaded()&&X&&w.removeControl(X)}),f.$$set=$=>{"position"in $&&v(1,P=$.position),"positionOptions"in $&&v(2,S=$.positionOptions),"fitBoundsOptions"in $&&v(3,c=$.fitBoundsOptions),"trackUserLocation"in $&&v(4,ne=$.trackUserLocation),"showAccuracyCircle"in $&&v(5,ie=$.showAccuracyCircle),"showUserLocation"in $&&v(6,re=$.showUserLocation)},f.$$.update=()=>{f.$$.dirty&510&&w&&!X&&(v(7,X=new yn.GeolocateControl({positionOptions:S,fitBoundsOptions:c,trackUserLocation:ne,showAccuracyCircle:ie,showUserLocation:re})),w.addControl(X,P))},[k,P,S,c,ne,ie,re,X,w]}class __ extends $r{constructor(g){super(),Qr(this,g,g_,null,Br,{position:1,positionOptions:2,fitBoundsOptions:3,trackUserLocation:4,showAccuracyCircle:5,showUserLocation:6})}}function y_(f){let g;const v=f[15].default,w=Qs(v,f,f[23],null);return{c(){w&&w.c()},m(k,P){w&&w.m(k,P),g=!0},p(k,P){w&&w.p&&(!g||P&8388608)&&ea(w,v,k,k[23],g?$s(v,k[23],P,null):ta(k[23]),null)},i(k){g||(Qt(w,k),g=!0)},o(k){_i(w,k),g=!1},d(k){w&&w.d(k)}}}function x_(f){let g,v,w;function k(S){f[16](S)}let P={id:f[1],type:"line",source:f[2],sourceLayer:f[3],beforeId:f[4],beforeLayerType:f[5],paint:f[6],layout:f[7],filter:f[8],minzoom:f[9],maxzoom:f[10],hoverCursor:f[11],manageHoverState:f[12],eventsIfTopMost:f[13],interactive:f[14],$$slots:{default:[y_]},$$scope:{ctx:f}};return f[0]!==void 0&&(P.hovered=f[0]),g=new p_({props:P}),Al.push(()=>ng(g,"hovered",k)),g.$on("click",f[17]),g.$on("dblclick",f[18]),g.$on("contextmenu",f[19]),g.$on("mouseenter",f[20]),g.$on("mousemove",f[21]),g.$on("mouseleave",f[22]),{c(){no(g.$$.fragment)},m(S,c){Js(g,S,c),w=!0},p(S,[c]){const ne={};c&2&&(ne.id=S[1]),c&4&&(ne.source=S[2]),c&8&&(ne.sourceLayer=S[3]),c&16&&(ne.beforeId=S[4]),c&32&&(ne.beforeLayerType=S[5]),c&64&&(ne.paint=S[6]),c&128&&(ne.layout=S[7]),c&256&&(ne.filter=S[8]),c&512&&(ne.minzoom=S[9]),c&1024&&(ne.maxzoom=S[10]),c&2048&&(ne.hoverCursor=S[11]),c&4096&&(ne.manageHoverState=S[12]),c&8192&&(ne.eventsIfTopMost=S[13]),c&16384&&(ne.interactive=S[14]),c&8388608&&(ne.$$scope={dirty:c,ctx:S}),!v&&c&1&&(v=!0,ne.hovered=S[0],tg(()=>v=!1)),g.$set(ne)},i(S){w||(Qt(g.$$.fragment,S),w=!0)},o(S){_i(g.$$.fragment,S),w=!1},d(S){Ys(g,S)}}}function v_(f,g,v){let{$$slots:w={},$$scope:k}=g,{id:P=Wp("line")}=g,{source:S=void 0}=g,{sourceLayer:c=void 0}=g,{beforeId:ne=void 0}=g,{beforeLayerType:ie=void 0}=g,{paint:re}=g,{layout:X=void 0}=g,{filter:$=void 0}=g,{minzoom:We=void 0}=g,{maxzoom:qe=void 0}=g,{hoverCursor:ut=void 0}=g,{manageHoverState:et=!1}=g,{hovered:pt=null}=g,{eventsIfTopMost:Xe=!1}=g,{interactive:Ge=!0}=g;function rt(_e){pt=_e,v(0,pt)}function ot(_e){Qa.call(this,f,_e)}function Bt(_e){Qa.call(this,f,_e)}function Ke(_e){Qa.call(this,f,_e)}function Dt(_e){Qa.call(this,f,_e)}function ct(_e){Qa.call(this,f,_e)}function _t(_e){Qa.call(this,f,_e)}return f.$$set=_e=>{"id"in _e&&v(1,P=_e.id),"source"in _e&&v(2,S=_e.source),"sourceLayer"in _e&&v(3,c=_e.sourceLayer),"beforeId"in _e&&v(4,ne=_e.beforeId),"beforeLayerType"in _e&&v(5,ie=_e.beforeLayerType),"paint"in _e&&v(6,re=_e.paint),"layout"in _e&&v(7,X=_e.layout),"filter"in _e&&v(8,$=_e.filter),"minzoom"in _e&&v(9,We=_e.minzoom),"maxzoom"in _e&&v(10,qe=_e.maxzoom),"hoverCursor"in _e&&v(11,ut=_e.hoverCursor),"manageHoverState"in _e&&v(12,et=_e.manageHoverState),"hovered"in _e&&v(0,pt=_e.hovered),"eventsIfTopMost"in _e&&v(13,Xe=_e.eventsIfTopMost),"interactive"in _e&&v(14,Ge=_e.interactive),"$$scope"in _e&&v(23,k=_e.$$scope)},[pt,P,S,c,ne,ie,re,X,$,We,qe,ut,et,Xe,Ge,w,rt,ot,Bt,Ke,Dt,ct,_t,k]}class uy extends $r{constructor(g){super(),Qr(this,g,v_,x_,Br,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function b_(f){let g=f.getCenter(),v=Math.round(f.getZoom()*100)/100,w=Math.ceil((v*Math.LN2+Math.log(512/360/.5))/Math.LN10),k=Math.pow(10,w),P=Math.round(g.lat*k)/k,S=Math.round(g.lng*k)/k,c=`${v}/${P}/${S}`,ne=f.getBearing(),ie=f.getPitch();return(ne||ie)&&(c+=`/${Math.round(ne*10)/10}`),ie&&(c+=`/${Math.round(ie)}`),`#${c}`}function w_(f){return f.replace("#","").split("/").map(parseFloat)}var Fc=gh;function gh(f,g){return f===g||f!==f&&g!==g?!0:typeof f!=typeof g||{}.toString.call(f)!={}.toString.call(g)||f!==Object(f)||!f?!1:Array.isArray(f)?sp(f,g):{}.toString.call(f)=="[object Set]"?sp(Array.from(f),Array.from(g)):{}.toString.call(f)=="[object Object]"?S_(f,g):T_(f,g)}function T_(f,g){return f.toString()===g.toString()}function sp(f,g){var v=f.length;if(v!=g.length)return!1;for(var w=0;wv(6,w=re));let{position:P="top-left"}=g,{showCompass:S=!0}=g,{showZoom:c=!0}=g,{visualizePitch:ne=!1}=g,ie=null;return ia(()=>{w!=null&&w.loaded()&&ie&&w.removeControl(ie)}),f.$$set=re=>{"position"in re&&v(1,P=re.position),"showCompass"in re&&v(2,S=re.showCompass),"showZoom"in re&&v(3,c=re.showZoom),"visualizePitch"in re&&v(4,ne=re.visualizePitch)},f.$$.update=()=>{f.$$.dirty&126&&w&&!ie&&(v(5,ie=new yn.NavigationControl({showCompass:S,showZoom:c,visualizePitch:ne})),w.addControl(ie,P))},[k,P,S,c,ne,ie,w]}class A_ extends $r{constructor(g){super(),Qr(this,g,I_,null,Br,{position:1,showCompass:2,showZoom:3,visualizePitch:4})}}function C_(f,g,v){let w;const{map:k}=fo();Rr(f,k,ie=>v(5,w=ie));let{position:P="bottom-left"}=g,{maxWidth:S=void 0}=g,{unit:c="metric"}=g,ne=null;return ia(()=>{w!=null&&w.loaded()&&ne&&w.removeControl(ne)}),f.$$set=ie=>{"position"in ie&&v(1,P=ie.position),"maxWidth"in ie&&v(2,S=ie.maxWidth),"unit"in ie&&v(3,c=ie.unit)},f.$$.update=()=>{f.$$.dirty&62&&w&&!ne&&(v(4,ne=new yn.ScaleControl({maxWidth:S,unit:c})),w.addControl(ne,P))},[k,P,S,c,ne,w]}class k_ extends $r{constructor(g){super(),Qr(this,g,C_,null,Br,{position:1,maxWidth:2,unit:3})}}const E_=f=>({map:f[0]&8,loadedImages:f[0]&16,allImagesLoaded:f[0]&32}),ap=f=>({map:f[3],loadedImages:f[4],allImagesLoaded:f[5]});function op(f){let g,v,w=f[2]&&lp(f);const k=f[35].default,P=Qs(k,f,f[34],ap);return{c(){w&&w.c(),g=xi(),P&&P.c()},m(S,c){w&&w.m(S,c),Et(S,g,c),P&&P.m(S,c),v=!0},p(S,c){S[2]?w?(w.p(S,c),c[0]&4&&Qt(w,1)):(w=lp(S),w.c(),Qt(w,1),w.m(g.parentNode,g)):w&&(ho(),_i(w,1,1,()=>{w=null}),po()),P&&P.p&&(!v||c[0]&56|c[1]&8)&&ea(P,k,S,S[34],v?$s(k,S[34],c,E_):ta(S[34]),ap)},i(S){v||(Qt(w),Qt(P,S),v=!0)},o(S){_i(w),_i(P,S),v=!1},d(S){S&&It(g),w&&w.d(S),P&&P.d(S)}}}function lp(f){let g,v,w,k,P,S,c,ne;return g=new A_({props:{position:f[6]}}),w=new __({props:{position:f[6],fitBoundsOptions:{maxZoom:12}}}),P=new m_({props:{position:f[6]}}),c=new k_({props:{position:f[6]}}),{c(){no(g.$$.fragment),v=xi(),no(w.$$.fragment),k=xi(),no(P.$$.fragment),S=xi(),no(c.$$.fragment)},m(ie,re){Js(g,ie,re),Et(ie,v,re),Js(w,ie,re),Et(ie,k,re),Js(P,ie,re),Et(ie,S,re),Js(c,ie,re),ne=!0},p(ie,re){const X={};re[0]&64&&(X.position=ie[6]),g.$set(X);const $={};re[0]&64&&($.position=ie[6]),w.$set($);const We={};re[0]&64&&(We.position=ie[6]),P.$set(We);const qe={};re[0]&64&&(qe.position=ie[6]),c.$set(qe)},i(ie){ne||(Qt(g.$$.fragment,ie),Qt(w.$$.fragment,ie),Qt(P.$$.fragment,ie),Qt(c.$$.fragment,ie),ne=!0)},o(ie){_i(g.$$.fragment,ie),_i(w.$$.fragment,ie),_i(P.$$.fragment,ie),_i(c.$$.fragment,ie),ne=!1},d(ie){ie&&(It(v),It(k),It(S)),Ys(g,ie),Ys(w,ie),Ys(P,ie),Ys(c,ie)}}}function M_(f){let g,v,w,k,P,S=f[3]&&f[0]&&op(f);return{c(){g=kt("div"),S&&S.c(),ai(g,"class",v=Xd(f[1])+" svelte-p00lfq"),Jd(g,"expand-map",!f[1])},m(c,ne){Et(c,g,ne),S&&S.m(g,null),w=!0,k||(P=Xm(f[9].call(null,g)),k=!0)},p(c,ne){c[3]&&c[0]?S?(S.p(c,ne),ne[0]&9&&Qt(S,1)):(S=op(c),S.c(),Qt(S,1),S.m(g,null)):S&&(ho(),_i(S,1,1,()=>{S=null}),po()),(!w||ne[0]&2&&v!==(v=Xd(c[1])+" svelte-p00lfq"))&&ai(g,"class",v),(!w||ne[0]&2)&&Jd(g,"expand-map",!c[1])},i(c){w||(Qt(S),w=!0)},o(c){_i(S),w=!1},d(c){c&&It(g),S&&S.d(),k=!1,P()}}}function P_(f,g,v){let w,k,P,S,{$$slots:c={},$$scope:ne}=g,{map:ie=null}=g,{class:re=void 0}=g,{style:X}=g,{diffStyleUpdates:$=!1}=g,{center:We=void 0}=g,{zoom:qe=void 0}=g,{pitch:ut=0}=g,{bearing:et=0}=g,{bounds:pt=void 0}=g,{hash:Xe=!1}=g,{loaded:Ge=!1}=g,{minZoom:rt=0}=g,{maxZoom:ot=22}=g,{zoomOnDoubleClick:Bt=!0}=g,{locale:Ke=void 0}=g,{interactive:Dt=!0}=g,{attributionControl:ct=!0}=g,{cooperativeGestures:_t=!1}=g,{preserveDrawingBuffer:_e=!1}=g,{maxBounds:Ze=void 0}=g,{images:nt=[]}=g,{standardControls:yt=!1}=g,{filterLayers:bt=void 0}=g,{transformRequest:st=void 0}=g;const qt=kp(),{map:wt,loadedImages:Hi}=i_();Rr(f,wt,Ae=>v(3,P=Ae)),Rr(f,Hi,Ae=>v(4,S=Ae));let Ii=new Set;async function Ft(Ae){if(P!=null&&P.loaded())if("url"in Ae){Ii.add(Ae.id);try{let it=await P.loadImage(Ae.url);P==null||P.addImage(Ae.id,it.data,Ae.options),S.add(Ae.id),Hi.set(S)}catch(it){qt("error",it)}finally{Ii.delete(Ae.id)}}else P.addImage(Ae.id,Ae.data,Ae.options),S.add(Ae.id),Hi.set(S)}let At,ei,Nt,hi;function Ht(Ae){if(Xe){let it=w_(window.location.hash);it.length>=3&&(v(11,qe=it[0]),v(10,We=[it[2],it[1]])),it.length==5&&(v(15,et=it[3]),v(14,ut=it[4]))}return Nc(wt,P=new yn.Map(Jp({container:Ae,style:X,locale:Ke,center:We,zoom:qe,pitch:ut,bearing:et,minZoom:rt,maxZoom:ot,interactive:Dt,preserveDrawingBuffer:_e,maxBounds:Ze,bounds:pt,attributionControl:ct,transformRequest:st,cooperativeGestures:_t})),P),P.on("load",it=>{v(0,Ge=!0),qt("load",P)}),P.on("error",it=>qt("error",{...it,map:P})),P.on("movestart",it=>qt("movestart",{...it,map:P})),P.on("moveend",it=>{if(v(10,We=it.target.getCenter()),v(11,qe=it.target.getZoom()),v(12,pt=it.target.getBounds()),qt("moveend",{...it,map:P}),Xe){let Lt=window.location.href.replace(/(#.+)?$/,b_(P));window.history.replaceState(window.history.state,"",Lt)}}),P.on("zoomstart",it=>qt("zoomstart",{...it,map:P})),P.on("zoom",it=>{v(11,qe=it.target.getZoom()),qt("zoom",{...it,map:P})}),P.on("zoomend",it=>{v(11,qe=it.target.getZoom()),qt("zoomend",{...it,map:P})}),P.on("style.load",()=>{if(P){const it=P.getStyle();if(v(31,At=it.layers.map(Lt=>Lt.id)),v(32,ei=Object.keys(it.sources)),hi)for(const[Lt,Mi]of Object.entries(hi))P.addSource(Lt,Mi);if(Nt)for(const Lt of Nt)P.addLayer(Lt)}}),P.on("styledata",it=>{if(P&&bt){const Lt=P.getStyle().layers;if(Lt)for(let Mi of Lt)bt(Mi)||P.setLayoutProperty(Mi.id,"visibility","none")}qt("styledata",{...it,map:P})}),{destroy(){v(0,Ge=!1),P==null||P.remove(),Nc(wt,P=null,P)}}}let Wt=X;return f.$$set=Ae=>{"map"in Ae&&v(13,ie=Ae.map),"class"in Ae&&v(1,re=Ae.class),"style"in Ae&&v(16,X=Ae.style),"diffStyleUpdates"in Ae&&v(17,$=Ae.diffStyleUpdates),"center"in Ae&&v(10,We=Ae.center),"zoom"in Ae&&v(11,qe=Ae.zoom),"pitch"in Ae&&v(14,ut=Ae.pitch),"bearing"in Ae&&v(15,et=Ae.bearing),"bounds"in Ae&&v(12,pt=Ae.bounds),"hash"in Ae&&v(18,Xe=Ae.hash),"loaded"in Ae&&v(0,Ge=Ae.loaded),"minZoom"in Ae&&v(19,rt=Ae.minZoom),"maxZoom"in Ae&&v(20,ot=Ae.maxZoom),"zoomOnDoubleClick"in Ae&&v(21,Bt=Ae.zoomOnDoubleClick),"locale"in Ae&&v(22,Ke=Ae.locale),"interactive"in Ae&&v(23,Dt=Ae.interactive),"attributionControl"in Ae&&v(24,ct=Ae.attributionControl),"cooperativeGestures"in Ae&&v(25,_t=Ae.cooperativeGestures),"preserveDrawingBuffer"in Ae&&v(26,_e=Ae.preserveDrawingBuffer),"maxBounds"in Ae&&v(27,Ze=Ae.maxBounds),"images"in Ae&&v(28,nt=Ae.images),"standardControls"in Ae&&v(2,yt=Ae.standardControls),"filterLayers"in Ae&&v(29,bt=Ae.filterLayers),"transformRequest"in Ae&&v(30,st=Ae.transformRequest),"$$scope"in Ae&&v(34,ne=Ae.$$scope)},f.$$.update=()=>{if(f.$$.dirty[0]&4&&v(6,w=typeof yt=="boolean"?void 0:yt),f.$$.dirty[0]&8&&v(13,ie=P),f.$$.dirty[0]&268435465&&Ge&&P!=null&&P.loaded())for(let Ae of nt)!Ii.has(Ae.id)&&!P.hasImage(Ae.id)&&Ft(Ae);if(f.$$.dirty[0]&268435472&&v(5,k=nt.every(Ae=>S.has(Ae.id))),f.$$.dirty[0]&196616|f.$$.dirty[1]&7&&P&&!Fc(X,Wt)){const Ae=P.getStyle();if(At&&(Nt=Ae.layers.filter(it=>!At.includes(it.id))),ei){const it=Object.keys(Ae.sources).filter(Lt=>!ei.includes(Lt));hi={};for(const Lt of it)hi[Lt]=Ae.sources[Lt]}v(33,Wt=X),P.setStyle(X,{diff:$})}f.$$.dirty[0]&1032&&We&&!Fc(We,P==null?void 0:P.getCenter())&&(P==null||P.panTo(We)),f.$$.dirty[0]&2056&&qe&&!Fc(qe,P==null?void 0:P.getZoom())&&(P==null||P.zoomTo(qe)),f.$$.dirty[0]&4104&&pt&&!Fc(pt,P==null?void 0:P.getBounds())&&(P==null||P.fitBounds(pt)),f.$$.dirty[0]&2097160&&(Bt?P==null||P.doubleClickZoom.enable():P==null||P.doubleClickZoom.disable())},[Ge,re,yt,P,S,k,w,wt,Hi,Ht,We,qe,pt,ie,ut,et,X,$,Xe,rt,ot,Bt,Ke,Dt,ct,_t,_e,Ze,nt,bt,st,At,ei,Wt,ne,c]}class hy extends $r{constructor(g){super(),Qr(this,g,P_,M_,Br,{map:13,class:1,style:16,diffStyleUpdates:17,center:10,zoom:11,pitch:14,bearing:15,bounds:12,hash:18,loaded:0,minZoom:19,maxZoom:20,zoomOnDoubleClick:21,locale:22,interactive:23,attributionControl:24,cooperativeGestures:25,preserveDrawingBuffer:26,maxBounds:27,images:28,standardControls:2,filterLayers:29,transformRequest:30},null,[-1,-1])}}const z_=f=>({features:f[0]&16,data:f[0]&16,map:f[0]&4,close:f[0]&1}),cp=f=>{var g;return{features:f[4],data:(g=f[4])==null?void 0:g[0],map:f[2],close:f[31]}};function up(f){let g,v,w=(f[4]||f[3]instanceof yn.Marker)&&hp(f);return{c(){g=kt("div"),w&&w.c()},m(k,P){Et(k,g,P),w&&w.m(g,null),f[32](g),v=!0},p(k,P){k[4]||k[3]instanceof yn.Marker?w?(w.p(k,P),P[0]&24&&Qt(w,1)):(w=hp(k),w.c(),Qt(w,1),w.m(g,null)):w&&(ho(),_i(w,1,1,()=>{w=null}),po())},i(k){v||(Qt(w),v=!0)},o(k){_i(w),v=!1},d(k){k&&It(g),w&&w.d(),f[32](null)}}}function hp(f){let g;const v=f[30].default,w=Qs(v,f,f[29],cp);return{c(){w&&w.c()},m(k,P){w&&w.m(k,P),g=!0},p(k,P){w&&w.p&&(!g||P[0]&536870933)&&ea(w,v,k,k[29],g?$s(v,k[29],P,z_):ta(k[29]),cp)},i(k){g||(Qt(w,k),g=!0)},o(k){_i(w,k),g=!1},d(k){w&&w.d(k)}}}function D_(f){let g,v,w=f[9].default&&up(f);return{c(){w&&w.c(),g=Gc()},m(k,P){w&&w.m(k,P),Et(k,g,P),v=!0},p(k,P){k[9].default?w?(w.p(k,P),P[0]&512&&Qt(w,1)):(w=up(k),w.c(),Qt(w,1),w.m(g.parentNode,g)):w&&(ho(),_i(w,1,1,()=>{w=null}),po())},i(k){v||(Qt(w),v=!0)},o(k){_i(w),v=!1},d(k){k&&It(g),w&&w.d(k)}}}function L_(f,g,v){let w,k,P,S,c,ne,{$$slots:ie={},$$scope:re}=g;const X=Wm(ie);let{closeButton:$=void 0}=g,{closeOnClickOutside:We=!0}=g,{closeOnClickInside:qe=!1}=g,{closeOnMove:ut=!1}=g,{openOn:et="click"}=g,{openIfTopMost:pt=!0}=g,{focusAfterOpen:Xe=!0}=g,{anchor:Ge=void 0}=g,{offset:rt=void 0}=g,{popupClass:ot=void 0}=g,{maxWidth:Bt=void 0}=g,{lngLat:Ke=void 0}=g,{html:Dt=void 0}=g,{open:ct=!1}=g;const{map:_t,popupTarget:_e,layerEvent:Ze,layer:nt,eventTopMost:yt}=fo();Rr(f,_t,he=>v(2,P=he)),Rr(f,_e,he=>v(3,c=he)),Rr(f,Ze,he=>v(28,S=he)),Rr(f,nt,he=>v(35,ne=he));const bt=["click","dblclick","contextmenu"];let st,qt=!1,wt;function Hi(){if(!st)return;let he=st.getElement();!he||he===wt||(wt=he,et==="hover"&&(wt.style.pointerEvents="none"),wt.addEventListener("mouseenter",()=>{v(24,qt=!0)},{passive:!0}),wt.addEventListener("mouseleave",()=>{v(24,qt=!1)},{passive:!0}),wt.addEventListener("click",()=>{qe&&v(0,ct=!1)},{passive:!0}))}$m(()=>{if(P)return P.on("click",it),P.on("contextmenu",it),typeof c=="string"&&(P.on("click",c,ei),P.on("dblclick",c,ei),P.on("contextmenu",c,ei),P.on("mousemove",c,Ae),P.on("mouseleave",c,Wt),P.on("touchstart",c,hi),P.on("touchend",c,Ht)),()=>{P!=null&&P.loaded()&&(st==null||st.remove(),P.off("click",it),P.off("contextmenu",it),c instanceof yn.Marker?c.getPopup()===st&&c.setPopup(void 0):typeof c=="string"&&(P.off("click",c,ei),P.off("dblclick",c,ei),P.off("contextmenu",c,ei),P.off("mousemove",c,Ae),P.off("mouseleave",c,Wt),P.off("touchstart",c,hi),P.off("touchend",c,Ht)))}});function Ii(he){return pt?!("marker"in he)&&!n_(he)&&yt(he)!==ne:!1}let Ft=null,At="normal";function ei(he){he.type===et&&(Ii(he)||("layerType"in he?he.layerType==="deckgl"?(v(10,Ke=he.coordinate),v(4,Ft=he.object?[he.object]:null)):(v(10,Ke=he.lngLat),v(4,Ft=he.features??[])):(v(10,Ke=he.lngLat),v(4,Ft=he.features??[])),setTimeout(()=>v(0,ct=!0))))}let Nt=null;function hi(he){Nt=he.point}function Ht(he){if(!Nt||et!=="hover")return;let Ot=Nt.dist(he.point);Nt=null,Ot<3&&(v(10,Ke=he.lngLat),v(4,Ft=he.features??[]),st.isOpen()?v(25,At="justOpened"):(v(25,At="opening"),v(0,ct=!0)))}function Wt(he){et!=="hover"||Nt||At!=="normal"||(v(0,ct=!1),v(4,Ft=null))}function Ae(he){if(!(et!=="hover"||Nt||At!=="normal")){if(Ii(he)){v(0,ct=!1),v(4,Ft=null);return}v(0,ct=!0),v(4,Ft=he.features??[]),v(10,Ke=he.lngLat)}}function it(he){if(At==="justOpened"){v(25,At="normal");return}if(!We)return;let Ot=[wt,c instanceof yn.Marker?c==null?void 0:c.getElement():null];ct&&st.isOpen()&&!Ot.some(jt=>jt==null?void 0:jt.contains(he.originalEvent.target))&&(he.type==="contextmenu"&&et==="contextmenu"||he.type!=="contextmenu")&&v(0,ct=!1)}ia(()=>{P&&(st!=null&&st.isOpen())&&st.remove()});let Lt;const Mi=()=>v(0,ct=!1);function Ji(he){Al[he?"unshift":"push"](()=>{Lt=he,v(1,Lt)})}return f.$$set=he=>{"closeButton"in he&&v(11,$=he.closeButton),"closeOnClickOutside"in he&&v(12,We=he.closeOnClickOutside),"closeOnClickInside"in he&&v(13,qe=he.closeOnClickInside),"closeOnMove"in he&&v(14,ut=he.closeOnMove),"openOn"in he&&v(15,et=he.openOn),"openIfTopMost"in he&&v(16,pt=he.openIfTopMost),"focusAfterOpen"in he&&v(17,Xe=he.focusAfterOpen),"anchor"in he&&v(18,Ge=he.anchor),"offset"in he&&v(19,rt=he.offset),"popupClass"in he&&v(20,ot=he.popupClass),"maxWidth"in he&&v(21,Bt=he.maxWidth),"lngLat"in he&&v(10,Ke=he.lngLat),"html"in he&&v(22,Dt=he.html),"open"in he&&v(0,ct=he.open),"$$scope"in he&&v(29,re=he.$$scope)},f.$$.update=()=>{if(f.$$.dirty[0]&14336&&v(27,w=$??(!We&&!qe)),f.$$.dirty[0]&146685952&&(st||(v(23,st=new yn.Popup({closeButton:w,closeOnClick:!1,closeOnMove:ut,focusAfterOpen:Xe,maxWidth:Bt,className:ot,anchor:Ge,offset:rt})),wt=st.getElement(),st.on("open",()=>{v(0,ct=!0),Hi()}),st.on("close",he=>{v(0,ct=!1)}))),f.$$.dirty[0]&8421384&&st&&c instanceof yn.Marker&&(et==="click"?c.setPopup(st):c.getPopup()===st&&c.setPopup(void 0)),f.$$.dirty[0]&268468224&&bt.includes(et)&&(S==null?void 0:S.type)===et&&(ei(S),Nc(Ze,S=null,S)),f.$$.dirty[0]&268468224&&v(26,k=et==="hover"&&((S==null?void 0:S.type)==="mousemove"||(S==null?void 0:S.type)==="mouseenter")),f.$$.dirty[0]&352354304&&et==="hover"&&Ze&&(k&&S&&(S.layerType==="deckgl"?(v(10,Ke=S.coordinate),v(4,Ft=S.object?[S.object]:null)):(v(10,Ke=S.lngLat),v(4,Ft=S.features??[]))),v(0,ct=(k||qt)??!1)),f.$$.dirty[0]&12582914&&(Lt?st.setDOMContent(Lt):Dt&&st.setHTML(Dt)),f.$$.dirty[0]&8389632&&Ke&&st.setLngLat(Ke),f.$$.dirty[0]&41943045&&P){let he=st.isOpen();ct&&!he?(st.addTo(P),At==="opening"&&v(25,At="justOpened")):!ct&&he&&st.remove()}},[ct,Lt,P,c,Ft,_t,_e,Ze,nt,X,Ke,$,We,qe,ut,et,pt,Xe,Ge,rt,ot,Bt,Dt,st,qt,At,k,w,S,re,ie,Mi,Ji]}class R_ extends $r{constructor(g){super(),Qr(this,g,L_,D_,Br,{closeButton:11,closeOnClickOutside:12,closeOnClickInside:13,closeOnMove:14,openOn:15,openIfTopMost:16,focusAfterOpen:17,anchor:18,offset:19,popupClass:20,maxWidth:21,lngLat:10,html:22,open:0},null,[-1,-1])}}let yl={origins:"blue",destinations:"purple",lts1:"#009e73",lts2:"#56b4e9",lts3:"#e69f00",lts4:"#d55e00",lts_not_allowed:"red"},dy=["match",["get","lts"],0,yl.lts_not_allowed,1,yl.lts1,2,yl.lts2,3,yl.lts3,4,yl.lts4,"red"];function py(f,g,v){let w=["step",f];for(let k=1;kopen-source project + by + Dustin Carlino + , part of the + Urban Analytics Technology Platform + . It wouldn't be possible without:`,rt=xi(),ot=kt("ul"),ot.innerHTML=`
  • BikeOttawa's Level of Traffic Stress definition
  • GeoRust
  • svelte-maplibre
  • MapLibre GL JS
  • ChartJS
  • OpenStreetMap
  • fast-paths
  • Propensity to Cycle Tool
  • PMTiles
  • Special thanks to + Hadrien Salat + for the logo and + Stuart Lynn + for feedback and help with pmtiles, both from + the Alan Turing Institute
  • `,Bt=xi(),Ke=kt("button"),Ke.textContent="About",Dt=xi(),ct=kt("br"),_t=xi(),_e=kt("br"),Wd(v.src,w=dp)||ai(v,"src",w),ai(v,"width","100"),ai(v,"alt","od2net logo by Hadrien Salat"),ai(v,"class","svelte-1ey54bq"),S.__value="main",Yu(S,S.__value),ai(S,"class","svelte-1ey54bq"),c.__value="interactive",Yu(c,c.__value),ai(c,"class","svelte-1ey54bq"),ne.__value="costs",Yu(ne,ne.__value),ai(ne,"class","svelte-1ey54bq"),ai(P,"class","svelte-1ey54bq"),f[0]===void 0&&jc(()=>f[3].call(P)),ro(g,"display","flex"),ro(g,"justify-content","space-between"),ai(g,"class","svelte-1ey54bq"),ai($,"class","svelte-1ey54bq"),ai(qe,"class","svelte-1ey54bq"),ro(X,"display","flex"),ro(X,"justify-content","space-between"),ai(X,"class","svelte-1ey54bq"),Wd(et.src,pt=dp)||ai(et,"src",pt),ai(et,"width","300"),ai(et,"alt","od2net logo by Hadrien Salat"),ai(et,"class","svelte-1ey54bq"),ai(Ge,"class","svelte-1ey54bq"),ai(ot,"class","svelte-1ey54bq"),ai(re,"class","svelte-1ey54bq"),ai(Ke,"class","svelte-1ey54bq"),ai(ct,"class","svelte-1ey54bq"),ai(_e,"class","svelte-1ey54bq")},m(yt,bt){Et(yt,g,bt),at(g,v),at(g,k),at(g,P),at(P,S),at(P,c),at(P,ne),Kd(P,f[0],!0),Et(yt,ie,bt),Et(yt,re,bt),at(re,X),at(X,$),at(X,We),at(X,qe),at(re,ut),at(re,et),at(re,Xe),at(re,Ge),at(re,rt),at(re,ot),f[5](re),Et(yt,Bt,bt),Et(yt,Ke,bt),Et(yt,Dt,bt),Et(yt,ct,bt),Et(yt,_t,bt),Et(yt,_e,bt),Ze||(nt=[Bc(P,"change",f[3]),Bc(P,"change",f[2]),Bc(qe,"click",f[4]),Bc(Ke,"click",f[6])],Ze=!0)},p(yt,[bt]){bt&1&&Kd(P,yt[0])},i:Ar,o:Ar,d(yt){yt&&(It(g),It(ie),It(re),It(Bt),It(Ke),It(Dt),It(ct),It(_t),It(_e)),f[5](null),Ze=!1,uo(nt)}}}function F_(f,g,v){let{app:w}=g,k;function P(){w=="main"?window.location.href="index.html":w=="interactive"?window.location.href="interactive.html":w=="costs"&&(window.location.href="edge_cost.html")}function S(){w=Ym(this),v(0,w)}const c=()=>k.close();function ne(re){Al[re?"unshift":"push"](()=>{k=re,v(1,k)})}const ie=()=>k.showModal();return f.$$set=re=>{"app"in re&&v(0,w=re.app)},[w,k,P,S,c,ne,ie]}class gy extends $r{constructor(g){super(),Qr(this,g,F_,B_,Br,{app:0})}}const O_=f=>({props:f&8}),pp=f=>({props:N_(f[3])});function V_(f){let g;const v=f[1].default,w=Qs(v,f,f[2],pp);return{c(){w&&w.c()},m(k,P){w&&w.m(k,P),g=!0},p(k,P){w&&w.p&&(!g||P&12)&&ea(w,v,k,k[2],g?$s(v,k[2],P,O_):ta(k[2]),pp)},i(k){g||(Qt(w,k),g=!0)},o(k){_i(w,k),g=!1},d(k){w&&w.d(k)}}}function U_(f){let g,v;return g=new R_({props:{openOn:f[0],$$slots:{default:[V_,({features:w})=>({3:w}),({features:w})=>w?8:0]},$$scope:{ctx:f}}}),{c(){no(g.$$.fragment)},m(w,k){Js(g,w,k),v=!0},p(w,[k]){const P={};k&1&&(P.openOn=w[0]),k&12&&(P.$$scope={dirty:k,ctx:w}),g.$set(P)},i(w){v||(Qt(g.$$.fragment,w),v=!0)},o(w){_i(g.$$.fragment,w),v=!1},d(w){Ys(g,w)}}}function N_(f){return f?f[0].properties??{}:(console.log("A Popup with null features should be impossible"),{})}function j_(f,g,v){let{$$slots:w={},$$scope:k}=g,{openOn:P="hover"}=g;return f.$$set=S=>{"openOn"in S&&v(0,P=S.openOn),"$$scope"in S&&v(2,k=S.$$scope)},[P,w,k]}class _y extends $r{constructor(g){super(),Qr(this,g,j_,U_,Br,{openOn:0})}}function fp(f,g,v){const w=f.slice();return w[3]=g[v][0],w[4]=g[v][1],w}function mp(f,g,v){const w=f.slice();return w[7]=g[v],w}function gp(f){let g,v,w,k=f[0].count.toFixed(2)+"",P;return{c(){g=kt("div"),v=oi("Count: "),w=kt("b"),P=oi(k)},m(S,c){Et(S,g,c),at(g,v),at(g,w),at(w,P)},p(S,c){c&1&&k!==(k=S[0].count.toFixed(2)+"")&&Yr(P,k)},d(S){S&&It(g)}}}function _p(f){let g,v,w=f[0].forward_cost+"",k,P,S=f[0].backward_cost+"",c,ne,ie,re,X=(f[0].forward_cost/f[0].length).toFixed(2)+"",$,We,qe=(f[0].backward_cost/f[0].length).toFixed(2)+"",ut,et,pt;return{c(){g=kt("div"),v=oi("Cost: ["),k=oi(w),P=oi(", "),c=oi(S),ne=oi(`] ( + `),ie=kt("b"),re=oi("["),$=oi(X),We=oi(", "),ut=oi(qe),et=oi("]"),pt=oi(` + x the length)`)},m(Xe,Ge){Et(Xe,g,Ge),at(g,v),at(g,k),at(g,P),at(g,c),at(g,ne),at(g,ie),at(ie,re),at(ie,$),at(ie,We),at(ie,ut),at(ie,et),at(g,pt)},p(Xe,Ge){Ge&1&&w!==(w=Xe[0].forward_cost+"")&&Yr(k,w),Ge&1&&S!==(S=Xe[0].backward_cost+"")&&Yr(c,S),Ge&1&&X!==(X=(Xe[0].forward_cost/Xe[0].length).toFixed(2)+"")&&Yr($,X),Ge&1&&qe!==(qe=(Xe[0].backward_cost/Xe[0].length).toFixed(2)+"")&&Yr(ut,qe)},d(Xe){Xe&&It(g)}}}function yp(f){let g,v,w=f[0].slope.toFixed(2)+"",k,P,S=-f[0].slope.toFixed(2)+"",c,ne;return{c(){g=kt("div"),v=oi("Slope: ["),k=oi(w),P=oi(", "),c=oi(S),ne=oi("]")},m(ie,re){Et(ie,g,re),at(g,v),at(g,k),at(g,P),at(g,c),at(g,ne)},p(ie,re){re&1&&w!==(w=ie[0].slope.toFixed(2)+"")&&Yr(k,w),re&1&&S!==(S=-ie[0].slope.toFixed(2)+"")&&Yr(c,S)},d(ie){ie&&It(g)}}}function xp(f){let g,v=f[7]+"",w;return{c(){g=kt("li"),w=oi(v)},m(k,P){Et(k,g,P),at(g,w)},p(k,P){P&2&&v!==(v=k[7]+"")&&Yr(w,v)},d(k){k&&It(g)}}}function q_(f){let g;return{c(){g=kt("p"),g.textContent="OSM tags weren't kept"},m(v,w){Et(v,g,w)},p:Ar,d(v){v&&It(g)}}}function Z_(f){let g,v,w=co(Object.entries(f[2])),k=[];for(let P=0;P{"properties"in S&&v(0,w=S.properties)},[w,k,P]}class yy extends $r{constructor(g){super(),Qr(this,g,H_,G_,Br,{properties:0})}}const W_=f=>({}),bp=f=>({}),X_=f=>({}),wp=f=>({});function K_(f){let g,v,w,k;const P=f[1].left,S=Qs(P,f,f[0],wp),c=f[1].main,ne=Qs(c,f,f[0],bp);return{c(){g=kt("div"),S&&S.c(),v=xi(),w=kt("div"),ne&&ne.c(),ai(g,"class","left svelte-6kzmjs"),ai(w,"class","main svelte-6kzmjs")},m(ie,re){Et(ie,g,re),S&&S.m(g,null),Et(ie,v,re),Et(ie,w,re),ne&&ne.m(w,null),k=!0},p(ie,[re]){S&&S.p&&(!k||re&1)&&ea(S,P,ie,ie[0],k?$s(P,ie[0],re,X_):ta(ie[0]),wp),ne&&ne.p&&(!k||re&1)&&ea(ne,c,ie,ie[0],k?$s(c,ie[0],re,W_):ta(ie[0]),bp)},i(ie){k||(Qt(S,ie),Qt(ne,ie),k=!0)},o(ie){_i(S,ie),_i(ne,ie),k=!1},d(ie){ie&&(It(g),It(v),It(w)),S&&S.d(ie),ne&&ne.d(ie)}}}function J_(f,g,v){let{$$slots:w={},$$scope:k}=g;return f.$$set=P=>{"$$scope"in P&&v(0,k=P.$$scope)},[k,w]}class xy extends $r{constructor(g){super(),Qr(this,g,J_,K_,Br,{})}}function Tp(f,g,v){const w=f.slice();return w[1]=g[v][0],w[2]=g[v][1],w}function Sp(f){let g,v,w,k=f[1]+"",P,S;return{c(){g=kt("li"),v=kt("span"),w=xi(),P=oi(k),S=xi(),ai(v,"class","svelte-kzgqtg"),ro(v,"background",f[2])},m(c,ne){Et(c,g,ne),at(g,v),at(g,w),at(g,P),at(g,S)},p(c,ne){ne&1&&ro(v,"background",c[2]),ne&1&&k!==(k=c[1]+"")&&Yr(P,k)},d(c){c&&It(g)}}}function Y_(f){let g,v=co(f[0]),w=[];for(let k=0;k{"rows"in k&&v(0,w=k.rows)},[w]}class vy extends $r{constructor(g){super(),Qr(this,g,Q_,Y_,Br,{rows:0})}}export{Qa as $,tg as A,ep as B,Ym as C,Gc as D,Ar as E,ay as F,Qs as G,gy as H,Xm as I,ea as J,ta as K,xy as L,hy as M,$s as N,hh as O,sy as P,kp as Q,ly as R,$r as S,Rr as T,Nc as U,iy as V,Yr as W,ry as X,p_ as Y,Wp as Z,fg as _,Js as a,En as a0,dy as a1,cy as a2,Gm as a3,uy as a4,yl as a5,_y as a6,yy as a7,ia as a8,ty as a9,vy as aa,my as ab,co as ac,dh as ad,py as ae,fy as af,ny as ag,ey as ah,oy as ai,Jp as aj,s_ as ak,a_ as al,_i as b,no as c,Ys as d,kt as e,xi as f,oi as g,ai as h,Qr as i,Yu as j,jc as k,Et as l,yn as m,at as n,$m as o,Kd as p,Bc as q,ho as r,Br as s,Qt as t,po as u,It as v,uo as w,Al as x,ng as y,ro as z}; diff --git a/assets/Legend-b4adf9e9.css b/assets/Legend-b4adf9e9.css new file mode 100644 index 0000000..2958d55 --- /dev/null +++ b/assets/Legend-b4adf9e9.css @@ -0,0 +1 @@ +.ctrl-btn-center.svelte-1s83zbq{display:grid!important;height:100%;width:100%;place-items:center}.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23999' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-ms-high-contrast:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:#0000000d}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:#0000000d}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;top:0;right:0;bottom:0;left:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}.expand-map.svelte-p00lfq{position:absolute;top:0;bottom:0;left:0;right:0}.svelte-1ey54bq::backdrop{background-color:#000;opacity:.5}table.svelte-lh2o9l{border:solid}.svelte-6kzmjs{box-sizing:border-box}body{margin:0}div.svelte-6kzmjs{float:left}.left.svelte-6kzmjs{width:25%;height:100vh;overflow:scroll;padding:8px}.main.svelte-6kzmjs{width:75%}span.svelte-kzgqtg{display:block;float:left;height:16px;width:30px;margin-right:5px;border:1px solid #999} diff --git a/assets/OverpassSelector-c6601889.js b/assets/OverpassSelector-df03c184.js similarity index 99% rename from assets/OverpassSelector-c6601889.js rename to assets/OverpassSelector-df03c184.js index 30b2d49..b4bdf7e 100644 --- a/assets/OverpassSelector-c6601889.js +++ b/assets/OverpassSelector-df03c184.js @@ -1,4 +1,4 @@ -var Rm=Object.defineProperty;var Fm=(n,t,e)=>t in n?Rm(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var j=(n,t,e)=>(Fm(n,typeof t!="symbol"?t+"":t,e),e);import{ag as Nm,ah as Bm,S as Gi,i as qi,s as yi,D as ia,l as Ot,t as gn,r as Vl,b as Rn,u as jl,v as Et,ai as zm,T as Ia,a8 as xf,U as Ra,aj as Mh,E as ue,G as $m,J as Vm,K as jm,N as Wm,Z as Hm,e as ot,g as Xe,j as ee,k as vf,n as nt,p as Lr,q as ye,C as wf,f as pe,z as Bi,I as Sh,w as Ki,Q as Mf,W as Wl,x as Cr,V as hi,y as Fa,ac as Vi,c as Um,h as _e,a as Ym,A as Na,d as Xm,ad as Hl,ab as Sf,ak as os,al as Gm}from"./Legend-07540826.js";function qm(n,t,e,i,s){let o=!1;n.getSource(t)&&(o=!0,n.removeSource(t));const r=()=>{i(t)&&(n.addSource(t,e),s())};if(o){const a=()=>{t&&(n.getSource(t)?setTimeout(a,1):r())};a()}else r()}function Km(n,t,e){Nm().then(()=>{let i=Bm(n);if(!i)return;i.getSource(t)===e&&i.removeSource(t)})}function kh(n){let t=n[0],e,i,s=Ch(n);return{c(){s.c(),e=ia()},m(o,r){s.m(o,r),Ot(o,e,r),i=!0},p(o,r){r&1&&yi(t,t=o[0])?(Vl(),Rn(s,1,1,ue),jl(),s=Ch(o),s.c(),gn(s,1),s.m(e.parentNode,e)):s.p(o,r)},i(o){i||(gn(s),i=!0)},o(o){Rn(s),i=!1},d(o){o&&Et(e),s.d(o)}}}function Ch(n){let t;const e=n[15].default,i=$m(e,n,n[14],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&16384)&&Vm(i,e,s,s[14],t?Wm(e,s[14],o,null):jm(s[14]),null)},i(s){t||(gn(i,s),t=!0)},o(s){Rn(i,s),t=!1},d(s){i&&i.d(s)}}}function Jm(n){let t,e,i=n[0]&&kh(n);return{c(){i&&i.c(),t=ia()},m(s,o){i&&i.m(s,o),Ot(s,t,o),e=!0},p(s,[o]){s[0]?i?(i.p(s,o),o&1&&gn(i,1)):(i=kh(s),i.c(),gn(i,1),i.m(t.parentNode,t)):i&&(Vl(),Rn(i,1,1,()=>{i=null}),jl())},i(s){e||(gn(i),e=!0)},o(s){Rn(i),e=!1},d(s){s&&Et(t),i&&i.d(s)}}}function Zm(n,t,e){let i,s,o,{$$slots:r={},$$scope:a}=t,{id:l=Hm("geojson")}=t,{data:c}=t,{generateId:h=!1}=t,{promoteId:d=void 0}=t,{filter:f=void 0}=t,{lineMetrics:p=void 0}=t,{cluster:m=void 0}=t;const{map:b,cluster:_,self:x}=zm();Ia(n,b,v=>e(13,s=v)),Ia(n,_,v=>e(16,o=v)),Ia(n,x,v=>e(0,i=v));let M,k=!0;return xf(()=>{i&&M&&s&&(Km(b,i,M),Ra(x,i=null,i),e(11,M=void 0))}),n.$$set=v=>{"id"in v&&e(4,l=v.id),"data"in v&&e(5,c=v.data),"generateId"in v&&e(6,h=v.generateId),"promoteId"in v&&e(7,d=v.promoteId),"filter"in v&&e(8,f=v.filter),"lineMetrics"in v&&e(9,p=v.lineMetrics),"cluster"in v&&e(10,m=v.cluster),"$$scope"in v&&e(14,a=v.$$scope)},n.$$.update=()=>{n.$$.dirty&1024&&Ra(_,o=m,o),n.$$.dirty&12273&&s&&i!==l&&(Ra(x,i=l,i),qm(s,i,Mh({type:"geojson",data:c,filter:f,lineMetrics:p,generateId:h,promoteId:d,cluster:!!m,clusterMinPoints:m==null?void 0:m.minPoints,clusterMaxZoom:m==null?void 0:m.maxZoom,clusterRadius:m==null?void 0:m.radius,clusterProperties:m==null?void 0:m.properties}),v=>s&&v===i,()=>{i&&(e(11,M=s==null?void 0:s.getSource(i)),e(12,k=!0))})),n.$$.dirty&8208&&(s==null||s.on("style.load",()=>{e(11,M=s==null?void 0:s.getSource(l))})),n.$$.dirty&6176&&M&&(k?e(12,k=!1):M.setData(c)),n.$$.dirty&3072&&(M==null||M.setClusterOptions(Mh({cluster:!!m,clusterMaxZoom:m==null?void 0:m.maxZoom,clusterRadius:m==null?void 0:m.radius})))},[i,b,_,x,l,c,h,d,f,p,m,M,k,s,a,r]}class lC extends Gi{constructor(t){super(),qi(this,t,Zm,Jm,yi,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10})}}let rt;const kf=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&kf.decode();let Es=null;function Vs(){return(Es===null||Es.byteLength===0)&&(Es=new Uint8Array(rt.memory.buffer)),Es}function ci(n,t){return n=n>>>0,kf.decode(Vs().subarray(n,n+t))}const hn=new Array(128).fill(void 0);hn.push(void 0,null,!0,!1);let js=hn.length;function pt(n){js===hn.length&&hn.push(hn.length+1);const t=js;return js=hn[t],hn[t]=n,t}function J(n){return hn[n]}function Qm(n){n<132||(hn[n]=js,js=n)}function Pn(n){const t=J(n);return Qm(n),t}let di=0;const Pr=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},tb=typeof Pr.encodeInto=="function"?function(n,t){return Pr.encodeInto(n,t)}:function(n,t){const e=Pr.encode(n);return t.set(e),{read:n.length,written:e.length}};function Ba(n,t,e){if(e===void 0){const a=Pr.encode(n),l=t(a.length,1)>>>0;return Vs().subarray(l,l+a.length).set(a),di=a.length,l}let i=n.length,s=t(i,1)>>>0;const o=Vs();let r=0;for(;r127)break;o[s+r]=a}if(r!==i){r!==0&&(n=n.slice(r)),s=e(s,i,i=r+n.length*3,1)>>>0;const a=Vs().subarray(s+r,s+i),l=tb(n,a);r+=l.written}return di=r,s}function rs(n){return n==null}let Ts=null;function Ft(){return(Ts===null||Ts.byteLength===0)&&(Ts=new Int32Array(rt.memory.buffer)),Ts}let As=null;function Cf(){return(As===null||As.byteLength===0)&&(As=new Float64Array(rt.memory.buffer)),As}let Ds=null;function eb(){return(Ds===null||Ds.byteLength===0)&&(Ds=new BigInt64Array(rt.memory.buffer)),Ds}function dl(n){const t=typeof n;if(t=="number"||t=="boolean"||n==null)return`${n}`;if(t=="string")return`"${n}"`;if(t=="symbol"){const s=n.description;return s==null?"Symbol":`Symbol(${s})`}if(t=="function"){const s=n.name;return typeof s=="string"&&s.length>0?`Function(${s})`:"Function"}if(Array.isArray(n)){const s=n.length;let o="[";s>0&&(o+=dl(n[0]));for(let r=1;r1)i=e[1];else return toString.call(n);if(i=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} +var Rm=Object.defineProperty;var Fm=(n,t,e)=>t in n?Rm(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var j=(n,t,e)=>(Fm(n,typeof t!="symbol"?t+"":t,e),e);import{ag as Nm,ah as Bm,S as Gi,i as qi,s as yi,D as ia,l as Ot,t as gn,r as Vl,b as Rn,u as jl,v as Et,ai as zm,T as Ia,a8 as xf,U as Ra,aj as Mh,E as ue,G as $m,J as Vm,K as jm,N as Wm,Z as Hm,e as ot,g as Xe,j as ee,k as vf,n as nt,p as Lr,q as ye,C as wf,f as pe,z as Bi,I as Sh,w as Ki,Q as Mf,W as Wl,x as Cr,V as hi,y as Fa,ac as Vi,c as Um,h as _e,a as Ym,A as Na,d as Xm,ad as Hl,ab as Sf,ak as os,al as Gm}from"./Legend-7e8105f0.js";function qm(n,t,e,i,s){let o=!1;n.getSource(t)&&(o=!0,n.removeSource(t));const r=()=>{i(t)&&(n.addSource(t,e),s())};if(o){const a=()=>{t&&(n.getSource(t)?setTimeout(a,1):r())};a()}else r()}function Km(n,t,e){Nm().then(()=>{let i=Bm(n);if(!i)return;i.getSource(t)===e&&i.removeSource(t)})}function kh(n){let t=n[0],e,i,s=Ch(n);return{c(){s.c(),e=ia()},m(o,r){s.m(o,r),Ot(o,e,r),i=!0},p(o,r){r&1&&yi(t,t=o[0])?(Vl(),Rn(s,1,1,ue),jl(),s=Ch(o),s.c(),gn(s,1),s.m(e.parentNode,e)):s.p(o,r)},i(o){i||(gn(s),i=!0)},o(o){Rn(s),i=!1},d(o){o&&Et(e),s.d(o)}}}function Ch(n){let t;const e=n[15].default,i=$m(e,n,n[14],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&16384)&&Vm(i,e,s,s[14],t?Wm(e,s[14],o,null):jm(s[14]),null)},i(s){t||(gn(i,s),t=!0)},o(s){Rn(i,s),t=!1},d(s){i&&i.d(s)}}}function Jm(n){let t,e,i=n[0]&&kh(n);return{c(){i&&i.c(),t=ia()},m(s,o){i&&i.m(s,o),Ot(s,t,o),e=!0},p(s,[o]){s[0]?i?(i.p(s,o),o&1&&gn(i,1)):(i=kh(s),i.c(),gn(i,1),i.m(t.parentNode,t)):i&&(Vl(),Rn(i,1,1,()=>{i=null}),jl())},i(s){e||(gn(i),e=!0)},o(s){Rn(i),e=!1},d(s){s&&Et(t),i&&i.d(s)}}}function Zm(n,t,e){let i,s,o,{$$slots:r={},$$scope:a}=t,{id:l=Hm("geojson")}=t,{data:c}=t,{generateId:h=!1}=t,{promoteId:d=void 0}=t,{filter:f=void 0}=t,{lineMetrics:p=void 0}=t,{cluster:m=void 0}=t;const{map:b,cluster:_,self:x}=zm();Ia(n,b,v=>e(13,s=v)),Ia(n,_,v=>e(16,o=v)),Ia(n,x,v=>e(0,i=v));let M,k=!0;return xf(()=>{i&&M&&s&&(Km(b,i,M),Ra(x,i=null,i),e(11,M=void 0))}),n.$$set=v=>{"id"in v&&e(4,l=v.id),"data"in v&&e(5,c=v.data),"generateId"in v&&e(6,h=v.generateId),"promoteId"in v&&e(7,d=v.promoteId),"filter"in v&&e(8,f=v.filter),"lineMetrics"in v&&e(9,p=v.lineMetrics),"cluster"in v&&e(10,m=v.cluster),"$$scope"in v&&e(14,a=v.$$scope)},n.$$.update=()=>{n.$$.dirty&1024&&Ra(_,o=m,o),n.$$.dirty&12273&&s&&i!==l&&(Ra(x,i=l,i),qm(s,i,Mh({type:"geojson",data:c,filter:f,lineMetrics:p,generateId:h,promoteId:d,cluster:!!m,clusterMinPoints:m==null?void 0:m.minPoints,clusterMaxZoom:m==null?void 0:m.maxZoom,clusterRadius:m==null?void 0:m.radius,clusterProperties:m==null?void 0:m.properties}),v=>s&&v===i,()=>{i&&(e(11,M=s==null?void 0:s.getSource(i)),e(12,k=!0))})),n.$$.dirty&8208&&(s==null||s.on("style.load",()=>{e(11,M=s==null?void 0:s.getSource(l))})),n.$$.dirty&6176&&M&&(k?e(12,k=!1):M.setData(c)),n.$$.dirty&3072&&(M==null||M.setClusterOptions(Mh({cluster:!!m,clusterMaxZoom:m==null?void 0:m.maxZoom,clusterRadius:m==null?void 0:m.radius})))},[i,b,_,x,l,c,h,d,f,p,m,M,k,s,a,r]}class lC extends Gi{constructor(t){super(),qi(this,t,Zm,Jm,yi,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10})}}let rt;const kf=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&kf.decode();let Es=null;function Vs(){return(Es===null||Es.byteLength===0)&&(Es=new Uint8Array(rt.memory.buffer)),Es}function ci(n,t){return n=n>>>0,kf.decode(Vs().subarray(n,n+t))}const hn=new Array(128).fill(void 0);hn.push(void 0,null,!0,!1);let js=hn.length;function pt(n){js===hn.length&&hn.push(hn.length+1);const t=js;return js=hn[t],hn[t]=n,t}function J(n){return hn[n]}function Qm(n){n<132||(hn[n]=js,js=n)}function Pn(n){const t=J(n);return Qm(n),t}let di=0;const Pr=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},tb=typeof Pr.encodeInto=="function"?function(n,t){return Pr.encodeInto(n,t)}:function(n,t){const e=Pr.encode(n);return t.set(e),{read:n.length,written:e.length}};function Ba(n,t,e){if(e===void 0){const a=Pr.encode(n),l=t(a.length,1)>>>0;return Vs().subarray(l,l+a.length).set(a),di=a.length,l}let i=n.length,s=t(i,1)>>>0;const o=Vs();let r=0;for(;r127)break;o[s+r]=a}if(r!==i){r!==0&&(n=n.slice(r)),s=e(s,i,i=r+n.length*3,1)>>>0;const a=Vs().subarray(s+r,s+i),l=tb(n,a);r+=l.written}return di=r,s}function rs(n){return n==null}let Ts=null;function Ft(){return(Ts===null||Ts.byteLength===0)&&(Ts=new Int32Array(rt.memory.buffer)),Ts}let As=null;function Cf(){return(As===null||As.byteLength===0)&&(As=new Float64Array(rt.memory.buffer)),As}let Ds=null;function eb(){return(Ds===null||Ds.byteLength===0)&&(Ds=new BigInt64Array(rt.memory.buffer)),Ds}function dl(n){const t=typeof n;if(t=="number"||t=="boolean"||n==null)return`${n}`;if(t=="string")return`"${n}"`;if(t=="symbol"){const s=n.description;return s==null?"Symbol":`Symbol(${s})`}if(t=="function"){const s=n.name;return typeof s=="string"&&s.length>0?`Function(${s})`:"Function"}if(Array.isArray(n)){const s=n.length;let o="[";s>0&&(o+=dl(n[0]));for(let r=1;r1)i=e[1];else return toString.call(n);if(i=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} ${n.stack}`:i}function nb(n,t){const e=t(n.length*1,1)>>>0;return Vs().set(n,e/1),di=n.length,e}function ib(n,t){return n=n>>>0,Cf().subarray(n/8,n/8+t)}function Jn(n,t){try{return n.apply(this,t)}catch(e){rt.__wbindgen_exn_store(pt(e))}}class fl{static __wrap(t){t=t>>>0;const e=Object.create(fl.prototype);return e.__wbg_ptr=t,e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();rt.__wbg_jsnetwork_free(t)}constructor(t){try{const o=rt.__wbindgen_add_to_stack_pointer(-16),r=nb(t,rt.__wbindgen_malloc),a=di;rt.jsnetwork_new(o,r,a);var e=Ft()[o/4+0],i=Ft()[o/4+1],s=Ft()[o/4+2];if(s)throw Pn(i);return fl.__wrap(e)}finally{rt.__wbindgen_add_to_stack_pointer(16)}}recalculate(t){let e,i;try{const h=rt.__wbindgen_add_to_stack_pointer(-16);rt.jsnetwork_recalculate(h,this.__wbg_ptr,pt(t));var s=Ft()[h/4+0],o=Ft()[h/4+1],r=Ft()[h/4+2],a=Ft()[h/4+3],l=s,c=o;if(a)throw l=0,c=0,Pn(r);return e=l,i=c,ci(l,c)}finally{rt.__wbindgen_add_to_stack_pointer(16),rt.__wbindgen_free(e,i,1)}}updateCostFunction(t){try{const s=rt.__wbindgen_add_to_stack_pointer(-16);rt.jsnetwork_updateCostFunction(s,this.__wbg_ptr,pt(t));var e=Ft()[s/4+0],i=Ft()[s/4+1];if(i)throw Pn(e)}finally{rt.__wbindgen_add_to_stack_pointer(16)}}getBounds(){try{const s=rt.__wbindgen_add_to_stack_pointer(-16);rt.jsnetwork_getBounds(s,this.__wbg_ptr);var t=Ft()[s/4+0],e=Ft()[s/4+1],i=ib(t,e).slice();return rt.__wbindgen_free(t,e*8),i}finally{rt.__wbindgen_add_to_stack_pointer(16)}}debugNetwork(){let t,e;try{const c=rt.__wbindgen_add_to_stack_pointer(-16);rt.jsnetwork_debugNetwork(c,this.__wbg_ptr);var i=Ft()[c/4+0],s=Ft()[c/4+1],o=Ft()[c/4+2],r=Ft()[c/4+3],a=i,l=s;if(r)throw a=0,l=0,Pn(o);return t=a,e=l,ci(a,l)}finally{rt.__wbindgen_add_to_stack_pointer(16),rt.__wbindgen_free(t,e,1)}}}async function sb(n,t){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,t)}catch(i){if(n.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",i);else throw i}const e=await n.arrayBuffer();return await WebAssembly.instantiate(e,t)}else{const e=await WebAssembly.instantiate(n,t);return e instanceof WebAssembly.Instance?{instance:e,module:n}:e}}function ob(){const n={};return n.wbg={},n.wbg.__wbindgen_string_new=function(t,e){const i=ci(t,e);return pt(i)},n.wbg.__wbindgen_is_bigint=function(t){return typeof J(t)=="bigint"},n.wbg.__wbindgen_bigint_from_u64=function(t){const e=BigInt.asUintN(64,t);return pt(e)},n.wbg.__wbindgen_jsval_eq=function(t,e){return J(t)===J(e)},n.wbg.__wbindgen_object_drop_ref=function(t){Pn(t)},n.wbg.__wbindgen_error_new=function(t,e){const i=new Error(ci(t,e));return pt(i)},n.wbg.__wbindgen_string_get=function(t,e){const i=J(e),s=typeof i=="string"?i:void 0;var o=rs(s)?0:Ba(s,rt.__wbindgen_malloc,rt.__wbindgen_realloc),r=di;Ft()[t/4+1]=r,Ft()[t/4+0]=o},n.wbg.__wbindgen_number_get=function(t,e){const i=J(e),s=typeof i=="number"?i:void 0;Cf()[t/8+1]=rs(s)?0:s,Ft()[t/4+0]=!rs(s)},n.wbg.__wbindgen_is_string=function(t){return typeof J(t)=="string"},n.wbg.__wbindgen_is_object=function(t){const e=J(t);return typeof e=="object"&&e!==null},n.wbg.__wbindgen_is_undefined=function(t){return J(t)===void 0},n.wbg.__wbindgen_in=function(t,e){return J(t)in J(e)},n.wbg.__wbindgen_object_clone_ref=function(t){const e=J(t);return pt(e)},n.wbg.__wbindgen_jsval_loose_eq=function(t,e){return J(t)==J(e)},n.wbg.__wbindgen_boolean_get=function(t){const e=J(t);return typeof e=="boolean"?e?1:0:2},n.wbg.__wbindgen_number_new=function(t){return pt(t)},n.wbg.__wbg_getwithrefkey_3b3c46ba20582127=function(t,e){const i=J(t)[J(e)];return pt(i)},n.wbg.__wbg_new_abda76e883ba8a5f=function(){const t=new Error;return pt(t)},n.wbg.__wbg_stack_658279fe44541cf6=function(t,e){const i=J(e).stack,s=Ba(i,rt.__wbindgen_malloc,rt.__wbindgen_realloc),o=di;Ft()[t/4+1]=o,Ft()[t/4+0]=s},n.wbg.__wbg_error_f851667af71bcfc6=function(t,e){let i,s;try{i=t,s=e,console.error(ci(t,e))}finally{rt.__wbindgen_free(i,s,1)}},n.wbg.__wbg_getwithrefkey_5e6d9547403deab8=function(t,e){const i=J(t)[J(e)];return pt(i)},n.wbg.__wbg_set_841ac57cff3d672b=function(t,e,i){J(t)[Pn(e)]=Pn(i)},n.wbg.__wbg_now_0cfdc90c97d0c24b=function(t){return J(t).now()},n.wbg.__wbg_debug_9a6b3243fbbebb61=function(t){console.debug(J(t))},n.wbg.__wbg_error_788ae33f81d3b84b=function(t){console.error(J(t))},n.wbg.__wbg_info_2e30e8204b29d91d=function(t){console.info(J(t))},n.wbg.__wbg_log_1d3ae0273d8f4f8a=function(t){console.log(J(t))},n.wbg.__wbg_warn_d60e832f9882c1b2=function(t){console.warn(J(t))},n.wbg.__wbg_get_44be0491f933a435=function(t,e){const i=J(t)[e>>>0];return pt(i)},n.wbg.__wbg_length_fff51ee6522a1a18=function(t){return J(t).length},n.wbg.__wbg_new_898a68150f225f2e=function(){const t=new Array;return pt(t)},n.wbg.__wbindgen_is_function=function(t){return typeof J(t)=="function"},n.wbg.__wbg_newnoargs_581967eacc0e2604=function(t,e){const i=new Function(ci(t,e));return pt(i)},n.wbg.__wbg_next_526fc47e980da008=function(t){const e=J(t).next;return pt(e)},n.wbg.__wbg_next_ddb3312ca1c4e32a=function(){return Jn(function(t){const e=J(t).next();return pt(e)},arguments)},n.wbg.__wbg_done_5c1f01fb660d73b5=function(t){return J(t).done},n.wbg.__wbg_value_1695675138684bd5=function(t){const e=J(t).value;return pt(e)},n.wbg.__wbg_iterator_97f0c81209c6c35a=function(){return pt(Symbol.iterator)},n.wbg.__wbg_get_97b561fb56f034b5=function(){return Jn(function(t,e){const i=Reflect.get(J(t),J(e));return pt(i)},arguments)},n.wbg.__wbg_call_cb65541d95d71282=function(){return Jn(function(t,e){const i=J(t).call(J(e));return pt(i)},arguments)},n.wbg.__wbg_new_b51585de1b234aff=function(){const t=new Object;return pt(t)},n.wbg.__wbg_self_1ff1d729e9aae938=function(){return Jn(function(){const t=self.self;return pt(t)},arguments)},n.wbg.__wbg_window_5f4faef6c12b79ec=function(){return Jn(function(){const t=window.window;return pt(t)},arguments)},n.wbg.__wbg_globalThis_1d39714405582d3c=function(){return Jn(function(){const t=globalThis.globalThis;return pt(t)},arguments)},n.wbg.__wbg_global_651f05c6a0944d1c=function(){return Jn(function(){const t=global.global;return pt(t)},arguments)},n.wbg.__wbg_set_502d29070ea18557=function(t,e,i){J(t)[e>>>0]=Pn(i)},n.wbg.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb=function(t){let e;try{e=J(t)instanceof ArrayBuffer}catch{e=!1}return e},n.wbg.__wbg_isSafeInteger_bb8e18dd21c97288=function(t){return Number.isSafeInteger(J(t))},n.wbg.__wbg_entries_e51f29c7bba0c054=function(t){const e=Object.entries(J(t));return pt(e)},n.wbg.__wbg_buffer_085ec1f694018c4f=function(t){const e=J(t).buffer;return pt(e)},n.wbg.__wbg_new_8125e318e6245eed=function(t){const e=new Uint8Array(J(t));return pt(e)},n.wbg.__wbg_set_5cf90238115182c3=function(t,e,i){J(t).set(J(e),i>>>0)},n.wbg.__wbg_length_72e2208bbc0efc61=function(t){return J(t).length},n.wbg.__wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4=function(t){let e;try{e=J(t)instanceof Uint8Array}catch{e=!1}return e},n.wbg.__wbindgen_bigint_get_as_i64=function(t,e){const i=J(e),s=typeof i=="bigint"?i:void 0;eb()[t/8+1]=rs(s)?BigInt(0):s,Ft()[t/4+0]=!rs(s)},n.wbg.__wbindgen_debug_string=function(t,e){const i=dl(J(e)),s=Ba(i,rt.__wbindgen_malloc,rt.__wbindgen_realloc),o=di;Ft()[t/4+1]=o,Ft()[t/4+0]=s},n.wbg.__wbindgen_throw=function(t,e){throw new Error(ci(t,e))},n.wbg.__wbindgen_memory=function(){const t=rt.memory;return pt(t)},n}function rb(n,t){return rt=n.exports,ab.__wbindgen_wasm_module=t,Ds=null,As=null,Ts=null,Es=null,rt}async function ab(n){if(rt!==void 0)return rt;typeof n>"u"&&(n="/od2net/assets/wasm_od2net_bg.wasm");const t=ob();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));const{instance:e,module:i}=await sb(await n,t);return rb(e,i)}function lb(n){let t,e,i,s,o,r,a,l,c,h,d,f;return{c(){t=ot("div"),e=ot("label"),i=Xe(`Or load an example: `),s=ot("select"),o=ot("option"),o.textContent="Custom file loaded",r=ot("option"),r.textContent="Antwerp",a=ot("option"),a.textContent="Berlin",l=ot("option"),l.textContent="South London",c=ot("option"),c.textContent="Paris",h=ot("option"),h.textContent="Seattle",o.__value="",ee(o,o.__value),r.__value="antwerp",ee(r,r.__value),a.__value="berlin",ee(a,a.__value),l.__value="london",ee(l,l.__value),c.__value="paris",ee(c,c.__value),h.__value="seattle",ee(h,h.__value),n[0]===void 0&&vf(()=>n[1].call(s))},m(p,m){Ot(p,t,m),nt(t,e),nt(e,i),nt(e,s),nt(s,o),nt(s,r),nt(s,a),nt(s,l),nt(s,c),nt(s,h),Lr(s,n[0],!0),d||(f=ye(s,"change",n[1]),d=!0)},p(p,[m]){m&1&&Lr(s,p[0])},i:ue,o:ue,d(p){p&&Et(t),d=!1,f()}}}function cb(n,t,e){let{example:i}=t;function s(){i=wf(this),e(0,i)}return n.$$set=o=>{"example"in o&&e(0,i=o.example)},[i,s]}class cC extends Gi{constructor(t){super(),qi(this,t,cb,lb,yi,{example:0})}}/*! * @kurkle/color v0.3.2 diff --git a/assets/SidebarControls-66544d53.js b/assets/SidebarControls-4458b6f2.js similarity index 99% rename from assets/SidebarControls-66544d53.js rename to assets/SidebarControls-4458b6f2.js index 2b82d5d..7ccbdc4 100644 --- a/assets/SidebarControls-66544d53.js +++ b/assets/SidebarControls-4458b6f2.js @@ -1,4 +1,4 @@ -import{S as de,i as me,s as pe,Y as ut,x as it,y as ot,c as j,a as B,A as st,t as R,b as M,d as P,Z as ft,G as ct,J as _t,K as dt,N as mt,$ as ee,a0 as je,a1 as Xe,a2 as $e,a3 as Ie,a4 as pt,a5 as T,f as L,l as g,v as h,T as te,D as at,r as bt,u as gt,a6 as Be,a7 as ht,g as C,W as oe,e as b,h as H,n as d,q as O,E as xe,w as Pe,a8 as vt,a9 as wt,j as K,aa as kt,ab as D,z as et,V as ne}from"./Legend-07540826.js";const yt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function Me(t,n){const l={},e={},i={$$scope:1};let o=t.length;for(;o--;){const r=t[o],a=n[o];if(a){for(const s in r)s in a||(e[s]=1);for(const s in a)i[s]||(l[s]=a[s],i[s]=1);t[o]=a}else for(const s in r)i[s]=1}for(const r in e)r in l||(l[r]=void 0);return l}function He(t){return typeof t=="object"&&t!==null?t:{}}function Lt(t){let n;const l=t[16].default,e=ct(l,t,t[24],null);return{c(){e&&e.c()},m(i,o){e&&e.m(i,o),n=!0},p(i,o){e&&e.p&&(!n||o&16777216)&&_t(e,l,i,i[24],n?mt(l,i[24],o,null):dt(i[24]),null)},i(i){n||(R(e,i),n=!0)},o(i){M(e,i),n=!1},d(i){e&&e.d(i)}}}function Ct(t){let n,l,e;function i(r){t[17](r)}let o={id:t[1],type:"circle",source:t[2],sourceLayer:t[3],beforeId:t[4],beforeLayerType:t[5],paint:t[6],layout:t[7],filter:t[8],applyToClusters:t[9],minzoom:t[10],maxzoom:t[11],hoverCursor:t[12],manageHoverState:t[13],eventsIfTopMost:t[14],interactive:t[15],$$slots:{default:[Lt]},$$scope:{ctx:t}};return t[0]!==void 0&&(o.hovered=t[0]),n=new ut({props:o}),it.push(()=>ot(n,"hovered",i)),n.$on("click",t[18]),n.$on("dblclick",t[19]),n.$on("contextmenu",t[20]),n.$on("mouseenter",t[21]),n.$on("mousemove",t[22]),n.$on("mouseleave",t[23]),{c(){j(n.$$.fragment)},m(r,a){B(n,r,a),e=!0},p(r,[a]){const s={};a&2&&(s.id=r[1]),a&4&&(s.source=r[2]),a&8&&(s.sourceLayer=r[3]),a&16&&(s.beforeId=r[4]),a&32&&(s.beforeLayerType=r[5]),a&64&&(s.paint=r[6]),a&128&&(s.layout=r[7]),a&256&&(s.filter=r[8]),a&512&&(s.applyToClusters=r[9]),a&1024&&(s.minzoom=r[10]),a&2048&&(s.maxzoom=r[11]),a&4096&&(s.hoverCursor=r[12]),a&8192&&(s.manageHoverState=r[13]),a&16384&&(s.eventsIfTopMost=r[14]),a&32768&&(s.interactive=r[15]),a&16777216&&(s.$$scope={dirty:a,ctx:r}),!l&&a&1&&(l=!0,s.hovered=r[0],st(()=>l=!1)),n.$set(s)},i(r){e||(R(n.$$.fragment,r),e=!0)},o(r){M(n.$$.fragment,r),e=!1},d(r){P(n,r)}}}function St(t,n,l){let{$$slots:e={},$$scope:i}=n,{id:o=ft("circle")}=n,{source:r=void 0}=n,{sourceLayer:a=void 0}=n,{beforeId:s=void 0}=n,{beforeLayerType:m=void 0}=n,{paint:w}=n,{layout:v=void 0}=n,{filter:k=void 0}=n,{applyToClusters:u=void 0}=n,{minzoom:_=void 0}=n,{maxzoom:z=void 0}=n,{hoverCursor:I=void 0}=n,{manageHoverState:N=!1}=n,{hovered:S=null}=n,{eventsIfTopMost:E=!1}=n,{interactive:y=!0}=n;function A(c){S=c,l(0,S)}function F(c){ee.call(this,t,c)}function se(c){ee.call(this,t,c)}function G(c){ee.call(this,t,c)}function ae(c){ee.call(this,t,c)}function Q(c){ee.call(this,t,c)}function le(c){ee.call(this,t,c)}return t.$$set=c=>{"id"in c&&l(1,o=c.id),"source"in c&&l(2,r=c.source),"sourceLayer"in c&&l(3,a=c.sourceLayer),"beforeId"in c&&l(4,s=c.beforeId),"beforeLayerType"in c&&l(5,m=c.beforeLayerType),"paint"in c&&l(6,w=c.paint),"layout"in c&&l(7,v=c.layout),"filter"in c&&l(8,k=c.filter),"applyToClusters"in c&&l(9,u=c.applyToClusters),"minzoom"in c&&l(10,_=c.minzoom),"maxzoom"in c&&l(11,z=c.maxzoom),"hoverCursor"in c&&l(12,I=c.hoverCursor),"manageHoverState"in c&&l(13,N=c.manageHoverState),"hovered"in c&&l(0,S=c.hovered),"eventsIfTopMost"in c&&l(14,E=c.eventsIfTopMost),"interactive"in c&&l(15,y=c.interactive),"$$scope"in c&&l(24,i=c.$$scope)},[S,o,r,a,s,m,w,v,k,u,_,z,I,N,E,y,e,A,F,se,G,ae,Q,le,i]}class tt extends de{constructor(n){super(),me(this,n,St,Ct,pe,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}let Ne=je(!0),De=je(!1),qe=je(!1);function nt(t){let n,l;return n=new Be({props:{$$slots:{default:[Tt,({props:e})=>({8:e}),({props:e})=>e?256:0]},$$scope:{ctx:t}}}),{c(){j(n.$$.fragment)},m(e,i){B(n,e,i),l=!0},p(e,i){const o={};i&768&&(o.$$scope={dirty:i,ctx:e}),n.$set(o)},i(e){l||(R(n.$$.fragment,e),l=!0)},o(e){M(n.$$.fragment,e),l=!1},d(e){P(n,e)}}}function Tt(t){let n,l;return n=new ht({props:{properties:t[8]}}),{c(){j(n.$$.fragment)},m(e,i){B(n,e,i),l=!0},p(e,i){const o={};i&256&&(o.properties=e[8]),n.$set(o)},i(e){l||(R(n.$$.fragment,e),l=!0)},o(e){M(n.$$.fragment,e),l=!1},d(e){P(n,e)}}}function Ot(t){let n,l,e=t[2]&&nt(t);return{c(){e&&e.c(),n=at()},m(i,o){e&&e.m(i,o),g(i,n,o),l=!0},p(i,o){i[2]?e?(e.p(i,o),o&4&&R(e,1)):(e=nt(i),e.c(),R(e,1),e.m(n.parentNode,n)):e&&(bt(),M(e,1,1,()=>{e=null}),gt())},i(i){l||(R(e),l=!0)},o(i){M(e),l=!1},d(i){i&&h(n),e&&e.d(i)}}}function Rt(t){let n=t[8].origin_count+"",l,e;return{c(){l=C(n),e=C(" routes start here")},m(i,o){g(i,l,o),g(i,e,o)},p(i,o){o&256&&n!==(n=i[8].origin_count+"")&&oe(l,n)},d(i){i&&(h(l),h(e))}}}function zt(t){let n,l;return n=new Be({props:{$$slots:{default:[Rt,({props:e})=>({8:e}),({props:e})=>e?256:0]},$$scope:{ctx:t}}}),{c(){j(n.$$.fragment)},m(e,i){B(n,e,i),l=!0},p(e,i){const o={};i&768&&(o.$$scope={dirty:i,ctx:e}),n.$set(o)},i(e){l||(R(n.$$.fragment,e),l=!0)},o(e){M(n.$$.fragment,e),l=!1},d(e){P(n,e)}}}function It(t){let n=t[8].destination_count+"",l,e;return{c(){l=C(n),e=C(" routes end here")},m(i,o){g(i,l,o),g(i,e,o)},p(i,o){o&256&&n!==(n=i[8].destination_count+"")&&oe(l,n)},d(i){i&&(h(l),h(e))}}}function Mt(t){let n,l;return n=new Be({props:{$$slots:{default:[It,({props:e})=>({8:e}),({props:e})=>e?256:0]},$$scope:{ctx:t}}}),{c(){j(n.$$.fragment)},m(e,i){B(n,e,i),l=!0},p(e,i){const o={};i&768&&(o.$$scope={dirty:i,ctx:e}),n.$set(o)},i(e){l||(R(n.$$.fragment,e),l=!0)},o(e){M(n.$$.fragment,e),l=!1},d(e){P(n,e)}}}function Ht(t){let n,l,e,i,o,r;const a=[{id:"input-layer"},t[0],{filter:["==",["geometry-type"],"LineString"]},{manageHoverState:!0},{hoverCursor:t[2]?"pointer":void 0},{paint:{"line-width":t[3],"line-color":Xe,"line-opacity":$e(1,.5)}},{layout:{visibility:t[4]?"visible":"none"}},{beforeId:"Road labels"}];let s={$$slots:{default:[Ot]},$$scope:{ctx:t}};for(let u=0;ul(4,o=v)),te(t,De,v=>l(5,r=v)),te(t,qe,v=>l(6,a=v));let{sourceOverride:s={}}=n,{controls:m}=n;function w(v){if(!e)return;let k=v.detail.features[0].properties.way;window.open(`http://openstreetmap.org/way/${k}`,"_blank")}return t.$$set=v=>{"sourceOverride"in v&&l(0,s=v.sourceOverride),"controls"in v&&l(1,m=v.controls)},t.$$.update=()=>{t.$$.dirty&2&&l(2,e=!m.streetviewOn),t.$$.dirty&2&&l(3,i=Nt(m.maxCount))},[s,m,e,i,o,r,a,w]}class Ft extends de{constructor(n){super(),me(this,n,Dt,Ht,pe,{sourceOverride:0,controls:1})}}const{window:qt}=yt;function lt(t){let n,l,e,i,o,r,a,s,m,w,v;return m=wt(t[6][0]),{c(){n=b("div"),l=b("label"),e=b("input"),i=C(` +import{S as de,i as me,s as pe,Y as ut,x as it,y as ot,c as j,a as B,A as st,t as R,b as M,d as P,Z as ft,G as ct,J as _t,K as dt,N as mt,$ as ee,a0 as je,a1 as Xe,a2 as $e,a3 as Ie,a4 as pt,a5 as T,f as L,l as g,v as h,T as te,D as at,r as bt,u as gt,a6 as Be,a7 as ht,g as C,W as oe,e as b,h as H,n as d,q as O,E as xe,w as Pe,a8 as vt,a9 as wt,j as K,aa as kt,ab as D,z as et,V as ne}from"./Legend-7e8105f0.js";const yt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function Me(t,n){const l={},e={},i={$$scope:1};let o=t.length;for(;o--;){const r=t[o],a=n[o];if(a){for(const s in r)s in a||(e[s]=1);for(const s in a)i[s]||(l[s]=a[s],i[s]=1);t[o]=a}else for(const s in r)i[s]=1}for(const r in e)r in l||(l[r]=void 0);return l}function He(t){return typeof t=="object"&&t!==null?t:{}}function Lt(t){let n;const l=t[16].default,e=ct(l,t,t[24],null);return{c(){e&&e.c()},m(i,o){e&&e.m(i,o),n=!0},p(i,o){e&&e.p&&(!n||o&16777216)&&_t(e,l,i,i[24],n?mt(l,i[24],o,null):dt(i[24]),null)},i(i){n||(R(e,i),n=!0)},o(i){M(e,i),n=!1},d(i){e&&e.d(i)}}}function Ct(t){let n,l,e;function i(r){t[17](r)}let o={id:t[1],type:"circle",source:t[2],sourceLayer:t[3],beforeId:t[4],beforeLayerType:t[5],paint:t[6],layout:t[7],filter:t[8],applyToClusters:t[9],minzoom:t[10],maxzoom:t[11],hoverCursor:t[12],manageHoverState:t[13],eventsIfTopMost:t[14],interactive:t[15],$$slots:{default:[Lt]},$$scope:{ctx:t}};return t[0]!==void 0&&(o.hovered=t[0]),n=new ut({props:o}),it.push(()=>ot(n,"hovered",i)),n.$on("click",t[18]),n.$on("dblclick",t[19]),n.$on("contextmenu",t[20]),n.$on("mouseenter",t[21]),n.$on("mousemove",t[22]),n.$on("mouseleave",t[23]),{c(){j(n.$$.fragment)},m(r,a){B(n,r,a),e=!0},p(r,[a]){const s={};a&2&&(s.id=r[1]),a&4&&(s.source=r[2]),a&8&&(s.sourceLayer=r[3]),a&16&&(s.beforeId=r[4]),a&32&&(s.beforeLayerType=r[5]),a&64&&(s.paint=r[6]),a&128&&(s.layout=r[7]),a&256&&(s.filter=r[8]),a&512&&(s.applyToClusters=r[9]),a&1024&&(s.minzoom=r[10]),a&2048&&(s.maxzoom=r[11]),a&4096&&(s.hoverCursor=r[12]),a&8192&&(s.manageHoverState=r[13]),a&16384&&(s.eventsIfTopMost=r[14]),a&32768&&(s.interactive=r[15]),a&16777216&&(s.$$scope={dirty:a,ctx:r}),!l&&a&1&&(l=!0,s.hovered=r[0],st(()=>l=!1)),n.$set(s)},i(r){e||(R(n.$$.fragment,r),e=!0)},o(r){M(n.$$.fragment,r),e=!1},d(r){P(n,r)}}}function St(t,n,l){let{$$slots:e={},$$scope:i}=n,{id:o=ft("circle")}=n,{source:r=void 0}=n,{sourceLayer:a=void 0}=n,{beforeId:s=void 0}=n,{beforeLayerType:m=void 0}=n,{paint:w}=n,{layout:v=void 0}=n,{filter:k=void 0}=n,{applyToClusters:u=void 0}=n,{minzoom:_=void 0}=n,{maxzoom:z=void 0}=n,{hoverCursor:I=void 0}=n,{manageHoverState:N=!1}=n,{hovered:S=null}=n,{eventsIfTopMost:E=!1}=n,{interactive:y=!0}=n;function A(c){S=c,l(0,S)}function F(c){ee.call(this,t,c)}function se(c){ee.call(this,t,c)}function G(c){ee.call(this,t,c)}function ae(c){ee.call(this,t,c)}function Q(c){ee.call(this,t,c)}function le(c){ee.call(this,t,c)}return t.$$set=c=>{"id"in c&&l(1,o=c.id),"source"in c&&l(2,r=c.source),"sourceLayer"in c&&l(3,a=c.sourceLayer),"beforeId"in c&&l(4,s=c.beforeId),"beforeLayerType"in c&&l(5,m=c.beforeLayerType),"paint"in c&&l(6,w=c.paint),"layout"in c&&l(7,v=c.layout),"filter"in c&&l(8,k=c.filter),"applyToClusters"in c&&l(9,u=c.applyToClusters),"minzoom"in c&&l(10,_=c.minzoom),"maxzoom"in c&&l(11,z=c.maxzoom),"hoverCursor"in c&&l(12,I=c.hoverCursor),"manageHoverState"in c&&l(13,N=c.manageHoverState),"hovered"in c&&l(0,S=c.hovered),"eventsIfTopMost"in c&&l(14,E=c.eventsIfTopMost),"interactive"in c&&l(15,y=c.interactive),"$$scope"in c&&l(24,i=c.$$scope)},[S,o,r,a,s,m,w,v,k,u,_,z,I,N,E,y,e,A,F,se,G,ae,Q,le,i]}class tt extends de{constructor(n){super(),me(this,n,St,Ct,pe,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}let Ne=je(!0),De=je(!1),qe=je(!1);function nt(t){let n,l;return n=new Be({props:{$$slots:{default:[Tt,({props:e})=>({8:e}),({props:e})=>e?256:0]},$$scope:{ctx:t}}}),{c(){j(n.$$.fragment)},m(e,i){B(n,e,i),l=!0},p(e,i){const o={};i&768&&(o.$$scope={dirty:i,ctx:e}),n.$set(o)},i(e){l||(R(n.$$.fragment,e),l=!0)},o(e){M(n.$$.fragment,e),l=!1},d(e){P(n,e)}}}function Tt(t){let n,l;return n=new ht({props:{properties:t[8]}}),{c(){j(n.$$.fragment)},m(e,i){B(n,e,i),l=!0},p(e,i){const o={};i&256&&(o.properties=e[8]),n.$set(o)},i(e){l||(R(n.$$.fragment,e),l=!0)},o(e){M(n.$$.fragment,e),l=!1},d(e){P(n,e)}}}function Ot(t){let n,l,e=t[2]&&nt(t);return{c(){e&&e.c(),n=at()},m(i,o){e&&e.m(i,o),g(i,n,o),l=!0},p(i,o){i[2]?e?(e.p(i,o),o&4&&R(e,1)):(e=nt(i),e.c(),R(e,1),e.m(n.parentNode,n)):e&&(bt(),M(e,1,1,()=>{e=null}),gt())},i(i){l||(R(e),l=!0)},o(i){M(e),l=!1},d(i){i&&h(n),e&&e.d(i)}}}function Rt(t){let n=t[8].origin_count+"",l,e;return{c(){l=C(n),e=C(" routes start here")},m(i,o){g(i,l,o),g(i,e,o)},p(i,o){o&256&&n!==(n=i[8].origin_count+"")&&oe(l,n)},d(i){i&&(h(l),h(e))}}}function zt(t){let n,l;return n=new Be({props:{$$slots:{default:[Rt,({props:e})=>({8:e}),({props:e})=>e?256:0]},$$scope:{ctx:t}}}),{c(){j(n.$$.fragment)},m(e,i){B(n,e,i),l=!0},p(e,i){const o={};i&768&&(o.$$scope={dirty:i,ctx:e}),n.$set(o)},i(e){l||(R(n.$$.fragment,e),l=!0)},o(e){M(n.$$.fragment,e),l=!1},d(e){P(n,e)}}}function It(t){let n=t[8].destination_count+"",l,e;return{c(){l=C(n),e=C(" routes end here")},m(i,o){g(i,l,o),g(i,e,o)},p(i,o){o&256&&n!==(n=i[8].destination_count+"")&&oe(l,n)},d(i){i&&(h(l),h(e))}}}function Mt(t){let n,l;return n=new Be({props:{$$slots:{default:[It,({props:e})=>({8:e}),({props:e})=>e?256:0]},$$scope:{ctx:t}}}),{c(){j(n.$$.fragment)},m(e,i){B(n,e,i),l=!0},p(e,i){const o={};i&768&&(o.$$scope={dirty:i,ctx:e}),n.$set(o)},i(e){l||(R(n.$$.fragment,e),l=!0)},o(e){M(n.$$.fragment,e),l=!1},d(e){P(n,e)}}}function Ht(t){let n,l,e,i,o,r;const a=[{id:"input-layer"},t[0],{filter:["==",["geometry-type"],"LineString"]},{manageHoverState:!0},{hoverCursor:t[2]?"pointer":void 0},{paint:{"line-width":t[3],"line-color":Xe,"line-opacity":$e(1,.5)}},{layout:{visibility:t[4]?"visible":"none"}},{beforeId:"Road labels"}];let s={$$slots:{default:[Ot]},$$scope:{ctx:t}};for(let u=0;ul(4,o=v)),te(t,De,v=>l(5,r=v)),te(t,qe,v=>l(6,a=v));let{sourceOverride:s={}}=n,{controls:m}=n;function w(v){if(!e)return;let k=v.detail.features[0].properties.way;window.open(`http://openstreetmap.org/way/${k}`,"_blank")}return t.$$set=v=>{"sourceOverride"in v&&l(0,s=v.sourceOverride),"controls"in v&&l(1,m=v.controls)},t.$$.update=()=>{t.$$.dirty&2&&l(2,e=!m.streetviewOn),t.$$.dirty&2&&l(3,i=Nt(m.maxCount))},[s,m,e,i,o,r,a,w]}class Ft extends de{constructor(n){super(),me(this,n,Dt,Ht,pe,{sourceOverride:0,controls:1})}}const{window:qt}=yt;function lt(t){let n,l,e,i,o,r,a,s,m,w,v;return m=wt(t[6][0]),{c(){n=b("div"),l=b("label"),e=b("input"),i=C(` Google StreetView`),o=L(),r=b("label"),a=b("input"),s=C(` Bing Streetside`),H(e,"type","radio"),e.__value="google",K(e,e.__value),H(a,"type","radio"),a.__value="bing",K(a,a.__value),m.p(e,a)},m(k,u){g(k,n,u),d(n,l),d(l,e),e.checked=e.__value===t[1],d(l,i),d(n,o),d(n,r),d(r,a),a.checked=a.__value===t[1],d(r,s),w||(v=[O(e,"change",t[5]),O(a,"change",t[7])],w=!0)},p(k,u){u&2&&(e.checked=e.__value===k[1]),u&2&&(a.checked=a.__value===k[1])},d(k){k&&h(n),m.r(),w=!1,Pe(v)}}}function jt(t){let n,l,e,i,o,r,a,s=t[0]&<(t);return{c(){n=b("label"),l=b("input"),e=C(` StreetView`),i=L(),s&&s.c(),o=at(),H(l,"type","checkbox")},m(m,w){g(m,n,w),d(n,l),l.checked=t[0],d(n,e),g(m,i,w),s&&s.m(m,w),g(m,o,w),r||(a=[O(qt,"keydown",t[2]),O(l,"change",t[4])],r=!0)},p(m,[w]){w&1&&(l.checked=m[0]),m[0]?s?s.p(m,w):(s=lt(m),s.c(),s.m(o.parentNode,o)):s&&(s.d(1),s=null)},i:xe,o:xe,d(m){m&&(h(n),h(i),h(o)),s&&s.d(m),r=!1,Pe(a)}}}function Bt(t,n,l){let{map:e}=n,{enabled:i=!1}=n,o="google";function r(){e.on("click",s),e.getCanvas().style.cursor="zoom-in"}function a(){e.off("click",s),e.getCanvas().style.cursor="auto"}vt(a);function s(_){let z=_.lngLat.lng,I=_.lngLat.lat;o=="google"?window.open(`http://maps.google.com/maps?q=&layer=c&cbll=${I},${z}&cbp=11,0,0,0,0`,"_blank"):o=="bing"&&window.open(`https://www.bing.com/maps?cp=${I}~${z}&style=x`,"_blank")}function m(_){i&&_.key=="Escape"&&l(0,i=!1)}const w=[[]];function v(){i=this.checked,l(0,i)}function k(){o=this.__value,l(1,o)}function u(){o=this.__value,l(1,o)}return t.$$set=_=>{"map"in _&&l(3,e=_.map),"enabled"in _&&l(0,i=_.enabled)},t.$$.update=()=>{t.$$.dirty&1&&(i?r():a())},[i,o,m,e,v,k,w,u]}class Pt extends de{constructor(n){super(),me(this,n,Bt,jt,pe,{map:3,enabled:0})}}function Vt(t){let n,l=t[1].config.requests.description+"",e,i,o,r,a,s,m,w,v,k,u,_,z,I,N,S,E,y,A,F,se,G,ae,Q=t[1].num_origins.toLocaleString()+"",le,c,be,re,U,Ve,We,Ee,V,ge,ue,ie,X,Fe,$,Ge,fe=t[1].num_destinations.toLocaleString()+"",he,Je,ve,ce,x,Ke,Ae,Ye,W,we,ke,ye,Y,Le,_e,Ce,Se,Te,J,Oe,Z,Re,Ze;Y=new kt({props:{rows:[[`${D.lts1}: ${q(t[1].total_meters_lts1)}`,T.lts1],[`${D.lts2}: ${q(t[1].total_meters_lts2)}`,T.lts2],[`${D.lts3}: ${q(t[1].total_meters_lts3)}`,T.lts3],[`${D.lts4}: ${q(t[1].total_meters_lts4)}`,T.lts4],[`${D.lts_not_allowed}: ${q(t[1].total_meters_not_allowed)}`,T.lts_not_allowed]]}});function rt(f){t[16](f)}let Qe={map:t[2]};return t[0].streetviewOn!==void 0&&(Qe.enabled=t[0].streetviewOn),J=new Pt({props:Qe}),it.push(()=>ot(J,"enabled",rt)),{c(){n=b("p"),e=C(l),i=L(),o=b("div"),r=b("button"),r.textContent="See all output details",a=L(),s=b("div"),m=b("label"),w=b("input"),v=C(` diff --git a/assets/main-f2fa6d94.js b/assets/main-fe99ddfc.js similarity index 61% rename from assets/main-f2fa6d94.js rename to assets/main-fe99ddfc.js index 881f0ae..6c1c2b8 100644 --- a/assets/main-f2fa6d94.js +++ b/assets/main-fe99ddfc.js @@ -1,5 +1,5 @@ -import{S as ne,i as le,s as F,m as ie,P as re,L as se,c as E,a as O,t as _,b,d as q,o as ue,H as fe,e as g,f as N,g as T,h as j,j as M,k as pe,l as L,n as m,p as Q,q as U,r as A,u as B,v as C,w as me,M as ce,x as D,y as G,z as J,A as K,_ as _e,B as V,F as de,C as ge,D as ae,E as be}from"./Legend-07540826.js";import{S as he,L as ve}from"./SidebarControls-66544d53.js";let R="pmtilesSource";async function ke(a){let e=await a.getHeader(),o=await a.getMetadata();return{bounds:[e.minLon,e.minLat,e.maxLon,e.maxLat],outputMetadata:JSON.parse(o.description),minZoom:e.minZoom,maxZoom:e.maxZoom}}function ye(a,e,o){let{pmtiles:t}=e,{map:n}=e,{outputMetadata:l=null}=e,i=new re;ie.addProtocol("pmtiles",i.tile);async function f(s){r(R),i.add(s);let p=await ke(s);n.addSource(R,{type:"vector",tiles:["pmtiles://"+s.source.getKey()+"/{z}/{x}/{y}"],minzoom:p.minZoom,maxzoom:p.maxZoom,bounds:p.bounds}),n.fitBounds(p.bounds,{padding:100,duration:500}),o(0,l=p.outputMetadata)}function r(s){if(n.getSource(s)){let p=[];for(let u of n.getStyle().layers)"source"in u&&u.source==s&&p.push(u.id);for(let u of p)n.removeLayer(u);n.removeSource(s)}}return a.$$set=s=>{"pmtiles"in s&&o(1,t=s.pmtiles),"map"in s&&o(2,n=s.map),"outputMetadata"in s&&o(0,l=s.outputMetadata)},a.$$.update=()=>{a.$$.dirty&2&&(t?f(t):r(R))},[l,t,n]}class we extends ne{constructor(e){super(),le(this,e,ye,null,F,{pmtiles:1,map:2,outputMetadata:0})}}function X(a){let e,o,t;return{c(){e=T("Open a "),o=g("i"),o.textContent=".pmtiles",t=T(` +import{S as ne,i as le,s as F,m as ie,P as re,L as se,c as O,a as P,t as _,b,d as q,o as ue,H as fe,e as g,f as N,g as j,h as A,j as M,k as pe,l as L,n as m,p as Q,q as U,r as D,u as H,v as C,w as me,M as ce,x as I,y as G,z as R,A as K,_ as _e,B as V,F as de,C as ge,D as ae,E as be}from"./Legend-7e8105f0.js";import{S as he,L as ve}from"./SidebarControls-4458b6f2.js";let T="pmtilesSource";async function ke(a){let e=await a.getHeader(),o=await a.getMetadata();return{bounds:[e.minLon,e.minLat,e.maxLon,e.maxLat],outputMetadata:JSON.parse(o.description),minZoom:e.minZoom,maxZoom:e.maxZoom}}function ye(a,e,o){let{pmtiles:t}=e,{map:n}=e,{outputMetadata:l=null}=e,i=new re;ie.addProtocol("pmtiles",i.tile);async function f(s){r(T),i.add(s);let p=await ke(s);n.addSource(T,{type:"vector",tiles:["pmtiles://"+s.source.getKey()+"/{z}/{x}/{y}"],minzoom:p.minZoom,maxzoom:p.maxZoom,bounds:p.bounds}),n.fitBounds(p.bounds,{padding:100,duration:500}),o(0,l=p.outputMetadata)}function r(s){if(n.getSource(s)){let p=[];for(let u of n.getStyle().layers)"source"in u&&u.source==s&&p.push(u.id);for(let u of p)n.removeLayer(u);n.removeSource(s)}}return a.$$set=s=>{"pmtiles"in s&&o(1,t=s.pmtiles),"map"in s&&o(2,n=s.map),"outputMetadata"in s&&o(0,l=s.outputMetadata)},a.$$.update=()=>{a.$$.dirty&2&&(t?f(t):r(T))},[l,t,n]}class we extends ne{constructor(e){super(),le(this,e,ye,null,F,{pmtiles:1,map:2,outputMetadata:0})}}function X(a){let e,o,t;return{c(){e=j("Open a "),o=g("i"),o.textContent=".pmtiles",t=j(` file produced by the tool. Note this file stays in your browser; it doesn't - get uploaded anywhere.`)},m(n,l){L(n,e,l),L(n,o,l),L(n,t,l)},d(n){n&&(C(e),C(o),C(t))}}}function x(a){let e,o,t;function n(i){a[11](i)}let l={outputMetadata:a[3],map:a[1]};return a[4]!==void 0&&(l.controls=a[4]),e=new he({props:l}),D.push(()=>G(e,"controls",n)),{c(){E(e.$$.fragment)},m(i,f){O(e,i,f),t=!0},p(i,f){const r={};f&8&&(r.outputMetadata=i[3]),f&2&&(r.map=i[1]),!o&&f&16&&(o=!0,r.controls=i[4],K(()=>o=!1)),e.$set(r)},i(i){t||(_(e.$$.fragment,i),t=!0)},o(i){b(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function $e(a){let e,o,t,n,l,i,f,r,s,p,u,y,w,$,d,k,S,P,Z,W,I,H,Y;o=new fe({props:{app:"main"}});let h=a[2]==null&&X(),c=a[3]&&x(a);return{c(){e=g("div"),E(o.$$.fragment),t=N(),n=g("label"),h&&h.c(),l=N(),i=g("input"),f=N(),r=g("div"),s=g("label"),p=T(`Or load an example: + get uploaded anywhere.`)},m(n,l){L(n,e,l),L(n,o,l),L(n,t,l)},d(n){n&&(C(e),C(o),C(t))}}}function x(a){let e,o,t;function n(i){a[11](i)}let l={outputMetadata:a[3],map:a[1]};return a[4]!==void 0&&(l.controls=a[4]),e=new he({props:l}),I.push(()=>G(e,"controls",n)),{c(){O(e.$$.fragment)},m(i,f){P(e,i,f),t=!0},p(i,f){const r={};f&8&&(r.outputMetadata=i[3]),f&2&&(r.map=i[1]),!o&&f&16&&(o=!0,r.controls=i[4],K(()=>o=!1)),e.$set(r)},i(i){t||(_(e.$$.fragment,i),t=!0)},o(i){b(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function $e(a){let e,o,t,n,l,i,f,r,s,p,u,y,w,$,d,k,S,Z,E,W,B,J,Y;o=new fe({props:{app:"main"}});let h=a[2]==null&&X(),c=a[3]&&x(a);return{c(){e=g("div"),O(o.$$.fragment),t=N(),n=g("label"),h&&h.c(),l=N(),i=g("input"),f=N(),r=g("div"),s=g("label"),p=j(`Or load an example: `),u=g("select"),y=g("option"),y.textContent="Custom file loaded",w=g("option"),w.textContent="Edinburgh",$=g("option"),$.textContent=`England (2011 home-to-work) - `,d=g("option"),d.textContent="Liverpool (direct)",k=g("option"),k.textContent="Liverpool (quiet)",S=g("option"),S.textContent="London",P=g("option"),P.textContent="Seattle",Z=g("option"),Z.textContent="York",W=N(),c&&c.c(),j(i,"type","file"),y.__value="",M(y,y.__value),w.__value="edinburgh",M(w,w.__value),$.__value="england_2011_home_to_work",M($,$.__value),d.__value="liverpool_direct",M(d,d.__value),k.__value="liverpool_quiet",M(k,k.__value),S.__value="london",M(S,S.__value),P.__value="seattle",M(P,P.__value),Z.__value="york",M(Z,Z.__value),a[0]===void 0&&pe(()=>a[10].call(u)),j(e,"slot","left")},m(v,z){L(v,e,z),O(o,e,null),m(e,t),m(e,n),h&&h.m(n,null),m(n,l),m(n,i),a[9](i),m(e,f),m(e,r),m(r,s),m(s,p),m(s,u),m(u,y),m(u,w),m(u,$),m(u,d),m(u,k),m(u,S),m(u,P),m(u,Z),Q(u,a[0],!0),m(e,W),c&&c.m(e,null),I=!0,H||(Y=[U(i,"change",a[6]),U(u,"change",a[10])],H=!0)},p(v,z){v[2]==null?h||(h=X(),h.c(),h.m(n,l)):h&&(h.d(1),h=null),z&1&&Q(u,v[0]),v[3]?c?(c.p(v,z),z&8&&_(c,1)):(c=x(v),c.c(),_(c,1),c.m(e,null)):c&&(A(),b(c,1,1,()=>{c=null}),B())},i(v){I||(_(o.$$.fragment,v),_(c),I=!0)},o(v){b(o.$$.fragment,v),b(c),I=!1},d(v){v&&C(e),q(o),h&&h.d(),a[9](null),c&&c.d(),H=!1,me(Y)}}}function ee(a){let e=a[3],o,t,n=te(a);return{c(){n.c(),o=ae()},m(l,i){n.m(l,i),L(l,o,i),t=!0},p(l,i){i&8&&F(e,e=l[3])?(A(),b(n,1,1,be),B(),n=te(l),n.c(),_(n,1),n.m(o.parentNode,o)):n.p(l,i)},i(l){t||(_(n),t=!0)},o(l){b(n),t=!1},d(l){l&&C(o),n.d(l)}}}function te(a){let e,o;return e=new ve({props:{sourceOverride:{source:"pmtilesSource",sourceLayer:"rnet"},controls:a[4]}}),{c(){E(e.$$.fragment)},m(t,n){O(e,t,n),o=!0},p(t,n){const l={};n&16&&(l.controls=t[4]),e.$set(l)},i(t){o||(_(e.$$.fragment,t),o=!0)},o(t){b(e.$$.fragment,t),o=!1},d(t){q(e,t)}}}function Me(a){let e,o,t=a[3]&&ee(a);return{c(){t&&t.c(),e=ae()},m(n,l){t&&t.m(n,l),L(n,e,l),o=!0},p(n,l){n[3]?t?(t.p(n,l),l&8&&_(t,1)):(t=ee(n),t.c(),_(t,1),t.m(e.parentNode,e)):t&&(A(),b(t,1,1,()=>{t=null}),B())},i(n){o||(_(t),o=!0)},o(n){b(t),o=!1},d(n){n&&C(e),t&&t.d(n)}}}function oe(a){let e,o,t;function n(i){a[8](i)}let l={map:a[1],pmtiles:a[2]};return a[3]!==void 0&&(l.outputMetadata=a[3]),e=new we({props:l}),D.push(()=>G(e,"outputMetadata",n)),{c(){E(e.$$.fragment)},m(i,f){O(e,i,f),t=!0},p(i,f){const r={};f&2&&(r.map=i[1]),f&4&&(r.pmtiles=i[2]),!o&&f&8&&(o=!0,r.outputMetadata=i[3],K(()=>o=!1)),e.$set(r)},i(i){t||(_(e.$$.fragment,i),t=!0)},o(i){b(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function Le(a){let e,o,t,n,l;function i(s){a[7](s)}let f={style:"https://api.maptiler.com/maps/dataviz/style.json?key=MZEJTanw3WpxRvt7qDfo",standardControls:!0,hash:!0,$$slots:{default:[Me]},$$scope:{ctx:a}};a[1]!==void 0&&(f.map=a[1]),o=new ce({props:f}),D.push(()=>G(o,"map",i));let r=a[1]&&oe(a);return{c(){e=g("div"),E(o.$$.fragment),n=N(),r&&r.c(),j(e,"slot","main"),J(e,"position","relative"),J(e,"width","100%"),J(e,"height","100vh")},m(s,p){L(s,e,p),O(o,e,null),m(e,n),r&&r.m(e,null),l=!0},p(s,p){const u={};p&4120&&(u.$$scope={dirty:p,ctx:s}),!t&&p&2&&(t=!0,u.map=s[1],K(()=>t=!1)),o.$set(u),s[1]?r?(r.p(s,p),p&2&&_(r,1)):(r=oe(s),r.c(),_(r,1),r.m(e,null)):r&&(A(),b(r,1,1,()=>{r=null}),B())},i(s){l||(_(o.$$.fragment,s),_(r),l=!0)},o(s){b(o.$$.fragment,s),b(r),l=!1},d(s){s&&C(e),q(o),r&&r.d()}}}function Ce(a){let e,o;return e=new se({props:{$$slots:{main:[Le],left:[$e]},$$scope:{ctx:a}}}),{c(){E(e.$$.fragment)},m(t,n){O(e,t,n),o=!0},p(t,[n]){const l={};n&4159&&(l.$$scope={dirty:n,ctx:t}),e.$set(l)},i(t){o||(_(e.$$.fragment,t),o=!0)},o(t){b(e.$$.fragment,t),o=!1},d(t){q(e,t)}}}function Se(a,e,o){ue(async()=>{await _e()});let t,n,l="",i,f={maxCount:1e3,originRadius:3,destinationRadius:3,streetviewOn:!1},r;function s(d){try{o(0,l="");let k=r.files;o(2,n=new V(new de(k[0])))}catch(k){window.alert(`Problem loading this PMTiles file. Don't open the GeoJSON file; make sure to select .pmtiles. Error: ${k}`)}}function p(d){t=d,o(1,t)}function u(d){i=d,o(3,i)}function y(d){D[d?"unshift":"push"](()=>{r=d,o(5,r)})}function w(){l=ge(this),o(0,l)}function $(d){f=d,o(4,f)}return a.$$.update=()=>{a.$$.dirty&1&&l!=""&&o(2,n=new V(`https://assets.od2net.org/output/${l}.pmtiles`))},[l,t,n,i,f,r,s,p,u,y,w,$]}class Pe extends ne{constructor(e){super(),le(this,e,Se,Ce,F,{})}}new Pe({target:document.getElementById("app")}); + `,d=g("option"),d.textContent="Liverpool (direct)",k=g("option"),k.textContent="Liverpool (quiet)",S=g("option"),S.textContent="London",Z=g("option"),Z.textContent="Seattle",E=g("option"),E.textContent="York",W=N(),c&&c.c(),A(i,"type","file"),y.__value="",M(y,y.__value),w.__value="edinburgh",M(w,w.__value),$.__value="england_2011_home_to_work",M($,$.__value),d.__value="liverpool_direct",M(d,d.__value),k.__value="liverpool_quiet",M(k,k.__value),S.__value="london",M(S,S.__value),Z.__value="seattle",M(Z,Z.__value),E.__value="york",M(E,E.__value),a[0]===void 0&&pe(()=>a[10].call(u)),A(e,"slot","left")},m(v,z){L(v,e,z),P(o,e,null),m(e,t),m(e,n),h&&h.m(n,null),m(n,l),m(n,i),a[9](i),m(e,f),m(e,r),m(r,s),m(s,p),m(s,u),m(u,y),m(u,w),m(u,$),m(u,d),m(u,k),m(u,S),m(u,Z),m(u,E),Q(u,a[0],!0),m(e,W),c&&c.m(e,null),B=!0,J||(Y=[U(i,"change",a[6]),U(u,"change",a[10])],J=!0)},p(v,z){v[2]==null?h||(h=X(),h.c(),h.m(n,l)):h&&(h.d(1),h=null),z&1&&Q(u,v[0]),v[3]?c?(c.p(v,z),z&8&&_(c,1)):(c=x(v),c.c(),_(c,1),c.m(e,null)):c&&(D(),b(c,1,1,()=>{c=null}),H())},i(v){B||(_(o.$$.fragment,v),_(c),B=!0)},o(v){b(o.$$.fragment,v),b(c),B=!1},d(v){v&&C(e),q(o),h&&h.d(),a[9](null),c&&c.d(),J=!1,me(Y)}}}function ee(a){let e=a[3],o,t,n=te(a);return{c(){n.c(),o=ae()},m(l,i){n.m(l,i),L(l,o,i),t=!0},p(l,i){i&8&&F(e,e=l[3])?(D(),b(n,1,1,be),H(),n=te(l),n.c(),_(n,1),n.m(o.parentNode,o)):n.p(l,i)},i(l){t||(_(n),t=!0)},o(l){b(n),t=!1},d(l){l&&C(o),n.d(l)}}}function te(a){let e,o;return e=new ve({props:{sourceOverride:{source:"pmtilesSource",sourceLayer:"rnet"},controls:a[4]}}),{c(){O(e.$$.fragment)},m(t,n){P(e,t,n),o=!0},p(t,n){const l={};n&16&&(l.controls=t[4]),e.$set(l)},i(t){o||(_(e.$$.fragment,t),o=!0)},o(t){b(e.$$.fragment,t),o=!1},d(t){q(e,t)}}}function Me(a){let e,o,t=a[3]&&ee(a);return{c(){t&&t.c(),e=ae()},m(n,l){t&&t.m(n,l),L(n,e,l),o=!0},p(n,l){n[3]?t?(t.p(n,l),l&8&&_(t,1)):(t=ee(n),t.c(),_(t,1),t.m(e.parentNode,e)):t&&(D(),b(t,1,1,()=>{t=null}),H())},i(n){o||(_(t),o=!0)},o(n){b(t),o=!1},d(n){n&&C(e),t&&t.d(n)}}}function oe(a){let e,o,t;function n(i){a[8](i)}let l={map:a[1],pmtiles:a[2]};return a[3]!==void 0&&(l.outputMetadata=a[3]),e=new we({props:l}),I.push(()=>G(e,"outputMetadata",n)),{c(){O(e.$$.fragment)},m(i,f){P(e,i,f),t=!0},p(i,f){const r={};f&2&&(r.map=i[1]),f&4&&(r.pmtiles=i[2]),!o&&f&8&&(o=!0,r.outputMetadata=i[3],K(()=>o=!1)),e.$set(r)},i(i){t||(_(e.$$.fragment,i),t=!0)},o(i){b(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function Le(a){let e,o,t,n,l;function i(s){a[7](s)}let f={style:"https://api.maptiler.com/maps/dataviz/style.json?key=MZEJTanw3WpxRvt7qDfo",standardControls:!0,hash:!0,$$slots:{default:[Me]},$$scope:{ctx:a}};a[1]!==void 0&&(f.map=a[1]),o=new ce({props:f}),I.push(()=>G(o,"map",i));let r=a[1]&&oe(a);return{c(){e=g("div"),O(o.$$.fragment),n=N(),r&&r.c(),A(e,"slot","main"),R(e,"position","relative"),R(e,"width","100%"),R(e,"height","100vh")},m(s,p){L(s,e,p),P(o,e,null),m(e,n),r&&r.m(e,null),l=!0},p(s,p){const u={};p&4120&&(u.$$scope={dirty:p,ctx:s}),!t&&p&2&&(t=!0,u.map=s[1],K(()=>t=!1)),o.$set(u),s[1]?r?(r.p(s,p),p&2&&_(r,1)):(r=oe(s),r.c(),_(r,1),r.m(e,null)):r&&(D(),b(r,1,1,()=>{r=null}),H())},i(s){l||(_(o.$$.fragment,s),_(r),l=!0)},o(s){b(o.$$.fragment,s),b(r),l=!1},d(s){s&&C(e),q(o),r&&r.d()}}}function Ce(a){let e,o;return e=new se({props:{$$slots:{main:[Le],left:[$e]},$$scope:{ctx:a}}}),{c(){O(e.$$.fragment)},m(t,n){P(e,t,n),o=!0},p(t,[n]){const l={};n&4159&&(l.$$scope={dirty:n,ctx:t}),e.$set(l)},i(t){o||(_(e.$$.fragment,t),o=!0)},o(t){b(e.$$.fragment,t),o=!1},d(t){q(e,t)}}}function Se(a,e,o){ue(async()=>{await _e()});let t,n,l="",i,f={maxCount:1e3,originRadius:3,destinationRadius:3,streetviewOn:!1},r;function s(d){try{o(0,l="");let k=r.files;o(2,n=new V(new de(k[0])))}catch(k){window.alert(`Problem loading this PMTiles file. Don't open the GeoJSON file; make sure to select .pmtiles. Error: ${k}`)}}function p(d){t=d,o(1,t)}function u(d){i=d,o(3,i)}function y(d){I[d?"unshift":"push"](()=>{r=d,o(5,r)})}function w(){l=ge(this),o(0,l)}function $(d){f=d,o(4,f)}return a.$$.update=()=>{a.$$.dirty&1&&l!=""&&o(2,n=new V(`https://assets.od2net.org/output/${l}.pmtiles`))},[l,t,n,i,f,r,s,p,u,y,w,$]}class Ze extends ne{constructor(e){super(),le(this,e,Se,Ce,F,{})}}new Ze({target:document.getElementById("app")}); diff --git a/assets/x2-44be00bf.js b/assets/x2-44be00bf.js deleted file mode 100644 index 2f0e790..0000000 --- a/assets/x2-44be00bf.js +++ /dev/null @@ -1,9 +0,0 @@ -import{S as ie,i as re,s as fe,G as ce,e as S,h as T,z as W,l as R,I as x,q as N,J as pe,K as de,N as me,O as ge,t as y,b as k,v as J,w as _e,Q as be,R as he,T as $,U as ee,m as we,L as Le,c as q,f as O,a as D,d as P,o as ye,H as ve,x as H,y as Q,g as Y,n as v,A as V,r as te,u as ne,M as Ce,_ as ke,V as ue,W as Me,j as se,D as Be,E as Ee,X as ze}from"./Legend-07540826.js";import{L as Se,C as Ie,O as Oe,_ as qe,J as De,a as Pe,G as Re}from"./OverpassSelector-c6601889.js";import{S as Je,L as Ne}from"./SidebarControls-66544d53.js";function Te(s){let e,t,l,n,o,f,c;const a=s[17].default,r=ce(a,s,s[16],null);return{c(){e=S("div"),r&&r.c(),T(e,"tabindex",t=s[1]?0:void 0),T(e,"role",l=s[1]?"button":void 0),W(e,"z-index",s[2])},m(i,m){R(i,e,m),r&&r.m(e,null),o=!0,f||(c=[x(s[6].call(null,e)),x(n=je.call(null,e,s[0])),N(e,"click",s[18]),N(e,"dblclick",s[19]),N(e,"contextmenu",s[20]),N(e,"mouseenter",s[21]),N(e,"mouseleave",s[22]),N(e,"mousemove",s[23]),N(e,"keydown",s[7])],f=!0)},p(i,[m]){r&&r.p&&(!o||m&65536)&&pe(r,a,i,i[16],o?me(a,i[16],m,null):de(i[16]),null),(!o||m&2&&t!==(t=i[1]?0:void 0))&&T(e,"tabindex",t),(!o||m&2&&l!==(l=i[1]?"button":void 0))&&T(e,"role",l),n&&ge(n.update)&&m&1&&n.update.call(null,i[0]),m&4&&W(e,"z-index",i[2])},i(i){o||(y(r,i),o=!0)},o(i){k(r,i),o=!1},d(i){i&&J(e),r&&r.d(i),f=!1,_e(c)}}}function je(s,e){const t=s.className;function l(n){n?s.className=`${t} ${n}`:s.className=t}return l(e),{update:l}}function Ae(s,e,t){let l,n,o,{$$slots:f={},$$scope:c}=e,{lngLat:a}=e,{class:r=void 0}=e,{interactive:i=!0}=e,{asButton:m=!1}=e,{draggable:C=!1}=e,{feature:h=null}=e,{offset:B=void 0}=e,{zIndex:_=void 0}=e,{rotation:w=0}=e;const I=be(),{map:z,layerEvent:j,self:A}=he();$(s,z,u=>t(25,o=u)),$(s,j,u=>t(24,l=u)),$(s,A,u=>t(15,n=u));function F(u){ee(A,n=new we.Marker({element:u,rotation:w,draggable:C,offset:B}).setLngLat(a).addTo(o),n);const G=()=>p("dragstart"),U=()=>{L(),p("drag")},K=()=>{L(),p("dragend")};return C&&(n.on("dragstart",G),n.on("drag",U),n.on("dragend",K)),{destroy(){C&&(n==null||n.off("dragstart",G),n==null||n.off("drag",U),n==null||n.off("dragend",K)),n==null||n.remove()}}}function L(){let u=n==null?void 0:n.getLngLat();u&&(Array.isArray(a)?t(9,a=[u.lng,u.lat]):a&&"lon"in a?t(9,a={lon:u.lng,lat:u.lat}):t(9,a=u))}function b(u){u.key===" "&&(u.preventDefault(),u.stopPropagation(),p("click"))}function p(u){if(!i)return;let G=n==null?void 0:n.getLngLat();if(!G)return;const U=[G.lng,G.lat];let K={map:o,marker:n,lngLat:U,features:[{type:"Feature",properties:(h==null?void 0:h.properties)??{},geometry:{type:"Point",coordinates:U}}]};ee(j,l={...K,layerType:"marker",type:u},l),I(u,K)}const d=()=>p("click"),E=()=>p("dblclick"),X=()=>p("contextmenu"),Z=u=>{p("mouseenter")},g=()=>{p("mouseleave")},M=()=>p("mousemove");return s.$$set=u=>{"lngLat"in u&&t(9,a=u.lngLat),"class"in u&&t(0,r=u.class),"interactive"in u&&t(10,i=u.interactive),"asButton"in u&&t(1,m=u.asButton),"draggable"in u&&t(11,C=u.draggable),"feature"in u&&t(12,h=u.feature),"offset"in u&&t(13,B=u.offset),"zIndex"in u&&t(2,_=u.zIndex),"rotation"in u&&t(14,w=u.rotation),"$$scope"in u&&t(16,c=u.$$scope)},s.$$.update=()=>{s.$$.dirty&33280&&(n==null||n.setLngLat(a)),s.$$.dirty&40960&&(n==null||n.setOffset(B??[0,0])),s.$$.dirty&49152&&(n==null||n.setRotation(w))},[r,m,_,z,j,A,F,b,p,a,i,C,h,B,w,n,c,f,d,E,X,Z,g,M]}class Fe extends ie{constructor(e){super(),re(this,e,Ae,Te,fe,{lngLat:9,class:0,interactive:10,asButton:1,draggable:11,feature:12,offset:13,zIndex:2,rotation:14})}}const Xe=` - - - - -`;function ae(s){let e,t;return{c(){e=S("p"),t=Y(s[10])},m(l,n){R(l,e,n),v(e,t)},p(l,n){n&1024&&Me(t,l[10])},d(l){l&&J(e)}}}function le(s){let e,t,l,n,o,f,c,a,r,i,m,C;function h(_){s[21](_)}let B={};return s[2]!==void 0&&(B.cost=s[2]),a=new Pe({props:B}),H.push(()=>Q(a,"cost",h)),{c(){e=S("div"),t=S("label"),l=Y(`Max requests (limit for faster updates): - `),n=S("br"),o=O(),f=S("input"),c=O(),q(a.$$.fragment),T(f,"type","number"),T(f,"min",1)},m(_,w){R(_,e,w),v(e,t),v(t,l),v(t,n),v(t,o),v(t,f),se(f,s[1]),R(_,c,w),D(a,_,w),i=!0,m||(C=N(f,"input",s[20]),m=!0)},p(_,w){w&2&&ue(f.value)!==_[1]&&se(f,_[1]);const I={};!r&&w&4&&(r=!0,I.cost=_[2],V(()=>r=!1)),a.$set(I)},i(_){i||(y(a.$$.fragment,_),i=!0)},o(_){k(a.$$.fragment,_),i=!1},d(_){_&&(J(e),J(c)),P(a,_),m=!1,C()}}}function oe(s){let e,t,l,n,o;function f(a){s[22](a)}let c={outputMetadata:s[6].metadata,map:s[3]};return s[8]!==void 0&&(c.controls=s[8]),l=new Je({props:c}),H.push(()=>Q(l,"controls",f)),{c(){e=S("hr"),t=O(),q(l.$$.fragment)},m(a,r){R(a,e,r),R(a,t,r),D(l,a,r),o=!0},p(a,r){const i={};r&64&&(i.outputMetadata=a[6].metadata),r&8&&(i.map=a[3]),!n&&r&256&&(n=!0,i.controls=a[8],V(()=>n=!1)),l.$set(i)},i(a){o||(y(l.$$.fragment,a),o=!0)},o(a){k(l.$$.fragment,a),o=!1},d(a){a&&(J(e),J(t)),P(l,a)}}}function Ze(s){let e,t,l,n,o,f,c,a,r,i,m,C,h,B,_,w,I,z,j;t=new ve({props:{app:"interactive"}});function A(d){s[17](d)}let F={};s[0]!==void 0&&(F.example=s[0]),i=new Ie({props:F}),H.push(()=>Q(i,"example",A)),h=new Oe({props:{map:s[3]}}),h.$on("gotXml",s[13]),h.$on("loading",s[18]),h.$on("error",s[19]);let L=s[10]&&ae(s),b=s[4]&&le(s),p=s[6].metadata&&oe(s);return{c(){e=S("div"),q(t.$$.fragment),l=O(),n=S("label"),o=Y("Open an "),f=S("i"),f.textContent=".osm.pbf",c=Y(` - file - `),a=S("input"),r=O(),q(i.$$.fragment),C=O(),q(h.$$.fragment),B=O(),L&&L.c(),_=O(),b&&b.c(),w=O(),p&&p.c(),T(a,"type","file"),T(e,"slot","left")},m(d,E){R(d,e,E),D(t,e,null),v(e,l),v(e,n),v(n,o),v(n,f),v(n,c),v(n,a),s[16](a),v(e,r),D(i,e,null),v(e,C),D(h,e,null),v(e,B),L&&L.m(e,null),v(e,_),b&&b.m(e,null),v(e,w),p&&p.m(e,null),I=!0,z||(j=N(a,"change",s[11]),z=!0)},p(d,E){const X={};!m&&E&1&&(m=!0,X.example=d[0],V(()=>m=!1)),i.$set(X);const Z={};E&8&&(Z.map=d[3]),h.$set(Z),d[10]?L?L.p(d,E):(L=ae(d),L.c(),L.m(e,_)):L&&(L.d(1),L=null),d[4]?b?(b.p(d,E),E&16&&y(b,1)):(b=le(d),b.c(),y(b,1),b.m(e,w)):b&&(te(),k(b,1,1,()=>{b=null}),ne()),d[6].metadata?p?(p.p(d,E),E&64&&y(p,1)):(p=oe(d),p.c(),y(p,1),p.m(e,null)):p&&(te(),k(p,1,1,()=>{p=null}),ne())},i(d){I||(y(t.$$.fragment,d),y(i.$$.fragment,d),y(h.$$.fragment,d),y(b),y(p),I=!0)},o(d){k(t.$$.fragment,d),k(i.$$.fragment,d),k(h.$$.fragment,d),k(b),k(p),I=!1},d(d){d&&J(e),P(t),s[16](null),P(i),P(h),L&&L.d(),b&&b.d(),p&&p.d(),z=!1,j()}}}function Ge(s){let e,t;return{c(){e=new ze(!1),t=Be(),e.a=t},m(l,n){e.m(Xe,l,n),R(l,t,n)},p:Ee,d(l){l&&(J(t),e.d())}}}function He(s){let e,t;return e=new Ne({props:{controls:s[8]}}),{c(){q(e.$$.fragment)},m(l,n){D(e,l,n),t=!0},p(l,n){const o={};n&256&&(o.controls=l[8]),e.$set(o)},i(l){t||(y(e.$$.fragment,l),t=!0)},o(l){k(e.$$.fragment,l),t=!1},d(l){P(e,l)}}}function Ue(s){let e,t,l,n,o;function f(a){s[14](a)}let c={draggable:!0,$$slots:{default:[Ge]},$$scope:{ctx:s}};return s[5]!==void 0&&(c.lngLat=s[5]),e=new Fe({props:c}),H.push(()=>Q(e,"lngLat",f)),e.$on("dragend",s[12]),n=new Re({props:{data:s[6],$$slots:{default:[He]},$$scope:{ctx:s}}}),{c(){q(e.$$.fragment),l=O(),q(n.$$.fragment)},m(a,r){D(e,a,r),R(a,l,r),D(n,a,r),o=!0},p(a,r){const i={};r&67108864&&(i.$$scope={dirty:r,ctx:a}),!t&&r&32&&(t=!0,i.lngLat=a[5],V(()=>t=!1)),e.$set(i);const m={};r&64&&(m.data=a[6]),r&67109120&&(m.$$scope={dirty:r,ctx:a}),n.$set(m)},i(a){o||(y(e.$$.fragment,a),y(n.$$.fragment,a),o=!0)},o(a){k(e.$$.fragment,a),k(n.$$.fragment,a),o=!1},d(a){a&&J(l),P(e,a),P(n,a)}}}function Ke(s){let e,t,l,n;function o(c){s[15](c)}let f={style:"https://api.maptiler.com/maps/dataviz/style.json?key=MZEJTanw3WpxRvt7qDfo",standardControls:!0,hash:!0,$$slots:{default:[Ue]},$$scope:{ctx:s}};return s[3]!==void 0&&(f.map=s[3]),t=new Ce({props:f}),H.push(()=>Q(t,"map",o)),{c(){e=S("div"),q(t.$$.fragment),T(e,"slot","main"),W(e,"position","relative"),W(e,"width","100%"),W(e,"height","100vh")},m(c,a){R(c,e,a),D(t,e,null),n=!0},p(c,a){const r={};a&67109216&&(r.$$scope={dirty:a,ctx:c}),!l&&a&8&&(l=!0,r.map=c[3],V(()=>l=!1)),t.$set(r)},i(c){n||(y(t.$$.fragment,c),n=!0)},o(c){k(t.$$.fragment,c),n=!1},d(c){c&&J(e),P(t)}}}function We(s){let e,t,l,n;return e=new Le({props:{$$slots:{main:[Ke],left:[Ze]},$$scope:{ctx:s}}}),l=new Se({props:{loading:s[7]}}),{c(){q(e.$$.fragment),t=O(),q(l.$$.fragment)},m(o,f){D(e,o,f),R(o,t,f),D(l,o,f),n=!0},p(o,[f]){const c={};f&67110783&&(c.$$scope={dirty:f,ctx:o}),e.$set(c);const a={};f&128&&(a.loading=o[7]),l.$set(a)},i(o){n||(y(e.$$.fragment,o),y(l.$$.fragment,o),n=!0)},o(o){k(e.$$.fragment,o),k(l.$$.fragment,o),n=!1},d(o){o&&J(t),P(e,o),P(l,o)}}}function Qe(s,e,t){ye(async()=>{await qe(),await ke()});let l,n,o="",f={lng:0,lat:0},c={type:"FeatureCollection",features:[]},a=!1,r=1e3,i="Distance",m={maxCount:1e3,originRadius:3,destinationRadius:3,streetviewOn:!1},C;async function h(g){t(0,o=""),t(7,a=!0),B(await C.files[0].arrayBuffer())}function B(g){try{t(4,n=new De(new Uint8Array(g))),t(2,i="Distance");let M=n.getBounds();l.fitBounds([[M[0],M[1]],[M[2],M[3]]],{padding:20,animate:!1}),t(5,f.lng=(M[0]+M[2])/2,f),t(5,f.lat=(M[1]+M[3])/2,f),w()}catch(M){window.alert(`Problem importing osm.pbf file: ${M}`)}t(7,a=!1)}async function _(g){if(g!=""){t(7,a=!0);let M=await fetch(`https://assets.od2net.org/pbf_clips/${g}.osm.pbf`);B(await M.arrayBuffer())}}function w(){n&&t(6,c=JSON.parse(n.recalculate({lng:f.lng,lat:f.lat,max_requests:r,cost:i})))}function I(g,M){w()}let z="";function j(g){t(10,z="Parsing XML"),B(new TextEncoder().encode(g.detail)),t(10,z="")}function A(g){f=g,t(5,f)}function F(g){l=g,t(3,l)}function L(g){H[g?"unshift":"push"](()=>{C=g,t(9,C)})}function b(g){o=g,t(0,o)}const p=g=>t(10,z=g.detail),d=g=>t(10,z=g.detail);function E(){r=ue(this.value),t(1,r)}function X(g){i=g,t(2,i)}function Z(g){m=g,t(8,m)}return s.$$.update=()=>{s.$$.dirty&1&&_(o),s.$$.dirty&6&&I()},[o,r,i,l,n,f,c,a,m,C,z,h,w,j,A,F,L,b,p,d,E,X,Z]}class Ve extends ie{constructor(e){super(),re(this,e,Qe,We,fe,{})}}new Ve({target:document.getElementById("app")}); diff --git a/assets/x2-aa3aa0d9.js b/assets/x2-aa3aa0d9.js new file mode 100644 index 0000000..e334194 --- /dev/null +++ b/assets/x2-aa3aa0d9.js @@ -0,0 +1,9 @@ +import{S as ie,i as re,s as fe,G as pe,e as z,h as T,z as W,l as R,I as x,q as N,J as de,K as me,N as ge,O as _e,t as y,b as k,v as J,w as be,Q as he,R as we,T as $,U as ee,m as Le,L as ye,c as q,f as I,a as D,d as P,o as ve,H as Ce,x as H,y as Q,g as Y,n as v,A as V,r as te,u as ne,M as ke,_ as Me,V as ue,W as Be,j as se,D as Se,E as Ee,X as ze}from"./Legend-7e8105f0.js";import{L as Oe,C as Ie,O as qe,_ as De,J as Pe,a as Re,G as Je}from"./OverpassSelector-df03c184.js";import{S as Ne,L as Te}from"./SidebarControls-4458b6f2.js";function je(s){let e,t,l,n,o,u,p;const a=s[18].default,r=pe(a,s,s[17],null);return{c(){e=z("div"),r&&r.c(),T(e,"tabindex",t=s[1]?0:void 0),T(e,"role",l=s[1]?"button":void 0),W(e,"z-index",s[2])},m(i,d){R(i,e,d),r&&r.m(e,null),o=!0,u||(p=[x(s[6].call(null,e)),x(n=Ae.call(null,e,s[0])),N(e,"click",s[19]),N(e,"dblclick",s[20]),N(e,"contextmenu",s[21]),N(e,"mouseenter",s[22]),N(e,"mouseleave",s[23]),N(e,"mousemove",s[24]),N(e,"keydown",s[7])],u=!0)},p(i,[d]){r&&r.p&&(!o||d&131072)&&de(r,a,i,i[17],o?ge(a,i[17],d,null):me(i[17]),null),(!o||d&2&&t!==(t=i[1]?0:void 0))&&T(e,"tabindex",t),(!o||d&2&&l!==(l=i[1]?"button":void 0))&&T(e,"role",l),n&&_e(n.update)&&d&1&&n.update.call(null,i[0]),d&4&&W(e,"z-index",i[2])},i(i){o||(y(r,i),o=!0)},o(i){k(r,i),o=!1},d(i){i&&J(e),r&&r.d(i),u=!1,be(p)}}}function Ae(s,e){const t=s.className;function l(n){n?s.className=`${t} ${n}`:s.className=t}return l(e),{update:l}}function Fe(s,e,t){let l,n,o,{$$slots:u={},$$scope:p}=e,{lngLat:a}=e,{class:r=void 0}=e,{interactive:i=!0}=e,{asButton:d=!1}=e,{draggable:C=!1}=e,{feature:h=null}=e,{offset:B=void 0}=e,{zIndex:g=void 0}=e,{rotation:w=0}=e,{opacity:S=1}=e;const O=he(),{map:A,layerEvent:F,self:j}=we();$(s,A,f=>t(26,o=f)),$(s,F,f=>t(25,l=f)),$(s,j,f=>t(16,n=f));function L(f){ee(j,n=new Le.Marker({element:f,rotation:w,draggable:C,offset:B,opacity:S.toString()}).setLngLat(a).addTo(o),n);const G=()=>c("dragstart"),U=()=>{_(),c("drag")},K=()=>{_(),c("dragend")};return C&&(n.on("dragstart",G),n.on("drag",U),n.on("dragend",K)),{destroy(){C&&(n==null||n.off("dragstart",G),n==null||n.off("drag",U),n==null||n.off("dragend",K)),n==null||n.remove()}}}function _(){let f=n==null?void 0:n.getLngLat();f&&(Array.isArray(a)?t(9,a=[f.lng,f.lat]):a&&"lon"in a?t(9,a={lon:f.lng,lat:f.lat}):t(9,a=f))}function b(f){f.key===" "&&(f.preventDefault(),f.stopPropagation(),c("click"))}function c(f){if(!i)return;let G=n==null?void 0:n.getLngLat();if(!G)return;const U=[G.lng,G.lat];let K={map:o,marker:n,lngLat:U,features:[{type:"Feature",properties:(h==null?void 0:h.properties)??{},geometry:{type:"Point",coordinates:U}}]};ee(F,l={...K,layerType:"marker",type:f},l),O(f,K)}const E=()=>c("click"),X=()=>c("dblclick"),Z=()=>c("contextmenu"),m=f=>{c("mouseenter")},M=()=>{c("mouseleave")},ce=()=>c("mousemove");return s.$$set=f=>{"lngLat"in f&&t(9,a=f.lngLat),"class"in f&&t(0,r=f.class),"interactive"in f&&t(10,i=f.interactive),"asButton"in f&&t(1,d=f.asButton),"draggable"in f&&t(11,C=f.draggable),"feature"in f&&t(12,h=f.feature),"offset"in f&&t(13,B=f.offset),"zIndex"in f&&t(2,g=f.zIndex),"rotation"in f&&t(14,w=f.rotation),"opacity"in f&&t(15,S=f.opacity),"$$scope"in f&&t(17,p=f.$$scope)},s.$$.update=()=>{s.$$.dirty&66048&&(n==null||n.setLngLat(a)),s.$$.dirty&73728&&(n==null||n.setOffset(B??[0,0])),s.$$.dirty&81920&&(n==null||n.setRotation(w)),s.$$.dirty&98304&&(n==null||n.setOpacity(S.toString()))},[r,d,g,A,F,j,L,b,c,a,i,C,h,B,w,S,n,p,u,E,X,Z,m,M,ce]}class Xe extends ie{constructor(e){super(),re(this,e,Fe,je,fe,{lngLat:9,class:0,interactive:10,asButton:1,draggable:11,feature:12,offset:13,zIndex:2,rotation:14,opacity:15})}}const Ze=` + + + + +`;function ae(s){let e,t;return{c(){e=z("p"),t=Y(s[10])},m(l,n){R(l,e,n),v(e,t)},p(l,n){n&1024&&Be(t,l[10])},d(l){l&&J(e)}}}function le(s){let e,t,l,n,o,u,p,a,r,i,d,C;function h(g){s[21](g)}let B={};return s[2]!==void 0&&(B.cost=s[2]),a=new Re({props:B}),H.push(()=>Q(a,"cost",h)),{c(){e=z("div"),t=z("label"),l=Y(`Max requests (limit for faster updates): + `),n=z("br"),o=I(),u=z("input"),p=I(),q(a.$$.fragment),T(u,"type","number"),T(u,"min",1)},m(g,w){R(g,e,w),v(e,t),v(t,l),v(t,n),v(t,o),v(t,u),se(u,s[1]),R(g,p,w),D(a,g,w),i=!0,d||(C=N(u,"input",s[20]),d=!0)},p(g,w){w&2&&ue(u.value)!==g[1]&&se(u,g[1]);const S={};!r&&w&4&&(r=!0,S.cost=g[2],V(()=>r=!1)),a.$set(S)},i(g){i||(y(a.$$.fragment,g),i=!0)},o(g){k(a.$$.fragment,g),i=!1},d(g){g&&(J(e),J(p)),P(a,g),d=!1,C()}}}function oe(s){let e,t,l,n,o;function u(a){s[22](a)}let p={outputMetadata:s[6].metadata,map:s[3]};return s[8]!==void 0&&(p.controls=s[8]),l=new Ne({props:p}),H.push(()=>Q(l,"controls",u)),{c(){e=z("hr"),t=I(),q(l.$$.fragment)},m(a,r){R(a,e,r),R(a,t,r),D(l,a,r),o=!0},p(a,r){const i={};r&64&&(i.outputMetadata=a[6].metadata),r&8&&(i.map=a[3]),!n&&r&256&&(n=!0,i.controls=a[8],V(()=>n=!1)),l.$set(i)},i(a){o||(y(l.$$.fragment,a),o=!0)},o(a){k(l.$$.fragment,a),o=!1},d(a){a&&(J(e),J(t)),P(l,a)}}}function Ge(s){let e,t,l,n,o,u,p,a,r,i,d,C,h,B,g,w,S,O,A;t=new Ce({props:{app:"interactive"}});function F(c){s[17](c)}let j={};s[0]!==void 0&&(j.example=s[0]),i=new Ie({props:j}),H.push(()=>Q(i,"example",F)),h=new qe({props:{map:s[3]}}),h.$on("gotXml",s[13]),h.$on("loading",s[18]),h.$on("error",s[19]);let L=s[10]&&ae(s),_=s[4]&&le(s),b=s[6].metadata&&oe(s);return{c(){e=z("div"),q(t.$$.fragment),l=I(),n=z("label"),o=Y("Open an "),u=z("i"),u.textContent=".osm.pbf",p=Y(` + file + `),a=z("input"),r=I(),q(i.$$.fragment),C=I(),q(h.$$.fragment),B=I(),L&&L.c(),g=I(),_&&_.c(),w=I(),b&&b.c(),T(a,"type","file"),T(e,"slot","left")},m(c,E){R(c,e,E),D(t,e,null),v(e,l),v(e,n),v(n,o),v(n,u),v(n,p),v(n,a),s[16](a),v(e,r),D(i,e,null),v(e,C),D(h,e,null),v(e,B),L&&L.m(e,null),v(e,g),_&&_.m(e,null),v(e,w),b&&b.m(e,null),S=!0,O||(A=N(a,"change",s[11]),O=!0)},p(c,E){const X={};!d&&E&1&&(d=!0,X.example=c[0],V(()=>d=!1)),i.$set(X);const Z={};E&8&&(Z.map=c[3]),h.$set(Z),c[10]?L?L.p(c,E):(L=ae(c),L.c(),L.m(e,g)):L&&(L.d(1),L=null),c[4]?_?(_.p(c,E),E&16&&y(_,1)):(_=le(c),_.c(),y(_,1),_.m(e,w)):_&&(te(),k(_,1,1,()=>{_=null}),ne()),c[6].metadata?b?(b.p(c,E),E&64&&y(b,1)):(b=oe(c),b.c(),y(b,1),b.m(e,null)):b&&(te(),k(b,1,1,()=>{b=null}),ne())},i(c){S||(y(t.$$.fragment,c),y(i.$$.fragment,c),y(h.$$.fragment,c),y(_),y(b),S=!0)},o(c){k(t.$$.fragment,c),k(i.$$.fragment,c),k(h.$$.fragment,c),k(_),k(b),S=!1},d(c){c&&J(e),P(t),s[16](null),P(i),P(h),L&&L.d(),_&&_.d(),b&&b.d(),O=!1,A()}}}function He(s){let e,t;return{c(){e=new ze(!1),t=Se(),e.a=t},m(l,n){e.m(Ze,l,n),R(l,t,n)},p:Ee,d(l){l&&(J(t),e.d())}}}function Ue(s){let e,t;return e=new Te({props:{controls:s[8]}}),{c(){q(e.$$.fragment)},m(l,n){D(e,l,n),t=!0},p(l,n){const o={};n&256&&(o.controls=l[8]),e.$set(o)},i(l){t||(y(e.$$.fragment,l),t=!0)},o(l){k(e.$$.fragment,l),t=!1},d(l){P(e,l)}}}function Ke(s){let e,t,l,n,o;function u(a){s[14](a)}let p={draggable:!0,$$slots:{default:[He]},$$scope:{ctx:s}};return s[5]!==void 0&&(p.lngLat=s[5]),e=new Xe({props:p}),H.push(()=>Q(e,"lngLat",u)),e.$on("dragend",s[12]),n=new Je({props:{data:s[6],$$slots:{default:[Ue]},$$scope:{ctx:s}}}),{c(){q(e.$$.fragment),l=I(),q(n.$$.fragment)},m(a,r){D(e,a,r),R(a,l,r),D(n,a,r),o=!0},p(a,r){const i={};r&67108864&&(i.$$scope={dirty:r,ctx:a}),!t&&r&32&&(t=!0,i.lngLat=a[5],V(()=>t=!1)),e.$set(i);const d={};r&64&&(d.data=a[6]),r&67109120&&(d.$$scope={dirty:r,ctx:a}),n.$set(d)},i(a){o||(y(e.$$.fragment,a),y(n.$$.fragment,a),o=!0)},o(a){k(e.$$.fragment,a),k(n.$$.fragment,a),o=!1},d(a){a&&J(l),P(e,a),P(n,a)}}}function We(s){let e,t,l,n;function o(p){s[15](p)}let u={style:"https://api.maptiler.com/maps/dataviz/style.json?key=MZEJTanw3WpxRvt7qDfo",standardControls:!0,hash:!0,$$slots:{default:[Ke]},$$scope:{ctx:s}};return s[3]!==void 0&&(u.map=s[3]),t=new ke({props:u}),H.push(()=>Q(t,"map",o)),{c(){e=z("div"),q(t.$$.fragment),T(e,"slot","main"),W(e,"position","relative"),W(e,"width","100%"),W(e,"height","100vh")},m(p,a){R(p,e,a),D(t,e,null),n=!0},p(p,a){const r={};a&67109216&&(r.$$scope={dirty:a,ctx:p}),!l&&a&8&&(l=!0,r.map=p[3],V(()=>l=!1)),t.$set(r)},i(p){n||(y(t.$$.fragment,p),n=!0)},o(p){k(t.$$.fragment,p),n=!1},d(p){p&&J(e),P(t)}}}function Qe(s){let e,t,l,n;return e=new ye({props:{$$slots:{main:[We],left:[Ge]},$$scope:{ctx:s}}}),l=new Oe({props:{loading:s[7]}}),{c(){q(e.$$.fragment),t=I(),q(l.$$.fragment)},m(o,u){D(e,o,u),R(o,t,u),D(l,o,u),n=!0},p(o,[u]){const p={};u&67110783&&(p.$$scope={dirty:u,ctx:o}),e.$set(p);const a={};u&128&&(a.loading=o[7]),l.$set(a)},i(o){n||(y(e.$$.fragment,o),y(l.$$.fragment,o),n=!0)},o(o){k(e.$$.fragment,o),k(l.$$.fragment,o),n=!1},d(o){o&&J(t),P(e,o),P(l,o)}}}function Ve(s,e,t){ve(async()=>{await De(),await Me()});let l,n,o="",u={lng:0,lat:0},p={type:"FeatureCollection",features:[]},a=!1,r=1e3,i="Distance",d={maxCount:1e3,originRadius:3,destinationRadius:3,streetviewOn:!1},C;async function h(m){t(0,o=""),t(7,a=!0),B(await C.files[0].arrayBuffer())}function B(m){try{t(4,n=new Pe(new Uint8Array(m))),t(2,i="Distance");let M=n.getBounds();l.fitBounds([[M[0],M[1]],[M[2],M[3]]],{padding:20,animate:!1}),t(5,u.lng=(M[0]+M[2])/2,u),t(5,u.lat=(M[1]+M[3])/2,u),w()}catch(M){window.alert(`Problem importing osm.pbf file: ${M}`)}t(7,a=!1)}async function g(m){if(m!=""){t(7,a=!0);let M=await fetch(`https://assets.od2net.org/pbf_clips/${m}.osm.pbf`);B(await M.arrayBuffer())}}function w(){n&&t(6,p=JSON.parse(n.recalculate({lng:u.lng,lat:u.lat,max_requests:r,cost:i})))}function S(m,M){w()}let O="";function A(m){t(10,O="Parsing XML"),B(new TextEncoder().encode(m.detail)),t(10,O="")}function F(m){u=m,t(5,u)}function j(m){l=m,t(3,l)}function L(m){H[m?"unshift":"push"](()=>{C=m,t(9,C)})}function _(m){o=m,t(0,o)}const b=m=>t(10,O=m.detail),c=m=>t(10,O=m.detail);function E(){r=ue(this.value),t(1,r)}function X(m){i=m,t(2,i)}function Z(m){d=m,t(8,d)}return s.$$.update=()=>{s.$$.dirty&1&&g(o),s.$$.dirty&6&&S()},[o,r,i,l,n,u,p,a,d,C,O,h,w,A,F,j,L,_,b,c,E,X,Z]}class Ye extends ie{constructor(e){super(),re(this,e,Ve,Qe,fe,{})}}new Ye({target:document.getElementById("app")}); diff --git a/assets/x3-20435d61.js b/assets/x3-29170943.js similarity index 98% rename from assets/x3-20435d61.js rename to assets/x3-29170943.js index 50d1454..585300d 100644 --- a/assets/x3-20435d61.js +++ b/assets/x3-29170943.js @@ -1,4 +1,4 @@ -import{S as ge,i as $e,s as be,ac as K,e as $,f as E,z as T,l as k,E as oe,v as y,ad as ae,g as W,n as b,W as he,L as ye,c as N,a as O,t as S,b as C,d as j,o as ve,H as Se,x as Y,y as le,h as Q,q as te,A as se,r as we,u as ke,M as Ce,_ as Fe,a1 as Le,a5 as P,ae as re,C as Me,j as ee,k as Ee,p as ie,w as Ne,af as ne,a2 as Oe,aa as je,ab as G,a4 as Be,a6 as qe,a7 as Te}from"./Legend-07540826.js";import{L as Je,C as Pe,O as Ae,_ as He,J as De,a as Ge,G as Ie}from"./OverpassSelector-c6601889.js";function fe(l,e,n){const t=l.slice();return t[2]=e[n],t}function ue(l,e,n){const t=l.slice();return t[5]=e[n],t}function pe(l){let e,n;return{c(){e=$("span"),n=W(`  +import{S as ge,i as $e,s as be,ac as K,e as $,f as E,z as T,l as k,E as oe,v as y,ad as ae,g as W,n as b,W as he,L as ye,c as N,a as O,t as S,b as C,d as j,o as ve,H as Se,x as Y,y as le,h as Q,q as te,A as se,r as we,u as ke,M as Ce,_ as Fe,a1 as Le,a5 as P,ae as re,C as Me,j as ee,k as Ee,p as ie,w as Ne,af as ne,a2 as Oe,aa as je,ab as G,a4 as Be,a6 as qe,a7 as Te}from"./Legend-7e8105f0.js";import{L as Je,C as Pe,O as Ae,_ as He,J as De,a as Ge,G as Ie}from"./OverpassSelector-df03c184.js";function fe(l,e,n){const t=l.slice();return t[2]=e[n],t}function ue(l,e,n){const t=l.slice();return t[5]=e[n],t}function pe(l){let e,n;return{c(){e=$("span"),n=W(`  `),T(e,"background",l[5]),T(e,"width","100%"),T(e,"border","1px solid black")},m(t,o){k(t,e,o),b(e,n)},p(t,o){o&1&&T(e,"background",t[5])},d(t){t&&y(e)}}}function ce(l){let e,n=l[2].toFixed(1)+"",t;return{c(){e=$("span"),t=W(n)},m(o,s){k(o,e,s),b(e,t)},p(o,s){s&2&&n!==(n=o[2].toFixed(1)+"")&&he(t,n)},d(o){o&&y(e)}}}function Re(l){let e,n,t,o=K(l[0]),s=[];for(let a=0;a{"colorScale"in s&&n(0,t=s.colorScale),"limits"in s&&n(1,o=s.limits)},[t,o]}class ze extends ge{constructor(e){super(),$e(this,e,Xe,Re,be,{colorScale:0,limits:1})}}function _e(l){let e,n;return{c(){e=$("p"),n=W(l[12])},m(t,o){k(t,e,o),b(e,n)},p(t,o){o&4096&&he(n,t[12])},d(t){t&&y(e)}}}function me(l){let e,n,t,o,s,u,f,a,m,r,d,v,h,B,q,F,H,A,I,D,c,g,_,L,R;const X=[Ue,We],J=[];function U(p,i){return p[5]=="lts"?0:1}d=U(l),v=J[d]=X[d](l);function x(p){l[24](p)}let Z={};return l[1]!==void 0&&(Z.cost=l[1]),c=new Ge({props:Z}),Y.push(()=>le(c,"cost",x)),{c(){e=$("hr"),n=E(),t=$("div"),o=$("label"),s=W(`Color edges by: `),u=$("select"),f=$("option"),f.textContent="LTS",a=$("option"),a.textContent="Edge cost (relative to length)",m=$("option"),m.textContent="Nearby amenities",r=E(),v.c(),h=E(),B=$("div"),q=$("label"),F=$("input"),H=W(` Show cyclists not allowed`),A=E(),I=$("hr"),D=E(),N(c.$$.fragment),f.__value="lts",ee(f,f.__value),a.__value="cost",ee(a,a.__value),m.__value="nearby_amenities",ee(m,m.__value),l[5]===void 0&&Ee(()=>l[22].call(u)),Q(F,"type","checkbox"),T(q,"color",P.lts_not_allowed)},m(p,i){k(p,e,i),k(p,n,i),k(p,t,i),b(t,o),b(o,s),b(o,u),b(u,f),b(u,a),b(u,m),ie(u,l[5],!0),k(p,r,i),J[d].m(p,i),k(p,h,i),k(p,B,i),b(B,q),b(q,F),F.checked=l[6],b(q,H),k(p,A,i),k(p,I,i),k(p,D,i),O(c,p,i),_=!0,L||(R=[te(u,"change",l[22]),te(F,"change",l[23])],L=!0)},p(p,i){i&32&&ie(u,p[5]);let w=d;d=U(p),d===w?J[d].p(p,i):(we(),C(J[w],1,1,()=>{J[w]=null}),ke(),v=J[d],v?v.p(p,i):(v=J[d]=X[d](p),v.c()),S(v,1),v.m(h.parentNode,h)),i&64&&(F.checked=p[6]);const M={};!g&&i&2&&(g=!0,M.cost=p[1],se(()=>g=!1)),c.$set(M)},i(p){_||(S(v),S(c.$$.fragment,p),_=!0)},o(p){C(v),C(c.$$.fragment,p),_=!1},d(p){p&&(y(e),y(n),y(t),y(r),y(h),y(B),y(A),y(I),y(D)),J[d].d(p),j(c,p),L=!1,Ne(R)}}}function We(l){let e,n;return e=new ze({props:{colorScale:ne,limits:V(l[5],l[9],l[10])}}),{c(){N(e.$$.fragment)},m(t,o){O(e,t,o),n=!0},p(t,o){const s={};o&1568&&(s.limits=V(t[5],t[9],t[10])),e.$set(s)},i(t){n||(S(e.$$.fragment,t),n=!0)},o(t){C(e.$$.fragment,t),n=!1},d(t){j(e,t)}}}function Ue(l){let e,n,t,o;return e=new je({props:{rows:[[`${G.lts1}: ${l[8][1].toFixed(0)}% of roads by distance`,P.lts1],[`${G.lts2}: ${l[8][2].toFixed(0)}%`,P.lts2],[`${G.lts3}: ${l[8][3].toFixed(0)}%`,P.lts3],[`${G.lts4}: ${l[8][4].toFixed(0)}%`,P.lts4]]}}),{c(){N(e.$$.fragment),n=E(),t=$("p"),t.innerHTML='Note: LTS model from BikeOttawa'},m(s,u){O(e,s,u),k(s,n,u),k(s,t,u),o=!0},p(s,u){const f={};u&256&&(f.rows=[[`${G.lts1}: ${s[8][1].toFixed(0)}% of roads by distance`,P.lts1],[`${G.lts2}: ${s[8][2].toFixed(0)}%`,P.lts2],[`${G.lts3}: ${s[8][3].toFixed(0)}%`,P.lts3],[`${G.lts4}: ${s[8][4].toFixed(0)}%`,P.lts4]]),e.$set(f)},i(s){o||(S(e.$$.fragment,s),o=!0)},o(s){C(e.$$.fragment,s),o=!1},d(s){s&&(y(n),y(t)),j(e,s)}}}function Ze(l){let e,n,t,o,s,u,f,a,m,r,d,v,h,B,q,F,H,A;n=new Se({props:{app:"costs"}});function I(_){l[19](_)}let D={};l[0]!==void 0&&(D.example=l[0]),r=new Pe({props:D}),Y.push(()=>le(r,"example",I)),h=new Ae({props:{map:l[2]}}),h.$on("gotXml",l[16]),h.$on("loading",l[20]),h.$on("error",l[21]);let c=l[12]&&_e(l),g=l[3]&&me(l);return{c(){e=$("div"),N(n.$$.fragment),t=E(),o=$("label"),s=W("Open an "),u=$("i"),u.textContent=".osm.pbf",f=W(` diff --git a/edge_cost.html b/edge_cost.html index d2bbd4f..3a0090d 100644 --- a/edge_cost.html +++ b/edge_cost.html @@ -4,10 +4,10 @@ od2net edge cost mode - - - - + + + + diff --git a/index.html b/index.html index 0a5275e..ea8a35b 100644 --- a/index.html +++ b/index.html @@ -4,10 +4,10 @@ od2net - - - - + + + +
    diff --git a/interactive.html b/interactive.html index 64638f2..0438ef7 100644 --- a/interactive.html +++ b/interactive.html @@ -4,11 +4,11 @@ od2net interactive mode - - - - - + + + + +