PageSourceSearch

https://miramap.org/wp-content/plugins/clicamap-carte/front/build/bundle.js?ver=1790278398

js miramap.org collected 2026-09-24 19:33:31 UTC 1,057,135 bytes, 1,325 lines download raw bytes

1var app=function(){"use strict";const Sx="",Ix="";function on(){}function la(S,x){for(const b in x)S[b]=x[b];return S}function sp(S){return S()}function ap(){return Object.create(null)}function Cr(S){S.forEach(sp)}function lp(S){return typeof S=="function"}function yo(S,x){return S!=S?x==x:S!==x||S&&typeof S=="object"||typeof S=="function"}function j_(S){return Object.keys(S).length===0}function G_(S,x,b,k){if(S){const D=cp(S,x,b,k);return S[0](D)}}function cp(S,x,b,k){return S[1]&&k?la(b.ctx.slice(),S[1](k(x))):b.ctx}function Z_(S,x,b,k){if(S[2]&&k){const D=S[2](k(b));if(x.dirty===void 0)return D;if(typeof D=="object"){const ee=[],Z=Math.max(x.dirty.length,D.length);for(let o=0;o<Z;o+=1)ee[o]=x.dirty[o]|D[o];return ee}return x.dirty|D}return x.dirty}function q_(S,x,b,k,D,ee){if(D){const Z=cp(x,b,k,ee);S.p(Z,D)}}function W_(S){if(S.ctx.length>32){const x=[],b=S.ctx.length/32;for(let k=0;k<b;k++)x[k]=-1;return x}return-1}function up(S){const x={};for(const b in S)b[0]!=="$"&&(x[b]=S[b]);return x}function nt(S,x){S.appendChild(x)}function yt(S,x,b){S.insertBefore(x,b||null)}function ft(S){S.parentNode&&S.parentNode.removeChild(S)}function jc(S,x){for(let b=0;b<S.length;b+=1)S[b]&&S[b].d(x)}function mt(S){return document.createElement(S)}function ul(S){return document.createElementNS("http://www.w3.org/2000/svg",S)}function Ci(S){return document.createTextNode(S)}function Kt(){return Ci(" ")}function mr(){return Ci("")}function Ui(S,x,b,k){return S.addEventListener(x,b,k),()=>S.removeEventListener(x,b,k)}function X_(S){return function(x){return x.preventDefault(),S.call(this,x)}}function tt(S,x,b){b==null?S.removeAttribute(x):S.getAttribute(x)!==b&&S.setAttribute(x,b)}const H_=["width","height"];function hp(S,x){const b=Object.getOwnPropertyDescriptors(S.__proto__);for(const k in x)x[k]==null?S.removeAttribute(k):k==="style"?S.style.cssText=x[k]:k==="__value"?S.value=S[k]=x[k]:b[k]&&b[k].set&&H_.indexOf(k)===-1?S[k]=x[k]:tt(S,k,x[k])}function vh(S,x,b){x in S?S[x]=typeof S[x]=="boolean"&&b===""?!0:b:tt(S,x,b)}function K_(S){return Array.from(S.childNodes)}function sn(S,x){x=""+x,S.data!==x&&(S.data=x)}function dp(S,x){S.value=x??""}function ys(S,x,b,k){b==null?S.style.removeProperty(x):S.style.setProperty(x,b,k?"important":"")}let Gc;function Y_(){if(Gc===void 0){Gc=!1;try{typeof window<"u"&&window.parent&&window.parent.document}catch{Gc=!0}}return Gc}function J_(S,x){getComputedStyle(S).position==="static"&&(S.style.position="relative");const k=mt("iframe");k.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),k.setAttribute("aria-hidden","true"),k.tabIndex=-1;const D=Y_();let ee;return D?(k.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",ee=Ui(window,"message",Z=>{Z.source===k.contentWindow&&x()})):(k.src="about:blank",k.onload=()=>{ee=Ui(k.contentWindow,"resize",x),x()}),nt(S,k),()=>{(D||ee&&k.contentWindow)&&ee(),ft(k)}}function _r(S,x,b){S.classList[b?"add":"remove"](x)}function Q_(S,x,{bubbles:b=!1,cancelable:k=!1}={}){const D=document.createEvent("CustomEvent");return D.initCustomEvent(S,b,k,x),D}class $_{constructor(x=!1){this.is_svg=!1,this.is_svg=x,this.e=this.n=null}c(x){this.h(x)}m(x,b,k=null){this.e||(this.is_svg?this.e=ul(b.nodeName):this.e=mt(b.nodeType===11?"TEMPLATE":b.nodeName),this.t=b.tagName!=="TEMPLATE"?b:b.content,this.c(x)),this.i(k)}h(x){this.e.innerHTML=x,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(x){for(let b=0;b<this.n.length;b+=1)yt(this.t,this.n[b],x)}p(x){this.d(),this.h(x),this.i(this.a)}d(){this.n.forEach(ft)}}function Ln(S,x){return new S(x)}let hl;function dl(S){hl=S}function bh(){if(!hl)throw new Error("Function called outside component initialization");return hl}function pp(S){bh().$$.before_update.push(S)}function Zc(S){bh().$$.on_mount.push(S)}function wh(){const S=bh();return(x,b,{cancelable:k=!1}={})=>{const D=S.$$.callbacks[x];if(D){const ee=Q_(x,b,{cancelable:k});
1return D.slice().forEach(Z=>{Z.call(S,ee)}),!ee.defaultPrevented}return!0}}const ca=[],xo=[];let ua=[];const Th=[],fp=Promise.resolve();let Eh=!1;function mp(){Eh||(Eh=!0,fp.then(_p))}function qc(){return mp(),fp}function Wc(S){ua.push(S)}function eg(S){Th.push(S)}const Sh=new Set;let ha=0;function _p(){if(ha!==0)return;const S=hl;do{try{for(;ha<ca.length;){const x=ca[ha];ha++,dl(x),tg(x.$$)}}catch(x){throw ca.length=0,ha=0,x}for(dl(null),ca.length=0,ha=0;xo.length;)xo.pop()();for(let x=0;x<ua.length;x+=1){const b=ua[x];Sh.has(b)||(Sh.add(b),b())}ua.length=0}while(ca.length);for(;Th.length;)Th.pop()();Eh=!1,Sh.clear(),dl(S)}function tg(S){if(S.fragment!==null){S.update(),Cr(S.before_update);const x=S.dirty;S.dirty=[-1],S.fragment&&S.fragment.p(S.ctx,x),S.after_update.forEach(Wc)}}function ig(S){const x=[],b=[];ua.forEach(k=>S.indexOf(k)===-1?x.push(k):b.push(k)),b.forEach(k=>k()),ua=x}const Xc=new Set;let xs;function vn(){xs={r:0,c:[],p:xs}}function bn(){xs.r||Cr(xs.c),xs=xs.p}function Gt(S,x){S&&S.i&&(Xc.delete(S),S.i(x))}function ti(S,x,b,k){if(S&&S.o){if(Xc.has(S))return;Xc.add(S),xs.c.push(()=>{Xc.delete(S),k&&(b&&S.d(1),k())}),S.o(x)}else k&&k()}function ng(S,x){ti(S,1,1,()=>{x.delete(S.key)})}function rg(S,x,b,k,D,ee,Z,o,U,he,De,se){let de=S.length,Ie=ee.length,Pe=de;const Me={};for(;Pe--;)Me[S[Pe].key]=Pe;const $e=[],At=new Map,bt=new Map,lt=[];for(Pe=Ie;Pe--;){const qt=se(D,ee,Pe),It=b(qt);let Re=Z.get(It);Re?k&&lt.push(()=>Re.p(qt,x)):(Re=he(It,qt),Re.c()),At.set(It,$e[Pe]=Re),It in Me&&bt.set(It,Math.abs(Pe-Me[It]))}const Se=new Set,Qe=new Set;function ni(qt){Gt(qt,1),qt.m(o,De),Z.set(qt.key,qt),De=qt.first,Ie--}for(;de&&Ie;){const qt=$e[Ie-1],It=S[de-1],Re=qt.key,gt=It.key;
1qt===It?(De=qt.first,de--,Ie--):At.has(gt)?!Z.has(Re)||Se.has(Re)?ni(qt):Qe.has(gt)?de--:bt.get(Re)>bt.get(gt)?(Qe.add(Re),ni(qt)):(Se.add(gt),de--):(U(It,Z),de--)}for(;de--;){const qt=S[de];At.has(qt.key)||U(qt,Z)}for(;Ie;)ni($e[Ie-1]);return Cr(lt),$e}function Ih(S,x){const b={},k={},D={$$scope:1};let ee=S.length;for(;ee--;){const Z=S[ee],o=x[ee];if(o){for(const U in Z)U in o||(k[U]=1);for(const U in o)D[U]||(b[U]=o[U],D[U]=1);S[ee]=o}else for(const U in Z)D[U]=1}for(const Z in k)Z in b||(b[Z]=void 0);return b}function gp(S){return typeof S=="object"&&S!==null?S:{}}function yp(S,x,b){const k=S.$$.props[x];k!==void 0&&(S.$$.bound[k]=b,b(S.$$.ctx[k]))}function wn(S){S&&S.c()}function pn(S,x,b,k){const{fragment:D,after_update:ee}=S.$$;D&&D.m(x,b),k||Wc(()=>{const Z=S.$$.on_mount.map(sp).filter(lp);S.$$.on_destroy?S.$$.on_destroy.push(...Z):Cr(Z),S.$$.on_mount=[]}),ee.forEach(Wc)}function fn(S,x){const b=S.$$;b.fragment!==null&&(ig(b.after_update),Cr(b.on_destroy),b.fragment&&b.fragment.d(x),b.on_destroy=b.fragment=null,b.ctx=[])}function og(S,x){S.$$.dirty[0]===-1&&(ca.push(S),mp(),S.$$.dirty.fill(0)),S.$$.dirty[x/31|0]|=1<<x%31}function vo(S,x,b,k,D,ee,Z,o=[-1]){const U=hl;dl(S);const he=S.$$={fragment:null,ctx:[],props:ee,update:on,not_equal:D,bound:ap(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(x.context||(U?U.$$.context:[])),callbacks:ap(),dirty:o,skip_bound:!1,root:x.target||U.$$.root};Z&&Z(he.root);let De=!1;if(he.ctx=b?b(S,x.props||{},(se,de,...Ie)=>{const Pe=Ie.length?Ie[0]:de;return he.ctx&&D(he.ctx[se],he.ctx[se]=Pe)&&(!he.skip_bound&&he.bound[se]&&he.bound[se](Pe),De&&og(S,se)),de}):[],he.update(),De=!0,Cr(he.before_update),he.fragment=k?k(he.ctx):!1,x.target){if(x.hydrate){const se=K_(x.target);he.fragment&&he.fragment.l(se),se.forEach(ft)}else he.fragment&&he.fragment.c();x.intro&&Gt(S.$$.fragment),pn(S,x.target,x.anchor,x.customElement),_p()}dl(U)}class bo{$destroy(){fn(this,1),this.$destroy=on}$on(x,b){if(!lp(b))return on;const k=this.$$.callbacks[x]||(this.$$.callbacks[x]=[]);return k.push(b),()=>{const D=k.indexOf(b);D!==-1&&k.splice(D,1)}}$set(x){this.$$set&&!j_(x)&&(this.$$.skip_bound=!0,this.$$set(x),this.$$.skip_bound=!1)}}var sg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ag(S){return S&&S.__esModule&&Object.prototype.hasOwnProperty.call(S,"default")?S.default:S}var xp={exports:{}};(function(S,x){(function(b,k){S.exports=k()})(sg,function(){var b,k,D;function ee(o,U){if(!b)b=U;else if(!k)k=U;else{var he="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+b+")(sharedChunk); ("+k+")(sharedChunk); self.onerror = null;",De={};b(De),D=U(De),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(D.workerUrl=window.URL.createObjectURL(new Blob([he],{type:"text/javascript"})))}}ee(["exports"],function(o){var U=typeof self<"u"?self:{},he="2.15.0";let De;const se={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(De==null){const t=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{De={}.API_URL_REGEX!=null?new RegExp({}.API_URL_REGEX):t}catch{De=t}}return De},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!se.API_URL)return null;try{const t=new URL(se.API_URL);return t.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":t.hostname==="api.mapbox.com"?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},de={supported:!1,testSupport:function(t){!Me&&Pe&&($e?At(t):Ie=t)}};let Ie,Pe,Me=!1,$e=!1;function At(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,Pe),t.isContextLost())return;de.supported=!0}
vendor: 3,652 bytes, line 1
1catch{}t.deleteTexture(e),Me=!0}U.document&&(Pe=U.document.createElement("img"),Pe.onload=function(){Ie&&At(Ie),Ie=null,$e=!0},Pe.onerror=function(){Me=!0,Ie=null},Pe.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const bt="01";function lt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Se=Qe;function Qe(t,e,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=r}Qe.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(e===void 0&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var a=this.sampleCurveX(i)-t;if(Math.abs(a)<e)return i;var c=this.sampleCurveDerivativeX(i);if(Math.abs(c)<1e-6)break;i-=a/c}var h=0,p=1;for(i=t,r=0;r<20&&(a=this.sampleCurveX(i),!(Math.abs(a-t)<e));r++)t>a?h=i:p=i,i=.5*(p-h)+h;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var ni=lt(Se),qt=It;function It(t,e){this.x=t,this.y=e}It.prototype={clone:function(){return new It(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),r=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=r,this},_rotateAround:function(t,e){var i=Math.cos(t),r=Math.sin(t),a=e.y+r*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-r*(this.y-e.y),this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},It.convert=function(t){return t instanceof It?t:Array.isArray(t)?new It(t[0],t[1]):t};var Re=lt(qt);const gt=Math.PI/180,ui=180/Math.PI;function at(t){return t*gt}function Ct(t){return t*ui}const Qt=[[0,0],[1,0],[1,1],[0,1]];function Ke(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}
1function Tt(t,e,i,r){const a=new ni(t,e,i,r);return function(c){return a.solve(c)}}const $i=Tt(.25,.1,.25,1);function St(t,e,i){return Math.min(i,Math.max(e,t))}function Lt(t,e,i){return(i=St((i-t)/(e-t),0,1))*i*(3-2*i)}function vt(t,e,i){const r=i-e,a=((t-e)%r+r)%r+e;return a===e?i:a}function ai(t,e,i){if(!t.length)return i(null,[]);let r=t.length;const a=new Array(t.length);let c=null;t.forEach((h,p)=>{e(h,(m,_)=>{m&&(c=m),a[p]=_,--r==0&&i(c,a)})})}function Mi(t){const e=[];for(const i in t)e.push(t[i]);return e}function $t(t,...e){for(const i of e)for(const r in i)t[r]=i[r];return t}let nn=1;function Gn(){return nn++}function Tn(){return function t(e){return e?(e^Math.random()*(16>>e/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function mn(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Je(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function Dt(t,e){t.forEach(i=>{e[i]&&(e[i]=e[i].bind(e))})}function en(t,e){return t.indexOf(e,t.length-e.length)!==-1}function Vt(t,e,i){const r={};for(const a in t)r[a]=e.call(i||this,t[a],a,t);return r}function gr(t,e,i){const r={};for(const a in t)e.call(i||this,t[a],a,t)&&(r[a]=t[a]);return r}function _n(t){return Array.isArray(t)?t.map(_n):typeof t=="object"&&t?Vt(t,_n):t}const yr={};function wi(t){yr[t]||(typeof console<"u"&&console.warn(t),yr[t]=!0)}function En(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function wo(t){let e=0;for(let i,r,a=0,c=t.length,h=c-1;a<c;h=a++)i=t[a],r=t[h],e+=(r.x-i.x)*(i.y+r.y);return e}function Hn(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Sn(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,r,a,c)=>{const h=a||c;return e[r]=!h||h.toLowerCase(),""}),e["max-age"]){const i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e}let io=null;function kr(t){if(io==null){const e=t.navigator?t.navigator.userAgent:null;io=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return io}function no(t){try{const e=U[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch{return!1}}function Kn(t,e){return[t[4*e],t[4*e+1],t[4*e+2],t[4*e+3]]}const Pr="mapbox-tiles";let ro=500,To=50,kn,or;function zr(){try{return U.caches}catch{}}function Lr(){zr()&&!kn&&(kn=U.caches.open(Pr))}function Dr(t){const e=t.indexOf("?");if(e<0)return t;const i=function(a){const c=a.indexOf("?");return c>0?a.slice(c+1).split("&"):[]}(t),r=i.filter(a=>{const c=a.split("=");return c[0]==="language"||c[0]==="worldview"});return r.length?`${t.slice(0,e)}?${r.join("&")}`:t.slice(0,e)}let Rr=1/0;const pi={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(pi);class Pn extends Error{constructor(e,i,r){i===401&&_e(r)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=i,this.url=r}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const sr=Hn()?()=>self.worker&&self.worker.referrer:()=>(U.location.protocol==="blob:"?U.parent:U).location.href,ar=function(t,e){if(!(/^file:/.test(i=t.url)||/^file:/.test(sr())&&!/^\w+:/.test(i))){if(U.fetch&&U.Request&&U.AbortController&&U.Request.prototype.hasOwnProperty("signal"))return function(r,a){const c=new U.AbortController,h=new U.Request(r.url,{method:r.method||"GET",body:r.body,credentials:r.credentials,headers:r.headers,referrer:sr(),referrerPolicy:r.referrerPolicy,signal:c.signal});let p=!1,m=!1;const _=(v=h.url).indexOf("sku=")>0&&_e(v);var v;r.type==="json"&&h.headers.set("Accept","application/json");const T=(A,C,L)=>{if(m)return;if(A&&A.message!=="SecurityError"&&wi(A.toString()),C&&L)return E(C);const F=Date.now();U.fetch(h).then(W=>{if(W.ok){const $=_?W.clone():null;return E(W,$,F)}return a(new Pn(W.statusText,W.status,r.url))}).catch(W=>{W.name!=="AbortError"&&a(new Error(`${W.message} ${r.url}`))})},E=(A,C,L)=>{(r.type==="arrayBuffer"?A.arrayBuffer():r.type==="json"?A.json():A.text()).then(F=>
1{m||(C&&L&&function(W,$,X){if(Lr(),!kn)return;const J={status:$.status,statusText:$.statusText,headers:new U.Headers};$.headers.forEach((be,ye)=>J.headers.set(ye,be));const ie=Sn($.headers.get("Cache-Control")||"");if(ie["no-store"])return;ie["max-age"]&&J.headers.set("Expires",new Date(X+1e3*ie["max-age"]).toUTCString());const te=J.headers.get("Expires");te&&(new Date(te).getTime()-X<42e4||function(be,ye){if(or===void 0)try{new Response(new ReadableStream),or=!0}catch{or=!1}or?ye(be.body):be.blob().then(ye)}($,be=>{const ye=new U.Response(be,J);Lr(),kn&&kn.then(ke=>ke.put(Dr(W.url),ye)).catch(ke=>wi(ke.message))}))}(h,C,L),p=!0,a(null,F,A.headers.get("Cache-Control"),A.headers.get("Expires")))}).catch(F=>{m||a(new Error(F.message))})};return _?function(A,C){if(Lr(),!kn)return C(null);const L=Dr(A.url);kn.then(F=>{F.match(L).then(W=>{const $=function(X){if(!X)return!1;const J=new Date(X.headers.get("Expires")||0),ie=Sn(X.headers.get("Cache-Control")||"");return J>Date.now()&&!ie["no-cache"]}(W);F.delete(L),$&&F.put(L,W.clone()),C(null,W,$)}).catch(C)}).catch(C)}(h,T):T(null,null),{cancel:()=>{m=!0,p||c.abort()}}}(t,e);if(Hn()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var i;return function(r,a){const c=new U.XMLHttpRequest;c.open(r.method||"GET",r.url,!0),r.type==="arrayBuffer"&&(c.responseType="arraybuffer");for(const h in r.headers)c.setRequestHeader(h,r.headers[h]);return r.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=r.credentials==="include",c.onerror=()=>{a(new Error(c.statusText))},c.onload=()=>{if((c.status>=200&&c.status<300||c.status===0)&&c.response!==null){let h=c.response;if(r.type==="json")try{h=JSON.parse(c.response)}catch(p){return a(p)}a(null,h,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else a(new Pn(c.statusText,c.status,r.url))},c.send(r.body),{cancel:()=>c.abort()}}(t,e)},xr=function(t,e){return ar($t(t,{type:"arrayBuffer"}),e)};function Br(t){const e=U.document.createElement("a");return e.href=t,e.protocol===U.document.location.protocol&&e.host===U.document.location.host}const Q="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let R,B;R=[],B=0;const Y=function(t,e){if(de.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),B>=se.MAX_PARALLEL_IMAGE_REQUESTS){const c={requestParameters:t,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return R.push(c),c}B++;let i=!1;const r=()=>{if(!i)for(i=!0,B--;R.length&&B<se.MAX_PARALLEL_IMAGE_REQUESTS;){const c=R.shift(),{requestParameters:h,callback:p,cancelled:m}=c;m||(c.cancel=Y(h,p).cancel)}},a=xr(t,(c,h,p,m)=>{r(),c?e(c):h&&(U.createImageBitmap?function(_,v){const T=new U.Blob([new Uint8Array(_)],{type:"image/png"});U.createImageBitmap(T).then(E=>{v(null,E)}).catch(E=>{v(new Error(`Could not load image because of ${E.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(h,(_,v)=>e(_,v,p,m)):function(_,v){const T=new U.Image,E=U.URL;T.onload=()=>{v(null,T),E.revokeObjectURL(T.src),T.onload=null,U.requestAnimationFrame(()=>{T.src=Q})},T.onerror=()=>v(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const A=new U.Blob([new Uint8Array(_)],{type:"image/png"});T.src=_.byteLength?E.createObjectURL(A):Q}(h,(_,v)=>e(_,v,p,m)))});return{cancel:()=>{a.cancel(),r()}}},ne="NO_ACCESS_TOKEN";function ue(t){return t.indexOf("mapbox:")===0}function _e(t){return se.API_URL_REGEX.test(t)}function me(t){return se.API_CDN_URL_REGEX.test(t)}function ce(t){return se.API_STYLE_REGEX.test(t)&&!we(t)}function we(t){return se.API_SPRITE_REGEX.test(t)}const We=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Ye(t){const e=t.match(We);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function Ze(t){const e=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${e}`}const zt="mapbox.eventData";function Nt(t){if(!t)return null;const e=t.split(".");if(!e||e.length!==3)return null;try{return JSON.parse(decodeURIComponent(U.atob(e[1]).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch{return null}}class kt{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const i=Nt(se.ACCESS_TOKEN);let r="";return r=i&&i.u?U.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(a,c)=>String.fromCharCode(+("0x"+c)))):se.ACCESS_TOKEN||"",e?`${zt}.${e}:${r}`:`${zt}:${r}`}fetchEventData(){const e=no("localStorage"),i=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{const a=U.localStorage.getItem(i);a&&(this.eventData=JSON.parse(a));const c=U.localStorage.getItem(r);c&&(this.anonId=c)}catch{wi("Unable to read from LocalStorage")}}saveEventData(){const e=no("localStorage"),i=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{U.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&U.localStorage.setItem(i,JSON.stringify(this.eventData))}catch{wi("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,i,r,a){if(!se.EVENTS_URL)return;const c=Ye(se.EVENTS_URL);c.params.push(`access_token=${a||se.ACCESS_TOKEN||""}`);const h={event:this.type,created:new Date(e).toISOString()},p=i?$t(h,i):h,m={url:Ze(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([p])};this.pendingRequest=function(_,v){return ar($t(_,{method:"POST"}),v)}(m,_=>{this.pendingRequest=null,r(_),this.saveEventData(),this.processRequests(a)})}queueRequest(e,i){this.queue.push(e),this.processRequests(i)}}const jt=new class extends kt{constructor(t){super("appUserTurnstile"),this._customAccessToken=t}postTurnstileEvent(t,e){se.EVENTS_URL&&se.ACCESS_TOKEN&&Array.isArray(t)&&t.some(i=>ue(i)||_e(i))&&this.queueRequest(Date.now(),e)}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const e=Nt(se.ACCESS_TOKEN),i=e?e.u:se.ACCESS_TOKEN;let r=i!==this.eventData.tokenU;Je(this.anonId)||(this.anonId=Tn(),r=!0);const a=this.queue.shift();if(this.eventData.lastSuccess){const c=new Date(this.eventData.lastSuccess),h=new Date(a),p=(a-this.eventData.lastSuccess)/864e5;r=r||p>=1||p<-1||c.getDate()!==h.getDate()}else r=!0;r?this.postEvent(a,{sdkIdentifier:"mapbox-gl-js",sdkVersion:he,skuId:bt,"enabled.telemetry":!1,userId:this.anonId},c=>{c||(this.eventData.lastSuccess=a,this.eventData.tokenU=i)},t):this.processRequests()}},Yt=jt.postTurnstileEvent.bind(jt),ki=new class extends kt{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(t,e,i,r){this.skuToken=e,this.errorCb=r,se.EVENTS_URL&&(i||se.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(ne)))}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||(this.anonId||this.fetchEventData(),Je(this.anonId)||(this.anonId=Tn()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:he,skuId:bt,skuToken:this.skuToken,userId:this.anonId},r=>{r?this.errorCb(r):e&&(this.success[e]=!0)},t))}},Bi=ki.postMapLoadEvent.bind(ki),an=new class extends kt{constructor(){super("gljs.performance")}postPerformanceEvent(t,e){se.EVENTS_URL&&(t||se.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:e},t)}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:e,performanceData:i}=this.queue.shift(),r=function(a){const c=U.performance.getEntriesByType("resource"),h=U.performance.getEntriesByType("mark"),p=function(E){const A={};if(E){for(const C in E)if(C!=="other")for(const L of E[C]){const F=`${C}ResolveRangeMin`,W=`${C}ResolveRangeMax`,$=`${C}RequestCount`,X=`${C}RequestCachedCount`;A[F]=Math.min(A[F]||1/0,L.startTime),A[W]=Math.max(A[W]||-1/0,L.responseEnd);const J=ie=>{A[ie]===void 0&&(A[ie]=0),++A[ie]};L.transferSize!==void 0&&L.transferSize===0&&J(X),J($)}}return A}(function(E,A){const C={};if(E)for(const L of E){const F=A(L);C[F]===void 0&&(C[F]=[]),C[F].push(L)}return C}(c,pa)),m=U.devicePixelRatio,_=U.navigator.connection||U.navigator.mozConnection||U.navigator.webkitConnection,v={counters:[],metadata:[],attributes:[]},T=(E,A,C)=>{C!=null&&E.push({name:A,value:C.toString()})};for(const E in p)T(v.counters,E,p[E]);if(a.interactionRange[0]!==1/0&&a.interactionRange[1]!==-1/0&&(T(v.counters,"interactionRangeMin",a.interactionRange[0]),T(v.counters,"interactionRangeMax",a.interactionRange[1])),h)for(const E of Object.keys(oo)){const A=oo[E],C=h.find(L=>L.name===A);C&&T(v.counters,A,C.startTime)}return T(v.counters,"visibilityHidden",a.visibilityHidden),T(v.attributes,"style",function(E){if(E)for(const A of E){const C=A.name.split("?")[0];if(ce(C)){const L=C.split("/").slice(-2);if(L.length===2)return`mapbox://styles/${L[0]}/${L[1]}`}}}(c)),T(v.attributes,"terrainEnabled",a.terrainEnabled?"true":"false"),T(v.attributes,"fogEnabled",a.fogEnabled?"true":"false"),T(v.attributes,"projection",a.projection),T(v.attributes,"zoom",a.zoom),T(v.metadata,"devicePixelRatio",m),T(v.metadata,"connectionEffectiveType",_?_.effectiveType:void 0),T(v.metadata,"navigatorUserAgent",U.navigator.userAgent),T(v.metadata,"screenWidth",U.screen.width),T(v.metadata,"screenHeight",U.screen.height),T(v.metadata,"windowWidth",U.innerWidth),T(v.metadata,"windowHeight",U.innerHeight),T(v.metadata,"mapWidth",a.width/m),T(v.metadata,"mapHeight",a.height/m),T(v.metadata,"webglRenderer",a.renderer),T(v.metadata,"webglVendor",a.vendor),T(v.metadata,"sdkVersion",he),T(v.metadata,"sdkIdentifier","mapbox-gl-js"),v}(i);for(const a of r.metadata);for(const a of r.counters);for(const a of r.attributes);this.postEvent(e,r,()=>{},t)}},Vi=an.postPerformanceEvent.bind(an),Dn=new class extends kt{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(t,e,i,r){if(!se.API_URL||!se.SESSION_PATH)return;const a=Ye(se.API_URL+se.SESSION_PATH);a.params.push(`sku=${e||""}`),a.params.push(`access_token=${r||se.ACCESS_TOKEN||""}`);const c={url:Ze(a),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(h,p){return ar($t(h,{method:"GET"}),p)}(c,h=>{this.pendingRequest=null,i(h),this.saveEventData(),this.processRequests(r)})}getSessionAPI(t,e,i,r){this.skuToken=e,this.errorCb=r,se.SESSION_PATH&&se.API_URL&&(i||se.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(ne)))}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{id:e,timestamp:i}=this.queue.shift();
1e&&this.success[e]||this.getSession(i,this.skuToken,r=>{r?this.errorCb(r):e&&(this.success[e]=!0)},t)}},Ni=Dn.getSessionAPI.bind(Dn),rn=new Set,oo={create:"create",load:"load",fullLoad:"fullLoad"},fl={mark(t){U.performance.mark(t)},measure(t,e,i){U.performance.measure(t,e,i)}};function pa(t){const e=t.name.split("?")[0];return me(e)&&e.includes("mapbox-gl.js")?"javascript":me(e)&&e.includes("mapbox-gl.css")?"css":function(i){return se.API_FONTS_REGEX.test(i)}(e)?"fontRange":we(e)?"sprite":ce(e)?"style":function(i){return se.API_TILEJSON_REGEX.test(i)}(e)?"tilejson":"other"}const ri=U.performance;function bs(t){const e=t?t.url.toString():void 0;return ri.getEntriesByName(e)}let Eo,ae,Mt,ei;const ji={now:()=>Mt!==void 0?Mt:U.performance.now(),setNow(t){Mt=t},restoreNow(){Mt=void 0},frame(t){const e=U.requestAnimationFrame(t);return{cancel:()=>U.cancelAnimationFrame(e)}},getImageData(t,e=0){const{width:i,height:r}=t;ei||(ei=U.document.createElement("canvas"));const a=ei.getContext("2d",{willReadFrequently:!0});if(!a)throw new Error("failed to create canvas 2d context");return(i>ei.width||r>ei.height)&&(ei.width=i,ei.height=r),a.clearRect(-e,-e,i+2*e,r+2*e),a.drawImage(t,0,0,i,r),a.getImageData(-e,-e,i+2*e,r+2*e)},resolveURL:t=>(Eo||(Eo=U.document.createElement("a")),Eo.href=t,Eo.href),get devicePixelRatio(){return U.devicePixelRatio},get prefersReducedMotion(){return!!U.matchMedia&&(ae==null&&(ae=U.matchMedia("(prefers-reduced-motion: reduce)")),ae.matches)}};function lr(t,e,i){i[t]&&i[t].indexOf(e)!==-1||(i[t]=i[t]||[],i[t].push(e))}function Zn(t,e,i){if(i&&i[t]){const r=i[t].indexOf(e);r!==-1&&i[t].splice(r,1)}}class So{constructor(e,i={}){$t(this,i),this.type=e}}class Or extends So{constructor(e,i={}){super("error",$t({error:e},i))}}class ws{on(e,i){return this._listeners=this._listeners||{},lr(e,i,this._listeners),this}off(e,i){return Zn(e,i,this._listeners),Zn(e,i,this._oneTimeListeners),this}once(e,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},lr(e,i,this._oneTimeListeners),this):new Promise(r=>this.once(e,r))}fire(e,i){typeof e=="string"&&(e=new So(e,i||{}));const r=e.type;if(this.listens(r)){e.target=this;const a=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const p of a)p.call(this,e);const c=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const p of c)Zn(r,p,this._oneTimeListeners),p.call(this,e);const h=this._eventedParent;h&&($t(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),h.fire(e))}else e instanceof Or&&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,i){return this._eventedParent=e,this._eventedParentData=i,this}}var Ce=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"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"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"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":true,"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":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"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":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":{},"mapbox":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0}
1,"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"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_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"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"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1
vendor: 16,128 bytes, line 1
1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"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":true,"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"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":true,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["text-field",{"!":"text-variable-anchor"}],"expression":{"interpolated":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"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":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"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_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"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":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":
vendor: 17,203 bytes, line 1
1false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"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"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function Fr(t,...e){for(const i of e)for(const r in i)t[r]=i[r];return t}function qi(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function ln(t){if(Array.isArray(t))return t.map(ln);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=ln(t[i]);return e}return qi(t)}
1class Yc extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}var vr=Yc;class ml{constructor(e,i=[]){this.parent=e,this.bindings={};for(const[r,a]of i)this.bindings[r]=a}concat(e){return new ml(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}var Jc=ml;const Go={kind:"null"},ot={kind:"number"},Jt={kind:"string"},Wt={kind:"boolean"},qn={kind:"color"},cr={kind:"object"},Xt={kind:"value"},Wn={kind:"collator"},Ts={kind:"formatted"},Io={kind:"resolvedImage"};function Yn(t,e){return{kind:"array",itemType:t,N:e}}function zi(t){if(t.kind==="array"){const e=zi(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}return t.kind}const Qc=[Go,ot,Jt,Wt,qn,Ts,cr,Yn(Xt),Io];function Ur(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Ur(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(const i of Qc)if(!Ur(i,e))return null}}return`Expected ${zi(t)} but found ${zi(e)} instead.`}function Es(t,e){return e.some(i=>i.kind===t.kind)}function Ss(t,e){return e.some(i=>i==="null"?t===null:i==="array"?Array.isArray(t):i==="object"?t&&!Array.isArray(t)&&typeof t=="object":i===typeof t)}var _l,$c={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Is(t){return(t=Math.round(t))<0?0:t>255?255:t}function Ms(t){return Is(t[t.length-1]==="%"?parseFloat(t)/100*255:parseInt(t))}function fa(t){return(e=t[t.length-1]==="%"?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function Zo(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(.6666666666666666-i)*6:t}try{_l={}.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in $c)return $c[i].slice();if(i[0]==="#")return i.length===4?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:i.length===7&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var r=i.indexOf("("),a=i.indexOf(")");if(r!==-1&&a+1===i.length){var c=i.substr(0,r),h=i.substr(r+1,a-(r+1)).split(","),p=1;switch(c){case"rgba":if(h.length!==4)return null;p=fa(h.pop());case"rgb":return h.length!==3?null:[Ms(h[0]),Ms(h[1]),Ms(h[2]),p];case"hsla":if(h.length!==4)return null;p=fa(h.pop());case"hsl":if(h.length!==3)return null;var m=(parseFloat(h[0])%360+360)%360/360,_=fa(h[1]),v=fa(h[2]),T=v<=.5?v*(_+1):v+_-v*_,E=2*v-T;return[Is(255*Zo(E,T,m+.3333333333333333)),Is(255*Zo(E,T,m)),Is(255*Zo(E,T,m-.3333333333333333)),p];default:return null}}return null}}catch{}class Rn{constructor(e,i,r,a=1){this.r=e,this.g=i,this.b=r,this.a=a}static parse(e){if(!e)return;if(e instanceof Rn)return e;if(typeof e!="string")return;const i=_l(e);return i?new Rn(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toString(){const[e,i,r,a]=this.toArray();return`rgba(${Math.round(e)},${Math.round(i)},${Math.round(r)},${a})`}toArray(){const{r:e,g:i,b:r,a}=this;return a===0?[0,0,0,0]:[255*e/a,255*i/a,255*r/a,a]}toArray01(){const{r:e,g:i,b:r,a}=this;return a===0?[0,0,0,0]:[e/a,i/a,r/a,a]}toArray01PremultipliedAlpha(){const{r:e,g:i,b:r,a}=this;return[e,i,r,a]}}Rn.black=new Rn(0,0,0,1),Rn.white=new Rn(1,1,1,1),Rn.transparent=new Rn(0,0,0,0),Rn.red=new Rn(1,0,0,1),Rn.blue=new Rn(0,0,1,1);var Gi=Rn;class gl{constructor(e,i,r){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class yl{constructor(e,i,r,a,c){this.text=e.normalize?e.normalize():e,this.image=i,this.scale=r,this.fontStack=a,this.textColor=c}}class Bn{constructor(e){this.sections=e}static fromString(e){return new Bn([new yl(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 Bn?e:Bn.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const i of this.sections){if(i.image){e.push(["image",i.image.name]);continue}e.push(i.text);const r={};i.fontStack&&(r["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(r["font-scale"]=i.scale),i.textColor&&(r["text-color"]=["rgba"].concat(i.textColor.toArray())),e.push(r)}return e}}class Jn{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Jn({name:e,available:!1}):null}serialize(){return["image",this.name]}}function eu(t,e,i,r){return typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof i=="number"&&i>=0&&i<=255?r===void 0||typeof r=="number"&&r>=0&&r<=1?null:`Invalid rgba value [${[t,e,i,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof r=="number"?[t,e,i,r]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function As(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof Gi||t instanceof gl||t instanceof Bn||t instanceof Jn)return!0;
1if(Array.isArray(t)){for(const e of t)if(!As(e))return!1;return!0}if(typeof t=="object"){for(const e in t)if(!As(t[e]))return!1;return!0}return!1}function Oi(t){if(t===null)return Go;if(typeof t=="string")return Jt;if(typeof t=="boolean")return Wt;if(typeof t=="number")return ot;if(t instanceof Gi)return qn;if(t instanceof gl)return Wn;if(t instanceof Bn)return Ts;if(t instanceof Jn)return Io;if(Array.isArray(t)){const e=t.length;let i;for(const r of t){const a=Oi(r);if(i){if(i===a)continue;i=Xt;break}i=a}return Yn(i||Xt,e)}return cr}function Cs(t){const e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof Gi||t instanceof Bn||t instanceof Jn?t.toString():JSON.stringify(t)}class xl{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(e.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!As(e[1]))return i.error("invalid value");const r=e[1];let a=Oi(r);const c=i.expectedType;return a.kind!=="array"||a.N!==0||!c||c.kind!=="array"||typeof c.N=="number"&&c.N!==0||(a=c),new xl(a,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Gi?["rgba"].concat(this.value.toArray()):this.value instanceof Bn?this.value.serialize():this.value}}var Mo=xl,gn=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const vl={string:Jt,number:ot,boolean:Wt,object:cr};class bl{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let r,a=1;const c=e[0];if(c==="array"){let p,m;if(e.length>2){const _=e[1];if(typeof _!="string"||!(_ in vl)||_==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);p=vl[_],a++}else p=Xt;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);m=e[2],a++}r=Yn(p,m)}else r=vl[c];const h=[];for(;a<e.length;a++){const p=i.parse(e[a],a,Xt);if(!p)return null;h.push(p)}return new bl(r,h)}evaluate(e){for(let i=0;i<this.args.length;i++){const r=this.args[i].evaluate(e);if(!Ur(this.type,Oi(r)))return r;if(i===this.args.length-1)throw new gn(`Expected value to be of type ${zi(this.type)}, but found ${zi(Oi(r))} instead.`)}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=this.type,i=[e.kind];if(e.kind==="array"){const r=e.itemType;if(r.kind==="string"||r.kind==="number"||r.kind==="boolean"){i.push(r.kind);const a=e.N;(typeof a=="number"||this.args.length>1)&&i.push(a)}}return i.concat(this.args.map(r=>r.serialize()))}}var Vr=bl;class so{constructor(e){this.type=Ts,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&typeof r=="object")return i.error("First argument must be an image or text section.");const a=[];let c=!1;for(let h=1;h<=e.length-1;++h){const p=e[h];if(c&&typeof p=="object"&&!Array.isArray(p)){c=!1;let m=null;if(p["font-scale"]&&(m=i.parse(p["font-scale"],1,ot),!m))return null;let _=null;if(p["text-font"]&&(_=i.parse(p["text-font"],1,Yn(Jt)),!_))return null;let v=null;if(p["text-color"]&&(v=i.parse(p["text-color"],1,qn),!v))return null;const T=a[a.length-1];T.scale=m,T.font=_,T.textColor=v}else{const m=i.parse(e[h],1,Xt);if(!m)return null;const _=m.type.kind;if(_!=="string"&&_!=="value"&&_!=="null"&&_!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");c=!0,a.push({content:m,scale:null,font:null,textColor:null})}}return new so(a)}evaluate(e){return new Bn(this.sections.map(i=>{const r=i.content.evaluate(e);return Oi(r)===Io?new yl("",r,null,null,null):new yl(Cs(r),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null)}))}eachChild(e){for(const i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const i of this.sections){e.push(i.content.serialize());const r={};i.scale&&(r["font-scale"]=i.scale.serialize()),i.font&&(r["text-font"]=i.font.serialize()),i.textColor&&(r["text-color"]=i.textColor.serialize()),e.push(r)}return e}}class ma{constructor(e){this.type=Io,this.input=e}static parse(e,i){if(e.length!==2)return i.error("Expected two arguments.");const r=i.parse(e[1],1,Jt);return r?new ma(r):i.error("No image name provided.")}evaluate(e){const i=this.input.evaluate(e),r=Jn.fromString(i);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(i)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Ah={"to-boolean":Wt,"to-color":qn,"to-number":ot,"to-string":Jt};class wl{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const r=e[0];if((r==="to-boolean"||r==="to-string")&&e.length!==2)return i.error("Expected one argument.");const a=Ah[r],c=[];for(let h=1;h<e.length;h++){const p=i.parse(e[h],h,Xt);if(!p)return null;c.push(p)}return new wl(a,c)}
vendor: 6,444 bytes, line 1
1evaluate(e){if(this.type.kind==="boolean")return!!this.args[0].evaluate(e);if(this.type.kind==="color"){let i,r;for(const a of this.args){if(i=a.evaluate(e),r=null,i instanceof Gi)return i;if(typeof i=="string"){const c=e.parseColor(i);if(c)return c}else if(Array.isArray(i)&&(r=i.length<3||i.length>4?`Invalid rbga value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:eu(i[0],i[1],i[2],i[3]),!r))return new Gi(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new gn(r||`Could not parse color from value '${typeof i=="string"?i:String(JSON.stringify(i))}'`)}if(this.type.kind==="number"){let i=null;for(const r of this.args){if(i=r.evaluate(e),i===null)return 0;const a=Number(i);if(!isNaN(a))return a}throw new gn(`Could not convert ${JSON.stringify(i)} to number.`)}return this.type.kind==="formatted"?Bn.fromString(Cs(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Jn.fromString(Cs(this.args[0].evaluate(e))):Cs(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if(this.type.kind==="formatted")return new so([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new ma(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild(i=>{e.push(i.serialize())}),e}}var qo=wl;const br=["Unknown","Point","LineString","Polygon"];var Tl=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?br[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||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:r}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*e-t[0])+this.featureDistanceData.bearing[1]*(r*e-t[1])}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Gi.parse(t)),e}};class Ao{constructor(e,i,r,a){this.name=e,this.type=i,this._evaluate=r,this.args=a}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,i){const r=e[0],a=Ao.definitions[r];if(!a)return i.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const c=Array.isArray(a)?a[0]:a.type,h=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,p=h.filter(([_])=>!Array.isArray(_)||_.length===e.length-1);let m=null;for(const[_,v]of p){m=new Cl(i.registry,i.path,null,i.scope);const T=[];let E=!1;for(let A=1;A<e.length;A++){const C=e[A],L=Array.isArray(_)?_[A-1]:_.type,F=m.parse(C,1+T.length,L);if(!F){E=!0;break}T.push(F)}if(!E)if(Array.isArray(_)&&_.length!==T.length)m.error(`Expected ${_.length} arguments, but found ${T.length} instead.`);else{for(let A=0;A<T.length;A++){const C=Array.isArray(_)?_[A]:_.type,L=T[A];m.concat(A+1).checkSubtype(C,L.type)}if(m.errors.length===0)return new Ao(r,c,v,T)}}if(p.length===1)i.errors.push(...m.errors);else{const _=(p.length?p:h).map(([T])=>{return E=T,Array.isArray(E)?`(${E.map(zi).join(", ")})`:`(${zi(E.type)}...)`;var E}).join(" | "),v=[];for(let T=1;T<e.length;T++){const E=i.parse(e[T],1+v.length);if(!E)return null;v.push(zi(E.type))}i.error(`Expected arguments of type ${_}, but found (${v.join(", ")}) instead.`)}return null}static register(e,i){Ao.definitions=i;for(const r in i)e[r]=Ao}}var Nr=Ao;class ks{constructor(e,i,r){this.type=Wn,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=i}static parse(e,i){if(e.length!==2)return i.error("Expected one argument.");const r=e[1];if(typeof r!="object"||Array.isArray(r))return i.error("Collator options argument must be an object.");const a=i.parse(r["case-sensitive"]!==void 0&&r["case-sensitive"],1,Wt);if(!a)return null;const c=i.parse(r["diacritic-sensitive"]!==void 0&&r["diacritic-sensitive"],1,Wt);if(!c)return null;let h=null;return r.locale&&(h=i.parse(r.locale,1,Jt),!h)?null:new ks(a,c,h)}evaluate(e){return new gl(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}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}const jr=8192;function _a(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Wo(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Ps(t,e){const i=(180+t[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,a=Math.pow(2,e.z);return[Math.round(i*a*jr),Math.round(r*a*jr)]}function tu(t,e,i){const r=t[0]-e[0],a=t[1]-e[1],c=t[0]-i[0],h=t[1]-i[1];return r*h-c*a==0&&r*c<=0&&a*h<=0}function ga(t,e){let i=!1;for(let h=0,p=e.length;h<p;h++){const m=e[h];for(let _=0,v=m.length;_<v-1;_++){if(tu(t,m[_],m[_+1]))return!1;(a=m[_])[1]>(r=t)[1]!=(c=m[_+1])[1]>r[1]&&r[0]<(c[0]-a[0])*(r[1]-a[1])/(c[1]-a[1])+a[0]&&(i=!i)}}var r,a,c;return i}function El(t,e){for(let i=0;i<e.length;i++)if(ga(t,e[i]))return!0;return!1}function Sl(t,e,i,r){const a=r[0]-i[0],c=r[1]-i[1],h=(t[0]-i[0])*c-a*(t[1]-i[1]),p=(e[0]-i[0])*c-a*(e[1]-i[1]);return h>0&&p<0||h<0&&p>0}function Xo(t,e,i){for(const _ of i)for(let v=0;v<_.length-1;++v)if((p=[(h=_[v+1])[0]-(c=_[v])[0],h[1]-c[1]])[0]*(m=[(a=e)[0]-(r=t)[0],a[1]-r[1]])[1]-p[1]*m[0]!=0&&Sl(r,a,c,h)&&Sl(c,h,r,a))return!0;var r,a,c,h,p,m;return!1}function hi(t,e){for(let i=0;i<t.length;++i)if(!ga(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(Xo(t[i],t[i+1],e))return!1;return!0}function Ch(t,e){for(let i=0;i<e.length;i++)if(hi(t,e[i]))return!0;return!1}function Il(t,e,i){const r=[];for(let a=0;a<t.length;a++){const c=[];for(let h=0;h<t[a].length;
vendor: 6,939 bytes, line 1
1h++){const p=Ps(t[a][h],i);_a(e,p),c.push(p)}r.push(c)}return r}function iu(t,e,i){const r=[];for(let a=0;a<t.length;a++){const c=Il(t[a],e,i);r.push(c)}return r}function Ml(t,e,i,r){if(t[0]<i[0]||t[0]>i[2]){const a=.5*r;let c=t[0]-i[0]>a?-r:i[0]-t[0]>a?r:0;c===0&&(c=t[0]-i[2]>a?-r:i[2]-t[0]>a?r:0),t[0]+=c}_a(e,t)}function nu(t,e,i,r){const a=Math.pow(2,r.z)*jr,c=[r.x*jr,r.y*jr],h=[];if(!t)return h;for(const p of t)for(const m of p){const _=[m.x+c[0],m.y+c[1]];Ml(_,e,i,a),h.push(_)}return h}function Al(t,e,i,r){const a=Math.pow(2,r.z)*jr,c=[r.x*jr,r.y*jr],h=[];if(!t)return h;for(const m of t){const _=[];for(const v of m){const T=[v.x+c[0],v.y+c[1]];_a(e,T),_.push(T)}h.push(_)}if(e[2]-e[0]<=a/2){(p=e)[0]=p[1]=1/0,p[2]=p[3]=-1/0;for(const m of h)for(const _ of m)Ml(_,e,i,a)}var p;return h}class Ho{constructor(e,i){this.type=Wt,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(As(e[1])){const r=e[1];if(r.type==="FeatureCollection")for(let a=0;a<r.features.length;++a){const c=r.features[a].geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new Ho(r,r.features[a].geometry)}else if(r.type==="Feature"){const a=r.geometry.type;if(a==="Polygon"||a==="MultiPolygon")return new Ho(r,r.geometry)}else if(r.type==="Polygon"||r.type==="MultiPolygon")return new Ho(r,r)}return i.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(i,r){const a=[1/0,1/0,-1/0,-1/0],c=[1/0,1/0,-1/0,-1/0],h=i.canonicalID();if(!h)return!1;if(r.type==="Polygon"){const p=Il(r.coordinates,c,h),m=nu(i.geometry(),a,c,h);if(!Wo(a,c))return!1;for(const _ of m)if(!ga(_,p))return!1}if(r.type==="MultiPolygon"){const p=iu(r.coordinates,c,h),m=nu(i.geometry(),a,c,h);if(!Wo(a,c))return!1;for(const _ of m)if(!El(_,p))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(i,r){const a=[1/0,1/0,-1/0,-1/0],c=[1/0,1/0,-1/0,-1/0],h=i.canonicalID();if(!h)return!1;if(r.type==="Polygon"){const p=Il(r.coordinates,c,h),m=Al(i.geometry(),a,c,h);if(!Wo(a,c))return!1;for(const _ of m)if(!hi(_,p))return!1}if(r.type==="MultiPolygon"){const p=iu(r.coordinates,c,h),m=Al(i.geometry(),a,c,h);if(!Wo(a,c))return!1;for(const _ of m)if(!Ch(_,p))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var ya=Ho;function Ko(t){if(t instanceof Nr&&(t.name==="get"&&t.args.length===1||t.name==="feature-state"||t.name==="has"&&t.args.length===1||t.name==="properties"||t.name==="geometry-type"||t.name==="id"||/^filter-/.test(t.name))||t instanceof ya)return!1;let e=!0;return t.eachChild(i=>{e&&!Ko(i)&&(e=!1)}),e}function Gr(t){if(t instanceof Nr&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(i=>{e&&!Gr(i)&&(e=!1)}),e}function Co(t,e){if(t instanceof Nr&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild(r=>{i&&!Co(r,e)&&(i=!1)}),i}class xa{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(e.length!==2||typeof e[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const r=e[1];return i.scope.has(r)?new xa(r,i.scope.get(r)):i.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var ru=xa;class zs{constructor(e,i=[],r,a=new Jc,c=[]){this.registry=e,this.path=i,this.key=i.map(h=>`[${h}]`).join(""),this.scope=a,this.errors=c,this.expectedType=r}parse(e,i,r,a,c={}){return i?this.concat(i,r,a)._parse(e,c):this._parse(e,c)}_parse(e,i){function r(a,c,h){return h==="assert"?new Vr(c,[a]):h==="coerce"?new qo(c,[a]):a}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 a=e[0];if(typeof a!="string")return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const c=this.registry[a];if(c){let h=c.parse(e,this);if(!h)return null;if(this.expectedType){const p=this.expectedType,m=h.type;if(p.kind!=="string"&&p.kind!=="number"&&p.kind!=="boolean"&&p.kind!=="object"&&p.kind!=="array"||m.kind!=="value")if(p.kind!=="color"&&p.kind!=="formatted"&&p.kind!=="resolvedImage"||m.kind!=="value"&&m.kind!=="string"){if(this.checkSubtype(p,m))return null}else h=r(h,p,i.typeAnnotation||"coerce");else h=r(h,p,i.typeAnnotation||"assert")}if(!(h instanceof Mo)&&h.type.kind!=="resolvedImage"&&kl(h)){const p=new Tl;try{h=new Mo(h.type,h.evaluate(p))}catch(m){return this.error(m.message),null}}return h}return this.error(`Unknown expression "${a}". 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,i,r){const a=typeof e=="number"?this.path.concat(e):this.path,c=r?this.scope.concat(r):this.scope;return new zs(this.registry,a,i||null,c,this.errors)}error(e,...i){const r=`${this.key}${i.map(a=>`[${a}]`).join("")}`;this.errors.push(new vr(r,e))}checkSubtype(e,i){const r=Ur(e,i);return r&&this.error(r),r}}var Cl=zs;function kl(t){if(t instanceof ru)return kl(t.boundExpression);if(t instanceof Nr&&t.name==="error"||t instanceof ks||t instanceof ya)return!1;const e=t instanceof qo||t instanceof Vr;let i=!0;return t.eachChild(r=>{i=e?i&&kl(r):i&&r instanceof Mo}),!!i&&Ko(t)&&Co(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function va(t,e){const i=t.length-1;let r,a,c=0,h=i,p=0;for(;c<=h;)if(p=Math.floor((c+h)/2),r=t[p],a=t[p+1],r<=e){if(p===i||e<a)return p;c=p+1}else{if(!(r>e))throw new gn("Input is not a number.");h=p-1}return 0}class ba{constructor(e,i,r){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(const[a,c]of r)this.labels.push(a),this.outputs.push(c)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");const r=i.parse(e[1],1,ot);if(!r)return null;const a=[];let c=null;i.expectedType&&i.expectedType.kind!=="value"&&(c=i.expectedType);for(let h=1;h<e.length;h+=2){const p=h===1?-1/0:e[h],m=e[h+1],_=h,v=h+1;if(typeof p!="number")return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not c
1omputed expressions) for the input values.',_);if(a.length&&a[a.length-1][0]>=p)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',_);const T=i.parse(m,v,c);if(!T)return null;c=c||T.type,a.push([p,T])}return new ba(c,r,a)}evaluate(e){const i=this.labels,r=this.outputs;if(i.length===1)return r[0].evaluate(e);const a=this.input.evaluate(e);if(a<=i[0])return r[0].evaluate(e);const c=i.length;return a>=i[c-1]?r[c-1].evaluate(e):r[va(i,a)].evaluate(e)}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let i=0;i<this.labels.length;i++)i>0&&e.push(this.labels[i]),e.push(this.outputs[i].serialize());return e}}var Pl=ba;function ii(t,e,i){return t*(1-i)+e*i}var Ls=Object.freeze({__proto__:null,array:function(t,e,i){return t.map((r,a)=>ii(r,e[a],i))},color:function(t,e,i){return new Gi(ii(t.r,e.r,i),ii(t.g,e.g,i),ii(t.b,e.b,i),ii(t.a,e.a,i))},number:ii});const ou=.95047,zl=1.08883,su=4/29,ko=6/29,Ll=3*ko*ko,kh=ko*ko*ko,Ph=Math.PI/180,zh=180/Math.PI;function Dl(t){return t>kh?Math.pow(t,.3333333333333333):t/Ll+su}function Rl(t){return t>ko?t*t*t:Ll*(t-su)}
1function Bl(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,.4166666666666667)-.055)}function wa(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function au(t){const e=wa(t.r),i=wa(t.g),r=wa(t.b),a=Dl((.4124564*e+.3575761*i+.1804375*r)/ou),c=Dl((.2126729*e+.7151522*i+.072175*r)/1);return{l:116*c-16,a:500*(a-c),b:200*(c-Dl((.0193339*e+.119192*i+.9503041*r)/zl)),alpha:t.a}}function lu(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,r=isNaN(t.b)?e:e-t.b/200;return e=1*Rl(e),i=ou*Rl(i),r=zl*Rl(r),new Gi(Bl(3.2404542*i-1.5371385*e-.4985314*r),Bl(-.969266*i+1.8760108*e+.041556*r),Bl(.0556434*i-.2040259*e+1.0572252*r),t.alpha)}function Lh(t,e,i){const r=e-t;return t+i*(r>180||r<-180?r-360*Math.round(r/360):r)}const Ds={forward:au,reverse:lu,interpolate:function(t,e,i){return{l:ii(t.l,e.l,i),a:ii(t.a,e.a,i),b:ii(t.b,e.b,i),alpha:ii(t.alpha,e.alpha,i)}}},Yo={forward:function(t){const{l:e,a:i,b:r}=au(t),a=Math.atan2(r,i)*zh;return{h:a<0?a+360:a,c:Math.sqrt(i*i+r*r),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Ph,i=t.c;return lu({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:Lh(t.h,e.h,i),c:ii(t.c,e.c,i),l:ii(t.l,e.l,i),alpha:ii(t.alpha,e.alpha,i)}}};var Ol=Object.freeze({__proto__:null,hcl:Yo,lab:Ds});class Rs{constructor(e,i,r,a,c){this.type=e,this.operator=i,this.interpolation=r,this.input=a,this.labels=[],this.outputs=[];for(const[h,p]of c)this.labels.push(h),this.outputs.push(p)}static interpolationFactor(e,i,r,a){let c=0;if(e.name==="exponential")c=Fl(i,e.base,r,a);else if(e.name==="linear")c=Fl(i,1,r,a);else if(e.name==="cubic-bezier"){const h=e.controlPoints;c=new ni(h[0],h[1],h[2],h[3]).solve(Fl(i,1,r,a))}return c}static parse(e,i){let[r,a,c,...h]=e;if(!Array.isArray(a)||a.length===0)return i.error("Expected an interpolation type expression.",1);if(a[0]==="linear")a={name:"linear"};else if(a[0]==="exponential"){const _=a[1];if(typeof _!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:_}}else{if(a[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(a[0])}`,1,0);{const _=a.slice(1);if(_.length!==4||_.some(v=>typeof v!="number"||v<0||v>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:_}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(c=i.parse(c,2,ot),!c)return null;const p=[];let m=null;r==="interpolate-hcl"||r==="interpolate-lab"?m=qn:i.expectedType&&i.expectedType.kind!=="value"&&(m=i.expectedType);for(let _=0;_<h.length;_+=2){const v=h[_],T=h[_+1],E=_+3,A=_+4;if(typeof v!="number")return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',E);if(p.length&&p[p.length-1][0]>=v)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',E);const C=i.parse(T,A,m);if(!C)return null;m=m||C.type,p.push([v,C])}return m.kind==="number"||m.kind==="color"||m.kind==="array"&&m.itemType.kind==="number"&&typeof m.N=="number"?new Rs(m,r,a,c,p):i.error(`Type ${zi(m)} is not interpolatable.`)}evaluate(e){const i=this.labels,r=this.outputs;if(i.length===1)return r[0].evaluate(e);const a=this.input.evaluate(e);if(a<=i[0])return r[0].evaluate(e);const c=i.length;if(a>=i[c-1])return r[c-1].evaluate(e);const h=va(i,a),p=Rs.interpolationFactor(this.interpolation,a,i[h],i[h+1]),m=r[h].evaluate(e),_=r[h+1].evaluate(e);return this.operator==="interpolate"?Ls[this.type.kind.toLowerCase()](m,_,p):this.operator==="interpolate-hcl"?Yo.reverse(Yo.interpolate(Yo.forward(m),Yo.forward(_),p)):Ds.reverse(Ds.interpolate(Ds.forward(m),Ds.forward(_),p))}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const i=[this.operator,e,this.input.serialize()];for(let r=0;r<this.labels.length;
vendor: 5,398 bytes, line 1
1r++)i.push(this.labels[r],this.outputs[r].serialize());return i}}function Fl(t,e,i,r){const a=r-i,c=t-i;return a===0?0:e===1?c/a:(Math.pow(e,c)-1)/(Math.pow(e,a)-1)}var wr=Rs;class Ta{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expectected at least one argument.");let r=null;const a=i.expectedType;a&&a.kind!=="value"&&(r=a);const c=[];for(const p of e.slice(1)){const m=i.parse(p,1+c.length,r,void 0,{typeAnnotation:"omit"});if(!m)return null;r=r||m.type,c.push(m)}const h=a&&c.some(p=>Ur(a,p.type));return new Ta(h?Xt:r,c)}evaluate(e){let i,r=null,a=0;for(const c of this.args){if(a++,r=c.evaluate(e),r&&r instanceof Jn&&!r.available&&(i||(i=r),r=null,a===this.args.length))return i;if(r!==null)break}return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var Ul=Ta;class Ea{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let c=1;c<e.length-1;c+=2){const h=e[c];if(typeof h!="string")return i.error(`Expected string, but found ${typeof h} instead.`,c);if(/[^a-zA-Z0-9_]/.test(h))return i.error("Variable names must contain only alphanumeric characters or '_'.",c);const p=i.parse(e[c+1],c+1);if(!p)return null;r.push([h,p])}const a=i.parse(e[e.length-1],e.length-1,i.expectedType,r);return a?new Ea(r,a):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[i,r]of this.bindings)e.push(i,r.serialize());return e.push(this.result.serialize()),e}}var cu=Ea;class Vl{constructor(e,i,r){this.type=e,this.index=i,this.input=r}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=i.parse(e[1],1,ot),a=i.parse(e[2],2,Yn(i.expectedType||Xt));return r&&a?new Vl(a.type.itemType,r,a):null}evaluate(e){const i=this.index.evaluate(e),r=this.input.evaluate(e);if(i<0)throw new gn(`Array index out of bounds: ${i} < 0.`);if(i>=r.length)throw new gn(`Array index out of bounds: ${i} > ${r.length-1}.`);if(i!==Math.floor(i))throw new gn(`Array index must be an integer, but found ${i} instead.`);return r[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Dh=Vl;class Nl{constructor(e,i){this.type=Wt,this.needle=e,this.haystack=i}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=i.parse(e[1],1,Xt),a=i.parse(e[2],2,Xt);return r&&a?Es(r.type,[Wt,Jt,ot,Go,Xt])?new Nl(r,a):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${zi(r.type)} instead`):null}evaluate(e){const i=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(r==null)return!1;if(!Ss(i,["boolean","string","number","null"]))throw new gn(`Expected first argument to be of type boolean, string, number or null, but found ${zi(Oi(i))} instead.`);if(!Ss(r,["string","array"]))throw new gn(`Expected second argument to be of type array or string, but found ${zi(Oi(r))} instead.`);return r.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Sa=Nl;class Bs{constructor(e,i,r){this.type=ot,this.needle=e,this.haystack=i,this.fromIndex=r}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=i.parse(e[1],1,Xt),a=i.parse(e[2],2,Xt);if(!r||!a)return null;if(!Es(r.type,[Wt,Jt,ot,Go,Xt]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${zi(r.type)} instead`);if(e.length===4){const c=i.parse(e[3],3,ot);return c?new Bs(r,a,c):null}return new Bs(r,a)}evaluate(e){const i=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Ss(i,["boolean","string","number","null"]))throw new gn(`Expected first argument to be of type boolean, string, number or null, but found ${zi(Oi(i))} instead.`);if(!Ss(r,["string","array"]))throw new gn(`Expected second argument to be of type array or string, but found ${zi(Oi(r))} instead.`);if(this.fromIndex){const a=this.fromIndex.evaluate(e);return r.indexOf(i,a)}return r.indexOf(i)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var uu=Bs;class jl{constructor(e,i,r,a,c,h){this.inputType=e,this.type=i,this.input=r,this.cases=a,this.outputs=c,this.otherwise=h}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let r,a;i.expectedType&&i.expectedType.kind!=="value"&&(a=i.expectedType);const c={},h=[];for(let _=2;_<e.length-1;_+=2){let v=e[_];const T=e[_+1];Array.isArray(v)||(v=[v]);const E=i.concat(_);
1if(v.length===0)return E.error("Expected at least one branch label.");for(const C of v){if(typeof C!="number"&&typeof C!="string")return E.error("Branch labels must be numbers or strings.");if(typeof C=="number"&&Math.abs(C)>Number.MAX_SAFE_INTEGER)return E.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof C=="number"&&Math.floor(C)!==C)return E.error("Numeric branch labels must be integer values.");if(r){if(E.checkSubtype(r,Oi(C)))return null}else r=Oi(C);if(c[String(C)]!==void 0)return E.error("Branch labels must be unique.");c[String(C)]=h.length}const A=i.parse(T,_,a);if(!A)return null;a=a||A.type,h.push(A)}const p=i.parse(e[1],1,Xt);if(!p)return null;const m=i.parse(e[e.length-1],e.length-1,a);return m?p.type.kind!=="value"&&i.concat(1).checkSubtype(r,p.type)?null:new jl(r,a,p,c,h,m):null}evaluate(e){const i=this.input.evaluate(e);return(Oi(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],i=Object.keys(this.cases).sort(),r=[],a={};for(const h of i){const p=a[this.cases[h]];p===void 0?(a[this.cases[h]]=r.length,r.push([this.cases[h],[h]])):r[p][1].push(h)}const c=h=>this.inputType.kind==="number"?Number(h):h;for(const[h,p]of r)e.push(p.length===1?c(p[0]):p.map(c)),e.push(this.outputs[h].serialize());return e.push(this.otherwise.serialize()),e}}var Rh=jl;class Gl{constructor(e,i,r){this.type=e,this.branches=i,this.otherwise=r}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let r;i.expectedType&&i.expectedType.kind!=="value"&&(r=i.expectedType);const a=[];for(let h=1;h<e.length-1;h+=2){const p=i.parse(e[h],h,Wt);if(!p)return null;const m=i.parse(e[h+1],h+1,r);if(!m)return null;a.push([p,m]),r=r||m.type}const c=i.parse(e[e.length-1],e.length-1,r);return c?new Gl(r,a,c):null}evaluate(e){for(const[i,r]of this.branches)if(i.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[i,r]of this.branches)e(i),e(r);e(this.otherwise)}outputDefined(){return this.branches.every(([e,i])=>i.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var hu=Gl;class Os{constructor(e,i,r,a){this.type=e,this.input=i,this.beginIndex=r,this.endIndex=a}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=i.parse(e[1],1,Xt),a=i.parse(e[2],2,ot);if(!r||!a)return null;if(!Es(r.type,[Yn(Xt),Jt,Xt]))return i.error(`Expected first argument to be of type array or string, but found ${zi(r.type)} instead`);if(e.length===4){const c=i.parse(e[3],3,ot);return c?new Os(r.type,r,a,c):null}return new Os(r.type,r,a)}evaluate(e){const i=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Ss(i,["string","array"]))throw new gn(`Expected first argument to be of type array or string, but found ${zi(Oi(i))} instead.`);if(this.endIndex){const a=this.endIndex.evaluate(e);return i.slice(r,a)}return i.slice(r)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var du=Os;function Ia(t,e){return t==="=="||t==="!="?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 pu(t,e,i,r){return r.compare(e,i)===0}function Jo(t,e,i){const r=t!=="=="&&t!=="!=";return class N_{constructor(c,h,p){this.type=Wt,this.lhs=c,this.rhs=h,this.collator=p,this.hasUntypedArgument=c.type.kind==="value"||h.type.kind==="value"}static parse(c,h){if(c.length!==3&&c.length!==4)return h.error("Expected two or three arguments.");const p=c[0];let m=h.parse(c[1],1,Xt);if(!m)return null;if(!Ia(p,m.type))return h.concat(1).error(`"${p}" comparisons are not supported for type '${zi(m.type)}'.`);let _=h.parse(c[2],2,Xt);if(!_)return null;if(!Ia(p,_.type))return h.concat(2).error(`"${p}" comparisons are not supported for type '${zi(_.type)}'.`);if(m.type.kind!==_.type.kind&&m.type.kind!=="value"&&_.type.kind!=="value")return h.error(`Cannot compare types '${zi(m.type)}' and '${zi(_.type)}'.`);r&&(m.type.kind==="value"&&_.type.kind!=="value"?m=new Vr(_.type,[m]):m.type.kind!=="value"&&_.type.kind==="value"&&(_=new Vr(m.type,[_]))
1);let v=null;if(c.length===4){if(m.type.kind!=="string"&&_.type.kind!=="string"&&m.type.kind!=="value"&&_.type.kind!=="value")return h.error("Cannot use collator to compare non-string types.");if(v=h.parse(c[3],3,Wn),!v)return null}return new N_(m,_,v)}evaluate(c){const h=this.lhs.evaluate(c),p=this.rhs.evaluate(c);if(r&&this.hasUntypedArgument){const m=Oi(h),_=Oi(p);if(m.kind!==_.kind||m.kind!=="string"&&m.kind!=="number")throw new gn(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${m.kind}, ${_.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){const m=Oi(h),_=Oi(p);if(m.kind!=="string"||_.kind!=="string")return e(c,h,p)}return this.collator?i(c,h,p,this.collator.evaluate(c)):e(c,h,p)}eachChild(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)}outputDefined(){return!0}serialize(){const c=[t];return this.eachChild(h=>{c.push(h.serialize())}),c}}}const Bh=Jo("==",function(t,e,i){return e===i},pu),Oh=Jo("!=",function(t,e,i){return e!==i},function(t,e,i,r){return!pu(0,e,i,r)}),Fh=Jo("<",function(t,e,i){return e<i},function(t,e,i,r){return r.compare(e,i)<0}),Uh=Jo(">",function(t,e,i){return e>i},function(t,e,i,r){return r.compare(e,i)>0}),Vh=Jo("<=",function(t,e,i){return e<=i},function(t,e,i,r){return r.compare(e,i)<=0}),fu=Jo(">=",function(t,e,i){return e>=i},function(t,e,i,r){return r.compare(e,i)>=0});class Ma{constructor(e,i,r,a,c,h){this.type=Jt,this.number=e,this.locale=i,this.currency=r,this.unit=a,this.minFractionDigits=c,this.maxFractionDigits=h}static parse(e,i){if(e.length!==3)return i.error("Expected two arguments.");const r=i.parse(e[1],1,ot);if(!r)return null;const a=e[2];if(typeof a!="object"||Array.isArray(a))return i.error("NumberFormat options argument must be an object.");let c=null;if(a.locale&&(c=i.parse(a.locale,1,Jt),!c))return null;let h=null;if(a.currency&&(h=i.parse(a.currency,1,Jt),!h))return null;let p=null;if(a.unit&&(p=i.parse(a.unit,1,Jt),!p))return null;let m=null;if(a["min-fraction-digits"]&&(m=i.parse(a["min-fraction-digits"],1,ot),!m))return null;let _=null;return a["max-fraction-digits"]&&(_=i.parse(a["max-fraction-digits"],1,ot),!_)?null:new Ma(r,c,h,p,m,_)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class Qo{constructor(e){this.type=ot,this.input=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=i.parse(e[1],1);return r?r.type.kind!=="array"&&r.type.kind!=="string"&&r.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${zi(r.type)} instead.`):new Qo(r):null}evaluate(e){const i=this.input.evaluate(e);if(typeof i=="string"||Array.isArray(i))return i.length;throw new gn(`Expected value to be of type string or array, but found ${zi(Oi(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(i=>{e.push(i.serialize())}),e}}const mu={"==":Bh,"!=":Oh,">":Uh,"<":Fh,">=":fu,"<=":Vh,array:Vr,at:Dh,boolean:Vr,case:hu,coalesce:Ul,collator:ks,format:so,image:ma,in:Sa,"index-of":uu,
vendor: 6,873 bytes, line 1
1interpolate:wr,"interpolate-hcl":wr,"interpolate-lab":wr,length:Qo,let:cu,literal:Mo,match:Rh,number:Vr,"number-format":Ma,object:Vr,slice:du,step:Pl,string:Vr,"to-boolean":qo,"to-color":qo,"to-number":qo,"to-string":qo,var:ru,within:ya};function _u(t,[e,i,r,a]){e=e.evaluate(t),i=i.evaluate(t),r=r.evaluate(t);const c=a?a.evaluate(t):1,h=eu(e,i,r,c);if(h)throw new gn(h);return new Gi(e/255*c,i/255*c,r/255*c,c)}function Zr(t,e){return t in e}function Aa(t,e){const i=e[t];return i===void 0?null:i}function Qn(t){return{type:t}}Nr.register(mu,{error:[{kind:"error"},[Jt],(t,[e])=>{throw new gn(e.evaluate(t))}],typeof:[Jt,[Xt],(t,[e])=>zi(Oi(e.evaluate(t)))],"to-rgba":[Yn(ot,4),[qn],(t,[e])=>e.evaluate(t).toArray()],rgb:[qn,[ot,ot,ot],_u],rgba:[qn,[ot,ot,ot,ot],_u],has:{type:Wt,overloads:[[[Jt],(t,[e])=>Zr(e.evaluate(t),t.properties())],[[Jt,cr],(t,[e,i])=>Zr(e.evaluate(t),i.evaluate(t))]]},get:{type:Xt,overloads:[[[Jt],(t,[e])=>Aa(e.evaluate(t),t.properties())],[[Jt,cr],(t,[e,i])=>Aa(e.evaluate(t),i.evaluate(t))]]},"feature-state":[Xt,[Jt],(t,[e])=>Aa(e.evaluate(t),t.featureState||{})],properties:[cr,[],t=>t.properties()],"geometry-type":[Jt,[],t=>t.geometryType()],id:[Xt,[],t=>t.id()],zoom:[ot,[],t=>t.globals.zoom],pitch:[ot,[],t=>t.globals.pitch||0],"distance-from-center":[ot,[],t=>t.distanceFromCenter()],"heatmap-density":[ot,[],t=>t.globals.heatmapDensity||0],"line-progress":[ot,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[ot,[],t=>t.globals.skyRadialProgress||0],accumulated:[Xt,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[ot,Qn(ot),(t,e)=>{let i=0;for(const r of e)i+=r.evaluate(t);return i}],"*":[ot,Qn(ot),(t,e)=>{let i=1;for(const r of e)i*=r.evaluate(t);return i}],"-":{type:ot,overloads:[[[ot,ot],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[ot],(t,[e])=>-e.evaluate(t)]]},"/":[ot,[ot,ot],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[ot,[ot,ot],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[ot,[],()=>Math.LN2],pi:[ot,[],()=>Math.PI],e:[ot,[],()=>Math.E],"^":[ot,[ot,ot],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[ot,[ot],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[ot,[ot],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[ot,[ot],(t,[e])=>Math.log(e.evaluate(t))],log2:[ot,[ot],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[ot,[ot],(t,[e])=>Math.sin(e.evaluate(t))],cos:[ot,[ot],(t,[e])=>Math.cos(e.evaluate(t))],tan:[ot,[ot],(t,[e])=>Math.tan(e.evaluate(t))],asin:[ot,[ot],(t,[e])=>Math.asin(e.evaluate(t))],acos:[ot,[ot],(t,[e])=>Math.acos(e.evaluate(t))],atan:[ot,[ot],(t,[e])=>Math.atan(e.evaluate(t))],min:[ot,Qn(ot),(t,e)=>Math.min(...e.map(i=>i.evaluate(t)))],max:[ot,Qn(ot),(t,e)=>Math.max(...e.map(i=>i.evaluate(t)))],abs:[ot,[ot],(t,[e])=>Math.abs(e.evaluate(t))],round:[ot,[ot],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[ot,[ot],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[ot,[ot],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Wt,[Jt,Xt],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Wt,[Xt],(t,[e])=>t.id()===e.value],"filter-type-==":[Wt,[Jt],(t,[e])=>t.geometryType()===e.value],"filter-<":[Wt,[Jt,Xt],(t,[e,i])=>{const r=t.properties()[e.value],a=i.value;return typeof r==typeof a&&r<a}],"filter-id-<":[Wt,[Xt],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i<r}],"filter->":[Wt,[Jt,Xt],(t,[e,i])=>{const r=t.properties()[e.value],a=i.value;return typeof r==typeof a&&r>a}],"filter-id->":[Wt,[Xt],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i>r}],"filter-<=":[Wt,[Jt,Xt],(t,[e,i])=>{const r=t.properties()[e.value],a=i.value;return typeof r==typeof a&&r<=a}],"filter-id-<=":[Wt,[Xt],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i<=r}],"filter->=":[Wt,[Jt,Xt],(t,[e,i])=>{const r=t.properties()[e.value],a=i.value;return typeof r==typeof a&&r>=a}],"filter-id->=":[Wt,[Xt],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i>=r}],"filter-has":[Wt,[Xt],(t,[e])=>e.value in t.properties()],"filter-has-id":[Wt,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[Wt,[Yn(Jt)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Wt,[Yn(Xt)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Wt,[Jt,Yn(Xt)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Wt,[Jt,Yn(Xt)],(t,[e,i])=>function(r,a,c,h){for(;c<=h;){const p=c+h>>1;if(a[p]===r)return!0;a[p]>r?h=p-1:c=p+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Wt,overloads:[[[Wt,Wt],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Qn(Wt),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:Wt,overloads:[[[Wt,Wt],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Qn(Wt),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[Wt,[Wt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Wt,[Jt],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Jt,[Jt],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Jt,[Jt],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Jt,Qn(Xt),(t,e)=>e.map(i=>Cs(i.evaluate(t))).join("")],"resolved-locale":[Jt,[Wn],(t,[e])=>e.evaluate(t).resolvedLocale()]});var Fs=mu;function gu(t){return{result:"success",value:t}}function Po(t){return{result:"error",value:t}}function $o(t){return t["property-type"]==="data-driven"}function Ca(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function ka(t){return!!t.expression&&t.expression.interpolated}function oi(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function Us(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function yu(t){return t}function Pa(t,e){const i=e.type==="color",r=t.stops&&typeof t.stops[0][0]=="object",a=r||!(r||t.property!==void 0),c=t.type||(ka(e)?"exponential":"interval");if(i&&((t=Fr({},t)).stops&&(t.stops=t.stops.map(_=>[_[0],Gi.parse(_[1])])),t.default=Gi.parse(t.default?t.default:e.default)),t.colorSpace&&t.colorSpace!=="rgb"&&!Ol[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let h,p,m;if(c==="exponential")h=qr;else if(c==="interval")h=za;else if(c==="categorical"){h=xu,p=Object.create(null);for(const _ of t.stops)p[_[0]]=_[1];m=typeof t.stops[0][0]}else{if(c!=="identity")throw new Error(`Unknown function type "${c}"`);h=vu}if(r){const _={},v=[];for(let A=0;A<t.stops.length;A++){const C=t.stops[A],L=C[0].zoom;_[L]===void 0&&(_[L]={zoom:L,type:t.type,property:t.property,default:t.default,stops:[]},v.push(L)),_[L].stops.push([C[0].value,C[1]])}const T=[];for(const A of v)T.push([_[A].zoom,Pa(_[A],e)]);const E={name:"linear"};return{kind:"composite",interpolationType:E,interpolationFactor:wr.interpolationFactor.bind(void 0,E),zoomStops:T.map(A=>A[0]),evaluate:({zoom:A},C)=>qr({stops:T,base:t.base},e,A).evaluate(A,C)}}
vendor: 1,037 bytes, line 1
1if(a){const _=c==="exponential"?{name:"exponential",base:t.base!==void 0?t.base:1}:null;return{kind:"camera",interpolationType:_,interpolationFactor:wr.interpolationFactor.bind(void 0,_),zoomStops:t.stops.map(v=>v[0]),evaluate:({zoom:v})=>h(t,e,v,p,m)}}return{kind:"source",evaluate(_,v){const T=v&&v.properties?v.properties[t.property]:void 0;return T===void 0?es(t.default,e.default):h(t,e,T,p,m)}}}function es(t,e,i){return t!==void 0?t:e!==void 0?e:i!==void 0?i:void 0}function xu(t,e,i,r,a){return es(typeof i===a?r[i]:void 0,t.default,e.default)}function za(t,e,i){if(oi(i)!=="number")return es(t.default,e.default);const r=t.stops.length;if(r===1||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];const a=va(t.stops.map(c=>c[0]),i);return t.stops[a][1]}function qr(t,e,i){const r=t.base!==void 0?t.base:1;if(oi(i)!=="number")return es(t.default,e.default);const a=t.stops.length;if(a===1||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[a-1][0])return t.stops[a-1][1];const c=va(t.stops.map(v
1=>v[0]),i),h=function(v,T,E,A){const C=A-E,L=v-E;return C===0?0:T===1?L/C:(Math.pow(T,L)-1)/(Math.pow(T,C)-1)}(i,r,t.stops[c][0],t.stops[c+1][0]),p=t.stops[c][1],m=t.stops[c+1][1];let _=Ls[e.type]||yu;if(t.colorSpace&&t.colorSpace!=="rgb"){const v=Ol[t.colorSpace];_=(T,E)=>v.reverse(v.interpolate(v.forward(T),v.forward(E),h))}return typeof p.evaluate=="function"?{evaluate(...v){const T=p.evaluate.apply(void 0,v),E=m.evaluate.apply(void 0,v);if(T!==void 0&&E!==void 0)return _(T,E,h)}}:_(p,m,h)}function vu(t,e,i){return e.type==="color"?i=Gi.parse(i):e.type==="formatted"?i=Bn.fromString(i.toString()):e.type==="resolvedImage"?i=Jn.fromString(i.toString()):oi(i)===e.type||e.type==="enum"&&e.values[i]||(i=void 0),es(i,t.default,e.default)}class La{constructor(e,i){this.expression=e,this._warningHistory={},this._evaluator=new Tl,this._defaultValue=i?function(r){return r.type==="color"&&(Us(r.default)||Array.isArray(r.default))?new Gi(0,0,0,0):r.type==="color"?Gi.parse(r.default)||null:r.default===void 0?null:r.default}(i):null,this._enumValues=i&&i.type==="enum"?i.values:null}evaluateWithoutErrorHandling(e,i,r,a,c,h,p,m){return this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=r,this._evaluator.canonical=a||null,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=h,this._evaluator.featureTileCoord=p||null,this._evaluator.featureDistanceData=m||null,this.expression.evaluate(this._evaluator)}evaluate(e,i,r,a,c,h,p,m){this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=r||null,this._evaluator.canonical=a||null,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=h||null,this._evaluator.featureTileCoord=p||null,this._evaluator.featureDistanceData=m||null;try{const _=this.expression.evaluate(this._evaluator);if(_==null||typeof _=="number"&&_!=_)return this._defaultValue;if(this._enumValues&&!(_ in this._enumValues))throw new gn(`Expected value to be one of ${Object.keys(this._enumValues).map(v=>JSON.stringify(v)).join(", ")}, but found ${JSON.stringify(_)} instead.`);return _}catch(_){return this._warningHistory[_.message]||(this._warningHistory[_.message]=!0,typeof console<"u"&&console.warn(_.message)),this._defaultValue}}}function ts(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in Fs}function is(t,e){const i=new Cl(Fs,[],e?function(a){const c={color:qn,string:Jt,number:ot,enum:Jt,boolean:Wt,formatted:Ts,resolvedImage:Io};return a.type==="array"?Yn(c[a.value]||Xt,a.length):c[a.type]}(e):void 0),r=i.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return r?gu(new La(r,e)):Po(i.errors)}class Zl{constructor(e,i){this.kind=e,this._styleExpression=i,this.isStateDependent=e!=="constant"&&!Gr(i.expression)}evaluateWithoutErrorHandling(e,i,r,a,c,h){return this._styleExpression.evaluateWithoutErrorHandling(e,i,r,a,c,h)}evaluate(e,i,r,a,c,h){return this._styleExpression.evaluate(e,i,r,a,c,h)}}class Vs{constructor(e,i,r,a){this.kind=e,this.zoomStops=r,this._styleExpression=i,this.isStateDependent=e!=="camera"&&!Gr(i.expression),this.interpolationType=a}evaluateWithoutErrorHandling(e,i,r,a,c,h){return this._styleExpression.evaluateWithoutErrorHandling(e,i,r,a,c,h)}evaluate(e,i,r,a,c,h){return this._styleExpression.evaluate(e,i,r,a,c,h)}interpolationFactor(e,i,r){return this.interpolationType?wr.interpolationFactor(this.interpolationType,e,i,r):0}}function Ns(t,e){if((t=is(t,e)).result==="error")return t;const i=t.value.expression,r=Ko(i);if(!r&&!$o(e))return Po([new vr("","data expressions not supported")]);const a=Co(i,["zoom","pitch","distance-from-center"]);if(!a&&!Ca(e))return Po([new vr("","zoom expressions not supported")]);const c=Ra(i);return c||a?c instanceof vr?Po([c]):c instanceof wr&&!ka(e)?Po([new vr("",'"interpolate" expressions cannot be used with this property')]):gu(c?new Vs(r?"camera":"composite",t.value,c.labels,c instanceof wr?c.interpolation:void 0):new Zl(r?"constant":"source",t.value)):Po([new vr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Da{constructor(e,i){this._parameters=e,this._specification=i,Fr(this,Pa(this._parameters,this._specification))}static deserialize(e){return new Da(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Ra(t){let e=null;if(t instanceof cu)e=Ra(t.result);else if(t instanceof Ul){for(const i of t.args)if(e=Ra(i),e)break}else(t instanceof Pl||t instanceof wr)&&t.input instanceof Nr&&t.input.name==="zoom"&&(e=t);return e instanceof vr||t.eachChild(i=>{const r=Ra(i);r instanceof vr?e=r:!e&&r?e=new vr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new vr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}class st{constructor(e,i,r,a){this.message=(e?`${e}: `:"")+r,a&&(this.identifier=a),i!=null&&i.__line__&&(this.line=i.__line__)}}function ur(t){const e=t.key,i=t.value,r=t.valueSpec||{},a=t.objectElementValidators||{},c=t.style,h=t.styleSpec;let p=[];const m=oi(i);if(m!=="object")return[new st(e,i,`object expected, ${m}
1 found`)];for(const _ in i){const v=_.split(".")[0];let T;a[v]?T=a[v]:r[v]?T=In:a["*"]?T=a["*"]:r["*"]&&(T=In),T?p=p.concat(T({key:(e&&`${e}.`)+_,value:i[_],valueSpec:r[v]||r["*"],style:c,styleSpec:h,object:i,objectKey:_},i)):p.push(new st(e,i[_],`unknown property "${_}"`))}for(const _ in r)a[_]||r[_].required&&r[_].default===void 0&&i[_]===void 0&&p.push(new st(e,i,`missing required property "${_}"`));return p}function bu(t){const e=t.value,i=t.valueSpec,r=t.style,a=t.styleSpec,c=t.key,h=t.arrayElementValidator||In;if(oi(e)!=="array")return[new st(c,e,`array expected, ${oi(e)} found`)];if(i.length&&e.length!==i.length)return[new st(c,e,`array length ${i.length} expected, length ${e.length} found`)];if(i["min-length"]&&e.length<i["min-length"])return[new st(c,e,`array length at least ${i["min-length"]} expected, length ${e.length} found`)];let p={type:i.value,values:i.values,minimum:i.minimum,maximum:i.maximum,function:void 0};a.$version<7&&(p.function=i.function),oi(i.value)==="object"&&(p=i.value);let m=[];for(let _=0;_<e.length;_++)m=m.concat(h({array:e,arrayIndex:_,value:e[_],valueSpec:p,style:r,styleSpec:a,key:`${c}[${_}]`}));return m}function js(t){const e=t.key,i=t.value,r=t.valueSpec;let a=oi(i);if(a==="number"&&i!=i&&(a="NaN"),a!=="number")return[new st(e,i,`number expected, ${a} found`)];if("minimum"in r){let c=r.minimum;if(oi(r.minimum)==="array"&&(c=r.minimum[t.arrayIndex]),i<c)return[new st(e,i,`${i} is less than the minimum value ${c}`)]}if("maximum"in r){let c=r.maximum;if(oi(r.maximum)==="array"&&(c=r.maximum[t.arrayIndex]),i>c)return[new st(e,i,`${i} is greater than the maximum value ${c}`)]}return[]}function Gs(t){const e=t.valueSpec,i=qi(t.value.type);let r,a,c,h={};const p=i!=="categorical"&&t.value.property===void 0,m=!p,_=oi(t.value.stops)==="array"&&oi(t.value.stops[0])==="array"&&oi(t.value.stops[0][0])==="object",v=ur({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(A){if(i==="identity")return[new st(A.key,A.value,'identity function may not have a "stops" property')];let C=[];const L=A.value;return C=C.concat(bu({key:A.key,value:L,valueSpec:A.valueSpec,style:A.style,styleSpec:A.styleSpec,arrayElementValidator:T})),oi(L)==="array"&&L.length===0&&C.push(new st(A.key,L,"array must have at least one stop")),C},default:function(A){return In({key:A.key,value:A.value,valueSpec:e,style:A.style,styleSpec:A.styleSpec})}}});return i==="identity"&&p&&v.push(new st(t.key,t.value,'missing required property "property"')),i==="identity"||t.value.stops||v.push(new st(t.key,t.value,'missing required property "stops"')),i==="exponential"&&t.valueSpec.expression&&!ka(t.valueSpec)&&v.push(new st(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(m&&!$o(t.valueSpec)?v.push(new st(t.key,t.value,"property functions not supported")):p&&!Ca(t.valueSpec)&&v.push(new st(t.key,t.value,"zoom functions not supported"))),i!=="categorical"&&!_||t.value.property!==void 0||v.push(new st(t.key,t.value,'"property" property is required')),v;function T(A){let C=[];const L=A.value,F=A.key;if(oi(L)!=="array")return[new st(F,L,`array expected, ${oi(L)} found`)];if(L.length!==2)return[new st(F,L,`array length 2 expected, length ${L.length} found`)];if(_){if(oi(L[0])!=="object")return[new st(F,L,`object expected, ${oi(L[0])} found`)];if(L[0].zoom===void 0)return[new st(F,L,"object stop key must have zoom")];if(L[0].value===void 0)return[new st(F,L,"object stop key must have value")];const W=qi(L[0].zoom);if(typeof W!="number")return[new st(F,L[0].zoom,"stop zoom values must be numbers")];if(c&&c>W)return[new st(F,L[0].zoom,"stop zoom values must appear in ascending order")];W!==c&&(c=W,a=void 0,h={}),C=C.concat(ur({key:`${F}[0]`,value:L[0],valueSpec:{zoom:{}},style:A.style,styleSpec:A.styleSpec,objectElementValidators:{zoom:js,value:E}}))}else C=C.concat(E({key:`${F}[0]`,value:L[0],valueSpec:{},style:A.style,styleSpec:A.styleSpec},L));return ts(ln(L[1]))?C.concat([new st(`${F}[1]`,L[1],"expressions are not allowed in function stops.")]):C.concat(In({key:`${F}[1]`,value:L[1],valueSpec:e,style:A.style,styleSpec:A.styleSpec}))}function E(A,C){const L=oi(A.value),F=qi(A.value),W=A.value!==null?A.value:C;if(r){if(L!==r)return[new st(A.key,W,`${L} stop domain type must match previous stop domain type ${r}`)]}else r=L;if(L!=="number"&&L!=="string"&&L!=="boolean"&&typeof F!="number"&&typeof F!="string"&&typeof F!="boolean")return[new st(A.key,W,"stop domain value must be a number, string, or boolean")];
1if(L!=="number"&&i!=="categorical"){let $=`number expected, ${L} found`;return $o(e)&&i===void 0&&($+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new st(A.key,W,$)]}return i!=="categorical"||L!=="number"||typeof F=="number"&&isFinite(F)&&Math.floor(F)===F?i!=="categorical"&&L==="number"&&typeof F=="number"&&typeof a=="number"&&a!==void 0&&F<a?[new st(A.key,W,"stop domain values must appear in ascending order")]:(a=F,i==="categorical"&&F in h?[new st(A.key,W,"stop domain values must be unique")]:(h[F]=!0,[])):[new st(A.key,W,`integer expected, found ${String(F)}`)]}}function cn(t){const e=(t.expressionContext==="property"?Ns:is)(ln(t.value),t.valueSpec);if(e.result==="error")return e.value.map(r=>new st(`${t.key}${r.key}`,t.value,r.message));const i=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!i.outputDefined())return[new st(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!Gr(i))return[new st(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter")return Zs(i,t);if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!Co(i,["zoom","feature-state"]))return[new st(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!Ko(i))return[new st(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Zs(t,e){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(e.valueSpec&&e.valueSpec.expression)for(const a of e.valueSpec.expression.parameters)i.delete(a);if(i.size===0)return[];const r=[];return t instanceof Nr&&i.has(t.name)?[new st(e.key,e.value,`["${t.name}"] expression is not supported in a filter for a ${e.object.type} layer with id: ${e.object.id}`)]:(t.eachChild(a=>{r.push(...Zs(a,e))}),r)}function Ba(t){const e=t.key,i=t.value,r=t.valueSpec,a=[];return Array.isArray(r.values)?r.values.indexOf(qi(i))===-1&&a.push(new st(e,i,`expected one of [${r.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(r.values).indexOf(qi(i))===-1&&a.push(new st(e,i,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(i)} found`)),a}function ql(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!ql(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}function Oa(t,e="fill"){if(t==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};ql(t)||(t=rs(t));const i=t;let r=!0;try{r=function(_){if(!ns(_))return _;let v=ln(_);return Fa(v),v=wu(v),v}(i)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.
2This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md
3and paste the contents of this message in the report.
4Thank you!
5Filter Expression:
6${JSON.stringify(i,null,2)}
7        `)}const a=Ce[`filter_${e}`],c=is(r,a);let h=null;if(c.result==="error")throw new Error(c.value.map(_=>`${_.key}: ${_.message}`).join(", "));h=(_,v,T)=>c.value.evaluate(_,v,{},T);let p=null,m=null;if(r!==i){const _=is(i,a);if(_.result==="error")throw new Error(_.value.map(v=>`${v.key}: ${v.message}`).join(", "));p=(v,T,E,A,C)=>_.value.evaluate(v,T,{},E,void 0,void 0,A,C),m=!Ko(_.value.expression)}return{filter:h,dynamicFilter:p||void 0,needGeometry:Tu(r),needFeature:!!m}}function wu(t){if(!Array.isArray(t))return t;const e=function(i){if(Wl.has(i[0])){for(let r=1;r<i.length;r++)if(ns(i[r]))return!0}return i}(t);return e===!0?e:e.map(i=>wu(i))}function Fa(t){let e=!1;const i=[];if(t[0]==="case"){for(let r=1;r<t.length-1;r+=2)e=e||ns(t[r]),i.push(t[r+1]);i.push(t[t.length-1])}else if(t[0]==="match"){e=e||ns(t[1]);for(let r=2;r<t.length-1;r+=2)i.push(t[r+1]);i.push(t[t.length-1])}else if(t[0]==="step"){e=e||ns(t[1]);for(let r=1;r<t.length-1;r+=2)i.push(t[r+1])}e&&(t.length=0,t.push("any",...i));for(let r=1;r<t.length;r++)Fa(t[r])}function ns(t){if(!Array.isArray(t))return!1;if((e=t[0])==="pitch"||e==="distance-from-center")return!0;var e;
vendor: 7,630 bytes, lines 7-8
7for(let i=1;i<t.length;i++)if(ns(t[i]))return!0;return!1}const Wl=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function Nh(t,e){return t<e?-1:t>e?1:0}function Tu(t){if(!Array.isArray(t))return!1;if(t[0]==="within")return!0;for(let e=1;e<t.length;e++)if(Tu(t[e]))return!0;return!1}function rs(t){if(!t)return!0;const e=t[0];return t.length<=1?e!=="any":e==="=="?Xl(t[1],t[2],"=="):e==="!="?Ua(Xl(t[1],t[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Xl(t[1],t[2],e):e==="any"?(i=t.slice(1),["any"].concat(i.map(rs))):e==="all"?["all"].concat(t.slice(1).map(rs)):e==="none"?["all"].concat(t.slice(1).map(rs).map(Ua)):e==="in"?Hl(t[1],t.slice(2)):e==="!in"?Ua(Hl(t[1],t.slice(2))):e==="has"?Kl(t[1]):e==="!has"?Ua(Kl(t[1])):e!=="within"||t;var i}function Xl(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function Hl(t,e){if(e.length===0)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(i=>typeof i!=typeof e[0])?["filter-in-large",t,["literal",e.sort(Nh)]]:["filter-in-small",t,["literal",e]]}}function Kl(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ua(t){return["!",t]}function qs(t){return ql(ln(t.value))?cn(Fr({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${t.layerType||"fill"}`]})):Ws(t)}function Ws(t){const e=t.value,i=t.key;if(oi(e)!=="array")return[new st(i,e,`array expected, ${oi(e)} found`)];const r=t.styleSpec;let a,c=[];if(e.length<1)return[new st(i,e,"filter array must have at least 1 element")];switch(c=c.concat(Ba({key:`${i}[0]`,value:e[0],valueSpec:r.filter_operator,style:t.style,styleSpec:t.styleSpec})),qi(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&qi(e[1])==="$type"&&c.push(new st(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&c.push(new st(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(a=oi(e[1]),a!=="string"&&c.push(new st(`${i}[1]`,e[1],`string expected, ${a} found`)));for(let h=2;h<e.length;h++)a=oi(e[h]),qi(e[1])==="$type"?c=c.concat(Ba({key:`${i}[${h}]`,value:e[h],valueSpec:r.geometry_type,style:t.style,styleSpec:t.styleSpec})):a!=="string"&&a!=="number"&&a!=="boolean"&&c.push(new st(`${i}[${h}]`,e[h],`string, number, or boolean expected, ${a} found`));break;case"any":case"all":case"none":for(let h=1;h<e.length;h++)c=c.concat(Ws({key:`${i}[${h}]`,value:e[h],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":a=oi(e[1]),e.length!==2?c.push(new st(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):a!=="string"&&c.push(new st(`${i}[1]`,e[1],`string expected, ${a} found`));break;case"within":a=oi(e[1]),e.length!==2?c.push(new st(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):a!=="object"&&c.push(new st(`${i}[1]`,e[1],`object expected, ${a} found`))}return c}function Yl(t,e){const i=t.key,r=t.style,a=t.styleSpec,c=t.value,h=t.objectKey,p=a[`${e}_${t.layerType}`];if(!p)return[];const m=h.match(/^(.*)-transition$/);if(e==="paint"&&m&&p[m[1]]&&p[m[1]].transition)return In({key:i,value:c,valueSpec:a.transition,style:r,styleSpec:a});const _=t.valueSpec||p[h];if(!_)return[new st(i,c,`unknown property "${h}"`)];let v;if(oi(c)==="string"&&$o(_)&&!_.tokens&&(v=/^{([^}]+)}$/.exec(c))){const E=`\`{ "type": "identity", "property": ${v?JSON.stringify(v[1]):'"_"'} }\``;return[new st(i,c,`"${h}" does not support interpolation syntax
8Use an identity property function instead: ${E}.`)]}const T=[];return t.layerType==="symbol"&&(h==="text-field"&&r&&!r.glyphs&&T.push(new st(i,c,'use of "text-field" requires a style "glyphs" property')),h==="text-font"&&Us(ln(c))&&qi(c.type)==="identity"&&T.push(new st(i,c,'"text-font" does not support identity functions'))),T.concat(In({key:t.key,value:c,valueSpec:_,style:r,styleSpec:a,expressionContext:"property",propertyType:e,propertyKey:h}))}function Eu(t){return Yl(t,"paint")}function Jl(t){return Yl(t,"layout")}function Su(t){let e=[];const i=t.value,r=t.key,a=t.style,c=t.styleSpec;i.type||i.ref||e.push(new st(r,i,'either "type" or "ref" is required'));let h=qi(i.type);const p=qi(i.ref);if(i.id){const m=qi(i.id);for(let _=0;_<t.arrayIndex;_++){const v=a.layers[_];qi(v.id)===m&&e.push(new st(r,i.id,`duplicate layer id "${i.id}", previously used at line ${v.id.__line__}`))}}if("ref"in i){let m;["type","source","source-layer","filter","layout"].forEach(_=>{_ in i&&e.push(new st(r,i[_],`"${_}" is prohibited for ref layers`))}),a.layers.forEach(_=>{qi(_.id)===p&&(m=_)}),m?m.ref?e.push(new st(r,i.ref,"ref cannot reference another ref layer")):h=qi(m.type):typeof p=="string"&&e.push(new st(r,i.ref,`ref layer "${p}" not found`))}else if(h!=="background"&&h!=="sky")if(i.source){const m=a.sources&&a.sources[i.source],_=m&&qi(m.type);m?_==="vector"&&h==="raster"?e.push(new st(r,i.source,`layer "${i.id}" requires a raster source`)):_==="raster"&&h!=="raster"?e.push(new st(r,i.source,`layer "${i.id}" requires a vector source`)):_!=="vector"||i["source-layer"]?_==="raster-dem"&&h!=="hillshade"?e.push(new st(r,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):h!=="line"||!i.paint||!i.paint["line-gradient"]&&!i.paint["line-trim-offset"]||_==="geojson"&&m.lineMetrics||e.push(new st(r,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new st(r,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new st(r,i.source,`source "${i.source}" not found`))}else e.push(new st(r,i,'missing required property "source"'));return e=e.concat(ur({key:r,value:i,valueSpec:c.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>In({key:`${r}.type`,value:i.type,valueSpec:c.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"}),filter:m=>qs(Fr({layerType:h},m)),layout:m=>ur({layer:i,key:m.key,value:m.value,valueSpec:{},style:m.style,styleSpec:m.styleSpec,objectElementValidators:{"*":_=>Jl(Fr({layerType:h},_))}}),paint:m=>ur({layer:i,key:m.key,value:m.value,valueSpec:{},style:m.style,styleSpec:m.styleSpec,objectElementValidators:{"*":_=>Eu(Fr({layerType:h},_))}})}})),e}function ao(t){const e=t.value,i=t.key,r=oi(e);return r!=="string"?[new st(i,e,`string expected, ${r} found`)]:[]}const Iu={promoteId:function({key:t,value:e}){if(oi(e)==="string")return ao({key:t,value:e});{const i=[];for(const r in e)i.push(...ao({key:`${t}.${r}`,value:e[r]}));return i}}};function Mu(t){const e=t.value,i=t.key,r=t.styleSpec,a=t.style;if(!e.type)return[new st(i,e,'"type" is required')];const c=qi(e.type);let h;switch(c){case"vector":case"raster":case"raster-dem":return h=ur({key:i,value:e,valueSpec:r[`source_${c.replace("-","_")}`],style:t.style,styleSpec:r,objectElementValidators:Iu}),h;case"geojson":if(h=ur({key:i,value:e,valueSpec:r.source_geojson,style:a,styleSpec:r,objectElementValidators:Iu}),e.cluster)for(const p in e.clusterProperties){const[m,_]=e.clusterProperties[p],v=typeof m=="string"?[m,["accumulated"],["get",p]]:m;h.push(...cn({key:`${i}.${p}.map`,value:_,expressionContext:"cluster-map"})),h.push(...cn({key:`${i}.${p}.reduce`,value:v,expressionContext:"cluster-reduce"}))}return h;case"video":return ur({key:i,value:e,valueSpec:r.source_video,style:a,styleSpec:r});case"image":return ur({key:i,value:e,valueSpec:r.source_image,style:a,styleSpec:r});case"canvas":return[new st(i,null,"Please use runtime APIs to add canvas sources, rather than 
8including them in stylesheets.","source.canvas")];default:return Ba({key:`${i}.type`,value:e.type,valueSpec:{values:jh(r)},style:a,styleSpec:r})}}function jh(t){return t.source.reduce((e,i)=>{const r=t[i];return r.type.type==="enum"&&(e=e.concat(Object.keys(r.type.values))),e},[])}function Au(t){const e=t.value,i=t.styleSpec,r=i.light,a=t.style;let c=[];const h=oi(e);if(e===void 0)return c;if(h!=="object")return c=c.concat([new st("light",e,`object expected, ${h} found`)]),c;for(const p in e){const m=p.match(/^(.*)-transition$/);c=c.concat(m&&r[m[1]]&&r[m[1]].transition?In({key:p,value:e[p],valueSpec:i.transition,style:a,styleSpec:i}):r[p]?In({key:p,value:e[p],valueSpec:r[p],style:a,styleSpec:i}):[new st(p,e[p],`unknown property "${p}"`)])}return c}function Ql(t){const e=t.value,i=t.key,r=t.style,a=t.styleSpec,c=a.terrain;let h=[];const p=oi(e);if(e===void 0)return h;if(p!=="object")return h=h.concat([new st("terrain",e,`object expected, ${p} found`)]),h;for(const m in e){const _=m.match(/^(.*)-transition$/);h=h.concat(_&&c[_[1]]&&c[_[1]].transition?In({key:m,value:e[m],valueSpec:a.transition,style:r,styleSpec:a}):c[m]?In({key:m,value:e[m],valueSpec:c[m],style:r,styleSpec:a}):[new st(m,e[m],`unknown property "${m}"`)])}if(e.source){const m=r.sources&&r.sources[e.source],_=m&&qi(m.type);m?_!=="raster-dem"&&h.push(new st(i,e.source,`terrain cannot be used with a source of type ${String(_)}, it only be used with a "raster-dem" source type`)):h.push(new st(i,e.source,`source "${e.source}" not found`))}else h.push(new st(i,e,'terrain is missing required property "source"'));return h}function Cu(t){const e=t.value,i=t.style,r=t.styleSpec,a=r.fog;let c=[];const h=oi(e);if(e===void 0)return c;if(h!=="object")return c=c.concat([new st("fog",e,`object expected, ${h} found`)]),c;for(const p in e){const m=p.match(/^(.*)-transition$/);c=c.concat(m&&a[m[1]]&&a[m[1]].transition?In({key:p,value:e[p],valueSpec:r.transition,style:i,styleSpec:r}):a[p]?In({key:p,value:e[p],valueSpec:a[p],style:i,styleSpec:r}):[new st(p,e[p],`unknown property "${p}"`)])}return c}const ku={"*":()=>[],array:bu,boolean:function(t){const e=t.value,i=t.key,r=oi(e);return r!=="boolean"?[new st(i,e,`boolean expected, ${r} found`)]:[]},number:js,color:function(t){const e=t.key,i=t.value,r=oi(i);return r!=="string"?[new st(e,i,`color expected, ${r} found`)]:_l(i)===null?[new st(e,i,`color expected, "${i}" found`)]:[]},enum:Ba,filter:qs,function:Gs,layer:Su,object:ur,source:Mu,light:Au,terrain:Ql,fog:Cu,string:ao,formatted:function(t){return ao(t).length===0?[]:cn(t)},resolvedImage:function(t){return ao(t).length===0?[]:cn(t)},projection:function(t){const e=t.value,i=t.styleSpec,r=i.projection,a=t.style;let c=[];const h=oi(e);if(h==="object")for(const p in e)c=c.concat(In({key:p,value:e[p],valueSpec:r[p],style:a,styleSpec:i}));else h!=="string"&&(c=c.concat([new st("projection",e,`object or string expected, ${h} found`)]));return c}};function In(t){const e=t.value,i=t.valueSpec,r=t.styleSpec;return i.expression&&Us(qi(e))?Gs(t):i.expression&&ts(ln(e))?cn(t):i.type&&ku[i.type]?ku[i.type](t):ur(Fr({},t,{valueSpec:i.type?r[i.type]:i}))}function Gh(t){const e=t.value,i=t.key,r=ao(t);return r.length||(e.indexOf("{fontstack}")===-1&&r.push(new st(i,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&r.push(new st(i,e,'"glyphs" url must include a "{range}" token'))),r}function Pu(t,e=Ce){return $n(In({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Gh,"*":()=>[]}}))}const Zh=t=>$n(Eu(t)),qh=t=>$n(Jl(t));function $n(t){return t.slice().sort((e,i)=>e.line&&i.line?e.line-i.line:0)}function zu(t,e){let i=!1;if(e&&e.length)for(const r of e)t.fire(new Or(new Error(r.message))),i=!0;return i}var Wh=Tr,hr=3;function Tr(t,e,i){var r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],this.d=(e=a[1])+2*(i=a[2]);for(var c=0;c<this.d*this.d;c++){var h=a[hr+c],p=a[hr+c+1];r.push(h===p?null:a.subarray(h,p))}var m=a[hr+r.length+1];this.keys=a.subarray(a[hr+r.length],m),this.bboxes=a.subarray(m),this.insert=this._insertReadonly}else{this.d=e+2*i;for(var _=0;_<this.d*this.d;_++)r.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;var v=i/e*t;this.min=-v,this.max=t+v}
vendor: 5,687 bytes, line 8
8Tr.prototype.insert=function(t,e,i,r,a){this._forEachCell(e,i,r,a,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(a)},Tr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Tr.prototype._insertCell=function(t,e,i,r,a,c){this.cells[a].push(c)},Tr.prototype.query=function(t,e,i,r,a){var c=this.min,h=this.max;if(t<=c&&e<=c&&h<=i&&h<=r&&!a)return Array.prototype.slice.call(this.keys);var p=[];return this._forEachCell(t,e,i,r,this._queryCell,p,{},a),p},Tr.prototype._queryCell=function(t,e,i,r,a,c,h,p){var m=this.cells[a];if(m!==null)for(var _=this.keys,v=this.bboxes,T=0;T<m.length;T++){var E=m[T];if(h[E]===void 0){var A=4*E;(p?p(v[A+0],v[A+1],v[A+2],v[A+3]):t<=v[A+2]&&e<=v[A+3]&&i>=v[A+0]&&r>=v[A+1])?(h[E]=!0,c.push(_[E])):h[E]=!1}}},Tr.prototype._forEachCell=function(t,e,i,r,a,c,h,p){for(var m=this._convertToCellCoord(t),_=this._convertToCellCoord(e),v=this._convertToCellCoord(i),T=this._convertToCellCoord(r),E=m;E<=v;E++)for(var A=_;A<=T;A++){var C=this.d*A+E;if((!p||p(this._convertFromCellCoord(E),this._convertFromCellCoord(A),this._convertFromCellCoord(E+1),this._convertFromCellCoord(A+1)))&&a.call(this,t,e,i,r,C,c,h,p))return}},Tr.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Tr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Tr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=hr+this.cells.length+1+1,i=0,r=0;r<this.cells.length;r++)i+=this.cells[r].length;var a=new Int32Array(e+i+this.keys.length+this.bboxes.length);a[0]=this.extent,a[1]=this.n,a[2]=this.padding;for(var c=e,h=0;h<t.length;h++){var p=t[h];a[hr+h]=c,a.set(p,c),c+=p.length}return a[hr+t.length]=c,a.set(this.keys,c),a[hr+t.length+1]=c+=this.keys.length,a.set(this.bboxes,c),c+=this.bboxes.length,a.buffer};var zo=lt(Wh);const Va={};function ct(t,e,i={}){Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),Va[e]={klass:t,omit:i.omit||[]}}ct(Object,"Object"),zo.serialize=function(t,e){const i=t.toArrayBuffer();return e&&e.push(i),{buffer:i}},zo.deserialize=function(t){return new zo(t.buffer)},Object.defineProperty(zo,"name",{value:"Grid"}),ct(zo,"Grid"),ct(Gi,"Color"),ct(Error,"Error"),ct(Pn,"AJAXError"),ct(Jn,"ResolvedImage"),ct(Da,"StylePropertyFunction"),ct(La,"StyleExpression",{omit:["_evaluator"]}),ct(Vs,"ZoomDependentExpression"),ct(Zl,"ZoomConstantExpression"),ct(Nr,"CompoundExpression",{omit:["_evaluate"]});for(const t in Fs)Va[Fs[t]._classRegistryKey]||ct(Fs[t],`Expression${t}`);function $l(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}function ec(t){return U.ImageBitmap&&t instanceof U.ImageBitmap}function os(t,e){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if($l(t)||ec(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){const i=t;return e&&e.push(i.buffer),i}if(t instanceof U.ImageData)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){const i=[];for(const r of t)i.push(os(r,e));return i}if(typeof t=="object"){const i=t.constructor,r=i._classRegistryKey;if(!r)throw new Error(`can't serialize object of unregistered class ${r}`);const a=i.serialize?i.serialize(t,e):{};if(!i.serialize){for(const c in t)t.hasOwnProperty(c)&&(Va[r].omit.indexOf(c)>=0||(a[c]=os(t[c],e)));t instanceof Error&&(a.message=t.message)}if(a.$name)throw new Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(a.$name=r),a}throw new Error("can't serialize object of type "+typeof t)}function Lo(t){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||$l(t)||ec(t)||ArrayBuffer.isView(t)||t instanceof U.ImageData)return t;if(Array.isArray(t))return t.map(Lo);if(typeof t=="object"){const e=t.$name||"Object",{klass:i}=Va[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(t);const r=Object.create(i.prototype);for(const a of Object.keys(t))a!=="$name"&&(r[a]=Lo(t[a]));return r}throw new Error("can't deserialize object of type "+typeof t)}const rt={"Latin-1 Supplement":t=>t>=128&&t<=255,Arabic:t=>t>=1536&&t<=1791,"Arabic Supplement":t=>t>=1872&&t<=1919,"Arabic Extended-A":t=>t>=2208&&t<=2303,"Hangul Jamo":t=>t>=4352&&t<=4607,"Unified Canadian Aboriginal Syllabics":t=>t>=5120&&t<=5759,Khmer:t=>t>=6016&&t<=6143,"Unified Canadian Aboriginal Syllabics Extended":t=>t>=6320&&t<=6399,"General Punctuation":t=>t>=8192&&t<=8303,"Letterlike Symbols":t=>t>=8448&&t<=8527,"Number Forms":t=>t>=8528&&t<=8591,"Miscellaneous Technical":t=>t>=8960&&t<=9215,"Control Pictures":t=>t>=9216&&t<=9279,"Optical Character Recognition":t=>t>=9280&&t<=9311,"Enclosed Alphanumerics":t=>t>=9312&&t<=9471,"Geometric Shapes":t=>t>=9632&&t<=9727,"Miscellaneous Symbols":t=>t>=9728&&t<=9983,"Miscellaneous Symbols and Arrows":t=>t>=11008&&t<=11263,"CJK Radicals Supplement":t=>t>=11904&&t<=12031,"Kangxi Radicals":t=>t>=12032&&t<=12255,"Ideographic Description Characters":t=>t>=12272&&t<=12287,"CJK Symbols and Punctuation":t=>t>=12288&&t<=12351,Hiragana:t=>t>=12352&&t<=12447,Katakana:t=>t>=12448&&t<=12543,Bopomofo:t=>t>=12544&&t<=12591,"Hangul Compatibility Jamo":t=>t>=12592&&t<=12687,Kanbun:t=>t>=12688&&t<=12703,"Bopomofo Extended":t=>t>=12704&&t<=12735,"CJK Strokes":t=>t>
8=12736&&t<=12783,"Katakana Phonetic Extensions":t=>t>=12784&&t<=12799,"Enclosed CJK Letters and Months":t=>t>=12800&&t<=13055,"CJK Compatibility":t=>t>=13056&&t<=13311,"CJK Unified Ideographs Extension A":t=>t>=13312&&t<=19903,"Yijing Hexagram Symbols":t=>t>=19904&&t<=19967,"CJK Unified Ideographs":t=>t>=19968&&t<=40959,"Yi Syllables":t=>t>=40960&&t<=42127,"Yi Radicals":t=>t>=42128&&t<=42191,"Hangul Jamo Extended-A":t=>t>=43360&&t<=43391,"Hangul Syllables":t=>t>=44032&&t<=55215,"Hangul Jamo Extended-B":t=>t>=55216&&t<=55295,"Private Use Area":t=>t>=57344&&t<=63743,"CJK Compatibility Ideographs":t=>t>=63744&&t<=64255,"Arabic Presentation Forms-A":t=>t>=64336&&t<=65023,"Vertical Forms":t=>t>=65040&&t<=65055,"CJK Compatibility Forms":t=>t>=65072&&t<=65103,"Small Form Variants":t=>t>=65104&&t<=65135,"Arabic Presentation Forms-B":t=>t>=65136&&t<=65279,"Halfwidth and Fullwidth Forms":t=>t>=65280&&t<=65519};function tc(t){for(const e of t)if(ic(e.charCodeAt(0)))return!0;return!1}function Xh(t){for(const e of t)if(!Lu(e.charCodeAt(0)))return!1;return!0}function Lu(t){return!(rt.Arabic(t)||rt["Arabic Supplement"](t)||rt["Arabic Extended-A"](t)||rt["Arabic Presentation Forms-A"](t)||rt["Arabic Presentation Forms-B"](t))}function ic(t){return!(t!==746&&t!==747&&(t<4352||!(rt["Bopomofo Extended"](t)||rt.Bopomofo(t)||rt["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||rt["CJK Compatibility Ideographs"](t)||rt["CJK Compatibility"](t)||rt["CJK Radicals Supplement"](t)||rt["CJK Strokes"](t)||!(!rt["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||t===12336)||rt["CJK Unified Ideographs Extension A"](t)||rt["CJK Unified Ideographs"](t)||rt["Enclosed CJK Letters and Months"](t)||rt["Hangul Compatibility Jamo"](t)||rt["Hangul Jamo Extended-A"](t)||rt["Hangul Jamo Extended-B"](t)||rt["Hangul Jamo"](t)||rt["Hangul Syllables"](t)||rt.Hiragana(t)||rt["Ideographic Description Characters"](t)||rt.Kanbun(t)||rt["Kangxi Radicals"](t)||rt["Katakana Phonetic Extensions"](t)||rt.Katakana(t)&&t!==12540||!(!rt["Halfwidth and Fullwidth Forms"](t)||t===65288||t===65289||t===65293||t>=65306&&t<=65310||t===65339||t===65341||t===65343||t>=65371&&t<=65503||t===65507||t>=65512&&t<=65519)||!(!rt["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||rt["Unified Canadian Aboriginal Syllabics"](t)||rt["Unified Canadian Aboriginal Syllabics Extended"](t)||rt["Vertical Forms"](t)||rt["Yijing Hexagram Symbols"](t)||rt["Yi Syllables"](t)||rt["Yi Radicals"](t))))}function Du(t){return!(ic(t)||function(e){return!!(rt["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||rt["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)||rt["Letterlike Symbols"](e)||rt["Number Forms"](e)||rt["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)||rt["Control Pictures"](e)&&e!==9251||rt["Optical Character Recognition"](e)||rt["Enclosed Alphanumerics"](e)||rt["Geometric Shapes"](e)||rt["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||rt["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||rt["CJK Symbols and Punctuation"](e)||rt.Katakana(e)||rt["Private Use Area"](e)||rt["CJK Compatibility Forms"](e)||rt["Small Form Variants"](e)||rt["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(t))}function Ru(t){return t>=1424&&t<=2303||rt["Arabic Presentation Forms-A"](t)||rt["Arabic Presentation Forms-B"](t)}function Hh(t,e){return!(!e&&Ru(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||rt.Khmer(t))}function Kh(t){for(const e of t)if(Ru(e.charCodeAt(0)))return!0;return!1}const nc="deferred",rc="loading",oc="loaded";let ss=null,l="unavailable",n=null;const s=function(t){t&&typeof t=="string"&&t.indexOf("NetworkError")>-1&&(l="error"),ss&&ss(t)};function u(){d.fire(new So("pluginStateChange",{pluginStatus:l,pluginURL:n}))}const d=new ws,f=function(){return l},g=function(){if(l!==nc||!n)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");l=rc,u(),n&&xr({url:n},t=>{t?s(t):(l=oc,u())})},y={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>l===oc||y.applyArabicShaping!=null,isLoading:()=>l===rc,setState(t){l=t.pluginStatus,n=t.pluginURL},isParsed:()=>y.applyArabicShaping!=null&&y.processBidirectionalText!=null&&y.processStyledBidirectionalText!=null,getPluginURL:()=>n};class w{constructor(e,i){this.zoom=e,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.transition=i.transition,this.pitch=i.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(e){return function(i,r){for(const a of i)if(!Hh(a.charCo
8deAt(0),r))return!1;return!0}(e,y.isLoaded())}}class M{constructor(e,i){this.property=e,this.value=i,this.expression=function(r,a){if(Us(r))return new Da(r,a);if(ts(r)){const c=Ns(r,a);if(c.result==="error")throw new Error(c.value.map(h=>`${h.key}: ${h.message}`).join(", "));return c.value}{let c=r;return typeof r=="string"&&a.type==="color"&&(c=Gi.parse(r)),{kind:"constant",evaluate:()=>c}}}(i===void 0?e.specification.default:i,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,i,r){return this.property.possiblyEvaluate(this,e,i,r)}}class I{constructor(e){this.property=e,this.value=new M(e,void 0)}transitioned(e,i){return new O(this.property,this.value,i,$t({},e.transition,this.transition),e.now)}untransitioned(){return new O(this.property,this.value,null,{},0)}}class P{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return _n(this._values[e].value.value)}setValue(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new I(this._values[e].property)),this._values[e].value=new M(this._values[e].property,i===null?void 0:_n(i))}getTransition(e){return _n(this._values[e].transition)}setTransition(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new I(this._values[e].property)),this._values[e].transition=_n(i)||void 0}serialize(){const e={};for(const i of Object.keys(this._values)){const r=this.getValue(i);r!==void 0&&(e[i]=r);const a=this.getTransition(i);a!==void 0&&(e[`${i}-transition`]=a)}return e}transitioned(e,i){const r=new N(this._properties);for(const a of Object.keys(this._values))r._values[a]=this._values[a].transitioned(e,i._values[a]);return r}untransitioned(){const e=new N(this._properties);for(const i of Object.keys(this._values))e._values[i]=this._values[i].untransitioned();return e}}class O{constructor(e,i,r,a,c){const h=a.delay||0,p=a.duration||0;c=c||0,this.property=e,this.value=i,this.begin=c+h,this.end=this.begin+p,e.specification.transition&&(a.delay||a.duration)&&(this.prior=r)}possiblyEvaluate(e,i,r){const a=e.now||0,c=this.value.possiblyEvaluate(e,i,r),h=this.prior;if(h){if(a>this.end)return this.prior=null,c;if(this.value.isDataDriven())return this.prior=null,c;if(a<this.begin)return h.possiblyEvaluate(e,i,r);{const p=(a-this.begin)/(this.end-this.begin);return this.property.interpolate(h.possiblyEvaluate(e,i,r),c,Ke(p))}}return c}}class N{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,i,r){const a=new q(this._properties);for(const c of Object.keys(this._values))a._values[c]=this._values[c].possiblyEvaluate(e,i,r);return a}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class G{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return _n(this._values[e].value)}setValue(e,i){this._values[e]=new M(this._values[e].property,i===null?void 0:_n(i))}serialize(){const e={};for(const i of Object.keys(this._values)){const r=this.getValue(i);r!==void 0&&(e[i]=r)}return e}possiblyEvaluate(e,i,r){const a=new q(this._properties);for(const c of Object.keys(this._values))a._values[c]=this._values[c].possiblyEvaluate(e,i,r);return a}}class j{constructor(e,i,r){this.property=e,this.value=i,this.parameters=r}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,i,r,a){return this.property.evaluate(this.value,this.parameters,e,i,r,a)}}class q{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class z{constructor(e){this.specification=e}possiblyEvaluate(e,i){return e.expression.evaluate(i)}interpolate(e,i,r){const a=Ls[this.specification.type];return a?a(e,i,r):e}}class V{constructor(e,i){this.specification=e,this.overrides=i}possiblyEvaluate(e,i,r,a){return new j(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(i,null,{},r,a)}:e.expression,i)}interpolate(e,i,r){if(e.value.kind!=="constant"||i.value.kind!=="constant")return e;if(e.value.value===void 0||i.value.value===void 0)return new j(this,{kind:"constant",value:void 0},e.parameters);const a=Ls[this.specification.type];return a?new j(this,{kind:"constant",value:a(e.value.value,i.value.value,r)},e.parameters):e}evaluate(e,i,r,a,c,h){return e.kind==="constant"?e.value:e.evaluate(i,r,a,c,h)}}class H{constructor(e){this.specification=e}
vendor: 17,818 bytes, line 8
8possiblyEvaluate(e,i,r,a){return!!e.expression.evaluate(i,null,{},r,a)}interpolate(){return!1}}class K{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const i=new w(0,{});for(const r in e){const a=e[r];a.specification.overridable&&this.overridableProperties.push(r);const c=this.defaultPropertyValues[r]=new M(a,void 0),h=this.defaultTransitionablePropertyValues[r]=new I(a);this.defaultTransitioningPropertyValues[r]=h.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=c.possiblyEvaluate(i)}}}function re(t,e){return 256*(t=St(Math.floor(t),0,255))+St(Math.floor(e),0,255)}ct(V,"DataDrivenProperty"),ct(z,"DataConstantProperty"),ct(H,"ColorRampProperty");const le={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class oe{constructor(e,i){this._structArray=e,this._pos1=i*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class fe{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,i){return e._trim(),i&&(e.isTransferred=!0,i.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const i=Object.create(this.prototype);return i.arrayBuffer=e.arrayBuffer,i.length=e.length,i.capacity=e.arrayBuffer.byteLength/i.bytesPerElement,i._refreshViews(),i}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function pe(t,e=1){let i=0,r=0;return{members:t.map(a=>{const c=le[a.type].BYTES_PER_ELEMENT,h=i=ve(i,Math.max(e,c)),p=a.components||1;return r=Math.max(r,c),i+=c*p,{name:a.name,type:a.type,components:p,offset:h}}),size:ve(i,Math.max(r,e)),alignment:e}}function ve(t,e){return Math.ceil(t/e)*e}class Ne extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i){const r=this.length;return this.resize(r+1),this.emplace(r,e,i)}emplace(e,i,r){const a=2*e;return this.int16[a+0]=i,this.int16[a+1]=r,e}}Ne.prototype.bytesPerElement=4,ct(Ne,"StructArrayLayout2i4");class ge extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,i,r)}emplace(e,i,r,a){const c=3*e;return this.int16[c+0]=i,this.int16[c+1]=r,this.int16[c+2]=a,e}}ge.prototype.bytesPerElement=6,ct(ge,"StructArrayLayout3i6");class Le extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,r,a)}emplace(e,i,r,a,c){const h=4*e;return this.int16[h+0]=i,this.int16[h+1]=r,this.int16[h+2]=a,this.int16[h+3]=c,e}}Le.prototype.bytesPerElement=8,ct(Le,"StructArrayLayout4i8");class Te extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,h,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,i,r,a,c,h,p)}emplace(e,i,r,a,c,h,p,m){const _=6*e,v=12*e,T=3*e;return this.int16[_+0]=i,this.int16[_+1]=r,this.uint8[v+4]=a,this.uint8[v+5]=c,this.uint8[v+6]=h,this.uint8[v+7]=p,this.float32[T+2]=m,e}}Te.prototype.bytesPerElement=12,ct(Te,"StructArrayLayout2i4ub1f12");class Ve extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,r,a)}emplace(e,i,r,a,c){const h=4*e;return this.float32[h+0]=i,this.float32[h+1]=r,this.float32[h+2]=a,this.float32[h+3]=c,e}}Ve.prototype.bytesPerElement=16,ct(Ve,"StructArrayLayout4f16");class xe extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c){const h=this.length;return this.resize(h+1),this.emplace(h,e,i,r,a,c)}emplace(e,i,r,a,c,h){const p=6*e,m=3*e;return this.uint16[p+0]=i,this.uint16[p+1]=r,this.uint16[p+2]=a,this.uint16[p+3]=c,this.float32[m+2]=h,e}}xe.prototype.bytesPerElement=12,ct(xe,"StructArrayLayout4ui1f12");class ze extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,r,a)}emplace(e,i,r,a,c){const h=4*e;return this.uint16[h+0]=i,this.uint16[h+1]=r,this.uint16[h+2]=a,this.uint16[h+3]=c,e}}ze.prototype.bytesPerElement=8,ct(ze,"StructArrayLayout4ui8");class Ge extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,h){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,r,a,c,h)}emplace(e,i,r,a,c,h,p){const m=6*e;return this.int16[m+0]=i,this.int16[m+1]=r,this.int16[m+2]=a,this.int16[m+3]=c,this.int16[m+4]=h,this.int16[m+5]=p,e}}Ge.prototype.bytesPerElement=12,ct(Ge,"StructArrayLayout6i12");class Fe extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,h,p,m,_,v,T,E){const A=this.length;return this.resize(A+1),this.emplace(A,e,i,r,a,c,h,p,m,_,v,T,E)}emplace(e,i,r,a,c,h,p,m,_,v,T,E,A){const C=12*e;return this.int16[C+0]=i,this.int16[C+1]=r,this.int16[C+2]=a,this.int16[C+3]=c,this.uint16[C+4]=h,this.uint16[C+5]=p,this.uint16[C+6]=m,this.uint16[C+7]=_,this.int16[C+8]=v,this.int16[C+9]=T,this.int16[C+10]=E,this.int16[C+11]=A,e}}Fe.prototype.bytesPerElement=24,ct(Fe,"StructArrayLayout4i4ui4i24");class qe extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,h){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,r,a,c,h)}emplace(e,i,r,a,c,h,p){const m=10*e,_=5*e;return this.int16[m+0]=i,this.int16[m+1]=r,this.int16[m+2]=a,this.float32[_+2]=c,this.float32[_+3]=h,this.float32[_+4]=p,e}}qe.prototype.bytesPerElement=20,ct(qe,"StructArrayLayout3i3f20");class pt extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint32[1*e+0]=i,e}}pt.prototype.bytesPerElement=4,ct(pt,"StructArrayLayout1ul4");class Pt extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,h,p,m,_,v,T,E,A){const C=this.length;return this.resize(C+1),this.emplace(C,e,i,r,a,c,h,p,m,_,v,T,E,A)}emplace(e,i,r,a,c,h,p,m,_,v,T,E,A,C){const L=20*e,F=10*e;return this.int16[L+0]=i,this.int16[L+1]=r,this.int16[L+2]=a,this.int16[L+3]=c,this.int16[L+4]=h,this.float32[F+3]=p,this.float32[F+4]=m,this.float32[F+5]=_,this.float32[F+6]=v,this.int16[L+14]=T,this.uint32[F+8]=E,this.uint16[L+18]=A,this.uint16[L+19]=C,e}}Pt.prototype.bytesPerElement=40,ct(Pt,"StructArrayLayout5i4f1i1ul2ui40");class ut extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,h,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,i,r,a,c,h,p)}emplace(e,i,r,a,c,h,p,m){const _=8*e;return this.int16[_+0]=i,this.int16[_+1]=r,this.int16[_+2]=a,this.int16[_+4]=c,this.int16[_+5]=h,this.int16[_+6]=p,this.int16[_+7]=m,e}}ut.prototype.bytesPerElement=16,ct(ut,"StructArrayLayout3i2i2i16");class wt extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c){const h=this.length;return this.resize(h+1),this.emplace(h,e,i,r,a,c)}emplace(e,i,r,a,c,h){const p=4*e,m=8*e;return this.float32[p+0]=i,this.float32[p+1]=r,this.float32[p+2]=a,this.int16[m+6]=c,this.int16[m+7]=h,e}}wt.prototype.bytesPerElement=16,ct(wt,"StructArrayLayout2f1f2i16");class Ht extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,r,a)}emplace(e,i,r,a,c){const h=12*e,p=3*e;return this.uint8[h+0]=i,this.uint8[h+1]=r,this.float32[p+1]=a,this.float32[p+2]=c,e}}Ht.prototype.bytesPerElement=12,ct(Ht,"StructArrayLayout2ub2f12");class Zt extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,i,r)}emplace(e,i,r,a){const c=3*e;return this.float32[c+0]=i,this.float32[c+1]=r,this.float32[c+2]=a,e}}Zt.prototype.bytesPerElement=12,ct(Zt,"StructArrayLayout3f12");class dt extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,i,r)}emplace(e,i,r,a){const c=3*e;return this.uint16[c+0]=i,this.uint16[c+1]=r,this.uint16[c+2]=a,e}}dt.prototype.bytesPerElement=6,ct(dt,"StructArrayLayout3ui6");class di extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,h,p,m,_,v,T,E,A,C,L,F,W,$,X,J,ie){const te=this.length;return this.resize(te+1),this.emplace(te,e,i,r,a,c,h,p,m,_,v,T,E,A,C,L,F,W,$,X,J,ie)}emplace(e,i,r,a,c,h,p,m,_,v,T,E,A,C,L,F,W,$,X,J,ie,te){const be=30*e,ye=15*e,ke=60*e;return this.int16[be+0]=i,this.int16[be+1]=r,this.int16[be+2]=a,this.float32[ye+2]=c,this.float32[ye+3]=h,this.uint16[be+8]=p,this.uint16[be+9]=m,this.uint32[ye+5]=_,this.uint32[ye+6]=v,this.uint32[ye+7]=T,this.uint16[be+16]=E,this.uint16[be+17]=A,this.uint16[be+18]=C,this.float32[ye+10]=L,this.float32[ye+11]=F,this.uint8[ke+48]=W,this.uint8[ke+49]=$,this.uint8[ke+50]=X,this.uint32[ye+13]=J,this.int16[be+28]=ie,this.uint8[ke+58]=te,e}}di.prototype.bytesPerElement=60,ct(di,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class fi extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,h,p,m,_,v,T,E,A,C,L,F,W,$,X,J,ie,te,be,ye,ke,je,Ee,Be,Oe,Ue){const Xe=this.length;return this.resize(Xe+1),this.emplace(Xe,e,i,r,a,c,h,p,m,_,v,T,E,A,C,L,F,W,$,X,J,ie,te,be,ye,ke,je,Ee,Be,Oe,Ue)}emplace(e,i,r,a,c,h,p,m,_,v,T,E,A,C,L,F,W,$,X,J,ie,te,be,ye,ke,je,Ee,Be,Oe,Ue,Xe){const Ae=38*e,et=19*e;return this.int16[Ae+0]=i,this.int16[Ae+1]=r,this.int16[Ae+2]=a,this.float32[et+2]=c,this.float32[et+3]=h,this.int16[Ae+8]=p,this.int16[Ae+9]=m,this.int16[Ae+10]=_,this.int16[Ae+11]=v,this.int16[Ae+12]=T,this.int16[Ae+13]=E,this.uint16[Ae+14]=A,this.uint16[Ae+15]=C,this.uint16[Ae+16]=L,this.uint16[Ae+17]=F,this.uint16[Ae+18]=W,this.uint16[Ae+19]=$,this.uint16[Ae+20]=X,this.uint16[Ae+21]=J,this.uint16[Ae+22]=ie,this.uint16[Ae+23]=te,this.uint16[Ae+24]=be,this.uint16[Ae+25]=ye,this.uint16[Ae+26]=ke,this.uint16[Ae+27]=je,this.uint16[Ae+28]=Ee,this.uint32[et+15]=Be,this.float32[et+16]=Oe,this.float32[et+17]=Ue,this.float32[et+18]=Xe,e}}fi.prototype.bytesPerElement=76,ct(fi,"StructArrayLayout3i2f6i15ui1ul3f76");class mi extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.float32[1*e+0]=i,e}}mi.prototype.bytesPerElement=4,ct(mi,"StructArrayLayout1f4");class _i extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c){const h=this.length;return this.resize(h+1),this.emplace(h,e,i,r,a,c)}emplace(e,i,r,a,c,h){const p=5*e;return this.float32[p+0]=i,this.float32[p+1]=r,this.float32[p+2]=a,this.float32[p+3]=c,this.float32[p+4]=h,e}}_i.prototype.bytesPerElement=20,ct(_i,"StructArrayLayout5f20");class Mn extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,r,a)}emplace(e,i,r,a,c){const h=6*e;return this.uint32[3*e+0]=i,this.uint16[h+2]=r,this.uint16[h+3]=a,this.uint16[h+4]=c,e}}Mn.prototype.bytesPerElement=12,ct(Mn,"StructArrayLayout1ul3ui12");class un extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i){const r=this.length;return this.resize(r+1),this.emplace(r,e,i)}emplace(e,i,r){const a=2*e;return this.uint16[a+0]=i,this.uint16[a+1]=r,e}}un.prototype.bytesPerElement=4,ct(un,"StructArrayLayout2ui4");class er extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint16[1*e+0]=i,e}}er.prototype.bytesPerElement=2,ct(er,"StructArrayLayout1ui2");class Er extends fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i){const r=this.length;return this.resize(r+1),this.emplace(r,e,i)}emplace(e,i,r){const a=2*e;return this.float32[a+0]=i,this.float32[a+1]=r,e}}Er.prototype.bytesPerElement=8,ct(Er,"StructArrayLayout2f8");class Li extends oe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}Li.prototype.size=40;class gi extends Pt{get(e){return new Li(this,e)}}ct(gi,"CollisionBoxArray");class li extends oe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}li.prototype.size=60;class Wi extends di{get(e){return new li(this,e)}}ct(Wi,"PlacedSymbolArray");class zn extends oe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}
vendor: 4,166 bytes, line 8
8get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(e){this._structArray.uint32[this._pos4+15]=e}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}zn.prototype.size=76;class Pi extends fi{get(e){return new zn(this,e)}}ct(Pi,"SymbolInstanceArray");class On extends mi{getoffsetX(e){return this.float32[1*e+0]}}ct(On,"GlyphOffsetArray");class Na extends Ne{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}ct(Na,"SymbolLineVertexArray");class Do extends oe{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Do.prototype.size=12;class Xs extends Mn{get(e){return new Do(this,e)}}ct(Xs,"FeatureIndexArray");class Wr extends un{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}ct(Wr,"FillExtrusionCentroidArray");const lo=pe([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Ro=pe([{name:"a_dash",components:4,type:"Uint16"}]);var ja={exports:{}},Hs={exports:{}};Hs.exports=function(t,e){var i,r,a,c,h,p,m,_;for(r=t.length-(i=3&t.length),a=e,h=3432918353,p=461845907,_=0;_<r;)m=255&t.charCodeAt(_)|(255&t.charCodeAt(++_))<<8|(255&t.charCodeAt(++_))<<16|(255&t.charCodeAt(++_))<<24,++_,a=27492+(65535&(c=5*(65535&(a=(a^=m=(65535&(m=(m=(65535&m)*h+(((m>>>16)*h&65535)<<16)&4294967295)<<15|m>>>17))*p+(((m>>>16)*p&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(c>>>16)&65535)<<16);switch(m=0,i){case 3:m^=(255&t.charCodeAt(_+2))<<16;case 2:m^=(255&t.charCodeAt(_+1))<<8;case 1:a^=m=(65535&(m=(m=(65535&(m^=255&t.charCodeAt(_)))*h+(((m>>>16)*h&65535)<<16)&4294967295)<<15|m>>>17))*p+(((m>>>16)*p&65535)<<16)&4294967295}return a^=t.length,a=2246822507*(65535&(a^=a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295,(a^=a>>>16)>>>0};var sc=Hs.exports,hf={exports:{}};hf.exports=function(t,e){for(var i,r=t.length,a=e^r,c=0;r>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24))+((1540483477*(i>>>16)&65535)<<16),a=1540483477*(65535&a)+((1540483477*(a>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),r-=4,++c;switch(r){case 3:a^=(255&t.charCodeAt(c+2))<<16;case 2:a^=(255&t.charCodeAt(c+1))<<8;
8case 1:a=1540483477*(65535&(a^=255&t.charCodeAt(c)))+((1540483477*(a>>>16)&65535)<<16)}return a=1540483477*(65535&(a^=a>>>13))+((1540483477*(a>>>16)&65535)<<16),(a^=a>>>15)>>>0};var df=sc,Jg=hf.exports;ja.exports=df,ja.exports.murmur3=df,ja.exports.murmur2=Jg;var Yh=lt(ja.exports);class Bu{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,i,r,a){this.ids.push(pf(e)),this.positions.push(i,r,a)}getPositions(e){const i=pf(e);let r=0,a=this.ids.length-1;for(;r<a;){const h=r+a>>1;this.ids[h]>=i?a=h:r=h+1}const c=[];for(;this.ids[r]===i;)c.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return c}static serialize(e,i){const r=new Float64Array(e.ids),a=new Uint32Array(e.positions);return Jh(r,a,0,r.length-1),i&&i.push(r.buffer,a.buffer),{ids:r,positions:a}}static deserialize(e){const i=new Bu;return i.ids=e.ids,i.positions=e.positions,i.indexed=!0,i}}function pf(t){const e=+t;return!isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:Yh(String(t))}function Jh(t,e,i,r){for(;i<r;){const a=t[i+r>>1];let c=i-1,h=r+1;for(;;){do c++;while(t[c]<a);do h--;while(t[h]>a);if(c>=h)break;Ou(t,c,h),Ou(e,3*c,3*h),Ou(e,3*c+1,3*h+1),Ou(e,3*c+2,3*h+2)}h-i<r-h?(Jh(t,e,i,h),i=h+1):(Jh(t,e,h+1,r),r=h)}}function Ou(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}ct(Bu,"FeaturePositionMap");class Bo{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,i){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,i),this.initialized=!0),!!this.location}}class Fu extends Bo{constructor(e){super(e),this.current=0}set(e,i,r){this.fetchUniformLocation(e,i)&&this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))}}class ff extends Bo{constructor(e){super(e),this.current=[0,0,0,0]}set(e,i,r){this.fetchUniformLocation(e,i)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3])))}}class mf extends Bo{constructor(e){super(e),this.current=Gi.transparent}set(e,i,r){this.fetchUniformLocation(e,i)&&(r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a)))}}const Qg=new Float32Array(16),$g=new Float32Array(9),ey=new Float32Array(4);function Qh(t){return[re(255*t.r,255*t.g),re(255*t.b,255*t.a)]}class ac{constructor(e,i,r){this.value=e,this.uniformNames=i.map(a=>`u_${a}`),this.type=r}setUniform(e,i,r,a,c){i.set(e,c,a.constantOr(this.value))}getBinding(e,i){return this.type==="color"?new mf(e):new Fu(e)}}class Ga{constructor(e,i){this.uniformNames=i.map(r=>`u_${r}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,i,r,a,c){const h=c==="u_pattern"||c==="u_dash"?this.pattern:c==="u_pixel_ratio"?this.pixelRatio:null;h&&i.set(e,c,h)}getBinding(e,i){return i==="u_pattern"||i==="u_dash"?new ff(e):new Fu(e)}}class Oo{constructor(e,i,r,a){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=i.map(c=>({name:`a_${c}`,type:"Float32",components:r==="color"?2:1,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,i,r,a,c,h){const p=this.paintVertexArray.length,m=this.expression.evaluate(new w(0),i,{},c,a,h);this.paintVertexArray.resize(e),this._setPaintValue(p,e,m)}updatePaintArray(e,i,r,a,c){const h=this.expression.evaluate({zoom:0},r,a,void 0,c);this._setPaintValue(e,i,h)}_setPaintValue(e,i,r){if(this.type==="color"){const a=Qh(r);for(let c=e;c<i;c++)this.paintVertexArray.emplace(c,a[0],a[1])}else{for(let a=e;a<i;a++)this.paintVertexArray.emplace(a,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Xr{constructor(e,i,r,a,c,h){this.expression=e,this.uniformNames=i.map(p=>`u_${p}_t`),this.type=r,this.useIntegerZoom=a,this.zoom=c,this.maxValue=0,this.paintVertexAttributes=i.map(p=>({name:`a_${p}
8`,type:"Float32",components:r==="color"?4:2,offset:0})),this.paintVertexArray=new h}populatePaintArray(e,i,r,a,c,h){const p=this.expression.evaluate(new w(this.zoom),i,{},c,a,h),m=this.expression.evaluate(new w(this.zoom+1),i,{},c,a,h),_=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(_,e,p,m)}updatePaintArray(e,i,r,a,c){const h=this.expression.evaluate({zoom:this.zoom},r,a,void 0,c),p=this.expression.evaluate({zoom:this.zoom+1},r,a,void 0,c);this._setPaintValue(e,i,h,p)}_setPaintValue(e,i,r,a){if(this.type==="color"){const c=Qh(r),h=Qh(a);for(let p=e;p<i;p++)this.paintVertexArray.emplace(p,c[0],c[1],h[0],h[1])}else{for(let c=e;c<i;c++)this.paintVertexArray.emplace(c,r,a);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(a))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,i,r,a,c){const h=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,p=St(this.expression.interpolationFactor(h,this.zoom,this.zoom+1),0,1);i.set(e,c,p)}getBinding(e,i){return new Fu(e)}}class as{constructor(e,i,r,a,c){this.expression=e,this.layerId=c,this.paintVertexAttributes=(r==="array"?Ro:lo).members;for(let h=0;h<i.length;++h);this.paintVertexArray=new a}populatePaintArray(e,i,r){const a=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(a,e,i.patterns&&i.patterns[this.layerId],r)}updatePaintArray(e,i,r,a,c,h){this._setPaintValues(e,i,r.patterns&&r.patterns[this.layerId],h)}_setPaintValues(e,i,r,a){if(!a||!r)return;const c=a[r];if(!c)return;const{tl:h,br:p,pixelRatio:m}=c;for(let _=e;_<i;_++)this.paintVertexArray.emplace(_,h[0],h[1],p[0],p[1],m)}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class ls{constructor(e,i,r=()=>!0){this.binders={},this._buffers=[];const a=[];for(const c in e.paint._values){if(!r(c))continue;const h=e.paint.get(c);if(!(h instanceof j&&$o(h.property.specification)))continue;const p=iy(c,e.type),m=h.value,_=h.property.specification.type,v=!!h.property.useIntegerZoom,T=c==="line-dasharray"||c.endsWith("pattern"),E=c==="line-dasharray"&&e.layout.get("line-cap").value.kind!=="constant";if(m.kind!=="constant"||E)if(m.kind==="source"||E||T){const A=_f(c,_,"source");this.binders[c]=T?new as(m,p,_,A,e.id):new Oo(m,p,_,A),a.push(`/a_${c}`)}else{const A=_f(c,_,"composite");this.binders[c]=new Xr(m,p,_,v,i,A),a.push(`/z_${c}`)}else this.binders[c]=T?new Ga(m.value,p):new ac(m.value,p,_),a.push(`/u_${c}`)}this.cacheKey=a.sort().join("")}getMaxValue(e){const i=this.binders[e];return i instanceof Oo||i instanceof Xr?i.maxValue:0}populatePaintArrays(e,i,r,a,c,h){for(const p in this.binders){const m=this.binders[p];(m instanceof Oo||m instanceof Xr||m instanceof as)&&m.populatePaintArray(e,i,r,a,c,h)}}setConstantPatternPositions(e){for(const i in this.binders){const r=this.binders[i];r instanceof Ga&&r.setConstantPatternPositions(e)}}updatePaintArrays(e,i,r,a,c,h){let p=!1;for(const m in e){const _=i.getPositions(m);for(const v of _){const T=r.feature(v.index);for(const E in this.binders){const A=this.binders[E];if((A instanceof Oo||A instanceof Xr||A instanceof as)&&A.expression.isStateDependent===!0){const C=a.paint.get(E);A.expression=C.value,A.updatePaintArray(v.start,v.end,T,e[m],c,h),p=!0}}}}return p}defines(){const e=[];for(const i in this.binders){const r=this.binders[i];(r instanceof ac||r instanceof Ga)&&e.push(...r.uniformNames.map(a=>`#define HAS_UNIFORM_${a}`))}return e}getBinderAttributes(){const e=[];for(const i in this.binders){const r=this.binders[i];if(r instanceof Oo||r instanceof Xr||r instanceof as)for(let a=0;a<r.paintVertexAttributes.length;
8a++)e.push(r.paintVertexAttributes[a].name)}return e}getBinderUniforms(){const e=[];for(const i in this.binders){const r=this.binders[i];if(r instanceof ac||r instanceof Ga||r instanceof Xr)for(const a of r.uniformNames)e.push(a)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const i=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof ac||a instanceof Ga||a instanceof Xr)for(const c of a.uniformNames)i.push({name:c,property:r,binding:a.getBinding(e,c)})}return i}setUniforms(e,i,r,a,c){for(const{name:h,property:p,binding:m}of r)this.binders[p].setUniform(e,m,c,a.get(p),h)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const i=this.binders[e];(i instanceof Oo||i instanceof Xr||i instanceof as)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}}upload(e){for(const i in this.binders){const r=this.binders[i];(r instanceof Oo||r instanceof Xr||r instanceof as)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const i=this.binders[e];(i instanceof Oo||i instanceof Xr||i instanceof as)&&i.destroy()}}}class Ks{constructor(e,i,r=()=>!0){this.programConfigurations={};for(const a of e)this.programConfigurations[a.id]=new ls(a,i,r);this.needsUpload=!1,this._featureMap=new Bu,this._bufferOffset=0}populatePaintArrays(e,i,r,a,c,h,p){for(const m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(e,i,a,c,h,p);i.id!==void 0&&this._featureMap.add(i.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,i,r,a,c){for(const h of r)this.needsUpload=this.programConfigurations[h.id].updatePaintArrays(e,this._featureMap,i,h,a,c)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const ty={"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","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function iy(t,e){return ty[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}const ny={"line-pattern":{source:xe,composite:xe},"fill-pattern":{source:xe,composite:xe},"fill-extrusion-pattern":{source:xe,composite:xe},"line-dasharray":{source:ze,composite:ze}},ry={color:{source:Er,composite:Ve},number:{source:mi,composite:Er}};function _f(t,e,i){const r=ny[t];return r&&r[i]||ry[e][i]}ct(ac,"ConstantBinder"),ct(Ga,"PatternConstantBinder"),ct(Oo,"SourceExpressionBinder"),ct(as,"PatternCompositeBinder"),ct(Xr,"CompositeExpressionBinder"),ct(ls,"ProgramConfiguration",{omit:["_buffers"]}),ct(Ks,"ProgramConfigurationSet");const gf="-transition";class Hr extends ws{constructor(e,i){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&e.type!=="sky"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),i.layout&&(this._unevaluatedLayout=new G(i.layout)),i.paint)){this._transitionablePaint=new P(i.paint);for(const r in e.paint)this.setPaintProperty(r,e.paint[r],{validate:!1});for(const r in e.layout)this.setLayoutProperty(r,e.layout[r],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new q(i.paint)}}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,i,r={}){i!=null&&this._validate(qh,`layers.${this.id}.layout.${e}`,e,i,r)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,i):this.visibility=i)}getPaintProperty(e){return en(e,gf)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,i,r={}
8){if(i!=null&&this._validate(Zh,`layers.${this.id}.paint.${e}`,e,i,r))return!1;if(en(e,gf))return this._transitionablePaint.setTransition(e.slice(0,-11),i||void 0),!1;{const a=this._transitionablePaint._values[e],c=a.value.isDataDriven(),h=a.value;this._transitionablePaint.setValue(e,i),this._handleSpecialPaintPropertyUpdate(e);const p=this._transitionablePaint._values[e].value,m=p.isDataDriven(),_=en(e,"pattern")||e==="line-dasharray";return m||c||_||this._handleOverridablePaintPropertyUpdate(e,h,p)}}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getProgramConfiguration(e){return null}_handleOverridablePaintPropertyUpdate(e,i,r){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,i){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,i)}
vendor: 11,380 bytes, line 8
8serialize(){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),gr(e,(i,r)=>!(i===void 0||r==="layout"&&!Object.keys(i).length||r==="paint"&&!Object.keys(i).length))}_validate(e,i,r,a,c={}){return(!c||c.validate!==!1)&&zu(this,e.call(Pu,{key:i,layerType:this.type,objectKey:r,value:a,styleSpec:Ce,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const i=this.paint.get(e);if(i instanceof j&&$o(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=Oa(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const oy=pe([{name:"a_pos",components:2,type:"Int16"}],4),sy=pe([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class Xi{constructor(e=[]){this.segments=e}prepareSegment(e,i,r,a){let c=this.segments[this.segments.length-1];return e>Xi.MAX_VERTEX_ARRAY_LENGTH&&wi(`Max vertices per segment is ${Xi.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!c||c.vertexLength+e>Xi.MAX_VERTEX_ARRAY_LENGTH||c.sortKey!==a)&&(c={vertexOffset:i.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},a!==void 0&&(c.sortKey=a),this.segments.push(c)),c}get(){return this.segments}destroy(){for(const e of this.segments)for(const i in e.vaos)e.vaos[i].destroy()}static simpleSegment(e,i,r,a){return new Xi([{vertexOffset:e,primitiveOffset:i,vertexLength:r,primitiveLength:a,vaos:{},sortKey:0}])}}Xi.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ct(Xi,"SegmentVector");var xt=8192;class cs{constructor(e,i){e&&(i?this.setSouthWest(e).setNorthEast(i):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof yi?new yi(e.lng,e.lat):yi.convert(e),this}setSouthWest(e){return this._sw=e instanceof yi?new yi(e.lng,e.lat):yi.convert(e),this}extend(e){const i=this._sw,r=this._ne;let a,c;if(e instanceof yi)a=e,c=e;else{if(!(e instanceof cs))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(cs.convert(e)):this.extend(yi.convert(e)):typeof e=="object"&&e!==null&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(yi.convert(e)):this;if(a=e._sw,c=e._ne,!a||!c)return this}return i||r?(i.lng=Math.min(a.lng,i.lng),i.lat=Math.min(a.lat,i.lat),r.lng=Math.max(c.lng,r.lng),r.lat=Math.max(c.lat,r.lat)):(this._sw=new yi(a.lng,a.lat),this._ne=new yi(c.lng,c.lat)),this}getCenter(){return new yi((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 yi(this.getWest(),this.getNorth())}getSouthEast(){return new yi(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:i,lat:r}=yi.convert(e);let a=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&a}static convert(e){return!e||e instanceof cs?e:new cs(e)}}var Uu=1e-6,tr=typeof Float32Array<"u"?Float32Array:Array;function yf(){var t=new tr(9);return tr!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function xf(t,e,i){var r=e[0],a=e[1],c=e[2],h=e[3],p=e[4],m=e[5],_=e[6],v=e[7],T=e[8],E=i[0],A=i[1],C=i[2],L=i[3],F=i[4],W=i[5],$=i[6],X=i[7],J=i[8];return t[0]=E*r+A*h+C*_,t[1]=E*a+A*p+C*v,t[2]=E*c+A*m+C*T,t[3]=L*r+F*h+W*_,t[4]=L*a+F*p+W*v,t[5]=L*c+F*m+W*T,t[6]=$*r+X*h+J*_,t[7]=$*a+X*p+J*v,t[8]=$*c+X*m+J*T,t}function Kr(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function $h(t,e){var i=e[0],r=e[1],a=e[2],c=e[3],h=e[4],p=e[5],m=e[6],_=e[7],v=e[8],T=e[9],E=e[10],A=e[11],C=e[12],L=e[13],F=e[14],W=e[15],$=i*p-r*h,X=i*m-a*h,J=i*_-c*h,ie=r*m-a*p,te=r*_-c*p,be=a*_-c*m,ye=v*L-T*C,ke=v*F-E*C,je=v*W-A*C,Ee=T*F-E*L,Be=T*W-A*L,Oe=E*W-A*F,Ue=$*Oe-X*Be+J*Ee+ie*je-te*ke+be*ye;return Ue?(t[0]=(p*Oe-m*Be+_*Ee)*(Ue=1/Ue),t[1]=(a*Be-r*Oe-c*Ee)*Ue,t[2]=(L*be-F*te+W*ie)*Ue,t[3]=(E*te-T*be-A*ie)*Ue,t[4]=(m*je-h*Oe-_*ke)*Ue,t[5]=(i*Oe-a*je+c*ke)*Ue,t[6]=(F*J-C*be-W*X)*Ue,t[7]=(v*be-E*J+A*X)*Ue,t[8]=(h*Be-p*je+_*ye)*Ue,t[9]=(r*je-i*Be-c*ye)*Ue,t[10]=(C*te-L*J+W*$)*Ue,t[11]=(T*J-v*te-A*$)*Ue,t[12]=(p*ke-h*Ee-m*ye)*Ue,t[13]=(i*Ee-r*ke+a*ye)*Ue,t[14]=(L*X-C*ie-F*$)*Ue,t[15]=(v*ie-T*X+E*$)*Ue,t):null}function Ys(t,e,i){var r=e[0],a=e[1],c=e[2],h=e[3],p=e[4],m=e[5],_=e[6],v=e[7],T=e[8],E=e[9],A=e[10],C=e[11],L=e[12],F=e[13],W=e[14],$=e[15],X=i[0],J=i[1],ie=i[2],te=i[3];return t[0]=X*r+J*p+ie*T+te*L,t[1]=X*a+J*m+ie*E+te*F,t[2]=X*c+J*_+ie*A+te*W,t[3]=X*h+J*v+ie*C+te*$,t[4]=(X=i[4])*r+(J=i[5])*p+(ie=i[6])*T+(te=i[7])*L,t[5]=X*a+J*m+ie*E+te*F,t[6]=X*c+J*_+ie*A+te*W,t[7]=X*h+J*v+ie*C+te*$,t[8]=(X=i[8])*r+(J=i[9])*p+(ie=i[10])*T+(te=i[11])*L,t[9]=X*a+J*m+ie*E+te*F,t[10]=X*c+J*_+ie*A+te*W,t[11]=X*h+J*v+ie*C+te*$,t[12]=(X=i[12])*r+(J=i[13])*p+(ie=i[14])*T+(te=i[15])*L,t[13]=X*a+J*m+ie*E+te*F,t[14]=X*c+J*_+ie*A+te*W,t[15]=X*h+J*v+ie*C+te*$,t}function lc(t,e,i){var r,a,c,h,p,m,_,v,T,E,A,C,L=i[0],F=i[1],W=i[2];return e===t?(t[12]=e[0]*L+e[4]*F+e[8]*W+e[12],t[13]=e[1]*L+e[5]*F+e[9]*W+e[13],t[14]=e[2]*L+e[6]*F+e[10]*W+e[14],t[15]=e[3]*L+e[7]*F+e[11]*W+e[15]):(a=e[1],c=e[2],h=e[3],p=e[4],m=e[5],_=e[6],v=e[7],T=e[8],E=e[9],A=e[10],C=e[11],t[0]=r=e[0],t[1]=a,t[2]=c,t[3]=h,t[4]=p,t[5]=m,t[6]=_,t[7]=v,t[8]=T,t[9]=E,t[10]=A,t[11]=C,t[12]=r*L+p*F+T*W+e[12],t[13]=a*L+m*F+E*W+e[13],t[14]=c*L+_*F+A*W+e[14],t[15]=h*L+v*F+C*W+e[15]),t}function Js(t,e,i){var r=i[0],a=i[1],c=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*c,t[9]=e[9]*c,t[10]=e[10]*c,t[11]=e[11]*c,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ed(t,e,i){var r=Math.sin(i),a=Math.cos(i),c=e[4],h=e[5],p=e[6],m=e[7],_=e[8],v=e[9],T=e[10],E=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=c*a+_*r,t[5]=h*a+v*r,t[6]=p*a+T*r,t[7]=m*a+E*r,t[8]=_*a-c*r,t[9]=v*a-h*r,t[10]=T*a-p*r,t[11]=E*a-m*r,t}function Vu(t,e,i){var r=Math.sin(i),a=Math.cos(i),c=e[0],h=e[1],p=e[2],m=e[3],_=e[8],v=e[9],T=e[10],E=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=c*a-_*r,t[1]=h*a-v*r,t[2]=p*a-T*r,t[3]=m*a-E*r,t[8]=c*r+_*a,t[9]=h*r+v*a,t[10]=p*r+T*a,t[11]=m*r+E*a,t}function vf(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function bf(t,e,i){var r,a,c,h=i[0],p=i[1],m=i[2],_=Math.hypot(h,p,m);return _<Uu?null:(h*=_=1/_,p*=_,m*=_,r=Math.sin(e),a=Math.cos(e),t[0]=h*h*(c=1-a)+a,t[1]=p*h*c+m*r,t[2]=m*h*c-p*r,t[3]=0,t[4]=h*p*c-m*r,t[5]=p*p*c+a,t[6]=m*p*c+h*r,t[7]=0,t[8]=h*m*c+p*r,t[9]=p*m*c-h*r,t[10]=m*m*c+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var ay=Ys;function td(){var t=new tr(3);return tr!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function wf(t){var e=new tr(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function cc(t){return Math.hypot(t[0],t[1],t[2])}function Za(t,e,i){var r=new tr(3);return r[0]=t,r[1]=e,r[2]=i,r}function Fo(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function id(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function Tf(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t}function uc(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t}function hc(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t}function dr(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function dc(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t}function Fn(t,e){var i=e[0],r=e[1],a=e[2],c=i*i+r*r+a*a;return c>0&&(c=1/Math.sqrt(c)),t[0]=e[0]*c,t[1]=e[1]*c,t[2]=e[2]*c,t}function Sr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function nd(t,e,i){var r=e[0],a=e[1],c=e[2],h=i[0],p=i[1],m=i[2];return t[0]=a*m-c*p,t[1]=c*h-r*m,t[2]=r*p-a*h,t}function Zi(t,e,i){var r=e[0],a=e[1],c=e[2],h=i[3]*r+i[7]*a+i[11]*c+i[15];return t[0]=(i[0]*r+i[4]*a+i[8]*c+i[12])/(h=h||1),t[1]=(i[1]*r+i[5]*a+i[9]*c+i[13])/h,t[2]=(i[2]*r+i[6]*a+i[10]*c+i[14])/h,t}function Ef(t,e,i){var r=i[0],a=i[1],c=i[2],h=e[0],p=e[1],m=e[2],_=a*m-c*p,v=c*h-r*m,T=r*p-a*h,E=a*T-c*v,A=c*_-r*T,C=r*v-a*_,L=2*i[3];return v*=L,T*=L,A*=2,C*=2,t[0]=h+(_*=L)+(E*=2),t[1]=p+v+A,t[2]=m+T+C,t}var pc,Yr=id,ly=Tf,cy=cc;function Sf(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function If(t,e){var i=e[0],r=e[1],a=e[2],c=e[3],h=i*i+r*r+a*a+c*c;return h>0&&(h=1/Math.sqrt(h)),t[0]=i*h,t[1]=r*h,t[2]=a*h,t[3]=c*h,t}function Qs(t,e,i){var r=e[0],a=e[1],c=e[2],h=e[3];return t[0]=i[0]*r+i[4]*a+i[8]*c+i[12]*h,t[1]=i[1]*r+i[5]*a+i[9]*c+i[13]*h,t[2]=i[2]*r+i[6]*a+i[10]*c+i[14]*h,t[3]=i[3]*r+i[7]*a+i[11]*c+i[15]*h,t}function Mf(){var t=new tr(4);return tr!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Af(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Cf(t,e,i){i*=.5;var r=e[0],a=e[1],c=e[2],h=e[3],p=Math.sin(i),m=Math.cos(i);return t[0]=r*m+h*p,t[1]=a*m+c*p,t[2]=c*m-a*p,t[3]=h*m-r*p,t}function kf(t,e,i){i*=.5;var r=e[0],a=e[1],c=e[2],h=e[3],p=Math.sin(i),m=Math.cos(i);return t[0]=r*m-c*p,t[1]=a*m+h*p,t[2]=c*m+r*p,t[3]=h*m-a*p,t}td(),pc=new tr(4),tr!=Float32Array&&(pc[0]=0,pc[1]=0,pc[2]=0,pc[3]=0);var uy=If;td(),Za(1,0,0),Za(0,1,0),Mf(),Mf(),yf();const hy=pe([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Pf}=hy,zf=pe([{name:"a_pos_3",components:3,type:"Int16"}]);var fc=pe([{name:"a_pos",type:"Int16",components:2}]);class rd{constructor(e,i){this.pos=e,this.dir=i}intersectsPlane(e,i,r){const a=Sr(i,this.dir);if(Math.abs(a)<1e-6)return!1;const c=((e[0]-this.pos[0])*i[0]+(e[1]-this.pos[1])*i[1]+(e[2]-this.pos[2])*i[2])/a;return r[0]=this.pos[0]+this.dir[0]*c,r[1]=this.pos[1]+this.dir[1]*c,r[2]=this.pos[2]+this.dir[2]*c,!0}closestPointOnSphere(e,i,r){if(function(A,C){var L=A[0],F=A[1],W=A[2],$=C[0],X=C[1],J=C[2];return Math.abs(L-$)<=Uu*Math.max(1,Math.abs(L),Math.abs($))&&Math.abs(F-X)<=Uu*Math.max(1,Math.abs(F),Math.abs(X))&&Math.abs(W-J)<=Uu*Math.max(1,Math.abs(W),Math.abs(J))}(this.pos,e)||i===0)return r[0]=r[1]=r[2]=0,!1;const[a,c,h]=this.dir,p=this.pos[0]-e[0],m=this.pos[1]-e[1],_=this.pos[2]-e[2],v=a*
vendor: 7,852 bytes, line 8
8a+c*c+h*h,T=2*(p*a+m*c+_*h),E=T*T-4*v*(p*p+m*m+_*_-i*i);if(E<0){const A=Math.max(-T/2,0),C=p+a*A,L=m+c*A,F=_+h*A,W=Math.hypot(C,L,F);return r[0]=C*i/W,r[1]=L*i/W,r[2]=F*i/W,!1}{const A=(-T-Math.sqrt(E))/(2*v);if(A<0){const C=Math.hypot(p,m,_);return r[0]=p*i/C,r[1]=m*i/C,r[2]=_*i/C,!1}return r[0]=p+a*A,r[1]=m+c*A,r[2]=_+h*A,!0}}}class od{constructor(e,i,r,a,c){this.TL=e,this.TR=i,this.BR=r,this.BL=a,this.horizon=c}static fromInvProjectionMatrix(e,i,r){const a=[-1,1,1],c=[1,1,1],h=[1,-1,1],p=[-1,-1,1],m=Zi(a,a,e),_=Zi(c,c,e),v=Zi(h,h,e),T=Zi(p,p,e);return new od(m,_,v,T,i/r)}}class sd{constructor(e,i){this.points=e,this.planes=i}static fromInvProjectionMatrix(e,i,r,a){const c=Math.pow(2,r),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(m=>{const _=Qs([],m,e),v=1/_[3]/i*c;return function(T,E,A){return T[0]=E[0]*A[0],T[1]=E[1]*A[1],T[2]=E[2]*A[2],T[3]=E[3]*A[3],T}(_,_,[v,v,a?1/_[3]:v,v])}),p=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(m=>{const _=Fn([],nd([],Yr([],h[m[0]],h[m[1]]),Yr([],h[m[2]],h[m[1]]))),v=-Sr(_,h[m[1]]);return _.concat(v)});return new sd(h,p)}}class Un{static fromPoints(e){const i=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0];for(const a of e)uc(i,i,a),hc(r,r,a);return new Un(i,r)}static applyTransform(e,i){const r=e.getCorners();for(let a=0;a<r.length;++a)Zi(r[a],r[a],i);return Un.fromPoints(r)}constructor(e,i){this.min=e,this.max=i,this.center=dr([],Fo([],this.min,this.max),.5)}quadrant(e){const i=[e%2==0,e<2],r=wf(this.min),a=wf(this.max);for(let c=0;c<i.length;c++)r[c]=i[c]?this.min[c]:this.center[c],a[c]=i[c]?this.center[c]:this.max[c];return a[2]=this.max[2],new Un(r,a)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,i=this.max;return[[e[0],e[1],e[2]],[i[0],e[1],e[2]],[i[0],i[1],e[2]],[e[0],i[1],e[2]],[e[0],e[1],i[2]],[i[0],e[1],i[2]],[i[0],i[1],i[2]],[e[0],i[1],i[2]]]}intersects(e){const i=this.getCorners();let r=!0;for(let a=0;a<e.planes.length;a++){const c=e.planes[a];let h=0;for(let p=0;p<i.length;p++)h+=Sr(c,i[p])+c[3]>=0;if(h===0)return 0;h!==i.length&&(r=!1)}if(r)return 2;for(let a=0;a<3;a++){let c=Number.MAX_VALUE,h=-Number.MAX_VALUE;for(let p=0;p<e.points.length;p++){const m=e.points[p][a]-this.min[a];c=Math.min(c,m),h=Math.max(h,m)}if(h<0||c>this.max[a]-this.min[a])return 0}return 1}}const ad=5,Lf=6,co=xt/Math.PI/2,dy=16383,$s=64,mc=[$s,32,16],Ir=-co,Mr=co,py=[new Un([Ir,Ir,Ir],[Mr,Mr,Mr]),new Un([Ir,Ir,Ir],[0,0,Mr]),new Un([0,Ir,Ir],[Mr,0,Mr]),new Un([Ir,0,Ir],[0,Mr,Mr]),new Un([0,0,Ir],[Mr,Mr,Mr])];function Nu(t){return t*co/yc}function Df(t,e,i,r=!0){const a=dr([],t._camera.position,t.worldSize),c=[e,i,1,1];Qs(c,c,t.pixelMatrixInverse),Sf(c,c,1/c[3]);const h=Fn([],Yr([],c,a)),p=t.globeMatrix,m=[p[12],p[13],p[14]],_=Yr([],m,a),v=cc(_),T=Fn([],_),E=t.worldSize/(2*Math.PI),A=Sr(T,h),C=Math.asin(E/v);if(C<Math.acos(A)){if(!r)return null;const je=[],Ee=[];dr(je,h,v/A),Fn(Ee,Yr(Ee,je,_)),Fn(h,Fo(h,_,dr(h,Ee,Math.tan(C)*v)))}const L=[];new rd(a,h).closestPointOnSphere(m,E,L);const F=Fn([],Kn(p,0)),W=Fn([],Kn(p,1)),$=Fn([],Kn(p,2)),X=Sr(F,L),J=Sr(W,L),ie=Sr($,L),te=Ct(Math.asin(-J/E));let be=Ct(Math.atan2(X,ie));be=t.center.lng+function(je,Ee){const Be=(Ee-je+180)%360-180;return Be<-180?Be+360:Be}(t.center.lng,be);const ye=ho(be),ke=St(po(te),0,1);return new Ha(ye,ke)}class fy{constructor(e,i,r){this.a=Yr([],e,r),this.b=Yr([],i,r),this.center=r;const a=Fn([],this.a),c=Fn([],this.b);this.angle=Math.acos(Sr(a,c))}}function ld(t,e){if(t.angle===0)return null;let i;return i=t.a[e]===0?1/t.angle*.5*Math.PI:1/t.angle*Math.atan(t.b[e]/t.a[e]/Math.sin(t.angle)-1/Math.tan(t.angle)),i<0||i>1?null:function(r,a,c,h){const p=Math.sin(c);return r*(Math.sin((1-h)*c)/p)+a*(Math.sin(h*c)/p)}(t.a[e],t.b[e],t.angle,St(i,0,1))+t.center[e]}function uo(t){if(t.z<=1)return py[t.z+2*t.y+t.x];const e=cd(ju(t));return Un.fromPoints(e)}function ea(t,e,i){return dr(t,t,1-i),dc(t,t,e,i)}function Rf(t,e){const i=Xa(e.zoom);if(i===0)return uo(t);const r=ju(t),a=cd(r),c=ho(r.getWest())*e.worldSize,h=ho(r.getEast())*e.worldSize,p=po(r.getNorth())*e.worldSize,m=po(r.getSouth())*e.worldSize,_=[c,p,0],v=[h,p,0],T=[c,m,0],E=[h,m,0],A=$h([],e.globeMatrix);return Zi(_,_,A),Zi(v,v,A),Zi(T,T,A),Zi(E,E,A),a[0]=ea(a[0],T,i),a[1]=ea(a[1],E,i),a[2]=ea(a[2],v,i),a[3]=ea(a[3],_,i),Un.fromPoints(a)}function Bf(t,e,i){for(const r of t)Zi(r,r,e),dr(r,r,i)}function my(t,e,i){const r=e/t.worldSize,a=t.globeMatrix;if(i.z<=1){const ye=uo(i).getCorners();return Bf(ye,a,r),Un.fromPoints(ye)}const c=ju(i),h=cd(c);Bf(h,a,r);const p=Number.MAX_VALUE,m=[-p,-p,-p],_=[p,p,p];if(c.contains(t.center)){for(const je of h)uc(_,_,je),hc(m,m,je);m[2]=0;const ye=t.point,ke=[ye.x*r,ye.y*r,0];return uc(_,_,ke),hc(m,m,ke),new Un(_,m)}const v=[a[12]*r,a[13]*r,a[14]*r],T=c.getCenter(),E=St(t.center.lat,-Cn,Cn),A=St(T.lat,-Cn,Cn),C=ho(t.center.lng),L=po(E);let F=C-ho(T.lng);const W=L-po(A);F>.5?F-=1:F<-.5&&(F+=1);let $=0;Math.abs(F)>Math.abs(W)?$=F>=0?1:3:($=W>=0?0:2,dc(v,v,[a[4]*r,a[5]*r,a[6]*r],-Math.sin(at(W>=0?c.getSouth():c.getNorth()))*co));const X=h[$],J=h[($+1)%4],ie=new fy(X,J,v),te=[ld(ie,0)||X[0],ld(ie,1)||X[1],ld(ie,2)||X[2]],be=Xa(t.zoom);if(be>0){const ye=function({x:je,y:Ee,z:Be},Oe,Ue,Xe,Ae){const et=1/(1<<Be);let ht=je*et,it=ht+et,Rt=Ee*et,He=Rt+et,_t=0;const Bt=(ht+it)/2-Xe;return Bt>.5?_t=-1:Bt<-.5&&(_t=1),ht=((ht+_t)*Oe-(Xe*=Oe))*Ue+Xe,it=((it+_t)*Oe-Xe)*Ue+Xe,Rt=(Rt*Oe-(Ae*=Oe))*Ue+Ae,He=(He*Oe-Ae)*Ue+Ae,[[ht,He,0],[it,He,0],[it,Rt,0],[ht,Rt,0]]}(i,e,t._pixelsPerMercatorPixel,C,L);for(let je=0;je<h.length;je++)ea(h[je],ye[je],be);const ke=Fo([],ye[$],ye[($+1)%4]);dr(ke,ke,.5),ea(te,ke,be)}for(const ye of h)uc(_,_,ye),hc(m,m,ye);return _[2]=Math.min(X[2],J[2]),uc(_,_,te),hc(m,m,te),new Un(_,m)}function ju({x:t,y:e,z:i}){const r=1/(1<<i),a=new yi(pr(t*r),An((e+1)*r)),c=new yi(pr((t+1)*r),An(e*r));return new cs(a,c)}function cd(t){const e=at(t.getNorth()),i=at(t.getSouth()),r=Math.cos(e),a=Math.cos(i),c=Math.sin(e),h=Math.sin(i),p=t.getWest(),m=t.getEast();return[qa(a,h,p),qa(a,h,m),qa(r,c,m),qa(r,c,p)]}function qa(t,e,i,r=co){return i=at(i),[t*Math.sin(i)*r,-e*r,t*Math.cos(i)*r]}function Wa(t,e,i){return qa(Math.cos(at(t)),Math.sin(at(t)),e,i)}function _c(t,e,i,r){const a=1<<i.z,c=(t/xt+i.x)/a;return Wa(An((e/xt+i.y)/a),pr(c),r)}function Gu({min:t,max:e}){return dy/Math.max(e[0]-t[0],e[1]-t[1],e[2]-t[2])}const Of=new Float64Array(16);function gc(t){const e=Gu(t),i=vf(Of,[e,e,e]);return lc(i,i,((r=[])[0]=-(a=t.min)[0],r[1]=-a[1],r[2]=-a[2],r));var r,a}function ud(t){const e=(r=t.min,(i=Of)[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=r[0],i[13]=r[1],i[14]=r[2],i[15]=1,i);var i,r;const a=1/Gu(t);return Js(e,e,[a,a,a])}function Ff(t,e,i,r,a){const c=function(m){const _=xt/(2*Math.PI);return m/(2*Math.PI)/_}(i),h=[t,e,-i/(2*Math.PI)],p=Kr(new Float64Array(16));return lc(p,p,h),Js(p,p,[c,c,c]),ed(p,p,at(-a)),Vu(p,p,at(-r)),p}function Xa(t){return Lt(ad,Lf,t)}function Uf(t,e){const i=Wa(e.lat,e.lng),r=function(C){const L=Wa(C._center.lat,C._center.lng);let F=nd([],Za(0,1,0),L);const W=bf([],-C.angle,L);F=Zi(F,F,W),bf(W,-C._pitch,F);const $=Fn([],L);return dr($,$,Nu(C.cameraToCenterDistance/C.pixelsPerMeter)),Zi($,$,W),Fo([],L,$)}(t);return h=(a=id([],r,i))[0],p=a[1],m=a[2],_=(c=i)[0],v=c[1],T=c[2],A=(E=Math.sqrt(h*h+p*p+m*m)*Math.sqrt(_*_+v*v+T*T))&&Sr(a,c)/E,Math.acos(Math.min(Math.max(A,-1),1));var a,c,h,p,m,_,v,T,E,A}function hd(t,e){return Uf(t,e)>Math.PI/2*1.01}const Vf=at(85),_y=Math.cos(Vf),gy=Math.sin(Vf),yc=63710088e-1,Nf=2*Math.PI*yc;class us{constructor(e,i){if(isNaN(e)||isNaN(i))throw new Error(`Invalid LngLat object: (${e}, ${i})`);
vendor: 14,806 bytes, line 8
8if(this.lng=+e,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new us(vt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const i=Math.PI/180,r=this.lat*i,a=e.lat*i,c=Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos((e.lng-this.lng)*i);return yc*Math.acos(Math.min(c,1))}toBounds(e=0){const i=360*e/40075017,r=i/Math.cos(Math.PI/180*this.lat);return new cs(new us(this.lng-r,this.lat-i),new us(this.lng+r,this.lat+i))}toEcef(e){const i=Nu(e);return Wa(this.lat,this.lng,co+i)}static convert(e){if(e instanceof us)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new us(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new us(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: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}var yi=us;function dd(t){return Nf*Math.cos(t*Math.PI/180)}function ho(t){return(180+t)/360}function po(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Jr(t,e){return t/dd(e)}function pr(t){return 360*t-180}function An(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function jf(t,e){return t*dd(An(e))}const Cn=85.051129;function Gf(t){return 1/Math.cos(t*Math.PI/180)}class Ha{constructor(e,i,r=0){this.x=+e,this.y=+i,this.z=+r}static fromLngLat(e,i=0){const r=yi.convert(e);return new Ha(ho(r.lng),po(r.lat),Jr(i,r.lat))}toLngLat(){return new yi(pr(this.x),An(this.y))}toAltitude(){return jf(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Nf*Gf(An(this.y))}}function pd(t,e,i,r,a,c,h,p,m){const _=(e+r)/2,v=(i+a)/2,T=new Re(_,v);p(T),function(E,A,C,L,F,W){const $=C-F,X=L-W;return Math.abs((L-A)*$-(C-E)*X)/Math.hypot($,X)}(T.x,T.y,c.x,c.y,h.x,h.y)>=m?(pd(t,e,i,_,v,c,T,p,m),pd(t,_,v,r,a,T,h,p,m)):t.push(h)}function Zf(t,e,i){let r=t[0],a=r.x,c=r.y;e(r);const h=[r];for(let p=1;p<t.length;p++){const m=t[p],{x:_,y:v}=m;e(m),pd(h,a,c,_,v,r,m,e,i),a=_,c=v,r=m}return h}function fd(t,e,i,r){if(r(e,i)){const a=e.add(i)._mult(.5);fd(t,e,a,r),fd(t,a,i,r)}else t.push(i)}function yy(t,e){let i=t[0];const r=[i];for(let a=1;a<t.length;a++){const c=t[a];fd(r,i,c,e),i=c}return r}const md=Math.pow(2,14)-1,qf=-md-1;function xy(t,e){const i=Math.round(t.x*e),r=Math.round(t.y*e);return t.x=St(i,qf,md),t.y=St(r,qf,md),(i<t.x||i>t.x+1||r<t.y||r>t.y+1)&&wi("Geometry exceeds allowed extent, reduce your vector tile buffer size"),t}function Uo(t,e,i){const r=t.loadGeometry(),a=t.extent,c=xt/a;if(e&&i&&i.projection.isReprojectedInTileSpace){const h=1<<e.z,{scale:p,x:m,y:_,projection:v}=i,T=E=>{const A=pr((e.x+E.x/a)/h),C=An((e.y+E.y/a)/h),L=v.project(A,C);E.x=(L.x*p-m)*a,E.y=(L.y*p-_)*a};for(let E=0;E<r.length;E++)if(t.type!==1)r[E]=Zf(r[E],T,1);else{const A=[];for(const C of r[E])C.x<0||C.x>=a||C.y<0||C.y>=a||(T(C),A.push(C));r[E]=A}}for(const h of r)for(const p of h)xy(p,c);return r}function ta(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Uo(t):[]}}function Zu(t,e,i,r,a){t.emplaceBack(2*e+(r+1)/2,2*i+(a+1)/2)}function qu(t,e,i){t.emplaceBack(e.x,e.y,e.z,i[0]*16384,i[1]*16384,i[2]*16384)}class _d{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Ne,this.indexArray=new dt,this.segments=new Xi,this.programConfigurations=new Ks(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,r,a){const c=this.layers[0],h=[];let p=null;c.type==="circle"&&(p=c.layout.get("circle-sort-key"));for(const{feature:_,id:v,index:T,sourceLayerIndex:E}of e){const A=this.layers[0]._featureFilter.needGeometry,C=ta(_,A);if(!this.layers[0]._featureFilter.filter(new w(this.zoom),C,r))continue;const L=p?p.evaluate(C,{},r):void 0,F={id:v,properties:_.properties,type:_.type,sourceLayerIndex:E,index:T,geometry:A?C.geometry:Uo(_,r,a),patterns:{},sortKey:L};h.push(F)}p&&h.sort((_,v)=>_.sortKey-v.sortKey);let m=null;a.projection.name==="globe"&&(this.globeExtVertexArray=new Ge,m=a.projection);for(const _ of h){const{geometry:v,index:T,sourceLayerIndex:E}=_,A=e[T].feature;this.addFeature(_,v,T,i.availableImages,r,m),i.featureIndex.insert(A,v,T,E,this.index)}}update(e,i,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,oy.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,sy.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,i,r,a,c,h){for(const p of i)for(const m of p){const _=m.x,v=m.y;if(_<0||_>=xt||v<0||v>=xt)continue;if(h){const A=h.projectTilePoint(_,v,c),C=h.upVector(c,_,v),L=this.globeExtVertexArray;qu(L,A,C),qu(L,A,C),qu(L,A,C),qu(L,A,C)}const T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),E=T.vertexLength;Zu(this.layoutVertexArray,_,v,-1,-1),Zu(this.layoutVertexArray,_,v,1,-1),Zu(this.layoutVertexArray,_,v,1,1),Zu(this.layoutVertexArray,_,v,-1,1),this.indexArray.emplaceBack(E,E+1,E+2),this.indexArray.emplaceBack(E,E+2,E+3),T.vertexLength+=4,T.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},a,c)}}function Wf(t,e){for(let i=0;i<t.length;i++)if(ia(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(ia(t,e[i]))return!0;return!!gd(t,e)}function vy(t,e,i){return!!ia(t,e)||!!yd(e,t,i)}function Xf(t,e){if(t.length===1)return Kf(e,t[0]);for(let i=0;i<e.length;i++){const r=e[i];for(let a=0;a<r.length;a++)if(ia(t,r[a]))return!0}for(let i=0;i<t.length;i++)if(Kf(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(gd(t,e[i]))return!0;return!1}function by(t,e,i){if(t.length>1){if(gd(t,e))return!0;for(let r=0;r<e.length;r++)if(yd(e[r],t,i))return!0}for(let r=0;r<t.length;r++)if(yd(t[r],e,i))return!0;return!1}function gd(t,e){if(t.length===0||e.length===0)return!1;for(let i=0;i<t.length-1;i++){const r=t[i],a=t[i+1];for(let c=0;c<e.length-1;c++)if(wy(r,a,e[c],e[c+1]))return!0}return!1}function wy(t,e,i,r){return En(t,i,r)!==En(e,i,r)&&En(t,e,i)!==En(t,e,r)}function yd(t,e,i){const r=i*i;if(e.length===1)return t.distSqr(e[0])<r;for(let a=1;a<e.length;a++)if(Hf(t,e[a-1],e[a])<r)return!0;return!1}function Hf(t,e,i){const r=e.distSqr(i);if(r===0)return t.distSqr(e);const a=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/r;return t.distSqr(a<0?e:a>1?i:i.sub(e)._mult(a)._add(e))}function Kf(t,e){let i,r,a,c=!1;for(let h=0;h<t.length;h++){i=t[h];for(let p=0,m=i.length-1;p<i.length;m=p++)r=i[p],a=i[m],r.y>e.y!=a.y>e.y&&e.x<(a.x-r.x)*(e.y-r.y)/(a.y-r.y)+r.x&&(c=!c)}return c}function ia(t,e){let i=!1;for(let r=0,a=t.length-1;r<t.length;a=r++){const c=t[r],h=t[a];c.y>e.y!=h.y>e.y&&e.x<(h.x-c.x)*(e.y-c.y)/(h.y-c.y)+c.x&&(i=!i)}return i}function Yf(t,e,i,r,a){for(const h of t)if(e<=h.x&&i<=h.y&&r>=h.x&&a>=h.y)return!0;const c=[new Re(e,i),new Re(e,a),new Re(r,a),new Re(r,i)];if(t.length>2){for(const h of c)if(ia(t,h))return!0}for(let h=0;h<t.length-1;h++)if(Ty(t[h],t[h+1],c))return!0;return!1}function Ty(t,e,i){const r=i[0],a=i[2];if(t.x<r.x&&e.x<r.x||t.x>a.x&&e.x>a.x||t.y<r.y&&e.y<r.y||t.y>a.y&&e.y>a.y)return!1;const c=En(t,e,i[0]);return c!==En(t,e,i[1])||c!==En(t,e,i[2])||c!==En(t,e,i[3])}function Ka(t,e,i){const r=e.paint.get(t).value;return r.kind==="constant"?r.value:i.programConfigurations.get(e.id).getMaxValue(t)}function Wu(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Jf(t,e,i,r,a){if(!e[0]&&!e[1])return t;const c=Re.convert(e)._mult(a);i==="viewport"&&c._rotate(-r);const h=[];for(let p=0;p<t.length;p++)h.push(t[p].sub(c));return h}function Qf(t,e,i,r){const a=Re.convert(t)._mult(r);return e==="viewport"&&a._rotate(-i),a}ct(_d,"CircleBucket",{omit:["layers"]});const Ey=new K({"circle-sort-key":new V(Ce.layout_circle["circle-sort-key"])});var Sy={paint:new K({"circle-radius":new V(Ce.paint_circle["circle-radius"]),"circle-color":new V(Ce.paint_circle["circle-color"]),"circle-blur":new V(Ce.paint_circle["circle-blur"]),"circle-opacity":new V(Ce.paint_circle["circle-opacity"]),"circle-translate":new z(Ce.paint_circle["circle-translate"]),"circle-translate-anchor":new z(Ce.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new z(Ce.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new z(Ce.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new V(Ce.paint_circle["circle-stroke-width"]),"circle-stroke-color":new V(Ce.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new V(Ce.paint_circle["circle-stroke-opacity"])}),layout:Ey};function $f(t,e,i,r,a,c,h,p,m){if(c&&t.queryGeometry.isAboveHorizon)return!1;c&&(m*=t.pixelToTileUnitsFactor);const _=t.tileID.canonical,v=i.projection.upVectorScale(_,i.center.lat,i.worldSize).metersToTile;for(const T of e)for(const E of T){const A=E.add(p),C=a&&i.elevation?i.elevation.exaggeration()*a.getElevationAt(A.x,A.y,!0):0,L=i.projection.projectTilePoint(A.x,A.y,_);if(C>0){const X=i.projection.upVector(_,A.x,A.y);L.x+=X[0]*v*C,L.y+=X[1]*v*C,L.z+=X[2]*v*C}const F=c?A:Iy(L.x,L.y,L.z,r),W=c?t.tilespaceRays.map(X=>Ay(X,C)):t.queryGeometry.screenGeometry,$=Qs([],[L.x,L.y,L.z,1],r);if(!h&&c?m*=$[3]/i.cameraToCenterDistance:h&&!c&&(m*=i.cameraToCenterDistance/$[3]),c){const X=An((E.y/xt+_.y)/(1<<_.z));m/=i.projection.pixelsPerMeter(X,1)/Jr(1,X)}if(vy(W,F,m))return!0}return!1}function Iy(t,e,i,r){const a=Qs([],[t,e,i,1],r);return new Re(a[0]/a[3],a[1]/a[3])}const em=Za(0,0,0),My=Za(0,0,1);function Ay(t,e){const i=td();return em[2]=e,t.intersectsPlane(em,My,i),new Re(i[0],i[1])}class tm extends _d{}function im(t,{width:e,height:i},r,a){if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==e*i*r)throw new RangeError("mismatched image size")}else a=new Uint8Array(e*i*r);return t.width=e,t.height=i,t.data=a,t}function nm(t,e,i){const{width:r,height:a}=e;r===t.width&&a===t.height||(xd(t,e,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,r),height:Math.min(t.height,a)},i),t.width=r,t.height=a,t.data=e.data)}function xd(t,e,i,r,a,c){if(a.width===0||a.height===0)return e;if(a.width>t.width||a.height>t.height||i.x>t.width-a.width||i.y>t.height-a.height)throw new RangeError("out of range source coordinates for image copy");if(a.width>e.width||a.height>e.height||r.x>e.width-a.width||r.y>e.height-a.height)throw new RangeError("out of range destination coordinates for image copy");const h=t.data,p=e.data;for(let m=0;m<a.height;m++){const _=((i.y+m)*t.width+i.x)*c,v=((r.y+m)*e.width+r.x)*c;for(let T=0;T<a.width*c;T++)p[v+T]=h[_+T]}return e}ct(tm,"HeatmapBucket",{omit:["layers"]});class Vo{constructor(e,i){im(this,e,1,i)}resize(e){nm(this,new Vo(e),1)}clone(){return new Vo({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,r,a,c){xd(e,i,r,a,c,1)}}class ir{constructor(e,i){im(this,e,4,i)}resize(e){nm(this,new ir(e),4)}replace(e,i){i?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new ir({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,r,a,c){xd(e,i,r,a,c,4)}}ct(Vo,"AlphaImage"),ct(ir,"RGBAImage");var Cy={paint:new K({"heatmap-radius":new V(Ce.paint_heatmap["heatmap-radius"]),"heatmap-weight":new V(Ce.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new z(Ce.paint_heatmap["heatmap-intensity"]),"heatmap-color":new H(Ce.paint_heatmap["heatmap-color"]),"heatmap-opacity":new z(Ce.paint_heatmap["heatmap-opacity"])})};function vd(t){const e={},i=t.resolution||256,r=t.clips?t.clips.length:1,a=t.image||new ir({width:i,height:r}),c=(h,p,m)=>{e[t.evaluationKey]=m;const _=t.expression.evaluate(e);a.data[h+p+0]=Math.floor(255*_.r/_.a),a.data[h+p+1]=Math.floor(255*_.g/_.a),a.data[h+p+2]=Math.floor(255*_.b/_.a),a.data[h+p+3]=Math.floor(255*_.a)};if(t.clips)for(let h=0,p=0;h<r;++h,p+=4*i)for(let m=0,_=0;m<i;m++,_+=4){const v=m/(i-1),{start:T,end:E}=t.clips[h];c(p,_,T*(1-v)+E*v)}else for(let h=0,p=0;h<i;h++,p+=4)c(0,p,h/(i-1));return a}var ky={paint:new K({"hillshade-illumination-direction":new z(Ce.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new z(Ce.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new z(Ce.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new z(Ce.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new z(Ce.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new z(Ce.paint_hillshade["hillshade-accent-color"])})};const Py=pe([{name:"a_pos",components:2,type:"Int16"}],4),{members:zy}=Py;var bd={exports:{}};function Xu(t,e,i){i=i||2;var r,a,c,h,p,m,_,v=e&&e.length,T=v?e[0]*i:t.length,E=rm(t,0,T,i,!0),A=[];if(!E||E.next===E.prev)return A;if(v&&(E=function(L,F,W,$){var X,J,ie,te=[];for(X=0,J=F.length;X<J;X++)(ie=rm(L,F[X]*$,X<J-1?F[X+1]*$:L.length,$,!1))===ie.next&&(ie.steiner=!0),te.push(Vy(ie));for(te.sort(Oy),X=0;X<te.length;X++)W=Fy(te[X],W);return W}(t,e,E,i)),t.length>80*i){r=c=t[0],a=h=t[1];for(var C=i;C<T;C+=i)(p=t[C])<r&&(r=p),(m=t[C+1])<a&&(a=m),p>c&&(c=p),m>h&&(h=m);_=(_=Math.max(c-r,h-a))!==0?32767/_:0}return xc(E,A,i,r,a,_,0),A}function rm(t,e,i,r,a){var c,h;if(a===Ed(t,e,i,r)>0)for(c=e;c<i;c+=r)h=am(c,t[c],t[c+1],h);else for(c=i-r;c>=e;c-=r)h=am(c,t[c],t[c+1],h);return h&&Hu(h,h.next)&&(bc(h),h=h.next),h}function na(t,e){if(!t)return t;e||(e=t);var i,r=t;do if(i=!1,r.steiner||!Hu(r,r.next)&&Hi(r.prev,r,r.next)!==0)r=r.next;else{if(bc(r),(r=e=r.prev)===r.next)break;i=!0}while(i||r!==e);return e}function xc(t,e,i,r,a,c,h){if(t){!h&&c&&function(v,T,E,A){var C=v;do C.z===0&&(C.z=wd(C.x,C.y,T,E,A)),C.prevZ=C.prev,C.nextZ=C.next,C=C.next;while(C!==v);C.prevZ.nextZ=null,C.prevZ=null,function(L){var F,W,$,X,J,ie,te,be,ye=1;do{for(W=L,L=null,J=null,ie=0;W;){for(ie++,$=W,te=0,F=0;F<ye&&(te++,$=$.nextZ);F++);for(be=ye;te>0||be>0&&$;)te!==0&&(be===0||!$||W.z<=$.z)?(X=W,W=W.nextZ,te--):(X=$,$=$.nextZ,be--),J?J.nextZ=X:L=X,X.prevZ=J,J=X;W=$}J.nextZ=null,ye*=2}while(ie>1)}(C)}(t,r,a,c);for(var p,m,_=t;t.prev!==t.next;
vendor: 4,084 bytes, line 8
8)if(p=t.prev,m=t.next,c?Dy(t,r,a,c):Ly(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),bc(t),t=m.next,_=m.next;else if((t=m)===_){h?h===1?xc(t=Ry(na(t),e,i),e,i,r,a,c,2):h===2&&By(t,e,i,r,a,c):xc(na(t),e,i,r,a,c,1);break}}}function Ly(t){var e=t.prev,i=t,r=t.next;if(Hi(e,i,r)>=0)return!1;for(var a=e.x,c=i.x,h=r.x,p=e.y,m=i.y,_=r.y,v=a<c?a<h?a:h:c<h?c:h,T=p<m?p<_?p:_:m<_?m:_,E=a>c?a>h?a:h:c>h?c:h,A=p>m?p>_?p:_:m>_?m:_,C=r.next;C!==e;){if(C.x>=v&&C.x<=E&&C.y>=T&&C.y<=A&&Ya(a,p,c,m,h,_,C.x,C.y)&&Hi(C.prev,C,C.next)>=0)return!1;C=C.next}return!0}function Dy(t,e,i,r){var a=t.prev,c=t,h=t.next;if(Hi(a,c,h)>=0)return!1;for(var p=a.x,m=c.x,_=h.x,v=a.y,T=c.y,E=h.y,A=p<m?p<_?p:_:m<_?m:_,C=v<T?v<E?v:E:T<E?T:E,L=p>m?p>_?p:_:m>_?m:_,F=v>T?v>E?v:E:T>E?T:E,W=wd(A,C,e,i,r),$=wd(L,F,e,i,r),X=t.prevZ,J=t.nextZ;X&&X.z>=W&&J&&J.z<=$;){if(X.x>=A&&X.x<=L&&X.y>=C&&X.y<=F&&X!==a&&X!==h&&Ya(p,v,m,T,_,E,X.x,X.y)&&Hi(X.prev,X,X.next)>=0||(X=X.prevZ,J.x>=A&&J.x<=L&&J.y>=C&&J.y<=F&&J!==a&&J!==h&&Ya(p,v,m,T,_,E,J.x,J.y)&&Hi(J.prev,J,J.next)>=0))return!1;J=J.nextZ}for(;X&&X.z>=W;){if(X.x>=A&&X.x<=L&&X.y>=C&&X.y<=F&&X!==a&&X!==h&&Ya(p,v,m,T,_,E,X.x,X.y)&&Hi(X.prev,X,X.next)>=0)return!1;X=X.prevZ}for(;J&&J.z<=$;){if(J.x>=A&&J.x<=L&&J.y>=C&&J.y<=F&&J!==a&&J!==h&&Ya(p,v,m,T,_,E,J.x,J.y)&&Hi(J.prev,J,J.next)>=0)return!1;J=J.nextZ}return!0}function Ry(t,e,i){var r=t;do{var a=r.prev,c=r.next.next;!Hu(a,c)&&om(a,r,r.next,c)&&vc(a,c)&&vc(c,a)&&(e.push(a.i/i|0),e.push(r.i/i|0),e.push(c.i/i|0),bc(r),bc(r.next),r=t=c),r=r.next}while(r!==t);return na(r)}function By(t,e,i,r,a,c){var h=t;do{for(var p=h.next.next;p!==h.prev;){if(h.i!==p.i&&Ny(h,p)){var m=sm(h,p);return h=na(h,h.next),m=na(m,m.next),xc(h,e,i,r,a,c,0),void xc(m,e,i,r,a,c,0)}p=p.next}h=h.next}while(h!==t)}function Oy(t,e){return t.x-e.x}function Fy(t,e){var i=function(a,c){var h,p=c,m=a.x,_=a.y,v=-1/0;do{if(_<=p.y&&_>=p.next.y&&p.next.y!==p.y){var T=p.x+(_-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(T<=m&&T>v&&(v=T,h=p.x<p.next.x?p:p.next,T===m))return h}p=p.next}while(p!==c);if(!h)return null;var E,A=h,C=h.x,L=h.y,F=1/0;p=h;do m>=p.x&&p.x>=C&&m!==p.x&&Ya(_<L?m:v,_,C,L,_<L?v:m,_,p.x,p.y)&&(E=Math.abs(_-p.y)/(m-p.x),vc(p,a)&&(E<F||E===F&&(p.x>h.x||p.x===h.x&&Uy(h,p)))&&(h=p,F=E)),p=p.next;while(p!==A);return h}(t,e);if(!i)return e;var r=sm(i,t);return na(r,r.next),na(i,i.next)}function Uy(t,e){return Hi(t.prev,t,e.prev)<0&&Hi(e.next,t,t.next)<0}function wd(t,e,i,r,a){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*a|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*a|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Vy(t){var e=t,i=t;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==t);return i}function Ya(t,e,i,r,a,c,h,p){return(a-h)*(e-p)>=(t-h)*(c-p)&&(t-h)*(r-p)>=(i-h)*(e-p)&&(i-h)*(c-p)>=(a-h)*(r-p)}function Ny(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(i,r){var a=i;do{if(a.i!==i.i&&a.next.i!==i.i&&a.i!==r.i&&a.next.i!==r.i&&om(a,a.next,i,r))return!0;a=a.next}while(a!==i);return!1}(t,e)&&(vc(t,e)&&vc(e,t)&&function(i,r){var a=i,c=!1,h=(i.x+r.x)/2,p=(i.y+r.y)/2;do a.y>p!=a.next.y>p&&a.next.y!==a.y&&h<(a.next.x-a.x)*(p-a.y)/(a.next.y-a.y)+a.x&&(c=!c),a=a.next;while(a!==i);return c}(t,e)&&(Hi(t.prev,t,e.prev)||Hi(t,e.prev,e))||Hu(t,e)&&Hi(t.prev,t,t.next)>0&&Hi(e.prev,e,e.next)>0)}function Hi(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Hu(t,e){return t.x===e.x&&t.y===e.y}function om(t,e,i,r){var a=Yu(Hi(t,e,i)),c=Yu(Hi(t,e,r)),h=Yu(Hi(i,r,t)),p=Yu(Hi(i,r,e));return a!==c&&h!==p||!(a!==0||!Ku(t,i,e))||!(c!==0||!Ku(t,r,e))||!(h!==0||!Ku(i,t,r))||!(p!==0||!Ku(i,e,r))}function Ku(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function Yu(t){return t>0?1:t<0?-1:0}function vc(t,e){return Hi(t.prev,t,t.next)<0?Hi(t,e,t.next)>=0&&Hi(t,t.prev,e)>=0:Hi(t,e,t.prev)<0||Hi(t,t.next,e)<0}function sm(t,e){var i=new Td(t.i,t.x,t.y),r=new Td(e.i,e.x,e.y),a=t.next,c=e.prev;return t.next=e,e.prev=t,i.next=a,a.prev=i,r.next=i,i.prev=r,c.next=r,r.prev=c,r}
vendor: 4,782 bytes, line 8
8function am(t,e,i,r){var a=new Td(t,e,i);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function bc(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Td(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ed(t,e,i,r){for(var a=0,c=e,h=i-r;c<i;c+=r)a+=(t[h]-t[c])*(t[c+1]+t[h+1]),h=c;return a}bd.exports=Xu,bd.exports.default=Xu,Xu.deviation=function(t,e,i,r){var a=e&&e.length,c=Math.abs(Ed(t,0,a?e[0]*i:t.length,i));if(a)for(var h=0,p=e.length;h<p;h++)c-=Math.abs(Ed(t,e[h]*i,h<p-1?e[h+1]*i:t.length,i));var m=0;for(h=0;h<r.length;h+=3){var _=r[h]*i,v=r[h+1]*i,T=r[h+2]*i;m+=Math.abs((t[_]-t[T])*(t[v+1]-t[_+1])-(t[_]-t[v])*(t[T+1]-t[_+1]))}return c===0&&m===0?0:Math.abs((m-c)/c)},Xu.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},r=0,a=0;a<t.length;a++){for(var c=0;c<t[a].length;c++)for(var h=0;h<e;h++)i.vertices.push(t[a][c][h]);a>0&&i.holes.push(r+=t[a-1].length)}return i};var Sd=lt(bd.exports);function jy(t,e,i,r,a){lm(t,e,i||0,r||t.length-1,a||Gy)}function lm(t,e,i,r,a){for(;r>i;){if(r-i>600){var c=r-i+1,h=e-i+1,p=Math.log(c),m=.5*Math.exp(2*p/3),_=.5*Math.sqrt(p*m*(c-m)/c)*(h-c/2<0?-1:1);lm(t,e,Math.max(i,Math.floor(e-h*m/c+_)),Math.min(r,Math.floor(e+(c-h)*m/c+_)),a)}var v=t[e],T=i,E=r;for(wc(t,i,e),a(t[r],v)>0&&wc(t,i,r);T<E;){for(wc(t,T,E),T++,E--;a(t[T],v)<0;)T++;for(;a(t[E],v)>0;)E--}a(t[i],v)===0?wc(t,i,E):wc(t,++E,r),E<=e&&(i=E+1),e<=E&&(r=E-1)}}function wc(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function Gy(t,e){return t<e?-1:t>e?1:0}function Id(t,e){const i=t.length;if(i<=1)return[t];const r=[];let a,c;for(let h=0;h<i;h++){const p=wo(t[h]);p!==0&&(t[h].area=Math.abs(p),c===void 0&&(c=p<0),c===p<0?(a&&r.push(a),a=[t[h]]):a.push(t[h]))}if(a&&r.push(a),e>1)for(let h=0;h<r.length;h++)r[h].length<=e||(jy(r[h],e,1,r[h].length-1,Zy),r[h]=r[h].slice(0,e));return r}function Zy(t,e){return e.area-t.area}function Md(t,e,i){const r=i.patternDependencies;let a=!1;for(const c of e){const h=c.paint.get(`${t}-pattern`);h.isConstant()||(a=!0);const p=h.constantOr(null);p&&(a=!0,r[p]=!0)}return a}function Ad(t,e,i,r,a){const c=a.patternDependencies;for(const h of e){const p=h.paint.get(`${t}-pattern`).value;if(p.kind!=="constant"){let m=p.evaluate({zoom:r},i,{},a.availableImages);m=m&&m.name?m.name:m,c[m]=!0,i.patterns[h.id]=m}}return i}class Ju{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ne,this.indexArray=new dt,this.indexArray2=new un,this.programConfigurations=new Ks(e.layers,e.zoom),this.segments=new Xi,this.segments2=new Xi,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=e.projection}populate(e,i,r,a){this.hasPattern=Md("fill",this.layers,i);const c=this.layers[0].layout.get("fill-sort-key"),h=[];for(const{feature:p,id:m,index:_,sourceLayerIndex:v}of e){const T=this.layers[0]._featureFilter.needGeometry,E=ta(p,T);if(!this.layers[0]._featureFilter.filter(new w(this.zoom),E,r))continue;const A=c?c.evaluate(E,{},r,i.availableImages):void 0,C={id:m,properties:p.properties,type:p.type,sourceLayerIndex:v,index:_,geometry:T?E.geometry:Uo(p,r,a),patterns:{},sortKey:A};h.push(C)}c&&h.sort((p,m)=>p.sortKey-m.sortKey);for(const p of h){const{geometry:m,index:_,sourceLayerIndex:v}=p;if(this.hasPattern){const T=Ad("fill",this.layers,p,this.zoom,i);this.patternFeatures.push(T)}else this.addFeature(p,m,_,r,{},i.availableImages);i.featureIndex.insert(e[_].feature,m,_,v,this.index)}}update(e,i,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,r,a)}addFeatures(e,i,r,a,c){for(const h of this.patternFeatures)this.addFeature(h,h.geometry,h.index,i,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,zy),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,i,r,a,c,h=[]){for(const p of Id(i,500)){let m=0;for(const C of p)m+=C.length;const _=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),v=_.vertexLength,T=[],E=[];
8for(const C of p){if(C.length===0)continue;C!==p[0]&&E.push(T.length/2);const L=this.segments2.prepareSegment(C.length,this.layoutVertexArray,this.indexArray2),F=L.vertexLength;this.layoutVertexArray.emplaceBack(C[0].x,C[0].y),this.indexArray2.emplaceBack(F+C.length-1,F),T.push(C[0].x),T.push(C[0].y);for(let W=1;W<C.length;W++)this.layoutVertexArray.emplaceBack(C[W].x,C[W].y),this.indexArray2.emplaceBack(F+W-1,F+W),T.push(C[W].x),T.push(C[W].y);L.vertexLength+=C.length,L.primitiveLength+=C.length}const A=Sd(T,E);for(let C=0;C<A.length;C+=3)this.indexArray.emplaceBack(v+A[C],v+A[C+1],v+A[C+2]);_.vertexLength+=m,_.primitiveLength+=A.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,c,h,a)}}ct(Ju,"FillBucket",{omit:["layers","patternFeatures"]});const qy=new K({"fill-sort-key":new V(Ce.layout_fill["fill-sort-key"])});var Wy={paint:new K({"fill-antialias":new z(Ce.paint_fill["fill-antialias"]),"fill-opacity":new V(Ce.paint_fill["fill-opacity"]),"fill-color":new V(Ce.paint_fill["fill-color"]),"fill-outline-color":new V(Ce.paint_fill["fill-outline-color"]),"fill-translate":new z(Ce.paint_fill["fill-translate"]),"fill-translate-anchor":new z(Ce.paint_fill["fill-translate-anchor"]),"fill-pattern":new V(Ce.paint_fill["fill-pattern"])}),layout:qy};const Xy=pe([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),Hy=pe([{name:"a_centroid_pos",components:2,type:"Uint16"}]),Ky=pe([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:Yy}=Xy;var Qu={},Jy=qt,cm=Ja;function Ja(t,e,i,r,a){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=a,t.readFields(Qy,this,e)}function Qy(t,e,i){t==1?e.id=i.readVarint():t==2?function(r,a){for(var c=r.readVarint()+r.pos;r.pos<c;){var h=a._keys[r.readVarint()],p=a._values[r.readVarint()];a.properties[h]=p}}(i,e):t==3?e.type=i.readVarint():t==4&&(e._geometry=i.pos)}function $y(t){for(var e,i,r=0,a=0,c=t.length,h=c-1;a<c;h=a++)r+=((i=t[h]).x-(e=t[a]).x)*(e.y+i.y);return r}Ja.types=["Unknown","Point","LineString","Polygon"],Ja.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,i=t.readVarint()+t.pos,r=1,a=0,c=0,h=0,p=[];t.pos<i;){if(a<=0){var m=t.readVarint();r=7&m,a=m>>3}if(a--,r===1||r===2)c+=t.readSVarint(),h+=t.readSVarint(),r===1&&(e&&p.push(e),e=[]),e.push(new Jy(c,h));else{if(r!==7)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&p.push(e),p},Ja.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,r=0,a=0,c=0,h=1/0,p=-1/0,m=1/0,_=-1/0;t.pos<e;){if(r<=0){var v=t.readVarint();i=7&v,r=v>>3}if(r--,i===1||i===2)(a+=t.readSVarint())<h&&(h=a),a>p&&(p=a),(c+=t.readSVarint())<m&&(m=c),c>_&&(_=c);else if(i!==7)throw new Error("unknown command "+i)}return[h,m,p,_]},Ja.prototype.toGeoJSON=function(t,e,i){var r,a,c=this.extent*Math.pow(2,i),h=this.extent*t,p=this.extent*e,m=this.loadGeometry(),_=Ja.types[this.type];function v(A){for(var C=0;C<A.length;C++){var L=A[C];A[C]=[360*(L.x+h)/c-180,360/Math.PI*Math.atan(Math.exp((180-360*(L.y+p)/c)*Math.PI/180))-90]}}switch(this.type){case 1:var T=[];for(r=0;r<m.length;r++)T[r]=m[r][0];v(m=T);break;case 2:for(r=0;r<m.length;r++)v(m[r]);break;case 3:for(m=function(A){var C=A.length;if(C<=1)return[A];for(var L,F,W=[],$=0;$<C;$++){var X=$y(A[$]);X!==0&&(F===void 0&&(F=X<0),F===X<0?(L&&W.push(L),L=[A[$]]):L.push(A[$]))}return L&&W.push(L),W}(m),r=0;r<m.length;r++)for(a=0;a<m[r].length;a++)v(m[r][a])}m.length===1?m=m[0]:_="Multi"+_;var E={type:"Feature",geometry:{type:_,coordinates:m},properties:this.properties};return"id"in this&&(E.id=this.id),E};var e0=cm,um=hm;function hm(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(t0,this,e),this.length=this._features.length}function t0(t,e,i){t===15?e.version=i.readVarint():t===1?e.name=i.readString():t===5?e.extent=i.readVarint():t===2?e._features.push(i.pos):t===3?e._keys.push(i.readString()):t===4&&e._values.push(function(r){for(var a=null,c=r.readVarint()+r.pos;r.pos<c;){var h=r.readVarint()>>3;a=h===1?r.readString():h===2?r.readFloat():h===3?r.readDouble():h===4?r.readVarint64():h===5?r.readVarint():h===6?r.readSVarint():h===7?r.readBoolean():null}return a}(i))}hm.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new e0(this._pbf,e,this.extent,this._keys,this._values)};var i0=um;function n0(t,e,i){if(t===3){var r=new i0(i,i.readVarint()+i.pos);r.length&&(e[r.name]=r)}}var Cd=Qu.VectorTile=function(t,e){this.layers=t.readFields(n0,{},e)},$u=Qu.VectorTileFeature=cm;function eh(t,e,i,r){const a=[],c=r===0?(h,p,m,_,v,T)=>{h.push(new Re(T,m+(T-p)/(_-p)*(v-m)))}:(h,p,m,_,v,T)=>{h.push(new Re(p+(T-m)/(v-m)*(_-p),T))};for(const h of t){const p=[];for(const m of h){if(m.length<=2)continue;const _=[];for(let E=0;E<m.length-1;E++){const A=m[E].x,C=m[E].y,L=m[E+1].x,F=m[E+1].y,W=r===0?A:C,$=r===0?L:F;W<e?$>e&&c(_,A,C,L,F,e):W>
8i?$<i&&c(_,A,C,L,F,i):_.push(m[E]),$<e&&W>=e&&c(_,A,C,L,F,e),$>i&&W<=i&&c(_,A,C,L,F,i)}let v=m[m.length-1];const T=r===0?v.x:v.y;T>=e&&T<=i&&_.push(v),_.length&&(v=_[_.length-1],_[0].x===v.x&&_[0].y===v.y||_.push(_[0]),p.push(_))}p.length&&a.push(p)}return a}Qu.VectorTileLayer=um;const r0=$u.types,o0=Math.pow(2,13);function Tc(t,e,i,r,a,c,h,p){t.emplaceBack((e<<1)+h,(i<<1)+c,(Math.floor(r*o0)<<1)+a,Math.round(p))}function Ec(t,e,i){t.emplaceBack(e.x,e.y,e.z,i[0]*16384,i[1]*16384,i[2]*16384)}class dm{constructor(){this.acc=new Re(0,0),this.polyCount=[]}startRing(e){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new Re(e.x,e.y),this.max=new Re(e.x,e.y))}append(e,i){this.currentPolyCount.edges++,this.acc._add(e);const r=this.min,a=this.max;e.x<r.x?r.x=e.x:e.x>a.x&&(a.x=e.x),e.y<r.y?r.y=e.y:e.y>a.y&&(a.y=e.y),((e.x===0||e.x===xt)&&e.x===i.x)!=((e.y===0||e.y===xt)&&e.y===i.y)&&this.processBorderOverlap(e,i),i.x<0!=e.x<0&&this.addBorderIntersection(0,ii(i.y,e.y,(0-i.x)/(e.x-i.x))),i.x>xt!=e.x>xt&&this.addBorderIntersection(1,ii(i.y,e.y,(xt-i.x)/(e.x-i.x))),i.y<0!=e.y<0&&this.addBorderIntersection(2,ii(i.x,e.x,(0-i.y)/(e.y-i.y))),i.y>xt!=e.y>xt&&this.addBorderIntersection(3,ii(i.x,e.x,(xt-i.y)/(e.y-i.y)))}addBorderIntersection(e,i){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const r=this.borders[e];i<r[0]&&(r[0]=i),i>r[1]&&(r[1]=i)}processBorderOverlap(e,i){if(e.x===i.x){if(e.y===i.y)return;const r=e.x===0?0:1;this.addBorderIntersection(r,i.y),this.addBorderIntersection(r,e.y)}else{const r=e.y===0?2:3;this.addBorderIntersection(r,i.x),this.addBorderIntersection(r,e.x)}}centroid(){const e=this.polyCount.reduce((i,r)=>i+r.edges,0);return e!==0?this.acc.div(e)._round():new Re(0,0)}span(){return new Re(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((e,i)=>e+ +(i[0]!==Number.MAX_VALUE),0)}}class Sc{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.layoutVertexArray=new Le,this.centroidVertexArray=new Wr,this.indexArray=new dt,this.programConfigurations=new Ks(e.layers,e.zoom),this.segments=new Xi,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.enableTerrain=e.enableTerrain}populate(e,i,r,a){this.features=[],this.hasPattern=Md("fill-extrusion",this.layers,i),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(c){const h=Math.exp(Math.PI*(1-c.y/(1<<c.z)*2));return 80150034*h/(h*h+1)/xt/(1<<c.z)}(r),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter;for(const{feature:c,id:h,index:p,sourceLayerIndex:m}of e){const _=this.layers[0]._featureFilter.needGeometry,v=ta(c,_);if(!this.layers[0]._featureFilter.filter(new w(this.zoom),v,r))continue;const T={id:h,sourceLayerIndex:m,index:p,geometry:_?v.geometry:Uo(c,r,a),properties:c.properties,type:c.type,patterns:{}},E=this.layoutVertexArray.length;this.hasPattern?this.features.push(Ad("fill-extrusion",this.layers,T,this.zoom,i)):this.addFeature(T,T.geometry,p,r,{},i.availableImages,a),i.featureIndex.insert(c,T.geometry,p,m,this.index,E)}this.sortBorders()}addFeatures(e,i,r,a,c){for(const h of this.features){const{geometry:p}=h;this.addFeature(h,p,h.index,i,r,a,c)}this.sortBorders()}update(e,i,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Yy),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,Ky.members,!0))),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.centroidVertexArray.length!==0&&(this.centroidVertexBuffer?this.needsCentroidUpdate&&this.centroidVertexBuffer.updateData(this.centroidVertexArray):this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Hy.members,!0),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,i,r,a,c,h,p){const m=[new Re(0,0),new Re(xt,xt)],_=p.projection,v=_.name==="globe",T=this.enableTerrain&&!v?new dm:null,E=r0[e.type]==="Polygon";v&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Ge);const A=Id(i,500);for(let W=A.length-1;W>=0;W--){const $=A[W];($.length===0||(C=$[0]).every(X=>X.x<=0)||C.every(X=>X.x>=xt)||C.every(X=>X.y<=0)||C.every(X=>X.y>=xt))&&A.splice(W,1)}var C;let L;if(v)L=xm(A,m,a);else{L=[];
8for(const W of A)L.push({polygon:W,bounds:m})}const F=E?this.edgeRadius:0;for(const{polygon:W,bounds:$}of L){let X=0,J=0;for(const te of W)E&&!te[0].equals(te[te.length-1])&&te.push(te[0]),J+=E?te.length-1:te.length;const ie=this.segments.prepareSegment((E?5:4)*J,this.layoutVertexArray,this.indexArray);if(E){const te=[],be=[];X=ie.vertexLength;for(const ke of W){let je,Ee;ke.length&&ke!==W[0]&&be.push(te.length/2),je=ke[1].sub(ke[0])._perp()._unit();for(let Be=1;Be<ke.length;Be++){const Oe=ke[Be],Ue=ke[Be===ke.length-1?1:Be+1];let{x:Xe,y:Ae}=Oe;if(F){Ee=Ue.sub(Oe)._perp()._unit();const et=je.add(Ee)._unit(),ht=F*Math.min(4,1/(je.x*et.x+je.y*et.y));Xe+=ht*et.x,Ae+=ht*et.y,je=Ee}Tc(this.layoutVertexArray,Xe,Ae,0,0,1,1,0),ie.vertexLength++,te.push(Oe.x,Oe.y),v&&Ec(this.layoutVertexExtArray,_.projectTilePoint(Xe,Ae,a),_.upVector(a,Xe,Ae))}}const ye=Sd(te,be);for(let ke=0;ke<ye.length;ke+=3)this.indexArray.emplaceBack(X+ye[ke],X+ye[ke+2],X+ye[ke+1]),ie.primitiveLength++}for(const te of W){T&&te.length&&T.startRing(te[0]);let be,ye,ke,je=te.length>4&&_m(te[te.length-2],te[0],te[1]),Ee=F?s0(te[te.length-2],te[0],te[1],F):0;ye=te[1].sub(te[0])._perp()._unit();let Be=!0;for(let Oe=1,Ue=0;Oe<te.length;Oe++){let Xe=te[Oe-1],Ae=te[Oe];const et=te[Oe===te.length-1?1:Oe+1];if(T&&E&&T.currentPolyCount.top++,mm(Ae,Xe,$)){F&&(ye=et.sub(Ae)._perp()._unit(),Be=!Be);continue}T&&T.append(Ae,Xe);const ht=Ae.sub(Xe)._perp(),it=ht.x/(Math.abs(ht.x)+Math.abs(ht.y)),Rt=ht.y>0?1:0,He=Xe.dist(Ae);if(Ue+He>32768&&(Ue=0),F){ke=et.sub(Ae)._perp()._unit();let Ot=fm(Xe,Ae,et,pm(ye,ke),F);isNaN(Ot)&&(Ot=0);const Et=Ae.sub(Xe)._unit();Xe=Xe.add(Et.mult(Ee))._round(),Ae=Ae.add(Et.mult(-Ot))._round(),Ee=Ot,ye=ke}const _t=ie.vertexLength,Bt=te.length>4&&_m(Xe,Ae,et);let si=gm(Ue,je,Be);if(Tc(this.layoutVertexArray,Xe.x,Xe.y,it,Rt,0,0,si),Tc(this.layoutVertexArray,Xe.x,Xe.y,it,Rt,0,1,si),Ue+=He,si=gm(Ue,Bt,!Be),je=Bt,Tc(this.layoutVertexArray,Ae.x,Ae.y,it,Rt,0,0,si),Tc(this.layoutVertexArray,Ae.x,Ae.y,it,Rt,0,1,si),ie.vertexLength+=4,this.indexArray.emplaceBack(_t+0,_t+1,_t+2),this.indexArray.emplaceBack(_t+1,_t+3,_t+2),ie.primitiveLength+=2,F){const Ot=X+(Oe===1?te.length-2:Oe-2),Et=Oe===1?X:Ot+1;if(this.indexArray.emplaceBack(_t+1,Ot,_t+3),this.indexArray.emplaceBack(Ot,Et,_t+3),ie.primitiveLength+=2,be===void 0&&(be=_t),!mm(et,te[Oe],$)){const Ai=Oe===te.length-1?be:ie.vertexLength;this.indexArray.emplaceBack(_t+2,_t+3,Ai),this.indexArray.emplaceBack(_t+3,Ai+1,Ai),this.indexArray.emplaceBack(_t+3,Et,Ai+1),ie.primitiveLength+=3}Be=!Be}if(v){const Ot=this.layoutVertexExtArray,Et=_.projectTilePoint(Xe.x,Xe.y,a),Ai=_.projectTilePoint(Ae.x,Ae.y,a),Ft=_.upVector(a,Xe.x,Xe.y),Ut=_.upVector(a,Ae.x,Ae.y);Ec(Ot,Et,Ft),Ec(Ot,Et,Ft),Ec(Ot,Ai,Ut),Ec(Ot,Ai,Ut)}}E&&(X+=te.length-1)}}if(T&&T.polyCount.length>0){if(T.borders){T.vertexArrayOffset=this.centroidVertexArray.length;const W=T.borders,$=this.featuresOnBorder.push(T)-1;for(let X=0;X<4;X++)W[X][0]!==Number.MAX_VALUE&&this.borders[X].push($)}this.encodeCentroid(T.borders?void 0:T.centroid(),T)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,c,h,a)}sortBorders(){for(let e=0;e<4;e++)this.borders[e].sort((i,r)=>this.featuresOnBorder[i].borders[e][0]-this.featuresOnBorder[r].borders[e][0])}encodeCentroid(e,i,r=!0){let a,c;if(e)if(e.y!==0){const p=i.span()._mult(this.tileToMeter);a=(Math.max(e.x,1)<<3)+Math.min(7,Math.round(p.x/10)),c=(Math.max(e.y,1)<<3)+Math.min(7,Math.round(p.y/10))}else a=Math.ceil(7*(e.x+450)),c=0;else a=0,c=+r;let h=r?this.centroidVertexArray.length:i.vertexArrayOffset;for(const p of i.polyCount){r&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*p.edges+p.top);for(let m=0;m<p.top;m++)this.centroidVertexArray.emplace(h++,a,c);for(let m=0;m<2*p.edges;m++)this.centroidVertexArray.emplace(h++,0,c),this.centroidVertexArray.emplace(h++,a,c)}}}function pm(t,e){const i=t.add(e)._unit();return t.x*i.x+t.y*i.y}function s0(t,e,i,r){const a=e.sub(t)._perp()._unit(),c=i.sub(e)._perp()._unit();return fm(t,e,i,pm(a,c),r)}function fm(t,e,i,r,a){const c=Math.sqrt(1-r*r);return Math.min(t.dist(e)/3,e.dist(i)/3,a*c/r)}function mm(t,e,i){return t.x<i[0].x&&e.x<i[0].x||t.x>i[1].x&&e.x>i[1].x||t.y<i[0].y&&e.y<i[0].y||t.y>i[1].y&&e.y>i[1].y}function _m(t,e,i){if(t.x<0||t.x>=xt||e.x<0||e.x>=xt||i.x<0||i.x>=xt)return!1;const r=i.sub(e),a=r.perp(),c=t.sub(e);return(r.x*c.x+r.y*c.y)/Math.sqrt((r.x*r.x+r.y*r.y)*(c.x*c.x+c.y*c.y))>-.866&&a.x*c.x+a.y*c.y<0}function gm(t,e,i){const r=e?2|t:-3&t;return i?1|r:-2&r}function ym(){const t=Math.PI/32,e=Math.tan(t),i=yc;return i*Math.sqrt(1+2*e*e)-i}function xm(t,e,i){const r=1<<i.z,a=pr(i.x/r),c=pr((i.x+1)/r),h=An(i.y/r),p=An((i.y+1)/r);return function(m,_,v,T,E=0,A){const C=[];if(!m.length||!v||!T)return C;const L=(te,be)=>{for(const ye of te)C.push({polygon:ye,bounds:be})},F=Math.ceil(Math.log2(v)),W=Math.ceil(Math.log2(T)),$=F-W,X=[];for(let te=0;te<Math.abs($);te++)X.push($>0?0:1);for(let te=0;te<Math.min(F,W);te++)X.push(0),X.push(1);let J=m;if(J=eh(J,_[0].y-E,_[1].y+E,1),J=eh(J,_[0].x-E,_[1].x+E,0),!J.length)return C;const ie=[];for(X.length?ie.push({polygons:J,bounds:_,depth:0}):L(J,_);ie.length;){const te=ie.pop(),be=te.depth,ye=X[be],ke=te.bounds[0],je=te.bounds[1],Ee=ye===0?ke.x:ke.y,Be=ye===0?je.x:je.y,Oe=A?A(ye,Ee,Be):.5*(Ee+Be),Ue=eh(te.polygons,Ee-E,Oe+E,ye),Xe=eh(te.polygons,Oe-E,Be+E,ye);if(Ue.length){const Ae=[ke,new Re(ye===0?Oe:je.x,ye===1?Oe:je.y)];X.length>be+1?ie.push({polygons:Ue,bounds:Ae,depth:be+1}):L(Ue,Ae)}if(Xe.length){const Ae=[new Re(ye===0?Oe:ke.x,ye===1?Oe:ke.y),je];X.length>be+1?ie.push({polygons:Xe,bounds:Ae,depth:be+1}):L(Xe,Ae)}}return C}(t,e,Math.ceil((c-a)/11.25),Math.ceil((h-p)/11.25),1,(m,_,v)=>{if(m===0)return .5*(_+v);{const T=An((i.y+_/xt)/r);return(po(.5*(An((i.y+v/xt)/r)+T))*r-i.y)*xt}})}ct(Sc,"FillExtrusionBucket",{omit:["layers","features"]}),ct(dm,"PartMetadata");const a0=new K({"fill-extrusion-edge-radius":new z(Ce["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var l0={paint:new K({"fill-extrusion-opacity":new z(Ce["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new V(Ce["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new z(Ce["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new z(Ce["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new V(Ce["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new V(Ce["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new V(Ce["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new z(Ce["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new z(Ce["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new z(Ce["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new z(Ce["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:a0};function vm(t,e,i){var r=2*Math.PI*6378137/256/Math.pow(2,i);return[t*r-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}class th{constructor(e,i,r){this.z=e,this.x=i,this.y=r,this.key=Ic(0,e,e,i,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,i){const r=function(c,h,p){var m=vm(256*c,256*(h=Math.pow(2,p)-h-1),p),_=vm(256*(c+1),256*(h+1),p);return m[0]+","+m[1]+","+_[0]+","+_[1]}(this.x,this.y,this.z),a=function(c,h,p){let m,_="";for(let v=c;v>0;v--)m=1<<v-1,_+=(h&m?1:0)+(p&m?2:0);return _}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(i==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",a).replace("{bbox-epsg-3857}",r)}toString(){return`${this.z}/${this.x}/${this.y}`}}class bm{constructor(e,i){this.wrap=e,this.canonical=i,this.key=Ic(e,i.z,i.z,i.x,i.y)}}class Vn{constructor(e,i,r,a,c){this.overscaledZ=e,this.wrap=i,this.canonical=new th(r,+a,+c),this.key=i===0&&e===r?this.canonical.key:Ic(i,e,r,a,c)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const i=this.canonical.z-e;return e>this.canonical.z?new Vn(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Vn(e,this.wrap,e,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(e,i=!0){if(this.overscaledZ===e&&i)return this.key;if(e>this.canonical.z)return Ic(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y);{const r=this.canonical.z-e;return Ic(this.wrap*+i,e,e,this.canonical.x>>r,this.canonical.y>>r)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const i=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>i&&e.canonical.y===this.canonical.y>>i}children(e){if(this.overscaledZ>=e)return[new Vn(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,r=2*this.canonical.x,a=2*this.canonical.y;return[new Vn(i,this.wrap,i,r,a),new Vn(i,this.wrap,i,r+1,a),new Vn(i,this.wrap,i,r,a+1),new Vn(i,this.wrap,i,r+1,a+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>
vendor: 5,901 bytes, line 8
8e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new Vn(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Vn(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new bm(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function Ic(t,e,i,r,a){const c=1<<Math.min(i,22);let h=c*(a%c)+r%c;return t&&i<22&&(h+=c*c*((t<0?-2*t-1:2*t)%(1<<2*(22-i)))),16*(32*h+i)+(e-i)}ct(th,"CanonicalTileID"),ct(Vn,"OverscaledTileID",{omit:["projMatrix"]});class Qa extends Re{constructor(e,i,r){super(e,i),this.z=r}}function Mc(t,e){return t.x*e.x+t.y*e.y}function wm(t,e){if(t.length===1){let i=0;const r=e[i++];let a;for(;!a||r.equals(a);)if(a=e[i++],!a)return 1/0;for(;i<e.length;i++){const c=e[i],h=t[0],p=a.sub(r),m=c.sub(r),_=h.sub(r),v=Mc(p,p),T=Mc(p,m),E=Mc(m,m),A=Mc(_,p),C=Mc(_,m),L=v*E-T*T,F=(E*A-T*C)/L,W=(v*C-T*A)/L,$=r.z*(1-F-W)+a.z*F+c.z*W;if(isFinite($))return $}return 1/0}{let i=1/0;for(const r of e)i=Math.min(i,r.z);return i}}function Tm(t,e,i,r,a,c,h,p){const m=h*a.getElevationAt(t,e,!0,!0),_=c[0]!==0,v=_?c[1]===0?h*(c[0]/7-450):h*function(T,E,A){const C=Math.floor(E[0]/8),L=Math.floor(E[1]/8),F=10*(E[0]-8*C),W=10*(E[1]-8*L),$=T.getElevationAt(C,L,!0,!0),X=T.getMeterToDEM(A),J=Math.floor(.5*(F*X-1)),ie=Math.floor(.5*(W*X-1)),te=T.tileCoordToPixel(C,L),be=2*J+1,ye=2*ie+1,ke=function(Xe,Ae,et,ht,it){return[Xe.getElevationAtPixel(Ae,et,!0),Xe.getElevationAtPixel(Ae+it,et,!0),Xe.getElevationAtPixel(Ae,et+it,!0),Xe.getElevationAtPixel(Ae+ht,et+it,!0)]}(T,te.x-J,te.y-ie,be,ye),je=Math.abs(ke[0]-ke[1]),Ee=Math.abs(ke[2]-ke[3]),Be=Math.abs(ke[0]-ke[2])+Math.abs(ke[1]-ke[3]),Oe=Math.min(.25,.5*X*(je+Ee)/be),Ue=Math.min(.25,.5*X*Be/ye);return $+Math.max(Oe*F,Ue*W)}(a,c,p):m;return{base:m+(i===0)?-1:i,top:_?Math.max(v+r,m+i+2):m+r}}const c0=pe([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:u0}=c0,h0=pe([{name:"a_packed",components:4,type:"Float32"}]),{members:d0}=h0,p0=$u.types,f0=Math.cos(Math.PI/180*37.5);class ih{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new Te,this.layoutVertexArray2=new Ve,this.indexArray=new dt,this.programConfigurations=new Ks(e.layers,e.zoom),this.segments=new Xi,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,r,a){this.hasPattern=Md("line",this.layers,i);const c=this.layers[0].layout.get("line-sort-key"),h=[];for(const{feature:v,id:T,index:E,sourceLayerIndex:A}of e){const C=this.layers[0]._featureFilter.needGeometry,L=ta(v,C);if(!this.layers[0]._featureFilter.filter(new w(this.zoom),L,r))continue;const F=c?c.evaluate(L,{},r):void 0,W={id:T,properties:v.properties,type:v.type,sourceLayerIndex:A,index:E,geometry:C?L.geometry:Uo(v,r,a),patterns:{},sortKey:F};h.push(W)}c&&h.sort((v,T)=>v.sortKey-T.sortKey);const{lineAtlas:p,featureIndex:m}=i,_=this.addConstantDashes(p);for(const v of h){const{geometry:T,index:E,sourceLayerIndex:A}=v;if(_&&this.addFeatureDashes(v,p),this.hasPattern){const C=Ad("line",this.layers,v,this.zoom,i);this.patternFeatures.push(C)}else this.addFeature(v,T,E,r,p.positions,i.availableImages);m.insert(e[E].feature,T,E,A,this.index)}}addConstantDashes(e){let i=!1;for(const r of this.layers){const a=r.paint.get("line-dasharray").value,c=r.layout.get("line-cap").value;if(a.kind!=="constant"||c.kind!=="constant")i=!0;else{const h=c.value,p=a.value;if(!p)continue;e.addDash(p,h)}}return i}addFeatureDashes(e,i){const r=this.zoom;for(const a of this.layers){const c=a.paint.get("line-dasharray").value,h=a.layout.get("line-cap").value;if(c.kind==="constant"&&h.kind==="constant")continue;let p,m;if(c.kind==="constant"){if(p=c.value,!p)continue}else p=c.evaluate({zoom:r},e);m=h.kind==="constant"?h.value:h.evaluate({zoom:r},e),i.addDash(p,m),e.patterns[a.id]=i.getKey(p,m)}}update(e,i,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,r,a)}addFeatures(e,i,r,a,c){for(const h of this.patternFeatures)this.addFeature(h,h.geometry,h.index,i,r,a)}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,d0)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,u0),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&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,i,r,a,c,h){const p=this.layers[0].layout,m=p.get("line-join").evaluate(e,{}),_=p.get("line-cap").evaluate(e,{}),v=p.get("line-miter-limit"),T=p.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const E of i)this.addLine(E,e,m,_,v,T);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,c,h,a)}addLine(e,i,r,a,c,h){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineS
vendor: 4,266 bytes, line 8
8oFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let W=0;W<e.length-1;W++)this.totalDistance+=e[W].dist(e[W+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const p=p0[i.type]==="Polygon";let m=e.length;for(;m>=2&&e[m-1].equals(e[m-2]);)m--;let _=0;for(;_<m-1&&e[_].equals(e[_+1]);)_++;if(m<(p?3:2))return;r==="bevel"&&(c=1.05);const v=this.overscaling<=16?15*xt/(512*this.overscaling):0,T=this.segments.prepareSegment(10*m,this.layoutVertexArray,this.indexArray);let E,A,C,L,F;this.e1=this.e2=-1,p&&(E=e[m-2],F=e[_].sub(E)._unit()._perp());for(let W=_;W<m;W++){if(C=W===m-1?p?e[_+1]:void 0:e[W+1],C&&e[W].equals(C))continue;F&&(L=F),E&&(A=E),E=e[W],F=C?C.sub(E)._unit()._perp():L,L=L||F;let $=L.add(F);$.x===0&&$.y===0||$._unit();const X=L.x*F.x+L.y*F.y,J=$.x*F.x+$.y*F.y,ie=J!==0?1/J:1/0,te=2*Math.sqrt(2-2*J),be=J<f0&&A&&C,ye=L.x*F.y-L.y*F.x>0;if(be&&W>_){const Ee=E.dist(A);if(Ee>2*v){const Be=E.sub(E.sub(A)._mult(v/Ee)._round());this.updateDistance(A,Be),this.addCurrentVertex(Be,L,0,0,T),A=Be}}const ke=A&&C;let je=ke?r:p?"butt":a;if(ke&&je==="round"&&(ie<h?je="miter":ie<=2&&(je="fakeround")),je==="miter"&&ie>c&&(je="bevel"),je==="bevel"&&(ie>2&&(je="flipbevel"),ie<c&&(je="miter")),A&&this.updateDistance(A,E),je==="miter")$._mult(ie),this.addCurrentVertex(E,$,0,0,T);else if(je==="flipbevel"){if(ie>100)$=F.mult(-1);else{const Ee=ie*L.add(F).mag()/L.sub(F).mag();$._perp()._mult(Ee*(ye?-1:1))}this.addCurrentVertex(E,$,0,0,T),this.addCurrentVertex(E,$.mult(-1),0,0,T)}else if(je==="bevel"||je==="fakeround"){const Ee=-Math.sqrt(ie*ie-1),Be=ye?Ee:0,Oe=ye?0:Ee;if(A&&this.addCurrentVertex(E,L,Be,Oe,T),je==="fakeround"){const Ue=Math.round(180*te/Math.PI/20);for(let Xe=1;Xe<Ue;Xe++){let Ae=Xe/Ue;if(Ae!==.5){const ht=Ae-.5;Ae+=Ae*ht*(Ae-1)*((1.0904+X*(X*(3.55645-1.43519*X)-3.2452))*ht*ht+(.848013+X*(.215638*X-1.06021)))}const et=F.sub(L)._mult(Ae)._add(L)._unit()._mult(ye?-1:1);this.addHalfVertex(E,et.x,et.y,!1,ye,0,T)}}C&&this.addCurrentVertex(E,F,-Be,-Oe,T)}else if(je==="butt")this.addCurrentVertex(E,$,0,0,T);else if(je==="square"){const Ee=A?1:-1;A||this.addCurrentVertex(E,$,Ee,Ee,T),this.addCurrentVertex(E,$,0,0,T),A&&this.addCurrentVertex(E,$,Ee,Ee,T)}else je==="round"&&(A&&(this.addCurrentVertex(E,L,0,0,T),this.addCurrentVertex(E,L,1,1,T,!0)),C&&(this.addCurrentVertex(E,F,-1,-1,T,!0),this.addCurrentVertex(E,F,0,0,T)));if(be&&W<m-1){const Ee=E.dist(C);if(Ee>2*v){const Be=E.add(C.sub(E)._mult(v/Ee)._round());this.updateDistance(E,Be),this.addCurrentVertex(Be,F,0,0,T),E=Be}}}}addCurrentVertex(e,i,r,a,c,h=!1){const p=i.y*a-i.x,m=-i.y-i.x*a;this.addHalfVertex(e,i.x+i.y*r,i.y-i.x*r,h,!1,r,c),this.addHalfVertex(e,p,m,h,!0,-a,c)}addHalfVertex({x:e,y:i},r,a,c,h,p,m){this.layoutVertexArray.emplaceBack((e<<1)+(c?1:0),(i<<1)+(h?1:0),Math.round(63*r)+128,Math.round(63*a)+128,1+(p===0?0:p<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const _=m.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,_),m.primitiveLength++),h?this.e2=_:this.e1=_}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,i){this.distance+=e.dist(i),this.updateScaledDistance()}}ct(ih,"LineBucket",{omit:["layers","patternFeatures"]});const m0=new K({"line-cap":new V(Ce.layout_line["line-cap"]),"line-join":new V(Ce.layout_line["line-join"]),"line-miter-limit":new z(Ce.layout_line["line-miter-limit"]),"line-round-limit":new z(Ce.layout_line["line-round-limit"]),"line-sort-key":new V(Ce.layout_line["line-sort-key"])});var Em={paint:new K({"line-opacity":new V(Ce.paint_line["line-opacity"]),"line-color":new V(Ce.paint_line["line-color"]),"line-translate":new z(Ce.paint_line["line-translate"]),"line-translate-anchor":new z(Ce.paint_line["line-translate-anchor"]),"line-width":new V(Ce.paint_line["line-width"]),"line-gap-width":new V(Ce.paint_line["line-gap-width"]),"line-offset":new V(Ce.paint_line["line-offset"]),"line-blur"
vendor: 5,240 bytes, line 8
8:new V(Ce.paint_line["line-blur"]),"line-dasharray":new V(Ce.paint_line["line-dasharray"]),"line-pattern":new V(Ce.paint_line["line-pattern"]),"line-gradient":new H(Ce.paint_line["line-gradient"]),"line-trim-offset":new z(Ce.paint_line["line-trim-offset"])}),layout:m0};const Sm=new class extends V{possiblyEvaluate(t,e){return e=new w(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,r){return e=$t({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,r)}}(Em.paint.properties["line-width"].specification);function Im(t,e){return e>0?e+2*t:t}Sm.useIntegerZoom=!0;const _0=pe([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),g0=pe([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),y0=pe([{name:"a_projected_pos",components:4,type:"Float32"}],4);pe([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const x0=pe([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),v0=pe([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);pe([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Mm=pe([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),b0=pe([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);pe([{name:"triangle",components:3,type:"Uint16"}]),pe([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),pe([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),pe([{type:"Float32",name:"offsetX"}]),pe([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var yn=24;const Qr=128;function kd(t,e){const{expression:i}=e;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new w(t+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:r,interpolationType:a}=i;let c=0;for(;c<r.length&&r[c]<=t;)c++;c=Math.max(0,c-1);let h=c;for(;h<r.length&&r[h]<t+1;)h++;h=Math.min(r.length-1,h);const p=r[c],m=r[h];return i.kind==="composite"?{kind:"composite",minZoom:p,maxZoom:m,interpolationType:a}:{kind:"camera",minZoom:p,maxZoom:m,minSize:i.evaluate(new w(p)),maxSize:i.evaluate(new w(m)),interpolationType:a}}}function nh(t,{uSize:e,uSizeT:i},{lowerSize:r,upperSize:a}){return t.kind==="source"?r/Qr:t.kind==="composite"?ii(r/Qr,a/Qr,i):e}function $a(t,e){let i=0,r=0;if(t.kind==="constant")r=t.layoutSize;else if(t.kind!=="source"){const{interpolationType:a,minZoom:c,maxZoom:h}=t,p=a?St(wr.interpolationFactor(a,e,c,h),0,1):0;t.kind==="camera"?r=ii(t.minSize,t.maxSize,p):i=p}return{uSizeT:i,uSize:r}}var w0=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:Qr,evaluateSizeForFeature:nh,evaluateSizeForZoom:$a,get
vendor: 5,814 bytes, line 8
8SizeData:kd});function T0(t,e,i){return t.sections.forEach(r=>{r.text=function(a,c,h){const p=c.layout.get("text-transform").evaluate(h,{});return p==="uppercase"?a=a.toLocaleUpperCase():p==="lowercase"&&(a=a.toLocaleLowerCase()),y.applyArabicShaping&&(a=y.applyArabicShaping(a)),a}(r.text,e,i)}),t}const Ac={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function E0(t){return t==="︶"||t==="﹈"||t==="︸"||t==="﹄"||t==="﹂"||t==="︾"||t==="︼"||t==="︺"||t==="︘"||t==="﹀"||t==="︐"||t==="︓"||t==="︔"||t==="`"||t===" ̄"||t==="︑"||t==="︒"}function S0(t){return t==="︵"||t==="﹇"||t==="︷"||t==="﹃"||t==="﹁"||t==="︽"||t==="︻"||t==="︹"||t==="︗"||t==="︿"}var Am=Ti,Cm=function(t,e,i,r,a){var c,h,p=8*a-r-1,m=(1<<p)-1,_=m>>1,v=-7,T=i?a-1:0,E=i?-1:1,A=t[e+T];for(T+=E,c=A&(1<<-v)-1,A>>=-v,v+=p;v>0;c=256*c+t[e+T],T+=E,v-=8);for(h=c&(1<<-v)-1,c>>=-v,v+=r;v>0;h=256*h+t[e+T],T+=E,v-=8);if(c===0)c=1-_;else{if(c===m)return h?NaN:1/0*(A?-1:1);h+=Math.pow(2,r),c-=_}return(A?-1:1)*h*Math.pow(2,c-r)},km=function(t,e,i,r,a,c){var h,p,m,_=8*c-a-1,v=(1<<_)-1,T=v>>1,E=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:c-1,C=r?1:-1,L=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(p=isNaN(e)?1:0,h=v):(h=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-h))<1&&(h--,m*=2),(e+=h+T>=1?E/m:E*Math.pow(2,1-T))*m>=2&&(h++,m/=2),h+T>=v?(p=0,h=v):h+T>=1?(p=(e*m-1)*Math.pow(2,a),h+=T):(p=e*Math.pow(2,T-1)*Math.pow(2,a),h=0));a>=8;t[i+A]=255&p,A+=C,p/=256,a-=8);for(h=h<<a|p,_+=a;_>0;t[i+A]=255&h,A+=C,h/=256,_-=8);t[i+A-C]|=128*L};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function Ti(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ti.Varint=0,Ti.Fixed64=1,Ti.Bytes=2,Ti.Fixed32=5;var Pd=4294967296,Pm=1/Pd,zm=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function No(t){return t.type===Ti.Bytes?t.readVarint()+t.pos:t.pos+1}function el(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Lm(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var a=i.pos-1;a>=t;a--)i.buf[a+r]=i.buf[a]}function I0(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function M0(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function A0(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function C0(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function k0(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function P0(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function z0(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function L0(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function D0(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function rh(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function tl(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Dm(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Ti.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),a=r>>3,c=this.pos;this.type=7&r,t(a,e,this),this.pos===c&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=rh(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Dm(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=rh(this.buf,this.pos)+rh(this.buf,this.pos+4)*Pd;return this.pos+=8,t},readSFixed64:function(){var t=rh(this.buf,this.pos)+Dm(this.buf,this.pos+4)*Pd;return this.pos+=8,t},readFloat:function(){var t=Cm(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Cm(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,r=this.buf;return e=127&(i=r[this.pos++]),i<128?e:(e|=(127&(i=r[this.pos++]))<<7,i<128?e:(e|=(127&(i=r[this.pos++]))<<14,i<128?e:(e|=(127&(i=r[this.pos++]))<<21,i<128?e:function(a,c,h){var p,m,_=h.buf;if(p=(112&(m=_[h.pos++]))>>4,m<128||(p|=(127&(m=_[h.pos++]))<<3,m<128)||(p|=(127&(m=_[h.pos++]))<<10,m<128)||(p|=(127&(m=_[h.pos++]))<<17,m<128)||(p|=(127&(m=_[h.pos++]))<<24,m<128)||(p|=(1&(m=_[h.pos++]))<<31,m<128))return el(a,p,c);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&zm?function(i,r,a){return zm.decode(i.subarray(r,a))}(this.buf,e,t):function(i,r,a){for(var c="",h=r;h<a;){var p,m,_,v=i[h],T=null,E=v>239?4:v>223?3:v>191?2:1;if(h+E>a)break;E===1?v<128&&(T=v):E===2?(192&(p=i[h+1]))==128&&(T=(31&v)<<6|63&p)<=127&&(T=null):E===3?
vendor: 4,164 bytes, line 8
8(m=i[h+2],(192&(p=i[h+1]))==128&&(192&m)==128&&((T=(15&v)<<12|(63&p)<<6|63&m)<=2047||T>=55296&&T<=57343)&&(T=null)):E===4&&(m=i[h+2],_=i[h+3],(192&(p=i[h+1]))==128&&(192&m)==128&&(192&_)==128&&((T=(15&v)<<18|(63&p)<<12|(63&m)<<6|63&_)<=65535||T>=1114112)&&(T=null)),T===null?(T=65533,E=1):T>65535&&(T-=65536,c+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),c+=String.fromCharCode(T),h+=E}return c}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Ti.Bytes)return t.push(this.readVarint(e));var i=No(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Ti.Bytes)return t.push(this.readSVarint());var e=No(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Ti.Bytes)return t.push(this.readBoolean());var e=No(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Ti.Bytes)return t.push(this.readFloat());var e=No(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Ti.Bytes)return t.push(this.readDouble());var e=No(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Ti.Bytes)return t.push(this.readFixed32());var e=No(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Ti.Bytes)return t.push(this.readSFixed32());var e=No(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Ti.Bytes)return t.push(this.readFixed64());var e=No(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Ti.Bytes)return t.push(this.readSFixed64());var e=No(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Ti.Varint)for(;this.buf[this.pos++]>127;);else if(e===Ti.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ti.Fixed32)this.pos+=4;else{if(e!==Ti.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),tl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),tl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),tl(this.buf,-1&t,this.pos),tl(this.buf,Math.floor(t*Pm),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),tl(this.buf,-1&t,this.pos),tl(this.buf,Math.floor(t*Pm),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(e,i){var r,a;if(e>=0?(r=e%4294967296|0,a=e/4294967296|0):(a=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,a=a+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),function(c,h,p){p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,p.buf[p.pos]=127&(c>>>=7)}(r,0,i),function(c,h){var p=(7&c)<<4;h.buf[h.pos++]|=p|((c>>>=3)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c)))))}(a,i)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(!!t)},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(r,a,c){for(var h,p,m=0;m<a.length;
vendor: 8,041 bytes, line 8
8m++){if((h=a.charCodeAt(m))>55295&&h<57344){if(!p){h>56319||m+1===a.length?(r[c++]=239,r[c++]=191,r[c++]=189):p=h;continue}if(h<56320){r[c++]=239,r[c++]=191,r[c++]=189,p=h;continue}h=p-55296<<10|h-56320|65536,p=null}else p&&(r[c++]=239,r[c++]=191,r[c++]=189,p=null);h<128?r[c++]=h:(h<2048?r[c++]=h>>6|192:(h<65536?r[c++]=h>>12|224:(r[c++]=h>>18|240,r[c++]=h>>12&63|128),r[c++]=h>>6&63|128),r[c++]=63&h|128)}return c}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Lm(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),km(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),km(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var r=this.pos-i;r>=128&&Lm(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,i){this.writeTag(t,Ti.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,I0,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,M0,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,k0,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,A0,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,C0,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,P0,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,z0,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,L0,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,D0,e)},writeBytesField:function(t,e){this.writeTag(t,Ti.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Ti.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Ti.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Ti.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Ti.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Ti.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Ti.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Ti.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Ti.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Ti.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};var oh=lt(Am);const zd=3;function R0(t,e,i){e.glyphs=[],t===1&&i.readMessage(B0,e)}function B0(t,e,i){if(t===3){const{id:r,bitmap:a,width:c,height:h,left:p,top:m,advance:_}=i.readMessage(O0,{});e.glyphs.push({id:r,bitmap:new Vo({width:c+2*zd,height:h+2*zd},a),metrics:{width:c,height:h,left:p,top:m,advance:_}})}else t===4?e.ascender=i.readSVarint():t===5&&(e.descender=i.readSVarint())}function O0(t,e,i){t===1?e.id=i.readVarint():t===2?e.bitmap=i.readBytes():t===3?e.width=i.readVarint():t===4?e.height=i.readVarint():t===5?e.left=i.readSVarint():t===6?e.top=i.readSVarint():t===7&&(e.advance=i.readVarint())}const Rm=zd;function Ld(t){let e=0,i=0;for(const h of t)e+=h.w*h.h,i=Math.max(i,h.w);t.sort((h,p)=>p.h-h.h);const r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let a=0,c=0;for(const h of t)for(let p=r.length-1;p>=0;p--){const m=r[p];if(!(h.w>m.w||h.h>m.h)){if(h.x=m.x,h.y=m.y,c=Math.max(c,h.y+h.h),a=Math.max(a,h.x+h.w),h.w===m.w&&h.h===m.h){const _=r.pop();p<r.length&&(r[p]=_)}else h.h===m.h?(m.x+=h.w,m.w-=h.w):h.w===m.w?(m.y+=h.h,m.h-=h.h):(r.push({x:m.x+h.w,y:m.y,w:m.w-h.w,h:h.h}),m.y+=h.h,m.h-=h.h);break}}return{w:a,h:c,fill:e/(a*c)||0}}const Xn=1;class Dd{constructor(e,{pixelRatio:i,version:r,stretchX:a,stretchY:c,content:h}){this.paddedRect=e,this.pixelRatio=i,this.stretchX=a,this.stretchY=c,this.content=h,this.version=r}get tl(){return[this.paddedRect.x+Xn,this.paddedRect.y+Xn]}get br(){return[this.paddedRect.x+this.paddedRect.w-Xn,this.paddedRect.y+this.paddedRect.h-Xn]}get displaySize(){return[(this.paddedRect.w-2*Xn)/this.pixelRatio,(this.paddedRect.h-2*Xn)/this.pixelRatio]}}class Bm{constructor(e,i){const r={},a={};this.haveRenderCallbacks=[];const c=[];this.addImages(e,r,c),this.addImages(i,a,c);const{w:h,h:p}=Ld(c),m=new ir({width:h||1,height:p||1});for(const _ in e){const v=e[_],T=r[_].paddedRect;ir.copy(v.data,m,{x:0,y:0},{x:T.x+Xn,y:T.y+Xn},v.data)}for(const _ in i){const v=i[_],T=a[_].paddedRect,E=T.x+Xn,A=T.y+Xn,C=v.data.width,L=v.data.height;ir.copy(v.data,m,{x:0,y:0},{x:E,y:A},v.data),ir.copy(v.data,m,{x:0,y:L-1},{x:E,y:A-1},{width:C,height:1}),ir.copy(v.data,m,{x:0,y:0},{x:E,y:A+L},{width:C,height:1}),ir.copy(v.data,m,{x:C-1,y:0},{x:E-1,y:A},{width:1,height:L}),ir.copy(v.data,m,{x:0,y:0},{x:E+C,y:A},{width:1,height:L})}this.image=m,this.iconPositions=r,this.patternPositions=a}addImages(e,i,r){for(const a in e){const c=e[a],h={x:0,y:0,w:c.data.width+2*Xn,h:c.data.height+2*Xn};r.push(h),i[a]=new Dd(h,c),c.hasRenderCallback&&this.haveRenderCallbacks.push(a)}}patchUpdatedImages(e,i){this.haveRenderCallbacks=this.haveRenderCallbacks.filter(r=>e.hasImage(r)),e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const r in e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),i),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),i)}patchUpdatedImage(e,i,r){if(!e||!i||e.version===i.version)return;e.version=i.version;const[a,c]=e.tl;r.update(i.data,void 0,{x:a,y:c})}}ct(Dd,"ImagePosition"),ct(Bm,"ImageAtlas");const fr={horizontal:1,vertical:2,horizontalOnly:3},Om=-17;class Cc{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,i){const r=new Cc;return r.scale=e||1,r.fontStack=i,r}static forImage(e){const i=new Cc;return i.imageName=e,i}}class il{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,i){const r=new il;for(let a=0;a<e.sections.length;a++){const c=e.sections[a];c.image?r.addImageSection(c):r.addTextSection(c,i)}return r}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSections(){return this.sections}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(e){this.text=function(i,r){let a="";for(let c=0;c<i.length;c++){const h=i.charCodeAt(c+1)||null,p=i.charCodeAt(c-1)||null;a+=!r&&(h&&Du(h)&&!Ac[i[c+1]]||p&&Du(p)&&!Ac[i[c-1]])||!Ac[i[c]]?i[c]:Ac[i[c]]}return a}(this.text,e)}trim(){let e=0;for(let r=0;r<this.text.length&&sh[this.text.charCodeAt(r)];r++)e++;let i=this.text.length;for(let r=this.text.length-1;r>=0&&r>=e&&sh[this.text.charCodeAt(r)];r--)i--;this.text=this.text.substring(e,i),this.sectionIndex=this.sectionIndex.slice(e,i)}substring(e,i){const r=new il;return r.text=this.text.substring(e,i),r.sectionIndex=this.sectionIndex.slice(e,i),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,i)=>Math.max(e,this.sections[i].scale),0)}addTextSection(e,i){this.text+=e.text,this.sections.push(Cc.forText(e.scale,e.fontStack||i));const r=this.sections.length-1;for(let a=0;a<e.text.length;++a)this.sectionIndex.push(r)}addImageSection(e){const i=e.image?e.image.name:"";if(i.length===0)return void wi("Can't add FormattedSection with an empty image.");const r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(Cc.forImage(i)),this.sectionIndex.push(this.sections.length-1)):wi("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Rd(t,e,i,r,a,c,h,p,m,_,v,T,E,A,C){const L=il.fromFeature(t,a);T===fr.vertical&&L.verticalizePunctuation(E);let F=[];const W=function(te,be,ye,ke,je,Ee){if(!te)return[];const Be=[],Oe=function(et,ht,it,Rt,He,_t){let Bt=0;for(let si=0;si<et.length();si++){const Ot=et.getSection(si);
8Bt+=Fm(et.getCharCode(si),Ot,Rt,He,ht,_t)}return Bt/Math.max(1,Math.ceil(Bt/it))}(te,be,ye,ke,je,Ee),Ue=te.text.indexOf("​")>=0;let Xe=0;for(let et=0;et<te.length();et++){const ht=te.getSection(et),it=te.getCharCode(et);if(sh[it]||(Xe+=Fm(it,ht,ke,je,be,Ee)),et<te.length()-1){const Rt=!((Ae=it)<11904||!(rt["Bopomofo Extended"](Ae)||rt.Bopomofo(Ae)||rt["CJK Compatibility Forms"](Ae)||rt["CJK Compatibility Ideographs"](Ae)||rt["CJK Compatibility"](Ae)||rt["CJK Radicals Supplement"](Ae)||rt["CJK Strokes"](Ae)||rt["CJK Symbols and Punctuation"](Ae)||rt["CJK Unified Ideographs Extension A"](Ae)||rt["CJK Unified Ideographs"](Ae)||rt["Enclosed CJK Letters and Months"](Ae)||rt["Halfwidth and Fullwidth Forms"](Ae)||rt.Hiragana(Ae)||rt["Ideographic Description Characters"](Ae)||rt["Kangxi Radicals"](Ae)||rt["Katakana Phonetic Extensions"](Ae)||rt.Katakana(Ae)||rt["Vertical Forms"](Ae)||rt["Yi Radicals"](Ae)||rt["Yi Syllables"](Ae)));(F0[it]||Rt||ht.imageName)&&Be.push(Vm(et+1,Xe,Oe,Be,U0(it,te.getCharCode(et+1),Rt&&Ue),!1))}}var Ae;return Nm(Vm(te.length(),Xe,Oe,Be,0,!0))}(L,_,c,e,r,A),{processBidirectionalText:$,processStyledBidirectionalText:X}=y;if($&&L.sections.length===1){const te=$(L.toString(),W);for(const be of te){const ye=new il;ye.text=be,ye.sections=L.sections;for(let ke=0;ke<be.length;ke++)ye.sectionIndex.push(0);F.push(ye)}}else if(X){const te=X(L.text,L.sectionIndex,W);for(const be of te){const ye=new il;ye.text=be[0],ye.sectionIndex=be[1],ye.sections=L.sections,F.push(ye)}}else F=function(te,be){const ye=[],ke=te.text;let je=0;for(const Ee of be)ye.push(te.substring(je,Ee)),je=Ee;return je<ke.length&&ye.push(te.substring(je,ke.length)),ye}(L,W);const J=[],ie={positionedLines:J,text:L.toString(),top:v[1],bottom:v[1],left:v[0],right:v[0],writingMode:T,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(te,be,ye,ke,je,Ee,Be,Oe,Ue,Xe,Ae,et){let ht=0,it=0,Rt=0;const He=Oe==="right"?1:Oe==="left"?0:.5;let _t=!1;for(const Ft of je){const Ut=Ft.getSections();for(const xi of Ut){if(xi.imageName)continue;const Ei=be[xi.fontStack];if(Ei&&(_t=Ei.ascender!==void 0&&Ei.descender!==void 0,!_t))break}if(!_t)break}let Bt=0;for(const Ft of je){Ft.trim();const Ut=Ft.getMaxScale(),xi=(Ut-1)*yn,Ei={positionedGlyphs:[],lineOffset:0};te.positionedLines[Bt]=Ei;const Si=Ei.positionedGlyphs;let vi=0;if(!Ft.length()){it+=Ee,++Bt;continue}let Di=0,Fi=0;for(let bi=0;bi<Ft.length();bi++){const tn=Ft.getSection(bi),Yi=Ft.getSectionIndex(bi),Ri=Ft.getCharCode(bi);let ci=tn.scale,Ji=null,Ii=null,Nn=null,Qi=yn,xn=0;const hn=!(Ue===fr.horizontal||!Ae&&!ic(Ri)||Ae&&(sh[Ri]||(si=Ri,rt.Arabic(si)||rt["Arabic Supplement"](si)||rt["Arabic Extended-A"](si)||rt["Arabic Presentation Forms-A"](si)||rt["Arabic Presentation Forms-B"](si))));if(tn.imageName){const jn=ke[tn.imageName];if(!jn)continue;Nn=tn.imageName,te.iconsInText=te.iconsInText||!0,Ii=jn.paddedRect;const dn=jn.displaySize;ci=ci*yn/et,Ji={width:dn[0],height:dn[1],left:Xn,top:-Rm,advance:hn?dn[1]:dn[0],localGlyph:!1},xn=_t?-Ji.height*ci:Om+Ut*yn-dn[1]*ci,Qi=Ji.advance;const to=(hn?dn[0]:dn[1])*ci-yn*Ut;to>0&&to>vi&&(vi=to)}else{const jn=ye[tn.fontStack];if(!jn)continue;jn[Ri]&&(Ii=jn[Ri]);const dn=be[tn.fontStack];if(!dn)continue;const to=dn.glyphs[Ri];if(!to)continue;if(Ji=to.metrics,Qi=Ri!==8203?yn:0,_t){const cl=dn.ascender!==void 0?Math.abs(dn.ascender):0,Uc=dn.descender!==void 0?Math.abs(dn.descender):0,Vc=(cl+Uc)*ci;Di<Vc&&(Di=Vc,Fi=(cl-Uc)/2*ci),xn=-cl*ci}
vendor: 16,626 bytes, line 8
8else xn=Om+(Ut-ci)*yn}hn?(te.verticalizable=!0,Si.push({glyph:Ri,imageName:Nn,x:ht,y:it+xn,vertical:hn,scale:ci,localGlyph:Ji.localGlyph,fontStack:tn.fontStack,sectionIndex:Yi,metrics:Ji,rect:Ii}),ht+=Qi*ci+Xe):(Si.push({glyph:Ri,imageName:Nn,x:ht,y:it+xn,vertical:hn,scale:ci,localGlyph:Ji.localGlyph,fontStack:tn.fontStack,sectionIndex:Yi,metrics:Ji,rect:Ii}),ht+=Ji.advance*ci+Xe)}Si.length!==0&&(Rt=Math.max(ht-Xe,Rt),_t?jm(Si,He,vi,Fi,Ee*Ut/2):jm(Si,He,vi,0,Ee/2)),ht=0;const Ki=Ee*Ut+vi;Ei.lineOffset=Math.max(vi,xi),it+=Ki,++Bt}var si;const Ot=it,{horizontalAlign:Et,verticalAlign:Ai}=Bd(Be);(function(Ft,Ut,xi,Ei,Si,vi){const Di=(Ut-xi)*Si,Fi=-vi*Ei;for(const Ki of Ft)for(const bi of Ki.positionedGlyphs)bi.x+=Di,bi.y+=Fi})(te.positionedLines,He,Et,Ai,Rt,Ot),te.top+=-Ai*Ot,te.bottom=te.top+Ot,te.left+=-Et*Rt,te.right=te.left+Rt,te.hasBaseline=_t}(ie,e,i,r,F,h,p,m,T,_,E,C),!function(te){for(const be of te)if(be.positionedGlyphs.length!==0)return!1;return!0}(J)&&ie}const sh={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},F0={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 Fm(t,e,i,r,a,c){if(e.imageName){const h=r[e.imageName];return h?h.displaySize[0]*e.scale*yn/c+a:0}{const h=i[e.fontStack],p=h&&h.glyphs[t];return p?p.metrics.advance*e.scale+a:0}}function Um(t,e,i,r){const a=Math.pow(t-e,2);return r?t<e?a/2:2*a:a+Math.abs(i)*i}function U0(t,e,i){let r=0;return t===10&&(r-=1e4),i&&(r+=150),t!==40&&t!==65288||(r+=50),e!==41&&e!==65289||(r+=50),r}function Vm(t,e,i,r,a,c){let h=null,p=Um(e,i,a,c);for(const m of r){const _=Um(e-m.x,i,a,c)+m.badness;_<=p&&(h=m,p=_)}return{index:t,x:e,priorBreak:h,badness:p}}function Nm(t){return t?Nm(t.priorBreak).concat(t.index):[]}function Bd(t){let e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function jm(t,e,i,r,a){if(!(e||i||r||a))return;const c=t.length-1,h=t[c],p=(h.x+h.metrics.advance*h.scale)*e;for(let m=0;m<=c;m++)t[m].x-=p,t[m].y+=i+r+a}function V0(t,e,i){const{horizontalAlign:r,verticalAlign:a}=Bd(i),c=e[0]-t.displaySize[0]*r,h=e[1]-t.displaySize[1]*a;return{image:t,top:h,bottom:h+t.displaySize[1],left:c,right:c+t.displaySize[0]}}function Gm(t,e,i,r,a,c){const h=t.image;let p;if(h.content){const F=h.content,W=h.pixelRatio||1;p=[F[0]/W,F[1]/W,h.displaySize[0]-F[2]/W,h.displaySize[1]-F[3]/W]}const m=e.left*c,_=e.right*c;let v,T,E,A;i==="width"||i==="both"?(A=a[0]+m-r[3],T=a[0]+_+r[1]):(A=a[0]+(m+_-h.displaySize[0])/2,T=A+h.displaySize[0]);const C=e.top*c,L=e.bottom*c;return i==="height"||i==="both"?(v=a[1]+C-r[0],E=a[1]+L+r[2]):(v=a[1]+(C+L-h.displaySize[1])/2,E=v+h.displaySize[1]),{image:h,top:v,right:T,bottom:E,left:A,collisionPadding:p}}class jo extends Re{constructor(e,i,r,a,c){super(e,i),this.angle=a,this.z=r,c!==void 0&&(this.segment=c)}clone(){return new jo(this.x,this.y,this.z,this.angle,this.segment)}}function Zm(t,e,i,r,a){if(e.segment===void 0)return!0;let c=e,h=e.segment+1,p=0;for(;p>-i/2;){if(h--,h<0)return!1;p-=t[h].dist(c),c=t[h]}p+=t[h].dist(t[h+1]),h++;const m=[];let _=0;for(;p<i/2;){const v=t[h],T=t[h+1];if(!T)return!1;let E=t[h-1].angleTo(v)-v.angleTo(T);for(E=Math.abs((E+3*Math.PI)%(2*Math.PI)-Math.PI),m.push({distance:p,angleDelta:E}),_+=E;p-m[0].distance>r;)_-=m.shift().angleDelta;if(_>a)return!1;h++,p+=v.dist(T)}return!0}function qm(t){let e=0;for(let i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function Wm(t,e,i){return t?.6*e*i:0}function Xm(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function N0(t,e,i,r,a,c){const h=Wm(i,a,c),p=Xm(i,r)*c;let m=0;const _=qm(t)/2;for(let v=0;v<t.length-1;v++){const T=t[v],E=t[v+1],A=T.dist(E);if(m+A>_){const C=(_-m)/A,L=ii(T.x,E.x,C),F=ii(T.y,E.y,C),W=new jo(L,F,0,E.angleTo(T),v);return!h||Zm(t,W,p,h,e)?W:void 0}m+=A}}function j0(t,e,i,r,a,c,h,p,m){const _=Wm(r,c,h),v=Xm(r,a),T=v*h,E=t[0].x===0||t[0].x===m||t[0].y===0||t[0].y===m;return e-T<e/4&&(e=T+e/4),Hm(t,E?e/2*p%e:(v/2+2*c)*h*p%e,e,_,i,T,E,!1,m)}function Hm(t,e,i,r,a,c,h,p,m){const _=c/2,v=qm(t);let T=0,E=e-i,A=[];for(let C=0;C<t.length-1;C++){const L=t[C],F=t[C+1],W=L.dist(F),$=F.angleTo(L);for(;E+i<T+W;){E+=i;const X=(E-T)/W,J=ii(L.x,F.x,X),ie=ii(L.y,F.y,X);if(J>=0&&J<m&&ie>=0&&ie<m&&E-_>=0&&E+_<=v){const te=new jo(J,ie,0,$,C);te._round(),r&&!Zm(t,te,c,r,a)||A.push(te)}}T+=W}return p||A.length||h||(A=Hm(t,T/2,i,r,a,c,h,!0,m)),A}function Km(t,e,i,r,a){const c=[];for(let h=0;h<t.length;h++){const p=t[h];let m;for(let _=0;_<p.length-1;_++){let v=p[_],T=p[_+1];v.x<e&&T.x<e||(v.x<e?v=new Re(e,v.y+(e-v.x)/(T.x-v.x)*(T.y-v.y))._round():T.x<e&&(T=new Re(e,v.y+(e-v.x)/(T.x-v.x)*(T.y-v.y))._round()),v.y<i&&T.y<i||(v.y<i?v=new Re(v.x+(i-v.y)/(T.y-v.y)*(T.x-v.x),i)._round():T.y<i&&(T=new Re(v.x+(i-v.y)/(T.y-v.y)*(T.x-v.x),i)._round()),v.x>=r&&T.x>=r||(v.x>=r?v=new Re(r,v.y+(r-v.x)/(T.x-v.x)*(T.y-v.y))._round():T.x>=r&&(T=new Re(r,v.y+(r-v.x)/(T.x-v.x)*(T.y-v.y))._round()),v.y>=a&&T.y>=a||(v.y>=a?v=new Re(v.x+(a-v.y)/(T.y-v.y)*(T.x-v.x),a)._round():T.y>=a&&(T=new Re(v.x+(a-v.y)/(T.y-v.y)*(T.x-v.x),a)._round()),m&&v.equals(m[m.length-1])||(m=[v],c.push(m)),m.push(T)))))}}return c}ct(jo,"Anchor");const kc=1e20;function Ym(t,e,i,r,a,c,h,p,m){for(let _=e;_<e+r;_++)Jm(t,i*c+_,c,a,h,p,m);for(let _=i;_<i+a;_++)Jm(t,_*c+e,1,r,h,p,m)}function Jm(t,e,i,r,a,c,h){c[0]=0,h[0]=-kc,h[1]=kc,a[0]=t[e];for(let p=1,m=0,_=0;p<r;p++){a[p]=t[e+p*i];const v=p*p;do{const T=c[m];_=(a[p]-a[T]+v-T*T)/(p-T)/2}while(_<=h[m]&&--m>-1);m++,c[m]=p,h[m]=_,h[m+1]=kc}for(let p=0,m=0;p<r;p++){for(;h[m+1]<p;)m++;const _=c[m],v=p-_;t[e+p*i]=a[_]+v*v}}const $r=2,Od={none:0,ideographs:1,all:2};class nl{constructor(e,i,r){this.requestManager=e,this.localGlyphMode=i,this.localFontFamily=r,this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(e){this.url=e}getGlyphs(e,i){const r=[];for(const a in e)for(const c of e[a])r.push({stack:a,id:c});ai(r,({stack:a,id:c},h)=>{let p=this.entries[a];p||(p=this.entries[a]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let m=p.glyphs[c];if(m!==void 0)return void h(null,{stack:a,id:c,glyph:m});if(m=this._tinySDF(p,a,c),m)return p.glyphs[c]=m,void h(null,{stack:a,id:c,glyph:m});const _=Math.floor(c/256);if(256*_>65535)return void h(new Error("glyphs > 65535 not supported"));if(p.ranges[_])return void h(null,{stack:a,id:c,glyph:m});let v=p.requests[_];v||(v=p.requests[_]=[],nl.loadGlyphRange(a,_,this.url,this.requestManager,(T,E)=>{if(E){p.ascender=E.ascender,p.descender=E.descender;for(const A in E.glyphs)this._doesCharSupportLocalGlyph(+A)||(p.glyphs[+A]=E.glyphs[+A]);p.ranges[_]=!0}for(const A of v)A(T,E);delete p.requests[_]})),v.push((T,E)=>{T?h(T):E&&h(null,{stack:a,id:c,glyph:E.glyphs[c]||null})})},(a,c)=>{if(a)i(a);else if(c){const h={};for(const{stack:p,id:m,glyph:_}of c)h[p]===void 0&&(h[p]={}),h[p].glyphs===void 0&&(h[p].glyphs={}),h[p].glyphs[m]=_&&{id:_.id,bitmap:_.bitmap.clone(),metrics:_.metrics},h[p].ascender=this.entries[p].ascender,h[p].descender=this.entries[p].descender;i(null,h)}})}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==Od.none&&(this.localGlyphMode===Od.all?!!this.localFontFamily:!!this.localFontFamily&&(rt["CJK Unified Ideographs"](e)||rt["Hangul Syllables"](e)||rt.Hiragana(e)||rt.Katakana(e)||rt["CJK Symbols and Punctuation"](e)))}_tinySDF(e,i,r){const a=this.localFontFamily;if(!a||!this._doesCharSupportLocalGlyph(r))return;let c=e.tinySDF;if(!c){let L="400";/bold/i.test(i)?L="900":/medium/i.test(i)?L="500":/light/i.test(i)&&(L="200"),c=e.tinySDF=new nl.TinySDF({fontFamily:a,fontWeight:L,fontSize:24*$r,buffer:3*$r,radius:8*$r}),c.fontWeight=L}if(this.localGlyphs[c.fontWeight][r])return this.localGlyphs[c.fontWeight][r];const h=String.fromCharCode(r),{data:p,width:m,height:_,glyphWidth:v,glyphHeight:T,glyphLeft:E,glyphTop:A,glyphAdvance:C}=c.draw(h);return this.localGlyphs[c.fontWeight][r]={id:r,bitmap:new Vo({width:m,height:_},p),metrics:{width:v/$r,height:T/$r,left:E/$r,top:A/$r-27,advance:C/$r,localGlyph:!0}}}}nl.loadGlyphRange=function(t,e,i,r,a){const c=256*e,h=c+255,p=r.transformRequest(r.normalizeGlyphsURL(i).replace("{fontstack}",t).replace("{range}",`${c}-${h}`),pi.Glyphs);xr(p,(m,_)=>{if(m)a(m);else if(_){const v={},T=function(E){return new oh(E).readFields(R0,{})}(_);for(const E of T.glyphs)v[E.id]=E;a(null,{glyphs:v,ascender:T.ascender,descender:T.descender})}})},nl.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:i=8,cutoff:r=.25,fontFamily:a="sans-serif",fontWeight:c="normal",fontStyle:h="normal"}={}){this.buffer=e,this.cutoff=r,this.radius=i;const p=this.size=t+4*e,m=this._createCanvas(p),_=this.ctx=m.getContext("2d",{willReadFrequently:!0});_.font=`${h} ${c} ${t}px ${a}`,_.textBaseline="alphabetic",_.textAlign="left",_.fillStyle="black",this.gridOuter=new Float64Array(p*p),this.gridInner=new Float64Array(p*p),this.f=new Float64Array(p),this.z=new Float64Array(p+1),this.v=new Uint16Array(p)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:r,actualBoundingBoxLeft:a,actualBoundingBoxRight:c}=this.ctx.measureText(t),h=Math.ceil(i),p=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(c-a))),m=Math.min(this.size-this.buffer,h+Math.ceil(r)),_=p+2*this.buffer,v=m+2*this.buffer,T=Math.max(_*v,0),E=new Uint8ClampedArray(T),A={data:E,width:_,height:v,glyphWidth:p,glyphHeight:m,glyphTop:h,glyphLeft:0,glyphAdvance:e};if(p===0||m===0)return A;const{ctx:C,buffer:L,gridInner:F,gridOuter:W}=this;C.clearRect(L,L,p,m),C.fillText(t,L,L+h);const $=C.getImageData(L,L,p,m);W.fill(kc,0,T),F.fill(0,0,T);for(let X=0;X<m;X++)for(let J=0;J<p;J++){const ie=$.data[4*(X*p+J)+3]/255;if(ie===0)continue;const te=(X+L)*_+J+L;if(ie===1)W[te]=0,F[te]=kc;else{const be=.5-ie;W[te]=be>0?be*be:0,F[te]=be<0?be*be:0}}Ym(W,0,0,_,v,_,this.f,this.v,this.z),Ym(F,L,L,p,m,_,this.f,this.v,this.z);for(let X=0;X<T;X++){const J=Math.sqrt(W[X])-Math.sqrt(F[X]);E[X]=Math.round(255-255*(J/this.radius+this.cutoff))}return A}};const rl=Xn;function Qm(t,e,i,r){const a=[],c=t.image,h=c.pixelRatio,p=c.paddedRect.w-2*rl,m=c.paddedRect.h-2*rl,_=t.right-t.left,v=t.bottom-t.top,T=c.stretchX||[[0,p]],E=c.stretchY||[[0,m]],A=(Ee,Be)=>Ee+Be[1]-Be[0],C=T.reduce(A,0),L=E.reduce(A,0),F=p-C,W=m-L;let $=0,X=C,J=0,ie=L,te=0,be=F,ye=0,ke=W;if(c.content&&r){const Ee=c.content;$=ah(T,0,Ee[0]),J=ah(E,0,Ee[1]),X=ah(T,Ee[0],Ee[2]),ie=ah(E,Ee[1],Ee[3]),te=Ee[0]-$,ye=Ee[1]-J,be=Ee[2]-Ee[0]-X,ke=Ee[3]-Ee[1]-ie}const je=(Ee,Be,Oe,Ue)=>{const Xe=lh(Ee.stretch-$,X,_,t.left),Ae=ch(Ee.fixed-te,be,Ee.stretch,C),et=lh(Be.stretch-J,ie,v,t.top),ht=ch(Be.fixed-ye,ke,Be.stretch,L),it=lh(Oe.stretch-$,X,_,t.left),Rt=ch(Oe.fixed-te,be,Oe.stretch,C),He=lh(Ue.stretch-J,ie,v,t.top),_t=ch(Ue.fixed-ye,ke,Ue.stretch,L),Bt=new Re(Xe,et),si=new Re(it,et),Ot=new Re(it,He),Et=new Re(Xe,He),Ai=new Re(Ae/h,ht/h),Ft=new Re(Rt/h,_t/h),Ut=e*Math.PI/180;if(Ut){const Si=Math.sin(Ut),vi=Math.cos(Ut),Di=[vi,-Si,Si,vi];Bt._matMult(Di),si._matMult(Di),Et._matMult(Di),Ot._matMult(Di)}const xi=Ee.stretch+Ee.fixed,Ei=Be.stretch+Be.fixed;return{tl:Bt,tr:si,bl:Et,br:Ot,tex:{x:c.paddedRect.x+rl+xi,y:c.paddedRect.y+rl+Ei,w:Oe.stretch+Oe.fixed-xi,h:Ue.stretch+Ue.fixed-Ei},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ai,pixelOffsetBR:Ft,minFontScaleX:be/h/_,minFontScaleY:ke/h/v,isSDF:i}};if(r&&(c.stretchX||c.stretchY)){const Ee=$m(T,F,C),Be=$m(E,W,L);for(let Oe=0;Oe<Ee.length-1;Oe++){const Ue=Ee[Oe],Xe=Ee[Oe+1];for(let Ae=0;Ae<Be.length-1;Ae++)a.push(je(Ue,Be[Ae],Xe,Be[Ae+1]))}}else a.push(je({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:p+1},{fixed:0,stretch:m+1}));return a}function ah(t,e,i){let r=0;for(const a of t)r+=Math.max(e,Math.min(i,a[1]))-Math.max(e,Math.min(i,a[0]));return r}function $m(t,e,i){const r=[{fixed:-rl,stretch:0}];for(const[a,c]of t){const h=r[r.length-1];r.push({fixed:a-h.stretch,stretch:h.stretch}),r.push({fixed:a-h.stretch,stretch:h.stretch+(c-a)})}return r.push({fixed:e+rl,stretch:i}),r}function lh(t,e,i,r){return t/e*i+r}function ch(t,e,i,r){return t-e*i/r}function G0(t,e,i,r){const a=e+t.positionedLines[r].lineOffset;return r===0?i+a/2:i+(a+(e+t.positionedLines[r-1].lineOffset))/2}class Z0{constructor(e=[],i=q0){if(this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:i,compare:r}=this,a=i[e];for(;e>0;){const c=e-1>>1,h=i[c];if(r(a,h)>=0)break;i[e]=h,e=c}i[e]=a}_down(e){const{data:i,compare:r}=this,a=this.length>>1,c=i[e];for(;e<a;){let h=1+(e<<1),p=i[h];const m=h+1;if(m<this.length&&r(i[m],p)<0&&(h=m,p=i[m]),r(p,c)>=0)break;i[e]=p,e=h}i[e]=c}}function q0(t,e){return t<e?-1:t>e?1:0}function W0(t,e=1,i=!1){let r=1/0,a=1/0,c=-1/0,h=-1/0;const p=t[0];for(let A=0;A<p.length;A++){const C=p[A];(!A||C.x<r)&&(r=C.x),(!A||C.y<a)&&(a=C.y),(!A||C.x>c)&&(c=C.x),(!A||C.y>h)&&(h=C.y)}const m=Math.min(c-r,h-a);let _=m/2;const v=new Z0([],X0);if(m===0)return new Re(r,a);for(let A=r;A<c;A+=m)for(let C=a;C<h;C+=m)v.push(new ol(A+_,C+_,_,t));let T=function(A){let C=0,L=0,F=0;const W=A[0];for(let $=0,X=W.length,J=X-1;$<X;J=$++){const ie=W[$],te=W[J],be=ie.x*te.y-te.x*ie.y;L+=(ie.x+te.x)*be,F+=(ie.y+te.y)*be,C+=3*be}return new ol(L/C,F/C,0,A)}(t),E=v.length;for(;v.length;){const A=v.pop();(A.d>T.d||!T.d)&&(T=A,i&&console.log("found best %d after %d probes",Math.round(1e4*A.d)/1e4,E)),A.max-T.d<=e||(_=A.h/2,v.push(new ol(A.p.x-_,A.p.y-_,_,t)),v.push(new ol(A.p.x+_,A.p.y-_,_,t)),v.push(new ol(A.p.x-_,A.p.y+_,_,t)),v.push(new ol(A.p.x+_,A.p.y+_,_,t)),E+=4)}return i&&(console.log(`num probes: ${E}`),console.log(`best distance: ${T.d}`)),T.p}function X0(t,e){return e.max-t.max}class ol{constructor(e,i,r,a){this.p=new Re(e,i),this.h=r,this.d=function(c,h){let p=!1,m=1/0;for(let _=0;_<h.length;_++){const v=h[_];for(let T=0,E=v.length,A=E-1;T<E;A=T++){const C=v[T],L=v[A];C.y>c.y!=L.y>c.y&&c.x<(L.x-C.x)*(c.y-C.y)/(L.y-C.y)+C.x&&(p=!p),m=Math.min(m,Hf(c,C,L))}}return(p?1:-1)*Math.sqrt(m)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}}const sl=7,Fd=Number.POSITIVE_INFINITY,H0=Math.sqrt(2);function e_(t,[e,i]){let r=0,a=0;if(i===Fd){e<0&&(e=0);const c=e/H0;switch(t){case"top-right":case"top-left":a=c-sl;break;case"bottom-right":case"bottom-left":a=-c+sl;break;case"bottom":a=-e+sl;break;case"top":a=e-sl}switch(t){case"top-right":case"bottom-right":r=-c;break;case"top-left":case"bottom-left":r=c;break;case"left":r=e;break;case"right":r=-e}}else{switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":a=i-sl;break;case"bottom-right":case"bottom-left":case"bottom":a=-i+sl}switch(t){case"top-right":case"bottom-right":case"right":r=-e;break;case"top-left":case"bottom-left":case"left":r=e}}return[r,a]}function K0(t,e,i,r,a,c,h,p,m,_){t.createArrays(),t.tilePixelRatio=xt/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;const v=t.layers[0].layout,T=t.layers[0]._unevaluatedLayout._values,E={};if(t.textSizeData.kind==="composite"){const{minZoom:L,maxZoom:F}=t.textSizeData;E.compositeTextSizes=[T["text-size"].possiblyEvaluate(new w(L),p),T["text-size"].possiblyEvaluate(new w(F),p)]}if(t.iconSizeData.kind==="composite"){const{minZoom:L,maxZoom:F}=t.iconSizeData;E.compositeIconSizes=[T["icon-size"].possiblyEvaluate(new w(L),p),T["icon-size"].possiblyEvaluate(new w(F),p)]}E.layoutTextSize=T["text-size"].possiblyEvaluate(new w(m+1),p),E.layoutIconSize=T["icon-size"].possiblyEvaluate(new w(m+1),p),E.textMaxSize=T["text-size"].possiblyEvaluate(new w(18),p);const A=v.get("text-rotation-alignment")==="map"&&v.get("symbol-placement")!=="point",C=v.get("text-size");for(const L of t.features){const F=v.get("text-font").evaluate(L,{},p).join(","),W=C.evaluate(L,{},p),$=E.layoutTextSize.evaluate(L,{},p),X=(E.layoutIconSize.evaluate(L,{},p),{horizontal:{},vertical:void 0}),J=L.text;let ie,te=[0,0];if(J){const ke=J.toString(),je=v.get("text-letter-spacing").evaluate(L,{},p)*yn,Ee=v.get("text-line-height").evaluate(L,{},p)*yn,Be=Xh(ke)?je:0,Oe=v.get("text-anchor").evaluate(L,{},p),Ue=v.get("text-variable-anchor");if(!Ue){const it=v.get("text-radial-offset").evaluate(L,{},p);te=it?e_(Oe,[it*yn,Fd]):v.get("text-offset").evaluate(L,{},p).map(Rt=>Rt*yn)}
8let Xe=A?"center":v.get("text-justify").evaluate(L,{},p);const Ae=v.get("symbol-placement")==="point",et=Ae?v.get("text-max-width").evaluate(L,{},p)*yn:1/0,ht=it=>{t.allowVerticalPlacement&&tc(ke)&&(X.vertical=Rd(J,e,i,a,F,et,Ee,Oe,it,Be,te,fr.vertical,!0,$,W))};if(!A&&Ue){const it=Xe==="auto"?Ue.map(He=>Ud(He)):[Xe];let Rt=!1;for(let He=0;He<it.length;He++){const _t=it[He];if(!X.horizontal[_t])if(Rt)X.horizontal[_t]=X.horizontal[0];else{const Bt=Rd(J,e,i,a,F,et,Ee,"center",_t,Be,te,fr.horizontal,!1,$,W);Bt&&(X.horizontal[_t]=Bt,Rt=Bt.positionedLines.length===1)}}ht("left")}else{if(Xe==="auto"&&(Xe=Ud(Oe)),Ae||v.get("text-writing-mode").indexOf("horizontal")>=0||!tc(ke)){const it=Rd(J,e,i,a,F,et,Ee,Oe,Xe,Be,te,fr.horizontal,!1,$,W);it&&(X.horizontal[Xe]=it)}ht(Ae?"left":Xe)}}let be=!1;if(L.icon&&L.icon.name){const ke=r[L.icon.name];ke&&(ie=V0(a[L.icon.name],v.get("icon-offset").evaluate(L,{},p),v.get("icon-anchor").evaluate(L,{},p)),be=ke.sdf,t.sdfIcons===void 0?t.sdfIcons=ke.sdf:t.sdfIcons!==ke.sdf&&wi("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(ke.pixelRatio!==t.pixelRatio||v.get("icon-rotate").constantOr(1)!==0)&&(t.iconsNeedLinear=!0))}const ye=i_(X.horizontal)||X.vertical;t.iconsInText||(t.iconsInText=!!ye&&ye.iconsInText),(ye||ie)&&Y0(t,L,X,ie,r,E,$,0,te,be,h,p,_)}c&&t.generateCollisionDebugBuffers(m,t.collisionBoxArray)}function Ud(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Y0(t,e,i,r,a,c,h,p,m,_,v,T,E){let A=c.textMaxSize.evaluate(e,{},T);A===void 0&&(A=h);const C=t.layers[0].layout,L=C.get("icon-offset").evaluate(e,{},T),F=i_(i.horizontal)||i.vertical,W=E.name==="globe",$=yn,X=h/$,J=t.tilePixelRatio*A/$,ie=(Oe=t.overscaling,t.zoom>18&&Oe>2&&(Oe>>=1),Math.max(xt/(512*Oe),1)*C.get("symbol-spacing")),te=C.get("text-padding")*t.tilePixelRatio,be=C.get("icon-padding")*t.tilePixelRatio,ye=at(C.get("text-max-angle")),ke=C.get("text-rotation-alignment")==="map"&&C.get("symbol-placement")!=="point",je=C.get("icon-rotation-alignment")==="map"&&C.get("symbol-placement")!=="point",Ee=C.get("symbol-placement"),Be=ie/2;var Oe;const Ue=C.get("icon-text-fit");let Xe;r&&Ue!=="none"&&(t.allowVerticalPlacement&&i.vertical&&(Xe=Gm(r,i.vertical,Ue,C.get("icon-text-fit-padding"),L,X)),F&&(r=Gm(r,F,Ue,C.get("icon-text-fit-padding"),L,X)));const Ae=(et,ht,it)=>{if(ht.x<0||ht.x>=xt||ht.y<0||ht.y>=xt)return;let Rt=null;if(W){const{x:He,y:_t,z:Bt}=E.projectTilePoint(ht.x,ht.y,it);Rt={anchor:new jo(He,_t,Bt,0,void 0),up:E.upVector(it,ht.x,ht.y)}}(function(He,_t,Bt,si,Ot,Et,Ai,Ft,Ut,xi,Ei,Si,vi,Di,Fi,Ki,bi,tn,Yi,Ri,ci,Ji,Ii,Nn,Qi){const xn=He.addToLineVertexArray(_t,si);let hn,jn,dn,to,cl,Uc,Vc,R_=0,B_=0,O_=0,F_=0,ep=-1,tp=-1;const go={};let U_=Yh("");const sa=Bt?Bt.anchor:_t;let ip=0,np=0;if(Ut._unevaluatedLayout.getValue("text-radial-offset")===void 0?[ip,np]=Ut.layout.get("text-offset").evaluate(ci,{},Qi).map(nr=>nr*yn):(ip=Ut.layout.get("text-radial-offset").evaluate(ci,{},Qi)*yn,np=Fd),He.allowVerticalPlacement&&Ot.vertical){const nr=Ot.vertical;if(Fi)Uc=Vd(nr),Ft&&(Vc=Vd(Ft));else{const rr=Ut.layout.get("text-rotate").evaluate(ci,{},Qi)+90;dn=uh(xi,sa,_t,Ei,Si,vi,nr,Di,rr,Ki),Ft&&(to=uh(xi,sa,_t,Ei,Si,vi,Ft,tn,rr))}}if(Et){const nr=Ut.layout.get("icon-rotate").evaluate(ci,{},Qi),rr=Ut.layout.get("icon-text-fit")!=="none",Nc=Qm(Et,nr,Ii,rr),op=Ft?Qm(Ft,nr,Ii,rr):void 0;jn=uh(xi,sa,_t,Ei,Si,vi,Et,tn,nr),R_=4*Nc.length;const V_=He.iconSizeData;let aa=null;V_.kind==="source"?(aa=[Qr*Ut.layout.get("icon-size").evaluate(ci,{},Qi)],aa[0]>hs&&wi(`${He.layerIds[0]}: Value for "icon-size" is >= ${Pc}. Reduce your "icon-size".`)):V_.kind==="composite"&&(aa=[Qr*Ji.compositeIconSizes[0].evaluate(ci,{},Qi),Qr*Ji.compositeIconSizes[1].evaluate(ci,{},Qi)],(aa[0]>hs||aa[1]>hs)&&wi(`${He.layerIds[0]}: Value for "icon-size" is >= ${Pc}. Reduce your "icon-size".`)),He.addSymbols(He.icon,Nc,aa,Ri,Yi,ci,!1,Bt,_t,xn.lineStartIndex,xn.lineLength,-1,Nn,Qi),ep=He.icon.placedSymbolArray.length-1,op&&(B_=4*op.length,He.addSymbols(He.icon,op,aa,Ri,Yi,ci,fr.vertical,Bt,_t,xn.lineStartIndex,xn.lineLength,-1,Nn,Qi),tp=He.icon.placedSymbolArray.length-1)}for(const nr in Ot.horizontal){const rr=Ot.horizontal[nr];hn||(U_=Yh(rr.text),Fi?cl=Vd(rr):hn=uh(xi,sa,_t,Ei,Si,vi,rr,Di,Ut.layout.get("text-rotate").evaluate(ci,{},Qi),Ki));const Nc=rr.positionedLines.length===1;if(O_+=t_(He,Bt,_t,rr,Ai,Ut,Fi,ci,Ki,xn,Ot.vertical?fr.horizontal:fr.horizontalOnly,Nc?Object.keys(Ot.horizontal):[nr],go,ep,Ji,Nn,Qi),Nc)break}Ot.vertical&&(F_+=t_(He,Bt,_t,Ot.vertical,Ai,Ut,Fi,ci,Ki,xn,fr.vertical,["vertical"],go,tp,Ji,Nn,Qi));let gs=-1;const rp=(nr,rr)=>nr?Math.max(nr,rr):rr;
8gs=rp(cl,gs),gs=rp(Uc,gs),gs=rp(Vc,gs);const Ex=gs>-1?1:0;He.glyphOffsetArray.length>=ps.MAX_GLYPHS&&wi("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),ci.sortKey!==void 0&&He.addToSortKeyRanges(He.symbolInstances.length,ci.sortKey),He.symbolInstances.emplaceBack(sa.x,sa.y,sa.z,_t.x,_t.y,go.right>=0?go.right:-1,go.center>=0?go.center:-1,go.left>=0?go.left:-1,go.vertical>=0?go.vertical:-1,ep,tp,U_,hn!==void 0?hn:He.collisionBoxArray.length,hn!==void 0?hn+1:He.collisionBoxArray.length,dn!==void 0?dn:He.collisionBoxArray.length,dn!==void 0?dn+1:He.collisionBoxArray.length,jn!==void 0?jn:He.collisionBoxArray.length,jn!==void 0?jn+1:He.collisionBoxArray.length,to||He.collisionBoxArray.length,to?to+1:He.collisionBoxArray.length,Ei,O_,F_,R_,B_,Ex,0,ip,np,gs)})(t,ht,Rt,et,i,r,a,Xe,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,te,ke,m,0,be,je,L,e,c,_,v,T)};if(Ee==="line")for(const et of Km(e.geometry,0,0,xt,xt)){const ht=j0(et,ie,ye,i.vertical||F,r,$,J,t.overscaling,xt);for(const it of ht)F&&J0(t,F.text,Be,it)||Ae(et,it,T)}else if(Ee==="line-center"){for(const et of e.geometry)if(et.length>1){const ht=N0(et,ye,i.vertical||F,r,$,J);ht&&Ae(et,ht,T)}}else if(e.type==="Polygon")for(const et of Id(e.geometry,0)){const ht=W0(et,16);Ae(et[0],new jo(ht.x,ht.y,0,0,void 0),T)}else if(e.type==="LineString")for(const et of e.geometry)Ae(et,new jo(et[0].x,et[0].y,0,0,void 0),T);else if(e.type==="Point")for(const et of e.geometry)for(const ht of et)Ae([ht],new jo(ht.x,ht.y,0,0,void 0),T)}const Pc=255,hs=Pc*Qr;function t_(t,e,i,r,a,c,h,p,m,_,v,T,E,A,C,L,F){const W=function(J,ie,te,be,ye,ke,je,Ee){const Be=[];if(ie.positionedLines.length===0)return Be;const Oe=be.layout.get("text-rotate").evaluate(ke,{})*Math.PI/180,Ue=function(it){const Rt=it[0],He=it[1],_t=Rt*He;return _t>0?[Rt,-He]:_t<0?[-Rt,He]:Rt===0?[He,Rt]:[He,-Rt]}(te);let Xe=Math.abs(ie.top-ie.bottom);for(const it of ie.positionedLines)Xe-=it.lineOffset;const Ae=ie.positionedLines.length,et=Xe/Ae;let ht=ie.top-te[1];for(let it=0;it<Ae;++it){const Rt=ie.positionedLines[it];ht=G0(ie,et,ht,it);for(const He of Rt.positionedGlyphs){if(!He.rect)continue;const _t=He.rect||{};let Bt=Rm+1,si=!0,Ot=1,Et=0;if(He.imageName){const Ii=je[He.imageName];if(!Ii)continue;if(Ii.sdf){wi("SDF images are not supported in formatted text and will be ignored.");continue}si=!1,Ot=Ii.pixelRatio,Bt=Xn/Ot}const Ai=(ye||Ee)&&He.vertical,Ft=He.metrics.advance*He.scale/2,Ut=He.metrics,xi=He.rect;if(xi===null)continue;Ee&&ie.verticalizable&&(Et=He.imageName?Ft-He.metrics.width*He.scale/2:0);const Ei=ye?[He.x+Ft,He.y]:[0,0];let Si=[0,0],vi=[0,0],Di=!1;ye||(Ai?(vi=[He.x+Ft+Ue[0],He.y+Ue[1]-Et],Di=!0):Si=[He.x+Ft+te[0],He.y+te[1]-Et]);const Fi=xi.w*He.scale/(Ot*(He.localGlyph?$r:1)),Ki=xi.h*He.scale/(Ot*(He.localGlyph?$r:1));let bi,tn,Yi,Ri;if(Ai){const Ii=He.y-ht,Nn=new Re(-Ft,Ft-Ii),Qi=-Math.PI/2,xn=new Re(...vi);bi=new Re(-Ft+Si[0],Si[1]),bi._rotateAround(Qi,Nn)._add(xn),bi.x+=-Ii+Ft,bi.y-=(Ut.left-Bt)*He.scale;const hn=He.imageName?Ut.advance*He.scale:yn*He.scale,jn=String.fromCharCode(He.glyph);E0(jn)?bi.x+=(1-Bt)*He.scale:S0(jn)?bi.x+=hn-Ut.height*He.scale+(-Bt-1)*He.scale:bi.x+=He.imageName||Ut.width+2*Bt===xi.w&&Ut.height+2*Bt===xi.h?(hn-Ki)/2:(hn-(Ut.height+2*Bt)*He.scale)/2,tn=new Re(bi.x,bi.y-Fi),Yi=new Re(bi.x+Ki,bi.y),Ri=new Re(bi.x+Ki,bi.y-Fi)}else{const Ii=(Ut.left-Bt)*He.scale-Ft+Si[0],Nn=(-Ut.top-Bt)*He.scale+Si[1],Qi=Ii+Fi,xn=Nn+Ki;bi=new Re(Ii,Nn),tn=new Re(Qi,Nn),Yi=new Re(Ii,xn),Ri=new Re(Qi,xn)}if(Oe){let Ii;Ii=ye?new Re(0,0):Di?new Re(Ue[0],Ue[1]):new Re(te[0],te[1]),bi._rotateAround(Oe,Ii),tn._rotateAround(Oe,Ii),Yi._rotateAround(Oe,Ii),Ri._rotateAround(Oe,Ii)}const ci=new Re(0,0),Ji=new Re(0,0);Be.push({tl:bi,tr:tn,bl:Yi,br:Ri,tex:_t,writingMode:ie.writingMode,glyphOffset:Ei,sectionIndex:He.sectionIndex,isSDF:si,pixelOffsetTL:ci,pixelOffsetBR:Ji,minFontScaleX:0,minFontScaleY:0})}}return Be}(0,r,m,c,h,p,a,t.allowVerticalPlacement),$=t.textSizeData;let X=null;$.kind==="source"?(X=[Qr*c.layout.get("text-size").evaluate(p,{},F)],X[0]>hs&&wi(`${t.layerIds[0]}: Value for "text-size" is >= ${Pc}. Reduce your "text-size".`)):$.kind==="composite"&&(X=[Qr*C.compositeTextSizes[0].evaluate(p,{},F),Qr*C.compositeTextSizes[1].evaluate(p,{},F)],(X[0]>hs||X[1]>hs)&&wi(`${t.layerIds[0]}: Value for "text-size" is >= ${Pc}. Reduce your "text-size".`)),t.addSymbols(t.text,W,X,m,h,p,v,e,i,_.lineStartIndex,_.lineLength,A,L,F);for(const J of T)E[J]=t.text.placedSymbolArray.length-1;return 4*W.length}function i_(t){for(const e in t)return t[e];return null}function uh(t,e,i,r,a,c,h,p,m,_){let v=h.top,T=h.bottom,E=h.left,A=h.right;const C=h.collisionPadding;if(C&&(E-=C[0],v-=C[1],A+=C[2],T+=C[3]),m){const L=new Re(E,v),F=new Re(A,v),W=new Re(E,T),$=new Re(A,T),X=at(m);let J=new Re(0,0);
vendor: 4,280 bytes, line 8
8_&&(J=new Re(_[0],_[1])),L._rotateAround(X,J),F._rotateAround(X,J),W._rotateAround(X,J),$._rotateAround(X,J),E=Math.min(L.x,F.x,W.x,$.x),A=Math.max(L.x,F.x,W.x,$.x),v=Math.min(L.y,F.y,W.y,$.y),T=Math.max(L.y,F.y,W.y,$.y)}return t.emplaceBack(e.x,e.y,e.z,i.x,i.y,E,v,A,T,p,r,a,c),t.length-1}function Vd(t){t.collisionPadding&&(t.top-=t.collisionPadding[1],t.bottom+=t.collisionPadding[3]);const e=t.bottom-t.top;return e>0?Math.max(10,e):null}function J0(t,e,i,r){const a=t.compareText;if(e in a){const c=a[e];for(let h=c.length-1;h>=0;h--)if(r.dist(c[h])<i)return!0}else a[e]=[];return a[e].push(r),!1}function n_(t,e){const i=t.fovAboveCenter,r=t.elevation?t.elevation.getMinElevationBelowMSL()*e:0,a=(t._camera.position[2]*t.worldSize-r)/Math.cos(t._pitch),c=Math.sin(i)*a/Math.sin(Math.max(Math.PI/2-t._pitch-i,.01)),h=Math.sin(t._pitch)*c+a;return Math.min(1.01*h,a*(1/t._horizonShift))}function ra(t,e){if(!e.isReprojectedInTileSpace)return{scale:1<<t.z,x:t.x,y:t.y,x2:t.x+1,y2:t.y+1,projection:e};const i=Math.pow(2,-t.z),r=t.x*i,a=(t.x+1)*i,c=t.y*i,h=(t.y+1)*i,p=pr(r),m=pr(a),_=An(c),v=An(h),T=e.project(p,_),E=e.project(m,_),A=e.project(m,v),C=e.project(p,v);let L=Math.min(T.x,E.x,A.x,C.x),F=Math.min(T.y,E.y,A.y,C.y),W=Math.max(T.x,E.x,A.x,C.x),$=Math.max(T.y,E.y,A.y,C.y);const X=i/16;function J(te,be,ye,ke,je,Ee){const Be=(ye+je)/2,Oe=(ke+Ee)/2,Ue=e.project(pr(Be),An(Oe)),Xe=Math.max(0,L-Ue.x,F-Ue.y,Ue.x-W,Ue.y-$);L=Math.min(L,Ue.x),W=Math.max(W,Ue.x),F=Math.min(F,Ue.y),$=Math.max($,Ue.y),Xe>X&&(J(te,Ue,ye,ke,Be,Oe),J(Ue,be,Be,Oe,je,Ee))}J(T,E,r,c,a,c),J(E,A,a,c,a,h),J(A,C,a,h,r,h),J(C,T,r,h,r,c),L-=X,F-=X,W+=X,$+=X;const ie=1/Math.max(W-L,$-F);return{scale:ie,x:L*ie,y:F*ie,x2:W*ie,y2:$*ie,projection:e}}const Q0=Kr(new Float32Array(16));class ds{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,i){return{x:0,y:0,z:0}}unproject(e,i){return new yi(0,0)}projectTilePoint(e,i,r){return{x:e,y:i,z:0}}locationPoint(e,i,r=!0){return e._coordinatePoint(e.locationCoordinate(i),r)}pixelsPerMeter(e,i){return Jr(1,e)*i}pixelSpaceConversion(e,i,r){return 1}farthestPixelDistance(e){return n_(e,e.pixelsPerMeter)}pointCoordinate(e,i,r,a){const c=e.horizonLineFromTop(!1),h=new Re(i,Math.max(c,r));return e.rayIntersectionCoordinate(e.pointRayIntersection(h,a))}pointCoordinate3D(e,i,r){const a=new Re(i,r);if(e.elevation)return e.elevation.pointCoordinate(a);{const c=this.pointCoordinate(e,a.x,a.y,0);return[c.x,c.y,c.z]}}isPointAboveHorizon(e,i){if(e.elevation)return!this.pointCoordinate3D(e,i.x,i.y);const r=e.horizonLineFromTop();return i.y<r}createInversionMatrix(e,i){return Q0}createTileMatrix(e,i,r){let a,c,h;const p=r.canonical,m=Kr(new Float64Array(16));if(this.isReprojectedInTileSpace){const _=ra(p,this);a=1,c=_.x+r.wrap*_.scale,h=_.y,Js(m,m,[a/_.scale,a/_.scale,e.pixelsPerMeter/i])}else a=i/e.zoomScale(p.z),c=(p.x+Math.pow(2,p.z)*r.wrap)*a,h=p.y*a;return lc(m,m,[c,h,0]),Js(m,m,[a/xt,a/xt,1]),m}upVector(e,i,r){return[0,0,1]}upVectorScale(e,i,r){return{metersToTile:1}}}class $0 extends ds{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[i,r]=this.parallels=e.parallels||[29.5,45.5],a=Math.sin(at(i));this.n=(a+Math.sin(at(r)))/2,this.c=1+a*(2*this.n-a),this.r0=Math.sqrt(this.c)/this.n}project(e,i){const{n:r,c:a,r0:c}=this,h=at(e-this.center[0]),p=at(i),m=Math.sqrt(a-2*r*Math.sin(p))/r;return{x:m*Math.sin(h*r),y:m*Math.cos(h*r)-c,z:0}}unproject(e,i){const{n:r,c:a,r0:c}=this,h=c+i;let p=Math.atan2(e,Math.abs(h))*Math.sign(h);h*r<0&&(p-=Math.PI*Math.sign(e)*Math.sign(h));const m=at(this.center[0])*r;p=vt(p,-Math.PI-m,Math.PI-m);const _=St(Ct(p/r)+this.center[0],-180,180),v=Math.asin(St((a-(e*e+h*h)*r*r)/(2*r),-1,1)),T=St(Ct(v),-Cn,Cn);return new yi(_,T)}}const zc=1.340264,Lc=-.081106,Dc=893e-6,Rc=.003796,hh=Math.sqrt(3)/2;class ex extends ds{project(e,i){i=i/180*Math.PI,e=e/180*Math.PI;const r=Math.asin(hh*Math.sin(i)),a=r*r,c=a*a*a;return{x:.5*(e*Math.cos(r)/(hh*(zc+3*Lc*a+c*(7*Dc+9*Rc*a)))/Math.PI+.5),y:1-.5*(r*(zc+Lc*a+c*(Dc+Rc*a))/M
vendor: 6,166 bytes, line 8
8ath.PI+1),z:0}}unproject(e,i){e=(2*e-.5)*Math.PI;let r=i=(2*(1-i)-1)*Math.PI,a=r*r,c=a*a*a;for(let v,T,E,A=0;A<12&&(T=r*(zc+Lc*a+c*(Dc+Rc*a))-i,E=zc+3*Lc*a+c*(7*Dc+9*Rc*a),v=T/E,r=St(r-v,-Math.PI/3,Math.PI/3),a=r*r,c=a*a*a,!(Math.abs(v)<1e-12));++A);const h=hh*e*(zc+3*Lc*a+c*(7*Dc+9*Rc*a))/Math.cos(r),p=Math.asin(Math.sin(r)/hh),m=St(180*h/Math.PI,-180,180),_=St(180*p/Math.PI,-Cn,Cn);return new yi(m,_)}}class tx extends ds{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,i){return{x:.5+e/360,y:.5-i/360,z:0}}unproject(e,i){const r=360*(e-.5),a=St(360*(.5-i),-Cn,Cn);return new yi(r,a)}}const al=Math.PI/2;function dh(t){return Math.tan((al+t)/2)}class ix extends ds{constructor(e){super(e),this.center=e.center||[0,30];const[i,r]=this.parallels=e.parallels||[30,30];let a=at(i),c=at(r);this.southernCenter=a+c<0,this.southernCenter&&(a=-a,c=-c);const h=Math.cos(a),p=dh(a);this.n=a===c?Math.sin(a):Math.log(h/Math.cos(c))/Math.log(dh(c)/p),this.f=h*Math.pow(dh(a),this.n)/this.n}project(e,i){i=at(i),this.southernCenter&&(i=-i),e=at(e-this.center[0]);const r=1e-6,{n:a,f:c}=this;c>0?i<-al+r&&(i=-al+r):i>al-r&&(i=al-r);const h=c/Math.pow(dh(i),a);let p=h*Math.sin(a*e),m=c-h*Math.cos(a*e);return p=.5*(p/Math.PI+.5),m=.5*(m/Math.PI+.5),{x:p,y:this.southernCenter?m:1-m,z:0}}unproject(e,i){e=(2*e-.5)*Math.PI,this.southernCenter&&(i=1-i),i=(2*(1-i)-.5)*Math.PI;const{n:r,f:a}=this,c=a-i,h=Math.sign(c),p=Math.sign(r)*Math.sqrt(e*e+c*c);let m=Math.atan2(e,Math.abs(c))*h;c*r<0&&(m-=Math.PI*Math.sign(e)*h);const _=St(Ct(m/r)+this.center[0],-180,180),v=St(Ct(2*Math.atan(Math.pow(a/p,1/r))-al),-Cn,Cn);return new yi(_,this.southernCenter?-v:v)}}class r_ extends ds{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,i){return{x:ho(e),y:po(i),z:0}}unproject(e,i){const r=pr(e),a=An(i);return new yi(r,a)}}const o_=at(Cn);class nx extends ds{project(e,i){const r=(i=at(i))*i,a=r*r;return{x:.5*((e=at(e))*(.8707-.131979*r+a*(a*(.003971*r-.001529*a)-.013791))/Math.PI+.5),y:1-.5*(i*(1.007226+r*(.015085+a*(.028874*r-.044475-.005916*a)))/Math.PI+1),z:0}}unproject(e,i){e=(2*e-.5)*Math.PI;let r=i=(2*(1-i)-1)*Math.PI,a=25,c=0,h=r*r;do{h=r*r;const _=h*h;c=(r*(1.007226+h*(.015085+_*(.028874*h-.044475-.005916*_)))-i)/(1.007226+h*(.045255+_*(.259866*h-.311325-.06507600000000001*_))),r=St(r-c,-o_,o_)}while(Math.abs(c)>1e-6&&--a>0);h=r*r;const p=St(Ct(e/(.8707+h*(h*(h*h*h*(.003971-.001529*h)-.013791)-.131979))),-180,180),m=Ct(r);return new yi(p,m)}}const s_=at(Cn);class rx extends ds{project(e,i){i=at(i),e=at(e);const r=Math.cos(i),a=2/Math.PI,c=Math.acos(r*Math.cos(e/2)),h=Math.sin(c)/c,p=.5*(e*a+2*r*Math.sin(e/2)/h)||0,m=.5*(i+Math.sin(i)/h)||0;return{x:.5*(p/Math.PI+.5),y:1-.5*(m/Math.PI+1),z:0}}unproject(e,i){let r=e=(2*e-.5)*Math.PI,a=i=(2*(1-i)-1)*Math.PI,c=25;const h=1e-6;let p=0,m=0;do{const _=Math.cos(a),v=Math.sin(a),T=2*v*_,E=v*v,A=_*_,C=Math.cos(r/2),L=Math.sin(r/2),F=2*C*L,W=L*L,$=1-A*C*C,X=$?1/$:0,J=$?Math.acos(_*C)*Math.sqrt(1/$):0,ie=.5*(2*J*_*L+2*r/Math.PI)-e,te=.5*(J*v+a)-i,be=.5*X*(A*W+J*_*C*E)+1/Math.PI,ye=X*(F*T/4-J*v*L),ke=.125*X*(T*L-J*v*A*F),je=.5*X*(E*C+J*W*_)+.5,Ee=ye*ke-je*be;p=(te*ye-ie*je)/Ee,m=(ie*ke-te*be)/Ee,r=St(r-p,-Math.PI,Math.PI),a=St(a-m,-s_,s_)}while((Math.abs(p)>h||Math.abs(m)>h)&&--c>0);return new yi(Ct(r),Ct(a))}}class a_ extends ds{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(at(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,i){const{scale:r,cosPhi:a}=this;return{x:at(e)*a*r+.5,y:-Math.sin(at(i))/a*r+.5,z:0}}unproject(e,i){const{scale:r,cosPhi:a}=this,c=-(i-.5)/r,h=St(Ct((e-.5)/r)/a,-180,180),p=Math.asin(St(c*a,-1,1)),m=St(Ct(p),-Cn,Cn);return new yi(h,m)}}class ox extends r_{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,i,r){const a=_c(e,i,r);return Zi(a,a,gc(uo(r))),{x:a[0],y:a[1],z:a[2]}}locationPoint(e,i){const r=Wa(i.lat,i.lng),a=Fn([],r),c=e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(i),e._centerAltitude):e._centerAltitude;dc(r,r,a,Jr(1,0)*xt*c);const h=Kr(new Float64Array(16));return Ys(h,e.pixelMatrix,e.globeMatrix),Zi(r,r,h),new Re(r[0],r[1])}pixelsPerMeter(e,i){return Jr(1,0)*i}pixelSpaceConversion(e,i,r){const a=Jr(1,e)*i,c=ii(Jr(1,45)*i,a,r);return this.pixelsPerMeter(e,i)/c}createTileMatrix(e,i,r){const a=ud(uo(r.canonical));return Ys(new Float64Array(16),e.globeMatrix,a)}createInversionMatrix(e,i){const{center:r}=e,a=gc(uo(i));return Vu(a,a,at(r.lng)),ed(a,a,at(r.lat)),Js(a,a,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(a)}pointCoordinate(e,i,r,a){return Df(e,i,r,!0)||new Ha(0,0)}pointCoordinate3D(e,i,r){const a=this.pointCoordinate(e,i,r,0);return[a.x,a.y,a.z]}isPointAboveHorizon(e,i){return!Df(e,i.x,i.y,!1)}farthestPixelDistance(e){const i=function(a,c){const h=a.cameraToCenterDistance,p=a._centerAltitude*c,m=a._camera,_=a._camera.forward(),v=Fo([],dr([],_,-h),[0,0,p]),T=a.worldSize/(2*Math.PI),E=[0,0,-T],A=a.width/a.height,C=Math.tan(a.fovAboveCenter),L=dr([],m.up(),C),F=dr([],m.right(),C*A),W=Fn([],Fo([],Fo([],_,L),F)),$=[];let X;if(new rd(v,W).closestPointOnSphere(E,T,$)){const J=Fo([],$,E),ie=Yr([],J,v);X=Math.cos(a.fovAboveCenter)*cc(ie)}else{const J=Yr([],v,E),ie=Yr([],E,v);Fn(ie,ie);const te=cc(J)-T;X=Math.sqrt(te*(te+2*T));const be=Math.acos(X/(T+te))-Math.acos(Sr(_,ie));X*=Math.cos(be)}return 1.01*X}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),r=Xa(e.zoom);if(r>0){const a=n_(e,Jr(1,e.center.lat)*e.worldSize),c=e.worldSize/(2*Math.PI),h=Math.max(e.width,e.height)/e.worldSize*Math.PI;return ii(i,a+c*(1-Math.cos(h)),Math.pow(r,10))}return i}upVector(e,i,r){return _c(i,r,e,1)}upVectorScale(e){return{metersToTile:Nu(Gu(uo(e)))}}}function l_(t){const e=t.parallels,i=!!e&&Math.abs(e[0]+e[1])<.01;
vendor: 16,867 bytes, line 8
8switch(t.name){case"mercator":return new r_(t);case"equirectangular":return new tx(t);case"naturalEarth":return new nx(t);case"equalEarth":return new ex(t);case"winkelTripel":return new rx(t);case"albers":return i?new a_(t):new $0(t);case"lambertConformalConic":return i?new a_(t):new ix(t);case"globe":return new ox(t)}throw new Error(`Invalid projection name: ${t.name}`)}const sx=$u.types,ax=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ph(t,e,i,r,a,c,h,p,m,_,v,T,E){const A=p?Math.min(hs,Math.round(p[0])):0,C=p?Math.min(hs,Math.round(p[1])):0;t.emplaceBack(e,i,Math.round(32*r),Math.round(32*a),c,h,(A<<1)+(m?1:0),C,16*_,16*v,256*T,256*E)}function fh(t,e,i,r,a,c,h){t.emplaceBack(e,i,r,a,c,h)}function mh(t,e,i,r,a){t.emplaceBack(e,i,r,a),t.emplaceBack(e,i,r,a),t.emplaceBack(e,i,r,a),t.emplaceBack(e,i,r,a)}function lx(t){for(const e of t.sections)if(Kh(e.text))return!0;return!1}class Nd{constructor(e){this.layoutVertexArray=new Fe,this.indexArray=new dt,this.programConfigurations=e,this.segments=new Xi,this.dynamicLayoutVertexArray=new Ve,this.opacityVertexArray=new pt,this.placedSymbolArray=new Wi,this.globeExtVertexArray=new qe}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,i,r,a){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,_0.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,y0.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,ax,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,g0.members,!0)),this.opacityVertexBuffer.itemSize=1),(r||a)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}ct(Nd,"SymbolBuffers");class jd{constructor(e,i,r){this.layoutVertexArray=new e,this.layoutAttributes=i,this.indexArray=new r,this.segments=new Xi,this.collisionVertexArray=new Ht,this.collisionVertexArrayExt=new Zt}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,x0.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,v0.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}ct(jd,"CollisionBuffers");class ps{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(h=>h.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Kr([]),this.placementViewportMatrix=Kr([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=kd(this.zoom,i["text-size"]),this.iconSizeData=kd(this.zoom,i["icon-size"]);const r=this.layers[0].layout,a=r.get("symbol-sort-key"),c=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=c!=="viewport-y"&&a.constantOr(1)!==void 0,this.sortFeaturesByY=(c==="viewport-y"||c==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=r.get("text-writing-mode").map(h=>fr[h]),this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id),this.sourceID=e.sourceID,this.projection=e.projection}createArrays(){this.text=new Nd(new Ks(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Nd(new Ks(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new On,this.lineVertexArray=new Na,this.symbolInstances=new Pi}calculateGlyphDependencies(e,i,r,a,c){for(let h=0;h<e.length;h++)if(i[e.charCodeAt(h)]=!0,a&&c){const p=Ac[e.charAt(h)];p&&(i[p.charCodeAt(0)]=!0)}}populate(e,i,r,a){const c=this.layers[0],h=c.layout,p=this.projection.name==="globe",m=h.get("text-font"),_=h.get("text-field"),v=h.get("icon-image"),T=(_.value.kind!=="constant"||_.value.value instanceof Bn&&!_.value.value.isEmpty()||_.value.value.toString().length>0)&&(m.value.kind!=="constant"||m.value.value.length>0),E=v.value.kind!=="constant"||!!v.value.value||Object.keys(v.parameters).length>0,A=h.get("symbol-sort-key");if(this.features=[],!T&&!E)return;const C=i.iconDependencies,L=i.glyphDependencies,F=i.availableImages,W=new w(this.zoom);for(const{feature:$,id:X,index:J,sourceLayerIndex:ie}of e){const te=c._featureFilter.needGeometry,be=ta($,te);if(!c._featureFilter.filter(W,be,r))continue;if(te||(be.geometry=Uo($,r,a)),p&&$.type!==1&&r.z<=5){const Ee=be.geometry,Be=.98078528056,Oe=(Ue,Xe)=>Sr(_c(Ue.x,Ue.y,r,1),_c(Xe.x,Xe.y,r,1))<Be;for(let Ue=0;Ue<Ee.length;Ue++)Ee[Ue]=yy(Ee[Ue],Oe)}let ye,ke;if(T){const Ee=c.getValueAndResolveTokens("text-field",be,r,F),Be=Bn.factory(Ee);lx(Be)&&(this.hasRTLText=!0),(!this.hasRTLText||f()==="unavailable"||this.hasRTLText&&y.isParsed())&&(ye=T0(Be,c,be))}if(E){const Ee=c.getValueAndResolveTokens("icon-image",be,r,F);ke=Ee instanceof Jn?Ee:Jn.fromString(Ee)}if(!ye&&!ke)continue;const je=this.sortFeaturesByKey?A.evaluate(be,{},r):void 0;if(this.features.push({id:X,text:ye,icon:ke,index:J,sourceLayerIndex:ie,geometry:be.geometry,properties:$.properties,type:sx[$.type],sortKey:je}),ke&&(C[ke.name]=!0),ye){const Ee=m.evaluate(be,{},r).join(","),Be=h.get("text-rotation-alignment")==="map"&&h.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(fr.vertical)>=0;for(const Oe of ye.sections)if(Oe.image)C[Oe.image.name]=!0;else{const Ue=tc(ye.toString()),Xe=Oe.fontStack||Ee,Ae=L[Xe]=L[Xe]||{};this.calculateGlyphDependencies(Oe.text,Ae,Be,this.allowVerticalPlacement,Ue)}}}h.get("symbol-placement")==="line"&&(this.features=function($){const X={},J={},ie=[];let te=0;function be(Ee){ie.push($[Ee]),te++}function ye(Ee,Be,Oe){const Ue=J[Ee];return delete J[Ee],J[Be]=Ue,ie[Ue].geometry[0].pop(),ie[Ue].geometry[0]=ie[Ue].geometry[0].concat(Oe[0]),Ue}function ke(Ee,Be,Oe){const Ue=X[Be];return delete X[Be],X[Ee]=Ue,ie[Ue].geometry[0].shift(),ie[Ue].geometry[0]=Oe[0].concat(ie[Ue].geometry[0]),Ue}function je(Ee,Be,Oe){const Ue=Oe?Be[0][Be[0].length-1]:Be[0][0];return`${Ee}:${Ue.x}:${Ue.y}`}for(let Ee=0;Ee<$.length;Ee++){const Be=$[Ee],Oe=Be.geometry,Ue=Be.text?Be.text.toString():null;if(!Ue){be(Ee);continue}const Xe=je(Ue,Oe),Ae=je(Ue,Oe,!0);if(Xe in J&&Ae in X&&J[Xe]!==X[Ae]){const et=ke(Xe,Ae,Oe),ht=ye(Xe,Ae,ie[et].geometry);delete X[Xe],delete J[Ae],J[je(Ue,ie[ht].geometry,!0)]=ht,ie[et].geometry=null}else Xe in J?ye(Xe,Ae,Oe):Ae in X?ke(Xe,Ae,Oe):(be(Ee),X[Xe]=te-1,J[Ae]=te-1)}return ie.filter(Ee=>Ee.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort(($,X)=>$.sortKey-X.sortKey)}update(e,i,r,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,i,this.layers,r,a),this.icon.programConfigurations.updatePaintArrays(e,i,this.layers,r,a))}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()}getProjection(){return this.projectionInstance||(this.projectionInstance=l_(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,i){const r=this.lineVertexArray.length;if(e.segment!==void 0)for(const{x:a,y:c}of i)this.lineVertexArray.emplaceBack(a,c);return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(e,i,r,a,c,h,p,m,_,v,T,E,A,C){const L=e.indexArray,F=e.layoutVertexArray,W=e.globeExtVertexArray,$=e.segments.prepareSegment(4*i.length,F,L,this.canOverlap?h.sortKey:void 0),X=this.glyphOffsetArray.length,J=$.vertexLength,ie=this.allowVerticalPlacement&&p===fr.vertical?Math.PI/2:0,te=h.text&&h.text.sections;for(let ye=0;ye<i.length;ye++){const{tl:ke,tr:je,bl:Ee,br:Be,tex:Oe,pixelOffsetTL:Ue,pixelOffsetBR:Xe,minFontScaleX:Ae,minFontScaleY:et,glyphOffset:ht,isSDF:it,sectionIndex:Rt}=i[ye],He=$.vertexLength,_t=ht[1];if(ph(F,_.x,_.y,ke.x,_t+ke.y,Oe.x,Oe.y,r,it,Ue.x,Ue.y,Ae,et),ph(F,_.x,_.y,je.x,_t+je.y,Oe.x+Oe.w,Oe.y,r,it,Xe.x,Ue.y,Ae,et),ph(F,_.x,_.y,Ee.x,_t+Ee.y,Oe.x,Oe.y+Oe.h,r,it,Ue.x,Xe.y,Ae,et),ph(F,_.x,_.y,Be.x,_t+Be.y,Oe.x+Oe.w,Oe.y+Oe.h,r,it,Xe.x,Xe.y,Ae,et),m){const{x:Bt,y:si,z:Ot}=m.anchor,[Et,Ai,Ft]=m.up;fh(W,Bt,si,Ot,Et,Ai,Ft),fh(W,Bt,si,Ot,Et,Ai,Ft),fh(W,Bt,si,Ot,Et,Ai,Ft),fh(W,Bt,si,Ot,Et,Ai,Ft),mh(e.dynamicLayoutVertexArray,Bt,si,Ot,ie)}else mh(e.dynamicLayoutVertexArray,_.x,_.y,_.z,ie);L.emplaceBack(He,He+1,He+2),L.emplaceBack(He+1,He+2,He+3),$.vertexLength+=4,$.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(ht[0]),ye!==i.length-1&&Rt===i[ye+1].sectionIndex||e.programConfigurations.populatePaintArrays(F.length,h,h.index,{},A,C,te&&te[Rt])}const be=m?m.anchor:_;e.placedSymbolArray.emplaceBack(be.x,be.y,be.z,_.x,_.y,X,this.glyphOffsetArray.length-X,J,v,T,_.segment,r?r[0]:0,r?r[1]:0,a[0],a[1],p,0,!1,0,E,0)}_commitLayoutVertex(e,i,r,a,c,h,p){e.emplaceBack(i,r,a,c,h,Math.round(p.x),Math.round(p.y))}_addCollisionDebugVertices(e,i,r,a,c,h,p){const m=r.segments.prepareSegment(4,r.layoutVertexArray,r.indexArray),_=m.vertexLength,v=p.tileAnchorX,T=p.tileAnchorY;for(let A=0;A<4;A++)r.collisionVertexArray.emplaceBack(0,0,0,0);r.collisionVertexArrayExt.emplaceBack(i,-e.padding,-e.padding),r.collisionVertexArrayExt.emplaceBack(i,e.padding,-e.padding),r.collisionVertexArrayExt.emplaceBack(i,e.padding,e.padding),r.collisionVertexArrayExt.emplaceBack(i,-e.padding,e.padding),this._commitLayoutVertex(r.layoutVertexArray,a,c,h,v,T,new Re(e.x1,e.y1)),this._commitLayoutVertex(r.layoutVertexArray,a,c,h,v,T,new Re(e.x2,e.y1)),this._commitLayoutVertex(r.layoutVertexArray,a,c,h,v,T,new Re(e.x2,e.y2)),this._commitLayoutVertex(r.layoutVertexArray,a,c,h,v,T,new Re(e.x1,e.y2)),m.vertexLength+=4;const E=r.indexArray;E.emplaceBack(_,_+1),E.emplaceBack(_+1,_+2),E.emplaceBack(_+2,_+3),E.emplaceBack(_+3,_),m.primitiveLength+=4}_addTextDebugCollisionBoxes(e,i,r,a,c,h){for(let p=a;p<c;p++){const m=r.get(p),_=this.getSymbolInstanceTextSize(e,h,i,p);this._addCollisionDebugVertices(m,_,this.textCollisionBox,m.projectedAnchorX,m.projectedAnchorY,m.projectedAnchorZ,h)}}_addIconDebugCollisionBoxes(e,i,r,a,c,h){for(let p=a;p<c;p++){const m=r.get(p),_=this.getSymbolInstanceIconSize(e,i,h.placedIconSymbolIndex);this._addCollisionDebugVertices(m,_,this.iconCollisionBox,m.projectedAnchorX,m.projectedAnchorY,m.projectedAnchorZ,h)}}generateCollisionDebugBuffers(e,i){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new jd(ut,Mm.members,un),this.iconCollisionBox=new jd(ut,Mm.members,un);const r=$a(this.iconSizeData,e),a=$a(this.textSizeData,e);for(let c=0;c<this.symbolInstances.length;c++){const h=this.symbolInstances.get(c);this._addTextDebugCollisionBoxes(a,e,i,h.textBoxStartIndex,h.textBoxEndIndex,h),this._addTextDebugCollisionBoxes(a,e,i,h.verticalTextBoxStartIndex,h.verticalTextBoxEndIndex,h),this._addIconDebugCollisionBoxes(r,e,i,h.iconBoxStartIndex,h.iconBoxEndIndex,h),this._addIconDebugCollisionBoxes(r,e,i,h.verticalIconBoxStartIndex,h.verticalIconBoxEndIndex,h)}}getSymbolInstanceTextSize(e,i,r,a){const c=this.text.placedSymbolArray.get(i.rightJustifiedTextSymbolIndex>=0?i.rightJustifiedTextSymbolIndex:i.centerJustifiedTextSymbolIndex>=0?i.centerJustifiedTextSymbolIndex:i.leftJustifiedTextSymbolIndex>=0?i.leftJustifiedTextSymbolIndex:i.verticalPlacedTextSymbolIndex>=0?i.verticalPlacedTextSymbolIndex:a),h=nh(this.textSizeData,e,c)/yn;return this.tilePixelRatio*h}getSymbolInstanceIconSize(e,i,r){const a=this.icon.placedSymbolArray.get(r),c=nh(this.iconSizeData,e,a);return this.tilePixelRatio*c}_commitDebugCollisionVertexUpdate(e,i,r){e.emplaceBack(i,-r,-r),e.emplaceBack(i,r,-r),e.emplaceBack(i,r,r),e.emplaceBack(i,-r,r)}_updateTextDebugCollisionBoxes(e,i,r,a,c,h){for(let p=a;p<c;p++){const m=r.get(p),_=this.getSymbolInstanceTextSize(e,h,i,p);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,_,m.padding)}}_updateIconDebugCollisionBoxes(e,i,r,a,c,h){for(let p=a;p<c;p++){const m=r.get(p),_=this.getSymbolInstanceIconSize(e,i,h);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,_,m.padding)}}updateCollisionDebugBuffers(e,i){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const r=$a(this.iconSizeData,e),a=$a(this.textSizeData,e);for(let c=0;c<this.symbolInstances.length;c++){const h=this.symbolInstances.get(c);this._updateTextDebugCollisionBoxes(a,e,i,h.textBoxStartIndex,h.textBoxEndIndex,h),this._updateTextDebugCollisionBoxes(a,e,i,h.verticalTextBoxStartIndex,h.verticalTextBoxEndIndex,h),this._updateIconDebugCollisionBoxes(r,e,i,h.iconBoxStartIndex,h.iconBoxEndIndex,h.placedIconSymbolIndex),this._updateIconDebugCollisionBoxes(r,e,i,h.verticalIconBoxStartIndex,h.verticalIconBoxEndIndex,h.placedIconSymbolIndex)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(e,i,r,a,c,h,p,m,_){const v={};if(i<r){const{x1:T,y1:E,x2:A,y2:C,padding:L,projectedAnchorX:F,projectedAnchorY:W,projectedAnchorZ:$,tileAnchorX:X,tileAnchorY:J,featureIndex:ie}=e.get(i);v.textBox={x1:T,y1:E,x2:A,y2:C,padding:L,projectedAnchorX:F,projectedAnchorY:W,projectedAnchorZ:$,tileAnchorX:X,tileAnchorY:J},v.textFeatureIndex=ie}if(a<c){const{x1:T,y1:E,x2:A,y2:C,padding:L,projectedAnchorX:F,projectedAnchorY:W,projectedAnchorZ:$,tileAnchorX:X,tileAnchorY:J,featureIndex:ie}=e.get(a);v.verticalTextBox={x1:T,y1:E,x2:A,y2:C,padding:L,projectedAnchorX:F,projectedAnchorY:W,projectedAnchorZ:$,tileAnchorX:X,tileAnchorY:J},v.verticalTextFeatureIndex=ie}if(h<p){const{x1:T,y1:E,x2:A,y2:C,padding:L,projectedAnchorX:F,projectedAnchorY:W,projectedAnchorZ:$,tileAnchorX:X,tileAnchorY:J,featureIndex:ie}=e.get(h);v.iconBox={x1:T,y1:E,x2:A,y2:C,padding:L,projectedAnchorX:F,projectedAnchorY:W,projectedAnchorZ:$,tileAnchorX:X,tileAnchorY:J},v.iconFeatureIndex=ie}if(m<_){const{x1:T,y1:E,x2:A,y2:C,padding:L,projectedAnchorX:F,projectedAnchorY:W,projectedAnchorZ:$,tileAnchorX:X,tileAnchorY:J,featureIndex:ie}=e.get(m);v.verticalIconBox={x1:T,y1:E,x2:A,y2:C,padding:L,projectedAnchorX:F,projectedAnchorY:W,projectedAnchorZ:$,tileAnchorX:X,tileAnchorY:J},v.verticalIconFeatureIndex=ie}return v}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let i=0;i<this.symbolInstances.length;i++){const r=this.symbolInstances.get(i);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,i){const r=e.placedSymbolArray.get(i),a=r.vertexStartIndex+4*r.numGlyphs;for(let c=r.vertexStartIndex;c<a;c+=4)e.indexArray.emplaceBack(c,c+1,c+2),e.indexArray.emplaceBack(c+1,c+2,c+3)}
8getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const i=Math.sin(e),r=Math.cos(e),a=[],c=[],h=[];for(let p=0;p<this.symbolInstances.length;++p){h.push(p);const m=this.symbolInstances.get(p);a.push(0|Math.round(i*m.tileAnchorX+r*m.tileAnchorY)),c.push(m.featureIndex)}return h.sort((p,m)=>a[p]-a[m]||c[m]-c[p]),h}addToSortKeyRanges(e,i){const r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===i?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const r=this.symbolInstances.get(i);this.featureSortOrder.push(r.featureIndex);const{rightJustifiedTextSymbolIndex:a,centerJustifiedTextSymbolIndex:c,leftJustifiedTextSymbolIndex:h,verticalPlacedTextSymbolIndex:p,placedIconSymbolIndex:m,verticalPlacedIconSymbolIndex:_}=r;a>=0&&this.addIndicesForPlacedSymbol(this.text,a),c>=0&&c!==a&&this.addIndicesForPlacedSymbol(this.text,c),h>=0&&h!==c&&h!==a&&this.addIndicesForPlacedSymbol(this.text,h),p>=0&&this.addIndicesForPlacedSymbol(this.text,p),m>=0&&this.addIndicesForPlacedSymbol(this.icon,m),_>=0&&this.addIndicesForPlacedSymbol(this.icon,_)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}ct(ps,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),ps.MAX_GLYPHS=65535,ps.addDynamicAttributes=mh;const cx=new K({"symbol-placement":new z(Ce.layout_symbol["symbol-placement"]),"symbol-spacing":new z(Ce.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new z(Ce.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new V(Ce.layout_symbol["symbol-sort-key"]),"symbol-z-order":new z(Ce.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new z(Ce.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new z(Ce.layout_symbol["icon-ignore-placement"]),"icon-optional":new z(Ce.layout_symbol["icon-optional"]),"icon-rotation-alignment":new z(Ce.layout_symbol["icon-rotation-alignment"]),"icon-size":new V(Ce.layout_symbol["icon-size"]),"icon-text-fit":new z(Ce.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new z(Ce.layout_symbol["icon-text-fit-padding"]),"icon-image":new V(Ce.layout_symbol["icon-image"]),"icon-rotate":new V(Ce.layout_symbol["icon-rotate"]),"icon-padding":new z(Ce.layout_symbol["icon-padding"]),"icon-keep-upright":new z(Ce.layout_symbol["icon-keep-upright"]),"icon-offset":new V(Ce.layout_symbol["icon-offset"]),"icon-anchor":new V(Ce.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new z(Ce.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new z(Ce.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new z(Ce.layout_symbol["text-rotation-alignment"]),"text-field":new V(Ce.layout_symbol["text-field"]),"text-font":new V(Ce.layout_symbol["text-font"]),"text-size":new V(Ce.layout_symbol["text-size"]),"text-max-width":new V(Ce.layout_symbol["text-max-width"]),"text-line-height":new V(Ce.layout_symbol["text-line-height"]),"text-letter-spacing":new V(Ce.layout_symbol["text-letter-spacing"]),"text-justify":new V(Ce.layout_symbol["text-justify"]),"text-radial-offset":new V(Ce.layout_symbol["text-radial-offset"]),"text-variable-anchor":new z(Ce.layout_symbol["text-variable-anchor"]),"text-anchor":new V(Ce.layout_symbol["text-anchor"]),"text-max-angle":new z(Ce.layout_symbol["text-max-angle"]),"text-writing-mode":new z(Ce.layout_symbol["text-writing-mode"]),"text-rotate":new V(Ce.layout_symbol["text-rotate"]),"text-padding":new z(Ce.layout_symbol["text-padding"]),"text-keep-upright":new z(Ce.layout_symbol["text-keep-upright"]),"text-transform":new V(Ce.layout_symbol["text-transform"]),"text-offset":new V(Ce.layout_symbol["text-offset"]),"text-allow-overlap":new z(Ce.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new z(Ce.layout_symbol["text-ignore-placement"]),"text-optional":new z(Ce.layout_symbol["text-optional"])});
vendor: 14,641 bytes, line 8
8var Gd={paint:new K({"icon-opacity":new V(Ce.paint_symbol["icon-opacity"]),"icon-color":new V(Ce.paint_symbol["icon-color"]),"icon-halo-color":new V(Ce.paint_symbol["icon-halo-color"]),"icon-halo-width":new V(Ce.paint_symbol["icon-halo-width"]),"icon-halo-blur":new V(Ce.paint_symbol["icon-halo-blur"]),"icon-translate":new z(Ce.paint_symbol["icon-translate"]),"icon-translate-anchor":new z(Ce.paint_symbol["icon-translate-anchor"]),"text-opacity":new V(Ce.paint_symbol["text-opacity"]),"text-color":new V(Ce.paint_symbol["text-color"],{runtimeType:qn,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new V(Ce.paint_symbol["text-halo-color"]),"text-halo-width":new V(Ce.paint_symbol["text-halo-width"]),"text-halo-blur":new V(Ce.paint_symbol["text-halo-blur"]),"text-translate":new z(Ce.paint_symbol["text-translate"]),"text-translate-anchor":new z(Ce.paint_symbol["text-translate-anchor"])}),layout:cx};class c_{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Go,this.defaultValue=e}evaluate(e){if(e.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(e.formattedSection))return i.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}ct(c_,"FormatSectionOverride",{omit:["defaultValue"]});class _h extends Hr{constructor(e){super(e,Gd)}recalculate(e,i){super.recalculate(e,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const r=this.layout.get("text-writing-mode");if(r){const a=[];for(const c of r)a.indexOf(c)<0&&a.push(c);this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(e,i,r,a){const c=this.layout.get(e).evaluate(i,{},r,a),h=this._unevaluatedLayout._values[e];return h.isDataDriven()||ts(h.value)||!c?c:function(p,m){return m.replace(/{([^{}]+)}/g,(_,v)=>v in p?String(p[v]):"")}(i.properties,c)}createBucket(e){return new ps(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of Gd.paint.overridableProperties){if(!_h.hasPaintOverride(this.layout,e))continue;const i=this.paint.get(e),r=new c_(i),a=new La(r,i.property.specification);let c=null;c=i.value.kind==="constant"||i.value.kind==="source"?new Zl("source",a):new Vs("composite",a,i.value.zoomStops,i.value._interpolationType),this.paint._values[e]=new j(i.property,c,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,r){return!(!this.layout||i.isDataDriven()||r.isDataDriven())&&_h.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){const r=e.get("text-field"),a=Gd.paint.properties[i];let c=!1;const h=p=>{for(const m of p)if(a.overrides&&a.overrides.hasOverride(m))return void(c=!0)};if(r.value.kind==="constant"&&r.value.value instanceof Bn)h(r.value.value.sections);else if(r.value.kind==="source"){const p=_=>{c||(_ instanceof Mo&&Oi(_.value)===Ts?h(_.value.sections):_ instanceof so?h(_.sections):_.eachChild(p))},m=r.value;m._styleExpression&&p(m._styleExpression.expression)}return c}getProgramConfiguration(e){return new ls(this,e)}}var ux={paint:new K({"background-color":new z(Ce.paint_background["background-color"]),"background-pattern":new z(Ce.paint_background["background-pattern"]),"background-opacity":new z(Ce.paint_background["background-opacity"])})},hx={paint:new K({"raster-opacity":new z(Ce.paint_raster["raster-opacity"]),"raster-hue-rotate":new z(Ce.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new z(Ce.paint_raster["raster-brightness-min"]),"raster-brightness-max":new z(Ce.paint_raster["raster-brightness-max"]),"raster-saturation":new z(Ce.paint_raster["raster-saturation"]),"raster-contrast":new z(Ce.paint_raster["raster-contrast"]),"raster-resampling":new z(Ce.paint_raster["raster-resampling"]),"raster-fade-duration":new z(Ce.paint_raster["raster-fade-duration"])})};class dx extends Hr{constructor(e){super(e,{}),this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}isLayerDraped(){return this.implementation.renderToTile!==void 0}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}var px={paint:new K({"sky-type":new z(Ce.paint_sky["sky-type"]),"sky-atmosphere-sun":new z(Ce.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new z(Ce.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new z(Ce.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new z(Ce.paint_sky["sky-gradient-radius"]),"sky-gradient":new H(Ce.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new z(Ce.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new z(Ce.paint_sky["sky-atmosphere-color"]),"sky-opacity":new z(Ce.paint_sky["sky-opacity"])})};function Zd(t,e,i){const r=[0,0,1],a=Af([]);return kf(a,a,i?-at(t)+Math.PI:at(t)),Cf(a,a,-at(e)),Ef(r,r,a),Fn(r,r)}const fx={circle:class extends Hr{constructor(t){super(t,Sy)}createBucket(t){return new _d(t)}queryRadius(t){const e=t;return Ka("circle-radius",this,e)+Ka("circle-stroke-width",this,e)+Wu(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,i,r,a,c,h,p){const m=Qf(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),_=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i);return $f(t,r,c,h,p,this.paint.get("circle-pitch-alignment")==="map",this.paint.get("circle-pitch-scale")==="map",m,_)}getProgramIds(){return["circle"]}getProgramConfiguration(t){return new ls(this,t)}},heatmap:class extends Hr{createBucket(t){return new tm(t)}constructor(t){super(t,Cy),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=vd({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(t){return Ka("heatmap-radius",this,t)}queryIntersectsFeature(t,e,i,r,a,c,h,p){const m=this.paint.get("heatmap-radius").evaluate(e,i);return $f(t,r,c,h,p,!0,!0,new Re(0,0),m)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(t){return new ls(this,t)}},hillshade:class extends Hr{constructor(t){super(t,ky)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends Hr{constructor(t){super(t,Wy)}getProgramIds(){const t=this.paint.get("fill-pattern"),e=t&&t.constantOr(1),i=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(t){return new ls(this,t)}recalculate(t,e){super.recalculate(t,e);const i=this.paint._values["fill-outline-color"];i.value.kind==="constant"&&i.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new Ju(t)}queryRadius(){return Wu(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,i,r,a,c){return!t.queryGeometry.isAboveHorizon&&Xf(Jf(t.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),r)}isTileClipped(){return!0}},"fill-extrusion":class extends Hr{constructor(t){super(t,l0)}createBucket(t){return new Sc(t)}queryRadius(){return Wu(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(t){return new ls(this,t)}queryIntersectsFeature(t,e,i,r,a,c,h,p,m){const _=Qf(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),v=this.paint.get("fill-extrusion-height").evaluate(e,i),T=this.paint.get("fill-extrusion-base").evaluate(e,i),E=[0,0],A=p&&c.elevation,C=c.elevation?c.elevation.exaggeration():1,L=t.tile.getBucket(this);if(A&&L instanceof Sc){const J=L.centroidVertexArray,ie=m+1;ie<J.length&&(E[0]=J.geta_centroid_pos0(ie),E[1]=J.geta_centroid_pos1(ie))}if(E[0]===0&&E[1]===1)return!1;c.projection.name==="globe"&&(r=xm([r],[new Re(0,0),new Re(xt,xt)],t.tileID.canonical).map(J=>J.polygon).flat());const F=A?p:null,[W,$]=function(J,ie,te,be,ye,ke,je,Ee,Be,Oe,Ue){return J.projection.name==="globe"?function(Xe,Ae,et,ht,it,Rt,He,_t,Bt,si,Ot){const Et=[],Ai=[],Ft=Xe.projection.upVectorScale(Ot,Xe.center.lat,Xe.worldSize).metersToTile,Ut=[0,0,0,1],xi=[0,0,0,1],Ei=(vi,Di,Fi,Ki)=>{vi[0]=Di,vi[1]=Fi,vi[2]=Ki,vi[3]=1},Si=ym();et>0&&(et+=Si),ht+=Si;for(const vi of Ae){const Di=[],Fi=[];for(const Ki of vi){const bi=Ki.x+it.x,tn=Ki.y+it.y,Yi=Xe.projection.projectTilePoint(bi,tn,Ot),Ri=Xe.projection.upVector(Ot,Ki.x,Ki.y);let ci=et,Ji=ht;if(He){const Ii=Tm(bi,tn,et,ht,He,_t,Bt,si);ci+=Ii.base,Ji+=Ii.top}et!==0?Ei(Ut,Yi.x+Ri[0]*Ft*ci,Yi.y+Ri[1]*Ft*ci,Yi.z+Ri[2]*Ft*ci):Ei(Ut,Yi.x,Yi.y,Yi.z),Ei(xi,Yi.x+Ri[0]*Ft*Ji,Yi.y+Ri[1]*Ft*Ji,Yi.z+Ri[2]*Ft*Ji),Zi(Ut,Ut,Rt),Zi(xi,xi,Rt),Di.push(new Qa(Ut[0],Ut[1],Ut[2])),Fi.push(new Qa(xi[0],xi[1],xi[2]))}Et.push(Di),Ai.push(Fi)}return[Et,Ai]}(J,ie,te,be,ye,ke,je,Ee,Be,Oe,Ue):je?function(Xe,Ae,et,ht,it,Rt,He,_t,Bt){const si=[],Ot=[],Et=[0,0,0,1];for(const Ai of Xe){const Ft=[],Ut=[];for(const xi of Ai){const Ei=xi.x+ht.x,Si=xi.y+ht.y,vi=Tm(Ei,Si,Ae,et,Rt,He,_t,Bt);Et[0]=Ei,Et[1]=Si,Et[2]=vi.base,Et[3]=1,Qs(Et,Et,it),Et[3]=Math.max(Et[3],1e-5);const Di=new Qa(Et[0]/Et[3],Et[1]/Et[3],Et[2]/Et[3]);Et[0]=Ei,Et[1]=Si,Et[2]=vi.top,Et[3]=1,Qs(Et,Et,it),Et[3]=Math.max(Et[3],1e-5);const Fi=new Qa(Et[0]/Et[3],Et[1]/Et[3],Et[2]/Et[3]);Ft.push(Di),Ut.push(Fi)}si.push(Ft),Ot.push(Ut)}return[si,Ot]}(ie,te,be,ye,ke,je,Ee,Be,Oe):function(Xe,Ae,et,ht,it){const Rt=[],He=[],_t=it[8]*Ae,Bt=it[9]*Ae,si=it[10]*Ae,Ot=it[11]*Ae,Et=it[8]*et,Ai=it[9]*et,Ft=it[10]*et,Ut=it[11]*et;for(const xi of Xe){const Ei=[],Si=[];for(const vi of xi){const Di=vi.x+ht.x,Fi=vi.y+ht.y,Ki=it[0]*Di+it[4]*Fi+it[12],bi=it[1]*Di+it[5]*Fi+it[13],tn=it[2]*Di+it[6]*Fi+it[14],Yi=it[3]*Di+it[7]*Fi+it[15],Ri=Ki+_t,ci=bi+Bt,Ji=tn+si,Ii=Math.max(Yi+Ot,1e-5),Nn=Ki+Et,Qi=bi+Ai,xn=tn+Ft,hn=Math.max(Yi+Ut,1e-5);Ei.push(new Qa(Ri/Ii,ci/Ii,Ji/Ii)),Si.push(new Qa(Nn/hn,Qi/hn,xn/hn))}Rt.push(Ei),He.push(Si)}return[Rt,He]}(ie,te,be,ye,ke)}(c,r,T,v,_,h,F,E,C,c.center.lat,t.tileID.canonical),X=t.queryGeometry;return function(J,ie,te){let be=1/0;Xf(te,ie)&&(be=wm(te,ie[0]));for(let ye=0;ye<ie.length;ye++){const ke=ie[ye],je=J[ye];for(let Ee=0;Ee<ke.length-1;Ee++){const Be=ke[Ee],Oe=[Be,ke[Ee+1],je[Ee+1],je[Ee],Be];Wf(te,Oe)&&(be=Math.min(be,wm(te,Oe)))}}return be!==1/0&&be}(W,$,X.isPointQuery()?X.screenBounds:X.screenGeometry)}},line:class extends Hr{constructor(t){super(t,Em),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){const e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof Pl,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=Sm.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new ih(t)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getProgramConfiguration(t){return new ls(this,t)}queryRadius(t){const e=t,i=Im(Ka("line-width",this,e),Ka("line-gap-width",this,e)),r=Ka("line-offset",this,e);return i/2+Math.abs(r)+Wu(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,i,r,a,c){if(t.queryGeometry.isAboveHorizon)return!1;const h=Jf(t.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),p=t.pixelToTileUnitsFactor/2*Im(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),m=this.paint.get("line-offset").evaluate(e,i);return m&&(r=function(_,v){const T=[],E=new Re(0,0);for(let A=0;A<_.length;A++){const C=_[A],L=[];for(let F=0;F<C.length;F++){const W=C[F],$=C[F+1],X=F===0?E:W.sub(C[F-1])._unit()._perp(),J=F===C.length-1?E:$.sub(W)._unit()._perp(),ie=X._add(J)._unit();ie._mult(1/(ie.x*J.x+ie.y*J.y)),L.push(ie._mult(v)._add(W))}T.push(L)}return T}(r,m*t.pixelToTileUnitsFactor)),function(_,v,T){for(let E=0;E<v.length;E++){const A=v[E];if(_.length>=3){for(let C=0;C<A.length;C++)if(ia(_,A[C]))return!0}if(by(_,A,T))return!0}return!1}(h,r,p)}isTileClipped(){return!0}},symbol:_h,background:class extends Hr{constructor(t){super(t,ux)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}},raster:class extends Hr{constructor(t){super(t,hx)}getProgramIds(){return["raster"]}},sky:class extends Hr{constructor(t){super(t,px),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="sky-gradient"?this._updateColorRamp():t!=="sky-atmosphere-sun"&&t!=="sky-atmosphere-halo-color"&&t!=="sky-atmosphere-color"&&t!=="sky-atmosphere-sun-intensity"||(this._skyboxInvali
8dated=!0)}_updateColorRamp(){this.colorRamp=vd({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(t){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const e=t.style.light.properties.get("position");return this._lightPosition.azimuthal!==e.azimuthal||this._lightPosition.polar!==e.polar}return!1}getCenter(t,e){if(this.paint.get("sky-type")==="atmosphere"){const r=this.paint.get("sky-atmosphere-sun"),a=!r,c=t.style.light,h=c.properties.get("position");return a&&c.properties.get("anchor")==="viewport"&&wi("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),a?Zd(h.azimuthal,90-h.polar,e):Zd(r[0],90-r[1],e)}const i=this.paint.get("sky-gradient-center");return Zd(i[0],90-i[1],e)}is3D(){return!1}isSky(){return!0}markSkyboxValid(t){this._skyboxInvalidated=!1,this._lightPosition=t.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const t=this.paint.get("sky-type");return t==="atmosphere"?["skyboxCapture","skybox"]:t==="gradient"?["skyboxGradient"]:null}}};class Bc{constructor(e,i,r,a){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(i,a)}update(e,i,r){const{width:a,height:c}=e,{context:h}=this,{gl:p}=h,{HTMLImageElement:m,HTMLCanvasElement:_,HTMLVideoElement:v,ImageData:T,ImageBitmap:E}=U;if(p.bindTexture(p.TEXTURE_2D,this.texture),h.pixelStoreUnpackFlipY.set(!1),h.pixelStoreUnpack.set(1),h.pixelStoreUnpackPremultiplyAlpha.set(this.format===p.RGBA&&(!i||i.premultiply!==!1)),r||this.size&&this.size[0]===a&&this.size[1]===c){const{x:A,y:C}=r||{x:0,y:0};e instanceof m||e instanceof _||e instanceof v||e instanceof T||E&&e instanceof E?p.texSubImage2D(p.TEXTURE_2D,0,A,C,p.RGBA,p.UNSIGNED_BYTE,e):p.texSubImage2D(p.TEXTURE_2D,0,A,C,a,c,p.RGBA,p.UNSIGNED_BYTE,e.data)}else this.size=[a,c],e instanceof m||e instanceof _||e instanceof v||e instanceof T||E&&e instanceof E?p.texImage2D(p.TEXTURE_2D,0,this.format,this.format,p.UNSIGNED_BYTE,e):p.texImage2D(p.TEXTURE_2D,0,this.format,a,c,0,this.format,p.UNSIGNED_BYTE,e.data);this.useMipmap=!!(i&&i.useMipmap&&this.isSizePowerOfTwo()),this.useMipmap&&p.generateMipmap(p.TEXTURE_2D)}bind(e,i){const{context:r}=this,{gl:a}=r;a.bindTexture(a.TEXTURE_2D,this.texture),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,this.useMipmap?e===a.NEAREST?a.NEAREST_MIPMAP_NEAREST:a.LINEAR_MIPMAP_NEAREST:e),this.filter=e),i!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,i),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,i),this.wrap=i)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class mx{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(){this._channel=void 0,this._callback=()=>{}}}class _x{constructor(){this.tasks={},this.taskQueue=[],Dt(["process"],this),this.invoker=new mx(this.process),this.nextId=0}add(e,i){const r=this.nextId++,a=function({type:c,isSymbolTile:h,zoom:p}){return p=p||0,c==="message"?0:c!=="maybePrepare"||h?c!=="parseTile"||h?c==="parseTile"&&h?300-p:c==="maybePrepare"&&h?400-p:500:200-p:100-p}(i);if(a===0){Hn();try{e()}finally{}return{cancel:()=>{}}}return this.tasks[r]={fn:e,metadata:i,priority:a,id:r},this.taskQueue.push(r),this.invoker.trigger(),{cancel:()=>{delete this.tasks[r]}}}process(){Hn();try{if(this.taskQueue=this.taskQueue.filter(r=>!!this.tasks[r]),!this.taskQueue.length)return;const e=this.pick();if(e===null)return;const i=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!i)return;i.fn()}finally{}}pick(){let e=null,i=1/0;for(let a=0;a<this.taskQueue.length;a++){const c=this.tasks[this.taskQueue[a]];c.priority<i&&(i=c.priority,e=a)}if(e===null)return null;const r=this.taskQueue[e];return this.taskQueue.splice(e,1),r}remove(){this.invoker.remove()}}class u_{constructor(e){this._stringToNumber={},this._numberToString=[];for(let i=0;i<e.length;i++){const r=e[i];this._stringToNumber[r]=i,this._numberToString[i]=r}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}const gx=["tile","layer","source","sourceLayer","state"];class h_{constructor(e,i,r,a,c){this.type="Feature",this._vectorTileFeature=e,this._z=i,this._x=r,this._y=a,this.properties=e.properties,this.id=c}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};this.id!==void 0&&(e.id=this.id);for(const i of gx)this[i]!==void 0&&(e[i]=this[i]);return e}}const Ar=32,fo=33,fs=new Uint16Array(8184);for(let t=0;t<2046;
vendor: 5,003 bytes, line 8
8t++){let e=t+2,i=0,r=0,a=0,c=0,h=0,p=0;for(1&e?a=c=h=Ar:i=r=p=Ar;(e>>=1)>1;){const _=i+a>>1,v=r+c>>1;1&e?(a=i,c=r,i=h,r=p):(i=a,r=c,a=h,c=p),h=_,p=v}const m=4*t;fs[m+0]=i,fs[m+1]=r,fs[m+2]=a,fs[m+3]=c}const mo=new Uint16Array(2178),ms=new Uint8Array(1089),gh=new Uint16Array(1089);function d_(t){return t===0?-.03125:t===32?.03125:0}var p_=pe([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const f_={type:2,extent:xt,loadGeometry:()=>[[new Re(0,0),new Re(xt+1,0),new Re(xt+1,xt+1),new Re(0,xt+1),new Re(0,0)]]};class qd{constructor(e,i,r,a,c){this.tileID=e,this.uid=Gn(),this.uses=0,this.tileSize=i,this.tileZoom=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=c,this.expiredRequestCount=0,this.state="loading",a&&a.transform&&(this.projection=a.transform.projection)}registerFadeDuration(e){const i=e+this.timeAdded;i<ji.now()||this.fadeEndTime&&i<this.fadeEndTime||(this.fadeEndTime=i)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}get tileTransform(){return this._tileTransform||(this._tileTransform=ra(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(e,i,r){if(this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(a,c){const h={};if(!c)return h;for(const p of a){const m=p.layerIds.map(_=>c.getLayer(_)).filter(Boolean);if(m.length!==0){p.layers=m,p.stateDependentLayerIds&&(p.stateDependentLayers=p.stateDependentLayerIds.map(_=>m.filter(v=>v.id===_)[0]));for(const _ of m)h[_.id]=p}}return h}(e.buckets,i.style),this.hasSymbolBuckets=!1;for(const a in this.buckets){const c=this.buckets[a];if(c instanceof ps){if(this.hasSymbolBuckets=!0,!r)break;c.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const a in this.buckets){const c=this.buckets[a];if(c instanceof ps&&c.hasRTLText){this.hasRTLText=!0,y.isLoading()||y.isLoaded()||f()!=="deferred"||g();break}}this.queryPadding=0;for(const a in this.buckets){const c=this.buckets[a];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(a).queryRadius(c))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),e.lineAtlas&&(this.lineAtlas=e.lineAtlas)}else this.collisionBoxArray=new gi}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(e){return this.buckets[e.id]}upload(e){for(const r in this.buckets){const a=this.buckets[r];a.uploadPending()&&a.upload(e)}const i=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Bc(e,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Bc(e,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new Bc(e,this.lineAtlas.image,i.ALPHA),this.lineAtlas.uploaded=!0)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,i,r,a,c,h,p,m){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:a,pixelPosMatrix:p,transform:h,params:c,tileTransform:this.tileTransform},e,i,r):{}}querySourceFeatures(e,i){const r=this.latestFeatureIndex;if(!r||!r.rawTileData)return;const a=r.loadVTLayers(),c=i?i.sourceLayer:"",h=a._geojsonTileLayer||a[c];if(!h)return;const p=Oa(i&&i.filter),{z:m,x:_,y:v}=this.tileID.canonical,T={z:m,x:_,y:v};for(let E=0;E<h.length;E++){const A=h.feature(E);if(p.needGeometry){const F=ta(A,!0);
vendor: 5,497 bytes, line 8
8if(!p.filter(new w(this.tileID.overscaledZ),F,this.tileID.canonical))continue}else if(!p.filter(new w(this.tileID.overscaledZ),A))continue;const C=r.getId(A,c),L=new h_(A,m,_,v,C);L.tile=T,e.push(L)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return!!this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const i=this.expirationTime;if(e.cacheControl){const r=Sn(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const r=Date.now();let a=!1;if(this.expirationTime>r)a=!1;else if(i)if(this.expirationTime<i)a=!0;else{const c=this.expirationTime-i;c?this.expirationTime=r+Math.max(c,3e4):a=!0}else a=!0;a?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(e,i){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(e).length===0||!i)return;const r=this.latestFeatureIndex.loadVTLayers(),a=i.style.listImages();for(const c in this.buckets){if(!i.style.hasLayer(c))continue;const h=this.buckets[c],p=h.layers[0].sourceLayer||"_geojsonTileLayer",m=r[p],_=e[p];if(!m||!_||Object.keys(_).length===0)continue;if(h.update(_,m,a,this.imageAtlas&&this.imageAtlas.patternPositions||{}),h instanceof ih||h instanceof Ju){const T=i.style._getSourceCache(h.layers[0].source);i._terrain&&i._terrain.enabled&&T&&h.programConfigurations.needsUpload&&i._terrain._clearRenderCacheForTile(T.id,this.tileID)}const v=i&&i.style&&i.style.getLayer(c);v&&(this.queryPadding=Math.max(this.queryPadding,v.queryRadius(h)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<ji.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=ji.now()+e}setTexture(e,i){const r=i.context,a=r.gl;this.texture=this.texture||i.getTileTexture(e.width),this.texture?this.texture.update(e,{useMipmap:!0}):(this.texture=new Bc(r,e,a.RGBA,{useMipmap:!0}),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE))}setDependencies(e,i){const r={};for(const a of i)r[a]=!0;this.dependencies[e]=r}hasDependency(e,i){for(const r of e){const a=this.dependencies[r];if(a){for(const c of i)if(a[c])return!0}}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(e,i){if(!i||i.name==="mercator"||this._tileDebugBuffer)return;const r=Uo(f_,this.tileID.canonical,this.tileTransform)[0],a=new Ne,c=new er;for(let h=0;h<r.length;h++){const{x:p,y:m}=r[h];a.emplaceBack(p,m),c.emplaceBack(h)}c.emplaceBack(0),this._tileDebugIndexBuffer=e.createIndexBuffer(c),this._tileDebugBuffer=e.createVertexBuffer(a,fc.members),this._tileDebugSegments=Xi.simpleSegment(0,0,a.length,c.length)}_makeTileBoundsBuffers(e,i){if(this._tileBoundsBuffer||!i||i.name==="mercator")return;const r=Uo(f_,this.tileID.canonical,this.tileTransform)[0];let a,c;if(this.isRaster){const h=function(p,m){const _=ra(p,m),v=Math.pow(2,p.z);for(let F=0;F<fo;F++)for(let W=0;W<fo;W++){const $=pr((p.x+(W+d_(W))/Ar)/v),X=An((p.y+(F+d_(F))/Ar)/v),J=m.project($,X),ie=F*fo+W;mo[2*ie+0]=Math.round((J.x*_.scale-_.x)*xt),mo[2*ie+1]=Math.round((J.y*_.scale-_.y)*xt)}ms.fill(0),gh.fill(0);for(let F=2045;F>=0;F--){const W=4*F,$=fs[W+0],X=fs[W+1],J=fs[W+2],ie=fs[W+3],te=$+J>>1,be=X+ie>>1,ye=te+be-X,ke=be+$-te,je=X*fo+$,Ee=ie*fo+J,Be=be*fo+te,Oe=Math.hypot((mo[2*je+0]+mo[2*Ee+0])/2-mo[2*Be+0],(mo[2*je+1]+mo[2*Ee+1])/2-mo[2*Be+1])>=16;ms[Be]=ms[Be]||(Oe?1:0),F<1022&&(ms[Be]=ms[Be]||ms[(X+ke>>1)*fo+($+ye>>1)]||ms[(ie+ke>>1)*fo+(J+ye>>1)])}const T=new Le,E=new dt;let A=0;function C(F,W){const $=W*fo+F;return gh[$]===0&&(T.emplaceBack(mo[2*$+0],mo[2*$+1],F*xt/Ar,W*xt/Ar),gh[$]=++A),gh[$]-1}function L(F,W,$,X,J,ie){const te=F+$>>1,be=W+X>>1;if(Math.abs(F-J)+Math.abs(W-ie)>1&&ms[be*fo+te])L(J,ie,F,W,te,be),L($,X,J,ie,te,be);else{const ye=C(F,W),ke=C($,X),je=C(J,ie);E.emplaceBack(ye,ke,je)}}return L(0,0,Ar,Ar,Ar,0),L(Ar,Ar,0,0,0,Ar),{vertices:T,indices:E}}(this.tileID.canonical,i);a=h.vertices,c=h.indices}else{a=new Le,c=new dt;for(const{x:p,y:m}of r)a.emplaceBack(p,m,0,0);const h=Sd(a.int16,void 0,4);for(let p=0;p<h.length;p+=3)c.emplaceBack(h[p],h[p+1],h[p+2])}this._tileBoundsBuffer=e.createVertexBuffer(a,p_.members),this._tileBoundsIndexBuffer=e.createIndexBuffer(c),this._tileBoundsSegments=Xi.simpleSegment(0,0,a.length,c.length)}_makeGlobeTileDebugBuffers(e,i){const r=i.projection;if(!r||r.name!=="globe"||i.freezeTileCoverage)return;const a=this.tileID.canonical,c=gc(Rf(a,i)),h=Xa(i.zoom);let p;h>0&&(p=$h(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(e,a,i,c,p,h),this._makeGlobeTileDebugTextBuffer(e,a,i,c,p,h)}_globePoint(e,i,r,a,c,h,p){let m=_c(e,i,r);if(h){const _=1<<r.z,v=ho(a.center.lng),T=po(a.center.lat),E=(r.x+.5)/_-v;let A=0;E>.5?A=-1:E<-.5&&(A=1);let C=(e/xt+r.x)/_+A,L=(i/xt+r.y)/_;C=(C-v)*a._pixelsPerMercatorPixel+v,L=(L-T)*a._pixelsPerMercatorPixel+T;const F=[C*a.worldSize,L*a.worldSize,0];Zi(F,F,h),m=ea(m,F,p)}return Zi(m,m,c)}_makeGlobeTileDebugBorderBuffer(e,i,r,a,c,h){const p=new Ne,m=new er,_=new ge,v=(E,A,C,L,F)=>{const W=(C-E)/(F-1),$=(L-A)/(F-1),X=p.length;for(let J=0;J<F;J++){const ie=E+J*W,te=A+J*$;p.emplaceBack(ie,te);
vendor: 11,159 bytes, line 8
8const be=this._globePoint(ie,te,i,r,a,c,h);_.emplaceBack(be[0],be[1],be[2]),m.emplaceBack(X+J)}},T=xt;v(0,0,T,0,16),v(T,0,T,T,16),v(T,T,0,T,16),v(0,T,0,0,16),this._tileDebugIndexBuffer=e.createIndexBuffer(m),this._tileDebugBuffer=e.createVertexBuffer(p,fc.members),this._globeTileDebugBorderBuffer=e.createVertexBuffer(_,zf.members),this._tileDebugSegments=Xi.simpleSegment(0,0,p.length,m.length)}_makeGlobeTileDebugTextBuffer(e,i,r,a,c,h){const p=xt/4,m=new Ne,_=new dt,v=new ge,T=25;_.reserve(32),m.reserve(T),v.reserve(T);const E=(A,C)=>T*A+C;for(let A=0;A<T;A++){const C=A*p;for(let L=0;L<T;L++){const F=L*p;m.emplaceBack(F,C);const W=this._globePoint(F,C,i,r,a,c,h);v.emplaceBack(W[0],W[1],W[2])}}for(let A=0;A<4;A++)for(let C=0;C<4;C++){const L=E(A,C),F=E(A,C+1),W=E(A+1,C),$=E(A+1,C+1);_.emplaceBack(L,F,W),_.emplaceBack(W,F,$)}this._tileDebugTextIndexBuffer=e.createIndexBuffer(_),this._tileDebugTextBuffer=e.createVertexBuffer(m,fc.members),this._globeTileDebugTextBuffer=e.createVertexBuffer(v,zf.members),this._tileDebugTextSegments=Xi.simpleSegment(0,0,T,32)}}class yx{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,i,r){const a=String(i);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][a]=this.stateChanges[e][a]||{},$t(this.stateChanges[e][a],r),this.deletedStates[e]===null){this.deletedStates[e]={};for(const c in this.state[e])c!==a&&(this.deletedStates[e][c]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][a]===null){this.deletedStates[e][a]={};for(const c in this.state[e][a])r[c]||(this.deletedStates[e][a][c]=null)}else for(const c in r)this.deletedStates[e]&&this.deletedStates[e][a]&&this.deletedStates[e][a][c]===null&&delete this.deletedStates[e][a][c]}removeFeatureState(e,i,r){if(this.deletedStates[e]===null)return;const a=String(i);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&i!==void 0)this.deletedStates[e][a]!==null&&(this.deletedStates[e][a]=this.deletedStates[e][a]||{},this.deletedStates[e][a][r]=null);else if(i!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][a])for(r in this.deletedStates[e][a]={},this.stateChanges[e][a])this.deletedStates[e][a][r]=null;else this.deletedStates[e][a]=null;else this.deletedStates[e]=null}getState(e,i){const r=String(i),a=$t({},(this.state[e]||{})[r],(this.stateChanges[e]||{})[r]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){const c=this.deletedStates[e][i];if(c===null)return{};for(const h in c)delete a[h]}return a}initializeTileState(e,i){e.setFeatureState(this.state,i)}coalesceChanges(e,i){const r={};for(const a in this.stateChanges){this.state[a]=this.state[a]||{};const c={};for(const h in this.stateChanges[a])this.state[a][h]||(this.state[a][h]={}),$t(this.state[a][h],this.stateChanges[a][h]),c[h]=this.state[a][h];r[a]=c}for(const a in this.deletedStates){this.state[a]=this.state[a]||{};const c={};if(this.deletedStates[a]===null)for(const h in this.state[a])c[h]={},this.state[a][h]={};else for(const h in this.deletedStates[a]){if(this.deletedStates[a][h]===null)this.state[a][h]={};else if(this.state[a][h])for(const p of Object.keys(this.deletedStates[a][h]))delete this.state[a][h][p];c[h]=this.state[a][h]}r[a]=r[a]||{},$t(r[a],c)}if(this.stateChanges={},this.deletedStates={},Object.keys(r).length!==0)for(const a in e)e[a].setFeatureState(r,i)}}class m_{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,i){const r=this.toIdx(e,i);return{min:this.minimums[r],max:this.maximums[r]}}isLeaf(e,i){return this.leaves[this.toIdx(e,i)]}toIdx(e,i){return i*this.size+e}}function __(t,e,i,r){let a=0,c=Number.MAX_VALUE;for(let h=0;h<3;h++)if(Math.abs(r[h])<1e-15){if(i[h]<t[h]||i[h]>e[h])return null}else{const p=1/r[h];let m=(t[h]-i[h])*p,_=(e[h]-i[h])*p;if(m>_){const v=m;m=_,_=v}if(m>a&&(a=m),_<c&&(c=_),a>c)return null}return a}function g_(t,e,i,r,a,c,h,p,m,_,v){const T=r-t,E=a-e,A=c-i,C=h-t,L=p-e,F=m-i,W=v[1]*F-v[2]*L,$=v[2]*C-v[0]*F,X=v[0]*L-v[1]*C,J=T*W+E*$+A*X;if(Math.abs(J)<1e-15)return null;const ie=1/J,te=_[0]-t,be=_[1]-e,ye=_[2]-i,ke=(te*W+be*$+ye*X)*ie;if(ke<0||ke>1)return null;const je=be*A-ye*E,Ee=ye*T-te*A,Be=te*E-be*T,Oe=(v[0]*je+v[1]*Ee+v[2]*Be)*ie;return Oe<0||ke+Oe>1?null:(C*je+L*Ee+F*Be)*ie}function y_(t,e,i){return(t-e)/(i-e)}function x_(t,e,i,r,a,c,h,p,m){const _=1<<i,v=c-r,T=h-a,E=(t+1)/_*v+r,A=(e+0)/_*T+a,C=(e+1)/_*T+a;p[0]=(t+0)/_*v+r,p[1]=A,m[0]=E,m[1]=C}class v_{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const i=function(c){const h=Math.ceil(Math.log2(c.dim/8)),p=[];let m=Math.ceil(Math.pow(2,h));const _=1/m,v=(A,C,L,F,W)=>{const $=F?1:0,X=(A+1)*L-$,J=C*L,ie=(C+1)*L-$;W[0]=A*L,W[1]=J,W[2]=X,W[3]=ie};let T=new m_(m);const E=[];for(let A=0;A<m*m;A++){v(A%m,Math.floor(A/m),_,!1,E);const C=_s(E[0],E[1],c),L=_s(E[2],E[1],c),F=_s(E[2],E[3],c),W=_s(E[0],E[3],c);T.minimums.push(Math.min(C,L,F,W)),T.maximums.push(Math.max(C,L,F,W)),T.leaves.push(1)}for(p.push(T),m/=2;m>=1;m/=2){const A=p[p.length-1];T=new m_(m);for(let C=0;C<m*m;C++){v(C%m,Math.floor(C/m),2,!0,E);const L=A.getElevation(E[0],E[1]),F=A.getElevation(E[2],E[1]),W=A.getElevation(E[2],E[3]),$=A.getElevation(E[0],E[3]),X=A.isLeaf(E[0],E[1]),J=A.isLeaf(E[2],E[1]),ie=A.isLeaf(E[2],E[3]),te=A.isLeaf(E[0],E[3]),be=Math.min(L.min,F.min,W.min,$.min),ye=Math.max(L.max,F.max,W.max,$.max),ke=X&&J&&ie&&te;T.maximums.push(ye),T.minimums.push(be),T.leaves.push(ye-be<=5&&ke?1:0)}p.push(T)}return p}(this.dem),r=i.length-1,a=i[r];this._addNode(a.minimums[0],a.maximums[0],a.leaves[0]),this._construct(i,0,0,r,0)}raycastRoot(e,i,r,a,c,h,p=1){return __([e,i,-100],[r,a,this.maximums[0]*p],c,h)}raycast(e,i,r,a,c,h,p=1){if(!this.nodeCount)return null;const m=this.raycastRoot(e,i,r,a,c,h,p);if(m==null)return null;const _=[],v=[],T=[],E=[],A=[{idx:0,t:m,nodex:0,nodey:0,depth:0}];for(;A.length>0;){const{idx:C,t:L,nodex:F,nodey:W,depth:$}=A.pop();if(this.leaves[C]){x_(F,W,$,e,i,r,a,T,E);const J=1<<$,ie=(F+0)/J,te=(F+1)/J,be=(W+0)/J,ye=(W+1)/J,ke=_s(ie,be,this.dem)*p,je=_s(te,be,this.dem)*p,Ee=_s(te,ye,this.dem)*p,Be=_s(ie,ye,this.dem)*p,Oe=g_(T[0],T[1],ke,E[0],T[1],je,E[0],E[1],Ee,c,h),Ue=g_(E[0],E[1],Ee,T[0],E[1],Be,T[0],T[1],ke,c,h),Xe=Math.min(Oe!==null?Oe:Number.MAX_VALUE,Ue!==null?Ue:Number.MAX_VALUE);if(Xe!==Number.MAX_VALUE)return Xe;{const Ae=dc([],c,h,L);if(b_(ke,je,Be,Ee,y_(Ae[0],T[0],E[0]),y_(Ae[1],T[1],E[1]))>=Ae[2])return L}continue}let X=0;for(let J=0;J<this._siblingOffset.length;J++){x_((F<<1)+this._siblingOffset[J][0],(W<<1)+this._siblingOffset[J][1],$+1,e,i,r,a,T,E),T[2]=-100,E[2]=this.maximums[this.childOffsets[C]+J]*p;const ie=__(T,E,c,h);if(ie!=null){const te=ie;_[J]=te;let be=!1;for(let ye=0;ye<X&&!be;ye++)te>=_[v[ye]]&&(v.splice(ye,0,J),be=!0);be||(v[X]=J),X++}}for(let J=0;J<X;J++){const ie=v[J];A.push({idx:this.childOffsets[C]+ie,t:_[ie],nodex:(F<<1)+this._siblingOffset[ie][0],nodey:(W<<1)+this._siblingOffset[ie][1],depth:$+1})}}return null}_addNode(e,i,r){return this.minimums.push(e),this.maximums.push(i),this.leaves.push(r),this.childOffsets.push(0),this.nodeCount++}_construct(e,i,r,a,c){if(e[a].isLeaf(i,r)===1)return;this.childOffsets[c]||(this.childOffsets[c]=this.nodeCount);const h=a-1,p=e[h];let m=0,_=0;for(let v=0;v<this._siblingOffset.length;v++){const T=2*i+this._siblingOffset[v][0],E=2*r+this._siblingOffset[v][1],A=p.getElevation(T,E),C=p.isLeaf(T,E),L=this._addNode(A.min,A.max,C);C&&(m|=1<<v),_||(_=L)}for(let v=0;v<this._siblingOffset.length;v++)m&1<<v||this._construct(e,2*i+this._siblingOffset[v][0],2*r+this._siblingOffset[v][1],h,_+v)}}function b_(t,e,i,r,a,c){return ii(ii(t,i,c),ii(e,r,c),a)}function _s(t,e,i){const r=i.dim,a=St(t*r-.5,0,r-1),c=St(e*r-.5,0,r-1),h=Math.floor(a),p=Math.floor(c),m=Math.min(h+1,r-1),_=Math.min(p+1,r-1);return b_(i.get(h,p),i.get(m,p),i.get(h,_),i.get(m,_),a-h,c-p)}const w_={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function xx(t,e,i){return(256*t*256+256*e+i)/10-1e4}function vx(t,e,i){return 256*t+e+i/256-32768}class yh{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,i,r,a=!1,c=!1){if(this.uid=e,i.height!==i.width)throw new RangeError("DEM tiles must be square");if(r&&r!=="mapbox"&&r!=="terrarium")return wi(`"${r}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=i.height;const h=this.dim=i.height-2,p=new Uint32Array(i.data.buffer);if(this.pixels=new Uint8Array(i.data.buffer),this.encoding=r||"mapbox",this.borderReady=a,!a){for(let m=0;m<h;m++)p[this._idx(-1,m)]=p[this._idx(0,m)],p[this._idx(h,m)]=p[this._idx(h-1,m)],p[this._idx(m,-1)]=p[this._idx(m,0)],p[this._idx(m,h)]=p[this._idx(m,h-1)];p[this._idx(-1,-1)]=p[this._idx(0,0)],p[this._idx(h,-1)]=p[this._idx(h-1,0)],p[this._idx(-1,h)]=p[this._idx(0,h-1)],p[this._idx(h,h)]=p[this._idx(h-1,h-1)],c&&this._buildQuadTree()}}_buildQuadTree(){this._tree=new v_(this)}get(e,i,r=!1){r&&(e=St(e,-1,this.dim),i=St(i,-1,this.dim));const a=4*this._idx(e,i);return(this.encoding==="terrarium"?vx:xx)(this.pixels[a],this.pixels[a+1],this.pixels[a+2])}static getUnpackVector(e){return w_[e]}get unpackVector(){return w_[this.encoding]}_idx(e,i){if(e<-1||e>=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(e+1)}static pack(e,i){const r=[0,0,0,0],a=yh.getUnpackVector(i);let c=Math.floor((e+a[3])/a[2]);return r[2]=c%256,c=Math.floor(c/256),r[1]=c%256,c=Math.floor(c/256),r[0]=c,r}getPixels(){return new ir({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,i,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let a=i*this.dim,c=i*this.dim+this.dim,h=r*this.dim,p=r*this.dim+this.dim;switch(i){case-1:a=c-1;break;case 1:c=a+1}switch(r){case-1:h=p-1;break;case 1:p=h+1}const m=-i*this.dim,_=-r*this.dim;for(let v=h;v<p;v++)for(let T=a;T<c;T++){const E=4*this._idx(T,v),A=4*this._idx(T+m,v+_);this.pixels[E+0]=e.pixels[A+0],this.pixels[E+1]=e.pixels[A+1],this.pixels[E+2]=e.pixels[A+2],this.pixels[E+3]=e.pixels[A+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}ct(yh,"DEMData"),ct(v_,"DemMinMaxQuadTree",{omit:["dem"]});class bx{constructor(e,i){this.max=e,this.onRemove=i,this.reset()}reset(){for(const e in this.data)for(const i of this.data[e])i.timeout&&clearTimeout(i.timeout),this.onRemove(i.value);return this.data={},this.order=[],this}add(e,i,r){const a=e.wrapped().key;this.data[a]===void 0&&(this.data[a]=[]);const c={value:i,timeout:void 0};if(r!==void 0&&(c.timeout=setTimeout(()=>{this.remove(e,c)},r)),this.data[a].push(c),this.order.push(a),this.order.length>this.max){const h=this._getAndRemoveByKey(this.order[0]);h&&this.onRemove(h)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const i=this.data[e].shift();return i.timeout&&clearTimeout(i.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),i.value}getByKey(e){const i=this.data[e];return i?i[0].value:null}
8get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,i){if(!this.has(e))return this;const r=e.wrapped().key,a=i===void 0?0:this.data[r].indexOf(i),c=this.data[r][a];return this.data[r].splice(a,1),c.timeout&&clearTimeout(c.timeout),this.data[r].length===0&&delete this.data[r],this.onRemove(c.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const i=this._getAndRemoveByKey(this.order[0]);i&&this.onRemove(i)}return this}filter(e){const i=[];for(const r in this.data)for(const a of this.data[r])e(a.value)||i.push(a);for(const r of i)this.remove(r.value.tileID,r)}}class ll{constructor(e,i,r){this.func=e,this.mask=i,this.range=r}}ll.ReadOnly=!1,ll.ReadWrite=!0,ll.disabled=new ll(519,ll.ReadOnly,[0,1]);const Wd=7680;class Xd{constructor(e,i,r,a,c,h){this.test=e,this.ref=i,this.mask=r,this.fail=a,this.depthFail=c,this.pass=h}}Xd.disabled=new Xd({func:519,mask:0},0,0,Wd,Wd,Wd);class _o{constructor(e,i,r){this.blendFunction=e,this.blendColor=i,this.mask=r}}_o.Replace=[1,0],_o.disabled=new _o(_o.Replace,Gi.transparent,[!1,!1,!1,!1]),_o.unblended=new _o(_o.Replace,Gi.transparent,[!0,!0,!0,!0]),_o.alphaBlended=new _o([1,771],Gi.transparent,[!0,!0,!0,!0]);const Hd=1029,Kd=2305;class eo{constructor(e,i,r){this.enable=e,this.mode=i,this.frontFace=r}}eo.disabled=new eo(!1,Hd,Kd),eo.backCCW=new eo(!0,Hd,Kd),eo.backCW=new eo(!0,Hd,2304),eo.frontCW=new eo(!0,1028,2304),eo.frontCCW=new eo(!0,1028,Kd);class oa extends ws{constructor(e,i,r){super(),this.id=e,this._onlySymbols=r,i.on("data",a=>{a.dataType==="source"&&a.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&a.dataType==="source"&&a.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),i.on("error",()=>{this._sourceErrored=!0}),this._source=i,this._tiles={},this._cache=new bx(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=i.minTileCacheSize,this._maxTileCacheSize=i.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new yx,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="custom"&&this._source._dataType==="raster"}onAdd(e){this.map=e,this._minTileCacheSize=this._minTileCacheSize===void 0&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const e in this._tiles){const i=this._tiles[e];if(i.state!=="loaded"&&i.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,i){return e.isSymbolTile=this._onlySymbols,this._source.loadTile(e,i)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,()=>{})}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e,()=>{})}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const i in this._tiles){const r=this._tiles[i];r.upload(e),r.prepare(this.map.style.imageManager)}}getIds(){return Mi(this._tiles).map(e=>e.tileID).sort(T_).map(e=>e.key)}getRenderableIds(e){const i=[];for(const r in this._tiles)this._isIdRenderable(+r,e)&&i.push(this._tiles[r]);return e?i.sort((r,a)=>{const c=r.tileID,h=a.tileID,p=new Re(c.canonical.x,c.canonical.y)._rotate(this.transform.angle),m=new Re(h.canonical.x,h.canonical.y)._rotate(this.transform.angle);return c.overscaledZ-h.overscaledZ||m.y-p.y||m.x-p.x}).map(r=>r.tileID.key):i.map(r=>r.tileID).sort(T_).map(r=>r.key)}hasRenderableParent(e){const i=this.findLoadedParent(e,0);return!!i&&this._isIdRenderable(i.tileID.key)}_isIdRenderable(e,i){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(i||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)this._tiles[e].state!=="errored"&&this._reloadTile(+e,"reloading")}}_reloadTile(e,i){const r=this._tiles[e];r&&(r.state!=="loading"&&(r.state=i),this._loadTile(r,this._tileLoaded.bind(this,r,e,i)))}_tileLoaded(e,i,r,a){if(a)if(e.state="errored",a.status!==404)this._source.fire(new Or(a,{tile:e}));else if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){const c=this.map.painter.terrain;this.update(this.transform,c.getScaledDemTileSize(),!0),c.resetTileLookupCache(this.id
vendor: 17,861 bytes, line 8
8)}else this.update(this.transform);else e.timeAdded=ji.now(),r==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),this._source.type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new So("data",{dataType:"source",tile:e,coord:e.tileID,sourceCacheId:this.id}))}_backfillDEM(e){const i=this.getRenderableIds();for(let a=0;a<i.length;a++){const c=i[a];if(e.neighboringTiles&&e.neighboringTiles[c]){const h=this.getTileByID(c);r(e,h),r(h,e)}}function r(a,c){if(!a.dem||a.dem.borderReady)return;a.needsHillshadePrepare=!0,a.needsDEMTextureUpload=!0;let h=c.tileID.canonical.x-a.tileID.canonical.x;const p=c.tileID.canonical.y-a.tileID.canonical.y,m=Math.pow(2,a.tileID.canonical.z),_=c.tileID.key;h===0&&p===0||Math.abs(p)>1||(Math.abs(h)>1&&(Math.abs(h+m)===1?h+=m:Math.abs(h-m)===1&&(h-=m)),c.dem&&a.dem&&(a.dem.backfillBorder(c.dem,h,p),a.neighboringTiles&&a.neighboringTiles[_]&&(a.neighboringTiles[_].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,i,r,a){for(const c in this._tiles){let h=this._tiles[c];if(a[c]||!h.hasData()||h.tileID.overscaledZ<=i||h.tileID.overscaledZ>r)continue;let p=h.tileID;for(;h&&h.tileID.overscaledZ>i+1;){const _=h.tileID.scaledTo(h.tileID.overscaledZ-1);h=this._tiles[_.key],h&&h.hasData()&&(p=_)}let m=p;for(;m.overscaledZ>i;)if(m=m.scaledTo(m.overscaledZ-1),e[m.key]){a[p.key]=p;break}}}findLoadedParent(e,i){if(e.key in this._loadedParentTiles){const r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=i?r:null}for(let r=e.overscaledZ-1;r>=i;r--){const a=e.scaledTo(r),c=this._getLoadedTile(a);if(c)return c}}_getLoadedTile(e){const i=this._tiles[e.key];return i&&i.hasData()?i:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,i){i=i||this._source.tileSize;const r=Math.ceil(e.width/i)+1,a=Math.ceil(e.height/i)+1,c=Math.floor(r*a*5),h=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,c):c,p=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,h):h;this._cache.setMaxSize(p)}handleWrapJump(e){const i=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,i){const r={};for(const a in this._tiles){const c=this._tiles[a];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+i),r[c.tileID.key]=c}this._tiles=r;for(const a in this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(const a in this._tiles)this._setTileReloadTimer(+a,this._tiles[a])}}update(e,i,r){if(this.transform=e,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!r)return;let a;this.updateCacheSize(e,i),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?a=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(p=>new Vn(p.canonical.z,p.wrap,p.canonical.z,p.canonical.x,p.canonical.y)):(a=e.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!r,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(a=a.filter(p=>this._source.hasTile(p)))):a=[];const c=this._updateRetainedTiles(a);if(E_(this._source.type)&&a.length!==0){const p={},m={},_=Object.keys(c);for(const T of _){const E=c[T],A=this._tiles[T];if(!A||A.fadeEndTime&&A.fadeEndTime<=ji.now())continue;const C=this.findLoadedParent(E,Math.max(E.overscaledZ-oa.maxOverzooming,this._source.minzoom));C&&(this._addTile(C.tileID),p[C.tileID.key]=C.tileID),m[T]=E}const v=a[a.length-1].overscaledZ;for(const T in this._tiles){const E=this._tiles[T];if(c[T]||!E.hasData())continue;let A=E.tileID;for(;A.overscaledZ>v;){A=A.scaledTo(A.overscaledZ-1);const C=this._tiles[A.key];if(C&&C.hasData()&&m[A.key]){c[T]=E.tileID;break}}}for(const T in p)c[T]||(this._coveredTiles[T]=!0,c[T]=p[T])}for(const p in c)this._tiles[p].clearFadeHold();const h=function(p,m){const _=[];for(const v in p)v in m||_.push(v);return _}(this._tiles,c);for(const p of h){const m=this._tiles[p];m.hasSymbolBuckets&&!m.holdingForFade()?m.setHoldDuration(this.map._fadeDuration):m.hasSymbolBuckets&&!m.symbolFadeFinished()||this._removeTile(+p)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const i={};if(e.length===0)return i;const r={},a=e.reduce((_,v)=>Math.min(_,v.overscaledZ),1/0),c=e[0].overscaledZ,h=Math.max(c-oa.maxOverzooming,this._source.minzoom),p=Math.max(c+oa.maxUnderzooming,this._source.minzoom),m={};for(const _ of e){const v=this._addTile(_);i[_.key]=_,v.hasData()||a<this._source.maxzoom&&(m[_.key]=_)}this._retainLoadedChildren(m,a,p,i);for(const _ of e){let v=this._tiles[_.key];if(v.hasData())continue;if(_.canonical.z>=this._source.maxzoom){const E=_.children(this._source.maxzoom)[0],A=this.getTile(E);if(A&&A.hasData()){i[E.key]=E;continue}}else{const E=_.children(this._source.maxzoom);if(i[E[0].key]&&i[E[1].key]&&i[E[2].key]&&i[E[3].key])continue}let T=v.wasRequested();for(let E=_.overscaledZ-1;E>=h;--E){const A=_.scaledTo(E);if(r[A.key]||(r[A.key]=!0,v=this.getTile(A),!v&&T&&(v=this._addTile(A)),v&&(i[A.key]=A,T=v.wasRequested(),v.hasData())))break}}return i}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const i=[];let r,a=this._tiles[e].tileID;for(;a.overscaledZ>0;){if(a.key in this._loadedParentTiles){r=this._loadedParentTiles[a.key];break}i.push(a.key);const c=a.scaledTo(a.overscaledZ-1);if(r=this._getLoadedTile(c),r)break;a=c}for(const c of i)this._loadedParentTiles[c]=r}}_addTile(e){let i=this._tiles[e.key];if(i)return i;i=this._cache.getAndRemove(e),i&&(this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,i)));const r=!!i;if(!r){const a=this.map?this.map.painter:null;i=new qd(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,a,this._isRaster),this._loadTile(i,this._tileLoaded.bind(this,i,e.key,i.state))}return i?(i.uses++,this._tiles[e.key]=i,r||this._source.fire(new So("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null}_setTileReloadTimer(e,i){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const r=i.getExpiryTimeout();r&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},r))}_removeTile(e){const i=this._tiles[e];i&&(i.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),i.uses>0||(i.hasData()&&i.state!=="reloading"?this._cache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(e,i,r){const a=[],c=this.transform;if(!c)return a;const h=c.projection.name==="globe",p=ho(c.center.lng);for(const m in this._tiles){const _=this._tiles[m];if(r&&_.clearQueryDebugViz(),_.holdingForFade())continue;let v;if(h){const T=_.tileID.canonical;if(T.z===0){const E=[Math.abs(St(p,...Oc(T,-1))-p),Math.abs(St(p,...Oc(T,1))-p)];v=[0,2*E.indexOf(Math.min(...E))-1]}else{const E=[Math.abs(St(p,...Oc(T,-1))-p),Math.abs(St(p,...Oc(T,0))-p),Math.abs(St(p,...Oc(T,1))-p)];v=[E.indexOf(Math.min(...E))-1]}}else v=[0];for(const T of v){const E=e.containsTile(_,c,i,T);E&&a.push(E)}}return a}getVisibleCoordinates(e){const i=this.getRenderableIds(e).map(r=>this._tiles[r].tileID);for(const r of i)r.projMatrix=this.transform.calculateProjMatrix(r.toUnwrapped());return i}hasTransition(){if(this._source.hasTransition())return!0;if(E_(this._source.type))for(const e in this._tiles){const i=this._tiles[e];if(i.fadeEndTime!==void 0&&i.fadeEndTime>=ji.now())return!0}return!1}setFeatureState(e,i,r){this._state.updateState(e=e||"_geojsonTileLayer",i,r)}removeFeatureState(e,i,r){this._state.removeFeatureState(e=e||"_geojsonTileLayer",i,r)}getFeatureState(e,i){return this._state.getState(e=e||"_geojsonTileLayer",i)}setDependencies(e,i,r){const a=this._tiles[e];a&&a.setDependencies(i,r)}reloadTilesForDependencies(e,i){for(const r in this._tiles)this._tiles[r].hasDependency(e,i)&&this._reloadTile(+r,"reloading");this._cache.filter(r=>!r.hasDependency(e,i))}_preloadTiles(e,i){if(!this._sourceLoaded){const p=()=>{this._sourceLoaded&&(this._source.off("data",p),this._preloadTiles(e,i))};return void this._source.on("data",p)}const r=new Map,a=Array.isArray(e)?e:[e],c=this.map.painter.terrain,h=this.usedForTerrain&&c?c.getScaledDemTileSize():this._source.tileSize;for(const p of a){const m=p.coveringTiles({tileSize:h,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const _ of m)r.set(_.key,_);this.usedForTerrain&&p.updateElevation(!1)}ai(Array.from(r.values()),(p,m)=>{const _=new qd(p,this._source.tileSize*p.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(_,v=>{this._source.type==="raster-dem"&&_.dem&&this._backfillDEM(_),m(v,_)})},i)}}function T_(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function E_(t){return t==="raster"||t==="image"||t==="video"||t==="custom"}function Oc(t,e){const i=1<<t.z;return[t.x/i+e,(t.x+1)/i+e]}oa.maxOverzooming=10,oa.maxUnderzooming=3;class xh{constructor(e,i,r){this._demTile=e,this._dem=this._demTile.dem,this._scale=i,this._offset=r}static create(e,i,r){const a=r||e.findDEMTileFor(i);if(!a||!a.dem)return;const c=a.dem,h=a.tileID,p=1<<i.canonical.z-h.canonical.z;return new xh(a,a.tileSize/xt/p,[(i.canonical.x/p-h.canonical.x)*c.dim,(i.canonical.y/p-h.canonical.y)*c.dim])}tileCoordToPixel(e,i){const r=i*this._scale+this._offset[1],a=Math.floor(e*this._scale+this._offset[0]),c=Math.floor(r);return new Re(a,c)}getElevationAt(e,i,r,a){const c=e*this._scale+this._offset[0],h=i*this._scale+this._offset[1],p=Math.floor(c),m=Math.floor(h),_=this._dem;return a=!!a,r?ii(ii(_.get(p,m,a),_.get(p,m+1,a),h-m),ii(_.get(p+1,m,a),_.get(p+1,m+1,a),h-m),c-p):_.get(p,m,a)}getElevationAtPixel(e,i,r){return this._dem.get(e,i,!!r)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*Jr(1,e)*this._dem.stride}}class S_{constructor(e,i){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new zo(xt,16,0),this.featureIndexArray=new Xs,this.promoteId=i}insert(e,i,r,a,c,h=0){const p=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,a,c,h);const m=this.grid;for(let _=0;_<i.length;_++){const v=i[_],T=[1/0,1/0,-1/0,-1/0];for(let E=0;E<v.length;E++){const A=v[E];T[0]=Math.min(T[0],A.x),T[1]=Math.min(T[1],A.y),T[2]=Math.max(T[2],A.x),T[3]=Math.max(T[3],A.y)}T[0]<xt&&T[1]<xt&&T[2]>=0&&T[3]>=0&&m.insert(p,T[0],T[1],T[2],T[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Cd(new oh(this.rawTileData)).layers,this.sourceLayerCoder=new u_(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,i,r,a){this.loadVTLayers();const c=e.params||{},h=Oa(c.filter),p=e.tileResult,m=e.transform,_=p.bufferedTilespaceBounds,v=this.grid.query(_.min.x,_.min.y,_.max.x,_.max.y,(C,L,F,W)=>Yf(p.bufferedTilespaceGeometry,C,L,F,W));v.sort(wx);let T=null;m.elevation&&v.length>0&&(T=xh.create(m.elevation,this.tileID));const E={};let A;for(let C=0;C<v.length;C++){const L=v[C];if(L===A)continue;A=L;const F=this.featureIndexArray.get(L);let W=null;this.loadMatchingFeature(E,F,h,c.layers,c.availableImages,i,r,a,($,X,J,ie=0)=>(W||(W=Uo($,this.tileID.canonical,e.tileTransform)),X.queryIntersectsFeature(p,$,J,W,this.z,e.transform,e.pixelPosMatrix,T,ie)))}return E}loadMatchingFeature(e,i,r,a,c,h,p,m,_){const{featureIndex:v,bucketIndex:T,sourceLayerIndex:E,layoutVertexArrayOffset:A}=i,C=this.bucketLayerIDs[T];if(a&&!function($,X){for(let J=0;J<$.length;J++)if(X.indexOf($[J])>=0)return!0;return!1}(a,C))return;const L=this.sourceLayerCoder.decode(E),F=this.vtLayers[L].feature(v);if(r.needGeometry){const $=ta(F,!0);if(!r.filter(new w(this.tileID.overscaledZ),$,this.tileID.canonical))return}else if(!r.filter(new w(this.tileID.overscaledZ),F))return;const W=this.getId(F,L);for(let $=0;$<C.length;$++){const X=C[$];if(a&&a.indexOf(X)<0)continue;const J=h[X];if(!J)continue;let ie={};W!==void 0&&m&&(ie=m.getState(J.sourceLayer||"_geojsonTileLayer",W));const te=$t({},p[X]);te.paint=I_(te.paint,J.paint,F,ie,c),te.layout=I_(te.layout,J.layout,F,ie,c);const be=!_||_(F,J,ie,A);if(!be)continue;const ye=new h_(F,this.z,this.x,this.y,W);ye.layer=te;let ke=e[X];ke===void 0&&(ke=e[X]=[]),ke.push({featureIndex:v,feature:ye,intersectionZ:be})}}lookupSymbolFeatures(e,i,r,a,c,h,p,m){const _={};this.loadVTLayers();const v=Oa(c);for(const T of e)this.loadMatchingFeature(_,{bucketIndex:r,sourceLayerIndex:a,featureIndex:T,layoutVertexArrayOffset:0},v,h,p,m,i);return _}loadFeature(e){const{featureIndex:i,sourceLayerIndex:r}=e;this.loadVTLayers();const a=this.sourceLayerCoder.decode(r),c=this.vtFeatures[a];if(c[i])return c[i];const h=this.vtLayers[a].feature(i);return c[i]=h,h}hasLayer(e){for(const i of this.bucketLayerIDs)for(const r of i)if(e===r)return!0;return!1}getId(e,i){let r=e.id;if(this.promoteId){const a=typeof this.promoteId=="string"?this.promoteId:this.promoteId[i];a!=null&&(r=e.properties[a]),typeof r=="boolean"&&(r=Number(r))}return r}}function I_(t,e,i,r,a){return Vt(t,(c,h)=>{const p=e instanceof q?e.get(h):null;return p&&p.evaluate?p.evaluate(i,r,a):p})}function wx(t,e){return e-t}ct(S_,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class M_{constructor(e,i){this.width=e,this.height=i,this.nextRow=0,this.image=new Vo({width:e,height:i}),this.positions={},this.uploaded=!1}getDash(e,i){const r=this.getKey(e,i);return this.positions[r]}trim(){const e=this.width,i=this.height=mn(this.nextRow);this.image.resize({width:e,height:i})}getKey(e,i){return e.join(",")+i}getDashRanges(e,i,r){const a=[];let c=e.length%2==1?-e[e.length-1]*r:0,h=e[0]*r,p=!0;a.push({left:c,right:h,isDash:p,zeroLength:e[0]===0});let m=e[0];for(let _=1;_<e.length;_++){p=!p;const v=e[_];c=m*r,m+=v,h=m*r,a.push({left:c,right:h,isDash:p,zeroLength:v===0})}return a}addRoundDash(e,i,r){const a=i/2;for(let c=-r;c<=r;c++){const h=this.width*(this.nextRow+r+c);let p=0,m=e[p];for(let _=0;_<this.width;_++){_/m.right>1&&(m=e[++p]);const v=Math.abs(_-m.left),T=Math.abs(_-m.right),E=Math.min(v,T);let A;const C=c/r*(a+1);if(m.isDash){const L=a-Math.abs(C);A=Math.sqrt(E*E+L*L)}else A=a-Math.sqrt(E*E+C*C);this.image.data[h+_]=Math.max(0,Math.min(255,A+128))}}}addRegularDash(e,i){for(let m=e.length-1;m>=0;--m){const _=e[m],v=e[m+1];_.zeroLength?e.splice(m,1):v&&v.isDash===_.isDash&&(v.left=_.left,e.splice(m,1))}const r=e[0],a=e[e.length-1];r.isDash===a.isDash&&(r.left=a.left-this.width,a.right=r.right+this.width);const c=this.width*this.nextRow;let h=0,p=e[h];for(let m=0;m<this.width;m++){m/p.right>1&&(p=e[++h]);const _=Math.abs(m-p.left),v=Math.abs(m-p.right),T=Math.min(_,v);this.image.data[c+m]=Math.max(0,Math.min(255,(p.isDash?T:-T)+i+128))}}addDash(e,i){const r=this.getKey(e,i);if(this.positions[r])return this.positions[r];const a=i==="round",c=a?7:0,h=2*c+1;if(this.nextRow+h>this.height)return wi("LineAtlas out of space"),null;e.length===0&&e.push(1);let p=0;for(let v=0;v<e.length;v++)e[v]<0&&(wi("Negative value is found in line dasharray, replacing values with 0"),e[v]=0),p+=e[v];if(p!==0){const v=this.width/p,T=this.getDashRanges(e,this.width,v);a?this.addRoundDash(T,v,c):this.addRegularDash(T,i==="square"?.5*v:0)}const m=this.nextRow+c;this.nextRow+=h;const _={tl:[m,c],br:[p,0]};return this.positions[r]=_,_}}ct(M_,"LineAtlas");const A_=1*$r;class C_{constructor(e){const i={},r=[];for(const p in e){const m=e[p],_=i[p]={};for(const v in m.glyphs){const T=m.glyphs[+v];if(!T||T.bitmap.width===0||T.bitmap.height===0)continue;const E=T.metrics.localGlyph?A_:1,A={x:0,y:0,w:T.bitmap.width+2*E,h:T.bitmap.height+2*E};r.push(A),_[v]=A}}const{w:a,h:c}=Ld(r),h=new Vo({width:a||1,height:c||1});for(const p in e){const m=e[p];for(const _ in m.glyphs){const v=m.glyphs[+_];if(!v||v.bitmap.width===0||v.bitmap.height===0)continue;const T=i[p][_],E=v.metrics.localGlyph?A_:1;Vo.copy(v.bitmap,h,{x:0,y:0},{x:T.x+E,y:T.y+E},v.bitmap)}}this.image=h,this.positions=i}}ct(C_,"GlyphAtlas");class Tx{constructor(e){this.tileID=new Vn(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.tileZoom=e.tileZoom,this.uid=e.uid,this.zoom=e.zoom,this.canonical=e.tileID.canonical,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.enableTerrain=!!e.enableTerrain,this.isSymbolTile=e.isSymbolTile,this.tileTransform=ra(e.tileID.canonical,e.projection),this.projection=e.projection}parse(e,i,r,a,c){this.status="parsing",this.data=e,this.collisionBoxArray=new gi;
8const h=new u_(Object.keys(e.layers).sort()),p=new S_(this.tileID,this.promoteId);p.bucketLayerIDs=[];const m={},_=new M_(256,256),v={featureIndex:p,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:_,availableImages:r},T=i.familiesBySource[this.source];for(const ie in T){const te=e.layers[ie];if(!te)continue;let be=!1,ye=!1;for(const Ee of T[ie])Ee[0].type==="symbol"?be=!0:ye=!0;if(this.isSymbolTile===!0&&!be||this.isSymbolTile===!1&&!ye)continue;te.version===1&&wi(`Vector tile source "${this.source}" layer "${ie}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const ke=h.encode(ie),je=[];for(let Ee=0;Ee<te.length;Ee++){const Be=te.feature(Ee),Oe=p.getId(Be,ie);je.push({feature:Be,id:Oe,index:Ee,sourceLayerIndex:ke})}for(const Ee of T[ie]){const Be=Ee[0];this.isSymbolTile!==void 0&&Be.type==="symbol"!==this.isSymbolTile||Be.minzoom&&this.zoom<Math.floor(Be.minzoom)||Be.maxzoom&&this.zoom>=Be.maxzoom||Be.visibility!=="none"&&(Yd(Ee,this.zoom,r),(m[Be.id]=Be.createBucket({index:p.bucketLayerIDs.length,layers:Ee,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ke,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:r})).populate(je,v,this.tileID.canonical,this.tileTransform),p.bucketLayerIDs.push(Ee.map(Oe=>Oe.id)))}}let E,A,C,L;_.trim();const F={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},W=()=>{if(E)return c(E);if(A&&C&&L){const ie=new C_(A),te=new Bm(C,L);for(const be in m){const ye=m[be];ye instanceof ps?(Yd(ye.layers,this.zoom,r),K0(ye,A,ie.positions,C,te.iconPositions,this.showCollisionBoxes,r,this.tileID.canonical,this.tileZoom,this.projection)):ye.hasPattern&&(ye instanceof ih||ye instanceof Ju||ye instanceof Sc)&&(Yd(ye.layers,this.zoom,r),ye.addFeatures(v,this.tileID.canonical,te.patternPositions,r,this.tileTransform))}this.status="done",c(null,{buckets:Mi(m).filter(be=>!be.isEmpty()),featureIndex:p,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ie.image,lineAtlas:_,imageAtlas:te,glyphMap:this.returnDependencies?A:null,iconMap:this.returnDependencies?C:null,glyphPositions:this.returnDependencies?ie.positions:null})}},$=Vt(v.glyphDependencies,ie=>Object.keys(ie).map(Number));Object.keys($).length?a.send("getGlyphs",{uid:this.uid,stacks:$},(ie,te)=>{E||(E=ie,A=te,W())},void 0,!1,F):A={};const X=Object.keys(v.iconDependencies);X.length?a.send("getImages",{icons:X,source:this.source,tileID:this.tileID,type:"icons"},(ie,te)=>{E||(E=ie,C=te,W())},void 0,!1,F):C={};const J=Object.keys(v.patternDependencies);J.length?a.send("getImages",{icons:J,source:this.source,tileID:this.tileID,type:"patterns"},(ie,te)=>{E||(E=ie,L=te,W())},void 0,!1,F):L={},W()}}function Yd(t,e,i){const r=new w(e);for(const a of t)a.recalculate(r,i)}class k_{constructor(e){this.entries={},this.scheduler=e}request(e,i,r,a){const c=this.entries[e]=this.entries[e]||{callbacks:[]};if(c.result){const[h,p]=c.result;return this.scheduler?this.scheduler.add(()=>{a(h,p)},i):a(h,p),()=>{}}return c.callbacks.push(a),c.cancel||(c.cancel=r((h,p)=>{c.result=[h,p];for(const m of c.callbacks)this.scheduler?this.scheduler.add(()=>{m(h,p)},i):m(h,p);setTimeout(()=>delete this.entries[e],3e3)})),()=>{c.result||(c.callbacks=c.callbacks.filter(h=>h!==a),c.callbacks.length||(c.cancel(),delete this.entries[e]))}}}function P_(t,e,i){const r=JSON.stringify(t.request);return t.data&&(this.deduped.entries[r]={result:[null,t.data]}),this.deduped.request(r,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom},a=>{const c=xr(t.request,(h,p,m,_)=>{h?a(h):p&&a(null,{vectorTile:i?void 0:new Cd(new oh(p)),rawData:p,cacheControl:m,expires:_})});return()=>{c.cancel(),a()}},e)}const z_=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Jd{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,r]=new Uint8Array(e,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const a=r>>4;if(a!==1)throw new Error(`Got v${a} data when expected v1.`);const c=z_[15&r];if(!c)throw new Error("Unrecognized array type.");const[h]=new Uint16Array(e,2,1),[p]=new Uint32Array(e,4,1);return new Jd(p,h,c,e)}constructor(e,i=64,r=Float64Array,a){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const c=z_.indexOf(this.ArrayType),h=2*e*this.ArrayType.BYTES_PER_ELEMENT,p=e*this.IndexArrayType.BYTES_PER_ELEMENT,m=(8-p%8)%8;if(c<0)throw new Error(`Unexpected typed array class: ${r}.`);a&&a instanceof ArrayBuffer?(this.data=a,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+m,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+h+p+m),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+m,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+c]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=i,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Qd(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,r,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:c,coords:h,nodeSize:p}=this,m=[0,c.length-1,0],_=[];for(;m.length;){const v=m.pop()||0,T=m.pop()||0,E=m.pop()||0;if(T-E<=p){for(let F=E;F<=T;F++){const W=h[2*F],$=h[2*F+1];W>=e&&W<=r&&$>=i&&$<=a&&_.push(c[F])}continue}const A=E+T>>1,C=h[2*A],L=h[2*A+1];C>=e&&C<=r&&L>=i&&L<=a&&_.push(c[A]),(v===0?e<=C:i<=L)&&(m.push(E),m.push(A-1),m.push(1-v)),(v===0?r>=C:a>=L)&&(m.push(A+1),m.push(T),m.push(1-v))}return _}within(e,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:c,nodeSize:h}=this,p=[0,a.length-1,0],m=[],_=r*r;for(;p.length;){const v=p.pop()||0,T=p.pop()||0,E=p.pop()||0;if(T-E<=h){for(let F=E;F<=T;F++)D_(c[2*F],c[2*F+1],e,i)<=_&&m.push(a[F]);continue}const A=E+T>>1,C=c[2*A],L=c[2*A+1];D_(C,L,e,i)<=_&&m.push(a[A]),(v===0?e-r<=C:i-r<=L)&&(p.push(E),p.push(A-1),p.push(1-v)),(v===0?e+r>=C:i+r>=L)&&(p.push(A+1),p.push(T),p.push(1-v))}return m}}function Qd(t,e,i,r,a,c){if(a-r<=i)return;const h=r+a>>1;L_(t,e,h,r,a,c),Qd(t,e,i,r,h-1,1-c),Qd(t,e,i,h+1,a,1-c)}function L_(t,e,i,r,a,c){for(;a>r;){if(a-r>600){const _=a-r+1,v=i-r+1,T=Math.log(_),E=.5*Math.exp(2*T/3),A=.5*Math.sqrt(T*E*(_-E)/_)*(v-_/2<0?-1:1);L_(t,e,i,Math.max(r,Math.floor(i-v*E/_+A)),Math.min(a,Math.floor(i+(_-v)*E/_+A)),c)}const h=e[2*i+c];let p=r,m=a;for(Fc(t,e,r,i),e[2*a+c]>h&&Fc(t,e,r,a);p<m;){for(Fc(t,e,p,m),p++,m--;e[2*p+c]<h;)p++;for(;e[2*m+c]>h;)m--}e[2*r+c]===h?Fc(t,e,r,m):(m++,Fc(t,e,m,a)),m<=i&&(r=m+1),i<=m&&(a=m-1)}}
8function Fc(t,e,i,r){$d(t,i,r),$d(e,2*i,2*r),$d(e,2*i+1,2*r+1)}function $d(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}function D_(t,e,i,r){const a=t-i,c=e-r;return a*a+c*c}o.ARRAY_TYPE=tr,o.AUTH_ERR_MSG=ne,o.Aabb=Un,o.Actor=class{constructor(t,e,i){this.target=t,this.parent=e,this.mapId=i,this.callbacks={},this.cancelCallbacks={},Dt(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=Hn()?t:U,this.scheduler=new _x}send(t,e,i,r,a=!1,c){const h=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=c,this.callbacks[h]=i);const p=kr(this.globalScope)?void 0:[];return this.target.postMessage({id:h,type:t,hasCallback:!!i,targetMapId:r,mustQueue:a,sourceMapId:this.mapId,data:os(e,p)},p),{cancel:()=>{i&&delete this.callbacks[h],this.target.postMessage({id:h,type:"<cancel>",targetMapId:r,sourceMapId:this.mapId})}}}receive(t){const e=t.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if(e.type==="<cancel>"){const r=this.cancelCallbacks[i];delete this.cancelCallbacks[i],r&&r.cancel()}else if(e.mustQueue||Hn()){const r=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add(()=>this.processTask(i,e),r&&r.metadata||{type:"message"})}else this.processTask(i,e)}processTask(t,e){if(e.type==="<response>"){const i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(Lo(e.error)):i(null,Lo(e.data)))}else{const i=kr(this.globalScope)?void 0:[],r=e.hasCallback?(c,h)=>{delete this.cancelCallbacks[t],this.target.postMessage({id:t,type:"<response>",sourceMapId:this.mapId,error:c?os(c):null,data:os(h,i)},i)}:c=>{},a=Lo(e.data);if(this.parent[e.type])this.parent[e.type](e.sourceMapId,a,r);else if(this.parent.getWorkerSource){const c=e.type.split(".");this.parent.getWorkerSource(e.sourceMapId,c[0],a.source)[c[1]](a,r)}else r(new Error(`Could not find function ${e.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},o.CanonicalTileID=th,o.Color=Gi,o.ColorMode=_o,o.CullFaceMode=eo,o.DEMData=yh,o.DataConstantProperty=z,o.DedupedRequest=k_,o.DepthMode=ll,o.EXTENT=xt,o.Elevation=class{isDataAvailableAtPoint(t){const e=this._source();if(this.isUsingMockSource()||!e||t.y<0||t.y>1)return!1;const i=e.getSource().maxzoom,r=1<<i,a=Math.floor(t.x),c=Math.floor((t.x-a)*r),h=Math.floor(t.y*r),p=this.findDEMTileFor(new Vn(i,a,i,c,h));return!(!p||!p.dem)}getAtPointOrZero(t,e=0){return this.getAtPoint(t,e)||0}getAtPoint(t,e,i=!0){if(this.isUsingMockSource())return null;e==null&&(e=null);const r=this._source();if(!r||t.y<0||t.y>1)return e;const a=r.getSource().maxzoom,c=1<<a,h=Math.floor(t.x),p=t.x-h,m=new Vn(a,h,a,Math.floor(p*c),Math.floor(t.y*c)),_=this.findDEMTileFor(m);if(!_||!_.dem)return e;const v=_.dem,T=1<<_.tileID.canonical.z,E=(p*T-_.tileID.canonical.x)*v.dim,A=(t.y*T-_.tileID.canonical.y)*v.dim,C=Math.floor(E),L=Math.floor(A);return(i?this.exaggeration():1)*ii(ii(v.get(C,L),v.get(C,L+1),A-L),ii(v.get(C+1,L),v.get(C+1,L+1),A-L),E-C)}getAtTileOffset(t,e,i){const r=1<<t.canonical.z;return this.getAtPointOrZero(new Ha(t.wrap+(t.canonical.x+e/xt)/r,(t.canonical.y+i/xt)/r))}getAtTileOffsetFunc(t,e,i,r){return a=>{const c=this.getAtTileOffset(t,a.x,a.y),h=r.upVector(t.canonical,a.x,a.y);return dr(h,h,c*r.upVectorScale(t.canonical,e,i).metersToTile),h}}getForTilePoints(t,e,i,r){if(this.isUsingMockSource())return!1;const a=xh.create(this,t,r);return!!a&&(e.forEach(c=>{c[2]=this.exaggeration()*a.getElevationAt(c[0],c[1],i)}),!0)}getMinMaxForTile(t){if(this.isUsingMockSource())return null;const e=this.findDEMTileFor(t);if(!e||!e.dem)return null;const i=e.dem.tree,r=e.tileID,a=1<<t.canonical.z-r.canonical.z;let c=t.canonical.x/a-r.canonical.x,h=t.canonical.y/a-r.canonical.y,p=0;for(let m=0;m<t.canonical.z-r.canonical.z&&!i.leaves[p];m++){c*=2,h*=2;const _=2*Math.floor(h)+Math.floor(c);p=i.childOffsets[p]+_,c%=1,h%=1}return{min:this.exaggeration()*i.minimums[p],max:this.exaggeration()*i.maximums[p]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(t,e,i){throw new Error("Pure virtual method called.")}pointCoordinate(t){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}isUsingMockSource(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(t){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}},o.ErrorEvent=Or,o.EvaluationParameters=w,o.Event=So,o.Evented=ws,o.FillExtrusionBucket=Sc,o.Frustum=sd,o.FrustumCorners=od,o.GLOBE_RADIUS=co,o.GLOBE_SCALE_MATCH_LATITUDE=45,o.GLOBE_ZOOM_THRESHOLD_MAX=Lf,o.GLOBE_ZOOM_THRESHOLD_MIN=ad,o.GlobeSharedBuffers=class{constructor(t){this._createGrid(t),this._createPoles(t)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const t of this._poleSegments)t.destroy();for(const t of this._gridSegments)t.withSkirts.destroy(),t.withoutSkirts.destroy();if(this._wireframeIndexBuffer){this._wireframeIndexBuffer.destroy();for(const t of this._wireframeSegments)t.destroy()}}_fillGridMeshWithLods(t,e){const i=new Ne,r=new dt,a=[],c=t+1+2,h=e[0]+1,p=e[0]+1+(1+e.length),m=(_,v,T)=>{let E=_===c-1?_-2:_===0?_:_-1;return E+=T?24575:0,[E,v]};for(let _=0;_<c;++_)i.emplaceBack(...m(_,0,!0));for(let _=0;_<h;++_)for(let v=0;v<c;++v)i.emplaceBack(...m(v,_,(v===0||v===c-1)&&!0));for(let _=0;_<e.length;++_){const v=e[_];for(let T=0;T<c;++T)i.emplaceBack(...m(T,v,!0))}for(let _=0;_<e.length;++_){const v=r.length,T=e[_]+1+2,E=new dt;for(let L=0;L<T-1;L++){const F=L===T-2,W=F?c*(p-e.length+_-L):c;for(let $=0;$<c-1;$++){const X=L*c+$;L===0||F||$===0||$===c-2?(E.emplaceBack(X+1,X,X+W),E.emplaceBack(X+W,X+W+1,X+1)):(r.emplaceBack(X+1,X,X+W),r.emplaceBack(X+W,X+W+1,X+1))}}const A=Xi.simpleSegment(0,v,i.length,r.length-v);for(let L=0;L<E.uint16.length;L+=3)r.emplaceBack(E.uint16[L],E.uint16[L+1],E.uint16[L+2]);const C=Xi.simpleSegment(0,v,i.length,r.length-v);a.push({withoutSkirts:A,withSkirts:C})}return{vertices:i,indices:r,segments:a}}_createGrid(t){const e=this._fillGridMeshWithLods($s,mc);this._gridSegments=e.segments,this._gridBuffer=t.createVertexBuffer(e.vertices,fc.members),this._gridIndexBuffer=t.createIndexBuffer(e.indices,!0)}_createPoles(t){const e=new dt;for(let a=0;a<=$s;a++)e.emplaceBack(0,a+1,a+2);this._poleIndexBuffer=t.createIndexBuffer(e,!0);const i=new _i,r=new _i;this._poleSegments=[];for(let a=0,c=0;a<ad;a++){const h=360/(1<<a);i.emplaceBack(0,-co,0,.5,0),r.emplaceBack(0,-co,0,.5,1);for(let p=0;p<=$s;p++){const m=p/$s,_=ii(0,h,m),[v,T,E]=qa(_y,gy,_,co);i.emplaceBack(v,T,E,m,0),r.emplaceBack(v,T,E,m,1)}this._poleSegments.push(Xi.simpleSegment(c,0,66,64)),c+=66}this._poleNorthVertexBuffer=t.createVertexBuffer(i,Pf,!1),this._poleSouthVertexBuffer=t.createVertexBuffer(r,Pf,!1)}getGridBuffers(t,e){return[this._gridBuffer,this._gridIndexBuffer,e?this._gridSegments[t].withSkirts:this._gridSegments[t].withoutSkirts]}getPoleBuffers(t){return[this._poleNorthVertexBuffer,this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[t]]}getWirefameBuffers(t,e){if(!this._wireframeSegments){const i=new un,r=$s,a=r+1+2,c=1;this._wireframeSegments=[];for(let h=0,p=0;h<mc.length;h++){const m=mc[h];for(let v=c;v<m+c;v++)for(let T=c;T<r+c;T++){const E=v*a+T;i.emplaceBack(E,E+1),i.emplaceBack(E,E+a),i.emplaceBack(E,E+a+1)}const _=m*r*3;this._wireframeSegments.push(Xi.simpleSegment(0,p,(m+1)*a,_)),p+=_}this._wireframeIndexBuffer=t.createIndexBuffer(i)}return[this._gridBuffer,this._wireframeIndexBuffer,this._wireframeSegments[e]]}},o.GlyphManager=nl,o.ImagePosition=Dd,o.KDBush=Jd,o.LivePerformanceUtils=fl,o.LngLat=yi,o.LngLatBounds=cs,o.LocalGlyphMode=Od,o.MAX_MERCATOR_LATITUDE=Cn,o.MercatorCoordinate=Ha,o.ONE_EM=yn,o.OverscaledTileID=Vn,o.PerformanceMarkers=oo,o.Point=Re,o.Properties=K,o.RGBAImage=ir,o.Ray=rd,o.RequestManager=class{constructor(t,e,i){this._transformRequestFn=t,this._customAccessToken=e,this._silenceAuthErrors=!!i,this._createSkuToken()}_createSkuToken(){const t=function(){let e="";for(let i=0;i<10;i++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",bt,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}normalizeStyleURL(t,e){if(!ue(t))return t;const i=Ye(t);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeGlyphsURL(t,e){if(!ue(t))return t;const i=Ye(t);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}
8normalizeSourceURL(t,e,i,r){if(!ue(t))return t;const a=Ye(t);return a.path=`/v4/${a.authority}.json`,a.params.push("secure"),i&&a.params.push(`language=${i}`),r&&a.params.push(`worldview=${r}`),this._makeAPIURL(a,this._customAccessToken||e)}normalizeSpriteURL(t,e,i,r){const a=Ye(t);return ue(t)?(a.path=`/styles/v1${a.path}/sprite${e}${i}`,this._makeAPIURL(a,this._customAccessToken||r)):(a.path+=`${e}${i}`,Ze(a))}normalizeTileURL(t,e,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!ue(t))return t;const r=Ye(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${e||i&&r.authority!=="raster"&&i===512?"@2x":""}${de.supported?".webp":"$1"}`),r.authority==="raster"?r.path=`/${se.RASTER_URL_PREFIX}${r.path}`:(r.path=r.path.replace(/^.+\/v4\//,"/"),r.path=`/${se.TILE_URL_VERSION}${r.path}`);const a=this._customAccessToken||function(c){for(const h of c){const p=h.match(/^access_token=(.*)$/);if(p)return p[1]}return null}(r.params)||se.ACCESS_TOKEN;return se.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push(`sku=${this._skuToken}`),this._makeAPIURL(r,a)}canonicalizeTileURL(t,e){const i=Ye(t);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return t;let r="mapbox://";i.path.match(/^\/raster\/v1\//)?r+=`raster/${i.path.replace(`/${se.RASTER_URL_PREFIX}/`,"")}`:r+=`tiles/${i.path.replace(`/${se.TILE_URL_VERSION}/`,"")}`;let a=i.params;return e&&(a=a.filter(c=>!c.match(/^access_token=/))),a.length&&(r+=`?${a.join("&")}`),r}canonicalizeTileset(t,e){const i=!!e&&ue(e),r=[];for(const a of t.tiles||[])_e(a)?r.push(this.canonicalizeTileURL(a,i)):r.push(a);return r}_makeAPIURL(t,e){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",r=Ye(se.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,t.protocol==="http"){const a=t.params.indexOf("secure");a>=0&&t.params.splice(a,1)}if(r.path!=="/"&&(t.path=`${r.path}${t.path}`),!se.REQUIRE_ACCESS_TOKEN)return Ze(t);if(e=e||se.ACCESS_TOKEN,!this._silenceAuthErrors){if(!e)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if(e[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return t.params=t.params.filter(a=>a.indexOf("access_token")===-1),t.params.push(`access_token=${e||""}`),Ze(t)}},o.ResourceType=pi,o.SegmentVector=Xi,o.SourceCache=oa,o.StencilMode=Xd,o.StructArrayLayout1ui2=er,o.StructArrayLayout2f1f2i16=wt,o.StructArrayLayout2i4=Ne,o.StructArrayLayout2ui4=un,o.StructArrayLayout3f12=Zt,o.StructArrayLayout3ui6=dt,o.StructArrayLayout4i8=Le,o.StructArrayLayout5f20=_i,o.Texture=Bc,o.Tile=qd,o.Transitionable=P,o.Uniform1f=Fu,o.Uniform1i=class extends Bo{constructor(t){super(t),this.current=0}set(t,e,i){this.fetchUniformLocation(t,e)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},o.Uniform2f=class extends Bo{constructor(t){super(t),this.current=[0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}},o.Uniform3f=class extends Bo{constructor(t){super(t),this.current=[0,0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}},o.Uniform4f=ff,o.UniformColor=mf,o.UniformMatrix2f=class extends Bo{constructor(t){super(t),this.current=ey}set(t,e,i){if(this.fetchUniformLocation(t,e)){for(let r=0;r<4;r++)if(i[r]!==this.current[r]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}}},o.UniformMatrix3f=class extends Bo{constructor(t){super(t),this.current=$g}set(t,e,i){if(this.fetchUniformLocation(t,e)){for(let r=0;r<9;r++)if(i[r]!==this.current[r]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}}},o.UniformMatrix4f=class extends Bo{constructor(t){super(t),this.current=Qg}set(t,e,i){if(this.fetchUniformLocation(t,e)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let r=1;r<16;r++)if(i[r]!==this.current[r]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}},o.UnwrappedTileID=bm,o.ValidationError=st,o.VectorTileFeature=$u,o.VectorTileWorkerSource=class extends ws{constructor(t,e,i,r,a){super(),this.actor=t,this.layerIndex=e,this.availableImages=i,this.loadVectorData=a||P_,this.loading={},this.loaded={},this.deduped=new k_(t.scheduler),this.isSpriteLoaded=r,this.scheduler
8=t.scheduler}loadTile(t,e){const i=t.uid,r=t&&t.request,a=r&&r.collectResourceTiming,c=this.loading[i]=new Tx(t);c.abort=this.loadVectorData(t,(h,p)=>{const m=!this.loading[i];if(delete this.loading[i],m||h||!p)return c.status="done",m||(this.loaded[i]=c),e(h);const _=p.rawData,v={};p.expires&&(v.expires=p.expires),p.cacheControl&&(v.cacheControl=p.cacheControl),c.vectorTile=p.vectorTile||new Cd(new oh(_));const T=()=>{c.parse(c.vectorTile,this.layerIndex,this.availableImages,this.actor,(E,A)=>{if(E||!A)return e(E);const C={};if(a){const L=bs(r);L.length>0&&(C.resourceTiming=JSON.parse(JSON.stringify(L)))}e(null,$t({rawTileData:_.slice(0)},A,v,C))})};this.isSpriteLoaded?T():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(T,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom}):T()}),this.loaded=this.loaded||{},this.loaded[i]=c})}reloadTile(t,e){const i=this.loaded,r=t.uid,a=this;if(i&&i[r]){const c=i[r];c.showCollisionBoxes=t.showCollisionBoxes,c.enableTerrain=!!t.enableTerrain,c.projection=t.projection,c.tileTransform=ra(t.tileID.canonical,t.projection);const h=(p,m)=>{const _=c.reloadCallback;_&&(delete c.reloadCallback,c.parse(c.vectorTile,a.layerIndex,this.availableImages,a.actor,_)),e(p,m)};c.status==="parsing"?c.reloadCallback=h:c.status==="done"&&(c.vectorTile?c.parse(c.vectorTile,this.layerIndex,this.availableImages,this.actor,h):h())}}abortTile(t,e){const i=t.uid,r=this.loading[i];r&&(r.abort&&r.abort(),delete this.loading[i]),e()}removeTile(t,e){const i=this.loaded,r=t.uid;i&&i[r]&&delete i[r],e()}},o.WritingMode=fr,o.ZoomDependentExpression=Vs,o.add=Fo,o.addDynamicAttributes=mh,o.adjoint=function(t,e){var i=e[0],r=e[1],a=e[2],c=e[3],h=e[4],p=e[5],m=e[6],_=e[7],v=e[8];return t[0]=h*v-p*_,t[1]=a*_-r*v,t[2]=r*p-a*h,t[3]=p*m-c*v,t[4]=i*v-a*m,t[5]=a*c-i*p,t[6]=c*_-h*m,t[7]=r*m-i*_,t[8]=i*h-r*c,t},o.asyncAll=ai,o.bezier=Tt,o.bindAll=Dt,o.boundsAttributes=p_,o.bufferConvexPolygon=function(t,e){const i=[];for(let r=0;r<t.length;r++){const a=vt(r-1,-1,t.length-1),c=vt(r+1,-1,t.length-1),h=t[r],p=t[c],m=t[a].sub(h).unit(),_=p.sub(h).unit(),v=_.angleWithSep(m.x,m.y),T=m.add(_).unit().mult(-1*e/Math.sin(v/2));i.push(h.add(T))}return i},o.cacheEntryPossiblyAdded=function(t){Rr++,Rr>To&&(t.getActor().send("enforceCacheSizeLimit",ro),Rr=0)},o.calculateGlobeLabelMatrix=function(t,e){const{x:i,y:r}=t.point,a=Ff(i,r,t.worldSize/t._pixelsPerMercatorPixel,0,0);return Ys(a,a,ud(uo(e)))},o.calculateGlobeMatrix=function(t){const{x:e,y:i}=t.point,{lng:r,lat:a}=t._center;return Ff(e,i,t.worldSize,r,a)},o.calculateGlobeMercatorMatrix=function(t){const e=t.pixelsPerMeter,i=e/Jr(1,t.center.lat),r=Kr(new Float64Array(16));return lc(r,r,[t.point.x,t.point.y,0]),Js(r,r,[i,i,e]),Float32Array.from(r)},o.circumferenceAtLatitude=dd,o.clamp=St,o.clearTileCache=function(t){if(!zr())return;const e=U.caches.delete(Pr);t&&e.catch(t).then(()=>t())},o.clipLine=Km,o.clone=function(t){var e=new tr(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},o.clone$1=_n,o.collisionCircleLayout=b0,o.config=se,o.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},o.create=function(){var t=new tr(16);return tr!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},o.create$1=yf,o.createExpression=is,o.createLayout=pe,o.createStyleLayer=function(t){return t.type==="custom"?new dx(t):new fx[t.type](t)},o.cross=nd,o.degToRad=at,o.distance=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},o.div=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t},o.dot=Sr,o.earthRadius=yc,o.ease=$i,o.easeCubicInOut=Ke,o.ecefToLatLng=function([t,e,i]){const r=Math.hypot(t,e,i),a=Math.atan2(t,i),c=.5*Math.PI-Math.acos(-e/r);return new yi(Ct(a),Ct(c))},o.emitValidationErrors=zu,o.endsWith=en,o.enforceCacheSizeLimit=function(t){Lr(),kn&&kn.then(e=>{e.keys().then(i=>{for(let r=0;r<i.length-t;r++)e.delete(i[r])})})},o.evaluateSizeForFeature=nh,o.evaluateSizeForZoom=$a,o.evaluateVariableOffset=e_,o.evented=d,o.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},o.exactEquals$1=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},o.exported=ji,o.exported$1=de,o.extend=$t,o.extend$1=Fr,o.fillExtrusionHeightLift=ym,o.filterObject=gr,o.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},o.fromQuat=function(t,e){var i=e[0],r=e[1],a=e[2],c=e[3],h=i+i,p=r+r,m=a+a,_=i*h,v=r*h,T=r*p,E=a*h,A=a*p,C=a
8*m,L=c*h,F=c*p,W=c*m;return t[0]=1-T-C,t[1]=v+W,t[2]=E-F,t[3]=0,t[4]=v-W,t[5]=1-_-C,t[6]=A+L,t[7]=0,t[8]=E+F,t[9]=A-L,t[10]=1-_-T,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.fromRotation=function(t,e){var i=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},o.fromScaling=vf,o.furthestTileCorner=function(t){const e=Math.round((t+45+360)%360/90)%4;return Qt[e]},o.getAABBPointSquareDist=function(t,e,i){let r=0;for(let a=0;a<2;++a){const c=i?i[a]:0;t[a]>c&&(r+=(t[a]-c)*(t[a]-c)),e[a]<c&&(r+=(c-e[a])*(c-e[a]))}return r},o.getAnchorAlignment=Bd,o.getAnchorJustification=Ud,o.getBounds=function(t){let e=1/0,i=1/0,r=-1/0,a=-1/0;for(const c of t)e=Math.min(e,c.x),i=Math.min(i,c.y),r=Math.max(r,c.x),a=Math.max(a,c.y);return{min:new Re(e,i),max:new Re(r,a)}},o.getColumn=Kn,o.getDefaultExportFromCjs=lt,o.getGridMatrix=function(t,e,i,r){const a=e.getNorth(),c=e.getSouth(),h=e.getWest(),p=e.getEast(),m=1<<t.z,_=p-h,v=a-c,T=_/$s,E=-v/mc[i],A=[0,T,0,E,0,0,a,h,0];if(t.z>0){const C=180/r;xf(A,A,[C/_+1,0,0,0,C/v+1,0,-.5*C/T,.5*C/E,1])}return A[2]=m,A[5]=t.x,A[8]=t.y,A},o.getImage=Y,o.getJSON=function(t,e){return ar($t(t,{type:"json"}),e)},o.getLatitudinalLod=function(t){const e=Cn-5;t=St(t,-e,e)/e*90;const i=Math.pow(Math.abs(Math.sin(at(t))),3);return Math.round(i*(mc.length-1))},o.getMapSessionAPI=Ni,o.getPerformanceMeasurement=bs,o.getProjection=l_,o.getRTLTextPluginStatus=f,o.getReferrer=sr,o.getTilePoint=function(t,{x:e,y:i},r=0){return new Re(((e-r)*t.scale-t.x)*xt,(i*t.scale-t.y)*xt)},o.getTileVec3=function(t,e,i=0){return Za(((e.x-i)*t.scale-t.x)*xt,(e.y*t.scale-t.y)*xt,jf(e.z,e.y))},o.getVideo=function(t,e){const i=U.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(let r=0;r<t.length;r++){const a=U.document.createElement("source");Br(t[r])||(i.crossOrigin="Anonymous"),a.src=t[r],i.appendChild(a)}return{cancel:()=>{}}},o.globeCenterToScreenPoint=function(t){const e=[0,0,0],i=Kr(new Float64Array(16));return Ys(i,t.pixelMatrix,t.globeMatrix),Zi(e,e,i),new Re(e[0],e[1])},o.globeDenormalizeECEF=ud,o.globeECEFOrigin=function(t,e){const i=[0,0,0];return Zi(i,i,gc(uo(e.canonical))),Zi(i,i,t),i},o.globeMetersToEcef=Nu,o.globeNormalizeECEF=gc,o.globePixelsToTileUnits=function(t,e){return xt/(512*Math.pow(2,t))*Gu(uo(e))},o.globePoleMatrixForTile=function(t,e,i){const r=Kr(new Float64Array(16)),a=(e/(1<<t)-.5)*Math.PI*2;return Vu(r,i.globeMatrix,a),Float32Array.from(r)},o.globeTileBounds=uo,o.globeTiltAtLngLat=Uf,o.globeToMercatorTransition=Xa,o.globeUseCustomAntiAliasing=function(t,e,i){const r=Xa(i.zoom),a=t.style.map._antialias,c=!!e.extStandardDerivatives,h=e.extStandardDerivativesForceOff||t.terrain&&t.terrain.exaggeration()>0;return r===0&&!a&&!h&&c},o.identity=Kr,o.identity$1=Af,o.invert=$h,o.isFullscreen=function(){return!!U.document.fullscreenElement||!!U.document.webkitFullscreenElement},o.isLngLatBehindGlobe=hd,o.isMapAuthenticated=function(t){return rn.has(t)},o.isMapboxURL=ue,o.isSafariWithAntialiasingBug=function(t){const e=t.navigator?t.navigator.userAgent:null;return!!kr(t)&&e&&(e.match("Version/15.4")||e.match("Version/15.5")||e.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},o.latFromMercatorY=An,o.latLngToECEF=Wa,o.len=cy,o.length=cc,o.length$1=function(t){return Math.hypot(t[0],t[1],t[2],t[3])},o.lngFromMercatorX=pr,o.loadVectorTile=P_,o.makeRequest=ar,o.mapValue=function(t,e,i,r,a){return St((t-e)/(i-e)*(a-r)+r,r,a)},o.mercatorScale=Gf,o.mercatorXfromLng=ho,o.mercatorYfromLat=po,o.mercatorZfromAltitude=Jr,o.mul=ay,o.mul$1=ly,o.multiply=Ys,o.multiply$1=xf,o.multiply$2=Tf,o.nextPowerOfTwo=mn,o.normalize=Fn,o.normalize$1=uy,o.normalize$2=If,o.number=ii,o.ortho=function(t,e,i,r,a,c,h){var p=1/(e-i),m=1/(r-a),_=1/(c-h);return t[0]=-2*p,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*m,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*_,t[11]=0,t[12]=(e+i)*p,t[13]=(a+r)*m,t[14]=(h+c)*_,t[15]=1,t},o.pbf=Am,o.perspective=function(t,e,i,r,a){var c,h=1/Math.tan(e/2);return t[0]=h/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,a!=null&&a!==1/0?(t[10]=(a+r)*(c=1/(r-a)),t[14]=2*a*r*c):(t[10]=-1,t[14]=-2*r),t},o.pick=function(t,e){const i={};for(let r=0;r<e.length;r++){const a=e[r];a in t&&(i[a]=t[a])}return i},o.plugin=y,o.pointGeometry=qt,o.polesInViewport=function(t){const e=Kr(new Float64Array(16));Ys(e,t.pixelMatrix,t.globeMatrix);const i=[0,Ir,0],r=[0,Mr,0];return Zi(i,i,e),Zi(r,r,e),[i[0]>0&&i[0]<=t.width&&i[1]>0&&i[1]<=t.height&&!hd(t,new yi(t.center.lat,90)),r[0]>0&&r[0]<=t.width&&r[1]>0&&r[1]<=t.height&&!hd(t,new yi(t.center.lat,-90))]},o.polygonContainsPoint=ia,o.polygonIntersectsBox=Yf,o.polygonIntersectsPolygon=Wf,o.polygonizeBounds=function(t,e,
vendor: 7,304 bytes, line 8
8i=0,r=!0){const a=new Re(i,i),c=t.sub(a),h=e.add(a),p=[c,new Re(h.x,c.y),h,new Re(c.x,h.y)];return r&&p.push(c.clone()),p},o.posAttributes=fc,o.postMapLoadEvent=Bi,o.postPerformanceEvent=Vi,o.postTurnstileEvent=Yt,o.potpack=Ld,o.prevPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},o.radToDeg=Ct,o.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],o.registerForPluginStateChange=function(t){return t({pluginStatus:l,pluginURL:n}),d.on("pluginStateChange",t),t},o.removeAuthState=function(t){rn.delete(t)},o.renderColorRamp=vd,o.resample=Zf,o.rotateX=ed,o.rotateX$1=Cf,o.rotateY=Vu,o.rotateY$1=kf,o.rotateZ=function(t,e,i){var r=Math.sin(i),a=Math.cos(i),c=e[0],h=e[1],p=e[2],m=e[3],_=e[4],v=e[5],T=e[6],E=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=c*a+_*r,t[1]=h*a+v*r,t[2]=p*a+T*r,t[3]=m*a+E*r,t[4]=_*a-c*r,t[5]=v*a-h*r,t[6]=T*a-p*r,t[7]=E*a-m*r,t},o.rotateZ$1=function(t,e,i){i*=.5;var r=e[0],a=e[1],c=e[2],h=e[3],p=Math.sin(i),m=Math.cos(i);return t[0]=r*m+a*p,t[1]=a*m-r*p,t[2]=c*m+h*p,t[3]=h*m-c*p,t},o.scale=Js,o.scale$1=Sf,o.scale$2=dr,o.scaleAndAdd=dc,o.set=function(t,e,i,r){return t[0]=e,t[1]=i,t[2]=r,t},o.setCacheLimits=function(t,e){ro=t,To=e},o.setColumn=function(t,e,i){t[4*e+0]=i[0],t[4*e+1]=i[1],t[4*e+2]=i[2],t[4*e+3]=i[3]},o.setRTLTextPlugin=function(t,e,i=!1){if(l===nc||l===rc||l===oc)throw new Error("setRTLTextPlugin cannot be called multiple times.");n=ji.resolveURL(t),l=nc,ss=e,u(),i||g()},o.smoothstep=Lt,o.spec=Ce,o.squaredLength=function(t){var e=t[0],i=t[1],r=t[2];return e*e+i*i+r*r},o.storeAuthState=function(t,e){e?rn.add(t):rn.delete(t)},o.sub=Yr,o.subtract=id,o.symbolSize=w0,o.tileAABB=function(t,e,i,r,a,c,h,p,m){if(m.name==="globe")return my(t,e,new th(i,r,a));const _=ra({z:i,x:r,y:a},m);return new Un([(c+_.x/_.scale)*e,e*(_.y/_.scale),h],[(c+_.x2/_.scale)*e,e*(_.y2/_.scale),p])},o.tileCornersToBounds=ju,o.tileTransform=ra,o.transformMat3=function(t,e,i){var r=e[0],a=e[1],c=e[2];return t[0]=r*i[0]+a*i[3]+c*i[6],t[1]=r*i[1]+a*i[4]+c*i[7],t[2]=r*i[2]+a*i[5]+c*i[8],t},o.transformMat4=Zi,o.transformMat4$1=Qs,o.transformQuat=Ef,o.transitionTileAABBinECEF=Rf,o.translate=lc,o.transpose=function(t,e){if(t===e){var i=e[1],r=e[2],a=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=r,t[7]=a}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},o.triggerPluginCompletionEvent=s,o.uniqueId=Gn,o.updateGlobeVertexNormal=function(t,e,i,r,a){const c=5*e+2;t.float32[c+0]=i,t.float32[c+1]=r,t.float32[c+2]=a},o.validateCustomStyleLayer=function(t){const e=[],i=t.id;return i===void 0&&e.push({message:`layers.${i}: missing required property "id"`}),t.render===void 0&&e.push({message:`layers.${i}: missing required method "render"`}),t.renderingMode&&t.renderingMode!=="2d"&&t.renderingMode!=="3d"&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},o.validateFilter=t=>$n(qs(t)),o.validateFog=t=>$n(Cu(t)),o.validateLayer=t=>$n(Su(t)),o.validateLight=t=>$n(Au(t)),o.validateSource=t=>$n(Mu(t)),o.validateStyle=Pu,o.validateTerrain=t=>$n(Ql(t)),o.values=Mi,o.vectorTile=Qu,o.version=he,o.warnOnce=wi,o.window=U,o.wrap=vt}),ee(["./shared"],function(o){function U(Q){if(typeof Q=="number"||typeof Q=="boolean"||typeof Q=="string"||Q==null)return JSON.stringify(Q);if(Array.isArray(Q)){let B="[";for(const Y of Q)B+=`${U(Y)},`;return`${B}]`}let R="{";for(const B of Object.keys(Q).sort())R+=`${B}:${U(Q[B])},`;return`${R}}`}function he(Q){let R="";for(const B of o.refProperties)R+=`/${U(Q[B])}`;return R}class De{constructor(R){this.keyCache={},R&&this.replace(R)}replace(R){this._layerConfigs={},this._layers={},this.update(R,[])}update(R,B){for(const ne of R)this._layerConfigs[ne.id]=ne,(this._layers[ne.id]=o.createStyleLayer(ne)).compileFilter(),this.keyCache[ne.id]&&delete this.keyCache[ne.id];for(const ne of B)delete this.keyCache[ne],delete this._layerConfigs[ne],delete this._layers[ne];this.familiesBySource={};const Y=function(ne,ue){const _e={};for(let ce=0;ce<ne.length;ce++){const we=ue&&ue[ne[ce].id]||he(ne[ce]);ue&&(ue[ne[ce].id]=we);let We=_e[we];We||(We=_e[we]=[]),We.push(ne[ce])}const me=[];for(const ce in _e)me.push(_e[ce]);return me}(o.values(this._layerConfigs),this.keyCache);for(const ne of Y){const ue=ne.map(Ye=>this._layers[Ye.id]),_e=ue[0];if(_e.visibility==="none")continue;const me=_e.source||"";let ce=this.familiesBySource[me];ce||(ce=this.familiesBySource[me]={});const we=_e.sourceLayer||"_geojsonTileLayer";let We=ce[we];We||(We=ce[we]=[]),We.push(ue)}}}class se{loadTile(R,B){const{uid:Y,encoding:ne,rawImageData:ue,padding:_e,buildQuadTree:me}=R,ce=o.window.ImageBitmap&&ue instanceof o.window.ImageBitmap?this.getImageData(ue,_e):ue;B(null,new o.DEMData(Y,ce,ne,_e<1,me))}getImageData(R,B){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(R.width,R.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=R.width,this.offscreenCanvas.height=R.height,this.offscreenCanvasContext.drawImage(R,0,0,R.width,R.height);const Y=this.offscreenCanvasContext.getImageData(-B,-B,R.width+2*B,R.height+2*B);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),Y}}function de(Q,R){if(Q.length!==0){Ie(Q[0],R);for(var B=1;B<Q.length;B++)Ie(Q[B],!R)}}function Ie(Q,R){for(var B=0,Y=0,ne=0,ue=Q.length,_e=ue-1;ne<ue;_e=ne++){var me=(Q[ne][0]-Q[_e][0])*(Q[_e][1]+Q[ne][1]),ce=B+me;Y+=Math.abs(B)>=Math.abs(me)?B-ce+me:me-ce+B,B=ce}B+Y>=0!=!!R&&Q.reverse()}var Pe=o.getDefaultExportFromCjs(function Q(R,B){var Y,ne=R&&R.type;if(ne==="FeatureCollection")for(Y=0;Y<R.features.length;Y++)Q(R.features[Y],B);else if(ne==="GeometryCollection")for(Y=0;Y<R.geometries.length;Y++)Q(R.geometries[Y],B);else if(ne==="Feature")Q(R.geometry,B);else if(ne==="Polygon")de(R.coordinates,B);else if(ne==="MultiPolygon")for(Y=0;Y<R.coordinates.length;Y++)de(R.coordinates[Y],B);return R});const Me=o.VectorTileFeature.prototype.toGeoJSON;var $e={exports:{}},At=o.pointGeometry,bt=o.vectorTile.VectorTileFeature,lt=Se;function Se(Q,R){this.options=R||{},this.features=Q,this.length=Q.length}function Qe(Q,R){this.id=typeof Q.id=="number"?Q.id:void 0,this.type=Q.type,this.rawGeometry=Q.type===1?[Q.geometry]:Q.geometry,this.properties=Q.tags,this.extent=R||4096}Se.prototype.feature=function(Q){return new Qe(this.features[Q],this.options.extent)},Qe.prototype.loadGeometry=function(){var Q=this.rawGeometry;this.geometry=[];for(var R=0;R<Q.length;R++){for(var B=Q[R],Y=[],ne=0;ne<B.length;ne++)Y.push(new At(B[ne][0],B[ne][1]));this.geometry.push(Y)}return this.geometry},Qe.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Q=this.geometry,R=1/0,B=-1/0,Y=1/0,ne=-1/0,ue=0;ue<Q.length;ue++)for(var _e=Q[ue],me=0;me<_e.length;me++){var ce=_e[me];R=Math.min(R,ce.x),B=Math.max(B,ce.x),Y=Math.min(Y,ce.y),ne=Math.max(ne,ce.y)}return[R,Y,B,ne]},Qe.prototype.toGeoJSON=bt.prototype.toGeoJSON;var ni=o.pbf,qt=lt;function It(Q){var R=new ni;return function(B,Y){for(var ne in B.layers)Y.writeMessage(3,Re,B.layers[ne])}(Q,R),R.finish()}function Re(Q,R){var B;
vendor: 4,158 bytes, line 8
8R.writeVarintField(15,Q.version||1),R.writeStringField(1,Q.name||""),R.writeVarintField(5,Q.extent||4096);var Y={keys:[],values:[],keycache:{},valuecache:{}};for(B=0;B<Q.length;B++)Y.feature=Q.feature(B),R.writeMessage(2,gt,Y);var ne=Y.keys;for(B=0;B<ne.length;B++)R.writeStringField(3,ne[B]);var ue=Y.values;for(B=0;B<ue.length;B++)R.writeMessage(4,Ke,ue[B])}function gt(Q,R){var B=Q.feature;B.id!==void 0&&R.writeVarintField(1,B.id),R.writeMessage(2,ui,Q),R.writeVarintField(3,B.type),R.writeMessage(4,Qt,B)}function ui(Q,R){var B=Q.feature,Y=Q.keys,ne=Q.values,ue=Q.keycache,_e=Q.valuecache;for(var me in B.properties){var ce=B.properties[me],we=ue[me];if(ce!==null){we===void 0&&(Y.push(me),ue[me]=we=Y.length-1),R.writeVarint(we);var We=typeof ce;We!=="string"&&We!=="boolean"&&We!=="number"&&(ce=JSON.stringify(ce));var Ye=We+":"+ce,Ze=_e[Ye];Ze===void 0&&(ne.push(ce),_e[Ye]=Ze=ne.length-1),R.writeVarint(Ze)}}}function at(Q,R){return(R<<3)+(7&Q)}function Ct(Q){return Q<<1^Q>>31}function Qt(Q,R){for(var B=Q.loadGeometry(),Y=Q.type,ne=0,ue=0,_e=B.length,me=0;me<_e;me++){var ce=B[me],we=1;Y===1&&(we=ce.length),R.writeVarint(at(1,we));for(var We=Y===3?ce.length-1:ce.length,Ye=0;Ye<We;Ye++){Ye===1&&Y!==1&&R.writeVarint(at(2,We-1));var Ze=ce[Ye].x-ne,zt=ce[Ye].y-ue;R.writeVarint(Ct(Ze)),R.writeVarint(Ct(zt)),ne+=Ze,ue+=zt}Y===3&&R.writeVarint(at(7,1))}}function Ke(Q,R){var B=typeof Q;B==="string"?R.writeStringField(1,Q):B==="boolean"?R.writeBooleanField(7,Q):B==="number"&&(Q%1!=0?R.writeDoubleField(3,Q):Q<0?R.writeSVarintField(6,Q):R.writeVarintField(5,Q))}$e.exports=It,$e.exports.fromVectorTileJs=It,$e.exports.fromGeojsonVt=function(Q,R){R=R||{};var B={};for(var Y in Q)B[Y]=new qt(Q[Y].features,R),B[Y].name=Y,B[Y].version=R.version,B[Y].extent=R.extent;return It({layers:B})},$e.exports.GeoJSONWrapper=qt;var Tt=o.getDefaultExportFromCjs($e.exports);const $i={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:Q=>Q},St=Math.fround||(Lt=new Float32Array(1),Q=>(Lt[0]=+Q,Lt[0]));var Lt;const vt=3,ai=5,Mi=6;class $t{constructor(R){this.options=Object.assign(Object.create($i),R),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(R){const{log:B,minZoom:Y,maxZoom:ne}=this.options;B&&console.time("total time");const ue=`prepare ${R.length} points`;B&&console.time(ue),this.points=R;const _e=[];for(let ce=0;ce<R.length;ce++){const we=R[ce];if(!we.geometry)continue;const[We,Ye]=we.geometry.coordinates,Ze=St(Tn(We)),zt=St(mn(Ye));_e.push(Ze,zt,1/0,ce,-1,1),this.options.reduce&&_e.push(0)}let me=this.trees[ne+1]=this._createTree(_e);B&&console.timeEnd(ue);for(let ce=ne;ce>=Y;ce--){const we=+Date.now();me=this.trees[ce]=this._createTree(this._cluster(me,ce)),B&&console.log("z%d: %d clusters in %dms",ce,me.numItems,+Date.now()-we)}return B&&console.timeEnd("total time"),this}getClusters(R,B){let Y=((R[0]+180)%360+360)%360-180;const ne=Math.max(-90,Math.min(90,R[1]));let ue=R[2]===180?180:((R[2]+180)%360+360)%360-180;const _e=Math.max(-90,Math.min(90,R[3]));if(R[2]-R[0]>=360)Y=-180,ue=180;else if(Y>ue){const Ye=this.getClusters([Y,ne,180,_e],B),Ze=this.getClusters([-180,ne,ue,_e],B);return Ye.concat(Ze)}const me=this.trees[this._limitZoom(B)],ce=me.range(Tn(Y),mn(_e),Tn(ue),mn(ne)),we=me.data,We=[];for(const Ye of ce){const Ze=this.stride*Ye;We.push(we[Ze+ai]>1?nn(we,Ze,this.clusterProps):this.points[we[Ze+vt]])}return We}getChildren(R){const B=this._getOriginId(R),Y=this._getOriginZoom(R),ne="No cluster with the specified id.",ue=this.trees[Y];if(!ue)throw new Error(ne);const _e=ue.data;if(B*this.stride>=_e.length)throw new Error(ne);const me=this.options.radius/(this.options.extent*Math.pow(2,Y-1)),ce=ue.within(_e[B*this.stride],_e[B*this.stride+1],me),we=[];for(const We of ce){const Ye=We*this.stride;_e[Ye+4]===R&&we.push(_e[Ye+ai]>1?nn(_e,Ye,this.clusterProps):this.points[_e[Ye+vt]])}if(we.length===0)throw new Error(ne);return we}getLeaves(R,B,Y){const ne=[];return this._appendLeaves(ne,R,B=B||10,Y=Y||0,0),ne}getTile(R,B,Y){const ne=this.trees[this._limitZoom(R)],ue=Math.pow(2,R),{extent:_e,radius:me}
vendor: 1,031 bytes, line 8
8=this.options,ce=me/_e,we=(Y-ce)/ue,We=(Y+1+ce)/ue,Ye={features:[]};return this._addTileFeatures(ne.range((B-ce)/ue,we,(B+1+ce)/ue,We),ne.data,B,Y,ue,Ye),B===0&&this._addTileFeatures(ne.range(1-ce/ue,we,1,We),ne.data,ue,Y,ue,Ye),B===ue-1&&this._addTileFeatures(ne.range(0,we,ce/ue,We),ne.data,-1,Y,ue,Ye),Ye.features.length?Ye:null}getClusterExpansionZoom(R){let B=this._getOriginZoom(R)-1;for(;B<=this.options.maxZoom;){const Y=this.getChildren(R);if(B++,Y.length!==1)break;R=Y[0].properties.cluster_id}return B}_appendLeaves(R,B,Y,ne,ue){const _e=this.getChildren(B);for(const me of _e){const ce=me.properties;if(ce&&ce.cluster?ue+ce.point_count<=ne?ue+=ce.point_count:ue=this._appendLeaves(R,ce.cluster_id,Y,ne,ue):ue<ne?ue++:R.push(me),R.length===Y)break}return ue}_createTree(R){const B=new o.KDBush(R.length/this.stride|0,this.options.nodeSize,Float32Array);for(let Y=0;Y<R.length;Y+=this.stride)B.add(R[Y],R[Y+1]);return B.finish(),B.data=R,B}_addTileFeatures(R,B,Y,ne,ue,_e){for(const me of R){const ce=me*this.stride,we=B[
8ce+ai]>1;let We,Ye,Ze;if(we)We=Gn(B,ce,this.clusterProps),Ye=B[ce],Ze=B[ce+1];else{const kt=this.points[B[ce+vt]];We=kt.properties;const[jt,Yt]=kt.geometry.coordinates;Ye=Tn(jt),Ze=mn(Yt)}const zt={type:1,geometry:[[Math.round(this.options.extent*(Ye*ue-Y)),Math.round(this.options.extent*(Ze*ue-ne))]],tags:We};let Nt;Nt=we||this.options.generateId?B[ce+vt]:this.points[B[ce+vt]].id,Nt!==void 0&&(zt.id=Nt),_e.features.push(zt)}}_limitZoom(R){return Math.max(this.options.minZoom,Math.min(Math.floor(+R),this.options.maxZoom+1))}_cluster(R,B){const{radius:Y,extent:ne,reduce:ue,minPoints:_e}=this.options,me=Y/(ne*Math.pow(2,B)),ce=R.data,we=[],We=this.stride;for(let Ye=0;Ye<ce.length;Ye+=We){if(ce[Ye+2]<=B)continue;ce[Ye+2]=B;const Ze=ce[Ye],zt=ce[Ye+1],Nt=R.within(ce[Ye],ce[Ye+1],me),kt=ce[Ye+ai];let jt=kt;for(const Yt of Nt){const ki=Yt*We;ce[ki+2]>B&&(jt+=ce[ki+ai])}if(jt>kt&&jt>=_e){let Yt,ki=Ze*kt,Bi=zt*kt,an=-1;const Vi=((Ye/We|0)<<5)+(B+1)+this.points.length;for(const Dn of Nt){const Ni=Dn*We;if(ce[Ni+2]<=B)continue;ce[Ni+2]=B;const rn=ce[Ni+ai];ki+=ce[Ni]*rn,Bi+=ce[Ni+1]*rn,ce[Ni+4]=Vi,ue&&(Yt||(Yt=this._map(ce,Ye,!0),an=this.clusterProps.length,this.clusterProps.push(Yt)),ue(Yt,this._map(ce,Ni)))}ce[Ye+4]=Vi,we.push(ki/jt,Bi/jt,1/0,Vi,-1,jt),ue&&we.push(an)}else{for(let Yt=0;Yt<We;Yt++)we.push(ce[Ye+Yt]);if(jt>1)for(const Yt of Nt){const ki=Yt*We;if(!(ce[ki+2]<=B)){ce[ki+2]=B;for(let Bi=0;Bi<We;Bi++)we.push(ce[ki+Bi])}}}}return we}_getOriginId(R){return R-this.points.length>>5}_getOriginZoom(R){return(R-this.points.length)%32}_map(R,B,Y){if(R[B+ai]>1){const _e=this.clusterProps[R[B+Mi]];return Y?Object.assign({},_e):_e}const ne=this.points[R[B+vt]].properties,ue=this.options.map(ne);return Y&&ue===ne?Object.assign({},ue):ue}}function nn(Q,R,B){return{type:"Feature",id:Q[R+vt],properties:Gn(Q,R,B),geometry:{type:"Point",coordinates:[(Y=Q[R],360*(Y-.5)),Je(Q[R+1])]}};var Y}function Gn(Q,R,B){const Y=Q[R+ai],ne=Y>=1e4?`${Math.round(Y/1e3)}k`:Y>=1e3?Math.round(Y/100)/10+"k":Y,ue=Q[R+Mi],_e=ue===-1?{}:Object.assign({},B[ue]);return Object.assign(_e,{cluster:!0,cluster_id:Q[R+vt],point_count:Y,point_count_abbreviated:ne})}function Tn(Q){return Q/360+.5}function mn(Q){const R=Math.sin(Q*Math.PI/180),B=.5-.25*Math.log((1+R)/(1-R))/Math.PI;return B<0?0:B>1?1:B}function Je(Q){const R=(180-360*Q)*Math.PI/180;return 360*Math.atan(Math.exp(R))/Math.PI-90}function Dt(Q,R,B,Y){for(var ne,ue=Y,_e=B-R>>1,me=B-R,ce=Q[R],we=Q[R+1],We=Q[B],Ye=Q[B+1],Ze=R+3;Ze<B;Ze+=3){var zt=en(Q[Ze],Q[Ze+1],ce,we,We,Ye);if(zt>ue)ne=Ze,ue=zt;else if(zt===ue){var Nt=Math.abs(Ze-_e);Nt<me&&(ne=Ze,me=Nt)}}ue>Y&&(ne-R>3&&Dt(Q,R,ne,Y),Q[ne+2]=ue,B-ne>3&&Dt(Q,ne,B,Y))}function en(Q,R,B,Y,ne,ue){var _e=ne-B,me=ue-Y;if(_e!==0||me!==0){var ce=((Q-B)*_e+(R-Y)*me)/(_e*_e+me*me);ce>1?(B=ne,Y=ue):ce>0&&(B+=_e*ce,Y+=me*ce)}return(_e=Q-B)*_e+(me=R-Y)*me}function Vt(Q,R,B,Y){var ne={id:Q===void 0?null:Q,type:R,geometry:B,tags:Y,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(ue){var _e=ue.geometry,me=ue.type;if(me==="Point"||me==="MultiPoint"||me==="LineString")gr(ue,_e);else if(me==="Polygon"||me==="MultiLineString")for(var ce=0;ce<_e.length;ce++)gr(ue,_e[ce]);else if(me==="MultiPolygon")for(ce=0;ce<_e.length;ce++)for(var we=0;we<_e[ce].length;we++)gr(ue,_e[ce][we])}(ne),ne}function gr(Q,R){for(var B=0;B<R.length;B+=3)Q.minX=Math.min(Q.minX,R[B]),Q.minY=Math.min(Q.minY,R[B+1]),Q.maxX=Math.max(Q.maxX,R[B]),Q.maxY=Math.max(Q.maxY,R[B+1])}function _n(Q,R,B,Y){if(R.geometry){var ne=R.geometry.coordinates,ue=R.geometry.type,_e=Math.pow(B.tolerance/((1<<B.maxZoom)*B.extent),2),me=[],ce=R.id;if(B.promoteId?ce=R.properties[B.promoteId]:B.generateId&&(ce=Y||0),ue==="Point")yr(ne,me);else if(ue==="MultiPoint")for(var we=0;we<ne.length;we++)yr(ne[we],me);else if(ue==="LineString")wi(ne,me,_e,!1);else if(ue==="MultiLineString"){if(B.lineMetrics){for(we=0;we<ne.length;we++)wi(ne[we],me=[],_e,!1),Q.push(Vt(ce,"LineString",me,R.properties));return}En(ne,me,_e,!1)}else if(ue==="Polygon")En(ne,me,_e,!0);else{if(ue!=="MultiPolygon"){if(ue==="GeometryCollection"){for(we=0;we<R.geometry.geometries.length;we++)_n(Q,{id:ce,geometry:R.geometry.geometries[we],properties:R.properties},B,Y);return}throw new Error("Input data is not a valid GeoJSON object.")}for(we=0;we<ne.length;we++){var We=[];En(ne[we],We,_e,!0),me.push(We)}}Q.push(Vt(ce,ue,me,R.properties))}}function yr(Q,R){R.push(wo(Q[0])),R.push(Hn(Q[1])),R.push(0)}function wi(Q,R,B,Y){for(var ne,ue,_e=0,me=0;me<Q.length;me++){var ce=wo(Q[me][0]),we=Hn(Q[me][1]);R.push(ce),R.push(we),R.push(0),me>0&&(_e+=Y?(ne*we-ce*ue)/2:Math.sqrt(Math.pow(ce-ne,2)+Math.pow(we-ue,2))),ne=ce,ue=we}var We=R.length-3;R[2]=1,Dt(R,0,We,B),R[We+2]=1,R.size=Math.abs(_e),R.start=0,R.end=R.size}function En(Q,R,B,Y){for(var ne=0;ne<Q.length;ne++){var ue=[];wi(Q[ne],ue,B,Y),R.push(ue)}}function wo(Q){return Q/360+.5}function Hn(Q){var R=Math.sin(Q*Math.PI/180),B=.5-.25*Math.log((1+R)/(1-R))/Math.PI;return B<0?0:B>1?1:B}function Sn(Q,R,B,Y,ne,ue,_e,me){if(Y/=R,ue>=(B/=R)&&_e<Y)return Q;if(_e<B||ue>=Y)return null;for(var ce=[],we=0;we<Q.length;we++){var We=Q[we],Ye=We.geometry,Ze=We.type,zt=ne===0?We.minX:We.minY,Nt=ne===0?We.maxX:We.maxY;if(zt>=B&&Nt<Y)ce.push(We);else if(!(Nt<B||zt>=Y)){var kt=[];if(Ze==="Point"||Ze==="MultiPoint")io(Ye,kt,B,Y,ne);else if(Ze==="LineString")kr(Ye,kt,B,Y,ne,!1,me.lineMetrics);else if(Ze==="MultiLineString")Kn(Ye,kt,B,Y,ne,!1);else if(Ze==="Polygon")Kn(Ye,kt,B,Y,ne,!0);else if(Ze==="MultiPolygon")for(var jt=0;jt<Ye.length;jt++){var Yt=[];Kn(Ye[jt],Yt,B,Y,ne,!0),Yt.length&&kt.push(Yt)}if(kt.length){if(me.lineMetrics&&Ze==="LineString"){for(jt=0;jt<kt.length;jt++)ce.push(Vt(We.id,Ze,kt[jt],We.tags));continue}Ze!=="LineString"&&Ze!=="MultiLineString"||(kt.length===1?(Ze="LineString",kt=kt[0]):Ze="MultiLineString"),Ze!=="Point"&&Ze!=="MultiPoint"||(Ze=kt.length===3?"Point":"MultiPoint"),ce.push(Vt(We.id,Ze,kt,We.tags))}}}return ce.length?ce:null}function io(Q,R,B,Y,ne){for(var ue=0;ue<Q.length;
vendor: 11,137 bytes, line 8
8ue+=3){var _e=Q[ue+ne];_e>=B&&_e<=Y&&(R.push(Q[ue]),R.push(Q[ue+1]),R.push(Q[ue+2]))}}function kr(Q,R,B,Y,ne,ue,_e){for(var me,ce,we=no(Q),We=ne===0?ro:To,Ye=Q.start,Ze=0;Ze<Q.length-3;Ze+=3){var zt=Q[Ze],Nt=Q[Ze+1],kt=Q[Ze+2],jt=Q[Ze+3],Yt=Q[Ze+4],ki=ne===0?zt:Nt,Bi=ne===0?jt:Yt,an=!1;_e&&(me=Math.sqrt(Math.pow(zt-jt,2)+Math.pow(Nt-Yt,2))),ki<B?Bi>B&&(ce=We(we,zt,Nt,jt,Yt,B),_e&&(we.start=Ye+me*ce)):ki>Y?Bi<Y&&(ce=We(we,zt,Nt,jt,Yt,Y),_e&&(we.start=Ye+me*ce)):Pr(we,zt,Nt,kt),Bi<B&&ki>=B&&(ce=We(we,zt,Nt,jt,Yt,B),an=!0),Bi>Y&&ki<=Y&&(ce=We(we,zt,Nt,jt,Yt,Y),an=!0),!ue&&an&&(_e&&(we.end=Ye+me*ce),R.push(we),we=no(Q)),_e&&(Ye+=me)}var Vi=Q.length-3;zt=Q[Vi],Nt=Q[Vi+1],kt=Q[Vi+2],(ki=ne===0?zt:Nt)>=B&&ki<=Y&&Pr(we,zt,Nt,kt),Vi=we.length-3,ue&&Vi>=3&&(we[Vi]!==we[0]||we[Vi+1]!==we[1])&&Pr(we,we[0],we[1],we[2]),we.length&&R.push(we)}function no(Q){var R=[];return R.size=Q.size,R.start=Q.start,R.end=Q.end,R}function Kn(Q,R,B,Y,ne,ue){for(var _e=0;_e<Q.length;_e++)kr(Q[_e],R,B,Y,ne,ue,!1)}function Pr(Q,R,B,Y){Q.push(R),Q.push(B),Q.push(Y)}function ro(Q,R,B,Y,ne,ue){var _e=(ue-R)/(Y-R);return Q.push(ue),Q.push(B+(ne-B)*_e),Q.push(1),_e}function To(Q,R,B,Y,ne,ue){var _e=(ue-B)/(ne-B);return Q.push(R+(Y-R)*_e),Q.push(ue),Q.push(1),_e}function kn(Q,R){for(var B=[],Y=0;Y<Q.length;Y++){var ne,ue=Q[Y],_e=ue.type;if(_e==="Point"||_e==="MultiPoint"||_e==="LineString")ne=or(ue.geometry,R);else if(_e==="MultiLineString"||_e==="Polygon"){ne=[];for(var me=0;me<ue.geometry.length;me++)ne.push(or(ue.geometry[me],R))}else if(_e==="MultiPolygon")for(ne=[],me=0;me<ue.geometry.length;me++){for(var ce=[],we=0;we<ue.geometry[me].length;we++)ce.push(or(ue.geometry[me][we],R));ne.push(ce)}B.push(Vt(ue.id,_e,ne,ue.tags))}return B}function or(Q,R){var B=[];B.size=Q.size,Q.start!==void 0&&(B.start=Q.start,B.end=Q.end);for(var Y=0;Y<Q.length;Y+=3)B.push(Q[Y]+R,Q[Y+1],Q[Y+2]);return B}function zr(Q,R){if(Q.transformed)return Q;var B,Y,ne,ue=1<<Q.z,_e=Q.x,me=Q.y;for(B=0;B<Q.features.length;B++){var ce=Q.features[B],we=ce.geometry,We=ce.type;if(ce.geometry=[],We===1)for(Y=0;Y<we.length;Y+=2)ce.geometry.push(Lr(we[Y],we[Y+1],R,ue,_e,me));else for(Y=0;Y<we.length;Y++){var Ye=[];for(ne=0;ne<we[Y].length;ne+=2)Ye.push(Lr(we[Y][ne],we[Y][ne+1],R,ue,_e,me));ce.geometry.push(Ye)}}return Q.transformed=!0,Q}function Lr(Q,R,B,Y,ne,ue){return[Math.round(B*(Q*Y-ne)),Math.round(B*(R*Y-ue))]}function Dr(Q,R,B,Y,ne){for(var ue=R===ne.maxZoom?0:ne.tolerance/((1<<R)*ne.extent),_e={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:B,y:Y,z:R,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},me=0;me<Q.length;me++){_e.numFeatures++,Rr(_e,Q[me],ue,ne);var ce=Q[me].minX,we=Q[me].minY,We=Q[me].maxX,Ye=Q[me].maxY;ce<_e.minX&&(_e.minX=ce),we<_e.minY&&(_e.minY=we),We>_e.maxX&&(_e.maxX=We),Ye>_e.maxY&&(_e.maxY=Ye)}return _e}function Rr(Q,R,B,Y){var ne=R.geometry,ue=R.type,_e=[];if(ue==="Point"||ue==="MultiPoint")for(var me=0;me<ne.length;me+=3)_e.push(ne[me]),_e.push(ne[me+1]),Q.numPoints++,Q.numSimplified++;else if(ue==="LineString")pi(_e,ne,Q,B,!1,!1);else if(ue==="MultiLineString"||ue==="Polygon")for(me=0;me<ne.length;me++)pi(_e,ne[me],Q,B,ue==="Polygon",me===0);else if(ue==="MultiPolygon")for(var ce=0;ce<ne.length;ce++){var we=ne[ce];for(me=0;me<we.length;me++)pi(_e,we[me],Q,B,!0,me===0)}if(_e.length){var We=R.tags||null;if(ue==="LineString"&&Y.lineMetrics){for(var Ye in We={},R.tags)We[Ye]=R.tags[Ye];We.mapbox_clip_start=ne.start/ne.size,We.mapbox_clip_end=ne.end/ne.size}var Ze={geometry:_e,type:ue==="Polygon"||ue==="MultiPolygon"?3:ue==="LineString"||ue==="MultiLineString"?2:1,tags:We};R.id!==null&&(Ze.id=R.id),Q.features.push(Ze)}}function pi(Q,R,B,Y,ne,ue){var _e=Y*Y;if(Y>0&&R.size<(ne?_e:Y))B.numPoints+=R.length/3;else{for(var me=[],ce=0;ce<R.length;ce+=3)(Y===0||R[ce+2]>_e)&&(B.numSimplified++,me.push(R[ce]),me.push(R[ce+1])),B.numPoints++;ne&&function(we,We){for(var Ye=0,Ze=0,zt=we.length,Nt=zt-2;Ze<zt;Nt=Ze,Ze+=2)Ye+=(we[Ze]-we[Nt])*(we[Ze+1]+we[Nt+1]);if(Ye>0===We)for(Ze=0,zt=we.length;Ze<zt/2;Ze+=2){var kt=we[Ze],jt=we[Ze+1];we[Ze]=we[zt-2-Ze],we[Ze+1]=we[zt-1-Ze],we[zt-2-Ze]=kt,we[zt-1-Ze]=jt}}(me,ue),Q.push(me)}}function Pn(Q,R){var B=(R=this.options=function(ne,ue){for(var _e in ue)ne[_e]=ue[_e];return ne}(Object.create(this.options),R)).debug;if(B&&console.time("preprocess data"),R.maxZoom<0||R.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(R.promoteId&&R.generateId)throw new Error("promoteId and generateId cannot be used together.");var Y=function(ne,ue){var _e=[];if(ne.type==="FeatureCollection")for(var me=0;me<ne.features.length;me++)_n(_e,ne.features[me],ue,me);else _n(_e,ne.type==="Feature"?ne:{geometry:ne},ue);return _e}(Q,R);this.tiles={},this.tileCoords=[],B&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",R.indexMaxZoom,R.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Y=function(ne,ue){var _e=ue.buffer/ue.extent,me=ne,ce=Sn(ne,1,-1-_e,_e,0,-1,2,ue),we=Sn(ne,1,1-_e,2+_e,0,-1,2,ue);return(ce||we)&&(me=Sn(ne,1,-_e,1+_e,0,-1,2,ue)||[],ce&&(me=kn(ce,1).concat(me)),we&&(me=me.concat(kn(we,-1)))),me}(Y,R),Y.length&&this.splitTile(Y,0,0,0),B&&(Y.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function sr(Q,R,B){return 32*((1<<Q)*B+R)+Q}function ar(Q,R){const B=Q.tileID.canonical;if(!this._geoJSONIndex)return R(null,null);const Y=this._geoJSONIndex.getTile(B.z,B.x,B.y);if(!Y)return R(null,null);const ne=new class{constructor(_e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=o.EXTENT,this.length=_e.length,this._features=_e}feature(_e){return new class{constructor(me){this._feature=me,this.extent=o.EXTENT,this.type=me.type,this.properties=me.tags,"id"in me&&!isNaN(me.id)&&(this.id=parseInt(me.id,10))}loadGeometry(){if(this._feature.type===1){const me=[];for(const ce of this._feature.geometry)me.push([new o.Point(ce[0],ce[1])]);return me}{const me=[];for(const ce of this._feature.geometry){const we=[];for(const We of ce)we.push(new o.Point(We[0],We[1]));me.push(we)}return me}}toGeoJSON(me,ce,we){return Me.call(this,me,ce,we)}}(this._features[_e])}}(Y.features);let ue=Tt(ne);ue.byteOffset===0&&ue.byteLength===ue.buffer.byteLength||(ue=new Uint8Array(ue)),R(null,{vectorTile:ne,rawData:ue.buffer})}Pn.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Pn.prototype.splitTile=function(Q,R,B,Y,ne,ue,_e){for(var me=[Q,R,B,Y],ce=this.options,we=ce.debug;me.length;){Y=me.pop(),B=me.pop(),R=me.pop(),Q=me.pop();var We=1<<R,Ye=sr(R,B,Y),Ze=this.tiles[Ye];if(!Ze&&(we>1&&console.time("creation"),Ze=this.tiles[Ye]=Dr(Q,R,B,Y,ce),this.tileCoords.push({z:R,x:B,y:Y}),we)){we>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",R,B,Y,Ze.numFeatures,Ze.numPoints,Ze.numSimplified),console.timeEnd("creation"));var zt="z"+R;this.stats[zt]=(this.stats[zt]||0)+1,this.total++}if(Ze.source=Q,ne){if(R===ce.maxZoom||R===ne)continue;var Nt=1<<ne-R;if(B!==Math.floor(ue/Nt)||Y!==Math.floor(_e/Nt))continue}else if(R===ce.indexMaxZoom||Ze.numPoints<=ce.indexMaxPoints)continue;if(Ze.source=null,Q.length!==0){we>1&&console.time("clipping");var kt,jt,Yt,ki,Bi,an,Vi=.5*ce.buffer/ce.extent,Dn=.5-Vi,Ni=.5+Vi,rn=1+Vi;kt=jt=Yt=ki=null,Bi=Sn(Q,We,B-Vi,B+Ni,0,Ze.minX,Ze.maxX,ce),an=Sn(Q,We,B+Dn,B+rn,0,Ze.minX,Ze.maxX,ce),Q=null,Bi&&(kt=Sn(Bi,We,Y-Vi,Y+Ni,1,Ze.minY,Ze.maxY,ce),jt=Sn(Bi,We,Y+Dn,Y+rn,1,Ze.minY,Ze.maxY,ce),Bi=null),an&&(Yt=Sn(an,We,Y-Vi,Y+Ni,1,Ze.minY,Ze.maxY,ce),ki=Sn(an,We,Y+Dn,Y+rn,1,Ze.minY,Ze.maxY,ce),an=null),we>1&&console.timeEnd("clipping"),me.push(kt||[],R+1,2*B,2*Y),me.push(jt||[],R+1,2*B,2*Y+1),me.push(Yt||[],R+1,2*B+1,2*Y),me.push(ki||[],R+1,2*B+1,2*Y+1)}}},Pn.prototype.getTile=function(Q,R,B){var Y=this.options,ne=Y.extent,ue=Y.debug;if(Q<0||Q>24)return null;var _e=1<<Q,me=sr(Q,R=(R%_e+_e)%_e,B);if(this.tiles[me])return zr(this.tiles[me],ne);ue>1&&console.log("drilling down to z%d-%d-%d",Q,R,B);for(var ce,we=Q,We=R,Ye=B;!ce&&we>0;)we--,We=Math.floor(We/2),Ye=Math.floor(Ye/2),ce=this.tiles[sr(we,We,Ye)];return ce&&ce.source?(ue>1&&console.log("found parent tile z%d-%d-%d",we,We,Ye),ue>1&&console.time("drilling down"),this.splitTile(ce.source,we,We,Ye,Q,R,B),ue>1&&console.timeEnd("drilling down"),this.tiles[me]?zr(this.tiles[me],ne):null):null};class xr extends o.VectorTileWorkerSource{constructor(R,B,Y,ne,ue){super(R,B,Y,ne,ar),ue&&(this.loadGeoJSON=ue)}loadData(R,B){const Y=R&&R.request,ne=Y&&Y.collectResourceTiming;this.loadGeoJSON(R,(ue,_e)=>{if(ue||!_e)return B(ue);if(typeof _e!="object")return B(new Error(`Input data given to '${R.source}' is not a valid GeoJSON object.`));{Pe(_e,!0);try{if(R.filter){const ce=o.createExpression(R.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ce.result==="error")throw new Error(ce.value.map(We=>`${We.key}: ${We.message}`).join(", "));_e={type:"FeatureCollection",features:_e.features.filter(We=>ce.value.evaluate({zoom:0},We))}}this._geoJSONIndex=R.cluster?new $t(function({superclusterOptions:ce,clusterProperties:we}){if(!we||!ce)return ce;const We={},Ye={},Ze={accumulated:null,zoom:0},zt={properties:null},Nt=Object.keys(we);for(const kt of Nt){const[jt,Yt]=we[kt],ki=o.createExpression(Yt),Bi=o.createExpression(typeof jt=="string"?[jt,["accumulated"],["get",kt]]:jt);We[kt]=ki.value,Ye[kt]=Bi.value}return ce.map=kt=>{zt.properties=kt;const jt={};for(const Yt of Nt)jt[Yt]=We[Yt].evaluate(Ze,zt);return jt},ce.reduce=(kt,jt)=>{zt.properties=jt;for(const Yt of Nt)Ze.accumulated=kt[Yt],kt[Yt]=Ye[Yt].evaluate(Ze,zt)},ce}(R)).load(_e.features):function(ce,we){return new Pn(ce,we)}(_e,R.geojsonVtOptions)}catch(ce){return B(ce)}this.loaded={};const me={};if(ne){const ce=o.getPerformanceMeasurement(Y);ce&&(me.resourceTiming={},me.resourceTiming[R.source]=JSON.parse(JSON.stringify(ce)))}B(null,me)}})}reloadTile(R,B){const Y=this.loaded;return Y&&Y[R.uid]?super.reloadTile(R,B):this.loadTile(R,B)}loadGeoJSON(R,B){if(R.request)o.getJSON(R.request,B);else{if(typeof R.data!="string")return B(new Error(`Input data given to '${R.source}' is not a valid GeoJSON object.`));try{return B(null,JSON.parse(R.data))}catch{return B(new Error(`Input data given to '${R.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(R,B){try{B(null,this._geoJSONIndex.getClusterExpansionZoom(R.clusterId))}catch(Y){B(Y)}}getClusterChildren(R,B){try{B(null,this._geoJSONIndex.getChildren(R.clusterId))}catch(Y){B(Y)}}getClusterLeaves(R,B){try{B(null,this._geoJSONIndex.getLeaves(R.clusterId,R.limit,R.offset))}catch(Y){B(Y)}}}class Br{constructor(R){this.self=R,this.actor=new o.Actor(R,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=o.getProjection({name:"mercator"}),this.workerSourceTypes={vector:o.VectorTileWorkerSource,geojson:xr},this.workerSources={},this.demWorkerSources={}
8,this.self.registerWorkerSource=(B,Y)=>{if(this.workerSourceTypes[B])throw new Error(`Worker source with name "${B}" already registered.`);this.workerSourceTypes[B]=Y},this.self.registerRTLTextPlugin=B=>{if(o.plugin.isParsed())throw new Error("RTL text plugin already registered.");o.plugin.applyArabicShaping=B.applyArabicShaping,o.plugin.processBidirectionalText=B.processBidirectionalText,o.plugin.processStyledBidirectionalText=B.processStyledBidirectionalText}}clearCaches(R,B,Y){delete this.layerIndexes[R],delete this.availableImages[R],delete this.workerSources[R],delete this.demWorkerSources[R],Y()}checkIfReady(R,B,Y){Y()}setReferrer(R,B){this.referrer=B}spriteLoaded(R,B){this.isSpriteLoaded[R]=B;for(const Y in this.workerSources[R]){const ne=this.workerSources[R][Y];for(const ue in ne)ne[ue]instanceof o.VectorTileWorkerSource&&(ne[ue].isSpriteLoaded=B,ne[ue].fire(new o.Event("isSpriteLoaded")))}}setImages(R,B,Y){this.availableImages[R]=B;for(const ne in this.workerSources[R]){const ue=this.workerSources[R][ne];for(const _e in ue)ue[_e].availableImages=B}Y()}enableTerrain(R,B,Y){this.terrain=B,Y()}setProjection(R,B){this.projections[R]=o.getProjection(B)}setLayers(R,B,Y){this.getLayerIndex(R).replace(B),Y()}updateLayers(R,B,Y){this.getLayerIndex(R).update(B.layers,B.removedIds),Y()}loadTile(R,B,Y){const ne=this.enableTerrain?o.extend({enableTerrain:this.terrain},B):B;ne.projection=this.projections[R]||this.defaultProjection,this.getWorkerSource(R,B.type,B.source).loadTile(ne,Y)}loadDEMTile(R,B,Y){const ne=this.enableTerrain?o.extend({buildQuadTree:this.terrain},B):B;this.getDEMWorkerSource(R,B.source).loadTile(ne,Y)}reloadTile(R,B,Y){const ne=this.enableTerrain?o.extend({enableTerrain:this.terrain},B):B;ne.projection=this.projections[R]||this.defaultProjection,this.getWorkerSource(R,B.type,B.source).reloadTile(ne,Y)}abortTile(R,B,Y){this.getWorkerSource(R,B.type,B.source).abortTile(B,Y)}removeTile(R,B,Y){this.getWorkerSource(R,B.type,B.source).removeTile(B,Y)}removeSource(R,B,Y){if(!this.workerSources[R]||!this.workerSources[R][B.type]||!this.workerSources[R][B.type][B.source])return;const ne=this.workerSources[R][B.type][B.source];delete this.workerSources[R][B.type][B.source],ne.removeSource!==void 0?ne.removeSource(B,Y):Y()}loadWorkerSource(R,B,Y){try{this.self.importScripts(B.url),Y()}catch(ne){Y(ne.toString())}}syncRTLPluginState(R,B,Y){try{o.plugin.setState(B);const ne=o.plugin.getPluginURL();if(o.plugin.isLoaded()&&!o.plugin.isParsed()&&ne!=null){this.self.importScripts(ne);const ue=o.plugin.isParsed();Y(ue?void 0:new Error(`RTL Text Plugin failed to import scripts from ${ne}`),ue)}}catch(ne){Y(ne.toString())}}getAvailableImages(R){let B=this.availableImages[R];return B||(B=[]),B}getLayerIndex(R){let B=this.layerIndexes[R];return B||(B=this.layerIndexes[R]=new De),B}getWorkerSource(R,B,Y){if(this.workerSources[R]||(this.workerSources[R]={}),this.workerSources[R][B]||(this.workerSources[R][B]={}),!this.workerSources[R][B][Y]){const ne={send:(ue,_e,me,ce,we,We)=>{this.actor.send(ue,_e,me,R,we,We)},scheduler:this.actor.scheduler};this.workerSources[R][B][Y]=new this.workerSourceTypes[B](ne,this.getLayerIndex(R),this.getAvailableImages(R),this.isSpriteLoaded[R])}return this.workerSources[R][B][Y]}getDEMWorkerSource(R,B){return this.demWorkerSources[R]||(this.demWorkerSources[R]={}),this.demWorkerSources[R][B]||(this.demWorkerSources[R][B]=new se),this.demWorkerSources[R][B]}enforceCacheSizeLimit(R,B){o.enforceCacheSizeLimit(B)}getWorkerPerformanceMetrics(R,B,Y){Y(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Br(self)),Br}),ee(["./shared"],function(o){function U(l,n){if(Array.isArray(l)){if(!Array.isArray(n)||l.length!==n.length)return!1;for(let s=0;s<l.length;s++)if(!U(l[s],n[s]))return!1;return!0}if(typeof l=="object"&&l!==null&&n!==null){if(typeof n!="object"||Object.keys(l).length!==Object.keys(n).length)return!1;for(const s in l)if(!U(l[s],n[s]))return!1;return!0}return l===n}var he=De;function De(l){return!function(n){return typeof window>"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var u,d,f=new Blob([""],{type:"text/javascript"}),g=URL.createObjectURL(f);try{d=new Worker(g),u=!0}catch{u=!1}return d&&d.terminate(),URL.revokeObjectURL(g),u}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var u=document.createElement("canvas");u.width=u.height=1;var d=u.getContext("2d");if(!d)return!1;var f=d.getImageData(0,0,1,1);return f&&f.width===u.width}()?(se[s=n&&n.failIfMajorPerformanceCaveat]===void 0&&(se[s]=function(u){var d,f=function(g){var y=document.createElement("canvas"),w=Object.create(De.webGLContextAttributes);return w.failIfMajorPerformanceCaveat=g,y.getContext("webgl",w)||y.getContext("experimental-webgl",w)}(u);if(!f)return!1;try{d=f.createShader(f.VERTEX_SHADER)}catch{return!1}return!(!d||f.isContextLost())&&(f.shaderSource(d,"void main() {}"),f.compileShader(d),f.getShaderParameter(d,f.COMPILE_STATUS)===!0)}(s)),se[s]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray supp
8ort":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var s}(l)}var se={};function de(l,n,s){const u=o.window.document.createElement(l);return n!==void 0&&(u.className=n),s&&s.appendChild(u),u}function Ie(l,n,s){const u=o.window.document.createElementNS("http://www.w3.org/2000/svg",l);for(const d of Object.keys(n))u.setAttributeNS(null,d,n[d]);return s&&s.appendChild(u),u}De.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const Pe=o.window.document&&o.window.document.documentElement.style,Me=Pe&&Pe.userSelect!==void 0?"userSelect":"WebkitUserSelect";let $e;function At(){Pe&&Me&&($e=Pe[Me],Pe[Me]="none")}function bt(){Pe&&Me&&(Pe[Me]=$e)}function lt(l){l.preventDefault(),l.stopPropagation(),o.window.removeEventListener("click",lt,!0)}function Se(){o.window.addEventListener("click",lt,!0),o.window.setTimeout(()=>{o.window.removeEventListener("click",lt,!0)},0)}function Qe(l,n){const s=l.getBoundingClientRect();return It(l,s,n)}function ni(l,n){const s=l.getBoundingClientRect(),u=[];for(let d=0;d<n.length;d++)u.push(It(l,s,n[d]));return u}function qt(l){return o.window.InstallTrigger!==void 0&&l.button===2&&l.ctrlKey&&o.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:l.button}function It(l,n,s){const u=l.offsetWidth===n.width?1:l.offsetWidth/n.width;return new o.Point((s.clientX-n.left)*u,(s.clientY-n.top)*u)}function Re(l,n){var s=n[0],u=n[1],d=n[2],f=n[3],g=s*f-d*u;return g?(l[0]=f*(g=1/g),l[1]=-u*g,l[2]=-d*g,l[3]=s*g,l):null}function gt(l){const{userImage:n}=l;return!!(n&&n.render&&n.render())&&(l.data.replace(new Uint8Array(n.data.buffer)),!0)}class ui extends o.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new o.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(n){if(this.loaded!==n&&(this.loaded=n,n)){for(const{ids:s,callback:u}of this.requestors)this._notify(s,u);this.requestors=[]}}hasImage(n){return!!this.getImage(n)}getImage(n){return this.images[n]}addImage(n,s){this._validate(n,s)&&(this.images[n]=s)}_validate(n,s){let u=!0;return this._validateStretch(s.stretchX,s.data&&s.data.width)||(this.fire(new o.ErrorEvent(new Error(`Image "${n}" has invalid "stretchX" value`))),u=!1),this._validateStretch(s.stretchY,s.data&&s.data.height)||(this.fire(new o.ErrorEvent(new Error(`Image "${n}" has invalid "stretchY" value`))),u=!1),this._validateContent(s.content,s)||(this.fire(new o.ErrorEvent(new Error(`Image "${n}" has invalid "content" value`))),u=!1),u}_validateStretch(n,s){if(!n)return!0;let u=0;for(const d of n){if(d[0]<u||d[1]<d[0]||s<d[1])return!1;u=d[1]}return!0}_validateContent(n,s){return!(n&&(n.length!==4||n[0]<0||s.data.width<n[0]||n[1]<0||s.data.height<n[1]||n[2]<0||s.data.width<n[2]||n[3]<0||s.data.height<n[3]||n[2]<n[0]||n[3]<n[1]))}updateImage(n,s){s.version=this.images[n].version+1,this.images[n]=s,this.updatedImages[n]=!0}removeImage(n){const s=this.images[n];delete this.images[n],delete this.patterns[n],s.userImage&&s.userImage.onRemove&&s.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(n,s){let u=!0;if(!this.isLoaded())for(const d of n)this.images[d]||(u=!1);this.isLoaded()||u?this._notify(n,s):this.requestors.push({ids:n,callback:s})}_notify(n,s){const u={};for(const d of n){this.images[d]||this.fire(new o.Event("styleimagemissing",{id:d}));const f=this.images[d];f?u[d]={data:f.data.clone(),pixelRatio:f.pixelRatio,sdf:f.sdf,version:f.version,stretchX:f.stretchX,stretchY:f.stretchY,content:f.content,hasRenderCallback:!!(f.userImage&&f.userImage.render)}:o.warnOnce(`Image "${d}" 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.`)}s(null,u)}getPixelSize(){const{width:n,height:s}=this.atlasImage;return{width:n,height:s}}getPattern(n){const s=this.patterns[n],u=this.getImage(n);if(!u)return null;if(s&&s.position.version===u.version)return s.position;if(s)s.position.version=u.version;else{const d={w:u.data.width+2,h:u.data.height+2,x:0,y:0},f=new o.ImagePosition(d,u);this.patterns[n]={bin:d,position:f}}return this._updatePatternAtlas(),this.patterns[n].position}bind(n){const s=n.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new o.Texture(n,this.atlasImage,s.RGBA),this.atlasTexture&&this.atlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE)}_updatePatternAtlas(){const n=[];for(const f in this.patterns)n.push(this.patterns[f].bin);const{w:s,h:u}=o.potpack(n),d=this.atlasImage;d.resize({width:s||1,height:u||1});for(const f in this.patterns){const{bin:g}=this.patterns[f],y=g.x+1,w=g.y+1,M=this.images[f].data,I=M.width,P=M.height;o.RGBAImage.copy(M,d,{x:0,y:0},{x:y,y:w},{width:I,height:P}),o.RGBAImage.copy(M,d,{x:0,y:P-1},{x:y,y:w-1},{width:I,height:1}),o.RGBAImage.copy(M,d,{x:0,y:0},{x:y,y:w+P},{width:I,height:1}),o.RGBAImage.copy(M,d,{x:I-1,y:0},{x:y-1,y:w},{width:1,height:P}),o.RGBAImage.copy(M,d,{x:0,y:0},{x:y+I,y:w},{width:1,height:P})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}
vendor: 9,432 bytes, line 8
8dispatchRenderCallbacks(n){for(const s of n){if(this.callbackDispatchedThisFrame[s])continue;this.callbackDispatchedThisFrame[s]=!0;const u=this.images[s];gt(u)&&this.updateImage(s,u)}}}const at=new o.Properties({anchor:new o.DataConstantProperty(o.spec.light.anchor),position:new class{constructor(){this.specification=o.spec.light.position}possiblyEvaluate(l,n){return function([s,u,d]){const f=o.degToRad(u+90),g=o.degToRad(d);return{x:s*Math.cos(f)*Math.sin(g),y:s*Math.sin(f)*Math.sin(g),z:s*Math.cos(g),azimuthal:u,polar:d}}(l.expression.evaluate(n))}interpolate(l,n,s){return{x:o.number(l.x,n.x,s),y:o.number(l.y,n.y,s),z:o.number(l.z,n.z,s),azimuthal:o.number(l.azimuthal,n.azimuthal,s),polar:o.number(l.polar,n.polar,s)}}},color:new o.DataConstantProperty(o.spec.light.color),intensity:new o.DataConstantProperty(o.spec.light.intensity)});class Ct extends o.Evented{constructor(n){super(),this._transitionable=new o.Transitionable(at),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(n,s={}){if(!this._validate(o.validateLight,n,s))for(const u in n){const d=n[u];o.endsWith(u,"-transition")?this._transitionable.setTransition(u.slice(0,-11),d):this._transitionable.setValue(u,d)}}updateTransitions(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(n){this.properties=this._transitioning.possiblyEvaluate(n)}_validate(n,s,u){return(!u||u.validate!==!1)&&o.emitValidationErrors(this,n.call(o.validateStyle,o.extend({value:s,style:{glyphs:!0,sprite:!0},styleSpec:o.spec})))}}const Qt=new o.Properties({source:new o.DataConstantProperty(o.spec.terrain.source),exaggeration:new o.DataConstantProperty(o.spec.terrain.exaggeration)});let Ke=class extends o.Evented{constructor(l,n){super(),this._transitionable=new o.Transitionable(Qt),this.set(l),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=n}get(){return this._transitionable.serialize()}set(l){for(const n in l){const s=l[n];o.endsWith(n,"-transition")?this._transitionable.setTransition(n.slice(0,-11),s):this._transitionable.setValue(n,s)}}updateTransitions(l){this._transitioning=this._transitionable.transitioned(l,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(l){this.properties=this._transitioning.possiblyEvaluate(l)}};function Tt(l,n,s,u){const d=o.smoothstep(45,65,s),[f,g]=$i(l,u),y=o.length(n);let w=1-Math.min(1,Math.exp((y-f)/(g-f)*-6));return w*=w*w,w=Math.min(1,1.00747*w),w*d*l.alpha}function $i(l,n){const s=.5/Math.tan(.5*n);return[l.range[0]+s,l.range[1]+s]}const St=new o.Properties({range:new o.DataConstantProperty(o.spec.fog.range),color:new o.DataConstantProperty(o.spec.fog.color),"high-color":new o.DataConstantProperty(o.spec.fog["high-color"]),"space-color":new o.DataConstantProperty(o.spec.fog["space-color"]),"horizon-blend":new o.DataConstantProperty(o.spec.fog["horizon-blend"]),"star-intensity":new o.DataConstantProperty(o.spec.fog["star-intensity"])});class Lt extends o.Evented{constructor(n,s){super(),this._transitionable=new o.Transitionable(St),this.set(n),this._transitioning=this._transitionable.untransitioned(),this._transform=s}get state(){const n=this._transform,s=n.projection.name==="globe",u=o.globeToMercatorTransition(n.zoom),d=this.properties.get("range"),f=[.5,3];return{range:s?[o.number(f[0],d[0],u),o.number(f[1],d[1],u)]:d,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(n,s={}){if(!this._validate(o.validateFog,n,s)){for(const u of Object.keys(o.spec.fog))n&&n[u]===void 0&&(n[u]=o.spec.fog[u].default);for(const u in n){const d=n[u];o.endsWith(u,"-transition")?this._transitionable.setTransition(u.slice(0,-11),d):this._transitionable.setValue(u,d)}}}getOpacity(n){if(!this._transform.projection.supportsFog)return 0;const s=this.properties&&this.properties.get("color")||1;return(this._transform.projection.name==="globe"?1:o.smoothstep(45,65,n))*s.a}getOpacityAtLatLng(n,s){return this._transform.projection.supportsFog?function(u,d,f){const g=o.MercatorCoordinate.fromLngLat(d),y=f.elevation?f.elevation.getAtPointOrZero(g):0,w=[g.x,g.y,y];return o.transformMat4(w,w,f.mercatorFogMatrix),Tt(u,w,f.pitch,f._fov)}(this.state,n,s):0}getFovAdjustedRange(n){return this._transform.projection.supportsFog?$i(this.state,n):[0,1]}updateTransitions(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(n){this.properties=this._transitioning.possiblyEvaluate(n)}_validate(n,s,u){return(!u||u.validate!==!1)&&o.emitValidationErrors(this,n.call(o.validateStyle,o.extend({value:s,style:{glyphs:!0,sprite:!0},styleSpec:o.spec})))}}class vt{constructor(n,s){this.workerPool=n,this.actors=[],this.currentActor=0,this.id=o.uniqueId();const u=this.workerPool.acquire(this.id);for(let d=0;d<u.length;d++){const f=new vt.Actor(u[d],s,this.id);f.name=`Worker ${d}`,this.actors.push(f)}this.ready=!1,this.broadcast("checkIfReady",null,()=>{this.ready=!0})}broadcast(n,s,u){o.asyncAll(this.actors,(d,f)=>{d.send(n,s,f)},u=u||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(n=>{n.remove()}),this.actors=[],this.workerPool.release(this.id)}}function ai(l,n,s){return n*(o.EXTENT/(l.tileSize*Math.pow(2,s-l.tileID.overscaledZ)))}vt.Actor=o.Actor;class Mi{constructor(n,s,u,d){this.screenBounds=n,this.cameraPoint=s,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=u,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,d)}static createFromScreenPoints(n,s){let u,d;if(n instanceof o.Point||typeof n[0]=="number"){const f=o.Point.convert(n);u=[f],d=s.isPointAboveHorizon(f)}else{const f=o.Point.convert(n[0]),g=o.Point.convert(n[1]);u=[f,g],d=o.polygonizeBounds(f,g).every(y=>s.isPointAboveHorizon(y))}return new Mi(u,s.getCameraPoint(),d,s)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(n){return o.polygonizeBounds(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],n)}bufferedCameraGeometry(n){const s=this.screenBounds[0],u=this.screenBounds.length===1?this.screenBounds[0].add(new o.Point(1,1)):this.screenBounds[1],d=o.polygonizeBounds(s,u,0,!1);return this.cameraPoint.y>u.y&&(this.cameraPoint.x>s.x&&this.cameraPoint.x<u.x?d.splice(3,0,this.cameraPoint):this.cameraPoint.x>=u.x?d[2]=this.cameraPoint:this.cameraPoint.x<=s.x&&(d[3]=this.cameraPoint)),o.bufferConvexPolygon(d,n)}bufferedCameraGeometryGlobe(n){const s=this.screenBounds[0],u=this.screenBounds.length===1?this.screenBounds[0].add(new o.Point(1,1)):this.screenBounds[1],d=o.polygonizeBounds(s,u,n),f=this.cameraPoint.clone();switch(3*((f.y>s.y)+(f.y>u.y))+((f.x>s.x)+(f.x>u.x))){case 0:d[0]=f,d[4]=f.clone();break;case 1:d.splice(1,0,f);break;case 2:d[1]=f;break;case 3:d.splice(4,0,f);break;case 5:d.splice(2,0,f);break;case 6:d[3]=f;break;case 7:d.splice(3,0,f);break;case 8:d[2]=f}return d}containsTile(n,s,u,d=0){const f=n.queryPadding/s._pixelsPerMercatorPixel+1,g=u?this._bufferedCameraMercator(f,s):this._bufferedScreenMercator(f,s);let y=n.tileID.wrap+(g.unwrapped?d:0);const w=g.polygon.map(q=>o.getTilePoint(n.tileTransform,q,y));if(!o.polygonIntersectsBox(w,0,0,o.EXTENT,o.EXTENT))return;y=n.tileID.wrap+(this.screenGeometryMercator.unwrapped?d:0);const M=this.screenGeometryMercator.polygon.map(q=>o.getTileVec3(n.tileTransform,q,y)),I=M.map(q=>new o.Point(q[0],q[1])),P=s.getFreeCameraOptions().position||new o.MercatorCoordinate(0,0,0),O=o.getTileVec3(n.tileTransform,P,y),N=M.map(q=>{const z=o.sub(q,q,O);return o.normalize(z,z),new o.Ray(O,z)}),G=ai(n,1,s.zoom)*s._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:I,tilespaceRays:N,bufferedTilespaceGeometry:w,bufferedTilespaceBounds:(j=o.getBounds(w),j.min.x=o.clamp(j.min.x,0,o.EXTENT),j.min.y=o.clamp(j.min.y,0,o.EXTENT),j.max.x=o.clamp(j.max.x,0,o.EXTENT),j.max.y=o.clamp(j.max.y,0,o.EXTENT),j),tile:n,tileID:n.tileID,pixelToTileUnitsFactor:G};var j}_bufferedScreenMercator(n,s){const u=Gn(n);if(this._screenRaycastCache[u])return this._screenRaycastCache[u];{let d;return d=s.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(n),s):{polygon:this.bufferedScreenGeometry(n).map(f=>s.pointCoordinate3D(f)),unwrapped:!0},this._screenRaycastCache[u]=d,d}}_bufferedCameraMercator(n,s){const u=Gn(n);if(this._cameraRaycastCache[u])return this._cameraRaycastCache[u];{let d;return d=s.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(n),s):{polygon:this.bufferedCameraGeometry(n).map(f=>s.pointCoordinate3D(f)),unwrapped:!0},this._cameraRaycastCache[u]=d,d}}_projectAndResample(n,s){const u=function(f,g){const y=o.multiply([],g.pixelMatrix,g.globeMatrix),w=[0,-o.GLOBE_RADIUS,0,1],M=[0,o.GLOBE_RADIUS,0,1],I=[0,0,0,1];o.transformMat4$1(w,w,y),o.transformMat4$1(M,M,y),o.transformMat4$1(I,I,y);const P=new o.Point(w[0]/w[3],w[1]/w[3]),O=new o.Point(M[0]/M[3],M[1]/M[3]),N=o.polygonContainsPoint(f,P)&&w[3]<I[3],G=o.polygonContainsPoint(f,O)&&M[3]<I[3];if(!N&&!G)return null;const j=function(oe,fe,pe){for(let ve=1;
8ve<oe.length;ve++){const Ne=nn(fe.pointCoordinate3D(oe[ve-1]).x),ge=nn(fe.pointCoordinate3D(oe[ve]).x);if(pe<0){if(Ne<ge)return{idx:ve,t:-Ne/(ge-1-Ne)}}else if(ge<Ne)return{idx:ve,t:(1-Ne)/(ge+1-Ne)}}return null}(f,g,N?-1:1);if(!j)return null;const{idx:q,t:z}=j;let V=q>1?$t(f.slice(0,q),g):[],H=q<f.length?$t(f.slice(q),g):[];V=V.map(oe=>new o.Point(nn(oe.x),oe.y)),H=H.map(oe=>new o.Point(nn(oe.x),oe.y));const K=[...V];K.length===0&&K.push(H[H.length-1]);const re=o.number(K[K.length-1].y,(H.length===0?V[0]:H[0]).y,z);let le;return le=N?[new o.Point(0,re),new o.Point(0,0),new o.Point(1,0),new o.Point(1,re)]:[new o.Point(1,re),new o.Point(1,1),new o.Point(0,1),new o.Point(0,re)],K.push(...le),H.length===0?K.push(V[0]):K.push(...H),{polygon:K.map(oe=>new o.MercatorCoordinate(oe.x,oe.y)),unwrapped:!1}}(n,s);if(u)return u;const d=function(f,g){let y=!1,w=-1/0,M=0;for(let P=0;P<f.length-1;P++)f[P].x>w&&(w=f[P].x,M=P);for(let P=0;P<f.length-1;P++){const O=(M+P)%(f.length-1),N=f[O],G=f[O+1];Math.abs(N.x-G.x)>.5&&(N.x<G.x?(N.x+=1,O===0&&(f[f.length-1].x+=1)):(G.x+=1,O+1===f.length-1&&(f[0].x+=1)),y=!0)}const I=o.mercatorXfromLng(g.center.lng);return y&&I<Math.abs(I-1)&&f.forEach(P=>{P.x-=1}),{polygon:f,unwrapped:y}}($t(n,s).map(f=>new o.Point(nn(f.x),f.y)),s);return{polygon:d.polygon.map(f=>new o.MercatorCoordinate(f.x,f.y)),unwrapped:d.unwrapped}}}function $t(l,n){return o.resample(l,s=>{const u=n.pointCoordinate3D(s);s.x=u.x,s.y=u.y},.00390625)}function nn(l){return l<0?1+l%1:l%1}function Gn(l){return 100*l|0}function Tn(l,n,s,u,d){const f=function(g,y){if(g)return d(g);if(y){l.url&&y.tiles&&l.tiles&&delete l.tiles;const w=o.pick(o.extend(y,l),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);y.vector_layers&&(w.vectorLayers=y.vector_layers,w.vectorLayerIds=w.vectorLayers.map(M=>M.id)),w.tiles=n.canonicalizeTileset(w,l.url),d(null,w)}};return l.url?o.getJSON(n.transformRequest(n.normalizeSourceURL(l.url,null,s,u),o.ResourceType.Source),f):o.exported.frame(()=>f(null,l))}class mn{constructor(n,s,u){this.bounds=o.LngLatBounds.convert(this.validateBounds(n)),this.minzoom=s||0,this.maxzoom=u||24}validateBounds(n){return Array.isArray(n)&&n.length===4?[Math.max(-180,n[0]),Math.max(-90,n[1]),Math.min(180,n[2]),Math.min(90,n[3])]:[-180,-90,180,90]}contains(n){const s=Math.pow(2,n.z),u=Math.floor(o.mercatorXfromLng(this.bounds.getWest())*s),d=Math.floor(o.mercatorYfromLat(this.bounds.getNorth())*s),f=Math.ceil(o.mercatorXfromLng(this.bounds.getEast())*s),g=Math.ceil(o.mercatorYfromLat(this.bounds.getSouth())*s);return n.x>=u&&n.x<f&&n.y>=d&&n.y<g}}class Je{constructor(n,s,u){this.context=n;const d=n.gl;this.buffer=d.createBuffer(),this.dynamicDraw=!!u,this.context.unbindVAO(),n.bindElementBuffer.set(this.buffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,s.arrayBuffer,this.dynamicDraw?d.DYNAMIC_DRAW:d.STATIC_DRAW),this.dynamicDraw||s.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(n){const s=this.context.gl;this.context.unbindVAO(),this.bind(),s.bufferSubData(s.ELEMENT_ARRAY_BUFFER,0,n.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Dt={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class en{constructor(n,s,u,d){this.length=s.length,this.attributes=u,this.itemSize=s.bytesPerElement,this.dynamicDraw=d,this.context=n;const f=n.gl;this.buffer=f.createBuffer(),n.bindVertexBuffer.set(this.buffer),f.bufferData(f.ARRAY_BUFFER,s.arrayBuffer,this.dynamicDraw?f.DYNAMIC_DRAW:f.STATIC_DRAW),this.dynamicDraw||s.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(n){const s=this.context.gl;this.bind(),s.bufferSubData(s.ARRAY_BUFFER,0,n.arrayBuffer)}enableAttributes(n,s){for(let u=0;u<this.attributes.length;u++){const d=s.attributes[this.attributes[u].name];d!==void 0&&n.enableVertexAttribArray(d)}}setVertexAttribPointers(n,s,u){for(let d=0;d<this.attributes.length;d++){const f=this.attributes[d],g=s.attributes[f.name];g!==void 0&&n.vertexAttribPointer(g,f.components,n[Dt[f.type]],!1,this.itemSize,f.offset+this.itemSize*(u||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Vt{constructor(n){this.gl=n.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(n){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class gr extends Vt{getDefault(){return o.Color.transparent}set(n){const s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.clearColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)}}class _n extends Vt{getDefault(){return 1}set(n){(n!==this.current||this.dirty)&&(this.gl.clearDepth(n),this.current=n,this.dirty=!1)}}class yr extends Vt{getDefault(){return 0}set(n){(n!==this.current||this.dirty)&&(this.gl.clearStencil(n),this.current=n,this.dirty=!1)}}
vendor: 5,821 bytes, line 8
8class wi extends Vt{getDefault(){return[!0,!0,!0,!0]}set(n){const s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.colorMask(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)}}class En extends Vt{getDefault(){return!0}set(n){(n!==this.current||this.dirty)&&(this.gl.depthMask(n),this.current=n,this.dirty=!1)}}class wo extends Vt{getDefault(){return 255}set(n){(n!==this.current||this.dirty)&&(this.gl.stencilMask(n),this.current=n,this.dirty=!1)}}class Hn extends Vt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(n){const s=this.current;(n.func!==s.func||n.ref!==s.ref||n.mask!==s.mask||this.dirty)&&(this.gl.stencilFunc(n.func,n.ref,n.mask),this.current=n,this.dirty=!1)}}class Sn extends Vt{getDefault(){const n=this.gl;return[n.KEEP,n.KEEP,n.KEEP]}set(n){const s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||this.dirty)&&(this.gl.stencilOp(n[0],n[1],n[2]),this.current=n,this.dirty=!1)}}class io extends Vt{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;const s=this.gl;n?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST),this.current=n,this.dirty=!1}}class kr extends Vt{getDefault(){return[0,1]}set(n){const s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.depthRange(n[0],n[1]),this.current=n,this.dirty=!1)}}class no extends Vt{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;const s=this.gl;n?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),this.current=n,this.dirty=!1}}class Kn extends Vt{getDefault(){return this.gl.LESS}set(n){(n!==this.current||this.dirty)&&(this.gl.depthFunc(n),this.current=n,this.dirty=!1)}}class Pr extends Vt{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;const s=this.gl;n?s.enable(s.BLEND):s.disable(s.BLEND),this.current=n,this.dirty=!1}}class ro extends Vt{getDefault(){const n=this.gl;return[n.ONE,n.ZERO]}set(n){const s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.blendFunc(n[0],n[1]),this.current=n,this.dirty=!1)}}class To extends Vt{getDefault(){return o.Color.transparent}set(n){const s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.blendColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)}}class kn extends Vt{getDefault(){return this.gl.FUNC_ADD}set(n){(n!==this.current||this.dirty)&&(this.gl.blendEquation(n),this.current=n,this.dirty=!1)}}class or extends Vt{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;const s=this.gl;n?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE),this.current=n,this.dirty=!1}}class zr extends Vt{getDefault(){return this.gl.BACK}set(n){(n!==this.current||this.dirty)&&(this.gl.cullFace(n),this.current=n,this.dirty=!1)}}class Lr extends Vt{getDefault(){return this.gl.CCW}set(n){(n!==this.current||this.dirty)&&(this.gl.frontFace(n),this.current=n,this.dirty=!1)}}let Dr,Rr=class extends Vt{getDefault(){return null}set(l){(l!==this.current||this.dirty)&&(this.gl.useProgram(l),this.current=l,this.dirty=!1)}};class pi extends Vt{getDefault(){return this.gl.TEXTURE0}set(n){(n!==this.current||this.dirty)&&(this.gl.activeTexture(n),this.current=n,this.dirty=!1)}}class Pn extends Vt{getDefault(){const n=this.gl;return[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}set(n){const s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.viewport(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)}}class sr extends Vt{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;const s=this.gl;s.bindFramebuffer(s.FRAMEBUFFER,n),this.current=n,this.dirty=!1}}class ar extends Vt{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;const s=this.gl;s.bindRenderbuffer(s.RENDERBUFFER,n),this.current=n,this.dirty=!1}}class xr extends Vt{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;const s=this.gl;s.bindTexture(s.TEXTURE_2D,n),this.current=n,this.dirty=!1}}class Br extends Vt{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;const s=this.gl;s.bindBuffer(s.ARRAY_BUFFER,n),this.current=n,this.dirty=!1}}class Q extends Vt{getDefault(){return null}set(n){const s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,n),this.current=n,this.dirty=!1}}class R extends Vt{constructor(n){super(n),this.vao=n.extVertexArrayObject}getDefault(){return null}set(n){this.vao&&(n!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(n),this.current=n,this.dirty=!1)}}class B extends Vt{getDefault(){return 4}set(n){if(n===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,n),this.current=n,this.dirty=!1}}class Y extends Vt{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),this.current=n,this.dirty=!1}}class ne extends Vt{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,n),this.current=n,this.dirty=!1}}class ue extends Vt{constructor(n,s){super(n),this.context=n,this.parent=s}getDefault(){return null}}class _e extends ue{setDirty(){this.dirty=!0}set(n){if(n===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,n,0),this.current=n,this.dirty=!1}}class me extends ue{attachment(){return this.gl.DEPTH_ATTACHMENT}set(n){if(n===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,this.attachment(),s.RENDERBUFFER,n),this.current=n,this.dirty=!1}}class ce extends me{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}class we{constructor(n,s,u,d){this.context=n,this.width=s,this.height=u;const f=this.framebuffer=n.gl.createFramebuffer();
8this.colorAttachment=new _e(n,f),d&&(this.depthAttachment=new me(n,f))}destroy(){const n=this.context.gl,s=this.colorAttachment.get();if(s&&n.deleteTexture(s),this.depthAttachment){const u=this.depthAttachment.get();u&&n.deleteRenderbuffer(u)}n.deleteFramebuffer(this.framebuffer)}}class We{constructor(n,s=!1){if(this.gl=n,this.isWebGL2=s,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),s){const u=n;this.extVertexArrayObject={createVertexArrayOES:u.createVertexArray.bind(n),deleteVertexArrayOES:u.deleteVertexArray.bind(n),bindVertexArrayOES:u.bindVertexArray.bind(n)}}this.clearColor=new gr(this),this.clearDepth=new _n(this),this.clearStencil=new yr(this),this.colorMask=new wi(this),this.depthMask=new En(this),this.stencilMask=new wo(this),this.stencilFunc=new Hn(this),this.stencilOp=new Sn(this),this.stencilTest=new io(this),this.depthRange=new kr(this),this.depthTest=new no(this),this.depthFunc=new Kn(this),this.blend=new Pr(this),this.blendFunc=new ro(this),this.blendColor=new To(this),this.blendEquation=new kn(this),this.cullFace=new or(this),this.cullFaceSide=new zr(this),this.frontFace=new Lr(this),this.program=new Rr(this),this.activeTexture=new pi(this),this.viewport=new Pn(this),this.bindFramebuffer=new sr(this),this.bindRenderbuffer=new ar(this),this.bindTexture=new xr(this),this.bindVertexBuffer=new Br(this),this.bindElementBuffer=new Q(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new R(this),this.pixelStoreUnpack=new B(this),this.pixelStoreUnpackPremultiplyAlpha=new Y(this),this.pixelStoreUnpackFlipY=new ne(this),this.extTextureFilterAnisotropic=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=n.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureFilterAnisotropicForceOff=!1,this.extStandardDerivativesForceOff=!1,this.extDebugRendererInfo=n.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=n.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=n.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),s||(this.extTextureHalfFloat=n.getExtension("OES_texture_half_float")),(s||this.extTextureHalfFloat&&n.getExtension("OES_texture_half_float_linear"))&&(this.extRenderToTextureHalfFloat=n.getExtension("EXT_color_buffer_half_float")),this.extStandardDerivatives=s||n.getExtension("OES_standard_derivatives"),this.extTimerQuery=n.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(n,s){return new Je(this,n,s)}createVertexBuffer(n,s,u){return new en(this,n,s,u)}createRenderbuffer(n,s,u){const d=this.gl,f=d.createRenderbuffer();return this.bindRenderbuffer.set(f),d.renderbufferStorage(d.RENDERBUFFER,n,s,u),this.bindRenderbuffer.set(null),f}createFramebuffer(n,s,u){return new we(this,n,s,u)}clear({color:n,depth:s,stencil:u}){const d=this.gl;let f=0;n&&(f|=d.COLOR_BUFFER_BIT,this.clearColor.set(n),this.colorMask.set([!0,!0,!0,!0])),s!==void 0&&(f|=d.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(s),this.depthMask.set(!0)),u!==void 0&&(f|=d.STENCIL_BUFFER_BIT,this.clearStencil.set(u),this.stencilMask.set(255)),d.clear(f)}setCullFace(n){n.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(n.mode),this.frontFace.set(n.frontFace))}setDepthMode(n){n.func!==this.gl.ALWAYS||n.mask?(this.depthTest.set(!0),this.depthFunc.set(n.func),this.depthMask.set(n.mask),this.depthRange.set(n.range)):this.depthTest.set(!1)}setStencilMode(n){n.test.func!==this.gl.ALWAYS||n.mask?(this.stencilTest.set(!0),this.stencilMask.set(n.mask),this.stencilOp.set([n.fail,n.depthFail,n.pass
8]),this.stencilFunc.set({func:n.test.func,ref:n.ref,mask:n.test.mask})):this.stencilTest.set(!1)}setColorMode(n){U(n.blendFunction,o.ColorMode.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(n.blendFunction),this.blendColor.set(n.blendColor)),this.colorMask.set(n.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class Ye extends o.Evented{constructor(n,s,u,d){if(super(),this.id=n,this.dispatcher=u,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.extend(this,o.pick(s,["url","scheme","tileSize","promoteId"])),this._options=o.extend({type:"vector"},s),this._collectResourceTiming=s.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(d),this._tileWorkers={},this._deduped=new o.DedupedRequest}load(n){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"}));const s=Array.isArray(this.map._language)?this.map._language.join():this.map._language,u=this.map._worldview;this._tileJSONRequest=Tn(this._options,this.map._requestManager,s,u,(d,f)=>{this._tileJSONRequest=null,this._loaded=!0,d?(s&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${s}`),u&&u.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${u}`),this.fire(new o.ErrorEvent(d))):f&&(o.extend(this,f),f.bounds&&(this.tileBounds=new mn(f.bounds,this.minzoom,this.maxzoom)),o.postTurnstileEvent(f.tiles,this.map._requestManager._customAccessToken),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"}))),n&&n(d)})}loaded(){return this._loaded}hasTile(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)}onAdd(n){this.map=n,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(n){return this._options.tiles=n,this.reload(),this}setUrl(n){return this.url=n,this._options.url=n,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return o.extend({},this._options)}loadTile(n,s){const u=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme)),d={request:this.map._requestManager.transformRequest(u,o.ResourceType.Tile),data:void 0,uid:n.uid,tileID:n.tileID,tileZoom:n.tileZoom,zoom:n.tileID.overscaledZ,tileSize:this.tileSize*n.tileID.overscaleFactor(),type:this.t
8ype,source:this.id,pixelRatio:o.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:n.isSymbolTile};if(d.request.collectResourceTiming=this._collectResourceTiming,n.actor&&n.state!=="expired")n.state==="loading"?n.reloadCallback=s:n.request=n.actor.send("reloadTile",d,f.bind(this));else if(n.actor=this._tileWorkers[u]=this._tileWorkers[u]||this.dispatcher.getActor(),this.dispatcher.ready)n.request=n.actor.send("loadTile",d,f.bind(this),void 0,!0);else{const g=o.loadVectorTile.call({deduped:this._deduped},d,(y,w)=>{y||!w?f.call(this,y):(d.data={cacheControl:w.cacheControl,expires:w.expires,rawData:w.rawData.slice(0)},n.actor&&n.actor.send("loadTile",d,f.bind(this),void 0,!0))},!0);n.request={cancel:g}}function f(g,y){return delete n.request,n.aborted?s(null):g&&g.status!==404?s(g):(y&&y.resourceTiming&&(n.resourceTiming=y.resourceTiming),this.map._refreshExpiredTiles&&y&&n.setExpiryData(y),n.loadVectorData(y,this.map.painter),o.cacheEntryPossiblyAdded(this.dispatcher),s(null),void(n.reloadCallback&&(this.loadTile(n,n.reloadCallback),n.reloadCallback=null)))}}abortTile(n){n.request&&(n.request.cancel(),delete n.request),n.actor&&n.actor.send("abortTile",{uid:n.uid,type:this.t
vendor: 16,755 bytes, line 8
8ype,source:this.id})}unloadTile(n){n.unloadVectorData(),n.actor&&n.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Ze extends o.Evented{constructor(n,s,u,d){super(),this.id=n,this.dispatcher=u,this.setEventedParent(d),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=o.extend({type:"raster"},s),o.extend(this,o.pick(s,["url","scheme","tileSize"]))}load(n){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Tn(this._options,this.map._requestManager,null,null,(s,u)=>{this._tileJSONRequest=null,this._loaded=!0,s?this.fire(new o.ErrorEvent(s)):u&&(o.extend(this,u),u.bounds&&(this.tileBounds=new mn(u.bounds,this.minzoom,this.maxzoom)),o.postTurnstileEvent(u.tiles),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"}))),n&&n(s)})}loaded(){return this._loaded}onAdd(n){this.map=n,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(n){return this._options.tiles=n,this.reload(),this}setUrl(n){return this.url=n,this._options.url=n,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return o.extend({},this._options)}hasTile(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)}loadTile(n,s){const u=o.exported.devicePixelRatio>=2,d=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),u,this.tileSize);n.request=o.getImage(this.map._requestManager.transformRequest(d,o.ResourceType.Tile),(f,g,y,w)=>(delete n.request,n.aborted?(n.state="unloaded",s(null)):f?(n.state="errored",s(f)):g?(this.map._refreshExpiredTiles&&n.setExpiryData({cacheControl:y,expires:w}),n.setTexture(g,this.map.painter),n.state="loaded",o.cacheEntryPossiblyAdded(this.dispatcher),void s(null)):s(null)))}static loadTileData(n,s,u){n.setTexture(s,u)}static unloadTileData(n,s){n.texture&&s.saveTileTexture(n.texture)}abortTile(n,s){n.request&&(n.request.cancel(),delete n.request),s()}unloadTile(n,s){n.texture&&this.map.painter.saveTileTexture(n.texture),s()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function zt(l,n,s,u,d,f,g,y){const w=[l,s,d,n,u,f,1,1,1],M=[g,y,1],I=o.adjoint([],w),[P,O,N]=o.transformMat3(M,M,o.transpose(I,I));return o.multiply$1(w,[P,0,0,0,O,0,0,0,N],w)}class Nt extends o.Evented{constructor(n,s,u,d){super(),this.id=n,this.dispatcher=u,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(d),this.options=s,this._dirty=!1}load(n,s){this._loaded=s||!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=o.getImage(this.map._requestManager.transformRequest(this.url,o.ResourceType.Image),(u,d)=>{if(this._imageRequest=null,this._loaded=!0,u)this.fire(new o.ErrorEvent(u));else if(d){const{HTMLImageElement:f}=o.window;this.image=d instanceof f?o.exported.getImageData(d):d,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,n&&(this.coordinates=n),this._finishLoading()}})}loaded(){return this._loaded}updateImage(n){return this.image&&n.url?(this._imageRequest&&n.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=n.url,this.load(n.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(n){this.map=n,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(n){this.coordinates=n,this._boundsArray=void 0;const s=n.map(o.MercatorCoordinate.fromLngLat);return this.tileID=function(u){let d=1/0,f=1/0,g=-1/0,y=-1/0;for(const P of u)d=Math.min(d,P.x),f=Math.min(f,P.y),g=Math.max(g,P.x),y=Math.max(y,P.y);const w=Math.max(g-d,y-f),M=Math.max(0,Math.floor(-Math.log(w)/Math.LN2)),I=Math.pow(2,M);return new o.CanonicalTileID(M,Math.floor((d+g)/2*I),Math.floor((f+y)/2*I))}(s),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(n){for(const w in this.tiles){const M=this.tiles[w];M.state!=="loaded"&&(M.state="loaded",M.texture=this.texture)}if(this._boundsArray)return;const s=o.tileTransform(this.tileID,this.map.transform.projection),[u,d,f,g]=this.coordinates.map(w=>{const M=s.projection.project(w[0],w[1]);return o.getTilePoint(s,M)._round()});this.perspectiveTransform=function(w,M,I,P,O,N,G,j,q,z){const V=zt(0,0,w,0,0,M,w,M),H=zt(I,P,O,N,G,j,q,z);return o.multiply$1(H,o.adjoint(V,V),H),[H[6]/H[8]*w/o.EXTENT,H[7]/H[8]*M/o.EXTENT]}(this.width,this.height,u.x,u.y,d.x,d.y,g.x,g.y,f.x,f.y);const y=this._boundsArray=new o.StructArrayLayout4i8;y.emplaceBack(u.x,u.y,0,0),y.emplaceBack(d.x,d.y,o.EXTENT,0),y.emplaceBack(g.x,g.y,0,o.EXTENT),y.emplaceBack(f.x,f.y,o.EXTENT,o.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=n.createVertexBuffer(y,o.boundsAttributes.members),this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const n=this.map.painter.context,s=n.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new o.Texture(n,this.image,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(n)}loadTile(n,s){this.tileID&&this.tileID.equals(n.tileID.canonical)?(this.tiles[String(n.tileID.wrap)]=n,n.buckets={},s(null)):(n.state="errored",s(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const kt={vector:Ye,raster:Ze,"raster-dem":class extends Ze{constructor(l,n,s,u){super(l,n,s,u),this.type="raster-dem",this.maxzoom=22,this._options=o.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}loadTile(l,n){const s=this.map._requestManager.normalizeTileURL(l.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function u(d,f){d&&(l.state="errored",n(d)),f&&(l.dem=f,l.dem.onDeserialize(),l.needsHillshadePrepare=!0,l.needsDEMTextureUpload=!0,l.state="loaded",n(null))}l.request=o.getImage(this.map._requestManager.transformRequest(s,o.ResourceType.Tile),(function(d,f,g,y){if(delete l.request,l.aborted)l.state="unloaded",n(null);else if(d)l.state="errored",n(d);else if(f){this.map._refreshExpiredTiles&&l.setExpiryData({cacheControl:g,expires:y});const w=o.window.ImageBitmap&&f instanceof o.window.ImageBitmap&&(Dr==null&&(Dr=o.window.OffscreenCanvas&&new o.window.OffscreenCanvas(1,1).getContext("2d")&&typeof o.window.createImageBitmap=="function"),Dr),M=1-(f.width-o.prevPowerOfTwo(f.width))/2;M<1||l.neighboringTiles||(l.neighboringTiles=this._getNeighboringTiles(l.tileID));const I=w?f:o.exported.getImageData(f,M),P={uid:l.uid,coord:l.tileID,source:this.id,rawImageData:I,encoding:this.encoding,padding:M};l.actor&&l.state!=="expired"||(l.actor=this.dispatcher.getActor(),l.actor.send("loadDEMTile",P,u.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(l){const n=l.canonical,s=Math.pow(2,n.z),u=(n.x-1+s)%s,d=n.x===0?l.wrap-1:l.wrap,f=(n.x+1+s)%s,g=n.x+1===s?l.wrap+1:l.wrap,y={};return y[new o.OverscaledTileID(l.overscaledZ,d,n.z,u,n.y).key]={backfilled:!1},y[new o.OverscaledTileID(l.overscaledZ,g,n.z,f,n.y).key]={backfilled:!1},n.y>0&&(y[new o.OverscaledTileID(l.overscaledZ,d,n.z,u,n.y-1).key]={backfilled:!1},y[new o.OverscaledTileID(l.overscaledZ,l.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},y[new o.OverscaledTileID(l.overscaledZ,g,n.z,f,n.y-1).key]={backfilled:!1}),n.y+1<s&&(y[new o.OverscaledTileID(l.overscaledZ,d,n.z,u,n.y+1).key]={backfilled:!1},y[new o.OverscaledTileID(l.overscaledZ,l.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},y[new o.OverscaledTileID(l.overscaledZ,g,n.z,f,n.y+1).key]={backfilled:!1}),y}unloadTile(l){l.demTexture&&this.map.painter.saveTileTexture(l.demTexture),l.fbo&&(l.fbo.destroy(),delete l.fbo),l.dem&&delete l.dem,delete l.neighboringTiles,l.state="unloaded"}},geojson:class extends o.Evented{constructor(l,n,s,u){super(),this.id=l,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=s.getActor(),this.setEventedParent(u),this._data=n.data,this._options=o.extend({},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.EXTENT/this.tileSize;this.workerOptions=o.extend({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.EXTENT,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.EXTENT,radius:(n.clusterRadius!==void 0?n.clusterRadius:50)*d,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions)}onAdd(l){this.map=l,this.setData(this._data)}setData(l){return this._data=l,this._updateWorkerData(),this}getClusterExpansionZoom(l,n){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:l,source:this.id},n),this}getClusterChildren(l,n){return this.actor.send("geojson.getClusterChildren",{clusterId:l,source:this.id},n),this}getClusterLeaves(l,n,s,u){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:l,limit:n,offset:s},u),this}_updateWorkerData(){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new o.Event("dataloading",{dataType:"source"})),this._loaded=!1;const l=o.extend({},this.workerOptions),n=this._data;typeof n=="string"?(l.request=this.map._requestManager.transformRequest(o.exported.resolveURL(n),o.ResourceType.Source),l.request.collectResourceTiming=this._collectResourceTiming):l.data=JSON.stringify(n),this._pendingLoad=this.actor.send(`${this.type}.loadData`,l,(s,u)=>{if(this._loaded=!0,this._pendingLoad=null,s)this.fire(new o.ErrorEvent(s));else{const d={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&u&&u.resourceTiming&&u.resourceTiming[this.id]&&(d.resourceTiming=u.resourceTiming[this.id]),this.fire(new o.Event("data",d)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(l,n){const s=l.actor?"reloadTile":"loadTile";l.actor=this.actor,l.request=this.actor.send(s,{type:this.type,uid:l.uid,tileID:l.tileID,tileZoom:l.tileZoom,zoom:l.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:o.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(u,d)=>(delete l.request,l.unloadVectorData(),l.aborted?n(null):u?n(u):(l.loadVectorData(d,this.map.painter,s==="reloadTile"),n(null))),void 0,s==="loadTile")}abortTile(l){l.request&&(l.request.cancel(),delete l.request),l.aborted=!0}unloadTile(l){l.unloadVectorData(),this.actor.send("removeTile",{uid:l.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return o.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends Nt{constructor(l,n,s,u){super(l,n,s,u),this.roundZoom=!0,this.type="video",this.options=n}load(){this._loaded=!1;const l=this.options;this.urls=[];for(const n of l.urls)this.urls.push(this.map._requestManager.transformRequest(n,o.ResourceType.Source).url);o.getVideo(this.urls,(n,s)=>{this._loaded=!0,n?this.fire(new o.ErrorEvent(n)):s&&(this.video=s,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(l){if(this.video){const n=this.video.seekable;l<n.start(0)||l>n.end(0)?this.fire(new o.ErrorEvent(new o.ValidationError(`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=l}}getVideo(){return this.video}onAdd(l){this.map||(this.map=l,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 l=this.map.painter.context,n=l.gl;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 o.Texture(l,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(l)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:Nt,canvas:class extends Nt{constructor(l,n,s,u){super(l,n,s,u),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(d=>!Array.isArray(d)||d.length!==2||d.some(f=>typeof f!="number"))||this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof o.window.HTMLCanvasElement||this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`,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.ErrorEvent(new o.ValidationError(`sources.${l}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof o.window.HTMLCanvasElement?this.options.canvas:o.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new o.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(l){this.map=l,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let l=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,l=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,l=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const n=this.map.painter.context;this.texture?(l||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new o.Texture(n,this.canvas,n.gl.RGBA,{premultiply:!0}),this._prepareData(n)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const l of[this.canvas.width,this.canvas.height])if(isNaN(l)||l<=0)return!0;return!1}},custom:class extends o.Evented{constructor(l,n,s,u){super(),this.id=l,this.type="custom",this._dataType="raster",this._dispatcher=s,this._implementation=n,this.setEventedParent(u),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new o.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new o.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new mn(this._implementation.bounds,this.minzoom,this.maxzoom)),n.update=this._update.bind(this),n.clearTiles=this._clearTiles.bind(this),n.coveringTiles=this._coveringTiles.bind(this),o.extend(this,o.pick(n,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileC
8acheSize"]))}serialize(){return o.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(l){this._map=l,this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(l),this.load()}onRemove(l){this._implementation.onRemove&&this._implementation.onRemove(l)}hasTile(l){if(this._implementation.hasTile){const{x:n,y:s,z:u}=l.canonical;return this._implementation.hasTile({x:n,y:s,z:u})}return!this.tileBounds||this.tileBounds.contains(l.canonical)}loadTile(l,n){const{x:s,y:u,z:d}=l.tileID.canonical,f=new o.window.AbortController;l.request=Promise.resolve(this._implementation.loadTile({x:s,y:u,z:d},{signal:f.signal})).then((function(g){return delete l.request,l.aborted?(l.state="unloaded",n(null)):g===void 0?(l.state="errored",n(null)):g===null?(this.loadTileData(l,{width:this.tileSize,height:this.tileSize,data:null}),l.state="loaded",n(null)):function(y){return y instanceof o.window.ImageData||y instanceof o.window.HTMLCanvasElement||y instanceof o.window.ImageBitmap||y instanceof o.window.HTMLImageElement}(g)?(this.loadTileData(l,g),l.state="loaded",void n(null)):(l.state="errored",n(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(g=>{g.code!==20&&(l.state="errored",n(g))}),l.request.cancel=()=>f.abort()}loadTileData(l,n){Ze.loadTileData(l,n,this._map.painter)}unloadTileData(l){Ze.unloadTileData(l,this._map.painter)}unloadTile(l,n){if(this.unloadTileData(l),this._implementation.unloadTile){const{x:s,y:u,z:d}=l.tileID.canonical;this._implementation.unloadTile({x:s,y:u,z:d})}n()}abortTile(l,n){l.request&&l.request.cancel&&(l.request.cancel(),delete l.request),n()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(l=>({x:l.canonical.x,y:l.canonical.y,z:l.canonical.z}))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"}))}}},jt=function(l,n,s,u){const d=new kt[n.type](l,n,s,u);if(d.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${d.id}`);return o.bindAll(["load","abort","unload","serialize","prepare"],d),d};function Yt(l,n){const s=o.identity([]);return o.scale(s,s,[.5*l.width,.5*-l.height,1]),o.translate(s,s,[1,-1,0]),o.multiply(s,s,l.calculateProjMatrix(n.toUnwrapped())),Float32Array.from(s)}function ki(l,n,s,u,d,f,g,y=!1){const w=l.tilesIn(u,g,y);w.sort(an);const M=[];for(const P of w)M.push({wrappedTileID:P.tile.tileID.wrapped().key,queryResults:P.tile.queryRenderedFeatures(n,s,l._state,P,d,f,Yt(l.transform,P.tile.tileID),y)});const I=function(P){const O={},N={};for(const G of P){const j=G.queryResults,q=G.wrappedTileID,z=N[q]=N[q]||{};for(const V in j){const H=j[V],K=z[V]=z[V]||{},re=O[V]=O[V]||[];for(const le of H)K[le.featureIndex]||(K[le.featureIndex]=!0,re.push(le))}}return O}(M);for(const P in I)I[P].forEach(O=>{const N=O.feature,G=N.layer;G&&G.type!=="background"&&G.type!=="sky"&&(N.source=G.source,G["source-layer"]&&(N.sourceLayer=G["source-layer"]),N.state=N.id!==void 0?l.getFeatureState(G["source-layer"],N.id):{})});return I}function Bi(l,n){const s=l.getRenderableIds().map(f=>l.getTileByID(f)),u=[],d={};for(let f=0;f<s.length;f++){const g=s[f],y=g.tileID.canonical.key;d[y]||(d[y]=!0,g.querySourceFeatures(u,n))}return u}function an(l,n){const s=l.tileID,u=n.tileID;return s.overscaledZ-u.overscaledZ||s.canonical.y-u.canonical.y||s.wrap-u.wrap||s.canonical.x-u.canonical.x}function Vi(){return ss.workerClass!=null?new ss.workerClass:new o.window.Worker(ss.workerUrl)}const Dn="mapboxgl_preloaded_worker_pool";class Ni{constructor(){this.active={}}acquire(n){if(!this.workers)for(this.workers=[];this.workers.length<Ni.workerCount;)this.workers.push(new Vi);return this.active[n]=!0,this.workers.slice()}release(n){delete this.active[n],this.numActive()===0&&(this.workers.forEac
vendor: 8,228 bytes, line 8
8h(s=>{s.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Dn]}numActive(){return Object.keys(this.active).length}}let rn;function oo(){return rn||(rn=new Ni),rn}function fl(l,n){const s={};for(const u in l)u!=="ref"&&(s[u]=l[u]);return o.refProperties.forEach(u=>{u in n&&(s[u]=n[u])}),s}function pa(l){l=l.slice();const n=Object.create(null);for(let s=0;s<l.length;s++)n[l[s].id]=l[s];for(let s=0;s<l.length;s++)"ref"in l[s]&&(l[s]=fl(l[s],n[l[s].ref]));return l}Ni.workerCount=2;const ri={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setProjection:"setProjection"};function bs(l,n,s){s.push({command:ri.addSource,args:[l,n[l]]})}function Eo(l,n,s){n.push({command:ri.removeSource,args:[l]}),s[l]=!0}function ae(l,n,s,u){Eo(l,s,u),bs(l,n,s)}function Mt(l,n,s){let u;for(u in l[s])if(l[s].hasOwnProperty(u)&&u!=="data"&&!U(l[s][u],n[s][u]))return!1;for(u in n[s])if(n[s].hasOwnProperty(u)&&u!=="data"&&!U(l[s][u],n[s][u]))return!1;return!0}function ei(l,n,s,u,d,f){let g;for(g in n=n||{},l=l||{})l.hasOwnProperty(g)&&(U(l[g],n[g])||s.push({command:f,args:[u,g,n[g],d]}));for(g in n)n.hasOwnProperty(g)&&!l.hasOwnProperty(g)&&(U(l[g],n[g])||s.push({command:f,args:[u,g,n[g],d]}))}function ji(l){return l.id}function lr(l,n){return l[n.id]=n,l}class Zn{constructor(n,s){this.reset(n,s)}reset(n,s){this.points=n||[],this._distances=[0];for(let u=1;u<this.points.length;u++)this._distances[u]=this._distances[u-1]+this.points[u].dist(this.points[u-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(s||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(n){if(this.points.length===1)return this.points[0];n=o.clamp(n,0,1);let s=1,u=this._distances[s];const d=n*this.paddedLength+this.padding;for(;u<d&&s<this._distances.length;)u=this._distances[++s];const f=s-1,g=this._distances[f],y=u-g,w=y>0?(d-g)/y:0;return this.points[f].mult(1-w).add(this.points[s].mult(w))}}class So{constructor(n,s,u){const d=this.boxCells=[],f=this.circleCells=[];this.xCellCount=Math.ceil(n/u),this.yCellCount=Math.ceil(s/u);for(let g=0;g<this.xCellCount*this.yCellCount;g++)d.push([]),f.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=n,this.height=s,this.xScale=this.xCellCount/n,this.yScale=this.yCellCount/s,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(n,s,u,d,f){this._forEachCell(s,u,d,f,this._insertBoxCell,this.boxUid++),this.boxKeys.push(n),this.bboxes.push(s),this.bboxes.push(u),this.bboxes.push(d),this.bboxes.push(f)}insertCircle(n,s,u,d){this._forEachCell(s-d,u-d,s+d,u+d,this._insertCircleCell,this.circleUid++),this.circleKeys.push(n),this.circles.push(s),this.circles.push(u),this.circles.push(d)}_insertBoxCell(n,s,u,d,f,g){this.boxCells[f].push(g)}_insertCircleCell(n,s,u,d,f,g){this.circleCells[f].push(g)}_query(n,s,u,d,f,g){if(u<0||n>this.width||d<0||s>this.height)return!f&&[];const y=[];if(n<=0&&s<=0&&this.width<=u&&this.height<=d){if(f)return!0;for(let w=0;w<this.boxKeys.length;w++)y.push({key:this.boxKeys[w],x1:this.bboxes[4*w],y1:this.bboxes[4*w+1],x2:this.bboxes[4*w+2],y2:this.bboxes[4*w+3]});for(let w=0;w<this.circleKeys.length;w++){const M=this.circles[3*w],I=this.circles[3*w+1],P=this.circles[3*w+2];y.push({key:this.circleKeys[w],x1:M-P,y1:I-P,x2:M+P,y2:I+P})}return g?y.filter(g):y}return this._forEachCell(n,s,u,d,this._queryCell,y,{hitTest:f,seenUids:{box:{},circle:{}}},g),f?y.length>0:y}_queryCircle(n,s,u,d,f){const g=n-u,y=n+u,w=s-u,M=s+u;if(y<0||g>this.width||M<0||w>this.height)return!d&&[];const I=[];return this._forEachCell(g,w,y,M,this._queryCellCircle,I,{hitTest:d,circle:{x:n,y:s,radius:u},seenUids:{box:{},circle:{}}},f),d?I.length>0:I}query(n,s,u,d,f){return this._query(n,s,u,d,!1,f)}hitTest(n,s,u,d,f){return this._query(n,s,u,d,!0,f)}hitTestCircle(n,s,u,d){return this._queryCircle(n,s,u,!0,d)}_queryCell(n,s,u,d,f,g,y,w){const M=y.seenUids,I=this.boxCells[f];if(I!==null){const O=this.bboxes;for(const N of I)if(!M.box[N]){M.box[N]=!0;const G=4*N;if(n<=O[G+2]&&s<=O[G+3]&&u>=O[G+0]&&d>=O[G+1]&&(!w||w(this.boxKeys[N]))){if(y.hitTest)return g.push(!0),!0;g.push({key:this.boxKeys[N],x1:O[G],y1:O[G+1],x2:O[G+2],y2:O[G+3]})}}}const P=this.circleCells[f];if(P!==null){const O=this.circles;for(const N of P)if(!M.circle[N]){M.circle[N]=!0;const G=3*N;if(this._circleAndRectCollide(O[G],O[G+1],O[G+2],n,s,u,d)&&(!w||w(this.circleKeys[N]))){if(y.hitTest)return g.push(!0),!0;{const j=O[G],q=O[G+1],z=O[G+2];g.push({key:this.circleKeys[N],x1:j-z,y1:q-z,x2:j+z,y2:q+z})}}}}}_queryCellCircle(n,s,u,d,f,g,y,w){const M=y.circle,I=y.seenUids,P=this.boxCells[f];if(P!==null){const N=this.bboxes;for(const G of P)if(!I.box[G]){I.box[G]=!0;const j=4*G;if(this._circleAndRectCollide(M.x,M.y,M.radius,N[j+0],N[j+1],N[j+2],N[j+3])&&(!w||w(this.boxKeys[G])))return g.push(!0),!0}}const O=this.circleCells[f];if(O!==null){const N=this.circles;for(const G of O)if(!I.circle[G]){I.circle[G]=!0;const j=3*G;if(this._circlesCollide(N[j],N[j+1],N[j+2],M.x,M.y,M.radius)&&(!w||w(this.circleKeys[G])))return g.push(!0),!0}}}_forEachCell(n,s,u,d,f,g,y,w){const M=this._convertToXCellCoord(n),I=this._convertToYCellCoord(s),P=this._convertToXCellCoord(u),O=this._convertToYCellCoord(d);for(let N=M;N<=P;N++)for(let G=I;G<=O;G++)if(f.call(this,n,s,u,d,this.xCellCount*G+N,g,y,w))return}_convertToXCellCoord(n){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(n*this.xScale)))}_convertToYCellCoord(n){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(n*this.yScale)))}_circlesCollide(n,s,u,d,f,g){const y=d-n,w=f-s,M=u+g;return M*M>y*y+w*w}_circleAndRectCollide(n,s,u,d,f,g,y){const w=(g-d)/2,M=Math.abs(n-(d+w));if(M>w+u)return!1;const I=(y-f)/2,P=Math.abs(s-(f+I));if(P>I+u)return!1;if(M<=w||P<=I)return!0;const O=M-w,N=P-I;return O*O+N*N<=u*u}}const Or={unknown:0,flipRequired:1,flipNotRequired:2},ws=Math.tan(85*Math.PI/180);function Ce(l,n,s,u,d,f,g){const y=o.create();if(s)if(f.name==="globe"){const w=o.calculateGlobeLabelMatrix(d,n);o.multiply(y,y,w)}else{const w=Re([],g);y[0]=w[0],y[1]=w[1],y[4]=w[2],y[5]=w[3],u||o.rotateZ(y,y,d.angle)}else o.multiply(y,d.labelPlaneMatrix,l);return y}function Fr(l,n,s,u,d,f,g){const y=Ce(l,n,s,u,d,f,g);return f.name==="globe"&&s||(y[2]=y[6]=y[10]=y[14]=0),y}function qi(l,n,s,u,d,f,g){if(s){if(f.name==="globe"){const y=Ce(l,n,s,u,d,f,g);return o.invert(y,y),o.multiply(y,l,y),y}{const y=o.clone(l),w=o.identity([]);return w[0]=g[0],w[1]=g[1],w[4]=g[2],w[5]=g[3],o.multiply(y,y,w),u||o.rotateZ(y,y,-d.angle),y}}return d.glCoordMatrix}function ln(l,n,s,u){const d=[l,n,s,1];s?o.transformMat4$1(d,d,u):Xt(d,d,u);const f=d[3];return d[0]/=f,d[1]/=f,d[2]/=f,d}function Yc(l,n){return Math.min(.5+l/n*.5,1.5)}function vr(l,n){const s=l[0]/l[3],u=l[1]/l[3];return s>=-n[0]&&s<=n[0]&&u>=-n[1]&&u<=n[1]}function ml(l,n,s,u,d,f,g,y,w,M){const I=s.transform,P=u?l.textSizeData:l.iconSizeData,O=o.evaluateSizeForZoom(P,s.transform.zoom),N=I.projection.name==="globe",G=[256/s.width*2+1,256/s.height*2+1],j=u?l.text.dynamicLayoutVertexArray:l.icon.dynamicLayoutVertexArray;j.clear();let q=null;N&&(q=u?l.text.globeExtVertexArray:l.icon.globeExtVertexArray);const z=l.lineVertexArray,V=u?l.text.placedSymbolArray:l.icon.placedSymbolArray,H=s.transform.width/s.transform.height;let K,re=!1;for(let le=0;le<V.length;le++){const oe=V.get(le),{numGlyphs:fe,writingMode:pe}=oe;if(pe!==o.WritingMode.vertical||re||K===o.WritingMode.horizontal||(re=!0),K=pe,(oe.hidden||pe===o.WritingMode.vertical)&&!re){cr(fe,j);continue}re=!1;const ve=new o.Point(oe.tileAnchorX,oe.tileAnchorY);let{x:Ne,y:ge,z:Le}=I.projection.projectTilePoint(ve.x,ve.y,M.canonical);if(w){const[Pt,ut,wt]=w(ve);Ne+=Pt,ge+=ut,Le+=wt}const Te=[Ne,ge,Le,1];
8if(o.transformMat4$1(Te,Te,n),!vr(Te,G)){cr(fe,j);continue}const Ve=Yc(s.transform.cameraToCenterDistance,Te[3]),xe=o.evaluateSizeForFeature(P,O,oe),ze=g?xe/Ve:xe*Ve,Ge=ln(Ne,ge,Le,d);if(Ge[3]<=0){cr(fe,j);continue}let Fe={};const qe=g?null:w,pt=ot(oe,ze,!1,y,n,d,f,l.glyphOffsetArray,z,j,q,Ge,ve,Fe,H,qe,I.projection,M,g);re=pt.useVertical,qe&&pt.needsFlipping&&(Fe={}),(pt.notEnoughRoom||re||pt.needsFlipping&&ot(oe,ze,!0,y,n,d,f,l.glyphOffsetArray,z,j,q,Ge,ve,Fe,H,qe,I.projection,M,g).notEnoughRoom)&&cr(fe,j)}u?(l.text.dynamicLayoutVertexBuffer.updateData(j),q&&l.text.globeExtVertexBuffer.updateData(q)):(l.icon.dynamicLayoutVertexBuffer.updateData(j),q&&l.icon.globeExtVertexBuffer.updateData(q))}function Jc(l,n,s,u,d,f,g,y,w,M,I,P,O,N,G,j){const{lineStartIndex:q,glyphStartIndex:z,segment:V}=y,H=z+y.numGlyphs,K=q+y.lineLength,re=n.getoffsetX(z),le=n.getoffsetX(H-1),oe=qn(l*re,s,u,d,f,g,V,q,K,w,M,I,P,O,!0,N,G,j);if(!oe)return null;const fe=qn(l*le,s,u,d,f,g,V,q,K,w,M,I,P,O,!0,N,G,j);return fe?{first:oe,last:fe}:null}function Go(l,n,s,u){return l===o.WritingMode.horizontal&&Math.abs(u)>Math.abs(s)?{useVertical:!0}:l===o.WritingMode.vertical?u>0?{needsFlipping:!0}:null:n!==Or.unknown&&function(d,f){return d===0||Math.abs(f/d)>ws}(s,u)?n===Or.flipRequired?{needsFlipping:!0}:null:s<0?{needsFlipping:!0}:null}function ot(l,n,s,u,d,f,g,y,w,M,I,P,O,N,G,j,q,z,V){const H=n/24,K=l.lineOffsetX*H,re=l.lineOffsetY*H,{lineStartIndex:le,glyphStartIndex:oe,numGlyphs:fe,segment:pe,writingMode:ve,flipState:Ne}=l,ge=le+l.lineLength,Le=Te=>{if(I){const[Ge,Fe,qe]=Te.up,pt=M.length;o.updateGlobeVertexNormal(I,pt+0,Ge,Fe,qe),o.updateGlobeVertexNormal(I,pt+1,Ge,Fe,qe),o.updateGlobeVertexNormal(I,pt+2,Ge,Fe,qe),o.updateGlobeVertexNormal(I,pt+3,Ge,Fe,qe)}const[Ve,xe,ze]=Te.point;o.addDynamicAttributes(M,Ve,xe,ze,Te.angle)};if(fe>1){const Te=Jc(H,y,K,re,s,P,O,l,w,f,N,j,!1,q,z,V);if(!Te)return{notEnoughRoom:!0};if(u&&!s){let[Ve,xe,ze]=Te.first.point,[Ge,Fe,qe]=Te.last.point;[Ve,xe]=ln(Ve,xe,ze,g),[Ge,Fe]=ln(Ge,Fe,qe,g);const pt=Go(ve,Ne,(Ge-Ve)*G,Fe-xe);if(l.flipState=pt&&pt.needsFlipping?Or.flipRequired:Or.flipNotRequired,pt)return pt}Le(Te.first);for(let Ve=oe+1;Ve<oe+fe-1;Ve++){const xe=qn(H*y.getoffsetX(Ve),K,re,s,P,O,pe,le,ge,w,f,N,j,!1,!1,q,z,V);if(!xe)return M.length-=4*(Ve-oe),{notEnoughRoom:!0};Le(xe)}Le(Te.last)}else{if(u&&!s){const Ve=ln(O.x,O.y,0,d),xe=le+pe+1,ze=new o.Point(w.getx(xe),w.gety(xe)),Ge=ln(ze.x,ze.y,0,d),Fe=Ge[3]>0?Ge:Wt(O,ze,Ve,1,d,void 0,q,z.canonical),qe=Go(ve,Ne,(Fe[0]-Ve[0])*G,Fe[1]-Ve[1]);if(l.flipState=qe&&qe.needsFlipping?Or.flipRequired:Or.flipNotRequired,qe)return qe}const Te=qn(H*y.getoffsetX(oe),K,re,s,P,O,pe,le,ge,w,f,N,j,!1,!1,q,z,V);if(!Te)return{notEnoughRoom:!0};Le(Te)}return{}}function Jt(l,n,s,u,d){const{x:f,y:g,z:y}=u.projectTilePoint(l.x,l.y,n);if(!d)return ln(f,g,y,s);const[w,M,I]=d(l);return ln(f+w,g+M,y+I,s)}function Wt(l,n,s,u,d,f,g,y){const w=Jt(l.sub(n)._unit()._add(l),y,d,g,f);return o.sub(w,s,w),o.normalize(w,w),o.scaleAndAdd(w,s,w,u)}function qn(l,n,s,u,d,f,g,y,w,M,I,P,O,N,G,j,q,z){const V=u?l-n:l+n;let H=V>0?1:-1,K=0;u&&(H*=-1,K=Math.PI),H<0&&(K+=Math.PI);let re=y+g+(H>0?0:1)|0,le=d,oe=d,fe=0,pe=0;const ve=Math.abs(V),Ne=[],ge=[];let Le=f,Te=Le;const Ve=()=>Wt(Te,Le,oe,ve-fe+1,I,O,j,q.canonical);for(;fe+pe<=ve;){if(re+=H,re<y||re>=w)return null;if(oe=le,Te=Le,Ne.push(oe),N&&ge.push(Te),Le=new o.Point(M.getx(re),M.gety(re)),le=P[re],!le){const wt=Jt(Le,q.canonical,I,j,O);le=wt[3]>0?P[re]=wt:Ve()}fe+=pe,pe=o.distance(oe,le)}G&&O&&(P[re]&&(le=Ve(),pe=o.distance(oe,le)),P[re]=le);const xe=(ve-fe)/pe,ze=Le.sub(Te)._mult(xe)._add(Te),Ge=o.sub([],le,oe),Fe=o.scaleAndAdd([],oe,Ge,xe);let qe=[0,0,1],pt=Ge[0],Pt=Ge[1];if(z&&(qe=j.upVector(q.canonical,ze.x,ze.y),qe[0]!==0||qe[1]!==0||qe[2]!==1)){const wt=[qe[2],0,-qe[0]],Ht=o.cross([],qe,wt);o.normalize(wt,wt),o.normalize(Ht,Ht),pt=o.dot(Ge,wt),Pt=o.dot(Ge,Ht)}if(s){const wt=o.cross([],qe,Ge);o.normalize(wt,wt),o.scaleAndAdd(Fe,Fe,wt,s*H)}const ut=K+Math.atan2(Pt,pt);return Ne.push(Fe),N&&ge.push(ze),{point:Fe,angle:ut,path:Ne,tilePath:ge,up:qe}}function cr(l,n){const s=n.length,u=s+4*l;n.resize(u),n.float32.fill(-1/0,4*s,4*u)}function Xt(l,n,s){const u=n[0],d=n[1];return l[0]=s[0]*u+s[4]*d+s[12],l[1]=s[1]*u+s[5]*d+s[13],l[3]=s[3]*u+s[7]*d+s[15],l}const Wn=100;class Ts{constructor(n,s,u=new So(n.width+200,n.height+200,25),d=new So(n.width+200,n.height+200,25)){this.transform=n,this.grid=u,this.ignoredGrid=d,this.pitchfactor=Math.cos(n._pitch)*n.cameraToCenterDistance,this.screenRightBoundary=n.width+Wn,this.screenBottomBoundary=n.height+Wn,this.gridRightBoundary=n.width+200,this.gridBottomBoundary=n.height+200,this.fogState=s}placeCollisionBox(n,s,u,d,f,g,y,w){let M=u.projectedAnchorX,I=u.projectedAnchorY,P=u.projectedAnchorZ;const O=u.elevation,N=u.tileID,G=n.getProjection();if(O&&N){const[le,oe,fe]=G.upVector(N.canonical,u.tileAnchorX,u.tileAnchorY),pe=G.upVectorScale(N.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;M+=le*O*pe,I+=oe*O*pe,P+=fe*O*pe}const j=this.projectAndGetPerspectiveRatio(y,M,I,P,u.tileID,G.name==="globe"||!!O||this.transform.pitch>0,G),q=g*j.perspectiveRatio,z=(u.x1*s+d.x-u.padding)*q+j.point.x,V=(u.y1*s+d.y-u.padding)*q+j.point.y,H=(u.x2*s+d.x+u.padding)*q+j.point.x,K=(u.y2*s+d.y+u.padding)*q+j.point.y,re=j.perspectiveRatio<=.55||j.occluded;return!this.isInsideGrid(z,V,H,K)||!f&&this.grid.hitTest(z,V,H,K,w)||re?{box:[],offscreen:!1,occluded:j.occluded}:{box:[z,V,H,K],offscreen:this.isOffscreen(z,V,H,K),occluded:!1}}placeCollisionCircles(n,s,u,d,f,g,y,w,M,I,P,O,N,G,j){const q=[],z=this.transform.elevation,V=n.getProjection(),H=z?z.getAtTileOffsetFunc(j,this.transform.center.lat,this.transform.worldSize,V):null,K=new o.Point(u.tileAnchorX,u.tileAnchorY);let{x:re,y:le,z:oe}=V.projectTilePoint(K.x,K.y,j.canonical);if(H){const[ze,Ge,Fe]=H(K);re+=ze,le+=Ge,oe+=Fe}const fe=V.name==="globe",pe=this.projectAndGetPerspectiveRatio(y,re,le,oe,j,fe||!!z||this.transform.pitch>0,V),{perspectiveRatio:ve}=pe,Ne=(P?g/ve:g*ve)/o.ONE_EM,ge=ln(re,le,oe,w),Le=pe.signedDistanceFromCamera>0?Jc(Ne,f,u.lineOffsetX*Ne,u.lineOffsetY*Ne,!1,ge,K,u,d,w,{},z&&!P?H:null,P&&!!z,V,j,P):null;let Te=!1,Ve=!1,xe=!0;
vendor: 5,593 bytes, line 8
8if(Le&&!pe.occluded){const ze=.5*N*ve+G,Ge=new o.Point(-100,-100),Fe=new o.Point(this.screenRightBoundary,this.screenBottomBoundary),qe=new Zn,{first:pt,last:Pt}=Le,ut=pt.path.length;let wt=[];for(let dt=ut-1;dt>=1;dt--)wt.push(pt.path[dt]);for(let dt=1;dt<Pt.path.length;dt++)wt.push(Pt.path[dt]);const Ht=2.5*ze;M&&(wt=wt.map(([dt,di,fi],mi)=>(H&&!fe&&(fi=H(mi<ut-1?pt.tilePath[ut-1-mi]:Pt.tilePath[mi-ut+2])[2]),ln(dt,di,fi,M))),wt.some(dt=>dt[3]<=0)&&(wt=[]));let Zt=[];if(wt.length>0){let dt=1/0,di=-1/0,fi=1/0,mi=-1/0;for(const _i of wt)dt=Math.min(dt,_i[0]),fi=Math.min(fi,_i[1]),di=Math.max(di,_i[0]),mi=Math.max(mi,_i[1]);di>=Ge.x&&dt<=Fe.x&&mi>=Ge.y&&fi<=Fe.y&&(Zt=[wt.map(_i=>new o.Point(_i[0],_i[1]))],(dt<Ge.x||di>Fe.x||fi<Ge.y||mi>Fe.y)&&(Zt=o.clipLine(Zt,Ge.x,Ge.y,Fe.x,Fe.y)))}for(const dt of Zt){qe.reset(dt,.25*ze);let di=0;di=qe.length<=.5*ze?1:Math.ceil(qe.paddedLength/Ht)+1;for(let fi=0;fi<di;fi++){const mi=fi/Math.max(di-1,1),_i=qe.lerp(mi),Mn=_i.x+Wn,un=_i.y+Wn;q.push(Mn,un,ze,0);const er=Mn-ze,Er=un-ze,Li=Mn+ze,gi=un+ze;if(xe=xe&&this.isOffscreen(er,Er,Li,gi),Ve=Ve||this.isInsideGrid(er,Er,Li,gi),!s&&this.grid.hitTestCircle(Mn,un,ze,O)&&(Te=!0,!I))return{circles:[],offscreen:!1,collisionDetected:Te,occluded:!1}}}}return{circles:!I&&Te||!Ve?[]:q,offscreen:xe,collisionDetected:Te,occluded:pe.occluded}}queryRenderedSymbols(n){if(n.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const s=[];let u=1/0,d=1/0,f=-1/0,g=-1/0;for(const I of n){const P=new o.Point(I.x+Wn,I.y+Wn);u=Math.min(u,P.x),d=Math.min(d,P.y),f=Math.max(f,P.x),g=Math.max(g,P.y),s.push(P)}const y=this.grid.query(u,d,f,g).concat(this.ignoredGrid.query(u,d,f,g)),w={},M={};for(const I of y){const P=I.key;if(w[P.bucketInstanceId]===void 0&&(w[P.bucketInstanceId]={}),w[P.bucketInstanceId][P.featureIndex])continue;const O=[new o.Point(I.x1,I.y1),new o.Point(I.x2,I.y1),new o.Point(I.x2,I.y2),new o.Point(I.x1,I.y2)];o.polygonIntersectsPolygon(s,O)&&(w[P.bucketInstanceId][P.featureIndex]=!0,M[P.bucketInstanceId]===void 0&&(M[P.bucketInstanceId]=[]),M[P.bucketInstanceId].push(P.featureIndex))}return M}insertCollisionBox(n,s,u,d,f){(s?this.ignoredGrid:this.grid).insert({bucketInstanceId:u,featureIndex:d,collisionGroupID:f},n[0],n[1],n[2],n[3])}insertCollisionCircles(n,s,u,d,f){const g=s?this.ignoredGrid:this.grid,y={bucketInstanceId:u,featureIndex:d,collisionGroupID:f};for(let w=0;w<n.length;w+=4)g.insertCircle(y,n[w],n[w+1],n[w+2])}projectAndGetPerspectiveRatio(n,s,u,d,f,g,y){const w=[s,u,d,1];let M=!1;d||this.transform.pitch>0?(o.transformMat4$1(w,w,n),this.fogState&&f&&y.name!=="globe"&&(M=function(O,N,G,j,q,z){const V=z.calculateFogTileMatrix(q),H=[N,G,j];return o.transformMat4(H,H,V),Tt(O,H,z.pitch,z._fov)}(this.fogState,s,u,d,f.toUnwrapped(),this.transform)>.9)):Xt(w,w,n);const I=w[3];return{point:new o.Point((w[0]/I+1)/2*this.transform.width+Wn,(-w[1]/I+1)/2*this.transform.height+Wn),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(y)/I*.5,1.5),signedDistanceFromCamera:I,occluded:g&&w[2]>I||M}}isOffscreen(n,s,u,d){return u<Wn||n>=this.screenRightBoundary||d<Wn||s>this.screenBottomBoundary}isInsideGrid(n,s,u,d){return u>=0&&n<this.gridRightBoundary&&d>=0&&s<this.gridBottomBoundary}getViewportMatrix(){const n=o.identity([]);return o.translate(n,n,[-100,-100,0]),n}}function Io(l,n,s){const u=n.createTileMatrix(l,l.worldSize,s.toUnwrapped());return o.multiply(new Float32Array(16),l.projMatrix,u)}function Yn(l,n,s){if(n.projection.name===s.projection.name)return l.projMatrix;const u=s.clone();return u.setProjection(n.projection),Io(u,n.getProjection(),l)}function zi(l,n,s){return n.name===s.projection.name?l.projMatrix:Io(s,n,l)}class Qc{constructor(n,s,u,d){this.opacity=n?Math.max(0,Math.min(1,n.opacity+(n.placed?s:-s))):d&&u?1:0,this.placed=u}isHidden(){return this.opacity===0&&!this.placed}}class Ur{constructor(n,s,u,d,f,g=!1){this.text=new Qc(n?n.text:null,s,u,f),this.icon=new Qc(n?n.icon:null,s,d,f),this.clipped=g}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Es{constructor(n,s,u,d=!1){this.text=n,this.icon=s,this.skipFade=u,this.clipped=d}}class Ss{constructor(){this.invProjMatrix=o.create(),this.viewportMatrix=o.create(),this.circles=[]}}class _l{constructor(n,s,u,d,f){this.bucketInstanceId=n,this.featureIndex=s,this.sourceLayerIndex=u,this.bucketIndex=d,this.tileID=f}}class $c{constructor(n){this.crossSourceCollisions=n,this.maxGroupID=0,this.collisionGroups={}}get(n){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[n]){const s=++this.maxGroupID;this.collisionGroups[n]={ID:s,predicate:u=>u.collisionGroupID===s}}return this.collisionGroups[n]}}function Is(l,n,s,u,d){const{horizontalAlign:f,verticalAlign:g}=o.getAnchorAlignment(l),y=-(f-.5)*n,w=-(g-.5)*s,M=o.evaluateVariableOffset(l,u);return new o.Point(y+M[0]*d,w+M[1]*d)}function Ms(l,n,s,u,d){const f=new o.Point(l,n);return s&&f._rotate(u?d:-d),f}class fa{constructor(n,s,u,d,f){this.transform=n.clone(),this.projection=n.projection.name,this.collisionIndex=new Ts(this.transform,f),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=s,this.retainedQueryData={},this.collisionGroups=new $c(u),this.collisionCircleArrays={},this.prevPlacement=d,d&&(d.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(n,s,u,d){const f=u.getBucket(s),g=u.latestFeatureIndex;if(!f||!g||s.id!==f.layerIds[0])return;const y=f.layers[0].layout,w=u.collisionBoxArray,M=Math.pow(2,this.transform.zoom-u.tileID.overscaledZ
8),I=u.tileSize/o.EXTENT,P=u.tileID.toUnwrapped();this.transform.setProjection(f.projection);const O=(N=u.tileID,G=f.getProjection(),j=this.transform,G.name===this.projection?j.calculateProjMatrix(N.toUnwrapped()):Io(j,G,N));var N,G,j;const q=y.get("text-pitch-alignment")==="map",z=y.get("text-rotation-alignment")==="map";s.compileFilter();const V=s.dynamicFilter(),H=s.dynamicFilterNeedsFeature(),K=this.transform.calculatePixelsToTileUnitsMatrix(u),re=Fr(O,u.tileID.canonical,q,z,this.transform,f.getProjection(),K);let le=null;if(q){const pe=qi(O,u.tileID.canonical,q,z,this.transform,f.getProjection(),K);le=o.multiply([],this.transform.labelPlaneMatrix,pe)}let oe=null;V&&u.latestFeatureIndex&&(oe={unwrappedTileID:P,dynamicFilter:V,dynamicFilterNeedsFeature:H,featureIndex:u.latestFeatureIndex}),this.retainedQueryData[f.bucketInstanceId]=new _l(f.bucketInstanceId,g,f.sourceLayerIndex,f.index,u.tileID);const fe={bucket:f,layout:y,posMatrix:O,textLabelPlaneMatrix:re,labelToScreenMatrix:le,clippingData:oe,scale:M,textPixelRatio:I,holdingForFade:u.holdingForFade(),collisionBoxArray:w,partiallyEvaluatedTextSize:o.evaluateSizeForZoom(f.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:o.evaluateSizeForZoom(f.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(f.sourceID)};if(d)for(const pe of f.sortKeyRanges){const{sortKey:ve,symbolInstanceStart:Ne,symbolInstanceEnd:ge}=pe;n.push({sortKey:ve,symbolInstanceStart:Ne,symbolInstanceEnd:ge,parameters:fe})}else n.push({symbolInstanceStart:0,symbolInstanceEnd:f.symbolInstances.length,parameters:fe})}attemptAnchorPlacement(n,s,u,d,f,g,y,w,M,I,P,O,N,G,j,q,z,V){const{textOffset0:H,textOffset1:K,crossTileID:re}=O,le=[H,K],oe=Is(n,u,d,le,f),fe=this.collisionIndex.placeCollisionBox(G,f,s,Ms(oe.x,oe.y,g,y,this.transform.angle),P,w,M,I.predicate);if(q){const pe=G.getSymbolInstanceIconSize(V,this.transform.zoom,O.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(G,pe,q,Ms(oe.x,oe.y,g,y,this.transform.angle),P,w,M,I.predicate).box.length===0)return}if(fe.box.length>0){let pe;return this.prevPlacement&&this.prevPlacement.variableOffsets[re]&&this.prevPlacement.placements[re]&&this.prevPlacement.placements[re].text&&(pe=this.prevPlacement.variableOffsets[re].anchor),this.variableOffsets[re]={textOffset:le,width:u,height:d,anchor:n,textScale:f,prevAnchor:pe},this.markUsedJustification(G,n,O,j),G.allowVerticalPlacement&&(this.markUsedOrientation(G,j,O),this.placedOrientations[re]=j),{shift:oe,placedGlyphBoxes:fe}}}placeLayerBucketPart(n,s,u,d){const{bucket:f,layout:g,posMatrix:y,textLabelPlaneMatrix:w,labelToScreenMatrix:M,clippingData:I,textPixelRatio:P,holdingForFade:O,collisionBoxArray:N,partiallyEvaluatedTextSize:G,partiallyEvaluatedIconSize:j,collisionGroup:q}=n.parameters,z=g.get("text-optional"),V=g.get("icon-optional"),H=g.get("text-allow-overlap"),K=g.get("icon-allow-overlap"),re=g.get("text-rotation-alignment")==="map",le=g.get("text-pitch-alignment")==="map",oe=g.get("icon-text-fit")!=="none",fe=g.get("symbol-z-order")==="viewport-y";this.transform.setProjection(f.projection);let pe=H&&(K||!f.hasIconData()||V),ve=K&&(H||!f.hasTextData()||z);!f.collisionArrays&&N&&f.deserializeCollisionBoxes(N),u&&d&&f.updateCollisionDebugBuffers(this.transform.zoom,N);const Ne=(ge,Le,Te)=>{const{crossTileID:Ve,numVerticalGlyphVertices:xe}=ge;if(I){const Li={zoom:this.transform.zoom,pitch:this.transform.pitch};let gi=null;if(I.dynamicFilterNeedsFeature){const li=this.retainedQueryData[f.bucketInstanceId];gi=I.featureIndex.loadFeature({featureIndex:ge.featureIndex,bucketIndex:li.bucketIndex,sourceLayerIndex:li.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,I.dynamicFilter)(Li,gi,this.retainedQueryData[f.bucketInstanceId].tileID.canonical,new o.Point(ge.tileAnchorX,ge.tileAnchorY),this.transform.calculateDistanceTileData(I.unwrappedTileID)))return this.placements[Ve]=new Es(!1,!1,!1,!0),void s.add(Ve)}if(s.has(Ve))return;if(O)return void(this.placements[Ve]=new Es(!1,!1,!1));let ze=!1,Ge=!1,Fe=!0,qe=!1,pt=!1,Pt=null,ut={box:null,offscreen:null,occluded:null},wt={box:null,offscreen:null,occluded:null},Ht=null,Zt=null,dt=null,di=0,fi=0,mi=0;Te.textFeatureIndex?di=Te.textFeatureIndex:ge.useRuntimeCollisionCircles&&(di=ge.featureIndex),Te.verticalTextFeatureIndex&&(fi=Te.verticalTextFeatureIndex);const _i=Li=>{Li.tileID=this.retainedQueryData[f.bucketInstanceId].tileID;const gi=this.transform.elevation;(gi||Li.elevation)&&(Li.elevation=gi?gi.getAtTileOffset(Li.tileID,Li.tileAnchorX,Li.tileAnchorY):0)},Mn=Te.textBox;if(Mn){_i(Mn);const Li=li=>{let Wi=o.WritingMode.horizontal;if(f.allowVerticalPlacement&&!li&&this.prevPlacement){const zn=this.prevPlacement.placedOrientations[Ve];zn&&(this.placedOrientations[Ve]=zn,Wi=zn,this.markUsedOrientation(f,Wi,ge))}return Wi},gi=(li,Wi)=>{if(f.allowVerticalPlacement&&xe>0&&Te.verticalTextBox){for(const zn of f.writingModes)if(zn===o.WritingMode.vertical?(ut=Wi(),wt=ut):ut=li(),ut&&ut.box&&ut.box.length)break}else ut=li()};if(g.get("text-variable-anchor")){let li=g.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Ve]){const Pi=this.prevPlacement.variableOffsets[Ve];li.indexOf(Pi.anchor)>0&&(li=li.filter(On=>On!==Pi.anchor),li.unshift(Pi.anchor))}const Wi=(Pi,On,Na)=>{const Do=f.getSymbolInstanceTextSize(G,ge,this.transform.zoom,Le),Xs=(Pi.x2-Pi.x1)*Do+2*Pi.padding,Wr=(Pi.y2-Pi.y1)*Do+2*Pi.padding,lo=oe&&!K?On:null;lo&&_i(lo);let Ro={box:[],offscreen:!1,occluded:!1};const ja=H?2*li.length:li.length;for(let Hs=0;Hs<ja;++Hs){const sc=this.attemptAnchorPlacement(li[Hs%li.length],Pi,Xs,Wr,Do,re,le,P,y,q,Hs>=li.length,ge,Le,f,Na,lo,G,j);if(sc&&(Ro=sc.placedGlyphBoxes,Ro&&Ro.box&&Ro.box.length)){ze=!0,Pt=sc.shift;break}}return Ro};gi(()=>Wi(Mn,Te.iconBox,o.WritingMode.horizontal),()=>{const Pi=Te.verticalTextBox;return Pi&&_i(Pi),f.allowVerticalPlacement&&!(ut&&ut.box&&ut.box.length)&&xe>0&&Pi?Wi(Pi,Te.verticalIconBox,o.WritingMode.vertical):{box:null,offscreen:null,occluded:null}}),ut&&(ze=ut.box,Fe=ut.offscreen,qe=ut.occluded);const zn=Li(!(!ut||!ut.box));if(!ze&&this.prevPlacement){const Pi=this.prevPlacement.variableOffsets[Ve];Pi&&(this.variableOffsets[Ve]=Pi,this.markUsedJustification(f,Pi.anchor,ge,zn))}}else{const li=(Wi,zn)=>{const Pi=f.getSymbolInstanceTextSize(G,ge,this.transform.zoom,Le),On=this.collisionIndex.placeCollisionBox(f,Pi,Wi,new o.Point(0,0),H,P,y,q.predicate);return On&&On.box&&On.box.length&&(this.markUsedOrientation(f,zn,ge),this.placedOrientations[Ve]=zn),On};gi(()=>li(Mn,o.WritingMode.horizontal),()=>{const Wi=Te.verticalTextBox;return f.allowVerticalPlacement&&xe>0&&Wi?(_i(Wi),li(Wi,o.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}}),Li(!!(ut&&ut.box&&ut.box.length))}}if(Ht=ut,ze=Ht&&Ht.box&&Ht.box.length>0,Fe=Ht&&Ht.offscreen,qe=Ht&&Ht.occluded,ge.useRuntimeCollisionCircles){const Li=f.text.placedSymbolArray.get(ge.centerJustifiedTextSymbolIndex>=0?ge.centerJustifiedTextSymbolIndex:ge.verticalPlacedTextSymbolIndex),gi=o.evaluateSizeForFeature
vendor: 4,937 bytes, line 8
8(f.textSizeData,G,Li),li=g.get("text-padding");Zt=this.collisionIndex.placeCollisionCircles(f,H,Li,f.lineVertexArray,f.glyphOffsetArray,gi,y,w,M,u,le,q.predicate,ge.collisionCircleDiameter*gi/o.ONE_EM,li,this.retainedQueryData[f.bucketInstanceId].tileID),ze=H||Zt.circles.length>0&&!Zt.collisionDetected,Fe=Fe&&Zt.offscreen,qe=Zt.occluded}if(Te.iconFeatureIndex&&(mi=Te.iconFeatureIndex),Te.iconBox){const Li=gi=>{_i(gi);const li=oe&&Pt?Ms(Pt.x,Pt.y,re,le,this.transform.angle):new o.Point(0,0),Wi=f.getSymbolInstanceIconSize(j,this.transform.zoom,ge.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(f,Wi,gi,li,K,P,y,q.predicate)};wt&&wt.box&&wt.box.length&&Te.verticalIconBox?(dt=Li(Te.verticalIconBox),Ge=dt.box.length>0):(dt=Li(Te.iconBox),Ge=dt.box.length>0),Fe=Fe&&dt.offscreen,pt=dt.occluded}const un=z||ge.numHorizontalGlyphVertices===0&&xe===0,er=V||ge.numIconVertices===0;if(un||er?er?un||(Ge=Ge&&ze):ze=Ge&&ze:Ge=ze=Ge&&ze,ze&&Ht&&Ht.box&&this.collisionIndex.insertCollisionBox(Ht.box,g.get("text-ignore-placement"),f.bucketInstanceId,wt&&wt.box&&fi?fi:di,q.ID),Ge&&dt&&this.collisionIndex.insertCollisionBox(dt.box,g.get("icon-ignore-placement"),f.bucketInstanceId,mi,q.ID),Zt&&(ze&&this.collisionIndex.insertCollisionCircles(Zt.circles,g.get("text-ignore-placement"),f.bucketInstanceId,di,q.ID),u)){const Li=f.bucketInstanceId;let gi=this.collisionCircleArrays[Li];gi===void 0&&(gi=this.collisionCircleArrays[Li]=new Ss);for(let li=0;li<Zt.circles.length;li+=4)gi.circles.push(Zt.circles[li+0]),gi.circles.push(Zt.circles[li+1]),gi.circles.push(Zt.circles[li+2]),gi.circles.push(Zt.collisionDetected?1:0)}const Er=f.projection.name!=="globe";pe=pe&&(Er||!qe),ve=ve&&(Er||!pt),this.placements[Ve]=new Es(ze||pe,Ge||ve,Fe||f.justReloaded),s.add(Ve)};if(fe){const ge=f.getSortedSymbolIndexes(this.transform.angle);for(let Le=ge.length-1;Le>=0;--Le){const Te=ge[Le];Ne(f.symbolInstances.get(Te),Te,f.collisionArrays[Te])}}else for(let ge=n.symbolInstanceStart;ge<n.symbolInstanceEnd;ge++)Ne(f.symbolInstances.get(ge),ge,f.collisionArrays[ge]);if(u&&f.bucketInstanceId in this.collisionCircleArrays){const ge=this.collisionCircleArrays[f.bucketInstanceId];o.invert(ge.invProjMatrix,y),ge.viewportMatrix=this.collisionIndex.getViewportMatrix()}f.justReloaded=!1}markUsedJustification(n,s,u,d){const{leftJustifiedTextSymbolIndex:f,centerJustifiedTextSymbolIndex:g,rightJustifiedTextSymbolIndex:y,verticalPlacedTextSymbolIndex:w,crossTileID:M}=u,I=o.getAnchorJustification(s),P=d===o.WritingMode.vertical?w:I==="left"?f:I==="center"?g:I==="right"?y:-1;f>=0&&(n.text.placedSymbolArray.get(f).crossTileID=P>=0&&f!==P?0:M),g>=0&&(n.text.placedSymbolArray.get(g).crossTileID=P>=0&&g!==P?0:M),y>=0&&(n.text.placedSymbolArray.get(y).crossTileID=P>=0&&y!==P?0:M),w>=0&&(n.text.placedSymbolArray.get(w).crossTileID=P>=0&&w!==P?0:M)}markUsedOrientation(n,s,u){const d=s===o.WritingMode.horizontal||s===o.WritingMode.horizontalOnly?s:0,f=s===o.WritingMode.vertical?s:0,{leftJustifiedTextSymbolIndex:g,centerJustifiedTextSymbolIndex:y,rightJustifiedTextSymbolIndex:w,verticalPlacedTextSymbolIndex:M}=u,I=n.text.placedSymbolArray;g>=0&&(I.get(g).placedOrientation=d),y>=0&&(I.get(y).placedOrientation=d),w>=0&&(I.get(w).placedOrientation=d),M>=0&&(I.get(M).placedOrientation=f)}commit(n){this.commitTime=n,this.zoomAtLastRecencyCheck=this.transform.zoom;const s=this.prevPlacement;let u=!1;this.prevZoomAdjustment=s?s.zoomAdjustment(this.transform.zoom):0;const d=s?s.symbolFadeChange(n):1,f=s?s.opacities:{},g=s?s.variableOffsets:{},y=s?s.placedOrientations:{};for(const w in this.placements){const M=this.placements[w],I=f[w];I?(this.opacities[w]=new Ur(I,d,M.text,M.icon,null,M.clipped),u=u||M.text!==I.text.placed||M.icon!==I.icon.placed):(this.opacities[w]=new Ur(null,d,M.text,M.icon,M.skipFade,M.clipped),u=u||M.text||M.icon)}for(const w in f){const M=f[w];if(!this.opacities[w]){const I=new Ur(M,d,!1,!1);I.isHidden()||(this.opacities[w]=I,u=u||M.text.placed||M.icon.placed)}}for(const w in g)this.variableOffsets[w]||!this.opacities[w]||this.opacities[w].isHidden()||(this.variableOffsets[w]=g[w]);for(const w in y)this.placedOrientations[w]||!this.opacities[w]||this.opacities[w].isHidden()||(this.placedOrientations[w]=y[w]);u?this.lastPlacementChangeTime=n:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=s?s.lastPlacementChangeTime:n)}updateLayerOpacities(n,s){const u=new Set;for(const d of s){const f=d.getBucket(n);f&&d.latestFeatureIndex&&n.id===f.layerIds[0]&&this.updateBucketOpacities(f,u,d.collisionBoxArray)}}updateBucketOpacities(n,s,u){n.hasTextData()&&n.text.opacityVertexArray.clear(),n.hasIconData()&&n.icon.opacityVertexArray.clear(),n.hasIconCollisionBoxData()&&n.iconCollisionBox.collisionVertexArray.clear(),n.hasTextCollisionBoxData()&&n.textCollisionBox.collisionVertexArray.clear();const d=n.layers[0].layout,f=!!n.layers[0].dynamicFilter(),g=new Ur(null,0,!1,!1,
8!0),y=d.get("text-allow-overlap"),w=d.get("icon-allow-overlap"),M=d.get("text-variable-anchor"),I=d.get("text-rotation-alignment")==="map",P=d.get("text-pitch-alignment")==="map",O=d.get("icon-text-fit")!=="none",N=new Ur(null,0,y&&(w||!n.hasIconData()||d.get("icon-optional")),w&&(y||!n.hasTextData()||d.get("text-optional")),!0);!n.collisionArrays&&u&&(n.hasIconCollisionBoxData()||n.hasTextCollisionBoxData())&&n.deserializeCollisionBoxes(u);const G=(q,z,V)=>{for(let H=0;H<z/4;H++)q.opacityVertexArray.emplaceBack(V)};let j=0;for(let q=0;q<n.symbolInstances.length;q++){const z=n.symbolInstances.get(q),{numHorizontalGlyphVertices:V,numVerticalGlyphVertices:H,crossTileID:K,numIconVertices:re}=z,le=s.has(K);let oe=this.opacities[K];le?oe=g:oe||(oe=N,this.opacities[K]=oe),s.add(K);const fe=V>0||H>0,pe=re>0,ve=this.placedOrientations[K],Ne=ve===o.WritingMode.vertical,ge=ve===o.WritingMode.horizontal||ve===o.WritingMode.horizontalOnly;if(!fe&&!pe||oe.isHidden()||j++,fe){const Le=As(oe.text);G(n.text,V,Ne?Oi:Le),G(n.text,H,ge?Oi:Le);const Te=oe.text.isHidden(),{leftJustifiedTextSymbolIndex:Ve,centerJustifiedTextSymbolIndex:xe,rightJustifiedTextSymbolIndex:ze,verticalPlacedTextSymbolIndex:Ge}=z,Fe=n.text.placedSymbolArray,qe=Te||Ne?1:0;Ve>=0&&(Fe.get(Ve).hidden=qe),xe>=0&&(Fe.get(xe).hidden=qe),ze>=0&&(Fe.get(ze).hidden=qe),Ge>=0&&(Fe.get(Ge).hidden=Te||ge?1:0);const pt=this.variableOffsets[K];pt&&this.markUsedJustification(n,pt.anchor,z,ve);const Pt=this.placedOrientations[K];Pt&&(this.markUsedJustification(n,"left",z,Pt),this.markUsedOrientation(n,Pt,z))}if(pe){const Le=As(oe.icon),{placedIconSymbolIndex:Te,verticalPlacedIconSymbolIndex:Ve}=z,xe=n.icon.placedSymbolArray,ze=oe.icon.isHidden()?1:0;Te>=0&&(G(n.icon,re,Ne?Oi:Le),xe.get(Te).hidden=ze),Ve>=0&&(G(n.icon,z.numVerticalIconVertices,ge?Oi:Le),xe.get(Ve).hidden=ze)}if(n.hasIconCollisionBoxData()||n.hasTextCollisionBoxData()){const Le=n.collisionArrays[q];if(Le){let Te=new o.Point(0,0),Ve=!0;if(Le.textBox||Le.verticalTextBox){if(M){const ze=this.variableOffsets[K];ze?(Te=Is(ze.anchor,ze.width,ze.height,ze.textOffset,ze.textScale),I&&Te._rotate(P?this.transform.angle:-this.transform.angle)):Ve=!1}f&&(Ve=!oe.clipped),Le.textBox&&Zo(n.textCollisionBox.collisionVertexArray,oe.text.placed,!Ve||Ne,Te.x,Te.y),Le.verticalTextBox&&Zo(n.textCollisionBox.collisionVertexArray,oe.text.placed,!Ve||ge,Te.x,Te.y)}const xe=Ve&&!!(!ge&&Le.verticalIconBox);Le.iconBox&&Zo(n.iconCollisionBox.collisionVertexArray,oe.icon.placed,xe,O?Te.x:0,O?Te.y:0),Le.verticalIconBox&&Zo(n.iconCollisionBox.collisionVertexArray,oe.icon.placed,!xe,O?Te.x:0,O?Te.y:0)}}}if(n.fullyClipped=j===0,n.sortFeatures(this.transform.angle),this.retainedQueryData[n.bucketInstanceId]&&(this.retainedQueryData[n.bucketInstanceId].featureSortOrder=n.featureSortOrder),n.hasTextData()&&n.text.opacityVertexBuffer&&n.text.opacityVertexBuffer.updateData(n.text.opacityVertexArray),n.hasIconData()&&n.icon.opacityVertexBuffer&&n.icon.opacityVertexBuffer.updateData(n.icon.opacityVertexArray),n.hasIconCollisionBoxData()&&n.iconCollisionBox.collisionVertexBuffer&&n.iconCollisionBox.collisionVertexBuffer.updateData(n.iconCollisionBox.collisionVertexArray),n.hasTextCollisionBoxData()&&n.textCollisionBox.collisionVertexBuffer&&n.textCollisionBox.collisionVertexBuffer.updateData(n.textCollisionBox.collisionVertexArray),n.bucketInstanceId in this.collisionCircleArrays){const q=this.collisionCircleArrays[n.bucketInstanceId];n.placementInvProjMatrix=q.invProjMatrix,n.placementViewportMatrix=q.viewportMatrix,n.collisionCircleArray=q.circles,delete this.collisionCircleArrays[n.bucketInstanceId]}}symbolFadeChange(n){return this.fadeDuration===0?1:(n-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(n){return Math.max(0,(this.transform.zoom-n)/1.5)}hasTransitions(n){return this.stale||n-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(n,s){const u=this.zoomAtLastRecencyCheck===s?1-this.zoomAdjustment(s):1;return this.zoomAtLastRecencyCheck=s,this.commitTime+this.fadeDuration*u>n}setStale(){this.stale=!0}}function Zo(l,n,s,u,d){l.emplaceBack(n?1:0,s?1:0,u||0,d||0),l.emplaceBack(n?1:0,s?1:0,u||0,d||0),l.emplaceBack(n?1:0,s?1:0,u||0,d||0),l.emplaceBack(n?1:0,s?1:0,u||0,d||0)}const Rn=Math.pow(2,25),Gi=Math.pow(2,24),gl=Math.pow(2,17),yl=Math.pow(2,16),Bn=Math.pow(2,9),Jn=Math.pow(2,8),eu=Math.pow(2,1);function As(l){if(l.opacity===0&&!l.placed)return 0;if(l.opacity===1&&l.placed)return 4294967295;const n=l.placed?1:0,s=Math.floor(127*l.opacity);
8return s*Rn+n*Gi+s*gl+n*yl+s*Bn+n*Jn+s*eu+n}const Oi=0;class Cs{constructor(n){this._sortAcrossTiles=n.layout.get("symbol-z-order")!=="viewport-y"&&n.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(n,s,u,d,f){const g=this._bucketParts;for(;this._currentTileIndex<n.length;)if(s.getBucketParts(g,d,n[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,f())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,g.sort((y,w)=>y.sortKey-w.sortKey));this._currentPartIndex<g.length;){const y=g[this._currentPartIndex];if(s.placeLayerBucketPart(y,this._seenCrossTileIDs,u,y.symbolInstanceStart===0),this._currentPartIndex++,f())return!0}return!1}}class xl{constructor(n,s,u,d,f,g,y,w){this.placement=new fa(n,f,g,y,w),this._currentPlacementIndex=s.length-1,this._forceFullPlacement=u,this._showCollisionBoxes=d,this._done=!1}isDone(){return this._done}continuePlacement(n,s,u){const d=o.exported.now(),f=()=>{const g=o.exported.now()-d;return!this._forceFullPlacement&&g>2};for(;this._currentPlacementIndex>=0;){const g=s[n[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 Cs(g)),this._inProgressLayer.continuePlacement(u[g.source],this.placement,this._showCollisionBoxes,g,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(n){return this.placement.commit(n),this.placement}}const Mo=512/o.EXTENT/2;class gn{constructor(n,s,u){this.tileID=n,this.bucketInstanceId=u,this.index=new o.KDBush(s.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const d=n.canonical.x*o.EXTENT,f=n.canonical.y*o.EXTENT;for(let g=0;g<s.length;g++){const{key:y,crossTileID:w,tileAnchorX:M,tileAnchorY:I}=s.get(g),P=Math.floor((d+M)*Mo),O=Math.floor((f+I)*Mo);this.index.add(P,O),this.keys.push(y),this.crossTileIDs.push(w)}this.index.finish()}findMatches(n,s,u){const d=this.tileID.canonical.z<s.canonical.z?1:Math.pow(2,this.tileID.canonical.z-s.canonical.z),f=Mo/Math.pow(2,s.canonical.z-this.tileID.canonical.z),g=s.canonical.x*o.EXTENT,y=s.canonical.y*o.EXTENT;for(let w=0;w<n.length;w++){const M=n.get(w);if(M.crossTileID)continue;const{key:I,tileAnchorX:P,tileAnchorY:O}=M,N=Math.floor((g+P)*f),G=Math.floor((y+O)*f),j=this.index.range(N-d,G-d,N+d,G+d);for(const q of j){const z=this.crossTileIDs[q];if(this.keys[q]===I&&!u.has(z)){u.add(z),M.crossTileID=z;break}}}}}class vl{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class bl{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(n){const s=Math.round((n-this.lng)/360);if(s!==0)for(const u in this.indexes){const d=this.indexes[u],f={};for(const g in d){const y=d[g];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+s),f[y.tileID.key]=y}this.indexes[u]=f}this.lng=n}addBucket(n,s,u){if(this.indexes[n.overscaledZ]&&this.indexes[n.overscaledZ][n.key]){if(this.indexes[n.overscaledZ][n.key].bucketInstanceId===s.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(n.overscaledZ,this.indexes[n.overscaledZ][n.key])}for(let f=0;f<s.symbolInstances.length;f++)s.symbolInstances.get(f).crossTileID=0;this.usedCrossTileIDs[n.overscaledZ]||(this.usedCrossTileIDs[n.overscaledZ]=new Set);const d=this.usedCrossTileIDs[n.overscaledZ];for(const f in this.indexes){const g=this.indexes[f];if(Number(f)>n.overscaledZ)for(const y in g){const w=g[y];w.tileID.isChildOf(n)&&w.findMatches(s.symbolInstances,n,d)}else{const y=g[n.scaledTo(Number(f)).key];y&&y.findMatches(s.symbolInstances,n,d)}}for(let f=0;f<s.symbolInstances.length;f++){const g=s.symbolInstances.get(f);g.crossTileID||(g.crossTileID=u.generate(),d.add(g.crossTileID))}return this.indexes[n.overscaledZ]===void 0&&(this.indexes[n.overscaledZ]={}),this.indexes[n.overscaledZ][n.key]=new gn(n,s.symbolInstances,s.bucketInstanceId),!0}removeBucketCrossTileIDs(n,s){for(const u of s.crossTileIDs)this.usedCrossTileIDs[n].delete(u)}removeStaleBuckets(n){let s=!1;for(const u in this.indexes){const d=this.indexes[u];for(const f in d)n[d[f].bucketInstanceId]||(this.removeBucketCrossTileIDs(u,d[f]),delete d[f],s=!0)}return s}}class Vr{constructor(){this.layerIndexes={},this.crossTileIDs=new vl,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(n,s,u,d){let f=this.layerIndexes[n.id];f===void 0&&(f=this.layerIndexes[n.id]=new bl);let g=!1;const y={};d.name!=="globe"&&f.handleWrapJump(u);for(const w of s){const M=w.getBucket(n);M&&n.id===M.layerIds[0]&&(M.bucketInstanceId||(M.bucketInstanceId=++this.maxBucketInstanceId),f.addBucket(w.tileID,M,this.crossTileIDs)&&(g=!0),y[M.bucketInstanceId]=!0)}return f.removeStaleBuckets(y)&&(g=!0),g}pruneUnusedLayers(n){const s={};
8n.forEach(u=>{s[u]=!0});for(const u in this.layerIndexes)s[u]||delete this.layerIndexes[u]}}const so=(l,n)=>o.emitValidationErrors(l,n&&n.filter(s=>s.identifier!=="source.canvas")),ma=o.pick(ri,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),Ah=o.pick(ri,["setCenter","setZoom","setBearing","setPitch"]),wl={version:8,layers:[],sources:{}},qo={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class br extends o.Evented{constructor(n,s={}){super(),this.map=n,this.dispatcher=new vt(oo(),this),this.imageManager=new ui,this.imageManager.setEventedParent(this),this.glyphManager=new o.GlyphManager(n._requestManager,s.localFontFamily?o.LocalGlyphMode.all:s.localIdeographFontFamily?o.LocalGlyphMode.ideographs:o.LocalGlyphMode.none,s.localFontFamily||s.localIdeographFontFamily),this.crossTileSymbolIndex=new Vr,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",o.getReferrer());const u=this;this._rtlTextPluginCallback=br.registerForPluginStateChange(d=>{u.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:d.pluginStatus,pluginURL:d.pluginURL},(f,g)=>{if(o.triggerPluginCompletionEvent(f),g&&g.every(y=>y))for(const y in u._sourceCaches){const w=u._sourceCaches[y],M=w.getSource().type;M!=="vector"&&M!=="geojson"||w.reload()}})}),this.on("data",d=>{if(d.dataType!=="source"||d.sourceDataType!=="metadata")return;const f=this.getSource(d.sourceId);if(f&&f.vectorLayerIds)for(const g in this._layers){const y=this._layers[g];y.source===f.id&&this._validateLayer(y)}})}loadURL(n,s={}){this.fire(new o.Event("dataloading",{dataType:"style"}));const u=typeof s.validate=="boolean"?s.validate:!o.isMapboxURL(n);n=this.map._requestManager.normalizeStyleURL(n,s.accessToken);const d=this.map._requestManager.transformRequest(n,o.ResourceType.Style);this._request=o.getJSON(d,(f,g)=>{this._request=null,f?this.fire(new o.ErrorEvent(f)):g&&this._load(g,u)})}loadJSON(n,s={}){this.fire(new o.Event("dataloading",{dataType:"style"})),this._request=o.exported.frame(()=>{this._request=null,this._load(n,s.validate!==!1)})}loadEmpty(){this.fire(new o.Event("dataloading",{dataType:"style"})),this._load(wl,!1)}_updateLayerCount(n,s){const u=s?1:-1;n.is3D()&&(this._num3DLayers+=u),n.type==="circle"&&(this._numCircleLayers+=u),n.type==="symbol"&&(this._numSymbolLayers+=u)}_load(n,s){if(s&&so(this,o.validateStyle(n)))return;this._loaded=!0,this.stylesheet=o.clone$1(n),this._updateMapProjection();for(const d in n.sources)this.addSource(d,n.sources[d],{validate:!1});this._changed=!1,n.sprite?this._loadSprite(n.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(n.glyphs);const u=pa(this.stylesheet.layers);this._order=u.map(d=>d.id),this._layers={},this._serializedLayers={};for(const d of u){const f=o.createStyleLayer(d);f.setEventedParent(this,{layer:{id:f.id}}),this._layers[f.id]=f,this._serializedLayers[f.id]=f.serialize(),this._updateLayerCount(f,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Ct(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new o.Event("data",{dataType:"style"})),this.fire(new o.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}setProjection(n){n?this.stylesheet.projection=n:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(n){this._spriteRequest=function(s,u,d){let f,g,y;const w=o.exported.devicePixelRatio>1?"@2x":"";let M=o.getJSON(u.transformRequest(u.normalizeSpriteURL(s,w,".json"),o.ResourceType.SpriteJSON),(O,N)=>{M=null,y||(y=O,f=N,P())}),I=o.getImage(u.transformRequest(u.normalizeSpriteURL(s,w,".png"),o.ResourceType.SpriteImage),(O,N)=>{I=null,y||(y=O,g=N,P())});function P(){if(y)d(y);else if(f&&g){const O=o.exported.getImageData(g),N={};for(const G in f){const{width:j,height:q,x:z,y:V,sdf:H,pixelRatio:K,stretchX:re,stretchY:le,content:oe}=f[G],fe=new o.RGBAImage({width:j,height:q});o.RGBAImage.copy(O,fe,{x:z,y:V},{x:0,y:0},{width:j,height:q}),N[G]={data:fe,pixelRatio:K,sdf:H,stretchX:re,stretchY:le,content:oe}}d(null,N)}}return{cancel(){M&&(M.cancel(),M=null),I&&(I.cancel(),I=null)}}}(n,this.map._requestManager,(s,u)=>{if(this._spriteRequest=null,s)this.fire(new o.ErrorEvent(s));else if(u)for(const d in u)this.imageManager.addImage(d,u[d]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new o.Event("data",{dataType:"style"}))})}_validateLayer(n){const s=this.getSource(n.source);if(!s)return;const u=n.sourceLayer;u&&(s.type==="geojson"||s.vectorLayerIds&&s.vectorLayerIds.indexOf(u)===-1)&&this.fire(new o.ErrorEvent(new Error(`Source layer "${u}" does not exist on source "${s.id}" as specified by style layer "${n.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const n in this._sourceCaches)if(!this._sourceCaches[n].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(n){const s=[];for(const u of n){const d=this._layers[u];d.type!=="custom"&&s.push(d.serialize())}return s}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(const n in this._sourceCaches)if(this._sourceCaches[n].hasTransition())return!0;for(const n in this._layers)if(this._layers[n].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(n){return!!this.terrain&&(typeof n.isLayerDraped=="function"?n.isLayerDraped():qo[n.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(n){if(!this._loaded)return;const s=this._changed;if(this._changed){const d=Object.keys(this._updatedLayers),f=Object.keys(this._removedLayers);(d.length||f.length)&&this._updateWorkerLayers(d,f);for(const g in this._updatedSources){const y=this._updatedSources[g];y==="reload"?this._reloadSource(g):y==="clear"&&this._clearSource(g)}this._updateTilesForChangedImages();for(const g in this._updatedPaintProps)this._layers[g].updateTransitions(n);this.light.updateTransitions(n),this.fog&&this.fog.updateTransitions(n),this._resetUpdates()}const u={};for(const d in this._sourceCaches){const f=this._sourceCaches[d];u[d]=f.used,f.used=!1}for(const d of this._order){const f=this._layers[d];if(f.recalculate(n,this._availableImages),!f.isHidden(n.zoom)){const y=this._getLayerSourceCache(f);y&&(y.used=!0)}const g=this.map.painter;if(g){const y=f.getProgramIds();if(!y)continue;const w=f.getProgramConfiguration(n.zoom);for(const M of y)g.useProgram(M,w)}}for(const d in u){const f=this._sourceCaches[d];u[d]!==f.used&&f.getSource().fire(new o.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:f.getSource().id}))}this.light.recalculate(n),this.terrain&&this.terrain.recalculate(n),this.fog&&this.fog.recalculate(n),this.z=n.zoom,this._markersNeedU
vendor: 8,776 bytes, line 8
8pdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),s&&this.fire(new o.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const n=Object.keys(this._changedImages);if(n.length){for(const s in this._sourceCaches)this._sourceCaches[s].reloadTilesForDependencies(["icons","patterns"],n);this._changedImages={}}}_updateWorkerLayers(n,s){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:s})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(n){if(this._checkLoaded(),so(this,o.validateStyle(n)))return!1;(n=o.clone$1(n)).layers=pa(n.layers);const s=function(d,f){if(!d)return[{command:ri.setStyle,args:[f]}];let g=[];try{if(!U(d.version,f.version))return[{command:ri.setStyle,args:[f]}];U(d.center,f.center)||g.push({command:ri.setCenter,args:[f.center]}),U(d.zoom,f.zoom)||g.push({command:ri.setZoom,args:[f.zoom]}),U(d.bearing,f.bearing)||g.push({command:ri.setBearing,args:[f.bearing]}),U(d.pitch,f.pitch)||g.push({command:ri.setPitch,args:[f.pitch]}),U(d.sprite,f.sprite)||g.push({command:ri.setSprite,args:[f.sprite]}),U(d.glyphs,f.glyphs)||g.push({command:ri.setGlyphs,args:[f.glyphs]}),U(d.transition,f.transition)||g.push({command:ri.setTransition,args:[f.transition]}),U(d.light,f.light)||g.push({command:ri.setLight,args:[f.light]}),U(d.fog,f.fog)||g.push({command:ri.setFog,args:[f.fog]}),U(d.projection,f.projection)||g.push({command:ri.setProjection,args:[f.projection]});const y={},w=[];(function(P,O,N,G){let j;for(j in O=O||{},P=P||{})P.hasOwnProperty(j)&&(O.hasOwnProperty(j)||Eo(j,N,G));for(j in O){if(!O.hasOwnProperty(j))continue;const q=O[j];P.hasOwnProperty(j)?U(P[j],q)||(P[j].type==="geojson"&&q.type==="geojson"&&Mt(P,O,j)?N.push({command:ri.setGeoJSONSourceData,args:[j,q.data]}):ae(j,O,N,G)):bs(j,O,N)}})(d.sources,f.sources,w,y);const M=[];d.layers&&d.layers.forEach(P=>{P.source&&y[P.source]?g.push({command:ri.removeLayer,args:[P.id]}):M.push(P)});let I=d.terrain;I&&y[I.source]&&(g.push({command:ri.setTerrain,args:[void 0]}),I=void 0),g=g.concat(w),U(I,f.terrain)||g.push({command:ri.setTerrain,args:[f.terrain]}),function(P,O,N){O=O||[];const G=(P=P||[]).map(ji),j=O.map(ji),q=P.reduce(lr,{}),z=O.reduce(lr,{}),V=G.slice(),H=Object.create(null);let K,re,le,oe,fe,pe,ve;for(K=0,re=0;K<G.length;K++)le=G[K],z.hasOwnProperty(le)?re++:(N.push({command:ri.removeLayer,args:[le]}),V.splice(V.indexOf(le,re),1));for(K=0,re=0;K<j.length;K++)le=j[j.length-1-K],V[V.length-1-K]!==le&&(q.hasOwnProperty(le)?(N.push({command:ri.removeLayer,args:[le]}),V.splice(V.lastIndexOf(le,V.length-re),1)):re++,pe=V[V.length-K],N.push({command:ri.addLayer,args:[z[le],pe]}),V.splice(V.length-K,0,le),H[le]=!0);for(K=0;K<j.length;K++)if(le=j[K],oe=q[le],fe=z[le],!H[le]&&!U(oe,fe))if(U(oe.source,fe.source)&&U(oe["source-layer"],fe["source-layer"])&&U(oe.type,fe.type)){for(ve in ei(oe.layout,fe.layout,N,le,null,ri.setLayoutProperty),ei(oe.paint,fe.paint,N,le,null,ri.setPaintProperty),U(oe.filter,fe.filter)||N.push({command:ri.setFilter,args:[le,fe.filter]}),U(oe.minzoom,fe.minzoom)&&U(oe.maxzoom,fe.maxzoom)||N.push({command:ri.setLayerZoomRange,args:[le,fe.minzoom,fe.maxzoom]}),oe)oe.hasOwnProperty(ve)&&ve!=="layout"&&ve!=="paint"&&ve!=="filter"&&ve!=="metadata"&&ve!=="minzoom"&&ve!=="maxzoom"&&(ve.indexOf("paint.")===0?ei(oe[ve],fe[ve],N,le,ve.slice(6),ri.setPaintProperty):U(oe[ve],fe[ve])||N.push({command:ri.setLayerProperty,args:[le,ve,fe[ve]]}));for(ve in fe)fe.hasOwnProperty(ve)&&!oe.hasOwnProperty(ve)&&ve!=="layout"&&ve!=="paint"&&ve!=="filter"&&ve!=="metadata"&&ve!=="minzoom"&&ve!=="maxzoom"&&(ve.indexOf("paint.")===0?ei(oe[ve],fe[ve],N,le,ve.slice(6),ri.setPaintProperty):U(oe[ve],fe[ve])||N.push({command:ri.setLayerProperty,args:[le,ve,fe[ve]]}))}else N.push({command:ri.removeLayer,args:[le]}),pe=V[V.lastIndexOf(le)+1],N.push({command:ri.addLayer,args:[fe,pe]})}(M,f.layers,g)}catch(y){console.warn("Unable to compute style diff:",y),g=[{command:ri.setStyle,args:[f]}]}return g}(this.serialize(),n).filter(d=>!(d.command in Ah));if(s.length===0)return!1;const u=s.filter(d=>!(d.command in ma));if(u.length>0)throw new Error(`Unimplemented: ${u.map(d=>d.command).join(", ")}.`);return s.forEach(d=>{d.command!=="setTransition"&&d.command!=="setProjection"&&this[d.command].apply(this,d.args)}),this.stylesheet=n,this._updateMapProjection(),!0}addImage(n,s){return this.getImage(n)?this.fire(new o.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(n,s),this._afterImageUpdated(n),this)}updateImage(n,s){this.imageManager.updateImage(n,s)}getImage(n){return this.imageManager.getImage(n)}removeImage(n){return this.getImage(n)?(this.imageManager.removeImage(n),this._afterImageUpdated(n),this):this.fire(new o.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(n){this._availableImages=this.imageManager.listImages(),this._changedImages[n]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(n,s,u={}){if(this._checkLoaded(),this.getSource(n)!==void 0)throw new Error("There is already a source with this ID");if(!s.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(s).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(s.type)>=0&&this._validate(o.validateSource,`sources.${n}`,s,null,u))return;this.map&&this.map._collectResourceTiming&&(s.collectResourceTiming=!0);const d=jt(n,s,this.dispatcher,this);d.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(n),source:d.serialize(),sourceId:n}));const f=g=>{const y=(g?"symbol:":"other:")+n,w=this._sourceCaches[y]=new o.SourceCache(y,d,g);(g?this._symbolSourceCaches:this._otherSourceCaches)[n]=w,w.style=this,w.onAdd(this.map)};f(!1),s.type!=="vector"&&s.type!=="geojson"||f(!0),d.onAdd&&d.onAdd(this.map),this._changed=!0}removeSource(n){this._checkLoaded();const s=this.getSource(n);if(!s)throw new Error("There is no source with this ID");for(const d in this._layers)if(this._layers[d].source===n)return this.fire(new o.ErrorEvent(new Error(`Source "${n}" cannot be removed while layer "${d}" is using it.`)));if(this.terrain&&this.terrain.get().source===n)return this.fire(new o.ErrorEvent(new Error(`Source "${n}" cannot be removed while terrain is using it.`)));const u=this._getSourceCaches(n);for(const d of u)delete this._sourceCaches[d.id],delete this._updatedSources[d.id],d.fire(new o.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:d.getSource().id})),d.setEventedParent(null),d.clearTiles();return delete this._otherSourceCaches[n],delete this._symbolSourceCaches[n],s.setEventedParent(null),s.onRemove&&s.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(n,s){this._checkLoaded(),this.getSource(n).setData(s),this._changed=!0}getSource(n){const s=this._getSourceCache(n);return s&&s.getSource()}_getSources(){const n=[];for(const s in this._otherSourceCaches){const u=this._getSourceCache(s);u&&n.push(u.getSource())}return n}addLayer(n,s,u={}){this._checkLoaded();const d=n.id;if(this.getLayer(d))return void this.fire(new o.ErrorEvent(new Error(`Layer with id "${d}" already exists on this map`)));let f;if(n.type==="custom"){if(so(this,o.validateCustomStyleLayer(n)))return;f=o.createStyleLayer(n)}else{if(typeof n.source=="object"&&(this.addSource(d,n.source),n=o.clone$1(n),n=o.extend(n,{source:d})),this._validate(o.validateLayer,`layers.${d}`,n,{arrayIndex:-1},u))return;f=o.createStyleLayer(n),this._validateLayer(f),f.setEventedParent(this,{layer:{id:d}}),this._serializedLayers[f.id]=f.serialize(),this._updateLayerCount(f,!0)}const g=s?this._order.indexOf(s):this._order.length;if(s&&g===-1)return void this.fire(new o.ErrorEvent(new Error(`Layer with id "${s}" does not exist on this map.`)));this._order.splice(g,0,d),this._layerOrderChanged=!0,this._layers[d]=f;const y=this._getLayerSourceCache(f);if(this._removedLayers[d]&&f.source&&y&&f.type!=="custom"){const w=this._removedLayers[d];delete this._removedLayers[d],w.type!==f.type?this._updatedSources[f.source]="clear":(this._updatedSources[f.source]="reload",y.pause())}this._updateLayer(f),f.onAdd&&f.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(n,s){if(this._checkLoaded(),this._changed=!0,!this._layers[n])return void this.fire(new o.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be moved.`)));if(n===s)return;const u=this._order.indexOf(n);this._order.splice(u,1);const d=s?this._order.indexOf(s):this._order.length;
8s&&d===-1?this.fire(new o.ErrorEvent(new Error(`Layer with id "${s}" does not exist on this map.`))):(this._order.splice(d,0,n),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(n){this._checkLoaded();const s=this._layers[n];if(!s)return void this.fire(new o.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be removed.`)));s.setEventedParent(null),this._updateLayerCount(s,!1);const u=this._order.indexOf(n);this._order.splice(u,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[n]=s,delete this._layers[n],delete this._serializedLayers[n],delete this._updatedLayers[n],delete this._updatedPaintProps[n],s.onRemove&&s.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(n){return this._layers[n]}hasLayer(n){return n in this._layers}hasLayerType(n){for(const s in this._layers)if(this._layers[s].type===n)return!0;return!1}setLayerZoomRange(n,s,u){this._checkLoaded();const d=this.getLayer(n);d?d.minzoom===s&&d.maxzoom===u||(s!=null&&(d.minzoom=s),u!=null&&(d.maxzoom=u),this._updateLayer(d)):this.fire(new o.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(n,s,u={}){this._checkLoaded();const d=this.getLayer(n);if(d){if(!U(d.filter,s))return s==null?(d.filter=void 0,void this._updateLayer(d)):void(this._validate(o.validateFilter,`layers.${d.id}.filter`,s,{layerType:d.type},u)||(d.filter=o.clone$1(s),this._updateLayer(d)))}else this.fire(new o.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be filtered.`)))}getFilter(n){const s=this.getLayer(n);return s&&o.clone$1(s.filter)}setLayoutProperty(n,s,u,d={}){this._checkLoaded();const f=this.getLayer(n);f?U(f.getLayoutProperty(s),u)||(f.setLayoutProperty(s,u,d),this._updateLayer(f)):this.fire(new o.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(n,s){const u=this.getLayer(n);if(u)return u.getLayoutProperty(s);this.fire(new o.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style.`)))}setPaintProperty(n,s,u,d={}){this._checkLoaded();const f=this.getLayer(n);f?U(f.getPaintProperty(s),u)||(f.setPaintProperty(s,u,d)&&this._updateLayer(f),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new o.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(n,s){const u=this.getLayer(n);return u&&u.getPaintProperty(s)}setFeatureState(n,s){this._checkLoaded();const u=n.source,d=n.sourceLayer,f=this.getSource(u);if(!f)return void this.fire(new o.ErrorEvent(new Error(`The source '${u}' does not exist in the map's style.`)));const g=f.type;if(g==="geojson"&&d)return void this.fire(new o.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(g==="vector"&&!d)return void this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));n.id===void 0&&this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided.")));const y=this._getSourceCaches(u);for(const w of y)w.setFeatureState(d,n.id,s)}removeFeatureState(n,s){this._checkLoaded();const u=n.source,d=this.getSource(u);if(!d)return void this.fire(new o.ErrorEvent(new Error(`The source '${u}' does not exist in the map's style.`)));const f=d.type,g=f==="vector"?n.sourceLayer:void 0;if(f==="vector"&&!g)return void this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(s&&typeof n.id!="string"&&typeof n.id!="number")return void this.fire(new o.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const y=this._getSourceCaches(u);for(const w of y)w.removeFeatureState(g,n.id,s)}getFeatureState(n){this._checkLoaded();const s=n.source,u=n.sourceLayer,d=this.getSource(s);if(d){if(d.type!=="vector"||u)return n.id===void 0&&this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(s)[0].getFeatureState(u,n.id);this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new o.ErrorEvent(new Error(`The source '${s}' does not exist in the map's style.`)))}getTransition(){return o.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const n={};for(const s in this._sourceCaches){const u=this._sourceCaches[s].getSource();n[u.id]||(n[u.id]=u.serialize())}return o.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:n,layers:this._serializeLayers(this._order)},s=>s!==void 0)}_updateLayer(n){this._updatedLayers[n.id]=!0;const s=this._getLayerSourceCache(n);n.source&&!this._updatedSources[n.source]&&s&&s.getSource().type!=="raster"&&(this._updatedSources[n.source]="reload",s.pause()),this._changed=!0,n.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(n){const s=g=>this._layers[g].type==="fill-extrusion",u={},d=[];for(let g=this._order.length-1;g>=0;g--){const y=this._order[g];if(s(y)){u[y]=g;for(const w of n){const M=w[y];if(M)for(const I of M)d.push(I)}}}d.sort((g,y)=>y.intersectionZ-g.intersectionZ);const f=[];for(let g=this._order.length-1;g>=0;g--){const y=this._order[g];if(s(y))for(let w=d.length-1;w>=0;w--){const M=d[w].feature;if(u[M.layer.id]<g)break;f.push(M),d.pop()}else for(const w of n){const M=w[y];if(M)for(const I of M)f.push(I.feature)}}return f}
vendor: 9,514 bytes, lines 8-16
8queryRenderedFeatures(n,s,u){s&&s.filter&&this._validate(o.validateFilter,"queryRenderedFeatures.filter",s.filter,null,s);const d={};if(s&&s.layers){if(!Array.isArray(s.layers))return this.fire(new o.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(const w of s.layers){const M=this._layers[w];if(!M)return this.fire(new o.ErrorEvent(new Error(`The layer '${w}' does not exist in the map's style and cannot be queried for features.`))),[];d[M.source]=!0}}const f=[];s.availableImages=this._availableImages;const g=s&&s.layers?s.layers.some(w=>{const M=this.getLayer(w);return M&&M.is3D()}):this.has3DLayers(),y=Mi.createFromScreenPoints(n,u);for(const w in this._sourceCaches){const M=this._sourceCaches[w].getSource().id;s.layers&&!d[M]||f.push(ki(this._sourceCaches[w],this._layers,this._serializedLayers,y,s,u,g,!!this.map._showQueryGeometry))}return this.placement&&f.push(function(w,M,I,P,O,N,G){const j={},q=N.queryRenderedSymbols(P),z=[];for(const V of Object.keys(q).map(Number))z.push(G[V]);z.sort(an);for(const V of z){const H=V.featureIndex.lookupSymbolFeatures(q[V.bucketInstanceId],M,V.bucketIndex,V.sourceLayerIndex,O.filter,O.layers,O.availableImages,w);for(const K in H){const re=j[K]=j[K]||[],le=H[K];le.sort((oe,fe)=>{const pe=V.featureSortOrder;if(pe){const ve=pe.indexOf(oe.featureIndex);return pe.indexOf(fe.featureIndex)-ve}return fe.featureIndex-oe.featureIndex});for(const oe of le)re.push(oe)}}for(const V in j)j[V].forEach(H=>{const K=H.feature,re=I(w[V]);if(!re)return;const le=re.getFeatureState(K.layer["source-layer"],K.id);K.source=K.layer.source,K.layer["source-layer"]&&(K.sourceLayer=K.layer["source-layer"]),K.state=le});return j}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),y.screenGeometry,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(f)}querySourceFeatures(n,s){s&&s.filter&&this._validate(o.validateFilter,"querySourceFeatures.filter",s.filter,null,s);const u=this._getSourceCaches(n);let d=[];for(const f of u)d=d.concat(Bi(f,s));return d}addSourceType(n,s,u){return br.getSourceType(n)?u(new Error(`A source type called "${n}" already exists.`)):(br.setSourceType(n,s),s.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:s.workerSourceURL},u):u(null,null))}getLight(){return this.light.getLight()}setLight(n,s={}){this._checkLoaded();const u=this.light.getLight();let d=!1;for(const g in n)if(!U(n[g],u[g])){d=!0;break}if(!d)return;const f=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(n,s),this.light.updateTransitions(f)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(n,s=1){if(this._checkLoaded(),!n)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let u=n;if(s===1){if(typeof u.source=="object"){const d="terrain-dem-src";this.addSource(d,u.source),u=o.clone$1(u),u=o.extend(u,{source:d})}if(this._validate(o.validateTerrain,"terrain",u))return}if(!this.terrain||this.terrain&&s!==this.terrain.drapeRenderMode){if(!u)return;this._createTerrain(u,s)}else{const d=this.terrain,f=d.get();for(const g of Object.keys(o.spec.terrain))!u.hasOwnProperty(g)&&o.spec.terrain[g].default&&(u[g]=o.spec.terrain[g].default);for(const g in u)if(!U(u[g],f[g])){d.set(u),this.stylesheet.terrain=u;const y=this._setTransitionParameters({duration:0});d.updateTransitions(y);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(n){const s=this.fog=new Lt(n,this.map.transform);this.stylesheet.fog=n;const u=this._setTransitionParameters({duration:0});s.updateTransitions(u)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(const n of this.map._markers)n._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(n){if(this._checkLoaded(),!n)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const s=this.fog,u=s.get();Object.keys(n).length===0&&s.set(n);for(const d in n)if(!U(n[d],u[d])){s.set(n),this.stylesheet.fog=n;const f=this._setTransitionParameters({duration:0});s.updateTransitions(f);break}}else this._createFog(n);this._markersNeedUpdate=!0}_setTransitionParameters(n){return{now:o.exported.now(),transition:o.extend(n,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const n=this._order.filter(u=>this.isLayerDraped(this._layers[u])),s=this._order.filter(u=>!this.isLayerDraped(this._layers[u]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...n),this._drapedFirstOrder.push(...s)}_createTerrain(n,s){const u=this.terrain=new Ke(n,s);this.stylesheet.terrain=n,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const d=this._setTransitionParameters({duration:0});u.updateTransitions(d)}_force3DLayerUpdate(){for(const n in this._layers){const s=this._layers[n];s.type==="fill-extrusion"&&this._updateLayer(s)}}_forceSymbolLayerUpdate(){for(const n in this._layers){const s=this._layers[n];s.type==="symbol"&&this._updateLayer(s)}}_validate(n,s,u,d,f={}){return(!f||f.validate!==!1)&&so(this,n.call(o.validateStyle,o.extend({key:s,style:this.serialize(),value:u,styleSpec:o.spec},d)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),o.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const n in this._layers)this._layers[n].setEventedParent(null);for(const n in this._sourceCaches)this._sourceCaches[n].clearTiles(),this._sourceCaches[n].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(n){const s=this._getSourceCaches(n);for(const u of s)u.clearTiles()}_reloadSource(n){const s=this._getSourceCaches(n);for(const u of s)u.resume(),u.reload()}_reloadSources(){for(const n of this._getSources())n.reload&&n.reload()}_updateSources(n){for(const s in this._sourceCaches)this._sourceCaches[s].update(n)}_generateCollisionBoxes(){for(const n in this._sourceCaches){const s=this._sourceCaches[n];s.resume(),s.reload()}}_updatePlacement(n,s,u,d,f=!1){let g=!1,y=!1;const w={};for(const M of this._order){const I=this._layers[M];if(I.type!=="symbol")continue;if(!w[I.source]){const O=this._getLayerSourceCache(I);if(!O)continue;w[I.source]=O.getRenderableIds(!0).map(N=>O.getTileByID(N)).sort((N,G)=>G.tileID.overscaledZ-N.tileID.overscaledZ||(N.tileID.isLessThan(G.tileID)?-1:1))}const P=this.crossTileSymbolIndex.addLayer(I,w[I.source],n.center.lng,n.projection);g=g||P}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),f=f||this._layerOrderChanged||u===0,this._layerOrderChanged&&this.fire(new o.Event("neworder")),(f||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.exported.now(),n.zoom))&&(this.pauseablePlacement=new xl(n,this._order,f,s,u,d,this.placement,this.fog&&n.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,w),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.exported.now()),y=!0),g&&this.pauseablePlacement.placement.setStale()),y||g)for(const M of this._order){const I=this._layers[M];I.type==="symbol"&&this.placement.updateLayerOpacities(I,w[I.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(o.exported.now())}_releaseSymbolFadeTiles(){for(const n in this._sourceCaches)this._sourceCaches[n].releaseSymbolFadeTiles()}getImages(n,s,u){this.imageManager.getImages(s.icons,u),this._updateTilesForChangedImages();const d=f=>{f&&f.setDependencies(s.tileID.key,s.type,s.icons)};d(this._otherSourceCaches[s.source]),d(this._symbolSourceCaches[s.source])}getGlyphs(n,s,u){this.glyphManager.getGlyphs(s.stacks,u)}getResource(n,s,u){return o.makeRequest(s,u)}_getSourceCache(n){return this._otherSourceCaches[n]}_getLayerSourceCache(n){return n.type==="symbol"?this._symbolSourceCaches[n.source]:this._otherSourceCaches[n.source]}_getSourceCaches(n){const s=[];return this._otherSourceCaches[n]&&s.push(this._otherSourceCaches[n]),this._symbolSourceCaches[n]&&s.push(this._symbolSourceCaches[n]),s}_isSourceCacheLoaded(n){const s=this._getSourceCaches(n);return s.length===0?(this.fire(new o.ErrorEvent(new Error(`There is no source with ID '${n}'`))),!1):s.every(u=>u.loaded())}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}br.getSourceType=function(l){return kt[l]},br.setSourceType=function(l,n){kt[l]=n},br.registerForPluginStateChange=o.registerForPluginStateChange;var Tl=`
9#define EPSILON 0.0000001
10#define PI 3.141592653589793
11#define EXTENT 8192.0
12#define HALF_PI PI/2.0
13#define QUARTER_PI PI/4.0
14#define RAD_TO_DEG 180.0/PI
15#define DEG_TO_RAD PI/180.0
16#define GLOBE_RADIUS EXTENT/PI/2.0`,Ao="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;
16void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",Nr=`
17#define ELEVATION_SCALE 7.0
18#define ELEVATION_OFFSET 450.0
19#ifdef PROJECTION_GLOBE_VIEW
20uniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(
21mix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}
22#else
23vec3 elevationVector(vec2 pos) { return vec3(0,0,1); }
24#endif
25const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)
26{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}
27#ifdef TERRAIN
28#ifdef TERRAIN_DEM_FLOAT_FORMAT
29uniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;
30#else
31uniform sampler2D u_dem;uniform sampler2D u_dem_prev;
32#endif
33uniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) {
34#ifdef TERRAIN_DEM_FLOAT_FORMAT
35vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a;
36#else
37float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos));
38#ifdef TERRAIN_DEM_NEAREST_FILTER
39return u_exaggeration*tl;
40#endif
41float tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);
42#endif
43}float prevElevation(vec2 apos) {
44#ifdef TERRAIN_DEM_FLOAT_FORMAT
45vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a;
46#else
47float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);
48#endif
49}
50#ifdef TERRAIN_VERTEX_MORPHING
51float elevation(vec2 apos) {
52#ifdef ZERO_EXAGGERATION
53return 0.0;
54#endif
55float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}
56#else
57float elevation(vec2 apos) {
58#ifdef ZERO_EXAGGERATION
59return 0.0;
60#endif
61return currentElevation(apos);}
62#endif
63highp float unpack_depth(highp vec4 rgba_depth)
64{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(
65unpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy))
66);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {
67#ifdef TERRAIN_DEM_FLOAT_FORMAT
68float tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a;
69#else
70vec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);
70vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack);
71#endif
72return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}
73#else
74float elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }
75#endif`,ks=`#ifdef FOG
76uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}
77#endif`,jr=`#ifdef FOG
78uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(
79mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}
80#endif`;let _a={},Wo={};const Ps=[];
80Xo(Tl,Ps),Xo(Nr,Ps),Xo(ks,Ps),Xo(jr,Ps),_a=hi("",Nr),Wo=hi(jr,ks);const tu=hi(`
81#if __VERSION__ >=300
82#define varying in
83#define gl_FragColor glFragColor
84#define texture2D texture
85#define textureCube texture
86out vec4 glFragColor;
87#endif
88highp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth)
89{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}`,`
90#if __VERSION__ >=300
91#define attribute in
92#define varying out
93#define texture2D texture
94#endif
95float wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}
96#ifdef PROJECTION_GLOBE_VIEW
97vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {
98#ifndef PROJECTED_POS_ON_VIEWPORT
99float tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;
100#else
101return vec3(0.0);
102#endif
103}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}
104#endif
105vec2 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(
106unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
107);}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;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered.`),ga=Tl,El=`
108#ifdef GL_ES
109precision mediump float;
110#else
111
112#if !defined(lowp)
113#define lowp
114#endif
115
116#if !defined(mediump)
117#define mediump
118#endif
119
120#if !defined(highp)
121#define highp
122#endif
123
124#endif`;var Sl={background:hi(`uniform vec4 u_color;uniform float u_opacity;
125#ifdef LIGHTING_3D_MODE
126varying vec4 v_color;
127#endif
128void main() {vec4 out_color;
129#ifdef LIGHTING_3D_MODE
130out_color=v_color;
131#else
132out_color=u_color;
133#endif
134#ifdef FOG
135out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
136#endif
137gl_FragColor=out_color*u_opacity;
138#ifdef OVERDRAW_INSPECTOR
139gl_FragColor=vec4(1.0);
140#endif
141}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
142#ifdef LIGHTING_3D_MODE
143uniform vec4 u_color;varying vec4 v_color;
144#endif
145void main() {gl_Position=u_matrix*vec4(a_pos,0,1);
146#ifdef LIGHTING_3D_MODE
147v_color=apply_lighting(u_color);
148#endif
149#ifdef FOG
150v_fog_pos=fog_position(a_pos);
151#endif
152}`),backgroundPattern:hi(`uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);
153#ifdef LIGHTING_3D_MODE
154out_color=apply_lighting(out_color);
155#endif
156#ifdef FOG
157out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
158#endif
159gl_FragColor=out_color*u_opacity;
160#ifdef OVERDRAW_INSPECTOR
161gl_FragColor=vec4(1.0);
162#endif
163}`,`uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos);
164#ifdef FOG
165v_fog_pos=fog_position(a_pos);
166#endif
167}`),circle:hi(`varying vec3 v_data;varying float v_visibility;
168#pragma mapbox: define highp vec4 color
169#pragma mapbox: define mediump float radius
170#pragma mapbox: define lowp float blur
171#pragma mapbox: define lowp float opacity
172#pragma mapbox: define highp vec4 stroke_color
173#pragma mapbox: define mediump float stroke_width
174#pragma mapbox: define lowp float stroke_opacity
175void main() {
176#pragma mapbox: initialize highp vec4 color
177#pragma mapbox: initialize mediump float radius
178#pragma mapbox: initialize lowp float blur
179#pragma mapbox: initialize lowp float opacity
180#pragma mapbox: initialize highp vec4 stroke_color
181#pragma mapbox: initialize mediump float stroke_width
182#pragma mapbox: initialize lowp float stroke_opacity
183vec2 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(
184antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)
185);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);
186#ifdef LIGHTING_3D_MODE
187out_color=apply_lighting(out_color);
188#endif
189#ifdef FOG
190out_color=fog_apply_premultiplied(out_color,v_fog_pos);
191#endif
192gl_FragColor=out_color*(v_visibility*opacity_t);
193#ifdef OVERDRAW_INSPECTOR
194gl_FragColor=vec4(1.0);
195#endif
196}`,`#define NUM_VISIBILITY_RINGS 2
197#define INV_SQRT2 0.70710678
198#define ELEVATION_BIAS 0.0001
199#define NUM_SAMPLES_PER_RING 16
200uniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;
201#ifdef PROJECTION_GLOBE_VIEW
202attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;
203#endif
204varying vec3 v_data;varying float v_visibility;
205#pragma mapbox: define highp vec4 color
206#pragma mapbox: define mediump float radius
207#pragma mapbox: define lowp float blur
208#pragma mapbox: define lowp float opacity
209#pragma mapbox: define highp vec4 stroke_color
210#pragma mapbox: define mediump float stroke_width
211#pragma mapbox: define lowp float stroke_opacity
212vec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {
213#if defined(TERRAIN)
214return elevation(pos)+ELEVATION_BIAS;
215#else
216return 0.0;
217#endif
218}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);
219#ifdef PITCH_WITH_MAP
220#ifdef PROJECTION_GLOBE_VIEW
221return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );
222#else
223return u_matrix*( world_center+vec4(sample_offset,0,0) );
224#endif
225#else
226return projected_center+vec4(sample_offset,0,0);
227#endif
228}float get_sample_step() {
229#ifdef PITCH_WITH_MAP
230return 2.0*PI/float(NUM_SAMPLES_PER_RING);
231#else
232return PI/float(NUM_SAMPLES_PER_RING);
233#endif
234}void main(void) {
235#pragma mapbox: initialize highp vec4 color
236#pragma mapbox: initialize mediump float radius
237#pragma mapbox: initialize lowp float blur
238#pragma mapbox: initialize lowp float opacity
239#pragma mapbox: initialize highp vec4 stroke_color
240#pragma mapbox: initialize mediump float stroke_width
241#pragma mapbox: initialize lowp float stroke_opacity
242vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;
243#ifdef PROJECTION_GLOBE_VIEW
244vec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);
245#else 
246surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);
247#endif
248vec4 projected_center=u_matrix*world_center;float view_scale=0.0;
249#ifdef PITCH_WITH_MAP
250#ifdef SCALE_WITH_MAP
251view_scale=1.0;
252#else
253view_scale=projected_center.w/u_camera_to_center_distance;
254#endif
255#else
256#ifdef SCALE_WITH_MAP
257view_scale=u_camera_to_center_distance;
258#else
259view_scale=projected_center.w;
260#endif
261#endif
262gl_Position=project_vertex(extrude,world_center,projected_center,radiu
262s,stroke_width,view_scale,surface_vectors);float visibility=0.0;
263#ifdef TERRAIN
264float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;
265#ifdef PITCH_WITH_MAP
266float cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;
267#else
268occlusion_world_center=world_center;occlusion_projected_center=projected_center;
269#endif
270for(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);
271#else
272visibility=1.0;
273#endif
274#ifdef PROJECTION_GLOBE_VIEW
275visibility=1.0;
276#endif
277v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);
278#ifdef FOG
279v_fog_pos=fog_position(world_center.xyz);
280#endif
281}`),clippingMask:hi("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:hi(`uniform highp float u_intensity;varying vec2 v_extrude;
282#pragma mapbox: define highp float weight
283#define GAUSS_COEF 0.3989422804014327
284void main() {
285#pragma mapbox: initialize highp float weight
286float 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);
287#ifdef FOG
288if (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}
289#endif
290#ifdef OVERDRAW_INSPECTOR
291gl_FragColor=vec4(1.0);
292#endif
293}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;
294#ifdef PROJECTION_GLOBE_VIEW
295attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;
296#endif
297varying vec2 v_extrude;
298#pragma mapbox: define highp float weight
299#pragma mapbox: define mediump float radius
300const highp float ZERO=1.0/255.0/16.0;
301#define GAUSS_COEF 0.3989422804014327
302void main(void) {
303#pragma mapbox: initialize highp float weight
304#pragma mapbox: initialize mediump float radius
305vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;
306#ifdef PROJECTION_GLOBE_VIEW
307vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);
308#else
309pos=vec3(tilePos+extrude,elevation(tilePos));
310#endif
311gl_Position=u_matrix*vec4(pos,1);
312#ifdef FOG
313v_fog_pos=fog_position(pos);
314#endif
315}`),heatmapTexture:hi(`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;
316#ifdef OVERDRAW_INSPECTOR
317gl_FragColor=vec4(0.0);
318#endif
319}`,"attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:hi("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",`attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;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_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(
3200.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}`),collisionCircle:hi("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_2f;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_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(
321mix(-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(
3220.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:hi("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;
323#ifdef PROJECTION_GLOBE_VIEW
324attribute vec3 a_pos_3;
325#endif
326varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;
327#ifdef PROJECTION_GLOBE_VIEW
328gl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);
329#else
330gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);
331#endif
332}`),fill:hi(`#pragma mapbox: define highp vec4 color
333#pragma mapbox: define lowp float opacity
334void main() {
335#pragma mapbox: initialize highp vec4 color
336#pragma mapbox: initialize lowp float opacity
337vec4 out_color=color;
338#ifdef LIGHTING_3D_MODE
339out_color=apply_lighting(out_color);
340#endif
341#ifdef FOG
342out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
343#endif
344gl_FragColor=out_color*opacity;
345#ifdef OVERDRAW_INSPECTOR
346gl_FragColor=vec4(1.0);
347#endif
348}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
349#pragma mapbox: define highp vec4 color
350#pragma mapbox: define lowp float opacity
351void main() {
352#pragma mapbox: initialize highp vec4 color
353#pragma mapbox: initialize lowp float opacity
354gl_Position=u_matrix*vec4(a_pos,0,1);
355#ifdef FOG
356v_fog_pos=fog_position(a_pos);
357#endif
358}`),fillOutline:hi(`varying vec2 v_pos;
359#pragma mapbox: define highp vec4 outline_color
360#pragma mapbox: define lowp float opacity
361void main() {
362#pragma mapbox: initialize highp vec4 outline_color
363#pragma mapbox: initialize lowp float opacity
364float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;
365#ifdef LIGHTING_3D_MODE
366out_color=apply_lighting(out_color);
367#endif
368#ifdef FOG
369out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
370#endif
371gl_FragColor=out_color*(alpha*opacity);
372#ifdef OVERDRAW_INSPECTOR
373gl_FragColor=vec4(1.0);
374#endif
375}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
376#pragma mapbox: define highp vec4 outline_color
377#pragma mapbox: define lowp float opacity
378void main() {
379#pragma mapbox: initialize highp vec4 outline_color
380#pragma mapbox: initialize lowp float opacity
381gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
382#ifdef FOG
383v_fog_pos=fog_position(a_pos);
384#endif
385}`),fillOutlinePattern:hi(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world;
386#pragma mapbox: define lowp float opacity
387#pragma mapbox: define lowp vec4 pattern
388void main() {
389#pragma mapbox: initialize lowp float opacity
390#pragma mapbox: initialize mediump vec4 pattern
391vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos);
392#ifdef LIGHTING_3D_MODE
393out_color=apply_lighting(out_color);
394#endif
395#ifdef FOG
396out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
397#endif
398gl_FragColor=out_color*(alpha*opacity);
399#ifdef OVERDRAW_INSPECTOR
400gl_FragColor=vec4(1.0);
401#endif
402}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world;
403#pragma mapbox: define lowp float opacity
404#pragma mapbox: define lowp vec4 pattern
405#pragma mapbox: define lowp float pixel_ratio
406void main() {
407#pragma mapbox: initialize lowp float opacity
408#pragma mapbox: initialize mediump vec4 pattern
409#pragma mapbox: initialize lowp float pixel_ratio
410vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
411#ifdef FOG
412v_fog_pos=fog_position(a_pos);
413#endif
414}`),fillPattern:hi(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;
415#pragma mapbox: define lowp float opacity
416#pragma mapbox: define lowp vec4 pattern
417void main() {
418#pragma mapbox: initialize lowp float opacity
419#pragma mapbox: initialize mediump vec4 pattern
420vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);
421#ifdef LIGHTING_3D_MODE
422out_color=apply_lighting(out_color);
423#endif
424#ifdef FOG
425out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
426#endif
427gl_FragColor=out_color*opacity;
428#ifdef OVERDRAW_INSPECTOR
429gl_FragColor=vec4(1.0);
430#endif
431}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;
432#pragma mapbox: define lowp float opacity
433#pragma mapbox: define lowp vec4 pattern
434#pragma mapbox: define lowp float pixel_ratio
435void main() {
436#pragma mapbox: initialize lowp float opacity
437#pragma mapbox: initialize mediump vec4 pattern
438#pragma mapbox: initialize lowp float pixel_ratio
439vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);
440#ifdef FOG
441v_fog_pos=fog_position(a_pos);
442#endif
443}`),fillExtrusion:hi(`varying vec4 v_color;
444#ifdef RENDER_SHADOWS
445varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;
446#endif
447#ifdef FAUX_AO
448uniform lowp vec2 u_ao;varying vec3 v_ao;
449#endif
450#ifdef ZERO_ROOF_RADIUS
451varying vec4 v_roof_color;
452#endif
453#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
454varying highp vec3 v_normal;
455#endif
456void main() {
457#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
458vec3 normal=v_normal;
459#endif
460float z;vec4 color;
461#ifdef ZERO_ROOF_RADIUS
462z=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z);
463#else
464color=v_color;
465#endif
466#ifdef FAUX_AO
467float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0
467),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;
468#ifdef ZERO_ROOF_RADIUS
469concave*=(1.0-z);
470#endif
471float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade;
472#endif
473#ifdef RENDER_SHADOWS
474#ifdef ZERO_ROOF_RADIUS
475normal=mix(normal,vec3(0.0,0.0,1.0),z);
476#endif
477color.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth);
478#endif
479#ifdef FOG
480color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
481#endif
482gl_FragColor=color;
483#ifdef OVERDRAW_INSPECTOR
484gl_FragColor=vec4(1.0);
485#endif
486}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;
487#ifdef PROJECTION_GLOBE_VIEW
488attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;
489#endif
490varying vec4 v_color;
491#ifdef RENDER_SHADOWS
492uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;
493#endif
494#ifdef ZERO_ROOF_RADIUS
495varying vec4 v_roof_color;
496#endif
497#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
498varying highp vec3 v_normal;
499#endif
500#ifdef FAUX_AO
501uniform lowp vec2 u_ao;varying vec3 v_ao;
502#endif
503#pragma mapbox: define highp float base
504#pragma mapbox: define highp float height
505#pragma mapbox: define highp vec4 color
506void main() {
507#pragma mapbox: initialize highp float base
508#pragma mapbox: initialize highp float height
509#pragma mapbox: initialize highp vec4 color
510vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));
511#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
512v_normal=normal;
513#endif
514base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);
515#if defined(HAS_CENTROID) || defined(TERRAIN)
516centroid_pos=a_centroid_pos;
517#endif
518float ele=0.0;float h=0.0;float c_ele;vec3 pos;
519#ifdef TERRAIN
520bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h);
521#else
522h=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);
523#endif
524#ifdef PROJECTION_GLOBE_VIEW
525float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);
526#endif
527float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);
528#ifdef RENDER_SHADOWS
529v_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w;
530#endif
531float NdotL=0.0;float colorvalue=0.0;
532#ifdef LIGHTING_3D_MODE
533NdotL=calculate_NdotL(normal);
534#else
535colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);
536#endif
537if (normal.y !=0.0) {float r=0.84;
538#ifndef LIGHTING_3D_MODE
539r=mix(0.7,0.98,1.0-u_lightintensity);
540#endif
541NdotL*=(
542(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0);
543#ifdef FAUX_AO
544float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;
545#ifdef TERRAIN
546top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);
547#endif
548v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);
549#ifdef PROJECTION_GLOBE_VIEW
550top_height+=u_height_lift;
551#endif
552gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;
553#endif
554#ifdef LIGHTING_3D_MODE
555v_color=apply_lighting(color,NdotL);
556#else
557v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));
558#endif
559v_color*=u_opacity;
560#ifdef ZERO_ROOF_RADIUS
561v_roof_color=vec4(0.0,0.0,0.0,1.0);
562#ifdef LIGHTING_3D_MODE
563v_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0)));
564#else
565float roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));
566#endif
567v_roof_color*=u_opacity;
568#endif
569#ifdef FOG
570v_fog_pos=fog_position(pos);
571#endif
572}`),fillExtrusionPattern:hi(`uniform vec2 u_texsize;uniform sampler2D u_image;
573#ifdef FAUX_AO
574uniform lowp vec2 u_ao;varying vec3 v_ao;
575#endif
576#ifdef LIGHTING_3D_MODE
577varying float v_NdotL;
578#endif
579varying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity;
580#pragma mapbox: define lowp float base
581#pragma mapbox: define lowp float height
582#pragma mapbox: define lowp vec4 pattern
583#pragma mapbox: define lowp float pixel_ratio
584void main() {
585#pragma mapbox: initialize lowp float base
586#pragma mapbox: initialize lowp float height
587#pragma mapbox: initialize mediump vec4 pattern
588#pragma mapbox: initialize lowp float pixel_ratio
589vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);
590#ifdef LIGHTING_3D_MODE
591out_color=apply_lighting(out_color,v_NdotL)*u_opacity;
592#else
593out_color=out_color*v_lighting;
594#endif
595#ifdef FAUX_AO
596float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;
597#endif
598#ifdef FOG
599out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
600#endif
601gl_FragColor=out_color;
602#ifdef OVERDRAW_INSPECTOR
603gl_FragColor=vec4(1.0);
604#endif
605}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;
606#ifdef PROJECTION_GLOBE_VIEW
607attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;
608#endif
609varying vec2 v_pos;varying vec4 v_lighting;
610#ifdef FAUX_AO
611uniform lowp vec2 u_ao;varying vec3 v_ao;
612#endif
613#ifdef LIGHTING_3D_MODE
614varying float v_NdotL;
615#endif
616#pragma mapbox: define lowp float base
617#pragma mapbox: define lowp float height
618#pragma mapbox: define lowp vec4 pattern
619#pragma mapbox: define lowp float pixel_ratio
620void main() {
621#pragma mapbox: initialize lowp float base
622#pragma mapbox: initialize lowp float height
623#pragma mapbox: initialize mediump vec4 pattern
624#pragma mapbox: initialize lowp float pixel_ratio
625vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;
625base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);
626#if defined(HAS_CENTROID) || defined(TERRAIN)
627centroid_pos=a_centroid_pos;
628#endif
629float ele=0.0;float h=z;vec3 p;float c_ele;
630#ifdef TERRAIN
631bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h);
632#else
633p=vec3(pos_nx.xy,z);
634#endif
635#ifdef PROJECTION_GLOBE_VIEW
636float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);
637#endif
638float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0
639? pos_nx.xy
640: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;
641#ifdef LIGHTING_3D_MODE
642NdotL=calculate_NdotL(normal);
643#else
644NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);
645#endif
646if (normal.y !=0.0) {float r=0.84;
647#ifndef LIGHTING_3D_MODE
648r=mix(0.7,0.98,1.0-u_lightintensity);
649#endif
650NdotL*=(
651(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}
652#ifdef FAUX_AO
653float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;
654#ifdef TERRAIN
655top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(ce
655ntroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);
656#endif
657v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);
658#ifdef PROJECTION_GLOBE_VIEW
659top_height+=u_height_lift;
660#endif
661gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;
662#endif
663#ifdef LIGHTING_3D_MODE
664v_NdotL=NdotL;
665#else
666v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;
667#endif 
668#ifdef FOG
669v_fog_pos=fog_position(p);
670#endif
671}`),hillshadePrepare:hi(`#ifdef GL_ES
672precision highp float;
673#endif
674uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) {
675#ifdef TERRAIN_DEM_FLOAT_FORMAT
676return texture2D(u_image,coord).a/4.0;
677#else
678vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;
679#endif
680}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(
681(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)
682)/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(
683deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
684#ifdef OVERDRAW_INSPECTOR
685gl_FragColor=vec4(1.0);
686#endif
687}`,"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:hi(`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;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;
688#ifdef LIGHTING_3D_MODE
689gl_FragColor=apply_lighting(gl_FragColor);
690#endif
691#ifdef FOG
692gl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));
693#endif
694#ifdef OVERDRAW_INSPECTOR
695gl_FragColor=vec4(1.0);
696#endif
697}`,`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;
698#ifdef FOG
699v_fog_pos=fog_position(a_pos);
700#endif
701}`),line:hi(`uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv;
702#ifdef RENDER_LINE_DASH
703uniform sampler2D u_dash_image;varying vec2 v_tex;
704#endif
705#ifdef RENDER_LINE_GRADIENT
706uniform sampler2D u_gradient_image;
707#endif
708uniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}
709#pragma mapbox: define highp vec4 color
710#pragma mapbox: define lowp float floorwidth
711#pragma mapbox: define lowp vec4 dash
712#pragma mapbox: define lowp float blur
713#pragma mapbox: define lowp float opacity
714float linearstep(float edge0,float edge1,float x) {return  clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {
715#pragma mapbox: initialize highp vec4 color
716#pragma mapbox: initialize lowp float floorwidth
717#pragma mapbox: initialize lowp vec4 dash
718#pragma mapbox: initialize lowp float blur
719#pragma mapbox: initialize lowp float opacity
720float 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);
721#ifdef RENDER_LINE_DASH
722float sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);
723#endif
724highp vec4 out_color;
725#ifdef RENDER_LINE_GRADIENT
726out_color=texture2D(u_gradient_image,v_uv.xy);
727#else
728out_color=color;
729#endif
730float trimmed=1.0;
731#ifdef RENDER_LINE_TRIM_OFFSET
732highp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}}
733#endif
734#ifdef LIGHTING_3D_MODE
735out_color=apply_lighting(out_color);
736#endif
737#ifdef FOG
738out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
739#endif
740#ifdef RENDER_LINE_ALPHA_DISCARD
741if (alpha < u_alpha_discard_threshold) {discard;}
742#endif
743#ifdef RENDER_LINE_BORDER
744float edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);
745#ifdef RENDER_LINE_BORDER_AUTO
746float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}
747#else
748out_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha);
749#endif
750}
751#endif
752gl_FragColor=out_color*(alpha*opacity);
753#ifdef OVERDRAW_INSPECTOR
754gl_FragColor=vec4(1.0);
755#endif
756}`,`
757#define EXTRUDE_SCALE 0.015873016
758attribute vec2 a_pos_normal;attribute vec4 a_data;
759#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)
760attribute highp vec4 a_packed;
761#endif
762#ifdef RENDER_LINE_DASH
763attribute float a_linesofar;
764#endif
765uniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;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 vec4 v_uv;
766#ifdef RENDER_LINE_DASH
767uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex;
768#endif
769#ifdef RENDER_LINE_GRADIENT
770uniform float u_image_height;
771#endif
772#pragma mapbox: define highp vec4 color
773#pragma mapbox: define lowp float floorwidth
774#pragma mapbox: define lowp vec4 dash
775#pragma mapbox: define lowp float blur
776#pragma mapbox: define lowp float opacity
777#pragma mapbox: define mediump float gapwidth
778#pragma mapbox: define lowp float offset
779#pragma mapbox: define mediump float width
780void main() {
781#pragma mapbox: initialize highp vec4 color
782#pragma mapbox: initialize lowp float floorwidth
783#pragma mapbox: initialize lowp vec4 dash
784#pragma mapbox: initialize lowp float blur
785#pragma mapbox: initialize lowp float opacity
786#pragma mapbox: initialize mediump float gapwidth
787#pragma mapbox: initialize lowp float offset
788#pragma mapbox: initialize mediump float width
789float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=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*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;
790#ifndef RENDER_TO_TEXTURE
791float 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;
792#else
793v_gamma_scale=1.0;
794#endif
795#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)
796float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];
797#ifdef RENDER_LINE_GRADIENT
798highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end);
799#else
800v_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);
801#endif
802#endif
803#ifdef RENDER_LINE_DASH
804float scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y);
805#endif
806v_width2=vec2(outset,inset);
807#ifdef FOG
808v_fog_pos=fog_position(pos);
809#endif
810}`),linePattern:hi(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;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;
811#pragma mapbox: define lowp vec4 pattern
812#pragma mapbox: define lowp float pixel_ratio
813#pragma mapbox: define lowp float blur
814#pragma mapbox: define lowp float opacity
815void main() {
816#pragma mapbox: initialize mediump vec4 pattern
817#pragma mapbox: initialize lowp float pixel_ratio
818#pragma mapbox: initialize lowp float blur
819#pragma mapbox: initialize lowp float opacity
820vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.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=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos);
821#ifdef LIGHTING_3D_MODE
822color=apply_lighting(color);
823#endif
824#ifdef FOG
825color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
826#endif
827gl_FragColor=color*(alpha*opacity);
828#ifdef OVERDRAW_INSPECTOR
829gl_FragColor=vec4(1.0);
830#endif
831}`,`
832#define scale 0.015873016
833attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;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;
834#pragma mapbox: define lowp float blur
835#pragma mapbox: define lowp float opacity
836#pragma mapbox: define lowp float offset
837#pragma mapbox: define mediump float gapwidth
838#pragma mapbox: define mediump float width
839#pragma mapbox: define lowp float floorwidth
840#pragma mapbox: define lowp vec4 pattern
841#pragma mapbox: define lowp float pixel_ratio
842void main() {
843#pragma mapbox: initialize lowp float blur
844#pragma mapbox: initialize lowp float opacity
845#pragma mapbox: initialize lowp float offset
846#pragma mapbox: initialize mediump float gapwidth
847#pragma mapbox: initialize mediump float width
848#pragma mapbox: initialize lowp float floorwidth
849#pragma mapbox: initialize mediump vec4 pattern
850#pragma mapbox: initialize lowp float pixel_ratio
851float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=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_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;
852#ifndef RENDER_TO_TEXTURE
853float 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;
854#else
855v_gamma_scale=1.0;
856#endif
857v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;
858#ifdef FOG
859v_fog_pos=fog_position(pos);
860#endif
861}`),raster:hi(`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(
862dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);
863#ifdef LIGHTING_3D_MODE
864out_color=apply_lighting(out_color);
865#endif
866#ifdef FOG
867out_color=fog_dither(fog_apply(out_color,v_fog_pos));
868#endif
869gl_FragColor=vec4(out_color*color.a,color.a);
870#ifdef OVERDRAW_INSPECTOR
871gl_FragColor=vec4(1.0);
872#endif
873}`,`uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;
874#ifdef FOG
875v_fog_pos=fog_position(a_pos);
876#endif
877}`),symbolIcon:hi(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
878#pragma mapbox: define lowp float opacity
879void main() {
880#pragma mapbox: initialize lowp float opacity
881lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
882#ifdef OVERDRAW_INSPECTOR
883gl_FragColor=vec4(1.0);
884#endif
885}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;
886#ifdef PROJECTION_GLOBE_VIEW
887attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;
888#endif
889uniform 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 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;uniform vec3 u_up_vector;
890#ifdef PROJECTION_GLOBE_VIEW
891uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;
892#endif
893varying vec2 v_tex;varying float v_fade_opacity;
894#pragma mapbox: define lowp float opacity
895void main() {
896#pragma mapbox: initialize lowp float opacity
897vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;
898#ifdef PROJECTION_GLOBE_VIEW
899mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;
900#else
901world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;
902#endif
903vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?
904camera_to_anchor_distance/u_camera_to_center_distance :
905u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(
9060.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point;
907#ifdef PROJECTION_GLOBE_VIEW
908vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1);
909#else
910offsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);
911#endif
912vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;
913#ifdef PROJECTION_GLOBE_VIEW
914vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);
915#else
916projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);
917#endif
918highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);
919#ifdef TERRAIN
920#ifdef PITCH_WITH_MAP_TERRAIN
921vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);
922#endif
923#endif
924float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;
925#ifdef PROJECTION_GLOBE_VIEW
926vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
927#else
928gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
929#endif
930float projection_transition_fade=1.0;
931#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)
932projection_transition_fade=1.0-step(EPSILON,u_zoom_transition);
933#endif
934v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}`),symbolSDF:hi(`#define SDF_PX 8.0
935uniform 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;
936#pragma mapbox: define highp vec4 fill_color
937#pragma mapb
937ox: define highp vec4 halo_color
938#pragma mapbox: define lowp float opacity
939#pragma mapbox: define lowp float halo_width
940#pragma mapbox: define lowp float halo_blur
941void main() {
942#pragma mapbox: initialize highp vec4 fill_color
943#pragma mapbox: initialize highp vec4 halo_color
944#pragma mapbox: initialize lowp float opacity
945#pragma mapbox: initialize lowp float halo_width
946#pragma mapbox: initialize lowp float halo_blur
947float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
948#ifdef OVERDRAW_INSPECTOR
949gl_FragColor=vec4(1.0);
950#endif
951}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;
952#ifdef PROJECTION_GLOBE_VIEW
953attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;
954#endif
955uniform 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 bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;
956#ifdef PROJECTION_GLOBE_VIEW
957uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;
958#endif
959varying vec2 v_data0;varying vec3 v_data1;
960#pragma mapbox: define highp vec4 fill_color
961#pragma mapbox: define highp vec4 halo_color
962#pragma mapbox: define lowp float opacity
963#pragma mapbox: define lowp float halo_width
964#pragma mapbox: define lowp float halo_blur
965void main() {
966#pragma mapbox: initialize highp vec4 fill_color
967#pragma mapbox: initialize highp vec4 halo_color
968#pragma mapbox: initialize lowp float opacity
969#pragma mapbox: initialize lowp float halo_width
970#pragma mapbox: initialize lowp float halo_blur
971vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;
972#ifdef PROJECTION_GLOBE_VIEW
973mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;
974#else
975world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;
976#endif
977vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?
978camera_to_anchor_distance/u_camera_to_center_distance :
979u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(
9800.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;
981#ifdef PROJECTION_GLOBE_VIEW
982vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);
983#else
984offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);
985#endif
986vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;
987#ifdef PROJECTION_GLOBE_VIEW
988vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);
989#else
990projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);
991#endif
992highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);
993#ifdef TERRAIN
994#ifdef PITCH_WITH_MAP_TERRAIN
995vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);
996#endif
997#endif
998float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;
999#ifdef PROJECTION_GLOBE_VIEW
1000vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
1001#else
1002gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
1003#endif
1004float gamma_scale=gl_Position.w;float projection_transition_fade=1.0;
1005#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)
1006projection_transition_fade=1.0-step(EPSILON,u_zoom_transition);
1007#endif
1008vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}`),symbolTextAndIcon:hi(`#define SDF_PX 8.0
1009#define SDF 1.0
1010#define ICON 0.0
1011uniform 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;
1012#pragma mapbox: define highp vec4 fill_color
1013#pragma mapbox: define highp vec4 halo_color
1014#pragma mapbox: define lowp float opacity
1015#pragma mapbox: define lowp float halo_width
1016#pragma mapbox: define lowp float halo_blur
1017void main() {
1018#pragma mapbox: initialize highp vec4 fill_color
1019#pragma mapbox: initialize highp vec4 halo_color
1020#pragma mapbox: initialize lowp float opacity
1021#pragma mapbox: initialize lowp float halo_width
1022#pragma mapbox: initialize lowp float halo_blur
1023float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
1023gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
1024#ifdef OVERDRAW_INSPECTOR
1025gl_FragColor=vec4(1.0);
1026#endif
1027return;}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);
1028#ifdef OVERDRAW_INSPECTOR
1029gl_FragColor=vec4(1.0);
1030#endif
1031}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity;
1032#ifdef PROJECTION_GLOBE_VIEW
1033attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;
1034#endif
1035uniform 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 bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;
1036#ifdef PROJECTION_GLOBE_VIEW
1037uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;
1038#endif
1039varying vec4 v_data0;varying vec4 v_data1;
1040#pragma mapbox: define highp vec4 fill_color
1041#pragma mapbox: define highp vec4 halo_color
1042#pragma mapbox: define lowp float opacity
1043#pragma mapbox: define lowp float halo_width
1044#pragma mapbox: define lowp float halo_blur
1045void main() {
1046#pragma mapbox: initialize highp vec4 fill_color
1047#pragma mapbox: initialize highp vec4 halo_color
1048#pragma mapbox: initialize lowp float opacity
1049#pragma mapbox: initialize lowp float halo_width
1050#pragma mapbox: initialize lowp float halo_blur
1051vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;
1052#ifdef PROJECTION_GLOBE_VIEW
1053mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;
1054#else
1055world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;
1056#endif
1057vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?
1058camera_to_anchor_distance/u_camera_to_center_distance :
1059u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(
10600.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;
1061#ifdef PROJECTION_GLOBE_VIEW
1062vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);
1063#else
1064projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);
1065#endif
1066highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale);
1067#ifdef TERRAIN
1068#ifdef PITCH_WITH_MAP_TERRAIN
1069vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);
1070#endif
1071#endif
1072float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;
1073#ifdef PROJECTION_GLOBE_VIEW
1074vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
1075#else
1076gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
1077#endif
1078float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0;
1079#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)
1080projection_transition_fade=1.0-step(EPSILON,u_zoom_transition);
1081#endif
1082v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_s
1082df);}`),terrainRaster:hi(`uniform sampler2D u_image0;varying vec2 v_pos0;
1083#ifdef FOG
1084varying float v_fog_opacity;
1085#endif
1086#ifdef RENDER_SHADOWS
1087varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;
1088#endif
1089void main() {vec4 color=texture2D(u_image0,v_pos0);
1090#ifdef RENDER_SHADOWS
1091color.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth);
1092#endif
1093#ifdef FOG
1094#ifdef ZERO_EXAGGERATION
1095color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
1096#else
1097color=fog_dither(fog_apply_from_vert(color,v_fog_opacity));
1098#endif
1099#endif
1100gl_FragColor=color;
1101#ifdef TERRAIN_WIREFRAME
1102gl_FragColor=vec4(1.0,0.0,0.0,0.8);
1103#endif
1104#ifdef OVERDRAW_INSPECTOR
1105gl_FragColor=vec4(1.0);
1106#endif
1107}`,`uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0;
1108#ifdef FOG
1109varying float v_fog_opacity;
1110#endif
1111#ifdef RENDER_SHADOWS
1112uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;
1113#endif
1114const float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;
1115#ifdef TERRAIN_WIREFRAME
1116elevation+=wireframeOffset;
1117#endif
1118v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);
1119#ifdef FOG
1120#ifdef ZERO_EXAGGERATION
1121v_fog_pos=fog_position(decodedPos);
1122#else
1123v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));
1124#endif
1125#endif
1126#ifdef RENDER_SHADOWS
1127vec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w;
1128#endif
1129}`),terrainDepth:hi(`#ifdef GL_ES
1130precision highp float;
1131#endif
1132varying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}`,"uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:hi(`
1133varying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(
1134cos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(e
1134nd-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb;
1135#ifdef FOG
1136sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);
1137#endif
1138sky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity);
1139#ifdef OVERDRAW_INSPECTOR
1140gl_FragColor=vec4(1.0);
1141#endif
1142}`,Ao),skyboxGradient:hi(`varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5));
1143#ifdef FOG
1144color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;
1145#endif
1146color*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color;
1147#ifdef OVERDRAW_INSPECTOR
1148gl_FragColor=vec4(1.0);
1149#endif
1150}`,Ao),skyboxCapture:hi(`
1151varying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;
1152#ifdef GL_ES
1153precision highp float;
1154#endif
1155#define BETA_R                  vec3(5.5e-6,13.0e-6,22.4e-6)
1156#define BETA_M                  vec3(21e-6,21e-6,21e-6)
1157#define MIE_G                   0.76
1158#define DENSITY_HEIGHT_SCALE_R  8000.0
1159#define DENSITY_HEIGHT_SCALE_M  1200.0
1160#define PLANET_RADIUS           6360e3
1161#define ATMOSPHERE_RADIUS       6420e3
1162#define SAMPLE_STEPS            10
1163#define DENSITY_STEPS           4
1164float ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}
1164float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}`,"attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(e
1164nd-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:hi(`uniform sampler2D u_image0;varying vec2 v_pos0;
1165#ifndef FOG
1166uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;
1167#endif
1168void main() {vec4 color;
1169#ifdef CUSTOM_ANTIALIASING
1170vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(
1171mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias);
1172#else
1173color=texture2D(u_image0,v_pos0);
1174#endif
1175#ifdef FOG
1176color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
1177#endif
1178gl_FragColor=color;
1179#ifdef TERRAIN_WIREFRAME
1180gl_FragColor=vec4(1.0,0.0,0.0,0.8);
1181#endif
1182#ifdef OVERDRAW_INSPECTOR
1183gl_FragColor=vec4(1.0);
1184#endif
1185}`,`uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;
1186#ifdef GLOBE_POLES
1187attribute vec3 a_globe_pos;attribute vec2 a_uv;
1188#else
1189attribute vec2 a_pos;
1190#endif
1191varying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() {
1192#ifdef GLOBE_POLES
1193vec3 globe_pos=a_globe_pos;vec2 uv=a_uv;
1194#else
1195float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);
1196#endif
1197v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;
1198#ifdef GLOBE_POLES
1199vec3 up_vector=globe_derived_up_vector;
1200#else
1201vec3 up_vector=elevationVector(tile_pos);
1202#endif
1203float height=elevation(tile_pos);
1204#ifdef TERRAIN_WIREFRAME
1205height+=wireframeOffset;
1206#endif
1207globe_pos+=up_vector*height;
1208#ifndef GLOBE_POLES
1209globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;
1210#endif
1211#ifdef GLOBE_POLES
1212vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);
1213#else
1214vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);
1215#endif
1216gl_Position=u_proj_matrix*interpolated_pos;
1217#ifdef FOG
1218v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);
1219#endif
1220}`),globeAtmosphere:hi(`uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;
1220highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;
1221#ifdef PROJECTION_GLOBE_VIEW
1222globe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;}
1223#endif
1224highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?
12250.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle;
1226#ifdef PROJECTION_GLOBE_VIEW
1227highp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?
1228PI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);
1229#else
1230horizon_angle=horizon_angle_mercator;
1231#endif
1232horizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x:
1233(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y:
1234uv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}`,`attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(
1235mix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(
1236mix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}`)};function Xo(l,n){const s=l.replace(/\s*\/\/[^\n]*\n/g,`
1237`).split(`
1238`);for(let u of s)if(u=u.trim(),u[0]==="#"&&u.includes("if")&&!u.includes("endif")){u=u.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const d=u.split(" ");for(const f of d)n.includes(f)||n.push(f)}}function hi(l,n){const s=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,u=n.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),d={},f=[...Ps];return Xo(l,f),Xo(n,f),{fragmentSource:l=l.replace(s,(g,y,w,M,I)=>(d[I]=!0,y==="define"?`
1239#ifndef HAS_UNIFORM_u_${I}
1240varying ${w} ${M} ${I};
1241#else
1242uniform ${w} ${M} u_${I};
1243#endif
1244`:`
1245#ifdef HAS_UNIFORM_u_${I}
1246    ${w} ${M}
1246 ${I} = u_${I};
1247#endif
1248`)),vertexSource:n=n.replace(s,(g,y,w,M,I)=>{const P=M==="float"?"vec2":"vec4",O=I.match(/color/)?"color":P;return d[I]?y==="define"?`
1249#ifndef HAS_UNIFORM_u_${I}
1250uniform lowp float u_${I}_t;
1251attribute ${w} ${P} a_${I};
1252varying ${w} ${M} ${I};
1253#else
1254uniform ${w} ${M} u_${I};
1255#endif
1256`:O==="vec4"?`
1257#ifndef HAS_UNIFORM_u_${I}
1258    ${I} = a_${I};
1259#else
1260    ${w} ${M} ${I} = u_${I};
1261#endif
1262`:`
1263#ifndef HAS_UNIFORM_u_${I}
1264    ${I} = unpack_mix_${O}(a_${I}, u_${I}_t);
1265#else
1266    ${w} ${M} ${I} = u_${I};
1267#endif
1268`:y==="define"?`
1269#ifndef HAS_UNIFORM_u_${I}
1270uniform lowp float u_${I}_t;
1271attribute ${w} ${P} a_${I};
1272#else
1273uniform ${w} ${M} u_${I};
1274#endif
1275`:O==="vec4"?`
1276#ifndef HAS_UNIFORM_u_${I}
1277    ${w} ${M} ${I} = a_${I};
1278#else
1279    ${w} ${M} ${I} = u_${I};
1280#endif
1281`:`
1282#ifndef HAS_UNIFORM_u_${I}
1283    ${w} ${M} ${I} = unpack_mix_${O}(a_${I}, u_${I}_t);
1284#else
1285    ${w} ${M} ${I} = u_${I};
1286#endif
1287`}),staticAttributes:u,usedDefines:f}}class Ch{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(n,s,u,d,f,g,y){this.context=n;let w=this.boundPaintVertexBuffers.length!==d.length;for(let I=0;!w&&I<d.length;I++)this.boundPaintVertexBuffers[I]!==d[I]&&(w=!0);let M=this.boundDynamicVertexBuffers.length!==y.length;for(let I=0;!M&&I<y.length;I++)this.boundDynamicVertexBuffers[I]!==y[I]&&(M=!0);if(!n.extVertexArrayObject||!this.vao||this.boundProgram!==s||this.boundLayoutVertexBuffer!==u||w||M||this.boundIndexBuffer!==f||this.boundVertexOffset!==g)this.freshBind(s,u,d,f,g,y);else{n.bindVertexArrayOES.set(this.vao);for(const I of y)I&&I.bind();f&&f.dynamicDraw&&f.bind()}}freshBind(n,s,u,d,f,g){let y;const w=n.numAttributes,M=this.context,I=M.gl;if(M.extVertexArrayObject)this.vao&&this.destroy(),this.vao=M.extVertexArrayObject.createVertexArrayOES(),M.bindVertexArrayOES.set(this.vao),y=0,this.boundProgram=n,this.boundLayoutVertexBuffer=s,this.boundPaintVertexBuffers=u,this.boundIndexBuffer=d,this.boundVertexOffset=f,this.boundDynamicVertexBuffers=g;else{y=M.currentNumAttributes||0;for(let P=w;P<y;P++)I.disableVertexAttribArray(P)}s.enableAttributes(I,n),s.bind(),s.setVertexAttribPointers(I,n,f);for(const P of u)P.enableAttributes(I,n),P.bind(),P.setVertexAttribPointers(I,n,f);for(const P of g)P&&(P.enableAttributes(I,n),P.bind(),P.setVertexAttribPointers(I,n,f));d&&d.bind(),M.currentNumAttributes=w}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function Il(l,n){const s=Math.pow(2,n.canonical.z),u=n.canonical.y;return[new o.MercatorCoordinate(0,u/s).toLngLat().lat,new o.MercatorCoordinate(0,(u+1)/s).toLngLat().lat]}function iu(l,n,s,u,d,f,g){const y=l.context,w=y.gl,M=s.fbo;if(!M)return;l.prepareDrawTile();const I=l.useProgram("hillshade");y.activeTexture.set(w.TEXTURE0),w.bindTexture(w.TEXTURE_2D,M.colorAttachment.get());const P=((j,q,z,V)=>{const H=z.paint.get("hillshade-shadow-color"),K=z.paint.get("hillshade-highlight-color"),re=z.paint.get("hillshade-accent-color");let le=z.paint.get("hillshade-illumination-direction")*(Math.PI/180);z.paint.get("hillshade-illumination-anchor")==="viewport"&&(le-=j.transform.angle);const oe=!j.options.moving;return{u_matrix:V||j.transform.calculateProjMatrix(q.tileID.toUnwrapped(),oe),u_image:0,u_latrange:Il(0,q.tileID),u_light:[z.paint.get("hillshade-exaggeration"),le],u_shadow:H,u_highlight:K,u_accent:re}})(l,s,u,l.terrain?n.projMatrix:null);l.prepareDrawProgram(y,I,n.toUnwrapped());const{tileBoundsBuffer:O,tileBoundsIndexBuffer:N,tileBoundsSegments:G}=l.getTileBoundsBuffers(s);I.draw(y,w.TRIANGLES,d,f,g,o.CullFaceMode.disabled,P,u.id,O,N,G)}function Ml(l,n,s){if(!n.needsDEMTextureUpload)return;const u=l.context,d=u.gl;u.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||l.getTileTexture(s.stride);const f=s.getPixels();n.demTexture?n.demTexture.update(f,{premultiply:!1}):n.demTexture=new o.Texture(u,f,d.RGBA,{premultiply:!1}),n.needsDEMTextureUpload=!1}function nu(l,n,s,u,d,f){const g=l.context,y=g.gl;if(!n.dem)return;const w=n.dem;if(g.activeTexture.set(y.TEXTURE1),Ml(l,n,w),!n.demTexture)return;n.demTexture.bind(y.NEAREST,y.CLAMP_TO_EDGE);const M=w.dim;g.activeTexture.set(y.TEXTURE0);let I=n.fbo;if(!I){const G=new o.Texture(g,{width:M,height:M,data:null},y.RGBA);G.bind(y.LINEAR,y.CLAMP_TO_EDGE),I=n.fbo=g.createFramebuffer(M,M,!0),I.colorAttachment.set(G.texture)}g.bindFramebuffer.set(I.framebuffer),g.viewport.set([0,0,M,M]);const{tileBoundsBuffer:P,tileBoundsIndexBuffer:O,tileBoundsSegments:N}=l.getMercatorTileBoundsBuffers();l.useProgram("hillshadePrepare").draw(g,y.TRIANGLES,u,d,f,o.CullFaceMode.disabled,((G,j)=>{const q=j.stride,z=o.create();return o.ortho(z,0,o.EXTENT,-o.EXTENT,0,0,1),o.translate(z,z,[0,-o.EXTENT,0]),{u_matrix:z,u_image:1,u_dimension:[q,q],u_zoom:G.overscaledZ,u_unpack:j.unpackVector}})(n.tileID,w),s.id,P,O,N),n.needsHillshadePrepare=!1}const Al=l=>({u_matrix:new o.UniformMatrix4f(l),u_image0:new o.Uniform1i(l),u_skirt_height:new o.Uniform1f(l)}),Ho=(l,n)=>({u_matrix:l,u_image0:0,u_skirt_height:n}),ya=(l,n,s,u,d,f,g,y,w,M,I,P,O,N,G)=>({u_proj_matrix:Float32Array.from(l),u_globe_matrix:n,u_normalize_matrix:Float32Array.from(u),u_merc_matrix:s,u_zoom_transition:d,u_merc_center:f,u_image0:0,u_frustum_tl:g,u_frustum_tr:y,u_frustum_br:w,u_frustum_bl:M,u_globe_pos:I,u_globe_radius:P,u_viewport:O,u_grid_matrix:G?Float32Array.from(G):new Float32Array(9),u_skirt_height:N});function Ko(l,n){return l!=null&&n!=null&&!(!l.hasData()||!n.hasData())&&l.demTexture!=null&&n.demTexture!=null&&l.tileID.key!==n.tileID.key}const Gr=new class{constructor(){this.operations={}}newMorphing(l,n,s,u,d){if(l in this.operations){const f=this.operations[l];f.to.tileID.key!==s.tileID.key&&(f.queued=s)}else this.operations[l]={startTime:u,phase:0,duration:d,from:n,to:s,queued:null}}getMorphValuesForProxy(l){if(!(l in this.operations))return null;const n=this.operations[l];return{from:n.from,to:n.to,phase:n.phase}}update(l){for(const n in this.operations){const s=this.operations[n];for(s.phase=(l-s.startTime)/s.duration;s.phase>
vendor: 11,783 bytes, lines 1287-1290
1287=1||!this._validOp(s);)if(!this._nextOp(s,l)){delete this.operations[n];break}}}_nextOp(l,n){return!!l.queued&&(l.from=l.to,l.to=l.queued,l.queued=null,l.phase=0,l.startTime=n,!0)}_validOp(l){return l.from.hasData()&&l.to.hasData()}},Co={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function xa(l){return 6*Math.pow(1.5,22-l)}function ru(l,n){const s=1<<l.z;return!n&&(l.x===0||l.x===s-1)||l.y===0||l.y===s-1}const zs=l=>({u_matrix:l});function Cl(l,n,s,u,d){if(d>0){const f=o.exported.now(),g=(f-l.timeAdded)/d,y=n?(f-n.timeAdded)/d:-1,w=s.getSource(),M=u.coveringZoomLevel({tileSize:w.tileSize,roundZoom:w.roundZoom}),I=!n||Math.abs(n.tileID.overscaledZ-M)>Math.abs(l.tileID.overscaledZ-M),P=I&&l.refreshedUponExpiration?1:o.clamp(I?g:1-y,0,1);return l.refreshedUponExpiration&&g>=1&&(l.refreshedUponExpiration=!1),n?{opacity:1,mix:1-P}:{opacity:P,mix:0}}return{opacity:1,mix:0}}class kl extends o.SourceCache{constructor(n){const s={type:"raster-dem",maxzoom:n.transform.maxZoom},u=new vt(oo(),null),d=jt("mock-dem",s,u,n.style);super("mock-dem",d,!1),d.setEventedParent(this),this._sourceLoaded=!0}_loadTile(n,s){n.state="loaded",s(null)}}class va extends o.SourceCache{constructor(n){const s=jt("proxy",{type:"geojson",maxzoom:n.transform.maxZoom},new vt(oo(),null),n.style);super("proxy",s,!1),s.setEventedParent(this),this.map=this.getSource().map=n,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(n,s,u){if(n.freezeTileCoverage)return;this.transform=n;const d=n.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((f,g)=>{if(f[g.key]="",!this._tiles[g.key]){const y=new o.Tile(g,this._source.tileSize*g.overscaleFactor(),n.tileZoom);y.state="loaded",this._tiles[g.key]=y}return f},{});for(const f in this._tiles)f in d||(this.freeFBO(f),this._tiles[f].unloadVectorData(),delete this._tiles[f])}freeFBO(n){const s=this.proxyCachedFBO[n];if(s!==void 0){const u=Object.values(s);this.renderCachePool.push(...u),delete this.proxyCachedFBO[n]}}deallocRenderCache(){this.renderCache.forEach(n=>n.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class ba extends o.OverscaledTileID{constructor(n,s,u){super(n.overscaledZ,n.wrap,n.canonical.z,n.canonical.x,n.canonical.y),this.proxyTileKey=s,this.projMatrix=u}}class Pl extends o.Elevation{constructor(n,s){super(),this.painter=n,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[u,d,f]=function(w){const M=new o.StructArrayLayout2i4,I=new o.StructArrayLayout3ui6,P=131;M.reserve(17161),I.reserve(33800);const O=o.EXTENT/128,N=o.EXTENT+O/2,G=N+O;for(let q=-O;q<G;q+=O)for(let z=-O;z<G;z+=O){const V=z<0||z>N||q<0||q>N?24575:0,H=o.clamp(Math.round(z),0,o.EXTENT),K=o.clamp(Math.round(q),0,o.EXTENT);M.emplaceBack(H+V,K)}const j=(q,z)=>{const V=z*P+q;I.emplaceBack(V+1,V,V+P),I.emplaceBack(V+P,V+P+1,V+1)};for(let q=1;q<129;q++)for(let z=1;z<129;z++)j(z,q);return[0,129].forEach(q=>{for(let z=0;z<130;z++)j(z,q),j(q,z)}),[M,I,32768]}(),g=n.context;this.gridBuffer=g.createVertexBuffer(u,o.posAttributes.members),this.gridIndexBuffer=g.createIndexBuffer(d),this.gridSegments=o.SegmentVector.simpleSegment(0,0,u.length,d.length),this.gridNoSkirtSegments=o.SegmentVector.simpleSegment(0,0,u.length,f),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new va(s.map),this.orthoMatrix=o.create(),o.ortho(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,o.EXTENT,0,o.EXTENT,0,1);const y=g.gl;this._overlapStencilMode=new o.StencilMode({func:y.GEQUAL,mask:255},0,255,y.KEEP,y.KEEP,y.REPLACE),this._previousZoom=n.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=s,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new kl(s.map)}set style(n){n.on("data",this._onStyleDataEvent.bind(this)),n.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=n,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(n,s,u){if(n&&n.terrain){this._style!==n&&(this.style=n),this.enabled=!0;const d=n.terrain.properties;this.sourceCache=n.terrain.drapeRenderMode===0?this._mockSourceCache:n._getSourceCache(d.get("source")),this._exaggeration=d.get("exaggeration");const f=()=>{this.sourceCache.used&&o.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.
1288This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const g=this.getScaledDemTileSize();this.sourceCache.update(s,g,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,f(),this._initializing=!0),f(),s.updateElevation(!0,u),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(s),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(n){this._findCoveringTileCache[n]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const n=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||n.efficiency!==100&&o.warnOnce(`Terrain render cache efficiency is not optimal (${n.efficiency}%) and performance
1289                may be affected negatively, consider placing all background, fill and line layers before layer
1290                with id '${n.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(n){n.coord&&n.dataType==="source"?this._clearRenderCacheForTile(n.sourceCacheId,n.coord):n.dataType==="style"&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const n in this._style._sourceCaches)this._style._sourceCaches[n].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(n=>n.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const n=2*this.proxySourceCache.getSource().tileSize;return[n,n]}set useVertexMorphing(n){this._useVertexMorphing=n}updateTileBinding(n){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const s=this.proxySourceCache,u=this.painter.transform;this._initializing&&(this._initializing=u._centerAltitude===0&&this.getAtPointOrZero(o.MercatorCoordinate.fromLngLat(u.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);const d=this.proxyCoords=s.getIds().map(w=>{const M=s.getTileByID(w).tileID;return M.projMatrix=u.calculateProjMatrix(M.toUnwrapped()),M});(function(w,M){const I=M.transform.pointCoordinate(M.transform.getCameraPoint()),P=new o.Point(I.x,I.y);w.sort((O,N)=>{if(N.overscaledZ-O.overscaledZ)return N.overscaledZ-O.overscaledZ;const G=new o.Point(O.canonical.x+(1<<O.canonical.z)*O.wrap,O.canonical.y),j=new o.Point(N.canonical.x+(1<<N.canonical.z)*N.wrap,N.canonical.y),q=P.mult(1<<O.canonical.z);return q.x-=.5,q.y-=.5,q.distSqr(G)-q.distSqr(j)})})(d,this.painter),this._previousZoom=u.zoom;const f=this.proxyToSource||{};this.proxyToSource={},d.forEach(w=>{this.proxyToSource[w.key]={}}),this.terrainTileForTile={};const g=this._style._sourceCaches;for(const w in g){const M=g[w];if(!M.used||(M!==this.sourceCache&&this.resetTileLookupCache(M.id),this._setupProxiedCoordsForOrtho(M,n[w],f),M.usedForTerrain))continue;const I=n[w];M.getSource().reparseOverscaled&&this._assignTerrainTiles(I)}this.proxiedCoords[s.id]=d.map(w=>new ba(w,w.key,this.orthoMatrix)),this._assignTerrainTiles(d),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(f),this.renderingToTexture=!1,this._updateTimestamp=o.exported.now();const y={};this._visibleDemTiles=[];for(const w of this.proxyCoords){const M=this.terrainTileForTile[w.key];if(!M)continue;const I=M.tileID.key;I in y||(this._visibleDemTiles.push(M),y[I]=I)}}_assignTerrainTiles(n){this._initializing||n.forEach(s=>{if(this.terrainTileForTile[s.key])return;const u=this._findTileCoveringTileID(s,this.sourceCache);u&&(this.terrainTileForTile[s.key]=u)})}_prepareDEMTextures(){const n=this.painter.context,s=n.gl;for(const u in this.terrainTileForTile){const d=this.terrainTileForTile[u],f=d.dem;!f||d.demTexture&&!d.needsDEMTextureUpload||(n.activeTexture.set(s.TEXTURE1),Ml(this.painter,d,f))}}_prepareDemTileUniforms(n,s,u,d){if(!s||s.demTexture==null)return!1;const f=n.tileID.canonical,g=Math.pow(2,s.tileID.canonical.z-f.z),y=d||"";return u[`u_dem_tl${y}`]=[f.x*g%1,f.y*g%1],u[`u_dem_scale${y}`]=g,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const n=this.painter.context,s=n.gl;if(!this._emptyDepthBufferTexture){const u=new o.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new o.Texture(n,u,s.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let n=0;const s=this._visibleDemTiles.reduce((u,d)=>{if(!d.dem)return u;const f=d.dem.tree.minimums[0];return f>0&&n++,u+f},0);return n?s/n:0}_updateEmptyDEMTexture(){const n=this.painter.context,s=n.gl;n.activeTexture.set(s.TEXTURE2);const u=this._getLoadedAreaMinimum(),d=new o.RGBAImage({width:1,height:1},new Uint8Array(o.DEMData.pack(u,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let f=this._emptyDEMTexture;return f?f.update(d,{premultiply:!1}):f=this._emptyDEMTexture=new o.Texture(n,d,s.RGBA,{premultiply:!1}),f}setupElevationDraw(n,s,u){const d=this.painter.context,f=d.gl,g=(y=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:o.DEMData.getUnpackVector(y),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var y;g.u_dem_size=this.sourceCache.getSource().tileSize,g.u_exaggeration=this.exaggeration();let w=null,M=null,I=1;if(u&&u.morphing&&this._useVertexMorphing){const P=u.morphing.srcDemTile,O=u.morphing.dstDemTile;I=u.morphing.phase,P&&O&&(this._prepareDemTileUniforms(n,P,g,"_prev")&&(M=P),this._prepareDemTileUniforms(n,O,g)&&(w=O))}if(M&&w?(d.activeTexture.set(f.TEXTURE2),w.demTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE,f.NEAREST),d.activeTexture.set(f.TEXTURE4),M.demTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE,f.NEAREST),g.u_dem_lerp=I):(w=this.terrainTileForTile[n.tileID.key],d.activeTexture.set(f.TEXTURE2),(this._prepareDemTileUniforms(n,w,g)?w.demTexture:this.emptyDEMTexture).bind(f.NEAREST,f.CLAMP_TO_EDGE)),d.activeTexture.set(f.TEXTURE3),u&&u.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE),this._depthFBO&&(g.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE),g.u_depth_size_inv=[1,1]),u&&u.useMeterToDem&&w){const P=(1<<w.tileID.canonical.z)*o.mercatorZfromAltitude(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;g.u_meter_to_dem=P}
1290if(u&&u.labelPlaneMatrixInv&&(g.u_label_plane_matrix_inv=u.labelPlaneMatrixInv),s.setTerrainUniformValues(d,g),this.painter.transform.projection.name==="globe"){const P=this.globeUniformValues(this.painter.transform,n.tileID.canonical,u&&u.useDenormalizedUpVectorScale);s.setGlobeUniformValues(d,P)}}globeUniformValues(n,s,u){const d=n.projection;return{u_tile_tl_up:d.upVector(s,0,0),u_tile_tr_up:d.upVector(s,o.EXTENT,0),u_tile_br_up:d.upVector(s,o.EXTENT,o.EXTENT),u_tile_bl_up:d.upVector(s,0,o.EXTENT),u_tile_up_scale:u?o.globeMetersToEcef(1):d.upVectorScale(s,n.center.lat,n.worldSize).metersToTile}}renderToBackBuffer(n){const s=this.painter,u=this.painter.context;n.length!==0&&(u.bindFramebuffer.set(null),u.viewport.set([0,0,s.width,s.height]),s.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(d,f,g,y,w){if(d.transform.projection.name==="globe")(function(M,I,P,O,N){const G=M.context,j=G.gl;let q,z;const V=M.options.showTerrainWireframe?2:0,H=M.transform,K=o.globeUseCustomAntiAliasing(M,G,H),re=(Ve,xe)=>{if(z===Ve)return;const ze=[Co[Ve],"PROJECTION_GLOBE_VIEW"];K&&ze.push("CUSTOM_ANTIALIASING"),xe&&ze.push(Co[V]),q=M.useProgram("globeRaster",null,ze),z=Ve},le=M.colorModeForRenderPass(),oe=new o.DepthMode(j.LEQUAL,o.DepthMode.ReadWrite,M.depthRangeFor3D);Gr.update(N);const fe=o.calculateGlobeMercatorMatrix(H),pe=[o.mercatorXfromLng(H.center.lng),o.mercatorYfromLat(H.center.lat)],ve=V?[!1,!0]:[!1],Ne=M.globeSharedBuffers,ge=[H.width*o.exported.devicePixelRatio,H.height*o.exported.devicePixelRatio],Le=Float32Array.from(H.globeMatrix),Te={useDenormalizedUpVectorScale:!0};if(ve.forEach(Ve=>{const xe=M.transform,ze=xa(xe.zoom)*I.exaggeration();z=-1;const Ge=Ve?j.LINES:j.TRIANGLES;for(const Fe of O){const qe=P.getTile(Fe),pt=o.StencilMode.disabled,Pt=I.prevTerrainTileForTile[Fe.key],ut=I.terrainTileForTile[Fe.key];Ko(Pt,ut)&&Gr.newMorphing(Fe.key,Pt,ut,N,250),G.activeTexture.set(j.TEXTURE0),qe.texture.bind(j.LINEAR,j.CLAMP_TO_EDGE);const wt=Gr.getMorphValuesForProxy(Fe.key),Ht=wt?1:0;wt&&o.extend$1(Te,{morphing:{srcDemTile:wt.from,dstDemTile:wt.to,phase:o.easeCubicInOut(wt.phase)}});const Zt=o.tileCornersToBounds(Fe.canonical),dt=o.getLatitudinalLod(Zt.getCenter().lat),di=o.getGridMatrix(Fe.canonical,Zt,dt,xe.worldSize/xe._pixelsPerMercatorPixel),fi=o.globeNormalizeECEF(o.globeTileBounds(Fe.canonical)),mi=ya(xe.projMatrix,Le,fe,fi,o.globeToMercatorTransition(xe.zoom),pe,xe.frustumCorners.TL,xe.frustumCorners.TR,xe.frustumCorners.BR,xe.frustumCorners.BL,xe.globeCenterInViewSpace,xe.globeRadius,ge,ze,di);if(re(Ht,Ve),I.setupElevationDraw(qe,q,Te),M.prepareDrawProgram(G,q,Fe.toUnwrapped()),Ne){const[_i,Mn,un]=Ve?Ne.getWirefameBuffers(M.context,dt):Ne.getGridBuffers(dt,ze!==0);q.draw(G,Ge,oe,pt,le,o.CullFaceMode.backCCW,mi,"globe_raster",_i,Mn,un)}}}),Ne){const Ve=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];K&&Ve.push("CUSTOM_ANTIALIASING"),q=M.useProgram("globeRaster",null,Ve);for(const xe of O){const{x:ze,y:Ge,z:Fe}=xe.canonical,qe=Ge===0,pt=Ge===(1<<Fe)-1,[Pt,ut,wt,Ht]=Ne.getPoleBuffers(Fe);if(Ht&&(qe||pt)){const Zt=P.getTile(xe);G.activeTexture.set(j.TEXTURE0),Zt.texture.bind(j.LINEAR,j.CLAMP_TO_EDGE);let dt=o.globePoleMatrixForTile(Fe,ze,H);const di=o.globeNormalizeECEF(o.globeTileBounds(xe.canonical)),fi=(mi,_i)=>mi.draw(G,j.TRIANGLES,oe,o.StencilMode.disabled,le,o.CullFaceMode.disabled,ya(H.projMatrix,dt,dt,di,0,pe,H.frustumCorners.TL,H.frustumCorners.TR,H.frustumCorners.BR,H.frustumCorners.BL,H.globeCenterInViewSpace,H.globeRadius,ge,0),"globe_pole_raster",_i,wt,Ht);I.setupElevationDraw(Zt,q,Te),M.prepareDrawProgram(G,q,xe.toUnwrapped()),qe&&fi(q,Pt),pt&&(dt=o.scale(o.create(),dt,[1,-1,1]),fi(q,ut))}}}})(d,f,g,y,w);else{const M=d.context,I=M.gl;let P,O;const N=d.options.showTerrainWireframe?2:0,G=(H,K)=>{if(O===H)return;const re=[Co[H]];K&&re.push(Co[N]),P=d.useProgram("terrainRaster",null,re),O=H},j=d.colorModeForRenderPass(),q=new o.DepthMode(I.LEQUAL,o.DepthMode.ReadWrite,d.depthRangeFor3D);Gr.update(w);const z=d.transform,V=xa(z.zoom)*f.exaggeration();(N?[!1,!0]:[!1]).forEach(H=>{O=-1;const K=H?I.LINES:I.TRIANGLES,[re,le]=H?f.getWirefameBuffer():[f.gridIndexBuffer,f.gridSegments];for(const oe of y){const fe=g.getTile(oe),pe=o.StencilMode.disabled,ve=f.prevTerrainTileForTile[oe.key],Ne=f.terrainTileForTile[oe.key];Ko(ve,Ne)&&Gr.newMorphing(oe.key,ve,Ne,w,250),M.activeTexture.set(I.TEXTURE0),fe.texture.bind(I.LINEAR,I.CLAMP_TO_EDGE,I.LINEAR_MIPMAP_NEAREST);const ge=Gr.getMorphValuesForProxy(oe.key),Le=ge?1:0;let Te;ge&&(Te={morphing:{srcDemTile:ge.from,dstDemTile:ge.to,phase:o.easeCubicInOut(ge.phase)}});const Ve=Ho(oe.projMatrix,ru(oe.canonical,z.renderWorldCopies)?V/10:V);G(Le,H),f.setupElevationDraw(fe,P,Te),d.prepareDrawProgram(M,P,oe.toUnwrapped()),P.draw(M,K,q,pe,j,o.CullFaceMode.backCCW,Ve,"terrain_raster",f.gridBuffer,re,le)}})}}(s,this,this.proxySourceCache,n,this._updateTimestamp),this.renderingToTexture=!0,s.gpuTimingDeferredRenderEnd(),n.splice(0,n.length))}renderBatch(n){if(this._drapedRenderBatches.length===0)return n+1;this.renderingToTexture=!0;const s=this.painter,u=this.painter.context,d=this.proxySourceCache,f=this.proxiedCoords[d.id],g=this._drapedRenderBatches.shift(),y=[],w=s.style.order;let M=0;for(const I of f){const P=d.getTileByID(I.proxyTileKey),O=d.proxyCachedFBO[I.key]?d.proxyCachedFBO[I.key][n]:void 0,N=O!==void 0?d.renderCache[O]:this.pool[M++],G=O!==void 0;if(P.texture=N.tex,G&&!N.dirty){y.push(P.tileID);continue}let j;u.bindFramebuffer.set(N.fb.framebuffer),this.renderedToTile=!1,N.dirty&&(u.clear({color:o.Color.transparent,stencil:0}),N.dirty=!1);for(let q=g.start;q<=g.end;++q){const z=s.style._layers[w[q]];if(z.isHidden(s.transform.zoom))continue;const V=s.style._getLayerSourceCache(z),H=V?this.proxyToSource[I.key][
1290V.id]:[I];if(!H)continue;const K=H;u.viewport.set([0,0,N.fb.width,N.fb.height]),j!==(V?V.id:null)&&(this._setupStencil(N,H,z,V),j=V?V.id:null),s.renderLayer(s,V,z,K)}this.renderedToTile?(N.dirty=!0,y.push(P.tileID)):G||--M,M===5&&(M=0,this.renderToBackBuffer(y))}return this.renderToBackBuffer(y),this.renderingToTexture=!1,u.bindFramebuffer.set(null),u.viewport.set([0,0,s.width,s.height]),g.end+1}postRender(){}renderCacheEfficiency(n){const s=n.order.length;if(s===0)return{efficiency:100};let u,d=0,f=0,g=!1;for(let y=0;y<s;++y){const w=n._layers[n.order[y]];this._style.isLayerDraped(w)?(g&&++d,++f):g||(g=!0,u=w.id)}return f===0?{efficiency:100}:{efficiency:100*(1-d/f),firstUndrapedLayer:u}}getMinElevationBelowMSL(){let n=0;return this._visibleDemTiles.filter(s=>s.dem).forEach(s=>{n=Math.min(n,s.dem.tree.minimums[0])}),n===0?n:(n-30)*this._exaggeration}raycast(n,s,u){if(!this._visibleDemTiles)return null;const d=this._visibleDemTiles.filter(f=>f.dem).map(f=>{const g=f.tileID,y=1<<g.overscaledZ,{x:w,y:M}=g.canonical,I=w/y,P=(w+1)/y,O=M/y,N=(M+1)/y;return{minx:I,miny:O,maxx:P,maxy:N,t:f.dem.tree.raycastRoot(I,O,P,N,n,s,u),tile:f}});d.sort((f,g)=>(f.t!==null?f.t:Number.MAX_VALUE)-(g.t!==null?g.t:Number.MAX_VALUE));for(const f of d){if(f.t==null)return null;const g=f.tile.dem.tree.raycast(f.minx,f.miny,f.maxx,f.maxy,n,s,u);if(g!=null)return g}return null}_createFBO(){const n=this.painter.context,s=n.gl,u=this.drapeBufferSize;n.activeTexture.set(s.TEXTURE0);const d=new o.Texture(n,{width:u[0],height:u[1],data:null},s.RGBA);d.bind(s.LINEAR,s.CLAMP_TO_EDGE);const f=n.createFramebuffer(u[0],u[1],!1);return f.colorAttachment.set(d.texture),f.depthAttachment=new ce(n,f.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=n.createRenderbuffer(n.gl.DEPTH_STENCIL,u[0],u[1]),this._stencilRef=0,f.depthAttachment.set(this._sharedDepthStencil),n.clear({stencil:0})):f.depthAttachment.set(this._sharedDepthStencil),n.extTextureFilterAnisotropic&&!n.extTextureFilterAnisotropicForceOff&&s.texParameterf(s.TEXTURE_2D,n.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,n.extTextureFilterAnisotropicMax),{fb:f,tex:d,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._style.light&&this._style.light.hasTransition())return!0;for(const n in this._style._sourceCaches)if(this._style._sourceCaches[n].hasTransition())return!0;return this._style.order.some(n=>{const s=this._style._layers[n],u=s.isHidden(this.painter.transform.zoom);return s.type==="custom"?!u&&s.shouldRedrape():!u&&s.hasTransition()})}_clearLineLayersFromRenderCache(){let n=!1;for(const u of this._style._getSources())if(u instanceof Ye){n=!0;break}if(!n)return;const s={};for(let u=0;u<this._style.order.length;++u){const d=this._style._layers[this._style.order[u]],f=this._style._getLayerSourceCache(d);if(f&&!s[f.id]&&!d.isHidden(this.painter.transform.zoom)&&d.type==="line"&&d.widthExpression()instanceof o.ZoomDependentExpression){s[f.id]=!0;for(const g of this.proxyCoords){const y=this.proxyToSource[g.key][f.id];if(y)for(const w of y)this._clearRenderCacheForTile(f.id,w)}}}}_clearRasterLayersFromRenderCache(){let n=!1;for(const u in this._style._sourceCaches)if(this._style._sourceCaches[u]._source instanceof Ze){n=!0;break}if(!n)return;const s={};for(let u=0;u<this._style.order.length;++u){const d=this._style._layers[this._style.order[u]],f=this._style._getLayerSourceCache(d);if(!f||s[f.id]||d.isHidden(this.painter.transform.zoom)||d.type!=="raster")continue;const g=d.paint.get("raster-fade-duration");for(const y of this.proxyCoords){const w=this.proxyToSource[y.key][f.id];if(w)for(const M of w){const I=Cl(f.getTile(M),f.findLoadedParent(M,0),f,this.painter.transform,g);(I.opacity!==1||I.mix!==0)&&this._clearRenderCacheForTile(f.id,M)}}}}_setupDrapedRenderBatches(){const n=this._style.order,s=n.length;if(s===0)return;const u=[];let d,f=0,g=this._style._layers[n[f]];for(;!this._style.isLayerDraped(g)&&g.isHidden(this.painter.transform.zoom)&&++f<s;)g=this._style._layers[n[f]];for(;f<s;++f){const y=this._style._layers[n[f]];y.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(y)?d===void 0&&(d=f):d!==void 0&&(u.push({start:d,end:f-1}),d=void 0))}d!==void 0&&u.push({start:d,end:f-1}),this._drapedRenderBatches=u}_setupRenderCache(n){const s=this.proxySourceCache;if(this._shouldDisableRenderCache()||this._invalidateRenderCache){if(this._invalidateRenderCache=!1,s.renderCache.length>s.renderCachePool.length){const g=Object.values(s.proxyCachedFBO);s.proxyCachedFBO={};for(let y=0;y<g.length;++y){const w=Object.values(g[y]);s.renderCachePool.push(...w)}}return}this._clearRasterLayersFromRenderCache();const u=this.proxyCoords,d=this._tilesDirty;for(let g=u.length-1;g>=0;g--){const y=u[g];if(s.getTileByID(y.key),s.proxyCachedFBO[y.key]!==void 0){const w=n[y.key],M=this.proxyToSource[y.key];let I=0;for(const P in M){const O=M[P],N=w[P];if(!N||N.length!==O.length||O.some((G,j)=>G!==N[j]||d[P]&&d[P].hasOwnProperty(G.key))){I=-1;break}++I}for(const P in s.proxyCachedFBO[y.key])s.renderCache[s.proxyCachedFBO[y.key][P]].dirty=I<0||I!==Object.values(w).length}}const f=[...this._drapedRenderBatches];f.sort((g,y)=>y.end-y.start-(g.end-g.start));for(const g of f)for(const y of u){if(s.proxyCachedFBO[y.key])continue;let w=s.renderCachePool.pop();w===void 0&&s.renderCache.length<50&&(w=s.renderCache.length,s.renderCache.push(this._createFBO())),w!==void 0&&(s.proxyCachedFBO[y.key]={},s.proxyCachedFBO[y.key][g.start]=w,s.renderCache[w].dirty=!0)}this._tilesDirty={}}_setupStencil(n,s,u,d){if(!d||!this._sourceTilesOverlap[d.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const f=this.painter.context,g=f.gl;if(s.length<=1)return void(this._overlapStencilType=!1);let y;if(u.isTileClipped())y=s.length,this._overlapStencilMode.test={func:g.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(s[0].overscaledZ>
vendor: 4,710 bytes, line 1290
1290s[s.length-1].overscaledZ))return void(this._overlapStencilType=!1);y=1,this._overlapStencilMode.test={func:g.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+y>255&&(f.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=y,this._overlapStencilMode.ref=this._stencilRef,u.isTileClipped()&&this._renderTileClippingMasks(s,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(n){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[n.key]),this._overlapStencilMode):o.StencilMode.disabled}_renderTileClippingMasks(n,s){const u=this.painter,d=this.painter.context,f=d.gl;u._tileClippingMaskIDs={},d.setColorMode(o.ColorMode.disabled),d.setDepthMode(o.DepthMode.disabled);const g=u.useProgram("clippingMask");for(const y of n){const w=u._tileClippingMaskIDs[y.key]=--s;g.draw(d,f.TRIANGLES,o.DepthMode.disabled,new o.StencilMode({func:f.ALWAYS,mask:0},w,255,f.KEEP,f.KEEP,f.REPLACE),o.ColorMode.disabled,o.CullFaceMode.disabled,zs(y.projMatrix),"$clipping",u.tileExtentBuffer,u.quadTriangleIndexBuffer,u.tileExtentSegments)}}pointCoordinate(n){const s=this.painter.transform;if(n.x<0||n.x>s.width||n.y<0||n.y>s.height)return null;const u=[n.x,n.y,1,1];o.transformMat4$1(u,u,s.pixelMatrixInverse),o.scale$1(u,u,1/u[3]),u[0]/=s.worldSize,u[1]/=s.worldSize;const d=s._camera.position,f=o.mercatorZfromAltitude(1,s.center.lat),g=[d[0],d[1],d[2]/f,0],y=o.subtract([],u.slice(0,3),g);o.normalize(y,y);const w=this.raycast(g,y,this._exaggeration);return w!==null&&w?(o.scaleAndAdd(g,g,y,w),g[3]=g[2],g[2]*=f,g):null}drawDepth(){const n=this.painter,s=n.context,u=this.proxySourceCache,d=Math.ceil(n.width),f=Math.ceil(n.height);if(!this._depthFBO||this._depthFBO.width===d&&this._depthFBO.height===f||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const g=s.gl,y=s.createFramebuffer(d,f,!0);s.activeTexture.set(g.TEXTURE0);const w=new o.Texture(s,{width:d,height:f,data:null},g.RGBA);w.bind(g.NEAREST,g.CLAMP_TO_EDGE),y.colorAttachment.set(w.texture);const M=s.createRenderbuffer(s.gl.DEPTH_COMPONENT16,d,f);y.depthAttachment.set(M),this._depthFBO=y,this._depthTexture=w}s.bindFramebuffer.set(this._depthFBO.framebuffer),s.viewport.set([0,0,d,f]),function(g,y,w,M){if(g.transform.projection.name==="globe")return;const I=g.context,P=I.gl;I.clear({depth:1});const O=g.useProgram("terrainDepth"),N=new o.DepthMode(P.LESS,o.DepthMode.ReadWrite,g.depthRangeFor3D);for(const G of M){const j=w.getTile(G),q=Ho(G.projMatrix,0);y.setupElevationDraw(j,O),O.draw(I,P.TRIANGLES,N,o.StencilMode.disabled,o.ColorMode.unblended,o.CullFaceMode.backCCW,q,"terrain_depth",y.gridBuffer,y.gridIndexBuffer,y.gridNoSkirtSegments)}}(n,this,u,this.proxyCoords)}_setupProxiedCoordsForOrtho(n,s,u){if(n.getSource()instanceof Nt)return this._setupProxiedCoordsForImageSource(n,s,u);this._findCoveringTileCache[n.id]=this._findCoveringTileCache[n.id]||{};const d=this.proxiedCoords[n.id]=[],f=this.proxyCoords;for(let y=0;y<f.length;y++){const w=f[y],M=this._findTileCoveringTileID(w,n);if(M){const I=this._createProxiedId(w,M,u[w.key]&&u[w.key][n.id]);d.push(I),this.proxyToSource[w.key][n.id]=[I]}}let g=!1;for(let y=0;y<s.length;y++){const w=n.getTile(s[y]);if(!w||!w.hasData())continue;const M=this._findTileCoveringTileID(w.tileID,this.proxySourceCache);if(M&&M.tileID.canonical.z!==w.tileID.canonical.z){const I=this.proxyToSource[M.tileID.key][n.id],P=this._createProxiedId(M.tileID,w,u[M.tileID.key]&&u[M.tileID.key][n.id]);I?I.splice(I.length-1,0,P):this.proxyToSource[M.tileID.key][n.id]=[P],d.push(P),g=!0}}this._sourceTilesOverlap[n.id]=g}_setupProxiedCoordsForImageSource(n,s,u){if(!n.getSource().loaded())return;const d=this.proxiedCoords[n.id]=[],f=this.proxyCoords,g=n.getSource(),y=new o.Point(g.tileID.x,g.tileID.y)._div(1<<g.tileID.z),w=g.coordinates.map(o.MercatorCoordinate.fromLngLat).reduce((I,P)=>(I.min.x=Math.min(I.min.x,P.x-y.x),I.min.y=Math.min(I.min.y,P.y-y.y),I.max.x=Math.max(I.max.x,P.x-y.x),I.max.y=Math.max(I.max.y,P.y-y.y),I),{min:new o.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new o.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),M=(I,P)=>{const O=I.wrap+I.canonical.x/(1<<I.canonical.z),N=I.canonical.y/(1<<I.canonical.z),G=o.EXTENT/(1<<I.canonical.z),j=P.wrap+P.canonical.x/(1<<P.canonical.z),q=P.canonical.y/(1<<P.canonical.z);return O+G<j+w.min.x||O>j+w.max.x||N+G<q+w.min.y||N>q+w.max.y};for(let I=0;I<f.length;I++){const P=f[I];for(let O=0;O<s.length;O++){const N=n.getTile(s[O]);if(!N||!N.hasData()||M(P,N.tileID))continue;
1290const G=this._createProxiedId(P,N,u[P.key]&&u[P.key][n.id]),j=this.proxyToSource[P.key][n.id];j?j.push(G):this.proxyToSource[P.key][n.id]=[G],d.push(G)}}}_createProxiedId(n,s,u){let d=this.orthoMatrix;if(u){const f=u.find(g=>g.key===s.tileID.key);if(f)return f}if(s.tileID.key!==n.key){const f=n.canonical.z-s.tileID.canonical.z;let g,y,w;d=o.create();const M=s.tileID.wrap-n.wrap<<n.overscaledZ;f>0?(g=o.EXTENT>>f,y=g*((s.tileID.canonical.x<<f)-n.canonical.x+M),w=g*((s.tileID.canonical.y<<f)-n.canonical.y)):(g=o.EXTENT<<-f,y=o.EXTENT*(s.tileID.canonical.x-(n.canonical.x+M<<-f)),w=o.EXTENT*(s.tileID.canonical.y-(n.canonical.y<<-f))),o.ortho(d,0,g,0,g,0,1),o.translate(d,d,[y,w,0])}return new ba(s.tileID,n.key,d)}_findTileCoveringTileID(n,s){let u=s.getTile(n);if(u&&u.hasData())return u;const d=this._findCoveringTileCache[s.id],f=d[n.key];if(u=f?s.getTileByID(f):null,u&&u.hasData()||f===null)return u;let g=u?u.tileID:n,y=g.overscaledZ;const w=s.getSource().minzoom,M=[];if(!f){const P=s.getSource().maxzoom;if(n.canonical.z>=P){const O=n.canonical.z-P;s.getSource().reparseOverscaled?(y=Math.max(n.canonical.z+2,s.transform.tileZoom),g=new o.OverscaledTileID(y,n.wrap,P,n.canonical.x>>O,n.canonical.y>>O)):O!==0&&(y=P,g=new o.OverscaledTileID(y,n.wrap,P,n.canonical.x>>O,n.canonical.y>>O))}g.key!==n.key&&(M.push(g.key),u=s.getTile(g))}const I=P=>{M.forEach(O=>{d[O]=P}),M.length=0};for(y-=1;y>=w&&(!u||!u.hasData());y--){u&&I(u.tileID.key);const P=g.calculateScaledKey(y);if(u=s.getTileByID(P),u&&u.hasData())break;const O=d[P];if(O===null)break;O===void 0?M.push(P):u=s.getTileByID(O)}return I(u?u.tileID.key:null),u&&u.hasData()?u:null}findDEMTileFor(n){return this.enabled?this._findTileCoveringTileID(n,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(n,s){let u=this._tilesDirty[n];u||(u=this._tilesDirty[n]={}),u[s.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const n=function(s){let u=0;const d=new o.StructArrayLayout2ui4,f=131;for(let g=1;g<129;g++){for(let y=1;y<129;y++)u=g*f+y,d.emplaceBack(u,u+1),d.emplaceBack(u,u+f),d.emplaceBack(u+1,u+f),g===128&&d.emplaceBack(u+f,u+f+1);d.emplaceBack(u+1,u+1+f)}return d}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(n),this.wireframeSegments=o.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,n.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class ii{static cacheKey(n,s,u,d){let f=`${s}${d?d.cacheKey:""}`;for(const g of u)n.usedDefines.includes(g)&&(f+=`/${g}`);return f}constructor(n,s,u,d,f,g){const y=n.gl;this.program=y.createProgram();const w=function(z){const V=[];for(let H=0;H<z.length;H++){if(z[H]===null)continue;const K=z[H].split(" ");V.push(K.pop())}return V}(u.staticAttributes),M=d?d.getBinderAttributes():[],I=w.concat(M);let P=d?d.defines():[];P=P.concat(g.map(z=>`#define ${z}`));const O=n.isWebGL2?`#version 300 es
1291`:"",N=O+P.concat(n.extStandardDerivatives&&O.length===0?`#extension GL_OES_standard_derivatives : enable
1292`.concat(El):El,El,ga,tu.fragmentSource,Wo.fragmentSource,u.fragmentSource).join(`
1293`),G=O+P.concat(`
1294#ifdef GL_ES
1295precision highp float;
1296#else
1297
1298#if !defined(lowp)
1299#define lowp
1300#endif
1301
1302#if !defined(mediump)
1303#define mediump
1304#endif
1305
1306#if !defined(highp)
1307#define highp
1308#endif
1309
1310#endif`,ga,tu.vertexSource,Wo.vertexSource,_a.vertexSource,u.vertexSource).join(`
1311`),j=y.createShader(y.FRAGMENT_SHADER);if(y.isContextLost())return void(this.failedToCreate=!0);y.shaderSource(j,N),y.compileShader(j),y.attachShader(this.program,j);const q=y.createShader(y.VERTEX_SHADER);if(y.isContextLost())this.failedToCreate=!0;else{y.shaderSource(q,G),y.compileShader(q),y.attachShader(this.program,q),this.attributes={},this.numAttributes=I.length;for(let z=0;z<this.numAttributes;z++)I[z]&&(y.bindAttribLocation(this.program,z,I[z]),this.attributes[I[z]]=z);y.linkProgram(this.program),y.deleteShader(q),y.deleteShader(j),this.fixedUniforms=f(n),this.binderUniforms=d?d.getUniforms(n):[],g.includes("TERRAIN")&&(this.terrainUniforms=(z=>({u_dem:new o.Uniform1i(z),u_dem_prev:new o.Uniform1i(z),u_dem_unpack:new o.Uniform4f(z),u_dem_tl:new o.Uniform2f(z),u_dem_scale:new o.Uniform1f(z),u_dem_tl_prev:new o.Uniform2f(z),u_dem_scale_prev:new o.Uniform1f(z),u_dem_size:new o.Uniform1f(z),u_dem_lerp:new o.Uniform1f(z),u_exaggeration:new o.Uniform1f(z),u_depth:new o.Uniform1i(z),u_depth_size_inv:new o.Uniform2f(z),u_meter_to_dem:new o.Uniform1f(z),u_label_plane_matrix_inv:new o.UniformMatrix4f(z)}))(n)),g.includes("GLOBE")&&(this.globeUniforms=(z=>({u_tile_tl_up:new o.Uniform3f(z),u_tile_tr_up:new o.Uniform3f(z),u_tile_br_up:new o.Uniform3f(z),u_tile_bl_up:new o.Uniform3f(z),u_tile_up_scale:new o.Uniform1f(z)}))(n)),g.includes("FOG")&&(this.fogUniforms=(z=>({u_fog_matrix:new o.UniformMatrix4f(z),u_fog_range:new o.Uniform2f(z),u_fog_color:new o.Uniform4f(z),u_fog_horizon_blend:new o.Uniform1f(z),u_fog_temporal_offset:new o.Uniform1f(z),u_frustum_tl:new o.Uniform3f(z),u_frustum_tr:new o.Uniform3f(z),u_frustum_br:new o.Uniform3f(z),u_frustum_bl:new o.Uniform3f(z),u_globe_pos:new o.Uniform3f(z),u_globe_radius:new o.Uniform1f(z),u_globe_transition:new o.Uniform1f(z),u_is_globe:new o.Uniform1i(z),u_viewport:new o.Uniform2f(z)}))(n))}}setTerrainUniformValues(n,s){if(!this.terrainUniforms)return;const u=this.terrainUniforms;if(!this.failedToCreate){n.program.set(this.program);for(const d in s)u[d]&&u[d].set(this.program,d,s[d])}}setGlobeUniformValues(n,s){if(!this.globeUniforms)return;const u=this.globeUniforms;if(!this.failedToCreate){n.program.set(this.program);for(const d in s)u[d]&&u[d].set(this.program,d,s[d])}}setFogUniformValues(n,s){if(!this.fogUniforms)return;const u=this.fogUniforms;if(!this.failedToCreate){n.program.set(this.program);for(const d in s)u[d].set(this.program,d,s[d])}}draw(n,s,u,d,f,g,y,w,M,I,P,O,N,G,j){const q=n.gl;if(this.failedToCreate)return;n.program.set(this.program),n.setDepthMode(u),n.setStencilMode(d),n.setColorMode(f),n.setCullFace(g);for(const V of Object.keys(this.fixedUniforms))this.fixedUniforms[V].set(this.program,V,y[V]);G&&G.setUniforms(this.program,n,this.binderUniforms,O,{zoom:N});const z={[q.LINES]:2,[q.TRIANGLES]:3,[q.LINE_STRIP]:1}[s];for(const V of P.get()){const H=V.vaos||(V.vaos={});(H[w]||(H[w]=new Ch)).bind(n,this,M,G?G.getPaintVertexBuffers():[],I,V.vertexOffset,j||[]),q.drawElements(s,V.primitiveLength*z,q.UNSIGNED_SHORT,V.primitiveOffset*z*2)}}}
1311function Ls(l,n){const s=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,l.transform.tileZoom)/s,d=u*(n.tileID.canonical.x+n.tileID.wrap*s),f=u*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_tile_units_to_pixels:1/ai(n,1,l.transform.tileZoom),u_pixel_coord_upper:[d>>16,f>>16],u_pixel_coord_lower:[65535&d,65535&f]}}const ou=o.create(),zl=(l,n,s,u,d,f,g,y,w,M,I)=>{const P=n.style.light,O=P.properties.get("position"),N=[O.x,O.y,O.z],G=o.create$1();P.properties.get("anchor")==="viewport"&&(o.fromRotation(G,-n.transform.angle),o.transformMat3(N,N,G));const j=P.properties.get("color"),q=n.transform,z={u_matrix:l,u_lightpos:N,u_lightintensity:P.properties.get("intensity"),u_lightcolor:[j.r,j.g,j.b],u_vertical_gradient:+s,u_opacity:u,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:ou,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:d,u_edge_radius:f};return q.projection.name==="globe"&&(z.u_tile_id=[g.canonical.x,g.canonical.y,1<<g.canonical.z],z.u_zoom_transition=w,z.u_inv_rot_matrix=I,z.u_merc_center=M,z.u_up_dir=q.projection.upVector(new o.CanonicalTileID(0,0,0),M[0]*o.EXTENT,M[1]*o.EXTENT),z.u_height_lift=y),z},su=(l,n,s,u,d,f,g,y,w,M,I,P)=>{const O=zl(l,n,s,u,d,f,g,w,M,I,P),N={u_height_factor:-Math.pow(2,g.overscaledZ)/y.tileSize/8};return o.extend(O,Ls(n,y),N)},ko=l=>({u_matrix:l}),Ll=(l,n,s)=>o.extend(ko(l),Ls(n,s)),kh=(l,n)=>({u_matrix:l,u_world:n}),Ph=(l,n,s,u)=>o.extend(Ll(l,n,s),{u_world:u}),zh=o.create(),Dl=(l,n,s,u,d,f)=>{const g=l.transform,y=g.projection.name==="globe";let w;if(f.paint.get("circle-pitch-alignment")==="map")if(y){const I=o.globePixelsToTileUnits(g.zoom,n.canonical)*g._pixelsPerMercatorPixel;w=Float32Array.from([I,0,0,I])}else w=g.calculatePixelsToTileUnitsMatrix(s);else w=new Float32Array([g.pixelsToGLUnits[0],0,0,g.pixelsToGLUnits[1]]);const M={u_camera_to_center_distance:g.cameraToCenterDistance,u_matrix:l.translatePosMatrix(n.projMatrix,s,f.paint.get("circle-translate"),f.paint.get("circle-translate-anchor")),u_device_pixel_ratio:o.exported.devicePixelRatio,u_extrude_scale:w,u_inv_rot_matrix:zh,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(y){M.u_inv_rot_matrix=u,M.u_merc_center=d,M.u_tile_id=[n.canonical.x,n.canonical.y,1<<n.canonical.z],M.u_zoom_transition=o.globeToMercatorTransition(g.zoom);const I=d[0]*o.EXTENT,P=d[1]*o.EXTENT;M.u_up_dir=g.projection.upVector(new o.CanonicalTileID(0,0,0),I,P)}return M},Rl=l=>{const n=[];return l.paint.get("circle-pitch-alignment")==="map"&&n.push("PITCH_WITH_MAP"),l.paint.get("circle-pitch-scale")==="map"&&n.push("SCALE_WITH_MAP"),n},Bl=(l,n,s,u)=>{const d=o.EXTENT/s.tileSize;return{u_matrix:l,u_camera_to_center_distance:n.getCameraToCenterDistance(u),u_extrude_scale:[n.pixelsToGLUnits[0]/d,n.pixelsToGLUnits[1]/d]}},wa=(l,n,s=1)=>({u_matrix:l,u_color:n,u_overlay:0,u_overlay_scale:s}),au=o.create(),lu=(l,n,s,u,d,f,g)=>{const y=l.transform,w=y.projection.name==="globe",M=w?o.globePixelsToTileUnits(y.zoom,n.canonical)*y._pixelsPerMercatorPixel:ai(s,1,f),I={u_matrix:n.projMatrix,u_extrude_scale:M,u_intensity:g,u_inv_rot_matrix:au,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(w){I.u_inv_rot_matrix=u,I.u_merc_center=d,I.u_tile_id=[n.canonical.x,n.canonical.y,1<<n.canonical.z],I.u_zoom_transition=o.globeToMercatorTransition(y.zoom);const P=d[0]*o.EXTENT,O=d[1]*o.EXTENT;I.u_up_dir=y.projection.upVector(new o.CanonicalTileID(0,0,0),P,O)}return I},Lh=(l,n,s,u,d,f,g)=>{const y=l.transform,w=y.calculatePixelsToTileUnitsMatrix(n);return{u_matrix:Ol(l,n,s,u),u_pixels_to_tile_units:w,u_device_pixel_ratio:f,u_units_to_pixels:[1/y.pixelsToGLUnits[0],1/y.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:d,u_texsize:Rs(s)?n.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Yo(n,l.transform),u_alpha_discard_threshold:0,u_trim_offset:g}},Ds=(l,n,s,u,d)=>{const f=l.transform;return{u_matrix:Ol(l,n,s,u),u_texsize:n.imageAtlasTexture.size,u_pixels_to_tile_units:f.calculatePixelsToTileUnitsMatrix(n),u_device_pixel_ratio:d,u_image:0,u_tile_units_to_pixels:Yo(n,f),u_units_to_pixels:[1/f.pixelsToGLUnits[0],1/f.pixelsToGLUnits[1]],u_alph
vendor: 12,679 bytes, line 1311
1311a_discard_threshold:0}};function Yo(l,n){return 1/ai(l,1,n.tileZoom)}function Ol(l,n,s,u){return l.translatePosMatrix(u||n.tileID.projMatrix,n,s.paint.get("line-translate"),s.paint.get("line-translate-anchor"))}function Rs(l){const n=l.paint.get("line-dasharray").value;return n.value||n.kind!=="constant"}const Fl=(l,n,s,u,d,f)=>{return{u_matrix:l,u_tl_parent:n,u_scale_parent:s,u_fade_t:u.mix,u_opacity:u.opacity*d.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:d.paint.get("raster-brightness-min"),u_brightness_high:d.paint.get("raster-brightness-max"),u_saturation_factor:(y=d.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(g=d.paint.get("raster-contrast"),g>0?1/(1-g):1+g),u_spin_weights:wr(d.paint.get("raster-hue-rotate")),u_perspective_transform:f};var g,y};function wr(l){l*=Math.PI/180;const n=Math.sin(l),s=Math.cos(l);return[(2*s+1)/3,(-Math.sqrt(3)*n-s+1)/3,(Math.sqrt(3)*n-s+1)/3]}const Ta=o.create(),Ul=(l,n,s,u,d,f,g,y,w,M,I,P,O,N,G,j)=>{const q=d.transform,z={u_is_size_zoom_constant:+(l==="constant"||l==="source"),u_is_size_feature_constant:+(l==="constant"||l==="camera"),u_size_t:n?n.uSizeT:0,u_size:n?n.uSize:0,u_camera_to_center_distance:q.cameraToCenterDistance,u_rotate_symbol:+s,u_aspect_ratio:q.width/q.height,u_fade_change:d.options.fadeDuration?d.symbolFadeChange:1,u_matrix:f,u_label_plane_matrix:g,u_coord_matrix:y,u_is_text:+w,u_pitch_with_map:+u,u_texsize:M,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Ta,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Ta,u_up_vector:[0,-1,0]};return j.name==="globe"&&(z.u_tile_id=[I.canonical.x,I.canonical.y,1<<I.canonical.z],z.u_zoom_transition=P,z.u_inv_rot_matrix=N,z.u_merc_center=O,z.u_camera_forward=q._camera.forward(),z.u_ecef_origin=o.globeECEFOrigin(q.globeMatrix,I.toUnwrapped()),z.u_tile_matrix=Float32Array.from(q.globeMatrix),z.u_up_vector=G),z},Ea=(l,n,s,u,d,f,g,y,w,M,I,P,O,N,G,j,q)=>o.extend(Ul(l,n,s,u,d,f,g,y,w,M,P,O,N,G,j,q),{u_gamma_scale:u?d.transform.cameraToCenterDistance*Math.cos(d.terrain?0:d.transform._pitch):1,u_device_pixel_ratio:o.exported.devicePixelRatio,u_is_halo:+I}),cu=(l,n,s,u,d,f,g,y,w,M,I,P,O,N,G,j)=>o.extend(Ea(l,n,s,u,d,f,g,y,!0,w,!0,I,P,O,N,G,j),{u_texsize_icon:M,u_texture_icon:1}),Vl=(l,n,s)=>({u_matrix:l,u_opacity:n,u_color:s}),Dh=(l,n,s,u,d)=>o.extend(function(f,g,y){const w=g.imageManager.getPattern(f.toString()),{width:M,height:I}=g.imageManager.getPixelSize(),P=Math.pow(2,y.tileID.overscaledZ),O=y.tileSize*Math.pow(2,g.transform.tileZoom)/P,N=O*(y.tileID.canonical.x+y.tileID.wrap*P),G=O*y.tileID.canonical.y;return{u_image:0,u_pattern_tl:w.tl,u_pattern_br:w.br,u_texsize:[M,I],u_pattern_size:w.displaySize,u_tile_units_to_pixels:1/ai(y,1,g.transform.tileZoom),u_pixel_coord_upper:[N>>16,G>>16],u_pixel_coord_lower:[65535&N,65535&G]}}(u,s,d),{u_matrix:l,u_opacity:n}),Nl={fillExtrusion:l=>({u_matrix:new o.UniformMatrix4f(l),u_lightpos:new o.Uniform3f(l),u_lightintensity:new o.Uniform1f(l),u_lightcolor:new o.Uniform3f(l),u_vertical_gradient:new o.Uniform1f(l),u_opacity:new o.Uniform1f(l),u_edge_radius:new o.Uniform1f(l),u_ao:new o.Uniform2f(l),u_tile_id:new o.Uniform3f(l),u_zoom_transition:new o.Uniform1f(l),u_inv_rot_matrix:new o.UniformMatrix4f(l),u_merc_center:new o.Uniform2f(l),u_up_dir:new o.Uniform3f(l),u_height_lift:new o.Uniform1f(l)}),fillExtrusionPattern:l=>({u_matrix:new o.UniformMatrix4f(l),u_lightpos:new o.Uniform3f(l),u_lightintensity:new o.Uniform1f(l),u_lightcolor:new o.Uniform3f(l),u_vertical_gradient:new o.Uniform1f(l),u_height_factor:new o.Uniform1f(l),u_edge_radius:new o.Uniform1f(l),u_ao:new o.Uniform2f(l),u_tile_id:new o.Uniform3f(l),u_zoom_transition:new o.Uniform1f(l),u_inv_rot_matrix:new o.UniformMatrix4f(l),u_merc_center:new o.Uniform2f(l),u_up_dir:new o.Uniform3f(l),u_height_lift:new o.Uniform1f(l),u_image:new o.Uniform1i(l),u_texsize:new o.Uniform2f(l),u_pixel_coord_upper:new o.Uniform2f(l),u_pixel_coord_lower:new o.Uniform2f(l),u_tile_units_to_pixels:new o.Uniform1f(l),u_opacity:new o.Uniform1f(l)}),fill:l=>({u_matrix:new o.UniformMatrix4f(l)}),fillPattern:l=>({u_matrix:new o.UniformMatrix4f(l),u_image:new o.Uniform1i(l),u_texsize:new o.Uniform2f(l),u_pixel_coord_upper:new o.Uniform2f(l),u_pixel_coord_lower:new o.Uniform2f(l),u_tile_units_to_pixels:new o.Uniform1f(l)}),fillOutline:l=>({u_matrix:new o.UniformMatrix4f(l),u_world:new o.Uniform2f(l)}),fillOutlinePattern:l=>({u_matrix:new o.UniformMatrix4f(l),u_world:new o.Uniform2f(l),u_image:new o.Uniform1i(l),u_texsize:new o.Uniform2f(l),u_pixel_coord_upper:new o.Uniform2f(l),u_pixel_coord_lower:new o.Uniform2f(l),u_tile_units_to_pixels:new o.Uniform1f(l)}),circle:l=>({u_camera_to_center_distance:new o.Uniform1f(l),u_extrude_scale:new o.UniformMatrix2f(l),u_device_pixel_ratio:new o.Uniform1f(l),u_matrix:new o.UniformMatrix4f(l),u_inv_rot_matrix:new o.UniformMatrix4f(l),u_merc_center:new o.Uniform2f(l),u_tile_id:new o.Uniform3f(l),u_zoom_transition:new o.Uniform1f(l),u_up_dir:new o.Uniform3f(l)}),collisionBox:l=>({u_matrix:new o.UniformMatrix4f(l),u_camera_to_center_distance:new o.Uniform1f(l),u_extrude_scale:new o.Uniform2f(l)}),collisionCircle:l=>({u_matrix:new o.UniformMatrix4f(l),u_inv_matrix:new o.UniformMatrix4f(l),u_camera_to_center_distance:new o.Uniform1f(l),u_viewport_size:new o.Uniform2f(l)}),debug:l=>({u_color:new o.UniformColor(l),u_matrix:new o.UniformMatrix4f(l),u_overlay:new o.Uniform1i(l),u_overlay_scale:new o.Uniform1f(l)}),clippingMask:l=>({u_matrix:new o.UniformMatrix4f(l)}),heatmap:l=>({u_extrude_scale:new o.Uniform1f(l),u_intensity:new o.Uniform1f(l),u_matrix:new o.UniformMatrix4f(l),u_inv_rot_matrix:new o.UniformMatrix4f(l),u_merc_center:new o.Uniform2f(l),u_tile_id:new o.Uniform3f(l),u_zoom_transition:new o.Uniform1f(l),u_up_dir:new o.Uniform3f(l)}),heatmapTexture:l=>({u_image:new o.Uniform1i(l),u_color_ramp:new o.Uniform1i(l),u_opacity:new o.Uniform1f(l)}),hillshade:l=>({u_matrix:new o.UniformMatrix4f(l),u_image:new o.Uniform1i(l),u_latrange:new o.Uniform2f(l),u_light:new o.Uniform2f(l),u_shadow:new o.UniformColor(l),u_highlight:new o.UniformColor(l),u_accent:new o.UniformColor(l)}),hillshadePrepare:l=>({u_matrix:new o.UniformMatrix4f(l),u_image:new o.Uniform1i(l),u_dimension:new o.Uniform2f(l),u_zoom:new o.Uniform1f(l),u_unpack:new o.Uniform4f(l)}),line:l=>({u_matrix:new o.UniformMatrix4f(l),u_pixels_to_tile_units:new o.UniformMatrix2f(l),u_device_pixel_ratio:new o.Uniform1f(l),u_units_to_pixels:new o.Uniform2f(l),u_dash_image:new o.Uniform1i(l),u_gradient_image:new o.Uniform1i(l),u_image_height:new o.Uniform1f(l),u_texsize:new o.Uniform2f(l),u_tile_units_to_pixels:new o.Uniform1f(l),u_alpha_discard_threshold:new o.Uniform1f(l),u_trim_offset:new o.Uniform2f(l)}),linePattern:l=>({u_matrix:new o.UniformMatrix4f(l),u_texsize:new o.Uniform2f(l),u_pixels_to_tile_units:new o.UniformMatrix2f(l),u_device_pixel_ratio:new o.Uniform1f(l),u_image:new o.Uniform1i(l),u_units_to_pixels:new o.Uniform2f(l),u_tile_units_to_pixels:new o.Uniform1f(l),u_alpha_discard_threshold:new o.Uniform1f(l)}),raster:l=>({u_matrix:new o.UniformMatrix4f(l),u_tl_parent:new o.Uniform2f(l),u_scale_parent:new o.Uniform1f(l),u_fade_t:new o.Uniform1f(l),u_opacity:new o.Uniform1f(l),u_image0:new o.Uniform1i(l),u_image1:new o.Uniform1i(l),u_brightness_low:new o.Uniform1f(l),u_brightness_high:new o.Uniform1f(l),u_saturation_factor:new o.Uniform1f(l),u_contrast_factor:new o.Uniform1f(l),u_spin_weights:new o.Uniform3f(l),u_perspective_transform:new o.Uniform2f(l)}),symbolIcon:l=>({u_is_size_zoom_constant:new o.Uniform1i(l),u_is_size_feature_constant:new o.Uniform1i(l),u_size_t:new o.Uniform1f(l),u_size:new o.Uniform1f(l),u_camera_to_center_distance:new o.Uniform1f(l),u_rotate_symbol:new o.Uniform1i(l),u_aspect_ratio:new o.Uniform1f(l),u_fade_change:new o.Uniform1f(l),u_matrix:new o.UniformMatrix4f(l),u_label_plane_matrix:new o.UniformMatrix4f(l),u_coord_matrix:new o.UniformMatrix4f(l),u_is_text:new o.Uniform1i(l),u_pitch_with_map:new o.Uniform1i(l),u_texsize:new o.Uniform2f(l),u_tile_id:new o.Uniform3f(l),u_zoom_transition:new o.Uniform1f(l),u_inv_rot_matrix:new o.UniformMatrix4f(l),u_merc_center:new o.Uniform2f(l),u_camera_forward:new o.Uniform3f(l),u_tile_matrix:new o.UniformMatrix4f(l),u_up_vector:new o.Uniform3f(l),u_ecef_origin:new o.Uniform3f(l),u_texture:new o.Uniform1i(l)}),symbolSDF:l=>({u_is_size_zoom_constant:new o.Uniform1i(l),u_is_size_feature_constant:new o.Uniform1i(l),u_size_t:new o.Uniform1f(l),u_size:new o.Uniform1f(l),u_camera_to_center_distance:new o.Uniform1f(l),u_rotate_symbol:new o.Uniform1i(l),u_aspect_ratio:new o.Uniform1f(l),u_fade_change:new o.Uniform1f(l),u_matrix:new o.UniformMatrix4f(l),u_label_plane_matrix:new o.UniformMatrix4f(l),u_coord_matrix:new o.UniformMatrix4f(l),u_is_text:new o.Uniform1i(l),u_pitch_with_map:new o.Uniform1i(l),u_texsize:new o.Uniform2f(l),u_texture:new o.Uniform1i(l),u_gamma_scale:new o.Uniform1f(l),u_device_pixel_ratio:new o.Uniform1f(l),u_tile_id:new o.Uniform3f(l),u_zoom_transition:new o.Uniform1f(l),u_inv_rot_matrix:new o.UniformMatrix4f(l),u_merc_center:new o.Uniform2f(l),u_camera_forward:new o.Uniform3f(l),u_tile_matrix:new o.UniformMatrix4f(l),u_up_vector:new o.Uniform3f(l),u_ecef_origin:new o.Uniform3f(l),u_is_halo:new o.Uniform1i(l)}),symbolTextAndIcon:l=>({u_is_size_zoom_constant:new o.Uniform1i(l),u_is_size_feature_constant:new o.Uniform1i(l),u_size_t:new o.Uniform1f(l),u_size:new o.Uniform1f(l),u_camera_to_center_distance:new o.Uniform1f(l),u_rotate_symbol:new o.Uniform1i(l),u_aspect_ratio:new o.Uniform1f(l),u_fade_change:new o.Uniform1f(l),u_matrix:new o.UniformMatrix4f(l),u_label_plane_matrix:new o.UniformMatrix4f(l),u_coord_matrix:new o.UniformMatrix4f(l),u_is_text:new o.Uniform1i(l),u_pitch_with_map:new o.Uniform1i(l),u_texsize:new o.Uniform2f(l),u_texsize_icon:new o.Uniform2f(l),u_texture:new o.Uniform1i(l),u_texture_icon:new o.Uniform1i(l),u_gamma_scale:new o.Uniform1f(l),u_device_pixel_ratio:new o.Uniform1f(l),u_is_halo:new o.Uniform1i(l)}),background:l=>({u_matrix:new o.UniformMatrix4f(l),u_opacity:new o.Uniform1f(l),u_color:new o.UniformColor(l)}),backgroundPattern:l=>({u_matrix:new o.UniformMatrix4f(l),u_opacity:new o.Uniform1f(l),u_image:new o.Uniform1i(l),u_pattern_tl:new o.Uniform2f(l),u_pattern_br:new o.Uniform2f(l),u_texsize:new o.Uniform2f(l),u_pattern_size:new o.Uniform2f(l),u_pixel_coord_upper:new o.Uniform2f(l),u_pixel_coord_lower:new o.Uniform2f(l),u_tile_units_to_pixels:new o.Uniform1f(l)}),terrainRaster:Al,terrainDepth:Al,skybox:l=>({u_matrix:new o.UniformMatrix4f(l),u_sun_direction:new o.Uniform3f(l),u_cubemap:new o.Uniform1i(l),u_opacity:new o.Uniform1f(l),u_temporal_offset:new o.Uniform1f(l)}),skyboxGradient:l=>({u_matrix:new o.UniformMatrix4f(l),u_color_ramp:new o.Uniform1i(l),u_center_direction:new o.Uniform3f(l),u_radius:new o.Uniform1f(l),u_opacity:new o.Uniform1f(l),u_temporal_offset:new o.Uniform1f(l)}),skyboxCapture:l=>({u_matrix_3f:new o.UniformMatrix3f(l),u_sun_direction:new o.Uniform3f(l),u_sun_intensity:new o.Uniform1f(l),u_color_tint_r:new o.Uniform4f(l),u_color_tint_m:new o.Uniform4f(l),u_luminance:new o.Uniform1f(l)}),globeRaster:l=>({u_proj_matrix:new o.UniformMatrix4f(l),u_globe_matrix:new o.UniformMatrix4f(l),u_normalize_matrix:new o.UniformMatrix4f(l),u_merc_matrix:new o.UniformMatrix4f(l),u_zoom_transition:new o.Uniform1f(l),u_merc_center:new o.Uniform2f(l),u_image0:new o.Uniform1i(l),u_grid_matrix:new o.UniformMatrix3f(l),u_skirt_height:new o.Uniform1f(l),u_frustum_tl:new o.Uniform3f(l),u_frustum_tr:new o.Uniform3f(l),u_frustum_br:new o.Uniform3f(l),u_frustum_bl:new o.Uniform3f(l),u_globe_pos:new o.Uniform3f(l),u_globe_radius:new o.Uniform1f(l),u_viewport:new o.Uniform2f(l)}),globeAtmosphere:l=>({u_frustum_tl:new o.Uniform3f(l),u_frustum_tr:new o.Uniform3f(l),u_frustum_br:new o.Uniform3f(l),u_frustum_bl:new o.Uniform3f(l),u_horizon:new o.Uniform1f(l),u_transition:new o.Uniform1f(l),u_fadeout_range:new o.Uniform1f(l),u_color:new o.Uniform4f(l),u_high_color:new o.Uniform4f(l),u_space_color:new o.Uniform4f(l),u_star_intensity:new o.Uniform1f(l),u_star_density:new o.Uniform1f(l),u_star_size:new o.Uniform1f(l),u_temporal_offset:new o.Uniform1f(l),u_horizon_angle:new o.Uniform1f(l),u_rotation_matrix:new o.UniformMatrix4f(l)})};let Sa;function Bs(l,n,s,u,d,f,g){const y=l.context,w=y.gl,M=l.transform,I=l.useProgram("collisionBox"),P=[];let O=0,N=0;for(let K=0;K<u.length;K++){const re=u[K],le=n.getTile(re),oe=le.getBucket(s);if(!oe)continue;const fe=Yn(re,oe,M);let pe=fe;d[0]===0&&d[1]===0||(pe=l.translatePosMatrix(fe,le,d,f));const ve=g?oe.textCollisionBox:oe.iconCollisionBox,Ne=oe.collisionCircleArray;
1311if(Ne.length>0){const ge=o.create(),Le=pe;o.mul(ge,oe.placementInvProjMatrix,M.glCoordMatrix),o.mul(ge,ge,oe.placementViewportMatrix),P.push({circleArray:Ne,circleOffset:N,transform:Le,invTransform:ge,projection:oe.getProjection()}),O+=Ne.length/4,N=O}ve&&(l.terrain&&l.terrain.setupElevationDraw(le,I),I.draw(y,w.LINES,o.DepthMode.disabled,o.StencilMode.disabled,l.colorModeForRenderPass(),o.CullFaceMode.disabled,Bl(pe,M,le,oe.getProjection()),s.id,ve.layoutVertexBuffer,ve.indexBuffer,ve.segments,null,M.zoom,null,[ve.collisionVertexBuffer,ve.collisionVertexBufferExt]))}if(!g||!P.length)return;const G=l.useProgram("collisionCircle"),j=new o.StructArrayLayout2f1f2i16;j.resize(4*O),j._trim();let q=0;for(const K of P)for(let re=0;re<K.circleArray.length/4;re++){const le=4*re,oe=K.circleArray[le+0],fe=K.circleArray[le+1],pe=K.circleArray[le+2],ve=K.circleArray[le+3];j.emplace(q++,oe,fe,pe,ve,0),j.emplace(q++,oe,fe,pe,ve,1),j.emplace(q++,oe,fe,pe,ve,2),j.emplace(q++,oe,fe,pe,ve,3)}(!Sa||Sa.length<2*O)&&(Sa=function(K){const re=2*K,le=new o.StructArrayLayout3ui6;le.resize(re),le._trim();for(let oe=0;oe<re;oe++){const fe=6*oe;le.uint16[fe+0]=4*oe+0,le.uint16[fe+1]=4*oe+1,le.uint16[fe+2]=4*oe+2,le.uint16[fe+3]=4*oe+2,le.uint16[fe+4]=4*oe+3,le.uint16[fe+5]=4*oe+0}return le}(O));const z=y.createIndexBuffer(Sa,!0),V=y.createVertexBuffer(j,o.collisionCircleLayout.members,!0);for(const K of P){const re={u_matrix:K.transform,u_inv_matrix:K.invTransform,u_camera_to_center_distance:(H=M).getCameraToCenterDistance(K.projection),u_viewport_size:[H.width,H.height]};G.draw(y,w.TRIANGLES,o.DepthMode.disabled,o.StencilMode.disabled,l.colorModeForRenderPass(),o.CullFaceMode.disabled,re,s.id,V,z,o.SegmentVector.simpleSegment(0,2*K.circleOffset,K.circleArray.length,K.circleArray.length/2),null,M.zoom)}var H;V.destroy(),z.destroy()}const uu=o.create();function jl({width:l,height:n,anchor:s,textOffset:u,textScale:d},f){const{horizontalAlign:g,verticalAlign:y}=o.getAnchorAlignment(s),w=-(g-.5)*l,M=-(y-.5)*n,I=o.evaluateVariableOffset(s,u);return new o.Point((w/d+I[0])*f,(M/d+I[1])*f)}function Rh(l,n,s,u,d,f,g,y,w,M,I){const P=l.text.placedSymbolArray,O=l.text.dynamicLayoutVertexArray,N=l.icon.dynamicLayoutVertexArray,G={},j=l.getProjection(),q=zi(y,j,f),z=f.elevation,V=j.upVectorScale(y.canonical,f.center.lat,f.worldSize).metersToTile;O.clear();for(let H=0;H<P.length;H++){const K=P.get(H),{tileAnchorX:re,tileAnchorY:le,numGlyphs:oe}=K,fe=K.hidden||!K.crossTileID||l.allowVerticalPlacement&&!K.placedOrientation?null:u[K.crossTileID];if(fe){let pe=0,ve=0,Ne=0;if(z){const qe=z?z.getAtTileOffset(y,re,le):0,[pt,Pt,ut]=j.upVector(y.canonical,re,le);pe=qe*pt*V,ve=qe*Pt*V,Ne=qe*ut*V}let[ge,Le,Te,Ve]=ln(K.projectedAnchorX+pe,K.projectedAnchorY+ve,K.projectedAnchorZ+Ne,s?q:g);const xe=Yc(f.getCameraToCenterDistance(j),Ve);let ze=d.evaluateSizeForFeature(l.textSizeData,M,K)*xe/o.ONE_EM;s&&(ze*=l.tilePixelRatio/w);const Ge=jl(fe,ze);s?({x:ge,y:Le,z:Te}=j.projectTilePoint(re+Ge.x,le+Ge.y,y.canonical),[ge,Le,Te]=ln(ge+pe,Le+ve,Te+Ne,g)):(n&&Ge._rotate(-f.angle),ge+=Ge.x,Le+=Ge.y,Te=0);const Fe=l.allowVerticalPlacement&&K.placedOrientation===o.WritingMode.vertical?Math.PI/2:0;for(let qe=0;qe<oe;qe++)o.addDynamicAttributes(O,ge,Le,Te,Fe);I&&K.associatedIconIndex>=0&&(G[K.associatedIconIndex]={x:ge,y:Le,z:Te,angle:Fe})}else cr(oe,O)}if(I){N.clear();const H=l.icon.placedSymbolArray;for(let K=0;K<H.length;K++){const re=H.get(K),{numGlyphs:le}=re,oe=G[K];if(re.hidden||!oe)cr(le,N);else{const{x:fe,y:pe,z:ve,angle:Ne}=oe;for(let ge=0;ge<le;ge++)o.addDynamicAttributes(N,fe,pe,ve,Ne)}}l.icon.dynamicLayoutVertexBuffer.updateData(N)}l.text.dynamicLayoutVertexBuffer.updateData(O)}function Gl(l,n,s){return s.iconsInText&&n?"symbolTextAndIcon":l?"symbolSDF":"symbolIcon"}function hu(l,n,s,u,d,f,g,y,w,M,I,P){const O=l.context,N=O.gl,G=l.transform,j=y==="map",q=w==="map",z=j&&s.layout.get("symbol-placement")!=="point",V=j&&!q&&!z,H=s.layout.get("symbol-sort-key").constantOr(1)!==void 0;let K=!1;const re=l.depthModeForSublayer(0,o.DepthMode.ReadOnly),le=[o.mercatorXfromLng(G.center.lng),o.mercatorYfromLat(G.center.lat)],oe=s.layout.get("text-variable-anchor"),fe=G.projection.name==="globe",pe=[],ve=[0,-1,0];let Ne=ve;!fe&&!G.mercatorFromTransition||j||(Ne=function(ge){const Le=ge._camera.getWorldToCamera(ge.worldSize,1),Te=o.multiply([],Le,ge.globeMatrix);o.invert(Te,Te);const Ve=[0,0,0],xe=[0,1,0,0];return o.transformMat4$1(xe,xe,Te),Ve[0]=xe[0],Ve[1]=xe[1],Ve[2]=xe[2],o.normalize(Ve,Ve),Ve}(G));for(const ge of u){const Le=n.getTile(ge),Te=Le.getBucket(s);if(!Te||Te.projection.name==="mercator"&&fe)continue;const Ve=d?Te.text:Te.icon;if(!Ve||Te.fullyClipped||!Ve.segments.get().length)continue;const xe=Ve.programConfigurations.get(s.id),ze=d||Te.sdfIcons,Ge=d?Te.textSizeData:Te.iconSizeData,Fe=q||G.pitch!==0,qe=o.evaluateSizeForZoom(Ge,G.zoom);let pt,Pt,ut,wt,Ht=[0,0],Zt=null;if(d)Pt=Le.glyphAtlasTexture,ut=N.LINEAR,pt=Le.glyphAtlasTexture.size,Te.iconsInText&&(Ht=Le.imageAtlasTexture.size,Zt=Le.imageAtlasTexture,wt=Fe||l.options.rotating||l.options.zooming||Ge.kind==="composite"||Ge.kind==="camera"?N.LINEAR:N.NEAREST);else{const Wr=s.layout.get("icon-size").constantOr(0)!==1||Te.iconsNeedLinear;Pt=Le.imageAtlasTexture,ut=ze||l.options.rotating||l.options.zooming||Wr||Fe?N.LINEAR:N.NEAREST,pt=Le.imageAtlasTexture.size}const dt=Te.projection.name==="globe",di=dt?Ne:ve,fi=dt?o.globeToMercatorTransition(G.zoom):0,mi=zi(ge,Te.getProjection(),G),_i=G.calculatePixelsToTileUnitsMatrix(Le),Mn=Ce(mi,Le.tileID.canonical,q,j,G,Te.getProjection(),_i),un=l.terrain&&q&&z?o.invert(o.create(),Mn):uu,er=qi(mi,Le.tileID.canonical,q,j,G,Te.getProjection(),_i),Er=oe&&Te.hasTextData(),Li=s.layout.get("icon-text-fit")!=="none"&&Er&&Te.hasIconData();if(z){const Wr=G.elevation,lo=Wr?Wr.getAtTileOffsetFunc(ge,G.center.lat,G.worldSize,Te.getProjection()):null,Ro=Fr(mi,Le.tileID.canonical,q,j,G,Te.getProjection(),_i);ml(Te,mi,l,d,Ro,er,q,M,lo,ge)}const gi=z||d&&oe||Li,li=l.translatePosMatrix(mi,Le,f,g),Wi=gi?uu:Mn,zn=l.translatePosMatrix(er,Le,f,g,!0),Pi=Te.getProjection().createInversionMatrix(G,ge.canonical),On=[];l.terrainRenderModeElevated()&&q&&On.push("PITCH_WITH_MAP_TERRAIN"),dt&&On.push("PROJECTION_GLOBE_VIEW"),gi&&On.push("PROJECTED_POS_ON_VIEWPORT");const Na=ze&&s.paint.get(d?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Do;Do=ze?Te.iconsInText?cu(Ge.kind,qe,V,q,l,li,Wi,zn,pt,Ht,ge,fi,le,Pi,di,Te.getProjection()):Ea(Ge.kind,qe,V,q,l,li,Wi,zn,d,pt,!0,ge,fi,le,Pi,di,Te.getProjection()):Ul(Ge.kind,qe,V,q,l,li,Wi,zn,d,pt,ge,fi,le,Pi,di,Te.getProjection());const Xs={program:l.useProgram(Gl(ze,d,Te),xe,On),buffers:Ve,uniformValues:Do,atlasTexture:Pt,atlasTextureIcon:Zt,atlasInterpolation:ut,atlasInterpolationIcon:wt,isSDF:ze,hasHalo:Na,tile:Le,labelPlaneMatr
1311ixInv:un};if(H&&Te.canOverlap){K=!0;const Wr=Ve.segments.get();for(const lo of Wr)pe.push({segments:new o.SegmentVector([lo]),sortKey:lo.sortKey,state:Xs})}else pe.push({segments:Ve.segments,sortKey:0,state:Xs})}K&&pe.sort((ge,Le)=>ge.sortKey-Le.sortKey);for(const ge of pe){const Le=ge.state;if(l.terrain&&l.terrain.setupElevationDraw(Le.tile,Le.program,{useDepthForOcclusion:!fe,labelPlaneMatrixInv:Le.labelPlaneMatrixInv}),O.activeTexture.set(N.TEXTURE0),Le.atlasTexture.bind(Le.atlasInterpolation,N.CLAMP_TO_EDGE),Le.atlasTextureIcon&&(O.activeTexture.set(N.TEXTURE1),Le.atlasTextureIcon&&Le.atlasTextureIcon.bind(Le.atlasInterpolationIcon,N.CLAMP_TO_EDGE)),Le.isSDF){const Te=Le.uniformValues;Le.hasHalo&&(Te.u_is_halo=1,Os(Le.buffers,ge.segments,s,l,Le.program,re,I,P,Te)),Te.u_is_halo=0}Os(Le.buffers,ge.segments,s,l,Le.program,re,I,P,Le.uniformValues)}}function Os(l,n,s,u,d,f,g,y,w){const M=u.context,I=[l.dynamicLayoutVertexBuffer,l.opacityVertexBuffer,l.globeExtVertexBuffer];d.draw(M,M.gl.TRIANGLES,f,g,y,o.CullFaceMode.disabled,w,s.id,l.layoutVertexBuffer,l.indexBuffer,n,s.paint,u.transform.zoom,l.programConfigurations.get(s.id),I)}function du(l,n,s,u,d,f,g){const y=l.context.gl,w=s.paint.get("fill-pattern"),M=w&&w.constantOr(1);let I,P,O,N,G;g?(P=M&&!s.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",I=y.LINES):(P=M?"fillPattern":"fill",I=y.TRIANGLES);for(const j of u){const q=n.getTile(j);if(M&&!q.patternsLoaded())continue;const z=q.getBucket(s);if(!z)continue;l.prepareDrawTile();const V=z.programConfigurations.get(s.id),H=l.useProgram(P,V);M&&(l.context.activeTexture.set(y.TEXTURE0),q.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),V.updatePaintBuffers());const K=w.constantOr(null);if(K&&q.imageAtlas){const le=q.imageAtlas.patternPositions[K.toString()];le&&V.setConstantPatternPositions(le)}const re=l.translatePosMatrix(j.projMatrix,q,s.paint.get("fill-translate"),s.paint.get("fill-translate-anchor"));if(g){N=z.indexBuffer2,G=z.segments2;const le=l.terrain&&l.terrain.renderingToTexture?l.terrain.drapeBufferSize:[y.drawingBufferWidth,y.drawingBufferHeight];O=P==="fillOutlinePattern"&&M?Ph(re,l,q,le):kh(re,le)}else N=z.indexBuffer,G=z.segments,O=M?Ll(re,l,q):ko(re);l.prepareDrawProgram(l.context,H,j.toUnwrapped()),H.draw(l.context,I,d,l.stencilModeForClipping(j),f,o.CullFaceMode.disabled,O,s.id,z.layoutVertexBuffer,N,G,s.paint,l.transform.zoom,V)}}function Ia(l,n,s,u,d,f,g){const y=l.context,w=y.gl,M=l.transform,I=s.paint.get("fill-extrusion-pattern"),P=I.constantOr(1),O=s.paint.get("fill-extrusion-opacity"),N=[s.paint.get("fill-extrusion-ambient-occlusion-intensity"),s.paint.get("fill-extrusion-ambient-occlusion-radius")],G=s.layout.get("fill-extrusion-edge-radius"),j=G>0&&!s.paint.get("fill-extrusion-rounded-roof"),q=j?0:G,z=M.projection.name==="globe"?o.fillExtrusionHeightLift():0,V=M.projection.name==="globe",H=V?o.globeToMercatorTransition(M.zoom):0,K=[o.mercatorXfromLng(M.center.lng),o.mercatorYfromLat(M.center.lat)],re=[];V&&re.push("PROJECTION_GLOBE_VIEW"),N[0]>0&&re.push("FAUX_AO"),j&&re.push("ZERO_ROOF_RADIUS");for(const le of u){const oe=n.getTile(le),fe=oe.getBucket(s);if(!fe||fe.projection.name!==M.projection.name)continue;const pe=fe.programConfigurations.get(s.id),ve=l.useProgram(P?"fillExtrusionPattern":"fillExtrusion",pe,re);if(l.terrain){const ze=l.terrain;if(l.style.terrainSetForDrapingOnly())ze.setupElevationDraw(oe,ve,{useMeterToDem:!0});else{if(!fe.enableTerrain)continue;if(ze.setupElevationDraw(oe,ve,{useMeterToDem:!0}),pu(y,n,le,fe,s,ze),!fe.centroidVertexBuffer){const Ge=ve.attributes.a_centroid_pos;Ge!==void 0&&w.vertexAttrib2f(Ge,0,0)}}}P&&(l.context.activeTexture.set(w.TEXTURE0),oe.imageAtlasTexture.bind(w.LINEAR,w.CLAMP_TO_EDGE),pe.updatePaintBuffers());const Ne=I.constantOr(null);if(Ne&&oe.imageAtlas){const ze=oe.imageAtlas.patternPositions[Ne.toString()];ze&&pe.setConstantPatternPositions(ze)}const ge=l.translatePosMatrix(le.projMatrix,oe,s.paint.get("fill-extrusion-translate"),s.paint.get("fill-extrusion-translate-anchor")),Le=M.projection.createInversionMatrix(M,le.canonical),Te=s.paint.get("fill-extrusion-vertical-gradient"),Ve=P?su(ge,l,Te,O,N,q,le,oe,z,H,K,Le):zl(ge,l,Te,O,N,q,le,z,H,K,Le);l.prepareDrawProgram(y,ve,le.toUnwrapped());const xe=[];l.terrain&&xe.push(fe.centroidVertexBuffer),V&&xe.push(fe.layoutVertexExtBuffer),ve.draw(y,y.gl.TRIANGLES,d,f,g,o.CullFaceMode.backCCW,Ve,s.id,fe.layoutVertexBuffer,fe.indexBuffer,fe.segments,s.paint,l.transform.zoom,pe,xe)}}function pu(l,n,s,u,d,f){const g=[z=>{let V=z.canonical.x-1,H=z.wrap;
vendor: 7,921 bytes, line 1311
1311return V<0&&(V=(1<<z.canonical.z)-1,H--),new o.OverscaledTileID(z.overscaledZ,H,z.canonical.z,V,z.canonical.y)},z=>{let V=z.canonical.x+1,H=z.wrap;return V===1<<z.canonical.z&&(V=0,H++),new o.OverscaledTileID(z.overscaledZ,H,z.canonical.z,V,z.canonical.y)},z=>new o.OverscaledTileID(z.overscaledZ,z.wrap,z.canonical.z,z.canonical.x,(z.canonical.y===0?1<<z.canonical.z:z.canonical.y)-1),z=>new o.OverscaledTileID(z.overscaledZ,z.wrap,z.canonical.z,z.canonical.x,z.canonical.y===(1<<z.canonical.z)-1?0:z.canonical.y+1)],y=z=>{const V=n.getSource().minzoom,H=re=>{const le=n.getTileByID(re);if(le&&le.hasData())return le.getBucket(d)},K=[0,-1,1];for(const re of K){if(z.overscaledZ+re<V)continue;const le=H(z.calculateScaledKey(z.overscaledZ+re));if(le)return le}},w=[0,0,0],M=(z,V)=>(w[0]=Math.min(z.min.y,V.min.y),w[1]=Math.max(z.max.y,V.max.y),w[2]=o.EXTENT-V.min.x>z.max.x?V.min.x-o.EXTENT:z.max.x,w),I=(z,V)=>(w[0]=Math.min(z.min.x,V.min.x),w[1]=Math.max(z.max.x,V.max.x),w[2]=o.EXTENT-V.min.y>z.max.y?V.min.y-o.EXTENT:z.max.y,w),P=[(z,V)=>M(z,V),(z,V)=>M(V,z),(z,V)=>I(z,V),(z,V)=>I(V,z)],O=new o.Point(0,0);let N,G,j;const q=(z,V,H,K,re)=>{const le=[[K?H:z,K?z:H,0],[K?H:V,K?V:H,0]],oe=re<0?o.EXTENT+re:re,fe=[K?oe:(z+V)/2,K?(z+V)/2:oe,0];return H===0&&re<0||H!==0&&re>0?f.getForTilePoints(j,[fe],!0,G):le.push(fe),f.getForTilePoints(s,le,!0,N),Math.max(le[0][2],le[1][2],fe[2])/f.exaggeration()};for(let z=0;z<4;z++){const V=(z<2?1:5)-z,H=u.borders[z];if(H.length===0)continue;const K=j=g[z](s),re=y(K);if(!(re&&re instanceof o.FillExtrusionBucket&&re.enableTerrain)||u.borderDoneWithNeighborZ[z]===re.canonical.z&&re.borderDoneWithNeighborZ[V]===u.canonical.z||(G=f.findDEMTileFor(K),!G||!G.dem))continue;if(!N){const pe=f.findDEMTileFor(s);if(!pe||!pe.dem)return;N=pe}const le=re.borders[V];let oe=0;const fe=re.borderDoneWithNeighborZ[V]!==u.canonical.z;if(u.canonical.z===re.canonical.z){for(let pe=0;pe<H.length;pe++){const ve=u.featuresOnBorder[H[pe]],Ne=ve.borders[z];let ge;for(;oe<le.length&&(ge=re.featuresOnBorder[le[oe]],!(ge.borders[V][1]>Ne[0]+3));)fe&&re.encodeCentroid(void 0,ge,!1),oe++;if(ge&&oe<le.length){const Le=oe;let Te=0;for(;!(ge.borders[V][0]>Ne[1]-3)&&(Te++,++oe!==le.length);)ge=re.featuresOnBorder[le[oe]];if(ge=re.featuresOnBorder[le[Le]],ve.intersectsCount()>1||ge.intersectsCount()>1||Te!==1){Te!==1&&(oe=Le),u.encodeCentroid(void 0,ve,!1),fe&&re.encodeCentroid(void 0,ge,!1);continue}const Ve=P[z](ve,ge),xe=z%2?o.EXTENT-1:0;O.x=q(Ve[0],Math.min(o.EXTENT-1,Ve[1]),xe,z<2,Ve[2]),O.y=0,u.encodeCentroid(O,ve,!1),fe&&re.encodeCentroid(O,ge,!1)}else u.encodeCentroid(void 0,ve,!1)}u.borderDoneWithNeighborZ[z]=re.canonical.z,u.needsCentroidUpdate=!0,fe&&(re.borderDoneWithNeighborZ[V]=u.canonical.z,re.needsCentroidUpdate=!0)}else{for(const pe of H)u.encodeCentroid(void 0,u.featuresOnBorder[pe],!1);if(fe){for(const pe of le)re.encodeCentroid(void 0,re.featuresOnBorder[pe],!1);re.borderDoneWithNeighborZ[V]=u.canonical.z,re.needsCentroidUpdate=!0}u.borderDoneWithNeighborZ[z]=re.canonical.z,u.needsCentroidUpdate=!0}}(u.needsCentroidUpdate||!u.centroidVertexBuffer&&u.centroidVertexArray.length!==0)&&u.uploadCentroid(l)}const Jo=new o.Color(1,0,0,1),Bh=new o.Color(0,1,0,1),Oh=new o.Color(0,0,1,1),Fh=new o.Color(1,0,1,1),Uh=new o.Color(0,1,1,1);function Vh(l,n,s){const u=l.context,d=l.transform,f=u.gl,g=d.projection.name==="globe",y=g?["PROJECTION_GLOBE_VIEW"]:null;let w=s.projMatrix;if(g&&o.globeToMercatorTransition(d.zoom)>0){const ve=o.transitionTileAABBinECEF(s.canonical,d),Ne=o.globeDenormalizeECEF(ve);w=o.multiply(new Float32Array(16),d.globeMatrix,Ne),o.multiply(w,d.projMatrix,w)}const M=l.useProgram("debug",null,y),I=n.getTileByID(s.key);l.terrain&&l.terrain.setupElevationDraw(I,M);const P=o.DepthMode.disabled,O=o.StencilMode.disabled,N=l.colorModeForRenderPass(),G="$debug";u.activeTexture.set(f.TEXTURE0),l.emptyTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),g?I._makeGlobeTileDebugBuffers(l.context,d):I._makeDebugTileBoundsBuffers(l.context,d.projection);const j=I._tileDebugBuffer||l.debugBuffer,q=I._tileDebugIndexBuffer||l.debugIndexBuffer,z=I._tileDebugSegments||l.debugSegments;M.draw(u,f.LINE_STRIP,P,O,N,o.CullFaceMode.disabled,wa(w,o.Color.red),G,j,q,z,null,null,null,[I._globeTileDebugBorderBuffer]);const V=I.latestRawTileData,H=Math.floor((V&&V.byteLength||0)/1024),K=n.getTile(s).tileSize,re=512/Math.min(K,512)*(s.overscaledZ/d.zoom)*.5;let le=s.canonical.toString();s.overscaledZ!==s.canonical.z&&(le+=` => ${s.overscaledZ}`),le+=` ${H}kb`,function(ve,Ne){ve.initDebugOverlayCanvas();const ge=ve.debugOverlayCanvas,Le=ve.context.gl,Te=ve.debugOverlayCanvas.getContext("2d");Te.clearRect(0,0,ge.width,ge.height),Te.shadowColor="white",Te.shadowBlur=2,Te.lineWidth=1.5,Te.strokeStyle="white",Te.textBaseline="top",Te.font="bold 36px Open Sans, sans-serif",Te.fillText(Ne,5,5),Te.strokeText(Ne,5,5),ve.debugOverlayTexture.update(ge),ve.debugOverlayTexture.bind(Le.LINEAR,Le.CLAMP_TO_EDGE)}(l,le);const oe=I._tileDebugTextBuffer||l.debugBuffer,fe=I._tileDebugTextIndexBuffer||l.quadTriangleIndexBuffer,pe=I._tileDebugTextSegments||l.debugSegments;M.draw(u,f.TRIANGLES,P,O,o.ColorMode.alphaBlended,o.CullFaceMode.disabled,wa(w,o.Color.transparent,re),G,oe,fe,pe,null,null,null,[I._globeTileDebugTextBuffer])}function fu(l,n,s,u){Qo(l,0,n+s/2,l.transform.width,s,u)}function Ma(l,n,s,u){Qo(l,n-s/2,0,s,l.transform.height,u)}function Qo(l,n,s,u,d,f){const g=l.context,y=g.gl;y.enable(y.SCISSOR_TEST),y.scissor(n*o.exported.devicePixelRatio,s*o.exported.devicePixelRatio,u*o.exported.devicePixelRatio,d*o.exported.devicePixelRatio),g.clear({color:f}),y.disable(y.SCISSOR_TEST)}const mu=o.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:_u}=mu;function Zr(l,n,s,u){l.emplaceBack(n,s,u)}class Aa{constructor(n){this.vertexArray=new o.StructArrayLayout3f12,this.indices=new o.StructArrayLayout3ui6,Zr(this.vertexArray,-1,-1,1),Zr(this.vertexArray,1,-1,1),Zr(this.vertexArray,-1,1,1),Zr(this.vertexArray,1,1,1),Zr(this.vertexArray,-1,-1,-1),Zr(this.vertexArray,1,-1,-1),Zr(this.vertexArray,-1,1,-1),Zr(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=n.createVertexBuffer(this.vertexArray,_u),this.indexBuffer=n.createIndexBuffer(this.indices),this.segment=o.SegmentVector.simpleSegment(0,0,36,12)}}function Qn(l,n,s,u,d,f){const g=l.gl,y=n.paint.get("sky-atmosphere-color"),w=n.paint.get("sky-atmosphere-halo-color"),M=n.paint.get("sky-atmosphere-sun-intensity"),I=((P,O,N,G,j)=>({u_matrix_3f:P,u_sun_direction:O,u_sun_intensity:N,u_color_tint_r:[G.r,G.g,G.b,G.a],u_color_tint_m:[j.r,j.g,j.b,j.a],u_luminance:5e-5}))(o.fromMat4(o.create$1(),u),d,M,y,w);g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_CUBE_MAP_POSITIVE_X+f,n.skyboxTexture,0),s.draw(l,g.TRIANGLES,o.DepthMode.disabled,o.StencilMode.disabled,o.ColorMode.unblended,o.CullFaceMode.frontCW,I,"skyboxCapture",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment)}const Fs=o.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class gu{constructor(n){const s=new o.StructArrayLayout5f20;s.emplaceBack(-1,1,1,0,0),s.emplaceBack(1,1,1,1,0),s.emplaceBack(1,-1,1,1,1),s.emplaceBack(-1,-1,1,0,1);const u=new o.StructArrayLayout3ui6;u.emplaceBack(0,1,2),u.emplaceBack(2,3,0),this.vertexBuffer=n.createVertexBuffer(s,Fs.members),this.indexBuffer=n.createIndexBuffer(u),this.segments=o.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}
1311const Po={symbol:function(l,n,s,u,d){if(l.renderPass!=="translucent")return;const f=o.StencilMode.disabled,g=l.colorModeForRenderPass();s.layout.get("text-variable-anchor")&&function(y,w,M,I,P,O,N){const G=w.transform,j=P==="map",q=O==="map";for(const z of y){const V=I.getTile(z),H=V.getBucket(M);if(!H||!H.text||!H.text.segments.get().length)continue;const K=o.evaluateSizeForZoom(H.textSizeData,G.zoom),re=zi(z,H.getProjection(),G),le=G.calculatePixelsToTileUnitsMatrix(V),oe=Ce(re,V.tileID.canonical,q,j,G,H.getProjection(),le),fe=M.layout.get("icon-text-fit")!=="none"&&H.hasIconData();if(K){const pe=Math.pow(2,G.zoom-V.tileID.overscaledZ);Rh(H,j,q,N,o.symbolSize,G,oe,z,pe,K,fe)}}}(u,l,s,n,s.layout.get("text-rotation-alignment"),s.layout.get("text-pitch-alignment"),d),s.paint.get("icon-opacity").constantOr(1)!==0&&hu(l,n,s,u,!1,s.paint.get("icon-translate"),s.paint.get("icon-translate-anchor"),s.layout.get("icon-rotation-alignment"),s.layout.get("icon-pitch-alignment"),s.layout.get("icon-keep-upright"),f,g),s.paint.get("text-opacity").constantOr(1)!==0&&hu(l,n,s,u,!0,s.paint.get("text-translate"),s.paint.get("text-translate-anchor"),s.layout.get("text-rotation-alignment"),s.layout.get("text-pitch-alignment"),s.layout.get("text-keep-upright"),f,g),n.map.showCollisionBoxes&&(Bs(l,n,s,u,s.paint.get("text-translate"),s.paint.get("text-translate-anchor"),!0),Bs(l,n,s,u,s.paint.get("icon-translate"),s.paint.get("icon-translate-anchor"),!1))},circle:function(l,n,s,u){if(l.renderPass!=="translucent")return;const d=s.paint.get("circle-opacity"),f=s.paint.get("circle-stroke-width"),g=s.paint.get("circle-stroke-opacity"),y=s.layout.get("circle-sort-key").constantOr(1)!==void 0;if(d.constantOr(1)===0&&(f.constantOr(1)===0||g.constantOr(1)===0))return;const w=l.context,M=w.gl,I=l.transform,P=l.depthModeForSublayer(0,o.DepthMode.ReadOnly),O=o.StencilMode.disabled,N=l.colorModeForRenderPass(),G=I.projection.name==="globe",j=[o.mercatorXfromLng(I.center.lng),o.mercatorYfromLat(I.center.lat)],q=[];for(let V=0;V<u.length;V++){const H=u[V],K=n.getTile(H),re=K.getBucket(s);if(!re||re.projection.name!==I.projection.name)continue;const le=re.programConfigurations.get(s.id),oe=Rl(s);G&&oe.push("PROJECTION_GLOBE_VIEW");const fe=l.useProgram("circle",le,oe),pe=re.layoutVertexBuffer,ve=re.globeExtVertexBuffer,Ne=re.indexBuffer,ge=I.projection.createInversionMatrix(I,H.canonical),Le={programConfiguration:le,program:fe,layoutVertexBuffer:pe,globeExtVertexBuffer:ve,indexBuffer:Ne,uniformValues:Dl(l,H,K,ge,j,s),tile:K};if(y){const Te=re.segments.get();for(const Ve of Te)q.push({segments:new o.SegmentVector([Ve]),sortKey:Ve.sortKey,state:Le})}else q.push({segments:re.segments,sortKey:0,state:Le})}y&&q.sort((V,H)=>V.sortKey-H.sortKey);const z={useDepthForOcclusion:!G};for(const V of q){const{programConfiguration:H,program:K,layoutVertexBuffer:re,globeExtVertexBuffer:le,indexBuffer:oe,uniformValues:fe,tile:pe}=V.state,ve=V.segments;l.terrain&&l.terrain.setupElevationDraw(pe,K,z),l.prepareDrawProgram(w,K,pe.tileID.toUnwrapped()),K.draw(w,M.TRIANGLES,P,O,N,o.CullFaceMode.disabled,fe,s.id,re,oe,ve,s.paint,I.zoom,H,[le])}},heatmap:function(l,n,s,u){if(s.paint.get("heatmap-opacity")!==0)if(l.renderPass==="offscreen"){const d=l.context,f=d.gl,g=o.StencilMode.disabled,y=new o.ColorMode([f.ONE,f.ONE],o.Color.transparent,[!0,!0,!0,!0]);(function(N,G,j,q){const z=N.gl,V=G.width*q,H=G.height*q;N.activeTexture.set(z.TEXTURE1),N.viewport.set([0,0,V,H]);let K=j.heatmapFbo;if(!K||K&&(K.width!==V||K.height!==H)){K&&K.destroy();const re=z.createTexture();z.bindTexture(z.TEXTURE_2D,re),z.texParameteri(z.TEXTURE_2D,z.TEXTURE_WRAP_S,z.CLAMP_TO_EDGE),z.texParameteri(z.TEXTURE_2D,z.TEXTURE_WRAP_T,z.CLAMP_TO_EDGE),z.texParameteri(z.TEXTURE_2D,z.TEXTURE_MIN_FILTER,z.LINEAR),z.texParameteri(z.TEXTURE_2D,z.TEXTURE_MAG_FILTER,z.LINEAR),K=j.heatmapFbo=N.createFramebuffer(V,H,!1),function(le,oe,fe,pe,ve,Ne){const ge=le.gl;ge.texImage2D(ge.TEXTURE_2D,0,le.isWebGL2&&le.extRenderToTextureHalfFloat?ge.RGBA16F:ge.RGBA,ve,Ne,0,ge.RGBA,le.extRenderToTextureHalfFloat?le.isWebGL2?ge.HALF_FLOAT:le.extTextureHalfFloat.HALF_FLOAT_OES:ge.UNSIGNED_BYTE,null),pe.colorAttachment.set(fe)}(N,0,re,K,V,H)}else z.bindTexture(z.TEXTURE_2D,K.colorAttachment.get()),N.bindFramebuffer.set(K.framebuffer)})(d,l,s,l.transform.projection.name==="globe"?.5:.25),d.clear({color:o.Color.transparent});const w=l.transform,M=w.projection.name==="globe",I=M?["PROJECTION_GLOBE_VIEW"]:null,P=M?o.CullFaceMode.frontCCW:o.CullFaceMode.disabled,O=[o.mercatorXfromLng(w.center.lng),o.mercatorYfromLat(w.center.lat)];for(let N=0;N<u.length;N++){const G=u[N];if(n.hasRenderableParent(G))continue;const j=n.getTile(G),q=j.getBucket(s);if(!q||q.projection.name!==w.projection.name)continue;const z=q.programConfigurations.get(s.id),V=l.useProgram("heatmap",z,I),{zoom:H}=l.transform;l.terrain&&l.terrain.setupElevationDraw(j,V),l.prepareDrawProgram(d,V,G.toUnwrapped());const K=w.projection.createInversionMatrix(w,G.canonical);V.draw(d,f.TRIANGLES,o.DepthMode.disabled,g,y,P,lu(l,G,j,K,O,H,s.paint.get("heatmap-intensity")),s.id,q.layoutVertexBuffer,q.indexBuffer,q.segments,s.paint,l.transform.zoom,z,M?[q.globeExtVertexBuffer]:null)}d.viewport.set([0,0,l.width,l.height])}else l.renderPass==="translucent"&&(l.context.setColorMode(l.colorModeForRenderPass()),function(d,f){const g=d.context,y=g.gl,w=f.heatmapFbo;if(!w)return;
1311g.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,w.colorAttachment.get()),g.activeTexture.set(y.TEXTURE1);let M=f.colorRampTexture;M||(M=f.colorRampTexture=new o.Texture(g,f.colorRamp,y.RGBA)),M.bind(y.LINEAR,y.CLAMP_TO_EDGE),d.useProgram("heatmapTexture").draw(g,y.TRIANGLES,o.DepthMode.disabled,o.StencilMode.disabled,d.colorModeForRenderPass(),o.CullFaceMode.disabled,((I,P,O,N)=>({u_image:0,u_color_ramp:1,u_opacity:P.paint.get("heatmap-opacity")}))(0,f),f.id,d.viewportBuffer,d.quadTriangleIndexBuffer,d.viewportSegments,f.paint,d.transform.zoom)}(l,s))},line:function(l,n,s,u){if(l.renderPass!=="translucent")return;const d=s.paint.get("line-opacity"),f=s.paint.get("line-width");if(d.constantOr(1)===0||f.constantOr(1)===0)return;const g=l.depthModeForSublayer(0,o.DepthMode.ReadOnly),y=l.colorModeForRenderPass(),w=l.terrain&&l.terrain.renderingToTexture?1:o.exported.devicePixelRatio,M=s.paint.get("line-dasharray"),I=M.constantOr(1),P=s.layout.get("line-cap"),O=s.paint.get("line-pattern"),N=O.constantOr(1),G=s.paint.get("line-gradient"),j=N?"linePattern":"line",q=l.context,z=q.gl,V=(K=>{const re=[];Rs(K)&&re.push("RENDER_LINE_DASH"),K.paint.get("line-gradient")&&re.push("RENDER_LINE_GRADIENT");const le=K.paint.get("line-trim-offset");le[0]===0&&le[1]===0||re.push("RENDER_LINE_TRIM_OFFSET");const oe=K.paint.get("line-pattern").constantOr(1),fe=K.paint.get("line-opacity").constantOr(1)!==1;return!oe&&fe&&re.push("RENDER_LINE_ALPHA_DISCARD"),re})(s);let H=V.includes("RENDER_LINE_ALPHA_DISCARD");l.terrain&&l.terrain.clipOrMaskOverlapStencilType()&&(H=!1);for(const K of u){const re=n.getTile(K);if(N&&!re.patternsLoaded())continue;const le=re.getBucket(s);if(!le)continue;l.prepareDrawTile();const oe=le.programConfigurations.get(s.id),fe=l.useProgram(j,oe,V),pe=O.constantOr(null);if(pe&&re.imageAtlas){const ze=re.imageAtlas.patternPositions[pe.toString()];ze&&oe.setConstantPatternPositions(ze)}const ve=M.constantOr(null),Ne=P.constantOr(null);if(!N&&ve&&Ne&&re.lineAtlas){const ze=re.lineAtlas.getDash(ve,Ne);ze&&oe.setConstantPatternPositions(ze)}let[ge,Le]=s.paint.get("line-trim-offset");(Ne==="round"||Ne==="square")&&ge!==Le&&(ge===0&&(ge-=1),Le===1&&(Le+=1));const Te=l.terrain?K.projMatrix:null,Ve=N?Ds(l,re,s,Te,w):Lh(l,re,s,Te,le.lineClipsArray.length,w,[ge,Le]);if(G){const ze=le.gradients[s.id];let Ge=ze.texture;if(s.gradientVersion!==ze.version){let Fe=256;if(s.stepInterpolant){const qe=n.getSource().maxzoom,pt=K.canonical.z===qe?Math.ceil(1<<l.transform.maxZoom-K.canonical.z):1;Fe=o.clamp(o.nextPowerOfTwo(le.maxLineLength/o.EXTENT*1024*pt),256,q.maxTextureSize)}ze.gradient=o.renderColorRamp({expression:s.gradientExpression(),evaluationKey:"lineProgress",resolution:Fe,image:ze.gradient||void 0,clips:le.lineClipsArray}),ze.texture?ze.texture.update(ze.gradient):ze.texture=new o.Texture(q,ze.gradient,z.RGBA),ze.version=s.gradientVersion,Ge=ze.texture}q.activeTexture.set(z.TEXTURE1),Ge.bind(s.stepInterpolant?z.NEAREST:z.LINEAR,z.CLAMP_TO_EDGE)}I&&(q.activeTexture.set(z.TEXTURE0),re.lineAtlasTexture.bind(z.LINEAR,z.REPEAT),oe.updatePaintBuffers()),N&&(q.activeTexture.set(z.TEXTURE0),re.imageAtlasTexture.bind(z.LINEAR,z.CLAMP_TO_EDGE),oe.updatePaintBuffers()),l.prepareDrawProgram(q,fe,K.toUnwrapped());const xe=ze=>{fe.draw(q,z.TRIANGLES,g,ze,y,o.CullFaceMode.disabled,Ve,s.id,le.layoutVertexBuffer,le.indexBuffer,le.segments,s.paint,l.transform.zoom,oe,[le.layoutVertexBuffer2])};if(H){const ze=l.stencilModeForClipping(K).ref;ze===0&&l.terrain&&q.clear({stencil:0});const Ge={func:z.EQUAL,mask:255};Ve.u_alpha_discard_threshold=.8,xe(new o.StencilMode(Ge,ze,255,z.KEEP,z.KEEP,z.INVERT)),Ve.u_alpha_discard_threshold=0,xe(new o.StencilMode(Ge,ze,255,z.KEEP,z.KEEP,z.KEEP))}else xe(l.stencilModeForClipping(K))}H&&(l.resetStencilClippingMasks(),l.terrain&&q.clear({stencil:0}))},fill:function(l,n,s,u){const d=s.paint.get("fill-color"),f=s.paint.get("fill-opacity");if(f.constantOr(1)===0)return;const g=l.colorModeForRenderPass(),y=s.paint.get("fill-pattern"),w=l.opaquePassEnabledForLayer()&&!y.constantOr(1)&&d.constantOr(o.Color.transparent).a===1&&f.constantOr(0)===1?"opaque":"translucent";if(l.renderPass===w){const M=l.depthModeForSublayer(1,l.renderPass==="opaque"?o.DepthMode.ReadWrite:o.DepthMode.ReadOnly);du(l,n,s,u,M,g,!1)}if(l.renderPass==="translucent"&&s.paint.get("fill-antialias")){const M=l.depthModeForSublayer(s.getPaintProperty("fill-outline-color")?2:0,o.DepthMode.ReadOnly);du(l,n,s,u,M,g,!0)}},"fill-extrusion":function(l,n,s,u){const d=s.paint.get("fill-extrusion-opacity");if(d!==0&&l.renderPass==="translucent"){const f=new o.DepthMode(l.context.gl.LEQUAL,o.DepthMode.ReadWrite,l.depthRangeFor3D);if(d!==1||s.paint.get("fill-extrusion-pattern").constantOr(1))Ia(l,n,s,u,f,o.StencilMode.disabled,o.ColorMode.disabled),Ia(l,n,s,u,f,l.stencilModeFor3D(),l.colorModeForRenderPass()),l.resetStencilClippingMasks();else{const g=l.colorModeForRenderPass();Ia(l,n,s,u,f,o.StencilMode.disabled,g)}}},hillshade:function(l,n,s,u){if(l.renderPass!=="offscreen"&&l.renderPass!=="translucent")return;
1311const d=l.context,f=l.depthModeForSublayer(0,o.DepthMode.ReadOnly),g=l.colorModeForRenderPass(),y=l.terrain&&l.terrain.renderingToTexture,[w,M]=l.renderPass!=="translucent"||y?[{},u]:l.stencilConfigForOverlap(u);for(const I of M){const P=n.getTile(I);if(P.needsHillshadePrepare&&l.renderPass==="offscreen")nu(l,P,s,f,o.StencilMode.disabled,g);else if(l.renderPass==="translucent"){const O=y&&l.terrain?l.terrain.stencilModeForRTTOverlap(I):w[I.overscaledZ];iu(l,I,P,s,f,O,g)}}d.viewport.set([0,0,l.width,l.height]),l.resetStencilClippingMasks()},raster:function(l,n,s,u,d,f){if(l.renderPass!=="translucent"||s.paint.get("raster-opacity")===0||!u.length)return;const g=l.context,y=g.gl,w=n.getSource(),M=l.useProgram("raster"),I=l.colorModeForRenderPass(),P=l.terrain&&l.terrain.renderingToTexture,[O,N]=w instanceof Nt||P?[{},u]:l.stencilConfigForOverlap(u),G=N[N.length-1].overscaledZ,j=!l.options.moving;for(const q of N){const z=P?o.DepthMode.disabled:l.depthModeForSublayer(q.overscaledZ-G,s.paint.get("raster-opacity")===1?o.DepthMode.ReadWrite:o.DepthMode.ReadOnly,y.LESS),V=q.toUnwrapped(),H=n.getTile(q);if(P&&(!H||!H.hasData()))continue;const K=P?q.projMatrix:l.transform.calculateProjMatrix(V,j),re=l.terrain&&P?l.terrain.stencilModeForRTTOverlap(q):O[q.overscaledZ],le=f?0:s.paint.get("raster-fade-duration");H.registerFadeDuration(le);const oe=n.findLoadedParent(q,0),fe=Cl(H,oe,n,l.transform,le);let pe,ve;l.terrain&&l.terrain.prepareDrawTile();const Ne=s.paint.get("raster-resampling")==="nearest"?y.NEAREST:y.LINEAR;g.activeTexture.set(y.TEXTURE0),H.texture.bind(Ne,y.CLAMP_TO_EDGE),g.activeTexture.set(y.TEXTURE1),oe?(oe.texture.bind(Ne,y.CLAMP_TO_EDGE),pe=Math.pow(2,oe.tileID.overscaledZ-H.tileID.overscaledZ),ve=[H.tileID.canonical.x*pe%1,H.tileID.canonical.y*pe%1]):H.texture.bind(Ne,y.CLAMP_TO_EDGE),H.texture.useMipmap&&g.extTextureFilterAnisotropic&&l.transform.pitch>20&&y.texParameterf(y.TEXTURE_2D,g.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,g.extTextureFilterAnisotropicMax);const ge=Fl(K,ve||[0,0],pe||1,fe,s,w instanceof Nt?w.perspectiveTransform:[0,0]);if(l.prepareDrawProgram(g,M,V),w instanceof Nt)w.boundsBuffer&&w.boundsSegments&&M.draw(g,y.TRIANGLES,z,o.StencilMode.disabled,I,o.CullFaceMode.disabled,ge,s.id,w.boundsBuffer,l.quadTriangleIndexBuffer,w.boundsSegments);else{const{tileBoundsBuffer:Le,tileBoundsIndexBuffer:Te,tileBoundsSegments:Ve}=l.getTileBoundsBuffers(H);M.draw(g,y.TRIANGLES,z,re,I,o.CullFaceMode.disabled,ge,s.id,Le,Te,Ve)}}l.resetStencilClippingMasks()},background:function(l,n,s,u){const d=s.paint.get("background-color"),f=s.paint.get("background-opacity");if(f===0)return;const g=l.context,y=g.gl,w=l.transform,M=w.tileSize,I=s.paint.get("background-pattern");if(l.isPatternMissing(I))return;const P=!I&&d.a===1&&f===1&&l.opaquePassEnabledForLayer()?"opaque":"translucent";if(l.renderPass!==P)return;const O=o.StencilMode.disabled,N=l.depthModeForSublayer(0,P==="opaque"?o.DepthMode.ReadWrite:o.DepthMode.ReadOnly),G=l.colorModeForRenderPass(),j=l.useProgram(I?"backgroundPattern":"background");let q,z=u;z||(q=l.getBackgroundTiles(),z=Object.values(q).map(V=>V.tileID)),I&&(g.activeTexture.set(y.TEXTURE0),l.imageManager.bind(l.context));for(const V of z){const H=V.toUnwrapped(),K=u?V.projMatrix:l.transform.calculateProjMatrix(H);l.prepareDrawTile();const re=n?n.getTile(V):q?q[V.key]:new o.Tile(V,M,w.zoom,l),le=I?Dh(K,f,l,I,{tileID:V,tileSize:M}):Vl(K,f,d);l.prepareDrawProgram(g,j,H);const{tileBoundsBuffer:oe,tileBoundsIndexBuffer:fe,tileBoundsSegments:pe}=l.getTileBoundsBuffers(re);j.draw(g,y.TRIANGLES,N,O,G,o.CullFaceMode.disabled,le,s.id,oe,fe,pe)}},sky:function(l,n,s){const u=l.transform,d=u.projection.name==="mercator"||u.projection.name==="globe"?1:o.smoothstep(7,8,u.zoom),f=s.paint.get("sky-opacity")*d;if(f===0)return;const g=l.context,y=s.paint.get("sky-type"),w=new o.DepthMode(g.gl.LEQUAL,o.DepthMode.ReadOnly,[0,1]),M=l.frameCounter/1e3%1;y==="atmosphere"?l.renderPass==="offscreen"?s.needsSkyboxCapture(l)&&(function(I,P,O,N){const G=I.context,j=G.gl;let q=P.skyboxFbo;if(!q){q=P.skyboxFbo=G.createFramebuffer(32,32,!1),P.skyboxGeometry=new Aa(G),P.skyboxTexture=G.gl.createTexture(),j.bindTexture(j.TEXTURE_CUBE_MAP,P.skyboxTexture),j.texParameteri(j.TEXTURE_CUBE_MAP,j.TEXTURE_WRAP_S,j.CLAMP_TO_EDGE),j.texParameteri(j.TEXTURE_CUBE_MAP,j.TEXTURE_WRAP_T,j.CLAMP_TO_EDGE),j.texParameteri(j.TEXTURE_CUBE_MAP,j.TEXTURE_MIN_FILTER,j.L
1311INEAR),j.texParameteri(j.TEXTURE_CUBE_MAP,j.TEXTURE_MAG_FILTER,j.LINEAR);for(let K=0;K<6;++K)j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+K,0,j.RGBA,32,32,0,j.RGBA,j.UNSIGNED_BYTE,null)}G.bindFramebuffer.set(q.framebuffer),G.viewport.set([0,0,32,32]);const z=P.getCenter(I,!0),V=I.useProgram("skyboxCapture"),H=new Float64Array(16);o.identity(H),o.rotateY(H,H,.5*-Math.PI),Qn(G,P,V,H,z,0),o.identity(H),o.rotateY(H,H,.5*Math.PI),Qn(G,P,V,H,z,1),o.identity(H),o.rotateX(H,H,.5*-Math.PI),Qn(G,P,V,H,z,2),o.identity(H),o.rotateX(H,H,.5*Math.PI),Qn(G,P,V,H,z,3),o.identity(H),Qn(G,P,V,H,z,4),o.identity(H),o.rotateY(H,H,Math.PI),Qn(G,P,V,H,z,5),G.viewport.set([0,0,I.width,I.height])}(l,s),s.markSkyboxValid(l)):l.renderPass==="sky"&&function(I,P,O,N,G){const j=I.context,q=j.gl,z=I.transform,V=I.useProgram("skybox");j.activeTexture.set(q.TEXTURE0),q.bindTexture(q.TEXTURE_CUBE_MAP,P.skyboxTexture);const H=((K,re,le,oe,fe)=>({u_matrix:K,u_sun_direction:re,u_cubemap:0,u_opacity:oe,u_temporal_offset:fe}))(z.skyboxMatrix,P.getCenter(I,!1),0,N,G);I.prepareDrawProgram(j,V),V.draw(j,q.TRIANGLES,O,o.StencilMode.disabled,I.colorModeForRenderPass(),o.CullFaceMode.backCW,H,"skybox",P.skyboxGeometry.vertexBuffer,P.skyboxGeometry.indexBuffer,P.skyboxGeometry.segment)}(l,s,w,f,M):y==="gradient"&&l.renderPass==="sky"&&function(I,P,O,N,G){const j=I.context,q=j.gl,z=I.transform,V=I.useProgram("skyboxGradient");P.skyboxGeometry||(P.skyboxGeometry=new Aa(j)),j.activeTexture.set(q.TEXTURE0);let H=P.colorRampTexture;H||(H=P.colorRampTexture=new o.Texture(j,P.colorRamp,q.RGBA)),H.bind(q.LINEAR,q.CLAMP_TO_EDGE);const K=((re,le,oe,fe,pe)=>({u_matrix:re,u_color_ramp:0,u_center_direction:le,u_radius:o.degToRad(oe),u_opacity:fe,u_temporal_offset:pe}))(z.skyboxMatrix,P.getCenter(I,!1),P.paint.get("sky-gradient-radius"),N,G);I.prepareDrawProgram(j,V),V.draw(j,q.TRIANGLES,O,o.StencilMode.disabled,I.colorModeForRenderPass(),o.CullFaceMode.backCW,K,"skyboxGradient",P.skyboxGeometry.vertexBuffer,P.skyboxGeometry.indexBuffer,P.skyboxGeometry.segment)}(l,s,w,f,M)},debug:function(l,n,s){for(let u=0;u<s.length;u++)Vh(l,n,s[u])},custom:function(l,n,s,u){const d=l.context,f=s.implementation;if(!l.transform.projection.unsupportedLayers||!l.transform.projection.unsupportedLayers.includes("custom")||l.terrain&&(l.terrain.renderingToTexture||l.renderPass==="offscreen")&&s.isLayerDraped()){if(l.renderPass==="offscreen"){const g=f.prerender;if(g){if(l.setCustomLayerDefaults(),d.setColorMode(l.colorModeForRenderPass()),l.transform.projection.name==="globe"){const y=l.transform.pointMerc;g.call(f,d.gl,l.transform.customLayerMatrix(),l.transform.getProjection(),l.transform.globeToMercatorMatrix(),o.globeToMercatorTransition(l.transform.zoom),[y.x,y.y],l.transform.pixelsPerMeterRatio)}else g.call(f,d.gl,l.transform.customLayerMatrix());d.setDirty(),l.setBaseState()}}else if(l.renderPass==="translucent"){if(l.terrain&&l.terrain.renderingToTexture){const y=f.renderToTile;if(y){const w=u[0].canonical,M=new o.MercatorCoordinate(w.x+u[0].wrap*(1<<w.z),w.y,w.z);d.setDepthMode(o.DepthMode.disabled),d.setStencilMode(o.StencilMode.disabled),d.setColorMode(l.colorModeForRenderPass()),l.setCustomLayerDefaults(),y.call(f,d.gl,M),d.setDirty(),l.setBaseState()}return}l.setCustomLayerDefaults(),d.setColorMode(l.colorModeForRenderPass()),d.setStencilMode(o.StencilMode.disabled);const g=f.renderingMode==="3d"?new o.DepthMode(l.context.gl.LEQUAL,o.DepthMode.ReadWrite,l.depthRangeFor3D):l.depthModeForSublayer(0,o.DepthMode.ReadOnly);if(d.setDepthMode(g),l.transform.projection.name==="globe"){const y=l.transform.pointMerc;f.render(d.gl,l.transform.customLayerMatrix(),l.transform.getProjection(),l.transform.globeToMercatorMatrix(),o.globeToMercatorTransition(l.transform.zoom),[y.x,y.y],l.transform.pixelsPerMeterRatio)}else f.render(d.gl,l.transform.customLayerMatrix());d.setDirty(),l.setBaseState(),d.bindFramebuffer.set(null)}}else o.warnOnce("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")}};class $o{constructor(n,s,u=!1){this.context=new We(n,u),this.transform=s,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.setup(),this.numSublayers=o.SourceCache.maxUnderzooming+o.SourceCache.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={}}updateTerrain(n,s){const u=!!n&&!!n.terrain&&this.transform.projection.supportsTerrain;if(!(u||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new Pl(this,n));const d=this._terrain;this.transform.elevation=u?d:null,d.update(n,this.transform,s)}_updateFog(n){const s=n.fog;if(!s||this.transform.projection.name==="globe"||s.getOpacity(this.transform.pitch)<1||s.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[u,d]=s.getFovAdjustedRange(this.transform._fov);if(u>d)return void(this.transform.fogCullDistSq=null);const f=u+.78*(d-u);this.transform.fogCullDistSq=f*f}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}
vendor: 10,624 bytes, line 1311
1311resize(n,s){if(this.width=n*o.exported.devicePixelRatio,this.height=s*o.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const u of this.style.order)this.style._layers[u].resize()}setup(){const n=this.context,s=new o.StructArrayLayout2i4;s.emplaceBack(0,0),s.emplaceBack(o.EXTENT,0),s.emplaceBack(0,o.EXTENT),s.emplaceBack(o.EXTENT,o.EXTENT),this.tileExtentBuffer=n.createVertexBuffer(s,o.posAttributes.members),this.tileExtentSegments=o.SegmentVector.simpleSegment(0,0,4,2);const u=new o.StructArrayLayout2i4;u.emplaceBack(0,0),u.emplaceBack(o.EXTENT,0),u.emplaceBack(0,o.EXTENT),u.emplaceBack(o.EXTENT,o.EXTENT),this.debugBuffer=n.createVertexBuffer(u,o.posAttributes.members),this.debugSegments=o.SegmentVector.simpleSegment(0,0,4,5);const d=new o.StructArrayLayout2i4;d.emplaceBack(-1,-1),d.emplaceBack(1,-1),d.emplaceBack(-1,1),d.emplaceBack(1,1),this.viewportBuffer=n.createVertexBuffer(d,o.posAttributes.members),this.viewportSegments=o.SegmentVector.simpleSegment(0,0,4,2);const f=new o.StructArrayLayout4i8;f.emplaceBack(0,0,0,0),f.emplaceBack(o.EXTENT,0,o.EXTENT,0),f.emplaceBack(0,o.EXTENT,0,o.EXTENT),f.emplaceBack(o.EXTENT,o.EXTENT,o.EXTENT,o.EXTENT),this.mercatorBoundsBuffer=n.createVertexBuffer(f,o.boundsAttributes.members),this.mercatorBoundsSegments=o.SegmentVector.simpleSegment(0,0,4,2);const g=new o.StructArrayLayout3ui6;g.emplaceBack(0,1,2),g.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=n.createIndexBuffer(g);const y=new o.StructArrayLayout1ui2;for(const M of[0,1,3,2,0])y.emplaceBack(M);this.debugIndexBuffer=n.createIndexBuffer(y),this.emptyTexture=new o.Texture(n,new o.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),n.gl.RGBA),this.identityMat=o.create();const w=this.context.gl;this.stencilClearMode=new o.StencilMode({func:w.ALWAYS,mask:0},0,255,w.ZERO,w.ZERO,w.ZERO),this.loadTimeStamps.push(o.window.performance.now()),this.atmosphereBuffer=new gu(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(n){return n._makeTileBoundsBuffers(this.context,this.transform.projection),n._tileBoundsBuffer?{tileBoundsBuffer:n._tileBoundsBuffer,tileBoundsIndexBuffer:n._tileBoundsIndexBuffer,tileBoundsSegments:n._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const n=this.context,s=n.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(n,s.TRIANGLES,o.DepthMode.disabled,this.stencilClearMode,o.ColorMode.disabled,o.CullFaceMode.disabled,zs(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(n,s,u){if(!s||this.currentStencilSource===s.id||!n.isTileClipped()||!u||u.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let y=!1;for(const w of u)if(this._tileClippingMaskIDs[w.key]===void 0){y=!0;break}if(!y)return}this.currentStencilSource=s.id;const d=this.context,f=d.gl;this.nextStencilID+u.length>256&&this.clearStencil(),d.setColorMode(o.ColorMode.disabled),d.setDepthMode(o.DepthMode.disabled);const g=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const y of u){const w=s.getTile(y),M=this._tileClippingMaskIDs[y.key]=this.nextStencilID++,{tileBoundsBuffer:I,tileBoundsIndexBuffer:P,tileBoundsSegments:O}=this.getTileBoundsBuffers(w);g.draw(d,f.TRIANGLES,o.DepthMode.disabled,new o.StencilMode({func:f.ALWAYS,mask:0},M,255,f.KEEP,f.KEEP,f.REPLACE),o.ColorMode.disabled,o.CullFaceMode.disabled,zs(y.projMatrix),"$clipping",I,P,O)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const n=this.nextStencilID++,s=this.context.gl;return new o.StencilMode({func:s.NOTEQUAL,mask:255},n,255,s.KEEP,s.KEEP,s.REPLACE)}stencilModeForClipping(n){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(n);const s=this.context.gl;return new o.StencilMode({func:s.EQUAL,mask:255},this._tileClippingMaskIDs[n.key],0,s.KEEP,s.KEEP,s.REPLACE)}stencilConfigForOverlap(n){const s=this.context.gl,u=n.sort((g,y)=>y.overscaledZ-g.overscaledZ),d=u[u.length-1].overscaledZ,f=u[0].overscaledZ-d+1;if(f>1){this.currentStencilSource=void 0,this.nextStencilID+f>256&&this.clearStencil();const g={};for(let y=0;y<f;y++)g[y+d]=new o.StencilMode({func:s.GEQUAL,mask:255},y+this.nextStencilID,255,s.KEEP,s.KEEP,s.REPLACE);return this.nextStencilID+=f,[g,u]}return[{[d]:o.StencilMode.disabled},u]}colorModeForRenderPass(){const n=this.context.gl;return this._showOverdrawInspector?new o.ColorMode([n.CONSTANT_COLOR,n.ONE],new o.Color(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?o.ColorMode.unblended:o.ColorMode.alphaBlended}depthModeForSublayer(n,s,u){if(!this.opaquePassEnabledForLayer())return o.DepthMode.disabled;const d=1-((1+this.currentLayer)*this.numSublayers+n)*this.depthEpsilon;return new o.DepthMode(u||this.context.gl.LEQUAL,s,[d,d])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(n,s){this.style=n,this.options=s,this.imageManager=n.imageManager,this.glyphManager=n.glyphManager,this.symbolFadeChange=n.placement.symbolFadeChange(o.exported.now()),this.imageManager.beginFrame();const u=this.style.order,d=this.style._sourceCaches;for(const M in d){const I=d[M];I.used&&I.prepare(this.context)}const f={},g={},y={};for(const M in d){const I=d[M];f[M]=I.getVisibleCoordinates(),g[M]=f[M].slice().reverse(),y[M]=I.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let M=0;M<u.length;M++)if(this.style._layers[u[M]].is3D()){this.opaquePassCutoff=M;break}if(this.terrain&&(this.terrain.updateTileBinding(y),this.opaquePassCutoff=0),this.transform.projection.name!=="globe"||this.globeSharedBuffers||(this.globeSharedBuffers=new o.GlobeSharedBuffers(this.context)),!o.isMapAuthenticated(this.context.gl))return;this.renderPass="offscreen";for(const M of u){const I=this.style._layers[M],P=n._getLayerSourceCache(I);if(!I.hasOffscreenPass()||I.isHidden(this.transform.zoom))continue;const O=P?g[P.id]:void 0;(I.type==="custom"||I.isSky()||O&&O.length)&&this.renderLayer(this,P,I,O)}this.depthRangeFor3D=[0,1-(n.order.length+2)*this.numSublayers*this.depthEpsilon];const w=this.terrain;if(w&&(this.style.hasSymbolLayers()||this.style.hasCircleLayers())&&w.drawDepth(),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]),this.context.clear({color:s.showOverdrawInspector?o.Color.black:o.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=s.showOverdrawInspector,this.renderPass="opaque",!this.terrain)for(this.currentLayer=u.length-1;this.currentLayer>=0;this.currentLayer--){const M=this.style._layers[u[this.currentLayer]],I=n._getLayerSourceCache(M);if(M.isSky())continue;const P=I?g[I.id]:void 0;this._renderTileClippingMasks(M,I,P),this.renderLayer(this,I,M,P)}if(this.style.fog&&this.transform.projection.supportsFog&&function(M,I){const P=M.context,O=P.gl,N=M.transform,G=new o.DepthMode(O.LEQUAL,o.DepthMode.ReadOnly,[0,1]),j=M.useProgram("globeAtmosphere",null,N.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),q=o.globeToMercatorTransition(N.zoom),z=I.properties.get("color").toArray01(),V=I.properties.get("high-color").toArray01(),H=I.properties.get("space-color").toArray01PremultipliedAlpha(),K=o.identity$1([]);o.rotateY$1(K,K,-o.degToRad(N._center.lng)),o.rotateX$1(K,K,o.degToRad(N._center.lat)),o.rotateZ$1(K,K,N.angle),o.rotateX$1(K,K,-N._pitch);const re=o.fromQuat(new Float32Array(16),K),le=o.mapValue(I.properties.get("star-intensity"),0,1,0,.25),oe=5e-4,fe=o.mapValue(I.properties.get("horizon-blend"),0,1,oe,.25),pe=o.globeUseCustomAntiAliasing(M,P,N)&&fe===oe?N.worldSize/(2*Math.PI*1.025)-1:N.globeRadius,ve=M.frameCounter/1e3%1,Ne=o.length(N.globeCenterInViewSpace),ge=Math.sqrt(Math.pow(Ne,2)-Math.pow(pe,2)),Le=Math.acos(ge/Ne),Te=((xe,ze,Ge,Fe,qe,pt,Pt,ut,wt,Ht,Zt,dt,di,fi)=>({u_frustum_tl:xe,u_frustum_tr:ze,u_frustum_br:Ge,u_frustum_bl:Fe,u_horizon:qe,u_transition:pt,u_fadeout_range:Pt,u_color:ut,u_high_color:wt,u_space_color:Ht,u_star_intensity:Zt,u_star_size:5*o.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:dt,u_horizon_angle:di,u_rotation_matrix:fi}))(N.frustumCorners.TL,N.frustumCorners.TR,N.frustumCorners.BR,N.frustumCorners.BL,N.frustumCorners.horizon,q,fe,z,V,H,le,ve,Le,re);M.prepareDrawProgram(P,j);const Ve=M.atmosphereBuffer;Ve&&j.draw(P,O.TRIANGLES,G,o.StencilMode.disabled,o.ColorMode.alphaBlended,o.CullFaceMode.backCW,Te,"skybox",Ve.vertexBuffer,Ve.indexBuffer,Ve.segments)}(this,this.style.fog),this.renderPass="sky",(o.globeToMercatorTransition(this.transform.zoom)>0||this.transform.projection.name!=="globe")&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer<u.length;this.currentLayer++){const M=this.style._layers[u[this.currentLayer]],I=n._getLayerSourceCache(M);M.isSky()&&this.renderLayer(this,I,M,I?g[I.id]:void 0)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<u.length;){const M=this.style._layers[u[this.currentLayer]],I=n._getLayerSourceCache(M);if(M.isSky()){++this.currentLayer;continue}if(this.terrain&&this.style.isLayerDraped(M)){if(M.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer);continue}const P=I?(M.type==="symbol"?y:g)[I.id]:void 0;this._renderTileClippingMasks(M,I,I?f[I.id]:void 0),this.renderLayer(this,I,M,P),++this.currentLayer}if(this.terrain&&this.terrain.postRender(),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let M=null;o.values(this.style._layers).forEach(I=>{const P=n._getLayerSourceCache(I);P&&!I.isHidden(this.transform.zoom)&&(!M||M.getSource().maxzoom<P.getSource().maxzoom)&&(M=P)}),M&&this.options.showTileBoundaries&&Po.debug(this,M,M.getVisibleCoordinates())}this.options.showPadding&&function(M){const I=M.transform.padding;fu(M,M.transform.height-(I.top||0),3,Jo),fu(M,I.bottom||0,3,Bh),Ma(M,I.left||0,3,Oh),Ma(M,M.transform.width-(I.right||0),3,Fh);const P=M.transform.centerPoint;(function(O,N,G,j){Qo(O,N-1,G-10,2,20,j),Qo(O,N-10,G-1,20,2,j)})(M,P.x,M.transform.height-P.y,Uh)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(o.window.performance.now()),this.saveC
1311anvasCopy())}renderLayer(n,s,u,d){u.isHidden(this.transform.zoom)||(u.type==="background"||u.type==="sky"||u.type==="custom"||d&&d.length)&&(this.id=u.id,this.gpuTimingStart(u),(!n.transform.projection.unsupportedLayers||!n.transform.projection.unsupportedLayers.includes(u.type)||n.terrain&&u.type==="custom")&&Po[u.type](n,s,u,d,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(n){if(!this.options.gpuTiming)return;const s=this.context.extTimerQuery;let u=this.gpuTimers[n.id];u||(u=this.gpuTimers[n.id]={calls:0,cpuTime:0,query:s.createQueryEXT()}),u.calls++,s.beginQueryEXT(s.TIME_ELAPSED_EXT,u.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const n=this.context.extTimerQuery,s=n.createQueryEXT();this.deferredRenderGpuTimeQueries.push(s),n.beginQueryEXT(n.TIME_ELAPSED_EXT,s)}}gpuTimingDeferredRenderEnd(){if(!this.options.gpuTimingDeferredRender)return;const n=this.context.extTimerQuery;n.endQueryEXT(n.TIME_ELAPSED_EXT)}gpuTimingEnd(){if(!this.options.gpuTiming)return;const n=this.context.extTimerQuery;n.endQueryEXT(n.TIME_ELAPSED_EXT)}collectGpuTimers(){const n=this.gpuTimers;return this.gpuTimers={},n}collectDeferredRenderGpuQueries(){const n=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],n}queryGpuTimers(n){const s={};for(const u in n){const d=n[u],f=this.context.extTimerQuery,g=f.getQueryObjectEXT(d.query,f.QUERY_RESULT_EXT)/1e6;
1311f.deleteQueryEXT(d.query),s[u]=g}return s}queryGpuTimeDeferredRender(n){if(!this.options.gpuTimingDeferredRender)return 0;const s=this.context.extTimerQuery;let u=0;for(const d of n)u+=s.getQueryObjectEXT(d,s.QUERY_RESULT_EXT)/1e6,s.deleteQueryEXT(d);return u}translatePosMatrix(n,s,u,d,f){if(!u[0]&&!u[1])return n;const g=f?d==="map"?this.transform.angle:0:d==="viewport"?-this.transform.angle:0;if(g){const M=Math.sin(g),I=Math.cos(g);u=[u[0]*I-u[1]*M,u[0]*M+u[1]*I]}const y=[f?u[0]:ai(s,u[0],this.transform.zoom),f?u[1]:ai(s,u[1],this.transform.zoom),0],w=new Float32Array(16);return o.translate(w,n,y),w}saveTileTexture(n){const s=this._tileTextures[n.size[0]];s?s.push(n):this._tileTextures[n.size[0]]=[n]}getTileTexture(n){const s=this._tileTextures[n];return s&&s.length>0?s.pop():null}isPatternMissing(n){return n===null||n!==void 0&&!this.imageManager.getPattern(n.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const n=this.terrain&&this.terrain.renderingToTexture,s=this.terrain&&this.terrain.exaggeration()===0,u=this.style&&this.style.fog,d=[];return this.terrainRenderModeElevated()&&d.push("TERRAIN"),this.transform.projection.name==="globe"&&d.push("GLOBE"),s&&d.push("ZERO_EXAGGERATION"),u&&!n&&u.getOpacity(this.transform.pitch)!==0&&d.push("FOG"),n&&d.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&d.push("OVERDRAW_INSPECTOR"),d}useProgram(n,s,u){this.cache=this.cache||{};const d=u||[],f=this.currentGlobalDefines().concat(d),g=ii.cacheKey(Sl[n],n,f,s);return this.cache[g]||(this.cache[g]=new ii(this.context,n,Sl[n],s,Nl[n],f)),this.cache[g]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const n=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(n.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=o.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new o.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(n,s,u){if(this.terrain&&this.terrain.renderingToTexture)return;const d=this.style.fog;if(d){const f=d.getOpacity(this.transform.pitch),g=((y,w,M,I,P,O,N,G,j,q,z)=>{const V=y.transform,H=w.properties.get("color").toArray01();H[3]=I;const K=y.frameCounter/1e3%1;return{u_fog_matrix:M?V.calculateFogTileMatrix(M):y.identityMat,u_fog_range:w.getFovAdjustedRange(V._fov),u_fog_color:H,u_fog_horizon_blend:w.properties.get("horizon-blend"),u_fog_temporal_offset:K,u_frustum_tl:P,u_frustum_tr:O,u_frustum_br:N,u_frustum_bl:G,u_globe_pos:j,u_globe_radius:q,u_viewport:z,u_globe_transition:o.globeToMercatorTransition(V.zoom),u_is_globe:+(V.projection.name==="globe")}})(this,d,u,f,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*o.exported.devicePixelRatio,this.transform.height*o.exported.devicePixelRatio]);s.setFogUniformValues(n,g)}}setTileLoadedFlag(n){this.tileLoaded=n}saveCanvasCopy(){const n=this.canvasCopy();n&&(this.frameCopies.push(n),this.tileLoaded=!1)}canvasCopy(){const n=this.context.gl,s=n.createTexture();return n.bindTexture(n.TEXTURE_2D,s),n.copyTexImage2D(n.TEXTURE_2D,0,n.RGBA,0,0,n.drawingBufferWidth,n.drawingBufferHeight,0),s}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const n=this.style&&this.style.fog;return!!n&&n.getOpacity(this.transform.pitch)!==0}
vendor: 6,745 bytes, line 1311
1311getBackgroundTiles(){const n=this._backgroundTiles,s=this._backgroundTiles={},u=this.transform.coveringTiles({tileSize:512});for(const d of u)s[d.key]=n[d.key]||new o.Tile(d,512,this.transform.tileZoom,this);return s}clearBackgroundTiles(){this._backgroundTiles={}}}class Ca{constructor(n=0,s=0,u=0,d=0){if(isNaN(n)||n<0||isNaN(s)||s<0||isNaN(u)||u<0||isNaN(d)||d<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=n,this.bottom=s,this.left=u,this.right=d}interpolate(n,s,u){return s.top!=null&&n.top!=null&&(this.top=o.number(n.top,s.top,u)),s.bottom!=null&&n.bottom!=null&&(this.bottom=o.number(n.bottom,s.bottom,u)),s.left!=null&&n.left!=null&&(this.left=o.number(n.left,s.left,u)),s.right!=null&&n.right!=null&&(this.right=o.number(n.right,s.right,u)),this}getCenter(n,s){const u=o.clamp((this.left+n-this.right)/2,0,n),d=o.clamp((this.top+s-this.bottom)/2,0,s);return new o.Point(u,d)}equals(n){return this.top===n.top&&this.bottom===n.bottom&&this.left===n.left&&this.right===n.right}clone(){return new Ca(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function ka(l,n){const s=o.getColumn(l,3);o.fromQuat(l,n),o.setColumn(l,3,s)}function oi(l,n){const s=o.identity$1([]);return o.rotateZ$1(s,s,-n),o.rotateX$1(s,s,-l),s}function Us(l,n){const s=[l[0],l[1],0],u=[n[0],n[1],0];if(o.length(s)>=1e-15){const g=o.normalize([],s);o.scale$2(u,g,o.dot(u,g)),n[0]=u[0],n[1]=u[1]}const d=o.cross([],n,l);if(o.len(d)<1e-15)return null;const f=Math.atan2(-d[1],d[0]);return oi(Math.atan2(Math.sqrt(l[0]*l[0]+l[1]*l[1]),-l[2]),f)}class yu{constructor(n,s){this.position=n,this.orientation=s}get position(){return this._position}set position(n){if(n){const s=n instanceof o.MercatorCoordinate?n:new o.MercatorCoordinate(n[0],n[1],n[2]);this._renderWorldCopies&&(s.x=o.wrap(s.x,0,1)),this._position=s}else this._position=null}lookAtPoint(n,s){if(this.orientation=null,!this.position)return;const u=this.position,d=this._elevation?this._elevation.getAtPointOrZero(o.MercatorCoordinate.fromLngLat(n)):0,f=o.MercatorCoordinate.fromLngLat(n,d),g=[f.x-u.x,f.y-u.y,f.z-u.z];s||(s=[0,0,1]),s[2]=Math.abs(s[2]),this.orientation=Us(g,s)}setPitchBearing(n,s){this.orientation=oi(o.degToRad(n),o.degToRad(-s))}}class Pa{constructor(n,s){this._transform=o.identity([]),this.orientation=s,this.position=n}get mercatorPosition(){const n=this.position;return new o.MercatorCoordinate(n[0],n[1],n[2])}get position(){const n=o.getColumn(this._transform,3);return[n[0],n[1],n[2]]}set position(n){var s;n&&o.setColumn(this._transform,3,[(s=n)[0],s[1],s[2],1])}get orientation(){return this._orientation}set orientation(n){this._orientation=n||o.identity$1([]),n&&ka(this._transform,this._orientation)}getPitchBearing(){const n=this.forward(),s=this.right();return{bearing:Math.atan2(-s[1],s[0]),pitch:Math.atan2(Math.sqrt(n[0]*n[0]+n[1]*n[1]),-n[2])}}setPitchBearing(n,s){this._orientation=oi(n,s),ka(this._transform,this._orientation)}forward(){const n=o.getColumn(this._transform,2);return[-n[0],-n[1],-n[2]]}up(){const n=o.getColumn(this._transform,1);return[-n[0],-n[1],-n[2]]}right(){const n=o.getColumn(this._transform,0);return[n[0],n[1],n[2]]}getCameraToWorld(n,s){const u=new Float64Array(16);return o.invert(u,this.getWorldToCamera(n,s)),u}getWorldToCameraPosition(n,s,u){const d=this.position;o.scale$2(d,d,-n);const f=new Float64Array(16);return o.fromScaling(f,[u,u,u]),o.translate(f,f,d),f[10]*=s,f}getWorldToCamera(n,s){const u=new Float64Array(16),d=new Float64Array(4),f=this.position;return o.conjugate(d,this._orientation),o.scale$2(f,f,-n),o.fromQuat(u,d),o.translate(u,u,f),u[1]*=-1,u[5]*=-1,u[9]*=-1,u[13]*=-1,u[8]*=s,u[9]*=s,u[10]*=s,u[11]*=s,u}getCameraToClipPerspective(n,s,u,d){const f=new Float64Array(16);return o.perspective(f,n,s,u,d),f}getDistanceToElevation(n,s=!1){const u=n===0?0:o.mercatorZfromAltitude(n,s?o.latFromMercatorY(this.position[1]):this.position[1]),d=this.forward();return(u-this.position[2])/d[2]}clone(){return new Pa([...this.position],[...this.orientation])}}function es(l,n){const s=za(l.projection,l.zoom,l.width,l.height),u=function(f,g,y,w,M){const I=new o.LngLat(y.lng-180*qr,y.lat),P=new o.LngLat(y.lng+180*qr,y.lat),O=f.project(I.lng,I.lat),N=f.project(P.lng,P.lat),G=-Math.atan2(N.y-O.y,N.x-O.x),j=o.MercatorCoordinate.fromLngLat(y);j.y=o.clamp(j.y,-1+qr,1-qr);const q=j.toLngLat(),z=f.project(q.lng,q.lat),V=o.MercatorCoordinate.fromLngLat(q);V.x+=qr;const H=V.toLngLat(),K=f.project(H.lng,H.lat),re=La(K.x-z.x,K.y-z.y,G),le=o.MercatorCoordinate.fromLngLat(q);le.y+=qr;const oe=le.toLngLat(),fe=f.project(oe.lng,oe.lat),pe=La(fe.x-z.x,fe.y-z.y,G),ve=Math.abs(re.x)/Math.abs(pe.y),Ne=o.identity([]);o.rotateZ(Ne,Ne,-G*(1-(M?0:w)));const ge=o.identity([]);return o.scale(ge,ge,[1,1-(1-ve)*w,1]),ge[4]=-pe.x/pe.y*w,o.rotateZ(ge,ge,G),o.multiply(ge,Ne,ge),ge}(l.projection,0,l.center,s,n),d=xu(l);return o.scale(u,u,[d,d,1]),u}function xu(l){const n=l.projection,s=za(l.projection,l.zoom,l.width,l.height),u=vu(n,l.center),d=vu(n,o.LngLat.convert(n.center));return Math.pow(2,u*s+(1-s)*d)}function za(l,n,s,u,d=1/0){const f=l.range;if(!f)return 0;const g=Math.min(d,Math.max(s,u)),y=Math.log(g/1024)/Math.LN2;return o.smoothstep(f[0]+y,f[1]+y,n)}const qr=1/4e4;function vu(l,n){const s=o.clamp(n.lat,-o.MAX_MERCATOR_LATITUDE,o.MAX_MERCATOR_LATITUDE),u=new o.LngLat(n.lng-180*qr,s),d=new o.LngLat(n.lng+180*qr,s),f=l.project(u.lng,s),g=l.project(d.lng,s),y=o.MercatorCoordinate.fromLngLat(u),w=o.MercatorCoordinate.fromLngLat(d),M=g.x-f.x,I=g.y-f.y,P=w.x-y.x,O=w.y-y.y,N=Math.sqrt((P*P+O*O)/(M*M+I*I));return Math.log(N)/Math.LN2}function La(l,n,s){const u=Math.cos(s),d=Math.sin(s);return{x:l*u-n*d,y:l*d+n*u}}class ts{constructor(n,s,u,d,f,g,y){this.tileSize=512,this._renderWorldCopies=f===void 0||f,this._minZoom=n||0,this._maxZoom=s||22,this._minPitch=u??0,this._maxPitch=d??60,this.setProjection(g),this.setMaxBounds(y),this.width=0,this.height=0,this._center=new o.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Ca,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new Pa,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const n=new ts(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return n._elevation=this._elevation,n._centerAltitude=this._centerAltitude,n._centerAltitudeValidForE
1311xaggeration=this._centerAltitudeValidForExaggeration,n.tileSize=this.tileSize,n.mercatorFromTransition=this.mercatorFromTransition,n.width=this.width,n.height=this.height,n.cameraElevationReference=this.cameraElevationReference,n._center=this._center,n._setZoom(this.zoom),n._seaLevelZoom=this._seaLevelZoom,n.angle=this.angle,n._fov=this._fov,n._pitch=this._pitch,n._nearZ=this._nearZ,n._farZ=this._farZ,n._averageElevation=this._averageElevation,n._unmodified=this._unmodified,n._edgeInsets=this._edgeInsets.clone(),n._camera=this._camera.clone(),n._calcMatrices(),n.freezeTileCoverage=this.freezeTileCoverage,n.frustumCorners=this.frustumCorners,n}get elevation(){return this._elevation}set elevation(n){this._elevation!==n&&(this._elevation=n,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(n,s=!1){const u=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(this._seaLevelZoom==null||u)&&this._updateCameraOnTerrain(),(n||u)&&this._constrainCamera(s),this._calcMatrices()}getProjection(){return o.pick(this.projection,["name","center","parallels"])}setProjection(n){this.projectionOptions=n||{name:"mercator"};const s=this.projection?this.getProjection():void 0;this.projection=o.getProjection(this.projectionOptions);const u=!U(s,this.getProjection());return u&&this._calcMatrices(),this.mercatorFromTransition=!1,u}setMercatorFromTransition(){const n=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=o.getProjection({name:"mercator"});const s=n!==this.projection.name;return s&&this._calcMatrices(),s}get minZoom(){return this._minZoom}set minZoom(n){this._minZoom!==n&&(this._minZoom=n,this.zoom=Math.max(this.zoom,n))}get maxZoom(){return this._maxZoom}set maxZoom(n){this._maxZoom!==n&&(this._maxZoom=n,this.zoom=Math.min(this.zoom,n))}get minPitch(){return this._minPitch}set minPitch(n){this._minPitch!==n&&(this._minPitch=n,this.pitch=Math.max(this.pitch,n))}get maxPitch(){return this._maxPitch}set maxPitch(n){this._maxPitch!==n&&(this._maxPitch=n,this.pitch=Math.min(this.pitch,n))}get renderWorldCopies(){return this._renderWorldCopies&&this.projection.supportsWorldCopies===!0}set renderWorldCopies(n){n===void 0?n=!0:n===null&&(n=!1),this._renderWorldCopies=n}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const n=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(n))}get cameraWorldSize(){const n=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(n))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return o.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new o.Point(this.width,this.height)}get bearing(){return o.wrap(this.rotation,-180,180)}set bearing(n){this.rotation=n}get rotation(){return-this.angle/Math.PI*180}set rotation(n){const s=-n*Math.PI/180;var u;this.angle!==s&&(this._unmodified=!1,this.angle=s,this._calcMatrices(),this.rotationMatrix=(u=new o.ARRAY_TYPE(4),o.ARRAY_TYPE!=Float32Array&&(u[1]=0,u[2]=0),u[0]=1,u[3]=1,u),function(d,f,g){var y=f[0],w=f[1],M=f[2],I=f[3],P=Math.sin(g),O=Math.cos(g);d[0]=y*O+M*P,d[1]=w*O+I*P,d[2]=y*-P+M*O,d[3]=w*-P+I*O}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(n){const s=o.clamp(n,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==s&&(this._unmodified=!1,this._pitch=s,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const n=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/n)}set fov(n){n=Math.max(.01,Math.min(60,n)),this._fov!==n&&(this._unmodified=!1,this._fov=o.degToRad(n),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(n){this._averageElevation=n,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(n){const s=Math.min(Math.max(n,this.minZoom),this.maxZoom);this._zoom!==s&&(this._unmodified=!1,this._setZoom(s),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(n){this._zoom=n,this.scale=this.zoomScale(n),this.tileZoom=Math.floor(n),this.zoomFraction=n-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForE
vendor: 11,685 bytes, line 1311
1311xaggeration=void 0);const n=this._elevation;this._centerAltitude=n.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=n.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){this._centerAltitudeValidForExaggeration!==void 0&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const n=this._elevation,s=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],u=this.horizonLineFromTop();let d=0,f=0;for(let g=0;g<s.length;g++){const y=new o.Point(s[g][0]*this.width,u+s[g][1]*(this.height-u)),w=n.pointCoordinate(y);if(!w)continue;const M=1/Math.hypot(w[0]-this._camera.position[0],w[1]-this._camera.position[1]);d+=w[3]*M,f+=M}return f===0?NaN:d/f}get center(){return this._center}set center(n){n.lat===this._center.lat&&n.lng===this._center.lng||(this._unmodified=!1,this._center=n,this._terrainEnabled()&&(this.cameraElevationReference==="ground"?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(this._seaLevelZoom==null||!this._elevation)return;const n=this._seaLevelZoom,s=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),u=this.pixelsPerMeter/this.worldSize*s,d=this._mercatorZfromZoom(n),f=this._mercatorZfromZoom(this._maxZoom),g=Math.max(d-u,f);this._setZoom(this._zoomFromMercatorZ(g))}get padding(){return this._edgeInsets.toJSON()}set padding(n){this._edgeInsets.equals(n)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,n,1),this._calcMatrices())}computeZoomRelativeTo(n){const s=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,n.toAltitude()));let u;u=n.z<this._camera.position[2]?[s.x,s.y,s.z]:[n.x,n.y,n.z];const d=o.length(o.sub([],this._camera.position,u));return o.clamp(this._zoomFromMercatorZ(d),this._minZoom,this._maxZoom)}setFreeCameraOptions(n){if(!this.height||!n.position&&!n.orientation)return;this._updateCameraState();let s=!1;if(n.orientation&&!o.exactEquals(n.orientation,this._camera.orientation)&&(s=this._setCameraOrientation(n.orientation)),n.position){const u=[n.position.x,n.position.y,n.position.z];o.exactEquals$1(u,this._camera.position)||(this._setCameraPosition(u),s=!0)}s&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const n=this._camera.position,s=new yu;return s.position=new o.MercatorCoordinate(n[0],n[1],n[2]),s.orientation=this._camera.orientation,s._elevation=this.elevation,s._renderWorldCopies=this.renderWorldCopies,s}_setCameraOrientation(n){if(!o.length$1(n))return!1;o.normalize$1(n,n);const s=o.transformQuat([],[0,0,-1],n),u=o.transformQuat([],[0,-1,0],n);if(u[2]<0)return!1;const d=Us(s,u);return!!d&&(this._camera.orientation=d,!0)}_setCameraPosition(n){const s=this.zoomScale(this.minZoom)*this.tileSize,u=this.zoomScale(this.maxZoom)*this.tileSize,d=this.cameraToCenterDistance;n[2]=o.clamp(n[2],d/u,d/s),this._camera.position=n}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(n){return this._edgeInsets.equals(n)}interpolatePadding(n,s,u){this._unmodified=!1,this._edgeInsets.interpolate(n,s,u),this._constrain(),this._calcMatrices()}coveringZoomLevel(n){const s=(n.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/n.tileSize));return Math.max(0,s)}getVisibleUnwrappedCoordinates(n){const s=[new o.UnwrappedTileID(0,n)];if(this.renderWorldCopies){const u=this.pointCoordinate(new o.Point(0,0)),d=this.pointCoordinate(new o.Point(this.width,0)),f=this.pointCoordinate(new o.Point(this.width,this.height)),g=this.pointCoordinate(new o.Point(0,this.height)),y=Math.floor(Math.min(u.x,d.x,f.x,g.x)),w=Math.floor(Math.max(u.x,d.x,f.x,g.x)),M=1;for(let I=y-M;I<=w+M;I++)I!==0&&s.push(new o.UnwrappedTileID(I,n))}return s}coveringTiles(n){let s=this.coveringZoomLevel(n);const u=s,d=this.elevation&&!n.isTerrainDEM,f=this.projection.name==="mercator";if(n.minzoom!==void 0&&s<n.minzoom)return[];n.maxzoom!==void 0&&s>n.maxzoom&&(s=n.maxzoom);const g=this.locationCoordinate(this.center),y=this.center.lat,w=1<<s,M=[w*g.x,w*g.y,0],I=this.projection.name==="globe",P=!I,O=o.Frustum.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,s,P),N=I?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),G=w*o.mercatorZfromAltitude(1,this.center.lat),j=this._camera.position[2]/o.mercatorZfromAltitude(1,this.center.lat),q=[w*N.x,w*N.y,j*(P?1:G)],z=this.cameraToCenterDistance/n.tileSize*(n.roundZoom?1:.502),V=this.pitch<=60&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace?s:0,H=n.isTerrainDEM&&this._elevation?1e4*this._elevation.exaggeration():this._centerAltitude,K=n.isTerrainDEM?-H:this._elevation?this._elevation.getMinElevationBelowMSL():0,re=this.projection.isReprojectedInTileSpace?xu(this):1,le=xe=>{const Ge=new o.MercatorCoordinate(xe.x+25e-6,xe.y,xe.z),Fe=new o.MercatorCoordinate(xe.x,xe.y+25e-6,xe.z),qe=xe.toLngLat(),pt=Ge.toLngLat(),Pt=Fe.toLngLat(),ut=this.locationCoordinate(qe),wt=this.locationCoordinate(pt),Ht=this.locationCoordinate(Pt),Zt=Math.hypot(wt.x-ut.x,wt.y-ut.y),dt=Math.hypot(Ht.x-ut.x,Ht.y-ut.y);return Math.sqrt(Zt*dt)*re/25e-6},oe=xe=>{const ze=H,Ge=K;return{aabb:o.tileAABB(this,w,0,0,0,xe,Ge,ze,this.projection),zoom:0,x:0,y:0,minZ:Ge,maxZ:ze,wrap:xe,fullyVisible:!1}},fe=[];let pe=[];const ve=s,Ne=n.reparseOverscaled?u:s,ge=xe=>xe*xe,Le=ge((j-this._centerAltitude)*G),Te=xe=>{if(!this._elevation||!xe.tileID||!f)return;const ze=this._elevation.getMinMaxForTile(xe.tileID),Ge=xe.aabb;ze?(Ge.min[2]=ze.min,Ge.max[2]=ze.max,Ge.center[2]=(Ge.min[2]+Ge.max[2])/2):(xe.shouldSplit=Ve(xe),xe.shouldSplit||(Ge.min[2]=Ge.max[2]=Ge.center[2]=this._centerAltitude))},Ve=xe=>{if(xe.zoom<V)return!0;if(xe.zoom===ve)return!1;if(xe.shouldSplit!=null)return xe.shouldSplit;const ze=xe.aabb.distanceX(q),Ge=xe.aabb.distanceY(q);let Fe=Le,qe=1;if(I){Fe=ge(xe.aabb.distanceZ(q));const ut=Math.pow(2,xe.zoom),wt=o.latFromMercatorY((xe.y+1)/ut),Ht=o.latFromMercatorY(xe.y/ut),Zt=Math.min(Math.max(y,wt),Ht),dt=o.circumferenceAtLatitude(Zt)/o.circumferenceAtLatitude(y);if(qe=Zt===y?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,dt/this._mercatorScaleRatio),this.zoom<=o.GLOBE_ZOOM_THRESHOLD_MIN&&xe.zoom===ve-1&&dt>=.9)return!0}else if(d&&(Fe=ge(xe.aabb.distanceZ(q)*G)),this.projection.isReprojectedInTileSpace&&u<=5){const ut=Math.pow(2,xe.zoom),wt=le(new o.MercatorCoordinate((xe.x+.5)/ut,(xe.y+.5)/ut));qe=wt>.85?1:wt}const pt=ze*ze+Ge*Ge+Fe,Pt=ge((1<<ve-xe.zoom)*z*qe*((ut,wt)=>{if(wt*ge(.707)<ut)return 1;const Ht=Math.sqrt(wt/ut);return Ht/(1.4144271570014144+(Math.pow(1.1,Ht-1.4144271570014144+1)-1)/(1.1-1)-1)})(Math.max(Fe,Le),pt));return pt<Pt};if(this.renderWorldCopies)for(let xe=1;xe<=3;xe++)fe.push(oe(-xe)),fe.push(oe(xe));for(fe.push(oe(0));fe.length>0;){const xe=fe.pop(),ze=xe.x,Ge=xe.y;let Fe=xe.fullyVisible;if(!Fe){const qe=xe.aabb.intersects(O);if(qe===0)continue;Fe=qe===2}if(xe.zoom!==ve&&Ve(xe))for(let qe=0;qe<4;qe++){const pt=(ze<<1)+qe%2,Pt=(Ge<<1)+(qe>>1),ut={aabb:f?xe.aabb.quadrant(qe):o.tileAABB(this,w,xe.zoom+1,pt,Pt,xe.wrap,xe.minZ,xe.maxZ,this.projection),zoom:xe.zoom+1,x:pt,y:Pt,wrap:xe.wrap,fullyVisible:Fe,tileID:void 0,shouldSplit:void 0,minZ:xe.minZ,maxZ:xe.maxZ};d&&!I&&(ut.tileID=new o.OverscaledTileID(xe.zoom+1===ve?Ne:xe.zoom+1,xe.wrap,xe.zoom+1,pt,Pt),Te(ut)),fe.push(ut)}else{const qe=xe.zoom===ve?Ne:xe.zoom;if(n.minzoom&&n.minzoom>qe)continue;const pt=M[0]-(.5+ze+(xe.wrap<<xe.zoom))*(1<<s-xe.zoom),Pt=M[1]-.5-Ge,ut=xe.tileID?xe.tileID:new o.OverscaledTileID(qe,xe.wrap,xe.zoom,ze,Ge);pe.push({tileID:ut,distanceSq:pt*pt+Pt*Pt})}}if(this.fogCullDistSq){const xe=this.fogCullDistSq,ze=this.horizonLineFromTop();pe=pe.filter(Ge=>{const Fe=[0,0,0,1],qe=[o.EXTENT,o.EXTENT,0,1],pt=this.calculateFogTileMatrix(Ge.tileID.toUnwrapped());o.transformMat4$1(Fe,Fe,pt),o.transformMat4$1(qe,qe,pt);const Pt=o.getAABBPointSquareDist(Fe,qe);if(Pt===0)return!0;let ut=!1;const wt=this._elevation;if(wt&&Pt>xe&&ze!==0){const Ht=this.calculateProjMatrix(Ge.tileID.toUnwrapped());let Zt;n.isTerrainDEM||(Zt=wt.getMinMaxForTile(Ge.tileID)),Zt||(Zt={min:K,max:H});const dt=o.furthestTileCorner(this.rotation),di=[dt[0]*o.EXTENT,dt[1]*o.EXTENT,Zt.max];o.transformMat4(di,di,Ht),ut=(1-di[1])*this.height*.5<ze}return Pt<xe||ut})}return pe.sort((xe,ze)=>xe.distanceSq-ze.distanceSq).map(xe=>xe.tileID)}resize(n,s){this.width=n,this.height=s,this.pixelsToGLUnits=[2/n,-2/s],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(n){return Math.pow(2,n)}scaleZoom(n){return Math.log(n)/Math.LN2}project(n){const s=o.clamp(n.lat,-o.MAX_MERCATOR_LATITUDE,o.MAX_MERCATOR_LATITUDE),u=this.projection.project(n.lng,s);return new o.Point(u.x*this.worldSize,u.y*this.worldSize)}unproject(n){return this.projection.unproject(n.x/this.worldSize,n.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/o.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(n,s){let u,d;const f=this.centerPoint;if(this.projection.name==="globe"){const y=this.worldSize;u=(s.x-f.x)/y,d=(s.y-f.y)/y}else{const y=this.pointCoordinate(s),w=this.pointCoordinate(f);u=y.x-w.x,d=y.y-w.y}const g=this.locationCoordinate(n);this.setLocation(new o.MercatorCoordinate(g.x-u,g.y-d))}setLocation(n){this.center=this.coordinateLocation(n),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(n){return this.projection.locationPoint(this,n)}locationPoint3D(n){return this.projection.locationPoint(this,n,!0)}pointLocation(n){return this.coordinateLocation(this.pointCoordinate(n))}pointLocation3D(n){return this.coordinateLocation(this.pointCoordinate3D(n))}locationCoordinate(n,s){const u=s?o.mercatorZfromAltitude(s,n.lat):void 0,d=this.projection.project(n.lng,n.lat);return new o.MercatorCoordinate(d.x,d.y,u)}coordinateLocation(n){return this.projection.unproject(n.x,n.y)}pointRayIntersection(n,s){const u=s??this._centerAltitude,d=[n.x,n.y,0,1],f=[n.x,n.y,1,1];o.transformMat4$1(d,d,this.pixelMatrixInverse),o.transformMat4$1(f,f,this.pixelMatrixInverse);const g=f[3];o.scale$1(d,d,1/d[3]),o.scale$1(f,f,1/g);const y=d[2],w=f[2];return{p0:d,p1:f,t:y===w?0:(u-y)/(w-y)}}screenPointToMercatorRay(n){const s=[n.x,n.y,0,1],u=[n.x,n.y,1,1];return o.transformMat4$1(s,s,this.pixelMatrixInverse),o.transformMat4$1(u,u,this.pixelMatrixInverse),o.scale$1(s,s,1/s[3]),o.scale$1(u,u,1/u[3]),s[2]=o.mercatorZfromAltitude(s[2],this._center.lat)*this.worldSize,u[2]=o.mercatorZfromAltitude(u[2],this._center.lat)*this.worldSize,o.scale$1(s,s,1/this.worldSize),o.scale$1(u,u,1/this.worldSize),new o.Ray([s[0],s[1],s[2]],o.normalize([],o.sub([],u,s)))}rayIntersectionCoordinate(n){const{p0:s,p1:u,t:d}=n,f=o.mercatorZfromAltitude(s[2],this._center.lat),g=o.mercatorZfromAltitude(u[2],this._center.lat);return new o.MercatorCoordinate(o.number(s[0],u[0],d)/this.worldSize,o.number(s[1],u[1],d)/this.worldSize,o.number(f,g,d))}pointCoordinate(n,s=this._centerAltitude){return this.projection.pointCoordinate(this,n.x,n.y,s)}pointCoordinate3D(n){if(!this.elevation)return this.pointCoordinate(n);let s=this.projection.pointCoordinate3D(this,n.x,n.y);if(s)return new o.MercatorCoordinate(s[0],s[1],s[2]);let u=0,d=this.horizonLineFromTop();if(n.y>d)return this.pointCoordinate(n);const f=.02*d,g=n.clone();for(let y=0;y<10&&d-u>f;
1311y++){g.y=o.number(u,d,.66);const w=this.projection.pointCoordinate3D(this,g.x,g.y);w?(d=g.y,s=w):u=g.y}return s?new o.MercatorCoordinate(s[0],s[1],s[2]):this.pointCoordinate(n)}isPointAboveHorizon(n){return this.projection.isPointAboveHorizon(this,n)}isPointOnSurface(n){if(n.y<0||n.y>this.height||n.x<0||n.x>this.width)return!1;if(this.elevation||this.zoom>=o.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(n);const s=this.pointCoordinate(n);return s.y>=0&&s.y<=1}_coordinatePoint(n,s){const u=s&&this.elevation?this.elevation.getAtPointOrZero(n,this._centerAltitude):this._centerAltitude,d=[n.x*this.worldSize,n.y*this.worldSize,u+n.toAltitude(),1];return o.transformMat4$1(d,d,this.pixelMatrix),d[3]>0?new o.Point(d[0]/d[3],d[1]/d[3]):new o.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:n,left:s}=this._edgeInsets,u=this.height-this._edgeInsets.bottom,d=this.width-this._edgeInsets.right,f=this.pointLocation3D(new o.Point(s,n)),g=this.pointLocation3D(new o.Point(d,n)),y=this.pointLocation3D(new o.Point(d,u)),w=this.pointLocation3D(new o.Point(s,u));let M=Math.min(f.lng,g.lng,y.lng,w.lng),I=Math.max(f.lng,g.lng,y.lng,w.lng),P=Math.min(f.lat,g.lat,y.lat,w.lat),O=Math.max(f.lat,g.lat,y.lat,w.lat);const N=Math.pow(2,-this.zoom)/16*270,G=this.projection.name==="globe"?1:4,j=(q,z,V,H,K)=>{const re=(q+V)/2,le=(z+H)/2,oe=new o.Point(re,le),{lng:fe,lat:pe}=this.pointLocation3D(oe),ve=Math.max(0,M-fe,P-pe,fe-I,pe-O);M=Math.min(M,fe),I=Math.max(I,fe),P=Math.min(P,pe),O=Math.max(O,pe),(K<G||ve>N)&&(j(q,z,re,le,K+1),j(re,le,V,H,K+1))};if(j(s,n,d,n,1),j(d,n,d,u,1),j(d,u,s,u,1),j(s,u,s,n,1),this.projection.name==="globe"){const[q,z]=o.polesInViewport(this);q?(O=90,I=180,M=-180):z&&(P=-90,I=180,M=-180)}return new o.LngLatBounds(new o.LngLat(M,P),new o.LngLat(I,O))}_getBoundsRectangular(n,s){const{top:u,left:d}=this._edgeInsets,f=this.height-this._edgeInsets.bottom,g=this.width-this._edgeInsets.right,y=new o.Point(d,u),w=new o.Point(g,u),M=new o.Point(g,f),I=new o.Point(d,f);let P=this.pointCoordinate(y,n),O=this.pointCoordinate(w,n);const N=this.pointCoordinate(M,s),G=this.pointCoordinate(I,s),j=(q,z)=>(z.y-q.y)/(z.x-q.x);return P.y>1&&O.y>=0?P=new o.MercatorCoordinate((1-G.y)/j(G,P)+G.x,1):P.y<0&&O.y<=1&&(P=new o.MercatorCoordinate(-G.y/j(G,P)+G.x,0)),O.y>1&&P.y>=0?O=new o.MercatorCoordinate((1-N.y)/j(N,O)+N.x,1):O.y<0&&P.y<=1&&(O=new o.MercatorCoordinate(-N.y/j(N,O)+N.x,0)),new o.LngLatBounds().extend(this.coordinateLocation(P)).extend(this.coordinateLocation(O)).extend(this.coordinateLocation(G)).extend(this.coordinateLocation(N))}_getBoundsRectangularTerrain(){const n=this.elevation;if(!n.visibleDemTiles.length||n.isUsingMockSource())return this._getBoundsRectangular(0,0);const s=n.visibleDemTiles.reduce((u,d)=>{if(d.dem){const f=d.dem.tree;u.min=Math.min(u.min,f.minimums[0]),u.max=Math.max(u.max,f.maximums[0])}return u},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(s.min*n.exaggeration(),s.max*n.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(n=!0){const s=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,u=this.height/2-s*(1-this._horizonShift);return n?Math.max(0,u):u}getMaxBounds(){return this.maxBounds}setMaxBounds(n){this.maxBounds=n,this.minLat=-o.MAX_MERCATOR_LATITUDE,this.maxLat=o.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,n&&(this.minLat=n.getSouth(),this.maxLat=n.getNorth(),this.minLng=n.getWest(),this.maxLng=n.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=o.mercatorXfromLng(this.minLng)*this.tileSize,this.worldMaxX=o.mercatorXfromLng(this.maxLng)*this.tileSize,this.worldMinY=o.mercatorYfromLat(this.maxLat)*this.tileSize,this.worldMaxY=o.mercatorYfromLat(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(n,s){return this.projection.createTileMatrix(this,s,n)}calculateDistanceTileData(n){const s=n.key,u=this._distanceTileDataCache;if(u[s])return u[s];const d=n.canonical,f=1/this.height,g=this.cameraWorldSize,y=g/this.zoomScale(d.z),w=(d.x+Math.pow(2,d.z)*n.wrap)*y,M=d.y
vendor: 10,326 bytes, line 1311
1311*y,I=this.point;I.x*=g/this.worldSize,I.y*=g/this.worldSize;const P=this.angle,O=Math.sin(-P),N=-Math.cos(-P);return u[s]={bearing:[O,N],center:[(I.x-w)*f,(I.y-M)*f],scale:y/o.EXTENT*f},u[s]}calculateFogTileMatrix(n){const s=n.key,u=this._fogTileMatrixCache;if(u[s])return u[s];const d=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,n);return o.multiply(d,this.worldToFogMatrix,d),u[s]=new Float32Array(d),u[s]}calculateProjMatrix(n,s=!1){const u=n.key,d=s?this._alignedProjMatrixCache:this._projMatrixCache;if(d[u])return d[u];const f=this.calculatePosMatrix(n,this.worldSize);return o.multiply(f,this.projection.isReprojectedInTileSpace?this.mercatorMatrix:s?this.alignedProjMatrix:this.projMatrix,f),d[u]=new Float32Array(f),d[u]}calculatePixelsToTileUnitsMatrix(n){const s=n.tileID.key,u=this._pixelsToTileUnitsCache;if(u[s])return u[s];const d=function(f,g){const{scale:y}=f.tileTransform,w=y*o.EXTENT/(f.tileSize*Math.pow(2,g.zoom-f.tileID.overscaledZ+f.tileID.canonical.z));return M=new Float32Array(4),O=(I=g.inverseAdjustmentMatrix)[1],N=I[2],G=I[3],q=(P=[w,w])[1],M[0]=I[0]*(j=P[0]),M[1]=O*j,M[2]=N*q,M[3]=G*q,M;var M,I,P,O,N,G,j,q}(n,this);return u[s]=d,u[s]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if(this.projection.name==="globe"){const n=1/this.worldSize,s=o.fromScaling([],[n,n,n]);return o.multiply(s,s,this.globeMatrix),s}}recenterOnTerrain(){if(!this._elevation||this.projection.name==="globe")return;const n=this._elevation;this._updateCameraState();const s=o.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,u=this._computeCameraPosition(s),d=this._camera.forward(),f=o.mercatorZfromAltitude(1,this._center.lat);u[2]/=f,d[2]/=f,o.normalize(d,d);const g=n.raycast(u,d,n.exaggeration());if(g){const y=o.scaleAndAdd([],u,d,g),w=new o.MercatorCoordinate(y[0],y[1],o.mercatorZfromAltitude(y[2],o.latFromMercatorY(y[1]))),M=(w.z+o.length([w.x-u[0],w.y-u[1],w.z-u[2]*f]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(M),this._centerAltitude=w.toAltitude(),this._center=this.coordinateLocation(w),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(n=!1){if(!this._elevation)return;const s=this._elevation,u=o.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,d=this._computeCameraPosition(u),f=s.getAtPointOrZero(new o.MercatorCoordinate(...d)),g=this.pixelsPerMeter/this.worldSize*f,y=this._minimumHeightOverTerrain(),w=d[2]-g;if(w<=y)if(w<0||n){const M=this.locationCoordinate(this._center,this._centerAltitude),I=[d[0],d[1],M.z-d[2]],P=o.length(I);I[2]-=(y-w)/this._pixelsPerMercatorPixel;const O=o.length(I);if(O===0)return;o.scale$2(I,I,P/O*this._pixelsPerMercatorPixel),this._camera.position=[d[0],d[1],M.z*this._pixelsPerMercatorPixel-I[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const n=this.projection.name==="globe"||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||n){const O=this.center;return O.lat=o.clamp(O.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!n)&&(O.lng=o.clamp(O.lng,this.minLng,this.maxLng)),this.center=O,void(this._constraining=!1)}const s=this._unmodified,{x:u,y:d}=this.point;let f=0,g=u,y=d;const w=this.width/2,M=this.height/2,I=this.worldMinY*this.scale,P=this.worldMaxY*this.scale;if(d-M<I&&(y=I+M),d+M>P&&(y=P-M),P-I<this.height&&(f=Math.max(f,this.height/(P-I)),y=(P+I)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const O=this.worldMinX*this.scale,N=this.worldMaxX*this.scale,G=this.worldSize/2-(O+N)/2;g=(u+G+this.worldSize)%this.worldSize-G,g-w<O&&(g=O+w),g+w>N&&(g=N-w),N-O<this.width&&(f=Math.max(f,this.width/(N-O)),g=(N+O)/2)}g===u&&y===d||(this.center=this.unproject(new o.Point(g,y))),f&&(this.zoom+=this.scaleZoom(f)),this._constrainCamera(),this._unmodified=s,this._constraining=!1}_minZoomForBounds(){let n=Math.max(0,this.scaleZoom(this.height/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(n=Math.max(n,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),n}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){if(!this.height)return;const n=this.centerOffset,s=this.pixelsPerMeter;this.projection.name==="globe"&&(this._mercatorScaleRatio=o.mercatorZfromAltitude(1,this.center.lat)/o.mercatorZfromAltitude(1,o.GLOBE_SCALE_MATCH_LATITUDE));const u=za(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,u),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;const d=this.projection.zAxisUnit==="meters"?s:1,f=this._camera.getWorldToCamera(this.worldSize,d),g=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);g[8]=2*-n.x/this.width,g[9]=2*n.y/this.height;let y=o.mul([],g,f);if(this.projection.isReprojectedInTileSpace){const le=this.locationCoordinate(this.center),oe=o.identity([]);o.translate(oe,oe,[le.x*this.worldSize,le.y*this.worldSize,0]),o.multiply(oe,oe,es(this)),o.translate(oe,oe,[-le.x*this.worldSize,-le.y*this.worldSize,0]),o.multiply(y,y,oe),this.inverseAdjustmentMatrix=function(fe){const pe=es(fe,!0);return Re([],[pe[0],pe[1],pe[4],pe[5]])}(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];this.mercatorMatrix=o.scale([],y,[this.worldSize,this.worldSize,this.worldSize/d,1]),this.projMatrix=y,this.invProjMatrix=o.invert(new Float64Array(16),this.projMatrix);const w=o.invert([],g);this.frustumCorners=o.FrustumCorners.fromInvProjectionMatrix(w,this.horizonLineFromTop(),this.height);const M=new Float32Array(16);o.identity(M),o.scale(M,M,[1,-1,1]),o.rotateX(M,M,this._pitch),o.rotateZ(M,M,this.angle);const I=o.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ),P=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;I[8]=2*-n.x/this.width,I[9]=2*(n.y+P)/this.height,this.skyboxMatrix=o.multiply(M,I,M);const O=this.point,N=O.x,G=O.y,j=this.width%2/2,q=this.height%2/2,z=Math.cos(this.angle),V=Math.sin(this.angle),H=N-Math.round(N)+z*j+V*q,K=G-Math.round(G)+z*q+V*j,re=new Float64Array(y);if(o.translate(re,re,[H>.5?H-1:H,K>.5?K-1:K,0]),this.alignedProjMatrix=re,y=o.create(),o.scale(y,y,[this.width/2,-this.height/2,1]),o.translate(y,y,[1,-1,0]),this.labelPlaneMatrix=y,y=o.create(),o.scale(y,y,[1,-1,1]),o.translate(y,y,[-1,-1,0]),o.scale(y,y,[2/this.width,2/this.height,1]),this.glCoordMatrix=y,this.pixelMatrix=o.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},y=o.invert(new Float64Array(16),this.pixelMatrix),!y)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=y,this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=o.calculateGlobeMatrix(this);const le=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=o.transformMat4(le,le,f),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=y;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const n=this.cameraWorldSizeForFog,s=this.cameraPixelsPerMeter,u=this._camera.position,d=1/this.height/this._pixelsPerMercatorPixel,f=[n,n,s];o.scale$2(f,f,d),o.scale$2(u,u,-1),o.multiply$2(u,u,f);const g=o.create();o.translate(g,g,u),o.scale(g,g,f),this.mercatorFogMatrix=g,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(n,s,d)}_computeCameraPosition(n){const s=(n=n||this.pixelsPerMeter)/this.pixelsPerMeter,u=this._camera.forward(),d=this.point,f=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*s-n/this.worldSize*this._centerAltitude;return[d.x/this.worldSize-u[0]*f,d.y/this.worldSize-u[1]*f,n/this.worldSize*this._centerAltitude-u[2]*f]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(n){const s=this._maxCameraBoundsDistance()*Math.cos(this._pitch),u=this._camera.position[2],d=n[2];let f=1;this.projection.wrap&&(this.center=this.center.wrap()),d>0&&(f=Math.min((s-u)/d,1)),this._camera.position=o.scaleAndAdd([],this._camera.position,n,f),this._updateStateFromCamera()}_updateStateFromCamera(){const n=this._camera.position,s=this._camera.forward(),{pitch:u,bearing:d}=this._camera.getPitchBearing(),f=o.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,g=this._mercatorZfromZoom(this._maxZoom)*Math.cos(o.degToRad(this._maxPitch)),y=Math.max((n[2]-f)/Math.cos(u),g),w=this._zoomFromMercatorZ(y);o.scaleAndAdd(n,n,s,y),this._pitch=o.clamp(u,o.degToRad(this.minPitch),o.degToRad(this.maxPitch)),this.angle=o.wrap(d,-Math.PI,Math.PI),this._setZoom(o.clamp(w,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new o.MercatorCoordinate(n[0],n[1],n[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(n){return Math.pow(2,n)*this.tileSize}_mercatorZfromZoom(n){return this.cameraToCenterDistance/this._worldSizeFromZoom(n)}_minimumHeightOverTerrain(){const n=Math.min((this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(n)}_zoomFromMercatorZ(n){return this.scaleZoom(this.cameraToCenterDistance/(n*this.tileSize))}zoomFromMercatorZAdjusted(n){let s=0,u=o.GLOBE_ZOOM_THRESHOLD_MAX,d=0,f=1/0;for(;u-s>1e-6&&u>s;){const g=s+.5*(u-s),y=this.tileSize*Math.pow(2,g),w=this.getCameraToCenterDistance(this.projection,g,y),M=this.scaleZoom(w/(n*this.tileSize)),I=Math.abs(g-M);I<f&&(f=I,d=g),g<M?s=g:u=g}return d}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(o.warnOnce("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(n,s){const u=Math.min(n.x,s.x),d=Math.max(n.x,s.x),f=Math.min(n.y,s.y),g=Math.max(n.y,s.y);if(f<this.horizonLineFromTop(!1))return!0;
1311if(this.projection.name!=="mercator")return!1;const y=[new o.Point(u,f),new o.Point(d,g),new o.Point(u,g),new o.Point(d,f)],w=this.renderWorldCopies?-3:0,M=this.renderWorldCopies?4:1;for(const I of y){const P=this.pointRayIntersection(I);if(P.t<0)return!0;const O=this.rayIntersectionCoordinate(P);if(O.x<w||O.y<0||O.x>M||O.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+o.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new o.Point(0,0),new o.Point(this.width,this.height))}zoomDeltaToMovement(n,s){const u=o.length(o.sub([],this._camera.position,n)),d=this._zoomFromMercatorZ(u)+s;return u-this._mercatorZfromZoom(d)}getCameraPoint(){if(this.projection.name==="globe"){const n=function([s,u,d],f){const g=[s,u,d,1];o.transformMat4$1(g,g,f);const y=g[3]=Math.max(g[3],1e-6);return g[0]/=y,g[1]/=y,g[2]/=y,g}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new o.Point(n[0],n[1])}{const n=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new o.Point(0,n))}}getCameraToCenterDistance(n,s=this.zoom,u=this.worldSize){const d=za(n,s,this.width,this.height,1024),f=n.pixelSpaceConversion(this.center.lat,u,d);return .5/Math.tan(.5*this._fov)*this.height*f}getWorldToCameraMatrix(){const n=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&o.multiply(n,n,this.globeMatrix),n}}function is(l,n){let s=!1,u=null;const d=()=>{u=null,s&&(l(),u=setTimeout(d,n),s=!1)};return()=>(s=!0,u||d(),u)}class Zl{constructor(n){this._hashName=n&&encodeURIComponent(n),o.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=is(this._updateHashUnthrottled.bind(this),300)}addTo(n){return this._map=n,o.window.addEventListener("hashchange",this._onHashChange,!1),n.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),o.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const n=this._map;if(!n)return"";const s=Vs(n);if(this._hashName){const u=this._hashName;let d=!1;const f=o.window.location.hash.slice(1).split("&").map(g=>{const y=g.split("=")[0];return y===u?(d=!0,`${y}=${s}`):g}).filter(g=>g);return d||f.push(`${u}=${s}`),`#${f.join("&")}`}return`#${s}`}_getCurrentHash(){const n=o.window.location.hash.replace("#","");if(this._hashName){let s;return n.split("&").map(u=>u.split("=")).forEach(u=>{u[0]===this._hashName&&(s=u)}),(s&&s[1]||"").split("/")}return n.split("/")}_onHashChange(){const n=this._map;if(!n)return!1;const s=this._getCurrentHash();if(s.length>=3&&!s.some(u=>isNaN(u))){const u=n.dragRotate.isEnabled()&&n.touchZoomRotate.isEnabled()?+(s[3]||0):n.getBearing();return n.jumpTo({center:[+s[2],+s[1]],zoom:+s[0],bearing:u,pitch:+(s[4]||0)}),!0}return!1}_updateHashUnthrottled(){const n=o.window.location.href.replace(/(#.+)?$/,this.getHashString());o.window.history.replaceState(o.window.history.state,null,n)}}function Vs(l,n){const s=l.getCenter(),u=Math.round(100*l.getZoom())/100,d=Math.ceil((u*Math.LN2+Math.log(512/360/.5))/Math.LN10),f=Math.pow(10,d),g=Math.round(s.lng*f)/f,y=Math.round(s.lat*f)/f,w=l.getBearing(),M=l.getPitch();let I=n?`/${g}/${y}/${u}`:`${u}/${y}/${g}`;return(w||M)&&(I+="/"+Math.round(10*w)/10),M&&(I+=`/${Math.round(M)}`),I}const Ns={linearity:.3,easing:o.bezier(0,0,.3,1)},Da=o.extend({deceleration:2500,maxSpeed:1400},Ns),Ra=o.extend({deceleration:20,maxSpeed:1400},Ns),st=o.extend({deceleration:1e3,maxSpeed:360},Ns),ur=o.extend({deceleration:1e3,maxSpeed:90},Ns);class bu{constructor(n){this._map=n,this.clear()}clear(){this._inertiaBuffer=[]}record(n){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.exported.now(),settings:n})}_drainInertiaBuffer(){const n=this._inertiaBuffer,s=o.exported.now();for(;n.length>0&&s-n[0].time>160;)n.shift()}_onMoveEnd(n){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const s={zoom:0,bearing:0,pitch:0,pan:new o.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:f}of this._inertiaBuffer)s.zoom+=f.zoomDelta||0,s.bearing+=f.bearingDelta||0,s.pitch+=f.pitchDelta||0,f.panDelta&&s.pan._add(f.panDelta),f.around&&(s.around=f.around),f.pinchAround&&(s.pinchAround=f.pinchAround);const u=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,d={};if(s.pan.mag()){const f=Gs(s.pan.mag(),u,o.extend({},Da,n||{}));d.offset=s.pan.mult(f.amount/s.pan.mag()),d.center=this._map.transform.center,js(d,f)}if(s.zoom){const f=Gs(s.zoom,u,Ra);d.zoom=this._map.transform.zoom+f.amount,js(d,f)}if(s.bearing){const f=Gs(s.bearing,u,st);
vendor: 4,868 bytes, line 1311
1311d.bearing=this._map.transform.bearing+o.clamp(f.amount,-179,179),js(d,f)}if(s.pitch){const f=Gs(s.pitch,u,ur);d.pitch=this._map.transform.pitch+f.amount,js(d,f)}if(d.zoom||d.bearing){const f=s.pinchAround===void 0?s.around:s.pinchAround;d.around=f?this._map.unproject(f):this._map.getCenter()}return this.clear(),d.noMoveStart=!0,d}}function js(l,n){(!l.duration||l.duration<n.duration)&&(l.duration=n.duration,l.easing=n.easing)}function Gs(l,n,s){const{maxSpeed:u,linearity:d,deceleration:f}=s,g=o.clamp(l*d/(n/1e3),-u,u),y=Math.abs(g)/(f*d);return{easing:s.easing,duration:1e3*y,amount:g*(y/2)}}class cn extends o.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(n,s,u,d={}){const f=Qe(s.getCanvasContainer(),u),g=s.unproject(f);super(n,o.extend({point:f,lngLat:g,originalEvent:u},d)),this._defaultPrevented=!1,this.target=s}}class Zs extends o.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(n,s,u){const d=n==="touchend"?u.changedTouches:u.touches,f=ni(s.getCanvasContainer(),d),g=f.map(w=>s.unproject(w)),y=f.reduce((w,M,I,P)=>w.add(M.div(P.length)),new o.Point(0,0));super(n,{points:f,point:y,lngLats:g,lngLat:s.unproject(y),originalEvent:u}),this._defaultPrevented=!1}}class Ba extends o.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(n,s,u){super(n,{originalEvent:u}),this._defaultPrevented=!1}}class ql{constructor(n,s){this._map=n,this._clickTolerance=s.clickTolerance}reset(){this._mousedownPos=void 0}wheel(n){return this._firePreventable(new Ba(n.type,this._map,n))}mousedown(n,s){return this._mousedownPos=s,this._firePreventable(new cn(n.type,this._map,n))}mouseup(n){this._map.fire(new cn(n.type,this._map,n))}preclick(n){const s=o.extend({},n);s.type="preclick",this._map.fire(new cn(s.type,this._map,s))}click(n,s){this._mousedownPos&&this._mousedownPos.dist(s)>=this._clickTolerance||(this.preclick(n),this._map.fire(new cn(n.type,this._map,n)))}dblclick(n){return this._firePreventable(new cn(n.type,this._map,n))}mouseover(n){this._map.fire(new cn(n.type,this._map,n))}mouseout(n){this._map.fire(new cn(n.type,this._map,n))}touchstart(n){return this._firePreventable(new Zs(n.type,this._map,n))}touchmove(n){this._map.fire(new Zs(n.type,this._map,n))}touchend(n){this._map.fire(new Zs(n.type,this._map,n))}touchcancel(n){this._map.fire(new Zs(n.type,this._map,n))}_firePreventable(n){if(this._map.fire(n),n.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Oa{constructor(n){this._map=n}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(n){this._map.fire(new cn(n.type,this._map,n))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new cn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(n){this._delayContextMenu?this._contextMenuEvent=n:this._map.fire(new cn(n.type,this._map,n)),this._map.listens("contextmenu")&&n.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class wu{constructor(n,s){this._map=n,this._el=n.getCanvasContainer(),this._container=n.getContainer(),this._clickTolerance=s.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(n,s){this.isEnabled()&&n.shiftKey&&n.button===0&&(At(),this._startPos=this._lastPos=s,this._active=!0)}mousemoveWindow(n,s){if(!this._active)return;const u=s,d=this._startPos,f=this._lastPos;if(!d||!f||f.equals(u)||!this._box&&u.dist(d)<this._clickTolerance)return;this._lastPos=u,this._box||(this._box=de("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",n));const g=Math.min(d.x,u.x),y=Math.max(d.x,u.x),w=Math.min(d.y,u.y),M=Math.max(d.y,u.y);this._map._requestDomTask(()=>{this._box&&(this._box.style.transform=`translate(${g}px,${w}px)`,this._box.style.width=y-g+"px",this._box.style.height=M-w+"px")})}mouseupWindow(n,s){if(!this._active)return;const u=this._startPos,d=s;if(u&&n.button===0){if(this.reset(),Se(),u.x!==d.x||u.y!==d.y)return this._map.fire(new o.Event("boxzoomend",{originalEvent:n})),{cameraAnimation:f=>f.fitScreenCoordinates(u,d,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",n)}}keydown(n){this._active&&n.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",n))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),bt(),delete this._startPos,delete this._lastPos}_fireEvent(n,s){return this._map.fire(new o.Event(n,{originalEvent:s}))}}
vendor: 8,189 bytes, line 1311
1311function Fa(l,n){const s={};for(let u=0;u<l.length;u++)s[l[u].identifier]=n[u];return s}class ns{constructor(n){this.reset(),this.numTouches=n.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(n,s,u){(this.centroid||u.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=n.timeStamp),u.length===this.numTouches&&(this.centroid=function(d){const f=new o.Point(0,0);for(const g of d)f._add(g);return f.div(d.length)}(s),this.touches=Fa(u,s)))}touchmove(n,s,u){if(this.aborted||!this.centroid)return;const d=Fa(u,s);for(const f in this.touches){const g=d[f];(!g||g.dist(this.touches[f])>30)&&(this.aborted=!0)}}touchend(n,s,u){if((!this.centroid||n.timeStamp-this.startTime>500)&&(this.aborted=!0),u.length===0){const d=!this.aborted&&this.centroid;if(this.reset(),d)return d}}}class Wl{constructor(n){this.singleTap=new ns(n),this.numTaps=n.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(n,s,u){this.singleTap.touchstart(n,s,u)}touchmove(n,s,u){this.singleTap.touchmove(n,s,u)}touchend(n,s,u){const d=this.singleTap.touchend(n,s,u);if(d){const f=n.timeStamp-this.lastTime<500,g=!this.lastTap||this.lastTap.dist(d)<30;if(f&&g||this.reset(),this.count++,this.lastTime=n.timeStamp,this.lastTap=d,this.count===this.numTaps)return this.reset(),d}}}class Nh{constructor(){this._zoomIn=new Wl({numTouches:1,numTaps:2}),this._zoomOut=new Wl({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(n,s,u){this._zoomIn.touchstart(n,s,u),this._zoomOut.touchstart(n,s,u)}touchmove(n,s,u){this._zoomIn.touchmove(n,s,u),this._zoomOut.touchmove(n,s,u)}touchend(n,s,u){const d=this._zoomIn.touchend(n,s,u),f=this._zoomOut.touchend(n,s,u);return d?(this._active=!0,n.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:g.getZoom()+1,around:g.unproject(d)},{originalEvent:n})}):f?(this._active=!0,n.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:g.getZoom()-1,around:g.unproject(f)},{originalEvent:n})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Tu={0:1,2:2};class rs{constructor(n){this.reset(),this._clickTolerance=n.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(n,s){return!1}_move(n,s){return{}}mousedown(n,s){if(this._lastPoint)return;const u=qt(n);this._correctButton(n,u)&&(this._lastPoint=s,this._eventButton=u)}mousemoveWindow(n,s){const u=this._lastPoint;if(u){if(n.preventDefault(),this._eventButton!=null&&function(d,f){const g=Tu[f];return d.buttons===void 0||(d.buttons&g)!==g}(n,this._eventButton))this.reset();else if(this._moved||!(s.dist(u)<this._clickTolerance))return this._moved=!0,this._lastPoint=s,this._move(u,s)}}mouseupWindow(n){this._lastPoint&&qt(n)===this._eventButton&&(this._moved&&Se(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Xl extends rs{mousedown(n,s){super.mousedown(n,s),this._lastPoint&&(this._active=!0)}_correctButton(n,s){return s===0&&!n.ctrlKey}_move(n,s){return{around:s,panDelta:s.sub(n)}}}class Hl extends rs{_correctButton(n,s){return s===0&&n.ctrlKey||s===2}_move(n,s){const u=.8*(s.x-n.x);if(u)return this._active=!0,{bearingDelta:u}}contextmenu(n){n.preventDefault()}}class Kl extends rs{_correctButton(n,s){return s===0&&n.ctrlKey||s===2}_move(n,s){const u=-.5*(s.y-n.y);if(u)return this._active=!0,{pitchDelta:u}}contextmenu(n){n.preventDefault()}}class Ua{constructor(n,s){this._map=n,this._el=n.getCanvasContainer(),this._minTouches=1,this._clickTolerance=s.clickTolerance||1,this.reset(),o.bindAll(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new o.Point(0,0)}touchstart(n,s,u){return this._calculateTransform(n,s,u)}touchmove(n,s,u){if(this._active&&!(u.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(u.length===1&&!o.isFullscreen())return void this._showTouchPanBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return n.cancelable&&n.preventDefault(),this._calculateTransform(n,s,u)}}touchend(n,s,u){this._calculateTransform(n,s,u),this._active&&u.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(n,s,u){u.length>0&&(this._active=!0);const d=Fa(u,s),f=new o.Point(0,0),g=new o.Point(0,0);let y=0;for(const M in d){const I=d[M],P=this._touches[M];P&&(f._add(I),g._add(I.sub(P)),y++,d[M]=I)}if(this._touches=d,y<this._minTouches||!g.mag())return;const w=g.div(y);return this._sum._add(w),this._sum.mag()<this._clickTolerance?void 0:{around:f.div(y),panDelta:w}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=de("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")},500)}}class qs{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(n){}_move(n,s,u){return{}}touchstart(n,s,u){this._firstTwoTouches||u.length<2||(this._firstTwoTouches=[u[0].identifier,u[1].identifier],this._start([s[0],s[1]]))}touchmove(n,s,u){const d=this._firstTwoTouches;if(!d)return;n.preventDefault();const[f,g]=d,y=Ws(u,s,f),w=Ws(u,s,g);if(!y||!w)return;const M=this._aroundCenter?null:y.add(w).div(2);return this._move([y,w],M,n)}touchend(n,s,u){if(!this._firstTwoTouches)return;const[d,f]=this._firstTwoTouches,g=Ws(u,s,d),y=Ws(u,s,f);g&&y||(this._active&&Se(),this.reset())}touchcancel(){this.reset()}enable(n){this._enabled=!0,this._aroundCenter=!!n&&n.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function Ws(l,n,s){for(let u=0;u<l.length;u++)if(l[u].identifier===s)return n[u]}function Yl(l,n){return Math.log(l/n)/Math.LN2}class Eu extends qs{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(n){this._startDistance=this._distance=n[0].dist(n[1])}_move(n,s){const u=this._distance;if(this._distance=n[0].dist(n[1]),this._active||!(Math.abs(Yl(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Yl(this._distance,u),pinchAround:s}}}function Jl(l,n){return 180*l.angleWith(n)/Math.PI}class Su extends qs{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(n){this._startVector=this._vector=n[0].sub(n[1]),this._minDiameter=n[0].dist(n[1])}_move(n,s){const u=this._vector;if(this._vector=n[0].sub(n[1]),u&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:Jl(this._vector,u),pinchAround:s}}_isBelowThreshold(n){this._minDiameter=Math.min(this._minDiameter,n.mag());const s=25/(Math.PI*this._minDiameter)*360,u=this._startVector;if(!u)return!1;const d=Jl(n,u);return Math.abs(d)<s}}
vendor: 16,879 bytes, line 1311
1311function ao(l){return Math.abs(l.y)>Math.abs(l.x)}class Iu extends qs{constructor(n){super(),this._map=n}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(n){this._lastPoints=n,ao(n[0].sub(n[1]))&&(this._valid=!1)}_move(n,s,u){const d=this._lastPoints;if(!d)return;const f=n[0].sub(d[0]),g=n[1].sub(d[1]);return this._map._cooperativeGestures&&!o.isFullscreen()&&u.touches.length<3||(this._valid=this.gestureBeginsVertically(f,g,u.timeStamp),!this._valid)?void 0:(this._lastPoints=n,this._active=!0,{pitchDelta:(f.y+g.y)/2*-.5})}gestureBeginsVertically(n,s,u){if(this._valid!==void 0)return this._valid;const d=n.mag()>=2,f=s.mag()>=2;if(!d&&!f)return;if(!d||!f)return this._firstMove==null&&(this._firstMove=u),u-this._firstMove<100&&void 0;const g=n.y>0==s.y>0;return ao(n)&&ao(s)&&g}}const Mu={panStep:100,bearingStep:15,pitchStep:10};class jh{constructor(){const n=Mu;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(n){if(n.altKey||n.ctrlKey||n.metaKey)return;let s=0,u=0,d=0,f=0,g=0;switch(n.keyCode){case 61:case 107:case 171:case 187:s=1;break;case 189:case 109:case 173:s=-1;break;case 37:n.shiftKey?u=-1:(n.preventDefault(),f=-1);break;case 39:n.shiftKey?u=1:(n.preventDefault(),f=1);break;case 38:n.shiftKey?d=1:(n.preventDefault(),g=-1);break;case 40:n.shiftKey?d=-1:(n.preventDefault(),g=1);break;default:return}return this._rotationDisabled&&(u=0,d=0),{cameraAnimation:y=>{const w=y.getZoom();y.easeTo({duration:300,easeId:"keyboardHandler",easing:Au,zoom:s?Math.round(w)+s*(n.shiftKey?2:1):w,bearing:y.getBearing()+u*this._bearingStep,pitch:y.getPitch()+d*this._pitchStep,offset:[-f*this._panStep,-g*this._panStep],center:y.getCenter()},{originalEvent:n})}}}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 Au(l){return l*(2-l)}const Ql=4.000244140625;class Cu{constructor(n,s){this._map=n,this._el=n.getCanvasContainer(),this._handler=s,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,o.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(n){this._defaultZoomRate=n}setWheelZoomRate(n){this._wheelZoomRate=n}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(n){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!n&&n.around==="center",this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(n){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(n.ctrlKey||n.metaKey||this.isZooming()||o.isFullscreen()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let s=n.deltaMode===o.window.WheelEvent.DOM_DELTA_LINE?40*n.deltaY:n.deltaY;const u=o.exported.now(),d=u-(this._lastWheelEventTime||0);this._lastWheelEventTime=u,s!==0&&s%Ql==0?this._type="wheel":s!==0&&Math.abs(s)<4?this._type="trackpad":d>400?(this._type=null,this._lastValue=s,this._timeout=setTimeout(this._onTimeout,40,n)):this._type||(this._type=Math.abs(d*s)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,s+=this._lastValue)),n.shiftKey&&s&&(s/=4),this._type&&(this._lastWheelEvent=n,this._delta-=s,this._active||this._start(n)),n.preventDefault()}_onTimeout(n){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(n)}_start(n){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 s=Qe(this._el,n);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:s,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const n=this._map.transform;this._type==="wheel"&&n.projection.wrap&&(n._center.lng>=180||n._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const s=()=>n._terrainEnabled()&&this._aroundCoord?n.computeZoomRelativeTo(this._aroundCoord):n.zoom;if(this._delta!==0){const w=this._type==="wheel"&&Math.abs(this._delta)>Ql?this._wheelZoomRate:this._defaultZoomRate;let M=2/(1+Math.exp(-Math.abs(this._delta*w)));this._delta<0&&M!==0&&(M=1/M);const I=s(),P=Math.pow(2,I),O=typeof this._targetZoom=="number"?n.zoomScale(this._targetZoom):P;this._targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(O*M))),this._type==="wheel"&&(this._startZoom=I,this._easing=this._smoothOutEasing(200)),this._delta=0}const u=typeof this._targetZoom=="number"?this._targetZoom:s(),d=this._startZoom,f=this._easing;let g,y=!1;if(this._type==="wheel"&&d&&f){const w=Math.min((o.exported.now()-this._lastWheelEventTime)/200,1),M=f(w);g=o.number(d,u,M),w<1?this._frameId||(this._frameId=!0):y=!0}else g=u,y=!0;return this._active=!0,y&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!y,zoomDelta:g-s(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(n){let s=o.ease;if(this._prevEase){const u=this._prevEase,d=(o.exported.now()-u.start)/u.duration,f=u.easing(d+.01)-u.easing(d),g=.27/Math.sqrt(f*f+1e-4)*.01,y=Math.sqrt(.0729-g*g);s=o.bezier(g,y,.25,1)}return this._prevEase={start:o.exported.now(),duration:n,easing:s},s}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=de("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(o.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")},200)}}class ku{constructor(n,s){this._clickZoom=n,this._tapZoom=s}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 In{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(n,s){return n.preventDefault(),{cameraAnimation:u=>{u.easeTo({duration:300,zoom:u.getZoom()+(n.shiftKey?-1:1),around:u.unproject(s)},{originalEvent:n})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gh{constructor(){this._tap=new Wl({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(n,s,u){this._swipePoint||(this._tapTime&&n.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?u.length>0&&(this._swipePoint=s[0],this._swipeTouch=u[0].identifier):this._tap.touchstart(n,s,u))}touchmove(n,s,u){if(this._tapTime){if(this._swipePoint){if(u[0].identifier!==this._swipeTouch)return;const d=s[0],f=d.y-this._swipePoint.y;return this._swipePoint=d,n.preventDefault(),this._active=!0,{zoomDelta:f/128}}}else this._tap.touchmove(n,s,u)}touchend(n,s,u){this._tapTime?this._swipePoint&&u.length===0&&this.reset():this._tap.touchend(n,s,u)&&(this._tapTime=n.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Pu{constructor(n,s,u){this._el=n,this._mousePan=s,this._touchPan=u}enable(n){this._inertiaOptions=n||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Zh{constructor(n,s,u){this._pitchWithRotate=n.pitchWithRotate,this._mouseRotate=s,this._mousePitch=u}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 qh{constructor(n,s,u,d){this._el=n,this._touchZoom=s,this._touchRotate=u,this._tapDragZoom=d,this._rotationDisabled=!1,this._enabled=!0}enable(n){this._touchZoom.enable(n),this._rotationDisabled||this._touchRotate.enable(n),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const $n=l=>l.zoom||l.drag||l.pitch||l.rotate;class zu extends o.Event{}class Wh{constructor(){this.constants=[1,1,.01],this.radius=0}setup(n,s){const u=o.sub([],s,n);this.radius=o.length(u[2]<0?o.div([],u,this.constants):[u[0],u[1],0])}projectRay(n){o.div(n,n,this.constants),o.normalize(n,n),o.mul$1(n,n,this.constants);const s=o.scale$2([],n,this.radius);if(s[2]>0){const u=o.scale$2([],[0,0,1],o.dot(s,[0,0,1])),d=o.scale$2([],o.normalize([],[s[0],s[1],0]),this.radius),f=o.add([],s,o.scale$2([],o.sub([],o.add([],d,u),s),2));s[0]=f[0],s[1]=f[1]}return s}}function hr(l){return l.panDelta&&l.panDelta.mag()||l.zoomDelta||l.bearingDelta||l.pitchDelta}class Tr{constructor(n,s){this._map=n,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new bu(n),this._bearingSnap=s.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new Wh,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(s),o.bindAll(["handleEvent","handleWindowEvent"],this);const u=this._el;this._listeners=[[u,"touchstart",{passive:!0}],[u,"touchmove",{passive:!1}],[u,"touchend",void 0],[u,"touchcancel",void 0],[u,"mousedown",void 0],[u,"mousemove",void 0],[u,"mouseup",void 0],[o.window.document,"mousemove",{capture:!0}],[o.window.document,"mouseup",void 0],[u,"mouseover",void 0],[u,"mouseout",void 0],[u,"dblclick",void 0],[u,"click",void 0],[u,"keydown",{capture:!1}],[u,"keyup",void 0],[u,"wheel",{passive:!1}],[u,"contextmenu",void 0],[o.window,"blur",void 0]];for(const[d,f,g]of this._listeners)d.addEventListener(f,d===o.window.document?this.handleWindowEvent:this.handleEvent,g)}destroy(){for(const[n,s,u]of this._listeners)n.removeEventListener(s,n===o.window.document?this.handleWindowEvent:this.handleEvent,u)}_addDefaultHandlers(n){const s=this._map,u=s.getCanvasContainer();this._add("mapEvent",new ql(s,n));const d=s.boxZoom=new wu(s,n);this._add("boxZoom",d);const f=new Nh,g=new In;s.doubleClickZoom=new ku(g,f),this._add("tapZoom",f),this._add("clickZoom",g);const y=new Gh;this._add("tapDragZoom",y);const w=s.touchPitch=new Iu(s);this._add("touchPitch",w);const M=new Hl(n),I=new Kl(n);s.dragRotate=new Zh(n,M,I),this._add("mouseRotate",M,["mousePitch"]),this._add("mousePitch",I,["mouseRotate"]);const P=new Xl(n),O=new Ua(s,n);s.dragPan=new Pu(u,P,O),this._add("mousePan",P),this._add("touchPan",O,["touchZoom","touchRotate"]);const N=new Su,G=new Eu;s.touchZoomRotate=new qh(u,G,N,y),this._add("touchRotate",N,["touchPan","touchZoom"]),this._add("touchZoom",G,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Oa(s));const j=s.scrollZoom=new Cu(s,this);this._add("scrollZoom",j,["mousePan"]);const q=s.keyboard=new jh;this._add("keyboard",q);for(const z of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])n.interactive&&n[z]&&s[z].enable(n[z])}_add(n,s,u){this._handlers.push({handlerName:n,handler:s,allowed:u}),this._handlersById[n]=s}stop(n){if(!this._updatingCamera){for(const{handler:s}of this._handlers)s.reset();this._inertia.clear(),this._fireEvents({},{},n),this._changes=[]}}isActive(){for(const{handler:n}of this._handlers)if(n.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!$n(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(n,s,u){for(const d in n)if(d!==u&&(!s||s.indexOf(d)<0))return!0;return!1}handleWindowEvent(n){this.handleEvent(n,`${n.type}Window`)}_getMapTouches(n){const s=[];for(const u of n)this._el.contains(u.target)&&s.push(u);return s}handleEvent(n,s){this._updatingCamera=!0;const u=n.type==="renderFrame",d=u?void 0:n,f={needsRenderFrame:!1},g={},y={},w=n.touches?this._getMapTouches(n.touches):void 0,M=w?ni(this._el,w):u?void 0:Qe(this._el,n);for(const{handlerName:O,handler:N,allowed:G}of this._handlers){if(!N.isEnabled())continue;let j;this._blockedByActive(y,G,O)?N.reset():N[s||n.type]&&(j=N[s||n.type](n,M,w),this.mergeHandlerResult(f,g,j,O,d),j&&j.needsRenderFrame&&this._triggerRenderFrame()),(j||N.isActive())&&(y[O]=N)}const I={};for(const O in this._previousActiveHandlers)y[O]||(I[O]=d);this._previousActiveHandlers=y,(Object.keys(I).length||hr(f))&&(this._changes.push([f,g,I]),this._triggerRenderFrame()),(Object.keys(y).length||hr(f))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:P}=f;P&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],P(this._map))}mergeHandlerResult(n,s,u,d,f){if(!u)return;o.extend(n,u);const g={handlerName:d,originalEvent:u.originalEvent||f};u.zoomDelta!==void 0&&(s.zoom=g),u.panDelta!==void 0&&(s.drag=g),u.pitchDelta!==void 0&&(s.pitch=g),u.bearingDelta!==void 0&&(s.rotate=g)}_applyChanges(){const n={},s={},u={};for(const[d,f,g]of this._changes)d.panDelta&&(n.panDelta=(n.panDelta||new o.Point(0,0))._add(d.panDelta)),d.zoomDelta&&(n.zoomDelta=(n.zoomDelta||0)+d.zoomDelta),d.bearingDelta&&(n.bearingDelta=(n.bearingDelta||0)+d.bearingDelta),d.pitchDelta&&(n.pitchDelta=(n.pitchDelta||0)+d.pitchDelta),d.around!==void 0&&(n.around=d.around),d.aroundCoord!==void 0&&(n.aroundCoord=d.aroundCoord),d.pinchAround!==void 0&&(n.pinchAround=d.pinchAround),d.noInertia&&(n.noInertia=d.noInertia),o.extend(s,f),o.extend(u,g);this._updateMapTransform(n,s,u),this._changes=[]}_updateMapTransform(n,s,u){const d=this._map,f=d.transform,g=V=>[V.x,V.y,V.z];if((V=>{const H=this._eventsInProgress.drag;return H&&!this._handlersById[H.handlerName].isActive()})()&&!hr(n)){const V=f.zoom;f.cameraElevationReference="sea",f.recenterOnTerrain(),f.cameraElevationReference="ground",V!==f.zoom&&this._map._update(!0)}if(f._isCameraConstrained&&d._stop(!0),!hr(n))return void this._fireEvents(s,u,!0);let{panDelta:y,zoomDelta:w,bearingDelta:M,pitchDelta:I,around:P,aroundCoord:O,pinchAround:N}=n;f._isCameraConstrained&&(w>0&&(w=0),f._isCameraConstrained=!1),N!==void 0&&(P=N),(w||(V=>s[V]&&!this._eventsInProgress[V])("drag"))&&P&&(this._dragOrigin=g(f.pointCoordinate3D(P)),this._trackingEllipsoid.setup(f._camera.position,this._dragOrigin)),f.cameraElevationReference="sea",d._stop(!0),P=P||d.transform.centerPoint,M&&(f.bearing+=M),I&&(f.pitch+=I),f._updateCameraState();const G=[0,0,0];if(y)if(f.projection.name==="mercator"){const V=this._trackingEllipsoid.projectRay(f.screenPointToMercatorRay(P).dir),H=this._trackingEllipsoid.projectRay(f.screenPointToMercatorRay(P.sub(y)).dir);
vendor: 2,078 bytes, line 1311
1311G[0]=H[0]-V[0],G[1]=H[1]-V[1]}else{const V=f.pointCoordinate(P);if(f.projection.name==="globe"){y=y.rotate(-f.angle);const H=f._pixelsPerMercatorPixel/f.worldSize;G[0]=-y.x*o.mercatorScale(o.latFromMercatorY(V.y))*H,G[1]=-y.y*o.mercatorScale(f.center.lat)*H}else{const H=f.pointCoordinate(P.sub(y));V&&H&&(G[0]=H.x-V.x,G[1]=H.y-V.y)}}const j=f.zoom,q=[0,0,0];if(w){const V=g(O||f.pointCoordinate3D(P)),H={dir:o.normalize([],o.sub([],V,f._camera.position))};if(H.dir[2]<0){const K=f.zoomDeltaToMovement(V,w);o.scale$2(q,H.dir,K)}}const z=o.add(G,G,q);f._translateCameraConstrained(z),w&&Math.abs(f.zoom-j)>1e-4&&f.recenterOnTerrain(),f.cameraElevationReference="ground",this._map._update(),n.noInertia||this._inertia.record(n),this._fireEvents(s,u,!0)}_fireEvents(n,s,u){const d=$n(this._eventsInProgress),f=$n(n),g={};for(const I in n){const{originalEvent:P}=n[I];this._eventsInProgress[I]||(g[`${I}start`]=P),this._eventsInProgress[I]=n[I]}!d&&f&&this._fireEvent("movestart",f.originalEvent);for(const I in g)this._fireEvent(I,g[I]);f&&this._fireEvent("move",f.originalEvent);for(const I in n){const{originalEvent:P}=n[I];this._fireEvent(I,P)}const y={};let w;for(const I in this._eventsInProgress){const{handlerName:P,originalEvent:O}=this._eventsInProgress[I];this._handlersById[P].isActive()||(delete this._eventsInProgress[I],w=s[P]||O,y[`${I}end`]=w)}for(const I in y)this._fireEvent(I,y[I]);const M=$n(this._eventsInProgress);if(u&&(d||f)&&!M){this._updatingCamera=!0;const I=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),P=O=>O!==0&&-this._bearingSnap<O&&O<this._bearingSnap;I?(P(I.bearing||this._map.getBearing())&&(I.bearing=0),this._map.easeTo(I,{originalEvent:w})):(this._map.fire(new o.Event("moveend",{originalEvent:w})),P(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(n,s){this._map.fire(new o.Event(n,s?{originalEvent:s}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(n=>{this._frameId=void 0,this.handleEvent(new zu("renderFrame",{timeStamp:n})),this._applyChanges()})}
1311_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const zo="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Va extends o.Evented{constructor(n,s){super(),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=s.bearingSnap,this._respectPrefersReducedMotion=s.respectPrefersReducedMotion!==!1,o.bindAll(["_renderFrameCallback"],this)}getCenter(){return new o.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(n,s){return this.jumpTo({center:n},s)}panBy(n,s,u){return n=o.Point.convert(n).mult(-1),this.panTo(this.transform.center,o.extend({offset:n},s),u)}panTo(n,s,u){return this.easeTo(o.extend({center:n},s),u)}getZoom(){return this.transform.zoom}setZoom(n,s){return this.jumpTo({zoom:n},s),this}zoomTo(n,s,u){return this.easeTo(o.extend({zoom:n},s),u)}zoomIn(n,s){return this.zoomTo(this.getZoom()+1,n,s),this}zoomOut(n,s){return this.zoomTo(this.getZoom()-1,n,s),this}getBearing(){return this.transform.bearing}setBearing(n,s){return this.jumpTo({bearing:n},s),this}getPadding(){return this.transform.padding}setPadding(n,s){return this.jumpTo({padding:n},s),this}rotateTo(n,s,u){return this.easeTo(o.extend({bearing:n},s),u)}resetNorth(n,s){return this.rotateTo(0,o.extend({duration:1e3},n),s),this}resetNorthPitch(n,s){return this.easeTo(o.extend({bearing:0,pitch:0,duration:1e3},n),s),this}snapToNorth(n,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(n,s):this}getPitch(){return this.transform.pitch}setPitch(n,s){return this.jumpTo({pitch:n},s),this}cameraForBounds(n,s){n=o.LngLatBounds.convert(n);const u=s&&s.bearing||0,d=s&&s.pitch||0,f=n.getNorthWest(),g=n.getSouthEast();return this._cameraForBounds(this.transform,f,g,u,d,s)}_extendCameraOptions(n){const s={top:0,bottom:0,right:0,left:0};if(typeof(n=o.extend({padding:s,offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding=="number"){const u=n.padding;n.padding={top:u,bottom:u,right:u,left:u}}return n.padding=o.extend(s,n.padding),n}_minimumAABBFrustumDistance(n,s){const u=s.max[0]-s.min[0],d=s.max[1]-s.min[1];return u/d>n.aspect?u/(2*Math.tan(.5*n.fovX)*n.aspect):d/(2*Math.tan(.5*n.fovY)*n.aspect)}_cameraForBoundsOnGlobe(n,s,u,d,f,g){const y=n.clone(),w=this._extendCameraOptions(g);y.bearing=d,y.pitch=f;const M=o.LngLat.convert(s),I=o.LngLat.convert(u),P=.5*(M.lat+I.lat),O=.5*(M.lng+I.lng),N=o.latLngToECEF(P,O),G=o.normalize([],N),j=o.normalize([],o.cross([],G,[0,1,0])),q=o.cross([],j,G),z=[j[0],j[1],j[2],0,q[0],q[1],q[2],0,G[0],G[1],G[2],0,0,0,0,1],V=[N,o.latLngToECEF(M.lat,M.lng),o.latLngToECEF(I.lat,M.lng),o.latLngToECEF(I.lat,I.lng),o.latLngToECEF(M.lat,I.lng),o.latLngToECEF(P,M.lng),o.latLngToECEF(P,I.lng),o.latLngToECEF(M.lat,O),o.latLngToECEF(I.lat,O)];let H=o.Aabb.fromPoints(V.map(Fe=>[o.dot(j,Fe),o.dot(q,Fe),o.dot(G,Fe)]));const K=o.transformMat4([],H.center,z);o.squaredLength(K)===0&&o.set(K,0,0,1),o.normalize(K,K),o.scale$2(K,K,o.GLOBE_RADIUS),y.center=o.ecefToLatLng(K);const re=y.getWorldToCameraMatrix(),le=o.invert(new Float64Array(16),re);H=o.Aabb.applyTransform(H,o.multiply([],re,z)),o.transformMat4(K,K,re);const oe=.5*(H.max[2]-H.min[2]),fe=this._minimumAABBFrustumDistance(y,H),pe=o.scale$2([],[0,0,1],oe),ve=o.add(pe,K,pe),Ne=fe+(y.pitch===0?0:o.distance(K,ve)),ge=y.globeCenterInViewSpace,Le=o.sub([],K,[ge[0],ge[1],ge[2]]);o.normalize(Le,Le),o.scale$2(Le,Le,Ne);const Te=o.add([],K,Le);o.transformMat4(Te,Te,le);const Ve=o.earthRadius/o.GLOBE_RADIUS,xe=o.length(Te),ze=o.mercatorZfromAltitude(Math.max(xe*Ve-o.earthRadius,Number.EPSILON),0),Ge=Math.min(y.zoomFromMercatorZAdjusted(ze),w.maxZoom);return Ge>.5*(o.GLOBE_ZOOM_THRESHOLD_MIN+o.GLOBE_ZOOM_THRESHOLD_MAX)?(y.setProjection({name:"mercator"}),y.zoom=Ge,this._cameraForBounds(y,s,u,d,f,g)):{center:y.center,zoom:Ge,bearing:d,pitch:f}}queryTerrainElevation(n,s){const u=this.transform.elevation;return u?(s=o.extend({},{exaggerated:!0},s),u.getAtPoint(o.MercatorCoordinate.fromLngLat(n),null,s.exaggerated)):null}_cameraForBounds(n,s,u,d,f,g){if(n.projection.name==="globe")return this._cameraForBoundsOnGlobe(n,s,u,d,f,g);const y=n.clone(),w=this._extendCameraOptions(g),M=y.padding;y.bearing=d,y.pitch=f;const I=o.LngLat.convert(s),P=o.LngLat.convert(u),O=new o.LngLat(I.lng,P.lat),N=new o.LngLat(P.lng,I.lat),G=y.project(I),j=y.project(P),q=this.queryTerrainElevation(I),z=this.queryTerrainElevation(P),V=this.queryTerrainElevation(O),H=this.queryTerrainElevation(N),K=[[G.x,G.y,Math.min(q||0,z||0,V||0,H||0)],[j.x,j.y,Math.max(q||0,z||0,V||0,H||0)]];let re=o.Aabb.fromPoints(K);const le=y.getWorldToCameraMatrix(),oe=o.invert(new Float64Array(16),le);re=o.Aabb.applyTransform(re,le);
1311const fe=o.sub([],re.max,re.min),pe=M.left||0,ve=M.right||0,Ne=M.bottom||0,ge=M.top||0,{left:Le,right:Te,top:Ve,bottom:xe}=w.padding,ze=.5*(pe+ve),Ge=.5*(ge+Ne),Fe=Math.min(y.scaleZoom(y.scale*Math.min((y.width-(pe+ve+Le+Te))/fe[0],(y.height-(Ne+ge+xe+Ve))/fe[1])),w.maxZoom),qe=y.scale/y.zoomScale(Fe);re=new o.Aabb([re.min[0]-(Le+ze)*qe,re.min[1]-(xe+Ge)*qe,re.min[2]],[re.max[0]+(Te+ze)*qe,re.max[1]+(Ve+Ge)*qe,re.max[2]]);const pt=.5*fe[2],Pt=this._minimumAABBFrustumDistance(y,re),ut=[0,0,1,0];o.transformMat4$1(ut,ut,le),o.normalize$2(ut,ut);const wt=o.scale$2([],ut,Pt+pt),Ht=o.add([],re.center,wt),Zt=(typeof w.offset.x=="number"&&typeof w.offset.y=="number"?new o.Point(w.offset.x,w.offset.y):o.Point.convert(w.offset)).rotate(-o.degToRad(d));re.center[0]-=Zt.x*qe,re.center[1]+=Zt.y*qe,o.transformMat4(re.center,re.center,oe),o.transformMat4(Ht,Ht,oe);const dt=[re.center[0],re.center[1],Ht[2]*y.pixelsPerMeter];o.scale$2(dt,dt,1/y.worldSize);const di=o.lngFromMercatorX(dt[0]),fi=o.latFromMercatorY(dt[1]),mi=Math.min(y._zoomFromMercatorZ(dt[2]),w.maxZoom),_i=new o.LngLat(di,fi);return y.mercatorFromTransition&&mi<.5*(o.GLOBE_ZOOM_THRESHOLD_MIN+o.GLOBE_ZOOM_THRESHOLD_MAX)?(y.setProjection({name:"globe"}),y.zoom=mi,this._cameraForBounds(y,s,u,d,f,g)):{center:_i,zoom:mi,bearing:d,pitch:f}}fitBounds(n,s,u){const d=this.cameraForBounds(n,s);return this._fitInternal(d,s,u)}fitScreenCoordinates(n,s,u,d,f){const g=o.Point.convert(n),y=o.Point.convert(s),w=new o.Point(Math.min(g.x,y.x),Math.min(g.y,y.y)),M=new o.Point(Math.max(g.x,y.x),Math.max(g.y,y.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(g,y))return this;const I=this.transform.pointLocation3D(w),P=this.transform.pointLocation3D(M),O=this.transform.pointLocation3D(new o.Point(w.x,M.y)),N=this.transform.pointLocation3D(new o.Point(M.x,w.y)),G=[Math.min(I.lng,P.lng,O.lng,N.lng),Math.min(I.lat,P.lat,O.lat,N.lat)],j=[Math.max(I.lng,P.lng,O.lng,N.lng),Math.max(I.lat,P.lat,O.lat,N.lat)],q=d&&d.pitch?d.pitch:this.getPitch(),z=this._cameraForBounds(this.transform,G,j,u,q,d);return this._fitInternal(z,d,f)}_fitInternal(n,s,u){return n?(delete(s=o.extend(n,s)).padding,s.linear?this.easeTo(s,u):this.flyTo(s,u)):this}jumpTo(n,s){this.stop();const u=n.preloadOnly?this.transform.clone():this.transform;let d=!1,f=!1,g=!1;return"zoom"in n&&u.zoom!==+n.zoom&&(d=!0,u.zoom=+n.zoom),n.center!==void 0&&(u.center=o.LngLat.convert(n.center)),"bearing"in n&&u.bearing!==+n.bearing&&(f=!0,u.bearing=+n.bearing),"pitch"in n&&u.pitch!==+n.pitch&&(g=!0,u.pitch=+n.pitch),n.padding==null||u.isPaddingEqual(n.padding)||(u.padding=n.padding),n.preloadOnly?(this._preloadTiles(u),this):(this.fire(new o.Event("movestart",s)).fire(new o.Event("move",s)),d&&this.fire(new o.Event("zoomstart",s)).fire(new o.Event("zoom",s)).fire(new o.Event("zoomend",s)),f&&this.fire(new o.Event("rotatestart",s)).fire(new o.Event("rotate",s)).fire(new o.Event("rotateend",s)),g&&this.fire(new o.Event("pitchstart",s)).fire(new o.Event("pitch",s)).fire(new o.Event("pitchend",s)),this.fire(new o.Event("moveend",s)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||o.warnOnce(zo),this.transform.getFreeCameraOptions()}setFreeCameraOptions(n,s){const u=this.transform;if(!u.projection.supportsFreeCamera)return o.warnOnce(zo),this;this.stop();const d=u.zoom,f=u.pitch,g=u.bearing;u.setFreeCameraOptions(n);const y=d!==u.zoom,w=f!==u.pitch,M=g!==u.bearing;return this.fire(new o.Event("movestart",s)).fire(new o.Event("move",s)),y&&this.fire(new o.Event("zoomstart",s)).fire(new o.Event("zoom",s)).fire(new o.Event("zoomend",s)),M&&this.fire(new o.Event("rotatestart",s)).fire(new o.Event("rotate",s)).fire(new o.Event("rotateend",s)),w&&this.fire(new o.Event("pitchstart",s)).fire(new o.Event("pitch",s)).fire(new o.Event("pitchend",s)),this.fire(new o.Event("moveend",s)),this}easeTo(n,s){this._stop(!1,n.easeId),((n=o.extend({offset:[0,0],duration:500,easing:o.ease},n)).animate===!1||this._prefersReducedMotion(n))&&(n.duration=0);const u=this.transform,d=this.getZoom(),f=this.getBearing(),g=this.getPitch(),y=this.getPadding(),w="zoom"in n?+n.zoom:d,M="bearing"in n?this._normalizeBearing(n.bearing,f):f,I="pitch"in n?+n.pitch:g,P="padding"in n?n.padding:u.padding,O=o.Point.convert(n.offset);let N,G,j;if(u.projection.name==="globe"){const pe=o.MercatorCoordinate.fromLngLat(u.center),ve=O.rotate(-u.angle);pe.x+=ve.x/u.worldSize,pe.y+=ve.y/u.worldSize;const Ne=pe.toLngLat(),ge=o.LngLat.convert(n.center||Ne);this._normalizeCenter(ge),N=u.centerPoint.add(ve),G=new o.Point(pe.x,pe.
vendor: 7,649 bytes, line 1311
1311y).mult(u.worldSize),j=new o.Point(o.mercatorXfromLng(ge.lng),o.mercatorYfromLat(ge.lat)).mult(u.worldSize).sub(G)}else{N=u.centerPoint.add(O);const pe=u.pointLocation(N),ve=o.LngLat.convert(n.center||pe);this._normalizeCenter(ve),G=u.project(pe),j=u.project(ve).sub(G)}const q=u.zoomScale(w-d);let z,V;n.around&&(z=o.LngLat.convert(n.around),V=u.locationPoint(z));const H=this._zooming||w!==d,K=this._rotating||f!==M,re=this._pitching||I!==g,le=!u.isPaddingEqual(P),oe=pe=>ve=>{if(H&&(pe.zoom=o.number(d,w,ve)),K&&(pe.bearing=o.number(f,M,ve)),re&&(pe.pitch=o.number(g,I,ve)),le&&(pe.interpolatePadding(y,P,ve),N=pe.centerPoint.add(O)),z)pe.setLocationAtPoint(z,V);else{const Ne=pe.zoomScale(pe.zoom-d),ge=w>d?Math.min(2,q):Math.max(.5,q),Le=Math.pow(ge,1-ve),Te=pe.unproject(G.add(j.mult(ve*Le)).mult(Ne));pe.setLocationAtPoint(pe.renderWorldCopies?Te.wrap():Te,N)}return n.preloadOnly||this._fireMoveEvents(s),pe};if(n.preloadOnly){const pe=this._emulate(oe,n.duration,u);return this._preloadTiles(pe),this}const fe={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=H,this._rotating=K,this._pitching=re,this._padding=le,this._easeId=n.easeId,this._prepareEase(s,n.noMoveStart,fe),this._ease(oe(u),pe=>{u.recenterOnTerrain(),this._afterEase(s,pe)},n),this}_prepareEase(n,s,u={}){this._moving=!0,this.transform.cameraElevationReference="sea",s||u.moving||this.fire(new o.Event("movestart",n)),this._zooming&&!u.zooming&&this.fire(new o.Event("zoomstart",n)),this._rotating&&!u.rotating&&this.fire(new o.Event("rotatestart",n)),this._pitching&&!u.pitching&&this.fire(new o.Event("pitchstart",n))}_fireMoveEvents(n){this.fire(new o.Event("move",n)),this._zooming&&this.fire(new o.Event("zoom",n)),this._rotating&&this.fire(new o.Event("rotate",n)),this._pitching&&this.fire(new o.Event("pitch",n))}_afterEase(n,s){if(this._easeId&&s&&this._easeId===s)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const u=this._zooming,d=this._rotating,f=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,u&&this.fire(new o.Event("zoomend",n)),d&&this.fire(new o.Event("rotateend",n)),f&&this.fire(new o.Event("pitchend",n)),this.fire(new o.Event("moveend",n))}flyTo(n,s){if(this._prefersReducedMotion(n)){const Fe=o.pick(n,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Fe,s)}this.stop(),n=o.extend({offset:[0,0],speed:1.2,curve:1.42,easing:o.ease},n);const u=this.transform,d=this.getZoom(),f=this.getBearing(),g=this.getPitch(),y=this.getPadding(),w="zoom"in n?o.clamp(+n.zoom,u.minZoom,u.maxZoom):d,M="bearing"in n?this._normalizeBearing(n.bearing,f):f,I="pitch"in n?+n.pitch:g,P="padding"in n?n.padding:u.padding,O=u.zoomScale(w-d),N=o.Point.convert(n.offset);let G=u.centerPoint.add(N);const j=u.pointLocation(G),q=o.LngLat.convert(n.center||j);this._normalizeCenter(q);const z=u.project(j),V=u.project(q).sub(z);let H=n.curve;const K=Math.max(u.width,u.height),re=K/O,le=V.mag();if("minZoom"in n){const Fe=o.clamp(Math.min(n.minZoom,d,w),u.minZoom,u.maxZoom),qe=K/u.zoomScale(Fe-d);H=Math.sqrt(qe/le*2)}const oe=H*H;function fe(Fe){const qe=(re*re-K*K+(Fe?-1:1)*oe*oe*le*le)/(2*(Fe?re:K)*oe*le);return Math.log(Math.sqrt(qe*qe+1)-qe)}function pe(Fe){return(Math.exp(Fe)-Math.exp(-Fe))/2}function ve(Fe){return(Math.exp(Fe)+Math.exp(-Fe))/2}const Ne=fe(0);let ge=function(Fe){return ve(Ne)/ve(Ne+H*Fe)},Le=function(Fe){return K*((ve(Ne)*(pe(qe=Ne+H*Fe)/ve(qe))-pe(Ne))/oe)/le;var qe},Te=(fe(1)-Ne)/H;if(Math.abs(le)<1e-6||!isFinite(Te)){if(Math.abs(K-re)<1e-6)return this.easeTo(n,s);const Fe=re<K?-1:1;Te=Math.abs(Math.log(re/K))/H,Le=function(){return 0},ge=function(qe){return Math.exp(Fe*H*qe)}}n.duration="duration"in n?+n.duration:1e3*Te/("screenSpeed"in n?+n.screenSpeed/H:+n.speed),n.maxDuration&&n.duration>n.maxDuration&&(n.duration=0);const Ve=f!==M,xe=I!==g,ze=!u.isPaddingEqual(P),Ge=Fe=>qe=>{const pt=qe*Te,Pt=1/ge(pt);Fe.zoom=qe===1?w:d+Fe.scaleZoom(Pt),Ve&&(Fe.bearing=o.number(f,M,qe)),xe&&(Fe.pitch=o.number(g,I,qe)),ze&&(Fe.interpolatePadding(y,P,qe),G=Fe.centerPoint.add(N));const ut=qe===1?q:Fe.unproject(z.add(V.mult(Le(pt))).mult(Pt));return Fe.setLocationAtPoint(Fe.renderWorldCopies?ut.wrap():ut,G),Fe._updateCameraOnTerrain(),n.preloadOnly||this._fireMoveEvents(s),Fe};if(n.preloadOnly){const Fe=this._emulate(Ge,n.duration,u);return this._preloadTiles(Fe),this}return this._zooming=!0,this._rotating=Ve,this._pitching=xe,this._padding=ze,this._prepareEase(s,!1),this._ease(Ge(u),()=>this._afterEase(s),n),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(n,s){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const u=this._onEaseEnd;this._onEaseEnd=void 0,u.call(this,s)}if(!n){const u=this.handlers;u&&u.stop(!1)}return this}_ease(n,s,u){u.animate===!1||u.duration===0?(n(1),s()):(this._easeStart=o.exported.now(),this._easeOptions=u,this._onEaseFrame=n,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const n=Math.min((o.exported.now()-this._easeStart)/this._easeOptions.duration,1),s=this._onEaseFrame;s&&s(this._easeOptions.easing(n)),n<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(n,s){n=o.wrap(n,-180,180);const u=Math.abs(n-s);return Math.abs(n-360-s)<u&&(n-=360),Math.abs(n+360-s)<u&&(n+=360),n}_normalizeCenter(n){const s=this.transform;if(!s.renderWorldCopies||s.maxBounds)return;const u=n.lng-s.center.lng;n.lng+=u>180?-360:u<-180?360:0}_prefersReducedMotion(n){return this._respectPrefersReducedMotion&&o.exported.prefersReducedMotion&&!(n&&n.essential)}_emulate(n,s,u){const d=Math.ceil(15*s/1e3),f=[],g=n(u.clone());for(let y=0;y<=d;y++){const w=g(y/d);f.push(w.clone())}return f}}class ct{constructor(n={}){this.options=n,o.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(n){const s=this.options&&this.options.compact;return this._map=n,this._container=de("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=de("button","mapboxgl-ctrl-attrib-button",this._container),de("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=de("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),s&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),s===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(n,s){const u=this._map._getUIString(`AttributionControl.${s}`);n.setAttribute("aria-label",u),n.removeAttribute("title"),n.firstElementChild&&n.firstElementChild.setAttribute("title",u)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","fal
1311se")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let n=this._editLink;n||(n=this._editLink=this._container.querySelector(".mapbox-improve-map"));const s=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||o.config.ACCESS_TOKEN}];if(n){const u=s.reduce((d,f,g)=>(f.value&&(d+=`${f.key}=${f.value}${g<s.length-1?"&":""}`),d),"?");n.href=`${o.config.FEEDBACK_URL}/${u}#${Vs(this._map,!0)}`,n.rel="noopener nofollow",this._setElementTitle(n,"MapFeedback")}}_updateData(n){!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let n=[];if(this._map.style.stylesheet){const d=this._map.style.stylesheet;this.styleOwner=d.owner,this.styleId=d.id}const s=this._map.style._sourceCaches;for(const d in s){const f=s[d];if(f.used){const g=f.getSource();g.attribution&&n.indexOf(g.attribution)<0&&n.push(g.attribution)}}n.sort((d,f)=>d.length-f.length),n=n.filter((d,f)=>{for(let g=f+1;g<n.length;g++)if(n[g].indexOf(d)>=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?n=[...this.options.customAttribution,...n]:n.unshift(this.options.customAttribution));const u=n.join(" | ");u!==this._attribHTML&&(this._attribHTML=u,n.length?(this._innerContainer.innerHTML=u,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class $l{constructor(){o.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(n){this._map=n,this._container=de("div","mapboxgl-ctrl");const s=de("a","mapboxgl-ctrl-logo");return s.target="_blank",s.rel="noopener nofollow",s.href="https://www.mapbox.com/",s.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),s.setAttribute("rel","noopener nofollow"),this._container.appendChild(s),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(n){n&&n.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const n=this._map.style._sourceCaches;if(Object.entries(n).length===0)return!0;for(const s in n){const u=n[s].getSource();if(u.hasOwnProperty("mapbox_logo")&&!u.mapbox_logo)return!1}return!0}_updateCompact(){const n=this._container.children;if(n.length){const s=n[0];this._map.getCanvasContainer().offsetWidth<250?s.classList.add("mapboxgl-compact"):s.classList.remove("mapboxgl-compact")}}}class ec{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(n){const s=++this._id;return this._queue.push({callback:n,id:s,cancelled:!1}),s}remove(n){const s=this._currentlyRunning,u=s?this._queue.concat(s):this._queue;for(const d of u)if(d.id===n)return void(d.cancelled=!0)}run(n=0){const s=this._currentlyRunning=this._queue;this._queue=[];for(const u of s)if(!u.cancelled&&(u.callback(n),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function os(l,n,s){if(l=new o.LngLat(l.lng,l.lat),n){const u=new o.LngLat(l.lng-360,l.lat),d=new o.LngLat(l.lng+360,l.lat),f=360*Math.ceil(Math.abs(l.lng-s.center.lng)/360),g=s.locationPoint(l).distSqr(n),y=n.x<0||n.y<0||n.x>s.width||n.y>s.height;s.locationPoint(u).distSqr(n)<g&&(y||Math.abs(u.lng-s.center.lng)<f)?l=u:s.locationPoint(d).distSqr(n)<g&&(y||Math.abs(d.lng-s.center.lng)<f)&&(l=d)}for(;Math.abs(l.lng-s.center.lng)>180;){const u=s.locationPoint(l);if(u.x>=0&&u.y>=0&&u.x<=s.width&&u.y<=s.height)break;l.lng>s.center.lng?l.lng-=360:l.lng+=360}return l}
vendor: 4,505 bytes, line 1311
1311const Lo={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%)"};class rt extends o.Evented{constructor(n,s){if(super(),(n instanceof o.window.HTMLElement||s)&&(n=o.extend({element:n},s)),o.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&n.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=n&&n.occludedOpacity||.2,n&&n.element)this._element=n.element,this._offset=o.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=de("div");const d=41,f=27,g=Ie("svg",{display:"block",height:d*this._scale+"px",width:f*this._scale+"px",viewBox:`0 0 ${f} ${d}`},this._element),y=Ie("radialGradient",{id:"shadowGradient"},Ie("defs",{},g));Ie("stop",{offset:"10%","stop-opacity":.4},y),Ie("stop",{offset:"100%","stop-opacity":.05},y),Ie("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},g),Ie("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},g),Ie("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},g),Ie("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},g),this._offset=o.Point.convert(n&&n.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",d=>{d.preventDefault()}),this._element.addEventListener("mousedown",d=>{d.preventDefault()});const u=this._element.classList;for(const d in Lo)u.remove(`mapboxgl-marker-anchor-${d}`);u.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(n){return n===this._map||(this.remove(),this._map=n,n.getCanvasContainer().appendChild(this._element),n.on("move",this._updateMoving),n.on("moveend",this._update),n.on("remove",this._clearFadeTimer),n._addMarker(this),this.setDraggable(this._draggable),this._update(),n.on("click",this._onMapClick)),this}remove(){const n=this._map;return n&&(n.off("click",this._onMapClick),n.off("move",this._updateMoving),n.off("moveend",this._update),n.off("mousedown",this._addDragHandler),n.off("touchstart",this._addDragHandler),n.off("mouseup",this._onUp),n.off("touchend",this._onUp),n.off("mousemove",this._onMove),n.off("touchmove",this._onMove),n.off("remove",this._clearFadeTimer),n._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(n){return this._lngLat=o.LngLat.convert(n),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(n){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),n){if(!("offset"in n.options)){const d=Math.sqrt(Math.pow(13.5,2)/2);n.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[d,-1*(24.6+d)],"bottom-right":[-d,-1*(24.6+d)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=n,n._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","fal
1311se")}return this}_onKeyPress(n){const s=n.code,u=n.charCode||n.keyCode;s!=="Space"&&s!=="Enter"&&u!==32&&u!==13||this.togglePopup()}_onMapClick(n){const s=n.originalEvent.target,u=this._element;this._popup&&(s===u||u.contains(s))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const n=this._popup;return n?(n.isOpen()?(n.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(n.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const n=this._map,s=this._pos;if(!n||!s)return!1;const u=n.unproject(s),d=n.getFreeCameraOptions();if(!d.position)return!1;const f=d.position.toLngLat();return f.distanceTo(u)<.9*f.distanceTo(this._lngLat)}_evaluateOpacity(){const n=this._map;if(!n)return;const s=this._pos;if(!s||s.x<0||s.x>n.transform.width||s.y<0||s.y>n.transform.height)return void this._clearFadeTimer();const u=n.unproject(s);let d;n._showingGlobe()&&o.isLngLatBehindGlobe(n.transform,this._lngLat)?d=0:(d=1-n._queryFogOpacity(u),n.transform._terrainEnabled()&&n.getTerrain()&&this._behindTerrain()&&(d*=this._occludedOpacity)),this._element.style.opacity=`${d}`,this._element.style.pointerEvents=d>0?"auto":"none",this._popup&&this._popup._setOpacity(d),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const n=this._pos;if(!n||!this._map)return;const s=this._offset.mult(this._scale);this._element.style.transform=`
1312            translate(${n.x}px,${n.y}px)
1313            ${Lo[this._anchor]}
1314            ${this._calculateXYTransform()} ${this._calculateZTransform()}
1315            translate(${s.x}px,${s.y}px)
1316        `}_calculateXYTransform(){const n=this._pos,s=this._map,u=this.getPitchAlignment();if(!s||!n||u!=="map")return"";if(!s._showingGlobe()){const w=s.getPitch();return w?`rotateX(${w}deg)`:""}const d=o.radToDeg(o.globeTiltAtLngLat(s.transform,this._lngLat)),f=n.sub(o.globeCenterToScreenPoint(s.transform)),g=Math.abs(f.x)+Math.abs(f.y);if(g===0)return"";const y=d/g;return`rotateX(${-f.y*y}deg) rotateY(${f.x*y}deg)`}_calculateZTransform(){const n=this._pos,s=this._map;if(!s||!n)return"";let u=0;const d=this.getRotationAlignment();if(d==="map")if(s._showingGlobe()){const f=s.project(new o.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),g=s.project(new o.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(f);u=o.radToDeg(Math.atan2(g.y,g.x))-90}else u=-s.getBearing();else if(d==="horizon"){const f=o.smoothstep(4,6,s.getZoom()),g=o.globeCenterToScreenPoint(s.transform);g.y+=f*s.transform.height;const y=n.sub(g),w=o.radToDeg(Math.atan2(y.y,y.x));u=(w>90?w-270:w+90)*(1-f)}return u+=this._rotation,u?`rotateZ(${u}deg)`:""}_update(n){o.window.cancelAnimationFrame(this._updateFrameId);const s=this._map;
1316s&&(s.transform.renderWorldCopies&&(this._lngLat=os(this._lngLat,this._pos,s.transform)),this._pos=s.project(this._lngLat),n===!0?this._updateFrameId=o.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),s._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(s._showingGlobe()||s.getTerrain()||s.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(n){return this._offset=o.Point.convert(n),this._update(),this}_onMove(n){const s=this._map;if(!s)return;const u=this._pointerdownPos,d=this._positionDelta;if(u&&d){if(!this._isDragging){const f=this._clickTolerance||s._clickTolerance;if(n.point.dist(u)<f)return;this._isDragging=!0}this._pos=n.point.sub(d),this._lngLat=s.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new o.Event("dragstart"))),this.fire(new o.Event("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const n=this._map;n&&(n.off("mousemove",this._onMove),n.off("touchmove",this._onMove)),this._state==="active"&&this.fire(new o.Event("dragend")),this._state="inactive"}_addDragHandler(n){const s=this._map,u=this._pos;s&&u&&this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(u),this._pointerdownPos=n.point,this._state="pending",s.on("mousemove",this._onMove),s.on("touchmove",this._onMove),s.once("mouseup",this._onUp),s.once("touchend",this._onUp))}setDraggable(n){this._draggable=!!n;const s=this._map;return s&&(n?(s.on("mousedown",this._addDragHandler),s.on("touchstart",this._addDragHandler)):(s.off("mousedown",this._addDragHandler),s.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(n){return this._rotation=n||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(n){return this._rotationAlignment=n||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment==="auto"||this._rotationAlignment==="horizon"&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(n){return this._pitchAlignment=n||"auto",this._update(),this}getPitchAlignment(){return this._pitchAlignment==="auto"?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(n){return this._occludedOpacity=n||.2,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const tc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Xh=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Lu(l=new o.Point(0,0),n="bottom"){if(typeof l=="number"){const s=Math.round(Math.sqrt(.5*Math.pow(l,2)));switch(n){case"top":return new o.Point(0,l);case"top-left":return new o.Point(s,s);case"top-right":return new o.Point(-s,s);case"bottom":return new o.Point(0,-l);case"bottom-left":return new o.Point(s,-s);case"bottom-right":return new o.Point(-s,-s);case"left":return new o.Point(l,0);case"right":return new o.Point(-l,0)}return new o.Point(0,0)}return l instanceof o.Point||Array.isArray(l)?o.Point.convert(l):o.Point.convert(l[n]||[0,0])}class ic{constructor(n){this.jumpTo(n)}getValue(n){if(n<=this._startTime)return this._start;if(n>=this._endTime)return this._end;const s=o.easeCubicInOut((n-this._startTime)/(this._endTime-this._startTime));return this._start*(1-s)+this._end*s}isEasing(n){return n>=this._startTime&&n<=this._endTime}jumpTo(n){this._startTime=-1/0,this._endTime=-1/0,this._start=n,this._end=n}easeTo(n,s,u){this._start=this.getValue(s),this._end=n,this._startTime=s,this._endTime=s+u}}const Du={"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","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},Ru={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileC
1316acheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},Hh={showCompass:!0,showZoom:!0,visualizePitch:!1};class Kh{constructor(n,s,u=!1){this._clickTolerance=10,this.element=s,this.mouseRotate=new Hl({clickTolerance:n.dragRotate._mouseRotate._clickTolerance}),this.map=n,u&&(this.mousePitch=new Kl({clickTolerance:n.dragRotate._mousePitch._clickTolerance})),o.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),s.addEventListener("mousedown",this.mousedown),s.addEventListener("touchstart",this.touchstart,{passive:!1}),s.addEventListener("touchmove",this.touchmove),s.addEventListener("touchend",this.touchend),s.addEventListener("touchcancel",this.reset)}down(n,s){this.mouseRotate.mousedown(n,s),this.mousePitch&&this.mousePitch.mousedown(n,s),At()}move(n,s){const u=this.map,d=this.mouseRotate.mousemoveWindow(n,s),f=d&&d.bearingDelta;if(f&&u.setBearing(u.getBearing()+f),this.mousePitch){const g=this.mousePitch.mousemoveWindow(n,s),y=g&&g.pitchDelta;y&&u.setPitch(u.getPitch()+y)}}off(){const n=this.element;n.removeEventListener("mousedown",this.mousedown),n.removeEventListener("touchstart",this.touchstart,{passive:!1}),n.removeEventListener("touchmove",this.touchmove),n.removeEventListener("touchend",this.touchend),n.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){bt(),o.window.removeEventListener("mousemove",this.mousemove),o.window.removeEventListener("mouseup",this.mouseup)}mousedown(n){this.down(o.extend({},n,{ctrlKey:!0,preventDefault:()=>n.preventDefault()}),Qe(this.element,n)),o.window.addEventListener("mousemove",this.mousemove),o.window.addEventListener("mouseup",this.mouseup)}mousemove(n){this.move(n,Qe(this.element,n))}mouseup(n){this.mouseRotate.mouseupWindow(n),this.mousePitch&&this.mousePitch.mouseupWindow(n),this.offTemp()}touchstart(n){n.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=ni(this.element,n.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>n.preventDefault()},this._startPos))}touchmove(n){n.targetTouches.length!==1?this.reset():(this._lastPos=ni(this.element,n.targetTouches)[0],this.move({preventDefault:()=>n.preventDefault()},this._lastPos))}touchend(n){n.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}const nc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},rc={maxWidth:100,unit:"metric"},oc={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},ss={version:o.version,supported:he,setRTLTextPlugin:o.setRTLTextPlugin,getRTLTextPluginStatus:o.getRTLTextPluginStatus,Map:class extends Va{constructor(l){if(o.LivePerformanceUtils.mark(o.PerformanceMarkers.create),(l=o.extend({},Ru,l)).minZoom!=null&&l.maxZoom!=null&&l.minZoom>l.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(l.minPitch!=null&&l.maxPitch!=null&&l.minPitch>l.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(l.minPitch!=null&&l.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(l.maxPitch!=null&&l.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(l.antialias&&o.isSafariWithAntialiasingBug(o.window)&&(l.antialias=!1,o.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new ts(l.minZoom,l.maxZoom,l.minPitch,l.maxPitch,l.renderWorldCopies),l),this._interactive=l.interactive,this._minTileCacheSize=l.minTileCacheSize,this._maxTileCacheSize=l.maxTileCacheSize,this._failIfMajorPerformanceCaveat=l.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=l.preserveDrawingBuffer,this._antialias=l.antialias,this._useWebGL2=l.useWebGL2,this._trackResize=l.trackResize,this._bearingSnap=l.bearingSnap,this._refreshExpiredTiles=l.refreshExpiredTiles,this._fadeDuration=l.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=l.crossSourceCollisions,this._collectResourceTiming=l.collectResourceTiming,this._optimizeForTerrain=l.optimizeForTerrain,this._language=this._parseLanguage(l.language),this._worldview=l.worldview,this._renderTaskQueue=new ec,this._domRenderTaskQueue=new ec,this._controls=[],this._markers=[],this._popups=[],this._mapId=o.uniqueId(),this._locale=o.extend({},Du,l.locale),this._clickTolerance=l.clickTolerance,this._cooperativeGestures=l.cooperativeGestures,this._performanceMetricsCollection=l.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new ic(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new o.RequestManager(l.transformRequest,l.accessToken,l.testMode),this._silenceAuthErrors=!!l.testMode,typeof l.container=="string"){if(this._container=o.window.document.getElementById(l.container),!this._container)throw new Error(`Container '${l.container}' not found.`)}else{if(!(l.container instanceof o.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=l.container}if(this._container.childNodes.length>0&&o.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),l.maxBounds&&this.setMaxBounds(l.maxBounds),o.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),o.window!==void 0&&(o.window.addEventListener("online",this._onWindowOnline,!1),o.window.addEventListener("resize",this._onWindowResize,!1),o.window.addEventListener("orientationchange",this._onWindowResize,!1),o.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),o.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new Tr(this,l),this._localFontFamily=l.localFontFamily,this._localIdeographFontFamily=l.localIdeographFontFamily,l.style&&this.setStyle(l.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),l.projection&&this.setProjection(l.projection),this._hash=l.hash&&new Zl(typeof l.hash=="string"&&l.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch}),l.bounds&&(this.resize(),this.fitBounds(l.bounds,o.extend({},l.fitBoundsOptions,{duration:0})))),this.resize(),l.attributionControl&&this.addControl(new ct({customAttribution:l.customAttribution}
1316)),this._logoControl=new $l,this.addControl(this._logoControl,l.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",n=>{this._update(n.dataType==="style"),this.fire(new o.Event(`${n.dataType}data`,n))}),this.on("dataloading",n=>{this.fire(new o.Event(`${n.dataType}dataloading`,n))})}_getMapId(){return this._mapId}addControl(l,n){if(n===void 0&&(n=l.getDefaultPosition?l.getDefaultPosition():"top-right"),!l||!l.onAdd)return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const s=l.onAdd(this);this._controls.push(l);const u=this._controlPositions[n];return n.indexOf("bottom")!==-1?u.insertBefore(s,u.firstChild):u.appendChild(s),this}removeControl(l){if(!l||!l.onRemove)return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const n=this._controls.indexOf(l);return n>-1&&this._controls.splice(n,1),l.onRemove(this),this}hasControl(l){return this._controls.indexOf(l)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(l){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const n=!this._moving;return n&&this.fire(new o.Event("movestart",l)).fire(new o.Event("move",l)),this.fire(new o.Event("resize",l)),n&&this.fire(new o.Event("moveend",l)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(l){return this.transform.setMaxBounds(o.LngLatBounds.convert(l)),this._update()}setMinZoom(l){if((l=l??-2)>=-2&&l<=this.transform.maxZoom)return this.transform.minZoom=l,this._update(),this.getZoom()<l?this.setZoom(l):this.fire(new o.Event("zoomstart")).fire(new o.Event("zoom")).fire(new o.Event("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(l){if((l=l??22)>=this.transform.minZoom)return this.transform.maxZoom=l,this._update(),this.getZoom()>l?this.setZoom(l):this.fire(new o.Event("zoomstart")).fire(new o.Event("zoom")).fire(new o.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(l){if((l=l??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(l>=0&&l<=this.transform.maxPitch)return this.transform.minPitch=l,this._update(),this.getPitch()<l?this.setPitch(l):this.fire(new o.Event("pitchstart")).fire(new o.Event("pitch")).fire(new o.Event("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(l){if((l=l??85)>85)throw new Error("maxPitch must be less than or equal to 85");if(l>=this.transform.minPitch)return this.transform.maxPitch=l,this._update(),this.getPitch()>l?this.setPitch(l):this.fire(new o.Event("pitchstart")).fire(new o.Event("pitch")).fire(new o.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(l){return this.transform.renderWorldCopies=l,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(l){return l==="auto"?o.window.navigator.language:Array.isArray(l)?l.length===0?void 0:l.map(n=>n==="auto"?o.window.navigator.language:n):l}setLanguage(l){const n=this._parseLanguage(l);if(!this.style||n===this._language)return this;this._language=n,this.style._reloadSources();for(const s of this._controls)s._setLanguage&&s._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(l){return this.style&&l!==this._worldview?(this._worldview=l,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(l){return this._lazyInitEmptyStyle(),l?typeof l=="string"&&(l={name:l}):l=null,this._useExplicitProjection=!!l,this._prioritizeAndUpdateProjection(l,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const l=this.transform,n=l.projection.name;let s;n==="globe"&&l.zoom>=o.GLOBE_ZOOM_THRESHOLD_MAX?(l.setMercatorFromTransition(),s=!0):n==="mercator"&&l.zoom<o.GLOBE_ZOOM_THRESHOLD_MAX&&(l.setProjection({name:"globe"}),s=!0),s&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayer
1316Update())}_prioritizeAndUpdateProjection(l,n){return this._updateProjection(l||n||{name:"mercator"})}_updateProjection(l){let n;if(n=l.name==="globe"&&this.transform.zoom>=o.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(l),this.style.applyProjectionUpdate(),n){this.painter.clearBackgroundTiles();for(const s in this.style._sourceCaches)this.style._sourceCaches[s].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(l){return this.transform.locationPoint3D(o.LngLat.convert(l))}unproject(l){return this.transform.pointLocation3D(o.Point.convert(l))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(l,n,s){if(l==="mouseenter"||l==="mouseover"){let u=!1;const d=g=>{const y=n.filter(M=>this.getLayer(M)),w=y.length?this.queryRenderedFeatures(g.point,{layers:y}):[];w.length?u||(u=!0,s.call(this,new cn(l,this,g.originalEvent,{features:w}))):u=!1},f=()=>{u=!1};return{layers:new Set(n),listener:s,delegates:{mousemove:d,mouseout:f}}}if(l==="mouseleave"||l==="mouseout"){let u=!1;const d=g=>{const y=n.filter(w=>this.getLayer(w));(y.length?this.queryRenderedFeatures(g.point,{layers:y}):[]).length?u=!0:u&&(u=!1,s.call(this,new cn(l,this,g.originalEvent)))},f=g=>{u&&(u=!1,s.call(this,new cn(l,this,g.originalEvent)))};return{layers:new Set(n),listener:s,delegates:{mousemove:d,mouseout:f}}}{const u=d=>{const f=n.filter(y=>this.getLayer(y)),g=f.length?this.queryRenderedFeatures(d.point,{layers:f}):[];g.length&&(d.features=g,s.call(this,d),delete d.features)};return{layers:new Set(n),listener:s,delegates:{[l]:u}}}}on(l,n,s){if(s===void 0)return super.on(l,n);Array.isArray(n)||(n=[n]);const u=this._createDelegatedListener(l,n,s);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[l]=this._delegatedListeners[l]||[],this._delegatedListeners[l].push(u);for(const d in u.delegates)this.on(d,u.delegates[d]);return this}once(l,n,s){if(s===void 0)return super.once(l,n);Array.isArray(n)||(n=[n]);const u=this._createDelegatedListener(l,n,s);for(const d in u.delegates)this.once(d,u.delegates[d]);return this}off(l,n,s){if(s===void 0)return super.off(l,n);n=new Set(Array.isArray(n)?n:[n]);const u=(f,g)=>{if(f.size!==g.size)return!1;for(const y of f)if(!g.has(y))return!1;return!0},d=this._delegatedListeners?this._delegatedListeners[l]:void 0;return d&&(f=>{for(let g=0;g<f.length;g++){const y=f[g];if(y.listener===s&&u(y.layers,n)){for(const w in y.delegates)this.off(w,y.delegates[w]);return f.splice(g,1),this}}})(d),this}
vendor: 7,515 bytes, lines 1316-1318
1316queryRenderedFeatures(l,n){return this.style?(n!==void 0||l===void 0||l instanceof o.Point||Array.isArray(l)||(n=l,l=void 0),this.style.queryRenderedFeatures(l=l||[[0,0],[this.transform.width,this.transform.height]],n=n||{},this.transform)):[]}querySourceFeatures(l,n){return this.style.querySourceFeatures(l,n)}isPointOnSurface(l){const{name:n}=this.transform.projection;return n!=="globe"&&n!=="mercator"&&o.warnOnce(`${n} projection does not support isPointOnSurface, this API may behave unexpectedly.`),this.transform.isPointOnSurface(o.Point.convert(l))}setStyle(l,n){return(n=o.extend({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},n)).diff!==!1&&n.localIdeographFontFamily===this._localIdeographFontFamily&&n.localFontFamily===this._localFontFamily&&this.style&&l?(this._diffStyle(l,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._localFontFamily=n.localFontFamily,this._updateStyle(l,n))}_getUIString(l){const n=this._locale[l];if(n==null)throw new Error(`Missing UI string '${l}'`);return n}_updateStyle(l,n){return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),l&&(this.style=new br(this,n||{}),this.style.setEventedParent(this,{style:this.style}),typeof l=="string"?this.style.loadURL(l):this.style.loadJSON(l)),this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new br(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(l,n){if(typeof l=="string"){const s=this._requestManager.normalizeStyleURL(l),u=this._requestManager.transformRequest(s,o.ResourceType.Style);o.getJSON(u,(d,f)=>{d?this.fire(new o.ErrorEvent(d)):f&&this._updateDiff(f,n)})}else typeof l=="object"&&this._updateDiff(l,n)}_updateDiff(l,n){try{this.style.setState(l)&&this._update(!0)}catch(s){o.warnOnce(`Unable to perform style diff: ${s.message||s.error||s}.  Rebuilding the style from scratch.`),this._updateStyle(l,n)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(o.warnOnce("There is no style added to the map."),!1)}addSource(l,n){return this._lazyInitEmptyStyle(),this.style.addSource(l,n),this._update(!0)}isSourceLoaded(l){return!!this.style&&this.style._isSourceCacheLoaded(l)}areTilesLoaded(){const l=this.style&&this.style._sourceCaches;for(const n in l){const s=l[n]._tiles;for(const u in s){const d=s[u];if(d.state!=="loaded"&&d.state!=="errored")return!1}}return!0}addSourceType(l,n,s){this._lazyInitEmptyStyle(),this.style.addSourceType(l,n,s)}removeSource(l){return this.style.removeSource(l),this._updateTerrain(),this._update(!0)}getSource(l){return this.style.getSource(l)}addImage(l,n,{pixelRatio:s=1,sdf:u=!1,stretchX:d,stretchY:f,content:g}={}){if(this._lazyInitEmptyStyle(),n instanceof o.window.HTMLImageElement||o.window.ImageBitmap&&n instanceof o.window.ImageBitmap){const{width:y,height:w,data:M}=o.exported.getImageData(n);this.style.addImage(l,{data:new o.RGBAImage({width:y,height:w},M),pixelRatio:s,stretchX:d,stretchY:f,content:g,sdf:u,version:0})}else if(n.width===void 0||n.height===void 0)this.fire(new o.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{const{width:y,height:w}=n,M=n;this.style.addImage(l,{data:new o.RGBAImage({width:y,height:w},new Uint8Array(M.data)),pixelRatio:s,stretchX:d,stretchY:f,content:g,sdf:u,version:0,userImage:M}),M.onAdd&&M.onAdd(this,l)}}updateImage(l,n){const s=this.style.getImage(l);if(!s)return void this.fire(new o.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const u=n instanceof o.window.HTMLImageElement||o.window.ImageBitmap&&n instanceof o.window.ImageBitmap?o.exported.getImageData(n):n,{width:d,height:f}=u;d!==void 0&&f!==void 0?d===s.data.width&&f===s.data.height?(s.data.replace(u.data,!(n instanceof o.window.HTMLImageElement||o.window.ImageBitmap&&n instanceof o.window.ImageBitmap)),this.style.updateImage(l,s)):this.fire(new o.ErrorEvent(new Error(`The width and height of the updated image (${d}, ${f})
1317                must be that same as the previous version of the image
1318                (${s.data.width}, ${s.data.height})`))):this.fire(new o.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")))}hasImage(l){return l?!!this.style.getImage(l):(this.fire(new o.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(l){this.style.removeImage(l)}loadImage(l,n){o.getImage(this._requestManager.transformRequest(l,o.ResourceType.Image),(s,u)=>{n(s,u instanceof o.window.HTMLImageElement?o.exported.getImageData(u):u)})}listImages(){return this.style.listImages()}addLayer(l,n){return this._lazyInitEmptyStyle(),this.style.addLayer(l,n),this._update(!0)}moveLayer(l,n){return this.style.moveLayer(l,n),this._update(!0)}removeLayer(l){return this.style.removeLayer(l),this._update(!0)}getLayer(l){return this.style.getLayer(l)}setLayerZoomRange(l,n,s){return this.style.setLayerZoomRange(l,n,s),this._update(!0)}setFilter(l,n,s={}){return this.style.setFilter(l,n,s),this._update(!0)}getFilter(l){return this.style.getFilter(l)}setPaintProperty(l,n,s,u={}){return this.style.setPaintProperty(l,n,s,u),this._update(!0)}getPaintProperty(l,n){return this.style.getPaintProperty(l,n)}setLayoutProperty(l,n,s,u={}){return this.style.setLayoutProperty(l,n,s,u),this._update(!0)}getLayoutProperty(l,n){return this.style.getLayoutProperty(l,n)}setLight(l,n={}){return this._lazyInitEmptyStyle(),this.style.setLight(l,n),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(l){return this._lazyInitEmptyStyle(),!l&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(l),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(l){return this._lazyInitEmptyStyle(),this.style.setFog(l),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(l){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(o.LngLat.convert(l),this.transform):0}setFeatureState(l,n){return this.style.setFeatureState(l,n),this._update()}removeFeatureState(l,n){return this.style.removeFeatureState(l,n),this._update()}getFeatureState(l){return this.style.getFeatureState(l)}_updateContainerDimensions(){if(!this._container)return;const l=this._container.getBoundingClientRect().width||400,n=this._container.getBoundingClientRect().height||300;let s,u,d,f=this._container;for(;f&&(!u||!d);){const g=o.window.getComputedStyle(f).transform;g&&g!=="none"&&(s=g.match(/matrix.*\((.+)\)/)[1].split(", "),s[0]&&s[0]!=="0"&&s[0]!=="1"&&(u=s[0]),s[3]&&s[3]!=="0"&&s[3]!=="1"&&(d=s[3])),f=f.parentElement}this._containerWidth=u?Math.abs(l/u):l,this._containerHeight=d?Math.abs(n/d):n}_detectMissingCSS(){o.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&o.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described 
1318in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const l=this._container;l.classList.add("mapboxgl-map"),(this._missingCSSCanary=de("div","mapboxgl-canary",l)).style.visibility="hidden",this._detectMissingCSS();const n=this._canvasContainer=de("div","mapboxgl-canvas-container",l);this._interactive&&n.classList.add("mapboxgl-interactive"),this._canvas=de("canvas","mapboxgl-canvas",n),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const s=this._controlContainer=de("div","mapboxgl-control-container",l),u=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(d=>{u[d]=de("div",`mapboxgl-ctrl-${d}`,s)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(l,n){const s=o.exported.devicePixelRatio||1;this._canvas.width=s*Math.ceil(l),this._canvas.height=s*Math.ceil(n),this._canvas.style.width=`${l}px`,this._canvas.style.height=`${n}px`}_addMarker(l){this._markers.push(l)}_removeMarker(l){const n=this._markers.indexOf(l);n!==-1&&this._markers.splice(n,1)}_addPopup(l){this._popups.push(l)}_removePopup(l){const n=this._popups.indexOf(l);n!==-1&&this._popups.splice(n,1)}_setupPainter(){const l=o.extend({},he.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._useWebGL2&&this._canvas.getContext("webgl2",l),s=n||this._canvas.getContext("webgl",l)||this._canvas.getContext("experimental-webgl",l);s?(this._useWebGL2&&!n&&o.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),o.storeAuthState(s,!0),this.painter=new $o(s,this.transform,!!n),this.on("data",u=>{u.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),o.exported$1.testSupport(s)):this.fire(new o.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(l){l.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new o.Event("webglcontextlost",{originalEvent:l}))}_contextRestored(l){this._setupPainter(),this.resize(),this._update(),this.fire(new o.Event("webglcontextrestored",{originalEvent:l}))}_onMapScroll(l){if(l.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(l){return this.style?(this._styleDirty=this._styleDirty||l,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(l){return this._update(),this._renderTaskQueue.add(l)}_cancelRenderFrame(l){this._renderTaskQueue.remove(l)}_requestDomTask(l){!this.loaded()||this.loaded()&&!this.isMoving()?l():this._domRenderTaskQueue.add(l)}_render(l){let n;const s=this.painter.context.extTimerQuery,u=o.exported.now();if(this.listens("gpu-timing-frame")&&(n=s.createQueryEXT(),s.beginQueryEXT(s.TIME_ELAPSED_EXT,n)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],o.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],o.window.performance.now())),this._renderTaskQueue.run(l),this._domRenderTaskQueue.run(l),this._removed)return;this._updateProjectionTransition();const d=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const y=this.transform.zoom,w=this.transform.pitch,M=o.exported.now(),I=new o.EvaluationParameters(y,{now:M,fadeDuration:d,pitch:w,transition:this.style.getTransition()});this.style.update(I)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let f=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),f=this._updateAverageElevation(u),this.style._updateSources(this.transform),this._forceMar
vendor: 10,048 bytes, line 1318
1318kerAndPopupUpdate()):f=this._updateAverageElevation(u),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,d,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:d,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new o.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new o.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),n){const y=o.exported.now()-u;s.endQueryEXT(s.TIME_ELAPSED_EXT,n),setTimeout(()=>{const w=s.getQueryObjectEXT(n,s.QUERY_RESULT_EXT)/1e6;s.deleteQueryEXT(n),this.fire(new o.Event("gpu-timing-frame",{cpuTime:y,gpuTime:w})),o.window.performance.mark("frame-gpu",{startTime:u,detail:{gpuTime:w}})},50)}if(this.listens("gpu-timing-layer")){const y=this.painter.collectGpuTimers();setTimeout(()=>{const w=this.painter.queryGpuTimers(y);this.fire(new o.Event("gpu-timing-layer",{layerTimes:w}))},50)}if(this.listens("gpu-timing-deferred-render")){const y=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const w=this.painter.queryGpuTimeDeferredRender(y);this.fire(new o.Event("gpu-timing-deferred-render",{gpuTime:w}))},50)}const g=this._sourcesDirty||this._styleDirty||this._placementDirty||f;if(g||this._repaint)this.triggerRepaint();else{const y=!this.isMoving()&&this.loaded();if(y&&(f=this._updateAverageElevation(u,!0)),f)this.triggerRepaint();else if(this._triggerFrame(!1),y&&(this.fire(new o.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const w=this._calculateSpeedIndex();this.fire(new o.Event("speedindexcompleted",{speedIndex:w})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||g||(this._fullyLoaded=!0,o.LivePerformanceUtils.mark(o.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&o.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(l){for(const n of this._markers)l&&!this.getRenderWorldCopies()&&(n._lngLat=n._lngLat.wrap()),n._update();for(const n of this._popups)!l||this.getRenderWorldCopies()||n._trackPointer||(n._lngLat=n._lngLat.wrap()),n._update()}_updateAverageElevation(l,n=!1){const s=u=>(this.transform.averageElevation=u,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&s(0);if((n||l-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(l)){const u=this.transform.averageElevation;let d=this.transform.sampleAverageElevation(),f=!1;this.transform.elevation&&(f=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(d)?d=0:this._averageElevationLastSampledAt=l;const g=Math.abs(u-d);if(g>1){if(this._isInitialLoad||f)return this._averageElevation.jumpTo(d),s(d);this._averageElevation.easeTo(d,l,300)}else if(g>1e-4)return this._averageElevation.jumpTo(d),s(d)}return!!this._averageElevation.isEasing(l)&&s(this._averageElevation.getValue(l))}_authenticate(){o.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,l=>{if(l&&(l.message===o.AUTH_ERR_MSG||l.status===401)){const n=this.painter.context.gl;o.storeAuthState(n,!1),this._logoControl instanceof $l&&this._logoControl._updateLogo(),n&&n.clear(n.DEPTH_BUFFER_BIT|n.COLOR_BUFFER_BIT|n.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new o.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),o.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const l=this._isDragging();this.painter.updateTerrain(this.style,l)}_calculateSpeedIndex(){const l=this.painter.canvasCopy(),n=this.painter.getCanvasCopiesAndTimestamps();n.timeStamps.push(performance.now());const s=this.painter.context.gl,u=s.createFramebuffer();function d(f){s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,f,0);const g=new Uint8Array(s.drawingBufferWidth*s.drawingBufferHeight*4);return s.readPixels(0,0,s.drawingBufferWidth,s.drawingBufferHeight,s.RGBA,s.UNSIGNED_BYTE,g),g}return s.bindFramebuffer(s.FRAMEBUFFER,u),this._canvasPixelComparison(d(l),n.canvasCopies.map(d),n.timeStamps)}_canvasPixelComparison(l,n,s){let u=s[1]-s[0];const d=l.length/4;for(let f=0;f<n.length;f++){const g=n[f];let y=0;for(let w=0;w<g.length;w+=4)g[w]===l[w]&&g[w+1]===l[w+1]&&g[w+2]===l[w+2]&&g[w+3]===l[w+3]&&(y+=1);u+=(s[f+2]-s[f+1])*(1-y/d)}return u}remove(){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._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),o.window!==void 0&&(o.window.removeEventListener("resize",this._onWindowResize,!1),o.window.removeEventListener("orientationchange",this._onWindowResize,!1),o.window.removeEventListener("webkitfullscreenchange",this._onWindowResize,!1),o.window.removeEventListener("online",this._onWindowOnline,!1),o.window.removeEventListener("visibilitychange",this._onVisibilityChange,!1));const l=this.painter.context.gl.getExtension("WEBGL_lose_context");l&&l.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),o.removeAuthState(this.painter.context.gl),this._removed=!0,this.fire(new o.Event("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(l){this._renderNextFrame=this._renderNextFrame||l,this.style&&!this._frame&&(this._frame=o.exported.frame(n=>{const s=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,s&&this._render(n)}))}_preloadTiles(l){const n=this.style?Object.values(this.style._sourceCaches):[];return o.asyncAll(n,(s,u)=>s._preloadTiles(l,u),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(l){this._trackResize&&this.resize({originalEvent:l})._update()}_onVisibilityChange(){o.window.document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(l){this._showTileBoundaries!==l&&(this._showTileBoundaries=l,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(l){this._showTerrainWireframe!==l&&(this._showTerrainWireframe=l,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(l){this._speedIndexTiming!==l&&(this._speedIndexTiming=l,this._update())}get showPadding(){return!!this._showPadding}set showPadding(l){this._showPadding!==l&&(this._showPadding=l,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(l){this._showCollisionBoxes!==l&&(this._showCollisionBoxes=l,l?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(l){this._showOverdrawInspector!==l&&(this._showOverdrawInspector=l,this._update())}get repaint(){return!!this._repaint}set repaint(l){this._repaint!==l&&(this._repaint=l,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(l){this._vertices=l,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(l){this._showTileAABBs!==l&&(this._showTileAABBs=l,l&&this._update())}_setCacheLimits(l,n){o.setCacheLimits(l,n)}get version(){return o.version}},NavigationControl:class{constructor(l){this.options=o.extend({},Hh,l),this._container=de("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",n=>n.preventDefault()),this.options.showZoom&&(o.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",n=>{this._map&&this._map.zoomIn({},{originalEvent:n})}),de("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",n=>{this._map&&this._map.zoomOut({},{originalEvent:n})}),de("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(o.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",n=>{const s=this._map;s&&(this.options.visualizePitch?s.resetNorthPitch({},{originalEvent:n}):s.resetNorth({},{originalEvent:n}))}),this._compassIcon=de("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const l=this._map;if(!l)return;
1318const n=l.getZoom(),s=n===l.getMaxZoom(),u=n===l.getMinZoom();this._zoomInButton.disabled=s,this._zoomOutButton.disabled=u,this._zoomInButton.setAttribute("aria-disabled",s.toString()),this._zoomOutButton.setAttribute("aria-disabled",u.toString())}_rotateCompassArrow(){const l=this._map;if(!l)return;const n=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(l.transform.pitch*(Math.PI/180)),.5)}) rotateX(${l.transform.pitch}deg) rotateZ(${l.transform.angle*(180/Math.PI)}deg)`:`rotate(${l.transform.angle*(180/Math.PI)}deg)`;l._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=n)})}onAdd(l){return this._map=l,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),l.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&l.on("pitch",this._rotateCompassArrow),l.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Kh(l,this._compass,this.options.visualizePitch)),this._container}onRemove(){const l=this._map;l&&(this._container.remove(),this.options.showZoom&&l.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&l.off("pitch",this._rotateCompassArrow),l.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(l,n){const s=de("button",l,this._container);return s.type="button",s.addEventListener("click",n),s}_setButtonTitle(l,n){if(!this._map)return;const s=this._map._getUIString(`NavigationControl.${n}`);l.setAttribute("aria-label",s),l.firstElementChild&&l.firstElementChild.setAttribute("title",s)}},GeolocateControl:class extends o.Evented{constructor(l){super(),this.options=o.extend({geolocation:o.window.navigator.geolocation},nc,l),o.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=is(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(l){return this._map=l,this._container=de("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(l){const n=(s=!!this.options.geolocation)=>{this._supportsGeolocation=s,l(s)};this._supportsGeolocation!==void 0?l(this._supportsGeolocation):o.window.navigator.permissions!==void 0?o.window.navigator.permissions.query({name:"geolocation"}).then(s=>n(s.state!=="denied")).catch(()=>n()):n()}_isOutOfMapMaxBounds(l){const n=this._map.getMaxBounds(),s=l.coords;return!!n&&(s.longitude<n.getWest()||s.longitude>n.getEast()||s.latitude<n.getSouth()||s.latitude>n.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(l){if(this._map){if(this._isOutOfMapMaxBounds(l))return this._setErrorState(),this.fire(new o.Event("outofmaxbounds",l)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=l,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_E
1318RROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(l),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(l),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new o.Event("geolocate",l)),this._finish()}}_updateCamera(l){const n=new o.LngLat(l.coords.longitude,l.coords.latitude),s=l.coords.accuracy,u=this._map.getBearing(),d=o.extend({bearing:u},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(s),d,{geolocateSource:!0})}_updateMarker(l){if(l){const n=new o.LngLat(l.coords.longitude,l.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=l.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const l=this._map.transform,n=o.mercatorZfromAltitude(1,l._center.lat)*l.worldSize,s=Math.ceil(2*this._accuracy*n);this._circleElement.style.width=`${s}px`,this._circleElement.style.height=`${s}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(l){if(this._map){if(this.options.trackUserLocation)if(l.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",n),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(l.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new o.Event("error",l)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(l){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",n=>n.preventDefault()),this._geolocateButton=de("button","mapboxgl-ctrl-geolocate",this._container),de("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",l===!1){o.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",n),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",n)}else{const n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",n),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
1318se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=de("div","mapboxgl-user-location"),this._dotElement.appendChild(de("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(de("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new rt({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=de("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new rt({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("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new o.Event("trackuserlocationend")))})}}_onDeviceOrientation(l){this._userLocationDotMarker&&(l.webkitCompassHeading?this._heading=l.webkitCompassHeading:l.absolute===!0&&(this._heading=-1*l.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return o.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new o.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new o.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new o.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let l;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(l={maximumAge:6e5,timeout:0},this._noTimeout=!0):(l=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,l),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const l=()=>{o.window.addEventListener("ondeviceorientationabsolute"in o.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};o.window.DeviceMotionEvent!==void 0&&typeof o.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(n=>
vendor: 8,120 bytes, line 1318
1318{n==="granted"&&l()}).catch(console.error):l()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),o.window.removeEventListener("deviceorientation",this._onDeviceOrientation),o.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:ct,ScaleControl:class{constructor(l){this.options=o.extend({},rc,l),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),o.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const l=this.options.maxWidth||100,n=this._map,s=n._containerHeight/2,u=n._containerWidth/2-l/2,d=n.unproject([u,s]),f=n.unproject([u+l,s]),g=d.distanceTo(f);if(this.options.unit==="imperial"){const y=3.2808*g;y>5280?this._setScale(l,y/5280,"mile"):this._setScale(l,y,"foot")}else this.options.unit==="nautical"?this._setScale(l,g/1852,"nautical-mile"):g>=1e3?this._setScale(l,g/1e3,"kilometer"):this._setScale(l,g,"meter")}_setScale(l,n,s){this._map._requestDomTask(()=>{const u=function(f){const g=Math.pow(10,`${Math.floor(f)}`.length-1);let y=f/g;return y=y>=10?10:y>=5?5:y>=3?3:y>=2?2:y>=1?1:function(w){const M=Math.pow(10,Math.ceil(-Math.log(w)/Math.LN10));return Math.round(w*M)/M}(y),g*y}(n),d=u/n;this._container.innerHTML=this._isNumberFormatSupported&&s!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:s}).format(u):`${u}&nbsp;${oc[s]}`,this._container.style.width=l*d+"px"})}onAdd(l){return this._map=l,this._language=l.getLanguage(),this._container=de("div","mapboxgl-ctrl mapboxgl-ctrl-scale",l.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(l){this._language=l,this._update()}setUnit(l){this.options.unit=l,this._update()}},FullscreenControl:class{constructor(l){this._fullscreen=!1,l&&l.container&&(l.container instanceof o.window.HTMLElement?this._container=l.container:o.warnOnce("Full screen control 'container' must be a DOM element.")),o.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in o.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in o.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(l){return this._map=l,this._container||(this._container=this._map.getContainer()),this._controlContainer=de("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",o.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,o.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!o.window.document.fullscreenEnabled&&!o.window.document.webkitFullscreenEnabled)}_setupUI(){const l=this._fullscreenButton=de("button","mapboxgl-ctrl-fullscreen",this._controlContainer);de("span","mapboxgl-ctrl-icon",l).setAttribute("aria-hidden","true"),l.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),o.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const l=this._getTitle();this._fullscreenButton.setAttribute("aria-label",l),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",l)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(o.window.document.fullscreenElement||o.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?o.window.document.exitFullscreen?o.window.document.exitFullscreen():o.window.document.webkitCancelFullScreen&&o.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends o.Evented{constructor(l){super(),this.options=o.extend(Object.create(tc),l),o.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(l&&l.className?l.className.trim().split(/\s+/):[])}addTo(l){return this._map&&this.remove(),this._map=l,this.options.closeOnClick&&l.on("preclick",this._onClose),this.options.closeOnMove&&l.on("move",this._onClose),l.on("remove",this.remove),this._update(),l._addPopup(this),this._focusFirstElement(),this._trackPointer?(l.on("mousemove",this._onMouseEvent),l.on("mouseup",this._onMouseEvent),l._canvasContainer.classList.add("mapboxgl-track-pointer")):l.on("move",this._update),this.fire(new o.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const l=this._map;return l&&(l.off("move",this._update),l.off("move",this._onClose),l.off("preclick",this._onClose),l.off("click",this._onClose),l.off("remove",this.remove),l.off("mousemove",this._onMouseEvent),l.off("mouseup",this._onMouseEvent),l.off("drag",this._onMouseEvent),l._canvasContainer&&l._canvasContainer.classList.remove("mapboxgl-track-pointer"),l._removePopup(this),this._map=void 0),this.fire(new o.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(l){this._lngLat=o.LngLat.convert(l),this._pos=null,this._trackPointer=!1,this._update();const n=this._map;return n&&(n.on("move",this._update),n.off("mousemove",this._onMouseEvent),n._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const l=this._map;return l&&(l.off("move",this._update),l.on("mousemove",this._onMouseEvent),l.on("drag",this._onMouseEvent),l._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(l){return this.setDOMContent(o.window.document.createTextNode(l))}setHTML(l){const n=o.window.document.createDocumentFragment(),s=o.window.document.createElement("body");let u;for(s.innerHTML=l;u=s.firstChild,u;)n.appendChild(u);return this.setDOMContent(n)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(l){return this.options.maxWidth=l,this._update(),this}setDOMContent(l){let n=this._content;if(n)for(;n.hasChildNodes();)n.firstChild&&n.removeChild(n.firstChild);else n=this._content=de("div","mapboxgl-popup-content",this._container||void 0);if(n.appendChild(l),this.options.closeButton){const s=this._closeButton=de("button","mapboxgl-popup-close-button",n);s.type="button",s.setAttribute("aria-label","Close popup"),s.setAttribute("aria-hidden","true"),s.innerHTML="&#215;",s.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(l){return this._classList.add(l),this._updateClassList(),this}removeClassName(l){return this._classList.delete(l),this._updateClassList(),this}setOffset(l){return this.options.offset=l,this._update(),this}toggleClassName(l){let n;return this._classList.delete(l)?n=!1:(this._classList.add(l),n=!0),this._updateClassList(),n}_onMouseEvent(l){this._update(l.point)}_getAnchor(l){if(this.options.anchor)return this.options.anchor;const n=this._map,s=this._container,u=this._pos;if(!n||!s||!u)return"bottom";const d=s.offsetWidth,f=s.offsetHeight,g=u.x<d/2,y=u.x>n.transform.width-d/2;if(u.y+l<f)return g?"top-left":y?"top-right":"top";if(u.y>n.transform.height-f){if(g)return"bottom-left";if(y)return"bottom-right"}
1318return g?"left":y?"right":"bottom"}_updateClassList(){const l=this._container;if(!l)return;const n=[...this._classList];n.push("mapboxgl-popup"),this._anchor&&n.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&n.push("mapboxgl-popup-track-pointer"),l.className=n.join(" ")}_update(l){const n=this._map,s=this._content;if(!n||!this._lngLat&&!this._trackPointer||!s)return;let u=this._container;if(u||(u=this._container=de("div","mapboxgl-popup",n.getContainer()),this._tip=de("div","mapboxgl-popup-tip",u),u.appendChild(s)),this.options.maxWidth&&u.style.maxWidth!==this.options.maxWidth&&(u.style.maxWidth=this.options.maxWidth),n.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=os(this._lngLat,this._pos,n.transform)),!this._trackPointer||l){const d=this._pos=this._trackPointer&&l?l:n.project(this._lngLat),f=Lu(this.options.offset),g=this._anchor=this._getAnchor(f.y),y=Lu(this.options.offset,g),w=d.add(y).round();n._requestDomTask(()=>{this._container&&g&&(this._container.style.transform=`${Lo[g]} translate(${w.x}px,${w.y}px)`)})}if(!this._marker&&n._showingGlobe()){const d=o.isLngLatBehindGlobe(n.transform,this._lngLat)?0:1;this._setOpacity(d)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const l=this._container.querySelector(Xh);l&&l.focus()}_onClose(){this.remove()}_setOpacity(l){this._container&&(this._container.style.opacity=`${l}`),this._content&&(this._content.style.pointerEvents=l?"auto":"none")}},Marker:rt,Style:br,LngLat:o.LngLat,LngLatBounds:o.LngLatBounds,Point:o.Point,MercatorCoordinate:o.MercatorCoordinate,FreeCameraOptions:yu,Evented:o.Evented,config:o.config,prewarm:function(){oo().acquire(Dn)},clearPrewarmedResources:function(){const l=rn;l&&(l.isPreloaded()&&l.numActive()===1?(l.release(Dn),rn=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return o.config.ACCESS_TOKEN},set accessToken(l){o.config.ACCESS_TOKEN=l},get baseApiUrl(){return o.config.API_URL},set baseApiUrl(l){o.config.API_URL=l},get workerCount(){return Ni.workerCount},set workerCount(l){Ni.workerCount=l},get maxParallelImageRequests(){return o.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(l){o.config.MAX_PARALLEL_IMAGE_REQUESTS=l},clearStorage(l){o.clearTileCache(l)},workerUrl:"",workerClass:null,setNow:o.exported.setNow,restoreNow:o.exported.restoreNow};return ss});var Z=D;return Z})})(xp);var lg=xp.exports;const pl=ag(lg);function cg(S,x){const b=S.getBoundingClientRect(),k=x.getBoundingClientRect(),D={};return D.top=b.top<0,D.left=b.left<0,D.bottom=b.bottom+k.height>(window.innerHeight||document.documentElement.clientHeight),D.right=b.right>(window.innerWidth||document.documentElement.clientWidth),D.any=D.top||D.left||D.bottom||D.right,D}const Mx="";function ug(S){let x,b=S[0](S[1],S[2])+"",k;return{c(){x=mt("div"),tt(x,"class",k="item "+S[3]+" svelte-3e0qet")},m(D,ee){yt(D,x,ee),x.innerHTML=b},p(D,[ee]){ee&7&&b!==(b=D[0](D[1],D[2])+"")&&(x.innerHTML=b),ee&8&&k!==(k="item "+D[3]+" svelte-3e0qet")&&tt(x,"class",k)},i:on,o:on,d(D){D&&ft(x)}}}function hg(S,x,b){let{isActive:k=!1}=x,{isFirst:D=!1}=x,{isHover:ee=!1}=x,{isSelectable:Z=!1}=x,{getOptionLabel:o=void 0}=x,{item:U=void 0}=x,{filterText:he=""}=x,De="";return S.$$set=se=>{"isActive"in se&&b(4,k=se.isActive),"isFirst"in se&&b(5,D=se.isFirst),"isHover"in se&&b(6,ee=se.isHover),"isSelectable"in se&&b(7,Z=se.isSelectable),"getOptionLabel"in se&&b(0,o=se.getOptionLabel),"item"in se&&b(1,U=se.item),"filterText"in se&&b(2,he=se.filterText)},S.$$.update=()=>{if(S.$$.dirty&242){const se=[];k&&se.push("active"),D&&se.push("first"),ee&&se.push("hover"),U.isGroupHeader&&se.push("groupHeader"),U.isGroupItem&&se.push("groupItem"),Z||se.push("notSelectable"),b(3,De=se.join(" "))}},[o,U,he,De,k,D,ee,Z]}class vp extends bo{constructor(x){super(),vo(this,x,hg,ug,yo,{isActive:4,isFirst:5,isHover:6,isSelectable:7,getOptionLabel:0,item:1,filterText:2})}}const Ax="";function bp(S,x,b){const k=S.slice();return k[41]=x[b],k[42]=b,k}function dg(S){let x,b,k=S[1],D=[];for(let o=0;o<k.length;o+=1)D[o]=Ep(bp(S,k,o));const ee=o=>ti(D[o],1,1,()=>{D[o]=null});let Z=null;return k.length||(Z=wp(S)),{c(){for(let o=0;o<D.length;o+=1)D[o].c();x=mr(),Z&&Z.c()},m(o,U){for(let he=0;he<D.length;he+=1)D[he]&&D[he].m(o,U);yt(o,x,U),Z&&Z.m(o,U),b=!0}
1318,p(o,U){if(U[0]&114390){k=o[1];let he;for(he=0;he<k.length;he+=1){const De=bp(o,k,he);D[he]?(D[he].p(De,U),Gt(D[he],1)):(D[he]=Ep(De),D[he].c(),Gt(D[he],1),D[he].m(x.parentNode,x))}for(vn(),he=k.length;he<D.length;he+=1)ee(he);bn(),!k.length&&Z?Z.p(o,U):k.length?Z&&(Z.d(1),Z=null):(Z=wp(o),Z.c(),Z.m(x.parentNode,x))}},i(o){if(!b){for(let U=0;U<k.length;U+=1)Gt(D[U]);b=!0}},o(o){D=D.filter(Boolean);for(let U=0;U<D.length;U+=1)ti(D[U]);b=!1},d(o){jc(D,o),o&&ft(x),Z&&Z.d(o)}}}function pg(S){let x,b,k;var D=S[3];function ee(Z){return{props:{items:Z[1],itemHeight:Z[8],$$slots:{default:[_g,({item:o,i:U})=>({41:o,42:U}),({item:o,i:U})=>[0,(o?1024:0)|(U?2048:0)]]},$$scope:{ctx:Z}}}}return D&&(x=Ln(D,ee(S))),{c(){x&&wn(x.$$.fragment),b=mr()},m(Z,o){x&&pn(x,Z,o),yt(Z,b,o),k=!0},p(Z,o){const U={};if(o[0]&2&&(U.items=Z[1]),o[0]&256&&(U.itemHeight=Z[8]),o[0]&9814|o[1]&11264&&(U.$$scope={dirty:o,ctx:Z}),o[0]&8&&D!==(D=Z[3])){if(x){vn();const he=x;ti(he.$$.fragment,1,0,()=>{fn(he,1)}),bn()}D?(x=Ln(D,ee(Z)),wn(x.$$.fragment),Gt(x.$$.fragment,1),pn(x,b.parentNode,b)):x=null}else D&&x.$set(U)},i(Z){k||(x&&Gt(x.$$.fragment,Z),k=!0)},o(Z){x&&ti(x.$$.fragment,Z),k=!1},d(Z){Z&&ft(b),x&&fn(x,Z)}}}function wp(S){let x,b=!S[11]&&Tp(S);return{c(){b&&b.c(),x=mr()},m(k,D){b&&b.m(k,D),yt(k,x,D)},p(k,D){k[11]?b&&(b.d(1),b=null):b?b.p(k,D):(b=Tp(k),b.c(),b.m(x.parentNode,x))},d(k){b&&b.d(k),k&&ft(x)}}}function Tp(S){let x,b;return{c(){x=mt("div"),b=Ci(S[12]),tt(x,"class","empty svelte-1uyqfml")},m(k,D){yt(k,x,D),nt(x,b)},p(k,D){D[0]&4096&&sn(b,k[12])},d(k){k&&ft(x)}}}function fg(S){let x,b,k,D,ee,Z;var o=S[4];function U(de){return{props:{item:de[41],filterText:de[13],getOptionLabel:de[6],isFirst:Mh(de[42]),isActive:Hc(de[41],de[9],de[10]),isHover:Kc(de[2],de[41],de[42],de[1]),isSelectable:vs(de[41])}}}o&&(b=Ln(o,U(S)));function he(){return S[29](S[42])}function De(){return S[30](S[42])}function se(...de){return S[31](S[41],S[42],...de)}return{c(){x=mt("div"),b&&wn(b.$$.fragment),k=Kt(),tt(x,"class","listItem"),tt(x,"tabindex","-1")},m(de,Ie){yt(de,x,Ie),b&&pn(b,x,null),nt(x,k),D=!0,ee||(Z=[Ui(x,"mouseover",he),Ui(x,"focus",De),Ui(x,"click",se)],ee=!0)},p(de,Ie){S=de;const Pe={};if(Ie[0]&2&&(Pe.item=S[41]),Ie[0]&8192&&(Pe.filterText=S[13]),Ie[0]&64&&(Pe.getOptionLabel=S[6]),Ie[0]&1538&&(Pe.isActive=Hc(S[41],S[9],S[10])),Ie[0]&6&&(Pe.isHover=Kc(S[2],S[41],S[42],S[1])),Ie[0]&2&&(Pe.isSelectable=vs(S[41])),Ie[0]&16&&o!==(o=S[4])){if(b){vn();const Me=b;ti(Me.$$.fragment,1,0,()=>{fn(Me,1)}),bn()}o?(b=Ln(o,U(S)),wn(b.$$.fragment),Gt(b.$$.fragment,1),pn(b,x,k)):b=null}else o&&b.$set(Pe)},i(de){D||(b&&Gt(b.$$.fragment,de),D=!0)},o(de){b&&ti(b.$$.fragment,de),D=!1},d(de){de&&ft(x),b&&fn(b),ee=!1,Cr(Z)}}}function mg(S){let x,b=S[7](S[41])+"",k;return{c(){x=mt("div"),k=Ci(b),tt(x,"class","listGroupTitle svelte-1uyqfml")},m(D,ee){yt(D,x,ee),nt(x,k)},p(D,ee){ee[0]&130&&b!==(b=D[7](D[41])+"")&&sn(k,b)},i:on,o:on,d(D){D&&ft(x)}}}function Ep(S){let x,b,k,D;const ee=[mg,fg],Z=[];function o(U,he){return U[41].isGroupHeader&&!U[41].isSelectable?0:1}return x=o(S),b=Z[x]=ee[x](S),{c(){b.c(),k=mr()},m(U,he){Z[x].m(U,he),yt(U,k,he),D=!0},p(U,he){let De=x;x=o(U),x===De?Z[x].p(U,he):(vn(),ti(Z[De],1,1,()=>{Z[De]=null}),bn(),b=Z[x],b?b.p(U,he):(b=Z[x]=ee[x](U),b.c()),Gt(b,1),b.m(k.parentNode,k))},i(U){D||(Gt(b),D=!0)},o(U){ti(b),D=!1},d(U){Z[x].d(U),U&&ft(k)}}}function _g(S){let x,b,k,D,ee;var Z=S[4];function o(se){return{props:{item:se[41],filterText:se[13],getOptionLabel:se[6],isFirst:Mh(se[42]),isActive:Hc(se[41],se[9],se[10]),isHover:Kc(se[2],se[41],se[42],se[1]),isSelectable:vs(se[41])}}}Z&&(b=Ln(Z,o(S)));function U(){return S[26](S[42])}function he(){return S[27](S[42])}function De(...se){return S[28](S[41],S[42],...se)}return{c(){x=mt("div"),b&&wn(b.$$.fragment),tt(x,"class","listItem")},m(se,de){yt(se,x,de),b&&pn(b,x,null),k=!0,D||(ee=[Ui(x,"mouseover",U),Ui(x,"focus",he),Ui(x,"click",De)],D=!0)},p(se,de){S=se;const Ie={};if(de[1]&1024&&(Ie.item=S[41]),de[0]&8192&&(Ie.filterText=S[13]),de[0]&64&&(Ie.getOptionLabel=S[6]),de[1]&2048&&(Ie.isFirst=Mh(S[42])),de[0]&1536|de[1]&1024&&(Ie.isActive=Hc(S[41],S[9],S[10])),de[0]&6|de[1]&3072&&(Ie.isHover=Kc(S[2],S[41],S[42],S[1])),de[1]&1024&&(Ie.isSelectable=vs(S[41])),de[0]&16&&Z!==(Z=S[4])){if
1318(b){vn();const Pe=b;ti(Pe.$$.fragment,1,0,()=>{fn(Pe,1)}),bn()}Z?(b=Ln(Z,o(S)),wn(b.$$.fragment),Gt(b.$$.fragment,1),pn(b,x,null)):b=null}else Z&&b.$set(Ie)},i(se){k||(b&&Gt(b.$$.fragment,se),k=!0)},o(se){b&&ti(b.$$.fragment,se),k=!1},d(se){se&&ft(x),b&&fn(b),D=!1,Cr(ee)}}}function gg(S){let x,b,k,D,ee,Z;const o=[pg,dg],U=[];function he(De,se){return De[5]?0:1}return b=he(S),k=U[b]=o[b](S),{c(){x=mt("div"),k.c(),tt(x,"class","listContainer svelte-1uyqfml"),tt(x,"style",S[14]),_r(x,"virtualList",S[5])},m(De,se){yt(De,x,se),U[b].m(x,null),S[32](x),D=!0,ee||(Z=[Ui(window,"keydown",S[17]),Ui(window,"resize",S[18])],ee=!0)},p(De,se){let de=b;b=he(De),b===de?U[b].p(De,se):(vn(),ti(U[de],1,1,()=>{U[de]=null}),bn(),k=U[b],k?k.p(De,se):(k=U[b]=o[b](De),k.c()),Gt(k,1),k.m(x,null)),(!D||se[0]&16384)&&tt(x,"style",De[14]),(!D||se[0]&32)&&_r(x,"virtualList",De[5])},i(De){D||(Gt(k),D=!0)},o(De){ti(k),D=!1},d(De){De&&ft(x),U[b].d(),S[32](null),ee=!1,Cr(Z)}}}function Hc(S,x,b){return x&&x[b]===S[b]}function Mh(S){return S===0}function Kc(S,x,b,k){return vs(x)&&(S===b||k.length===1)}function vs(S){return S.isGroupHeader&&S.isSelectable||S.selectable||!S.hasOwnProperty("selectable")}function yg(S,x,b){const k=wh();let{container:D=void 0}=x,{VirtualList:ee=null}=x,{Item:Z=vp}=x,{isVirtualList:o=!1}=x,{items:U=[]}=x,{labelIdentifier:he="label"}=x,{getOptionLabel:De=(Je,Dt)=>{if(Je)return Je.isCreator?`Create "${Dt}"`:Je[he]}}=x,{getGroupHeaderLabel:se=null}=x,{itemHeight:de=40}=x,{hoverItemIndex:Ie=0}=x,{value:Pe=void 0}=x,{optionIdentifier:Me="value"}=x,{hideEmptyState:$e=!1}=x,{noOptionsMessage:At="No options"}=x,{isMulti:bt=!1}=x,{activeItemIndex:lt=0}=x,{filterText:Se=""}=x,{parent:Qe=null}=x,{listPlacement:ni=null}=x,{listAutoWidth:qt=null}=x,{listOffset:It=5}=x,Re=0,gt=!1,ui;Zc(()=>{if(U.length>0&&!bt&&Pe){const Je=U.findIndex(Dt=>Dt[Me]===Pe[Me]);Je&&b(2,Ie=Je)}St("active"),D.addEventListener("scroll",()=>{clearTimeout(Re),Re=setTimeout(()=>{gt=!1},100)},!1)}),pp(()=>{U||b(1,U=[]),U!==ui&&U.length>0&&b(2,Ie=0),ui=U});function at(Je){Je.isCreator||k("itemSelected",Je)}function Ct(Je){gt||b(2,Ie=Je)}function Qt(Je){const{item:Dt,i:en,event:Vt}=Je;if(Vt.stopPropagation(),Pe&&!bt&&Pe[Me]===Dt[Me])return Ke();Dt.isCreator?k("itemCreated",Se):vs(Dt)&&(b(19,lt=en),b(2,Ie=en),at(Dt))}function Ke(){k("closeList")}async function Tt(Je){if(o)return;let Dt=!0;for(;Dt;)Je>0&&Ie===U.length-1?b(2,Ie=0):Je<0&&Ie===0?b(2,Ie=U.length-1):b(2,Ie=Ie+Je),Dt=!vs(U[Ie]);await qc(),St("hover")}function $i(Je){switch(Je.key){case"Escape":Je.preventDefault(),Ke();break;case"ArrowDown":Je.preventDefault(),U.length&&Tt(1);break;case"ArrowUp":Je.preventDefault(),U.length&&Tt(-1);break;case"Enter":if(Je.preventDefault(),U.length===0)break;const Dt=U[Ie];if(Pe&&!bt&&Pe[Me]===Dt[Me]){Ke();break}Dt.isCreator?k("itemCreated",Se):(b(19,lt=Ie),at(U[Ie]));break;case"Tab":if(Je.preventDefault(),U.length===0||Pe&&Pe[Me]===U[Ie][Me])return Ke();b(19,lt=Ie),at(U[Ie]);break}}function St(Je){if(o||!D)return;let Dt;const en=D.querySelector(`.listItem .${Je}`);en&&(Dt=D.getBoundingClientRect().bottom-en.getBoundingClientRect().bottom),b(0,D.scrollTop-=Dt,D)}let Lt;function vt(){const{height:Je,width:Dt}=Qe.getBoundingClientRect();b(14,Lt=""),b(14,Lt+=`min-width:${Dt}px;width:${qt?"auto":"100%"};`),ni==="top"||ni==="auto"&&cg(Qe,D).bottom?b(14,Lt+=`bottom:${Je+It}px;`):b(14,Lt+=`top:${Je+It}px;`)}const ai=Je=>Ct(Je),Mi=Je=>Ct(Je),$t=(Je,Dt,en)=>Qt({item:Je,i:Dt,event:en}),nn=Je=>Ct(Je),Gn=Je=>Ct(Je),Tn=(Je,Dt,en)=>Qt({item:Je,i:Dt,event:en});function mn(Je){xo[Je?"unshift":"push"](()=>{D=Je,b(0,D)})}return S.$$set=Je=>{"container"in Je&&b(0,D=Je.container),"VirtualList"in Je&&b(3,ee=Je.VirtualList),"Item"in Je&&b(4,Z=Je.Item),"isVirtualList"in Je&&b(5,o=Je.isVirtualList),"items"in Je&&b(1,U=Je.items),"labelIdentifier"in Je&&b(20,he=Je.labelIdentifier),"getOptionLabel"in Je&&b(6,De=Je.getOptionLabel),"getGroupHeaderLabel"in Je&&b(7,se=Je.getGroupHeaderLabel),"itemHeight"in Je&&b(8,de=Je.itemHeight),"hoverItemIndex"in Je&&b(2,Ie=Je.hoverItemIndex),"value"in Je&&b(9,Pe=Je.value),"optionIdentifier"in Je&&b(10,Me=Je.optionIdentifier),"hideEmptyState"in Je&&b(11,$e=Je.hideEmptyState),"noOptionsMessage"in Je&&b(12,At=Je.noOptionsMessage),"isMulti"in Je&&b(21,bt=Je.isMulti),"activeItemIndex"in Je&&b(19,lt=Je.activeItemIndex),"filterText"in Je&&b(13,Se=Je.filterText),"parent"in Je&&b(22,Qe=Je.parent),"listPlacement"in Je&&b(23,ni=Je.listPlacement),"listAutoWidth"in Je&&b(24,qt=Je.listAutoWidth),"listOffset"in Je&&b(25,It=Je.listOffset)},S.$$.update=()=>{S.$$.dirty[0]&4194305&&Qe&&D&&vt()},[D,U,Ie,ee,Z,o,De,se,de,Pe,Me,$e,At,Se,Lt,Ct,Qt,$i,vt,lt,he,bt,Qe,ni,qt,It,ai,Mi,$t,nn,Gn,Tn,mn]}
1318class xg extends bo{constructor(x){super(),vo(this,x,yg,gg,yo,{container:0,VirtualList:3,Item:4,isVirtualList:5,items:1,labelIdentifier:20,getOptionLabel:6,getGroupHeaderLabel:7,itemHeight:8,hoverItemIndex:2,value:9,optionIdentifier:10,hideEmptyState:11,noOptionsMessage:12,isMulti:21,activeItemIndex:19,filterText:13,parent:22,listPlacement:23,listAutoWidth:24,listOffset:25},null,[-1,-1])}}const Cx="";function vg(S){let x,b=S[0](S[1])+"";return{c(){x=mt("div"),tt(x,"class","selection svelte-pu1q1n")},m(k,D){yt(k,x,D),x.innerHTML=b},p(k,[D]){D&3&&b!==(b=k[0](k[1])+"")&&(x.innerHTML=b)},i:on,o:on,d(k){k&&ft(x)}}}function bg(S,x,b){let{getSelectionLabel:k=void 0}=x,{item:D=void 0}=x;return S.$$set=ee=>{"getSelectionLabel"in ee&&b(0,k=ee.getSelectionLabel),"item"in ee&&b(1,D=ee.item)},[k,D]}class wg extends bo{constructor(x){super(),vo(this,x,bg,vg,yo,{getSelectionLabel:0,item:1})}}const kx="";function Sp(S,x,b){const k=S.slice();return k[9]=x[b],k[11]=b,k}function Ip(S){let x,b,k;function D(...ee){return S[6](S[11],...ee)}return{c(){x=mt("div"),x.innerHTML='<svg width="100%" height="100%" viewBox="-2 -2 50 50" focusable="false" aria-hidden="true" role="presentation" class="svelte-liu9pa"><path d="M34.923,37.251L24,26.328L13.077,37.251L9.436,33.61l10.923-10.923L9.436,11.765l3.641-3.641L24,19.047L34.923,8.124 l3.641,3.641L27.641,22.688L38.564,33.61L34.923,37.251z"></path></svg>',tt(x,"class","multiSelectItem_clear svelte-liu9pa")},m(ee,Z){yt(ee,x,Z),b||(k=Ui(x,"click",D),b=!0)},p(ee,Z){S=ee},d(ee){ee&&ft(x),b=!1,k()}}}function Mp(S){let x,b,k=S[4](S[9])+"",D,ee,Z,o,U,he=!S[2]&&!S[3]&&Ip(S);function De(...se){return S[7](S[11],...se)}return{c(){x=mt("div"),b=mt("div"),D=Kt(),he&&he.c(),ee=Kt(),tt(b,"class","multiSelectItem_label svelte-liu9pa"),tt(x,"class",Z="multiSelectItem "+(S[1]===S[11]?"active":"")+" "+(S[2]?"disabled":"")+" svelte-liu9pa")},m(se,de){yt(se,x,de),nt(x,b),b.innerHTML=k,nt(x,D),he&&he.m(x,null),nt(x,ee),o||(U=Ui(x,"click",De),o=!0)},p(se,de){S=se,de&17&&k!==(k=S[4](S[9])+"")&&(b.innerHTML=k),!S[2]&&!S[3]?he?he.p(S,de):(he=Ip(S),he.c(),he.m(x,ee)):he&&(he.d(1),he=null),de&6&&Z!==(Z="multiSelectItem "+(S[1]===S[11]?"active":"")+" "+(S[2]?"disabled":"")+" svelte-liu9pa")&&tt(x,"class",Z)},d(se){se&&ft(x),he&&he.d(),o=!1,U()}}}function Tg(S){let x,b=S[0],k=[];for(let D=0;D<b.length;D+=1)k[D]=Mp(Sp(S,b,D));return{c(){for(let D=0;D<k.length;D+=1)k[D].c();x=mr()},m(D,ee){for(let Z=0;Z<k.length;Z+=1)k[Z]&&k[Z].m(D,ee);yt(D,x,ee)},p(D,[ee]){if(ee&63){b=D[0];let Z;for(Z=0;Z<b.length;Z+=1){const o=Sp(D,b,Z);k[Z]?k[Z].p(o,ee):(k[Z]=Mp(o),k[Z].c(),k[Z].m(x.parentNode,x))}for(;Z<k.length;Z+=1)k[Z].d(1);k.length=b.length}},i:on,o:on,d(D){jc(k,D),D&&ft(x)}}}function Eg(S,x,b){const k=wh();let{value:D=[]}=x,{activeValue:ee=void 0}=x,{isDisabled:Z=!1}=x,{multiFullItemClearable:o=!1}=x,{getSelectionLabel:U=void 0}=x;function he(de,Ie){Ie.stopPropagation(),k("multiItemClear",{i:de})}const De=(de,Ie)=>he(de,Ie),se=(de,Ie)=>o?he(de,Ie):{};return S.$$set=de=>{"value"in de&&b(0,D=de.value),"activeValue"in de&&b(1,ee=de.activeValue),"isDisabled"in de&&b(2,Z=de.isDisabled),"multiFullItemClearable"in de&&b(3,o=de.multiFullItemClearable),"getSelectionLabel"in de&&b(4,U=de.getSelectionLabel)},[D,ee,Z,o,U,he,De,se]}class Sg extends bo{constructor(x){super(),vo(this,x,Eg,Tg,yo,{value:0,activeValue:1,isDisabled:2,multiFullItemClearable:3,getSelectionLabel:4})}}const Px="";function Ap(S,x,b){const k=S.slice();return k[23]=x[b],k}const Ig=S=>({item:S&32,i:S&32,hoverItemIndex:S&2}),Cp=S=>({item:S[23].data,i:S[23].index,hoverItemIndex:S[1]});function Mg(S){let x;return{c(){x=Ci("Missing template")},m(b,k){yt(b,x,k)},d(b){b&&ft(x)}}}function kp(S,x){let b,k,D;const ee=x[15].default,Z=G_(ee,x,x[14],Cp),o=Z||Mg();return{key:S,first:null,c(){b=mt("svelte-virtual-list-row"),o&&o.c(),k=Kt(),vh(b,"class","svelte-g2cagw"),this.first=b},m(U,he){yt(U,b,he),o&&o.m(b,null),nt(b,k),D=!0},p(U,he){x=U,Z&&Z.p&&(!D||he&16418)&&q_(Z,ee,x,x[14],D?Z_(ee,x[14],he,Ig):W_(x[14]),Cp)},i(U){D||(Gt(o,U),D=!0)},o(U){ti(o,U),D=!1},d(U){U&&ft(b),o&&o.d(U)}}}function Ag(S){let x,b,k=[],D=new Map,ee,Z,o,U,he=S[5];const De=se=>se[23].index;for(let se=0;se<he.length;se+=1){let de=Ap(S,he,se),Ie=De(de);D.set(Ie,k[se]=kp(Ie,de))}return{c(){x=mt("svelte-virtual-list-viewport"),b=mt("svelte-virtual-list-contents");for(let se=0;se<k.length;se+=1)k[se].c();
1318ys(b,"padding-top",S[6]+"px"),ys(b,"padding-bottom",S[7]+"px"),vh(b,"class","svelte-g2cagw"),ys(x,"height",S[0]),vh(x,"class","svelte-g2cagw"),Wc(()=>S[18].call(x))},m(se,de){yt(se,x,de),nt(x,b);for(let Ie=0;Ie<k.length;Ie+=1)k[Ie]&&k[Ie].m(b,null);S[16](b),S[17](x),ee=J_(x,S[18].bind(x)),Z=!0,o||(U=Ui(x,"scroll",S[8]),o=!0)},p(se,[de]){de&16418&&(he=se[5],vn(),k=rg(k,de,De,1,se,he,D,b,ng,kp,null,Ap),bn()),(!Z||de&64)&&ys(b,"padding-top",se[6]+"px"),(!Z||de&128)&&ys(b,"padding-bottom",se[7]+"px"),(!Z||de&1)&&ys(x,"height",se[0])},i(se){if(!Z){for(let de=0;de<he.length;de+=1)Gt(k[de]);Z=!0}},o(se){for(let de=0;de<k.length;de+=1)ti(k[de]);Z=!1},d(se){se&&ft(x);for(let de=0;de<k.length;de+=1)k[de].d();S[16](null),S[17](null),ee(),o=!1,U()}}}function Cg(S,x,b){let{$$slots:k={},$$scope:D}=x,{items:ee=void 0}=x,{height:Z="100%"}=x,{itemHeight:o=40}=x,{hoverItemIndex:U=0}=x,{start:he=0}=x,{end:De=0}=x,se=[],de,Ie,Pe,Me=0,$e,At,bt=0,lt=0,Se;async function Qe(gt,ui,at){const{scrollTop:Ct}=Ie;await qc();let Qt=bt-Ct,Ke=he;for(;Qt<ui&&Ke<gt.length;){let $i=de[Ke-he];$i||(b(10,De=Ke+1),await qc(),$i=de[Ke-he]);const St=se[Ke]=at||$i.offsetHeight;Qt+=St,Ke+=1}b(10,De=Ke);const Tt=gt.length-De;Se=(bt+Qt)/De,b(7,lt=Tt*Se),se.length=gt.length,Ie&&b(3,Ie.scrollTop=0,Ie)}async function ni(){const{scrollTop:gt}=Ie,ui=he;for(let Ke=0;Ke<de.length;Ke+=1)se[he+Ke]=o||de[Ke].offsetHeight;let at=0,Ct=0;for(;at<ee.length;){const Ke=se[at]||Se;if(Ct+Ke>gt){b(9,he=at),b(6,bt=Ct);break}Ct+=Ke,at+=1}for(;at<ee.length&&(Ct+=se[at]||Se,at+=1,!(Ct>gt+Me)););b(10,De=at);const Qt=ee.length-De;for(Se=Ct/De;at<ee.length;)se[at++]=Se;if(b(7,lt=Qt*Se),he<ui){await qc();let Ke=0,Tt=0;for(let St=he;St<ui;St+=1)de[St-he]&&(Ke+=se[St],Tt+=o||de[St-he].offsetHeight);const $i=Tt-Ke;Ie.scrollTo(0,gt+$i)}}Zc(()=>{de=Pe.getElementsByTagName("svelte-virtual-list-row"),b(13,At=!0)});function qt(gt){xo[gt?"unshift":"push"](()=>{Pe=gt,b(4,Pe)})}function It(gt){xo[gt?"unshift":"push"](()=>{Ie=gt,b(3,Ie)})}function Re(){Me=this.offsetHeight,b(2,Me)}return S.$$set=gt=>{"items"in gt&&b(11,ee=gt.items),"height"in gt&&b(0,Z=gt.height),"itemHeight"in gt&&b(12,o=gt.itemHeight),"hoverItemIndex"in gt&&b(1,U=gt.hoverItemIndex),"start"in gt&&b(9,he=gt.start),"end"in gt&&b(10,De=gt.end),"$$scope"in gt&&b(14,D=gt.$$scope)},S.$$.update=()=>{S.$$.dirty&3584&&b(5,$e=ee.slice(he,De).map((gt,ui)=>({index:ui+he,data:gt}))),S.$$.dirty&14340&&At&&Qe(ee,Me,o)},[Z,U,Me,Ie,Pe,$e,bt,lt,ni,he,De,ee,o,At,D,k,qt,It,Re]}class kg extends bo{constructor(x){super(),vo(this,x,Cg,Ag,yo,{items:11,height:0,itemHeight:12,hoverItemIndex:1,start:9,end:10})}}function Pg(S){let x,b;return{c(){x=ul("svg"),b=ul("path"),tt(b,"fill","currentColor"),tt(b,"d",`M34.923,37.251L24,26.328L13.077,37.251L9.436,33.61l10.923-10.923L9.436,11.765l3.641-3.641L24,19.047L34.923,8.124
1319    l3.641,3.641L27.641,22.688L38.564,33.61L34.923,37.251z`),tt(x,"width","100%"),tt(x,"height","100%"),tt(x,"viewBox","-2 -2 50 50"),tt(x,"focusable","false"),tt(x,"aria-hidden","true"),tt(x,"role","presentation")},m(k,D){yt(k,x,D),nt(x,b)},p:on,i:on,o:on,d(k){k&&ft(x)}}}class zg extends bo{constructor(x){super(),vo(this,x,null,Pg,yo,{})}}function Lg(S,x,b){let k;return function(){let ee=this,Z=arguments,o=function(){k=null,b||S.apply(ee,Z)},U=b&&!k;clearTimeout(k),k=setTimeout(o,x),U&&S.apply(ee,Z)}}const zx="";function Pp(S,x,b){const k=S.slice();return k[103]=x[b],k}function zp(S){let x,b,k,D,ee;return{c(){x=mt("span"),b=Ci(S[33]),k=Kt(),D=mt("span"),ee=Ci(S[32]),tt(x,"id","aria-selection"),tt(D,"id","aria-context")},m(Z,o){yt(Z,x,o),nt(x,b),yt(Z,k,o),yt(Z,D,o),nt(D,ee)},p(Z,o){o[1]&4&&sn(b,Z[33]),o[1]&2&&sn(ee,Z[32])},d(Z){Z&&ft(x),Z&&ft(k),Z&&ft(D)}}}function Lp(S){let x,b,k;const D=[S[18]];var ee=S[17];function Z(o){let U={};for(let he=0;he<D.length;he+=1)U=la(U,D[he]);return{props:U}}return ee&&(x=Ln(ee,Z())),{c(){x&&wn(x.$$.fragment),b=mr()},m(o,U){x&&pn(x,o,U),yt(o,b,U),k=!0},p(o,U){const he=U[0]&262144?Ih(D,[gp(o[18])]):{};if(U[0]&131072&&ee!==(ee=o[17])){if(x){vn();const De=x;ti(De.$$.fragment,1,0,()=>{fn(De,1)}),bn()}
1319ee?(x=Ln(ee,Z()),wn(x.$$.fragment),Gt(x.$$.fragment,1),pn(x,b.parentNode,b)):x=null}else ee&&x.$set(he)},i(o){k||(x&&Gt(x.$$.fragment,o),k=!0)},o(o){x&&ti(x.$$.fragment,o),k=!1},d(o){o&&ft(b),x&&fn(x,o)}}}function Dp(S){let x,b,k;var D=S[26];function ee(Z){return{props:{value:Z[2],getSelectionLabel:Z[12],activeValue:Z[30],isDisabled:Z[9],multiFullItemClearable:Z[8]}}}return D&&(x=Ln(D,ee(S)),x.$on("multiItemClear",S[38]),x.$on("focus",S[40])),{c(){x&&wn(x.$$.fragment),b=mr()},m(Z,o){x&&pn(x,Z,o),yt(Z,b,o),k=!0},p(Z,o){const U={};if(o[0]&4&&(U.value=Z[2]),o[0]&4096&&(U.getSelectionLabel=Z[12]),o[0]&1073741824&&(U.activeValue=Z[30]),o[0]&512&&(U.isDisabled=Z[9]),o[0]&256&&(U.multiFullItemClearable=Z[8]),o[0]&67108864&&D!==(D=Z[26])){if(x){vn();const he=x;ti(he.$$.fragment,1,0,()=>{fn(he,1)}),bn()}D?(x=Ln(D,ee(Z)),x.$on("multiItemClear",Z[38]),x.$on("focus",Z[40]),wn(x.$$.fragment),Gt(x.$$.fragment,1),pn(x,b.parentNode,b)):x=null}else D&&x.$set(U)},i(Z){k||(x&&Gt(x.$$.fragment,Z),k=!0)},o(Z){x&&ti(x.$$.fragment,Z),k=!1},d(Z){Z&&ft(b),x&&fn(x,Z)}}}function Rp(S){let x,b,k,D,ee;var Z=S[25];function o(U){return{props:{item:U[2],getSelectionLabel:U[12]}}}return Z&&(b=Ln(Z,o(S))),{c(){x=mt("div"),b&&wn(b.$$.fragment),tt(x,"class","selectedItem svelte-17l1npl")},m(U,he){yt(U,x,he),b&&pn(b,x,null),k=!0,D||(ee=Ui(x,"focus",S[40]),D=!0)},p(U,he){const De={};if(he[0]&4&&(De.item=U[2]),he[0]&4096&&(De.getSelectionLabel=U[12]),he[0]&33554432&&Z!==(Z=U[25])){if(b){vn();const se=b;ti(se.$$.fragment,1,0,()=>{fn(se,1)}),bn()}Z?(b=Ln(Z,o(U)),wn(b.$$.fragment),Gt(b.$$.fragment,1),pn(b,x,null)):b=null}else Z&&b.$set(De)},i(U){k||(b&&Gt(b.$$.fragment,U),k=!0)},o(U){b&&ti(b.$$.fragment,U),k=!1},d(U){U&&ft(x),b&&fn(b),D=!1,ee()}}}function Bp(S){let x,b,k,D,ee;var Z=S[23];function o(U){return{}}return Z&&(b=Ln(Z,o())),{c(){x=mt("div"),b&&wn(b.$$.fragment),tt(x,"class","clearSelect svelte-17l1npl"),tt(x,"aria-hidden","true")},m(U,he){yt(U,x,he),b&&pn(b,x,null),k=!0,D||(ee=Ui(x,"click",X_(S[27]
1319)),D=!0)},p(U,he){if(he[0]&8388608&&Z!==(Z=U[23])){if(b){vn();const De=b;ti(De.$$.fragment,1,0,()=>{fn(De,1)}),bn()}Z?(b=Ln(Z,o()),wn(b.$$.fragment),Gt(b.$$.fragment,1),pn(b,x,null)):b=null}},i(U){k||(b&&Gt(b.$$.fragment,U),k=!0)},o(U){b&&ti(b.$$.fragment,U),k=!1},d(U){U&&ft(x),b&&fn(b),D=!1,ee()}}}function Op(S){let x;function b(ee,Z){return ee[22]?Rg:Dg}let k=b(S),D=k(S);return{c(){x=mt("div"),D.c(),tt(x,"class","indicator svelte-17l1npl"),tt(x,"aria-hidden","true")},m(ee,Z){yt(ee,x,Z),D.m(x,null)},p(ee,Z){k===(k=b(ee))&&D?D.p(ee,Z):(D.d(1),D=k(ee),D&&(D.c(),D.m(x,null)))},d(ee){ee&&ft(x),D.d()}}}function Dg(S){let x,b;return{c(){x=ul("svg"),b=ul("path"),tt(b,"d",`M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747
1320          3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0
1321          1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502
1322          0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0
1323          0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z`),tt(x,"width","100%"),tt(x,"height","100%"),tt(x,"viewBox","0 0 20 20"),tt(x,"focusable","false"),tt(x,"aria-hidden","true"),tt(x,"class","svelte-17l1npl")},m(k,D){yt(k,x,D),nt(x,b)},p:on,d(k){k&&ft(x)}}}function Rg(S){let x,b;return{c(){x=new $_(!1),b=mr(),x.a=b},m(k,D){x.m(S[22],k,D),yt(k,b,D)},p(k,D){D[0]&4194304&&x.p(k[22])},d(k){k&&ft(b),k&&x.d()}}}function Fp(S){let x;return{c(){x=mt("div"),x.innerHTML='<svg class="spinner_icon svelte-17l1npl" viewBox="25 25 50 50"><circle class="spinner_path svelte-17l1npl" cx="50" cy="50" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-miterlimit="10"></circle></svg>',tt(x,"class","spinner svelte-17l1npl")},m(b,k){yt(b,x,k)},d(b){b&&ft(x)}}}function Up(S){let x,b,k,D;const ee=[S[34]];function Z(he){S[84](he)}var o=S[24];function U(he){let De={};for(let se=0;se<ee.length;se+=1)De=la(De,ee[se]);return he[28]!==void 0&&(De.hoverItemIndex=he[28]),{props:De}}return o&&(x=Ln(o,U(S)),xo.push(()=>yp(x,"hoverItemIndex",Z)),x.$on("itemSelected",S[43]),x.$on("itemCreated",S[44]),x.$on("closeList",S[45])),{c(){x&&wn(x.$$.fragment),k=mr()},m(he,De){x&&pn(x,he,De),yt(he,k,De),D=!0},p(he,De){const se=De[1]&8?Ih(ee,[gp(he[34])]):{};if(!b&&De[0]&268435456&&(b=!0,se.hoverItemIndex=he[28],eg(()=>b=!1)),De[0]&16777216&&o!==(o=he[24])){if(x){vn();const de=x;ti(de.$$.fragment,1,0,()=>{fn(de,1)}),bn()}o?(x=Ln(o,U(he)),xo.push(()=>yp(x,"hoverItemIndex",Z)),x.$on("itemSelected",he[43]),x.$on("itemCreated",he[44]),x.$on("closeList",he[45]),wn(x.$$.fragment),Gt(x.$$.fragment,1),pn(x,k.parentNode,k)):x=null}else o&&x.$set(se)},i(he){D||(x&&Gt(x.$$.fragment,he),D=!0)},o(he){x&&ti(x.$$.fragment,he),D=!1},d(he){he&&ft(k),x&&fn(x,he)}}}function Vp(S){let x,b,k;return{c(){x=mt("input"),tt(x,"name",b=S[16].name),tt(x,"type","hidden"),x.value=k=S[2]?S[12](S[2]):null,tt(x,"class","svelte-17l1npl")},m(D,ee){yt(D,x,ee)},p(D,ee){ee[0]&65536&&b!==(b=D[16].name)&&tt(x,"name",b),ee[0]&4100&&k!==(k=D[2]?D[12](D[2]):null)&&(x.value=k)},d(D){D&&ft(x)}}}function Np(S){let x,b=S[2],k=[];for(let D=0;D<b.length;D+=1)k[D]=jp(Pp(S,b,D));return{c(){for(let D=0;D<k.length;D+=1)k[D].c();x=mr()},m(D,ee){for(let Z=0;Z<k.length;Z+=1)k[Z]&&k[Z].m(D,ee);yt(D,x,ee)},p(D,ee){if(ee[0]&69636){b=D[2];let Z;for(Z=0;Z<b.length;Z+=1){const o=Pp(D,b,Z);k[Z]?k[Z].p(o,ee):(k[Z]=jp(o),k[Z].c(),k[Z].m(x.parentNode,x))}for(;Z<k.length;Z+=1)k[Z].d(1);k.length=b.length}},d(D){jc(k,D),D&&ft(x)}}}function jp(S){let x,b,k;return{c(){x=mt("input"),tt(x,"name",b=S[16].name),tt(x,"type","hidden"),x.value=k=S[103]?S[12](S[103]):null,tt(x,"class","svelte-17l1npl")},m(D,ee){yt(D,x,ee)},p(D,ee){ee[0]&65536&&b!==(b=D[16].name)&&tt(x,"name",b),ee[0]&4100&&k!==(k=D[103]?D[12](D[103]):null)&&(x.value=k)},d(D){D&&ft(x)}}}function Bg(S){let x,b,k,D,ee,Z,o,U,he,De,se,de,Ie,Pe,Me,$e,At,bt,lt=S[1]&&zp(S),Se=S[17]&&Lp(S),Qe=S[35]&&Dp(S),ni=[{readOnly:o=!S[13]},S[31],{placeholder:S[36]},{style:S[14]},{disabled:S[9]}],qt={};for(let Ke=0;Ke<ni.length;Ke+=1)qt=la(qt,ni[Ke]);let It=!S[7]&&S[29]&&Rp(S),Re=S[37]&&Bp(S),gt=!S[37]&&(S[20]||S[19]&&!S[2]||!S[13]&&!S[9]&&!S[4]&&(S[29]&&!S[15]||!S[29]))&&Op(S),ui=S[4]&&Fp(),at=S[5]&&Up(S),Ct=(!S[7]||S[7]&&!S[35])&&Vp(S),Qt=S[7]&&S[35]&&Np(S);return{c(){x=mt("div"),b=mt("span"),lt&&lt.c(),k=Kt(),Se&&Se.c(),D=Kt(),Qe&&Qe.c(),ee=Kt(),Z=mt("input"),U=Kt(),It&&It.c(),he=Kt(),Re&&Re.c(),De=Kt(),gt&&gt.c(),se=Kt(),ui&&ui.c(),de=Kt(),at&&at.c(),Ie=Kt(),Ct&&Ct.c(),Pe=Kt(),Qt&&Qt.c(),tt(b,"aria-live","polite"),tt(b,"aria-atomic","fal
1323se"),tt(b,"aria-relevant","additions text"),tt(b,"class","a11yText svelte-17l1npl"),hp(Z,qt),_r(Z,"svelte-17l1npl",!0),tt(x,"class",Me="selectContainer "+S[21]+" svelte-17l1npl"),tt(x,"style",S[11]),_r(x,"hasError",S[10]),_r(x,"multiSelect",S[7]),_r(x,"disabled",S[9]),_r(x,"focused",S[1])},m(Ke,Tt){yt(Ke,x,Tt),nt(x,b),lt&&lt.m(b,null),nt(x,k),Se&&Se.m(x,null),nt(x,D),Qe&&Qe.m(x,null),nt(x,ee),nt(x,Z),Z.autofocus&&Z.focus(),S[82](Z),dp(Z,S[3]),nt(x,U),It&&It.m(x,null),nt(x,he),Re&&Re.m(x,null),nt(x,De),gt&&gt.m(x,null),nt(x,se),ui&&ui.m(x,null),nt(x,de),at&&at.m(x,null),nt(x,Ie),Ct&&Ct.m(x,null),nt(x,Pe),Qt&&Qt.m(x,null),S[85](x),$e=!0,At||(bt=[Ui(window,"click",S[41]),Ui(window,"focusin",S[41]),Ui(window,"keydown",S[39]),Ui(Z,"focus",S[40]),Ui(Z,"input",S[83]),Ui(x,"click",S[42])],At=!0)},p(Ke,Tt){Ke[1]?lt?lt.p(Ke,Tt):(lt=zp(Ke),lt.c(),lt.m(b,null)):lt&&(lt.d(1),lt=null),Ke[17]?Se?(Se.p(Ke,Tt),Tt[0]&131072&&Gt(Se,1)):(Se=Lp(Ke),Se.c(),Gt(Se,1),Se.m(x,D)):Se&&(vn(),ti(Se,1,1,()=>{Se=null}),bn()),Ke[35]?Qe?(Qe.p(Ke,Tt),Tt[1]&16&&Gt(Qe,1)):(Qe=Dp(Ke),Qe.c(),Gt(Qe,1),Qe.m(x,ee)):Qe&&(vn(),ti(Qe,1,1,()=>{Qe=null}),bn()),hp(Z,qt=Ih(ni,[(!$e||Tt[0]&8192&&o!==(o=!Ke[13]))&&{readOnly:o},Tt[1]&1&&Ke[31],(!$e||Tt[1]&32)&&{placeholder:Ke[36]},(!$e||Tt[0]&16384)&&{style:Ke[14]},(!$e||Tt[0]&512)&&{disabled:Ke[9]}])),Tt[0]&8&&Z.value!==Ke[3]&&dp(Z,Ke[3]),_r(Z,"svelte-17l1npl",!0),!Ke[7]&&Ke[29]?It?(It.p(Ke,Tt),Tt[0]&536871040&&Gt(It,1)):(It=Rp(Ke),It.c(),Gt(It,1),It.m(x,he)):It&&(vn(),ti(It,1,1,()=>{It=null}),bn()),Ke[37]?Re?(Re.p(Ke,Tt),Tt[1]&64&&Gt(Re,1)):(Re=Bp(Ke),Re.c(),Gt(Re,1),Re.m(x,De)):Re&&(vn(),ti(Re,1,1,()=>{Re=null}),bn()),!Ke[37]&&(Ke[20]||Ke[19]&&!Ke[2]||!Ke[13]&&!Ke[9]&&!Ke[4]&&(Ke[29]&&!Ke[15]||!Ke[29]))?gt?gt.p(Ke,Tt):(gt=Op(Ke),gt.c(),gt.m(x,se)):gt&&(gt.d(1),gt=null),Ke[4]?ui||(ui=Fp(),ui.c(),ui.m(x,de)):ui&&(ui.d(1),ui=null),Ke[5]?at?(at.p(Ke,Tt),Tt[0]&32&&Gt(at,1)):(at=Up(Ke),at.c(),Gt(at,1),at.m(x,Ie)):at&&(vn(),ti(at,1,1,()=>{at=null}),bn()),!Ke[7]||Ke[7]&&!Ke[35]?Ct?Ct.p(Ke,Tt):(Ct=Vp(Ke),Ct.c(),Ct.m(x,Pe)):Ct&&(Ct.d(1),Ct=null),Ke[7]&&Ke[35]?Qt?Qt.p(Ke,Tt):(Qt=Np(Ke),Qt.c(),Qt.m(x,null)):Qt&&(Qt.d(1),Qt=null),(!$e||Tt[0]&2097152&&Me!==(Me="selectContainer "+Ke[21]+" svelte-17l1npl"))&&tt(x,"class",Me),(!$e||Tt[0]&2048)&&tt(x,"style",Ke[11]),(!$e||Tt[0]&2098176)&&_r(x,"hasError",Ke[10]),(!$e||Tt[0]&2097280)&&_r(x,"multiSelect",Ke[7]),(!$e||Tt[0]&2097664)&&_r(x,"disabled",Ke[9]),(!$e||Tt[0]&2097154)&&_r(x,"focused",Ke[1])},i(Ke){$e||(Gt(Se),Gt(Qe),Gt(It),Gt(Re),Gt(at),$e=!0)},o(Ke){ti(Se),ti(Qe),ti(It),ti(Re),ti(at),$e=!1},d(Ke){Ke&&ft(x),lt&&lt.d(),Se&&Se.d(),Qe&&Qe.d(),S[82](null),It&&It.d(),Re&&Re.d(),gt&&gt.d(),ui&&ui.d(),at&&at.d(),Ct&&Ct.d(),Qt&&Qt.d(),S[85](null),At=!1,Cr(bt)}}}function Gp(S){return S.map((x,b)=>({index:b,value:x,label:`${x}`}))}function Og(S,x,b){let k,D,ee,Z,o,U,he,De;const se=wh();let{id:de=null}=x,{container:Ie=void 0}=x,{input:Pe=void 0}=x,{isMulti:Me=!1}=x,{multiFullItemClearable:$e=!1}=x,{isDisabled:At=!1}=x,{isCreatable:bt=!1}=x,{isFocused:lt=!1}=x,{value:Se=null}=x,{filterText:Qe=""}=x,{placeholder:ni="Select..."}=x,{placeholderAlwaysShow:qt=!1}=x,{items:It=null}=x,{itemFilter:Re=(ae,Mt,ei)=>`${ae}`.toLowerCase().includes(Mt.toLowerCase())}=x,{groupBy:gt=void 0}=x,{groupFilter:ui=ae=>ae}=x,{isGroupHeaderSelectable:at=!1}=x,{getGroupHeaderLabel:Ct=ae=>ae[Qt]||ae.id}=x,{labelIdentifier:Qt="label"}=x,{getOptionLabel:Ke=(ae,Mt)=>ae.isCreator?`Create "${Mt}"`:ae[Qt]}=x,{optionIdentifier:Tt="value"}=x,{loadOptions:$i=void 0}=x,{hasError:St=!1}=x,{containerStyles:Lt=""}=x,{getSelectionLabel:vt=ae=>ae?ae[Qt]:null}=x,{createGroupHeaderItem:ai=ae=>({value:ae,label:ae})}=x,{createItem:Mi=ae=>({value:ae,label:ae})}=x;const $t=()=>k;let{isSearchable:nn=!0}=x,{inputStyles:Gn=""}=x,{isClearable:Tn=!0}=x,{isWaiting:mn=!1}=x,{listPlacement:Je="auto"}=x,{listOpen:Dt=!1}=x,{isVirtualList:en=!1}=x,{loadOptionsInterval:Vt=300}=x,{noOptionsMessage:gr="No options"}=x,{hideEmptyState:_n=!1}=x,{inputAttributes:yr={}}=x,{listAutoWidth:wi=!0}=x,{itemHeight:En=40}=x,{Icon:wo=void 0}=x,{iconProps:Hn={}}=x,{showChevron:Sn=!1}=x,{showIndicator:io=!1}=x,{containerClasses:kr=""}=x,{indicatorSvg:no=void 0}=x,{listOffset:Kn=5}=x,{ClearIcon:Pr=zg}=x,{Item:ro=vp}=x,{List:To=xg}=x,{Selection:kn=wg}=x,{MultiSelection:or=Sg}=x,{VirtualList:zr=kg}=x;function Lr(ae){if(ae.loadOptions&&ae.filterText.length>0)return;if(!ae.items)return[];ae.items&&ae.items.length>0&&typeof ae.items[0]!="object"&&(ae.items=Gp(ae.items));let Mt=ae.items.filter(ei=>{let ji=Re(Ke(ei,ae.filterText),ae.filterText,ei);return ji&&ae.isMulti&&ae.value&&Array.isArray(ae.value)&&(ji=!ae.value.some(lr=>lr[ae.optionIdentifier]===ei[ae.optionIdentifier])),ji});return ae.groupBy&&(Mt=ne(Mt)),ae.isCreatable&&(Mt=Dr(Mt,ae.filterText)),Mt}function Dr(ae,Mt){if(Mt.length===0)return ae;const ei=Mi(Mt);return ae[0]&&Mt===ae[0][Qt]?ae:(ei.isCreator=!0,[...ae,ei])}let{selectedValue:Rr=null}=x,pi,Pn,sr,ar,xr,Br;const Q=Lg(async()=>{b(4,mn=!0);let ae=await $i(Qe).catch(Mt=>{console.warn("svelte-select loadOptions error :>> ",Mt),se("error",{type:"loadOptions",details:Mt})});ae&&!ae.cancelled&&(ae?(ae&&ae.length>0&&typeof ae[0]!="object"&&(ae=Gp(ae)),b(81,k=[...ae]),se("loaded",{items:k})):b(81,k=[]),bt&&b(81,k=Dr(k,Qe)),b(4,mn=!1),b(1,lt=!0),b(5,Dt=!0))},Vt);function R(){typeof Se=="string"?b(2,Se={[Tt]:Se,label:Se}):Me&&Array.isArray(Se)&&Se.length>0&&b(2,Se=Se.map(ae=>typeof ae=="string"?{value:ae,label:ae}:ae))}let B;function Y(){b(31,B=Object.assign({autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:!1,tabindex:0,type:"text","aria-autocomplete":"list"},yr)),de&&b(31,B.id=de,B),nn||b(31,B.readonly=!0,B)}function ne(ae){const Mt=[],ei={};ae.forEach(lr=>{const Zn=gt(lr);Mt.includes(Zn)||(Mt.push(Zn),ei[Zn]=[],Zn&&ei[Zn].push(Object.assign(ai(Zn,lr),{id:Zn,isGroupHeader:!0,isSelectable:at}))),ei[Zn].push(Object.assign({isGroupItem:!!Zn},lr))});const ji=[];return ui(Mt).forEach(lr=>{ji.push(...ei[lr])}),ji}function ue(){if(Me){JSON.stringify(Se)!==JSON.stringify(Pn)&&We()&&se("select",Se);return}(!Pn||JSON.stringify(Se[Tt])!==JSON.stringify(Pn[Tt]))&&se("select",Se)}function _e(){lt||Dt?kt():Pe&&Pe.blur()}function me(){Se&&(Array.isArray(Se)?b(2,Se=[...Se]):b(2,Se=[Se]))}function ce(){Se&&b(2,Se=null)}function we(){Qe.length!==0&&(b(1,lt=!0),b(5,Dt=!0),$i?Q():(b(5,Dt=!0),Me&&b(30,pi=void 0)))}pp(async()=>{b(77,Pn=Se),b(78,sr=Qe),b(79,ar=lt),b(80,xr=Me)});function We(){let ae=!0;if(Se){const Mt=[],ei=[];Se.forEach(ji=>{Mt.includes(ji[Tt])?ae=!1:(Mt.push(ji[Tt]),ei.push(ji))}),ae||b(2,Se=ei)}return ae}function Ye(ae){let Mt=ae?ae[Tt]:Se[Tt];return It.find(ei=>ei[Tt]===Mt)}function Ze(ae){!ae||ae.length===0||ae.some(Mt=>typeof Mt!="object")||!Se||(Me?Se.some(Mt=>!Mt||!Mt[Tt]):!Se[Tt])||(Array.isArray(Se)?b(2,Se=Se.map(Mt=>Ye(Mt)||Mt)):b(2,Se=Ye()||Se))}function zt(ae){const{detail:Mt}
1323=ae,ei=Se[Mt?Mt.i:Se.length-1];Se.length===1?b(2,Se=void 0):b(2,Se=Se.filter(ji=>ji!==ei)),se("clear",ei)}function Nt(ae){if(lt)switch(ae.key){case"ArrowDown":ae.preventDefault(),b(5,Dt=!0),b(30,pi=void 0);break;case"ArrowUp":ae.preventDefault(),b(5,Dt=!0),b(30,pi=void 0);break;case"Tab":Dt||b(1,lt=!1);break;case"Backspace":if(!Me||Qe.length>0)return;if(Me&&Se&&Se.length>0){if(zt(pi!==void 0?pi:Se.length-1),pi===0||pi===void 0)break;b(30,pi=Se.length>pi?pi-1:void 0)}break;case"ArrowLeft":if(!Me||Qe.length>0)return;pi===void 0?b(30,pi=Se.length-1):Se.length>pi&&pi!==0&&b(30,pi-=1);break;case"ArrowRight":if(!Me||Qe.length>0||pi===void 0)return;pi===Se.length-1?b(30,pi=void 0):pi<Se.length-1&&b(30,pi+=1);break}}function kt(){b(1,lt=!0),Pe&&Pe.focus()}function jt(ae){if(!Ie)return;const Mt=ae.path&&ae.path.length>0?ae.path[0]:ae.target;Ie.contains(Mt)||Ie.contains(ae.relatedTarget)||(b(1,lt=!1),b(5,Dt=!1),b(30,pi=void 0),Pe&&Pe.blur())}function Yt(){At||(b(1,lt=!0),b(5,Dt=!Dt))}function ki(){b(2,Se=void 0),b(5,Dt=!1),se("clear",Se),kt()}Zc(()=>{lt&&Pe&&Pe.focus()});function Bi(ae){const{detail:Mt}=ae;if(Mt){b(3,Qe="");const ei=Object.assign({},Mt);(!ei.isGroupHeader||ei.isSelectable)&&(Me?b(2,Se=Se?Se.concat([ei]):[ei]):b(2,Se=ei),b(2,Se),setTimeout(()=>{b(5,Dt=!1),b(30,pi=void 0)}))}}function an(ae){const{detail:Mt}=ae;Me?(b(2,Se=Se||[]),b(2,Se=[...Se,Mi(Mt)])):b(2,Se=Mi(Mt)),se("itemCreated",Mt),b(3,Qe=""),b(5,Dt=!1),b(30,pi=void 0)}function Vi(){b(3,Qe=""),b(5,Dt=!1)}let{ariaValues:Dn=ae=>`Option ${ae}, selected.`}=x,{ariaListOpen:Ni=(ae,Mt)=>`You are currently focused on option ${ae}. There are ${Mt} results available.`}=x,{ariaFocused:rn=()=>"Select is focused, type to refine list, press down to open the menu."}=x;function oo(){let ae;return Me&&Se.length>0?ae=Se.map(Mt=>vt(Mt)).join(", "):ae=vt(Se),Dn(ae)}function fl(){if(!lt||!k||k.length===0)return"";let ae=k[Br];if(Dt&&ae){let Mt=vt(ae),ei=k?k.length:0;return Ni(Mt,ei)}else return rn()}function pa(ae){xo[ae?"unshift":"push"](()=>{Pe=ae,b(6,Pe)})}function ri(){Qe=this.value,b(3,Qe)}function bs(ae){Br=ae,b(28,Br)}function Eo(ae){xo[ae?"unshift":"push"](()=>{Ie=ae,b(0,Ie)})}return S.$$set=ae=>{"id"in ae&&b(46,de=ae.id),"container"in ae&&b(0,Ie=ae.container),"input"in ae&&b(6,Pe=ae.input),"isMulti"in ae&&b(7,Me=ae.isMulti),"multiFullItemClearable"in ae&&b(8,$e=ae.multiFullItemClearable),"isDisabled"in ae&&b(9,At=ae.isDisabled),"isCreatable"in ae&&b(47,bt=ae.isCreatable),"isFocused"in ae&&b(1,lt=ae.isFocused),"value"in ae&&b(2,Se=ae.value),"filterText"in ae&&b(3,Qe=ae.filterText),"placeholder"in ae&&b(48,ni=ae.placeholder),"placeholderAlwaysShow"in ae&&b(49,qt=ae.placeholderAlwaysShow),"items"in ae&&b(50,It=ae.items),"itemFilter"in ae&&b(51,Re=ae.itemFilter),"groupBy"in ae&&b(52,gt=ae.groupBy),"groupFilter"in ae&&b(53,ui=ae.groupFilter),"isGroupHeaderSelectable"in ae&&b(54,at=ae.isGroupHeaderSelectable),"getGroupHeaderLabel"in ae&&b(55,Ct=ae.getGroupHeaderLabel),"labelIdentifier"in ae&&b(56,Qt=ae.labelIdentifier),"getOptionLabel"in ae&&b(57,Ke=ae.getOptionLabel),"optionIdentifier"in ae&&b(58,Tt=ae.optionIdentifier),"loadOptions"in ae&&b(59,$i=ae.loadOptions),"hasError"in ae&&b(10,St=ae.hasError),"containerStyles"in ae&&b(11,Lt=ae.containerStyles),"getSelectionLabel"in ae&&b(12,vt=ae.getSelectionLabel),"createGroupHeaderItem"in ae&&b(60,ai=ae.createGroupHeaderItem),"createItem"in ae&&b(61,Mi=ae.createItem),"isSearchable"in ae&&b(13,nn=ae.isSearchable),"inputStyles"in ae&&b(14,Gn=ae.inputStyles),"isClearable"in ae&&b(15,Tn=ae.isClearable),"isWaiting"in ae&&b(4,mn=ae.isWaiting),"listPlacement"in ae&&b(63,Je=ae.listPlacement),"listOpen"in ae&&b(5,Dt=ae.listOpen),"isVirtualList"in ae&&b(64,en=ae.isVirtualList),"loadOptionsInterval"in ae&&b(65,Vt=ae.loadOptionsInterval),"noOptionsMessage"in ae&&b(66,gr=ae.noOptionsMessage),"hideEmptyState"in ae&&b(67,_n=ae.hideEmptyState),"inputAttributes"in ae&&b(16,yr=ae.inputAttributes),"listAutoWidth"in ae&&b(68,wi=ae.listAutoWidth),"itemHeight"in ae&&b(69,En=ae.itemHeight),"Icon"in ae&&b(17,wo=ae.Icon),"iconProps"in ae&&b(18,Hn=ae.iconProps),"showChevron"in ae&&b(19,Sn=ae.showChevron),"showIndicator"in ae&&b(20,io=ae.showIndicator),"containerClasses"in ae&&b(21,kr=ae.containerClasses),"indicatorSvg"in ae&&b(22,no=ae.indicatorSvg),"listOffset"in ae&&b(70,Kn=ae.listOffset),"ClearIcon"in ae&&b(23,Pr=ae.ClearIcon),"Item"in ae&&b(71,ro=ae.Item),"List"in ae&&b(24,To=ae.List),"Selection"in ae&&b(25,kn=ae.Selection),"MultiSelection"in ae&&b(26,or=ae.MultiSelection),"VirtualList"in ae&&b(72,zr=ae.VirtualList),"selectedValue"in ae&&b(73,Rr=ae.selectedValue),"ariaValues"in ae&&b(74,Dn=ae.ariaValues),"ariaListOpen"in ae&&b(75,Ni=ae.ariaListOpen),"ariaFocused"in ae&&b(76,rn=ae.ariaFocused)},S.$$.update=()=>{S.$$.dirty[0]&140|S.$$.dirty[1]&405340160&&b(81,k=Lr({loadOptions:$i,filterText:Qe,items:It,value:Se,isMulti:Me,optionIdentifier:Tt,groupBy:gt,isCreatable:bt})),S.$$.dirty[2]&2048&&Rr&&console.warn("selectedValue is no longer used. Please use value instead."),S.$$.dirty[1]&524288&&Ze(It),S.$$.dirty[0]&4&&Se&&R(),S.$$.dirty[0]&73728&&(yr||!nn)&&Y(),S.$$.dirty[0]&128|S.$$.dirty[2]&262144&&(Me&&me(),xr&&!Me&&ce()),S.$$.dirty[0]&132&&Me&&Se&&Se.length>1&&We(),S.$$.dirty[0]&4&&Se&&ue(),S.$$.dirty[0]&132|S.$$.dirty[2]&32768&&!Se&&Me&&Pn&&se("select",Se),S.$$.dirty[0]&2|S.$$.dirty[2]&131072&&lt!==ar&&_e(),S.$$.dirty[0]&8|S.$$.dirty[2]&65536&&Qe!==sr&&we(),S.$$.dirty[0]&12&&b(29,D=Se&&Qe.length===0),S.$$.dirty[0]&536904208&&b(37,ee=D&&Tn&&!At&&!mn),S.$$.dirty[0]&132|S.$$.dirty[1]&393216&&b(36,Z=qt&&Me?ni:Se?"":ni),S.$$.dirty[0]&132&&b(35,o=Me&&Se&&Se.length>0),S.$$.dirty[0]&141|S.$$.dirty[1]&218103808|S.$$.dirty[2]&526326&&b(34,U={Item:ro,filterText:Qe,optionIdentifier:Tt,noOptionsMessage:gr,hideEmptyState:_n,isVirtualList:en,VirtualList:zr,value:Se,isMulti:Me,getGroupHeaderLabel:Ct,items:k,itemHeight:En,getOptionLabel:Ke,listPlacement:Je,parent:Ie,listAutoWidth:wi,listOffset:Kn}),S.$$.dirty[0]&132&&b(33,he=Se?oo():""),S.$$.dirty[0]&268435490|S.$$.dirty[2]&524288&&b(32,De=fl())},[Ie,lt,Se,Qe,mn,Dt,Pe,Me,$e,At,St,Lt,vt,nn,Gn,Tn,yr,wo,Hn,Sn,io,kr,no,Pr,To,kn,or,ki,Br,D,pi,B,De,he,U,o,Z,ee,zt,Nt,kt,jt,Yt,Bi,an,Vi,de,bt,ni,qt,It,Re,gt,ui,at,Ct,Qt,Ke,Tt,$i,ai,Mi,$t,Je,en,Vt,gr,_n,wi,En,Kn,ro,zr,Rr,Dn,Ni,rn,Pn,sr,ar,xr,k,pa,ri,bs,Eo]}
1323class Zp extends bo{constructor(x){super(),vo(this,x,Og,Bg,yo,{id:46,container:0,input:6,isMulti:7,multiFullItemClearable:8,isDisabled:9,isCreatable:47,isFocused:1,value:2,filterText:3,placeholder:48,placeholderAlwaysShow:49,items:50,itemFilter:51,groupBy:52,groupFilter:53,isGroupHeaderSelectable:54,getGroupHeaderLabel:55,labelIdentifier:56,getOptionLabel:57,optionIdentifier:58,loadOptions:59,hasError:10,containerStyles:11,getSelectionLabel:12,createGroupHeaderItem:60,createItem:61,getFilteredItems:62,isSearchable:13,inputStyles:14,isClearable:15,isWaiting:4,listPlacement:63,listOpen:5,isVirtualList:64,loadOptionsInterval:65,noOptionsMessage:66,hideEmptyState:67,inputAttributes:16,listAutoWidth:68,itemHeight:69,Icon:17,iconProps:18,showChevron:19,showIndicator:20,containerClasses:21,indicatorSvg:22,listOffset:70,ClearIcon:23,Item:71,List:24,Selection:25,MultiSelection:26,VirtualList:72,selectedValue:73,handleClear:27,ariaValues:74,ariaListOpen:75,ariaFocused:76},null,[-1,-1,-1,-1])}get getFilteredItems(){return this.$$.ctx[62]}get handleClear(){return this.$$.ctx[27]}}function qp(S,x,b){const k=S.slice();return k[5]=x[b],k}function Wp(S){let x,b;return{c(){x=mt("span"),b=Ci(S[1]),tt(x,"class","cap_map_popup_etat")},m(k,D){yt(k,x,D),nt(x,b)},p(k,D){D&2&&sn(b,k[1])},d(k){k&&ft(x)}}}function Xp(S){let x,b,k,D,ee,Z=S[2].join(", ")+"",o;return{c(){x=mt("div"),b=mt("b"),b.textContent="Produits :",k=Kt(),D=mt("div"),ee=mt("p"),o=Ci(Z),tt(x,"class","cap_map_popup_data_container")},m(U,he){yt(U,x,he),nt(x,b),nt(x,k),nt(x,D),nt(D,ee),nt(ee,o)},p(U,he){he&4&&Z!==(Z=U[2].join(", ")+"")&&sn(o,Z)},d(U){U&&ft(x)}}}function Hp(S){let x,b,k,D,ee=S[0].llNom&&typeof S[0].llNom=="string"&&S[0].llNom.trim()!=="",Z,o,U,he,De,se=ee&&Kp(S),de=S[4].rue&&Yp(S),Ie=S[4].cp&&Jp(S),Pe=S[4].cp&&S[4].ville&&Qp(),Me=S[4].ville&&$p(S);return{c(){x=mt("div"),b=mt("b"),b.textContent="Livraisons :",k=Kt(),D=mt("div"),se&&se.c(),Z=Kt(),de&&de.c(),o=Kt(),U=mt("p"),Ie&&Ie.c(),he=Kt(),Pe&&Pe.c(),De=Kt(),Me&&Me.c(),tt(x,"class","cap_map_popup_data_container")},m($e,At){yt($e,x,At),nt(x,b),nt(x,k),nt(x,D),se&&se.m(D,null),nt(D,Z),de&&de.m(D,null),nt(D,o),nt(D,U),Ie&&Ie.m(U,null),nt(U,he),Pe&&Pe.m(U,null),nt(U,De),Me&&Me.m(U,null)},p($e,At){At&1&&(ee=$e[0].llNom&&typeof $e[0].llNom=="string"&&$e[0].llNom.trim()!==""),ee?se?se.p($e,At):(se=Kp($e),se.c(),se.m(D,Z)):se&&(se.d(1),se=null),$e[4].rue?de?de.p($e,At):(de=Yp($e),de.c(),de.m(D,o)):de&&(de.d(1),de=null),$e[4].cp?Ie?Ie.p($e,At):(Ie=Jp($e),Ie.c(),Ie.m(U,he)):Ie&&(Ie.d(1),Ie=null),$e[4].cp&&$e[4].ville?Pe||(Pe=Qp(),Pe.c(),Pe.m(U,De)):Pe&&(Pe.d(1),Pe=null),$e[4].ville?Me?Me.p($e,At):(Me=$p($e),Me.c(),Me.m(U,null)):Me&&(Me.d(1),Me=null)},d($e){$e&&ft(x),se&&se.d(),de&&de.d(),Ie&&Ie.d(),Pe&&Pe.d(),Me&&Me.d()}}}function Kp(S){let x,b=S[0].llNom+"",k;return{c(){x=mt("p"),k=Ci(b)},m(D,ee){yt(D,x,ee),nt(x,k)},p(D,ee){ee&1&&b!==(b=D[0].llNom+"")&&sn(k,b)},d(D){D&&ft(x)}}}function Yp(S){let x,b=S[4].rue+"",k;return{c(){x=mt("p"),k=Ci(b)},m(D,ee){yt(D,x,ee),nt(x,k)},p(D,ee){ee&16&&b!==(b=D[4].rue+"")&&sn(k,b)},d(D){D&&ft(x)}}}function Jp(S){let x=S[4].cp+"",b;return{c(){b=Ci(x)},m(k,D){yt(k,b,D)},p(k,D){D&16&&x!==(x=k[4].cp+"")&&sn(b,x)},d(k){k&&ft(b)}}}function Qp(S){let x;return{c(){x=Ci(" ")},m(b,k){yt(b,x,k)},d(b){b&&ft(x)}}}function $p(S){let x=S[4].ville+"",b;return{c(){b=Ci(x)},m(k,D){yt(k,b,D)},p(k,D){D&16&&x!==(x=k[4].ville+"")&&sn(b,x)},d(k){k&&ft(b)}}}function ef(S){let x,b=S[3],k=[];for(let D=0;D<b.length;D+=1)k[D]=sf(qp(S,b,D));return{c(){for(let D=0;D<k.length;D+=1)k[D].c();x=mr()},m(D,ee){for(let Z=0;Z<k.length;Z+=1)k[Z]&&k[Z].m(D,ee);yt(D,x,ee)},p(D,ee){if(ee&8){b=D[3];let Z;for(Z=0;Z<b.length;Z+=1){const o=qp(D,b,Z);k[Z]?k[Z].p(o,ee):(k[Z]=sf(o),k[Z].c(),k[Z].m(x.parentNode,x))}for(;Z<k.length;Z+=1)k[Z].d(1);k.length=b.length}},d(D){jc(k,D),D&&ft(x)}}}function tf(S){let x=S[5].jour+"",b;return{c(){b=Ci(x)},m(k,D){yt(k,b,D)},p(k,D){D&8&&x!==(x=k[5].jour+"")&&sn(b,x)},d(k){k&&ft(b)}}}function nf(S){let x=S[5].debut+"",b;return{c(){b=Ci(x)},m(k,D){yt(k,b,D)},p(k,D){D&8&&x!==(x=k[5].debut+"")&&sn(b,x)},d(k){k&&ft(b)}}}function rf(S){let x;return{c(){x=Ci("/")},m(b,k){yt(b,x,k)},d(b){b&&ft(x)}}}function of(S){let x=S[5].fin+"",b;return{c(){b=Ci(x)},m(k,D){yt(k,b,D)},p(k,D){D&8&&x!==(x=k[5].fin+"")&&sn(b,x)},d(k){k&&ft(b)}}}function sf(S){let x,b,k=S[5].saison?S[5].saison+" :":"",D,ee,Z,o,U,he,De,se=S[5].jour&&tf(S),de=S[5].debut&&nf(S),Ie=S[5].debut&&S[5].fin&&rf(),Pe=S[5].fin&&of(S);return{c(){x=mt("div"),b=mt("b"),D=Ci(k),ee=Kt(),Z=mt("p"),se&&se.c(),o=Kt(),de&&de.c(),U=Kt(),Ie&&Ie.c(),he=Kt(),Pe&&Pe.c(),De=Kt(),tt(x,"class","cap_map_popup_data_container")},m(Me,$e){yt(Me,x,$e),nt(x,b),nt(b,D),nt(x,ee),nt(x,Z),se&&se.m(Z,null),nt(Z,o),de&&de.m(Z,null),nt(Z,U),Ie&&Ie.m(Z,null),nt(Z,he),Pe&&Pe.m(Z,null),nt(x,De)},p(Me,$e){$e&8&&k!==(k=Me[5].saison?Me[5].saison+" :":"")&&sn(D,k),Me[5].jour?se?se.p(Me,$e):(se=tf(Me),se.c(),se.m(Z,o)):se&&(se.d(1),se=null),Me[5].debut?de?de.p(Me,$e):(de=nf(Me),de.c(),de.m(Z,U)):de&&(de.d(1),de=null),Me[5].debut&&Me[5].fin?Ie||(Ie=rf(),Ie.c(),Ie.m(Z,he)):Ie&&(Ie.d(1),Ie=null),Me[5].fin?Pe?Pe.p(Me,$e):(Pe=of(Me),Pe.c(),Pe.m(Z,null)):Pe&&(Pe.d(1),Pe=null)},d(Me){Me&&ft(x),se&&se.d(),de&&de.d(),Ie&&Ie.d(),Pe&&Pe.d()}}}function af(S){let x;return{c(){x=mt("div"),x.innerHTML=`<p>Pour rejoindre l&#39;AMAP ou aider ce projet, contactez directement le
1324				collectif et/ou contactez-nous à <a href="mailto:[email protected]">[email protected]</a>.</p>`,tt(x,"class","cap_map_popup_message_container")},m(b,k){yt(b,x,k)},d(b){b&&ft(x)}}}function lf(S){let x,b,k,D,ee=S[0].email+"",Z,o;return{c(){x=mt("div"),b=mt("b"),b.textContent="Email :",k=Kt(),D=mt("a"),Z=Ci(ee),tt(D,"href",o="mailto:"+S[0].email),tt(D,"target","_blank"),tt(x,"class","cap_map_popup_data_container")},m(U,he){yt(U,x,he),nt(x,b),nt(x,k),nt(x,D),nt(D,Z)}
1324,p(U,he){he&1&&ee!==(ee=U[0].email+"")&&sn(Z,ee),he&1&&o!==(o="mailto:"+U[0].email)&&tt(D,"href",o)},d(U){U&&ft(x)}}}function cf(S){let x,b,k,D,ee=S[0].url+"",Z,o;return{c(){x=mt("div"),b=mt("b"),b.textContent="Site internet :",k=Kt(),D=mt("a"),Z=Ci(ee),tt(D,"href",o=S[0].url),tt(D,"target","_blank"),tt(D,"rel","noopener noreferrer"),tt(x,"class","cap_map_popup_data_container")},m(U,he){yt(U,x,he),nt(x,b),nt(x,k),nt(x,D),nt(D,Z)},p(U,he){he&1&&ee!==(ee=U[0].url+"")&&sn(Z,ee),he&1&&o!==(o=U[0].url)&&tt(D,"href",o)},d(U){U&&ft(x)}}}function Fg(S){let x,b,k,D=S[0].nom+"",ee,Z,o,U,he,De,se,de,Ie=S[1]&&Wp(S),Pe=S[2][0]!==null&&Xp(S),Me=S[4][0]!==null&&Hp(S),$e=typeof S[3][0]=="object"&&ef(S),At=S[0].amapEtat&&S[0].amapEtat==="creation"&&af(),bt=S[0].email&&lf(S),lt=S[0].url&&cf(S);return{c(){x=mt("div"),Ie&&Ie.c(),b=Kt(),k=mt("h4"),ee=Ci(D),Z=Kt(),Pe&&Pe.c(),o=Kt(),Me&&Me.c(),U=Kt(),$e&&$e.c(),he=Kt(),At&&At.c(),De=Kt(),bt&&bt.c(),se=Kt(),lt&&lt.c(),tt(x,"class",de="cap_map_popup cap_map_popup_type_"+S[0].type)},m(Se,Qe){yt(Se,x,Qe),Ie&&Ie.m(x,null),nt(x,b),nt(x,k),nt(k,ee),nt(x,Z),Pe&&Pe.m(x,null),nt(x,o),Me&&Me.m(x,null),nt(x,U),$e&&$e.m(x,null),nt(x,he),At&&At.m(x,null),nt(x,De),bt&&bt.m(x,null),nt(x,se),lt&&lt.m(x,null)},p(Se,[Qe]){Se[1]?Ie?Ie.p(Se,Qe):(Ie=Wp(Se),Ie.c(),Ie.m(x,b)):Ie&&(Ie.d(1),Ie=null),Qe&1&&D!==(D=Se[0].nom+"")&&sn(ee,D),Se[2][0]!==null?Pe?Pe.p(Se,Qe):(Pe=Xp(Se),Pe.c(),Pe.m(x,o)):Pe&&(Pe.d(1),Pe=null),Se[4][0]!==null?Me?Me.p(Se,Qe):(Me=Hp(Se),Me.c(),Me.m(x,U)):Me&&(Me.d(1),Me=null),typeof Se[3][0]=="object"?$e?$e.p(Se,Qe):($e=ef(Se),$e.c(),$e.m(x,he)):$e&&($e.d(1),$e=null),Se[0].amapEtat&&Se[0].amapEtat==="creation"?At||(At=af(),At.c(),At.m(x,De)):At&&(At.d(1),At=null),Se[0].email?bt?bt.p(Se,Qe):(bt=lf(Se),bt.c(),bt.m(x,se)):bt&&(bt.d(1),bt=null),Se[0].url?lt?lt.p(Se,Qe):(lt=cf(Se),lt.c(),lt.m(x,null)):lt&&(lt.d(1),lt=null),Qe&1&&de!==(de="cap_map_popup cap_map_popup_type_"+Se[0].type)&&tt(x,"class",de)},i:on,o:on,d(Se){Se&&ft(x),Ie&&Ie.d(),Pe&&Pe.d(),Me&&Me.d(),$e&&$e.d(),At&&At.d(),bt&&bt.d(),lt&&lt.d()}}}function Ug(S,x,b){let k,D,ee,Z,{properties:o}=x;return S.$$set=U=>{"properties"in U&&b(0,o=U.properties)},S.$$.update=()=>{S.$$.dirty&1&&b(4,k=typeof o.adresse=="object"?o.adresse:JSON.parse(o.adresse)),S.$$.dirty&1&&b(3,D=typeof o.livraisonHoraires=="object"?o.livraisonHoraires:JSON.parse(o.livraisonHoraires)),S.$$.dirty&1&&b(2,ee=typeof o.typeProduction=="object"?o.typeProduction:JSON.parse(o.typeProduction)),S.$$.dirty&1&&b(1,Z=o.amapEtat&&o.amapEtat==="creation"?"En cours de création":null)},[o,Z,ee,D,k]}class Vg extends bo{constructor(x){super(),vo(this,x,Ug,Fg,yo,{properties:0})}}const Lx="";function Ng(S){let x,b,k,D,ee,Z,o,U,he,De,se,de,Ie,Pe,Me,$e,At,bt=S[14].showstats&&uf(S),lt=S[6]&&S[7]&&qg(S);De=new Zp({props:{containerStyles:"width:100%",loadOptions:Hg,showChevron:!1,placeholder:"Une commune",placeholderAlwaysShow:!1,noOptionsMessage:"Saisissez un nom"}}),De.$on("select",S[9]),De.$on("clear",S[11]);let Se=(S[6]||S[7])&&Wg(S);return{c(){x=mt("div"),b=mt("span"),b.innerHTML='<svg id="expand_button" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 540 540" width="30px"><g id="expand"><path d="m219.26,84.76h-115.41c-10.27,0-19.09,8.44-19.09,18.82,0,38.46.01,76.94.01,115.4,0,24.47,37.91,24.68,37.91.27,0-23.27,0-46.53,0-69.8,27.25,27.25,54.52,54.51,81.77,81.76,17.27,17.27,43.97-9.63,26.66-26.94-27.21-27.21-54.41-54.41-81.62-81.61h69.51c24.46.01,24.68-37.9.27-37.9Z" style="fill:#363636; stroke-width:0px;"></path><path d="m417.32,320.73c0,23.27,0,46.52,0,69.79l-81.77-81.77c-17.27-17.27-43.97,9.63-26.66,26.94,27.21,27.21,54.41,54.41,81.62,81.62-23.17,0-46.34,0-69.51,0-24.47,0-24.68,37.91-.27,37.91,38.47,0,76.95-.01,115.41-.01,10.27,0,19.09-8.44,19.09-18.82,0-38.46-.01-76.93-.01-115.4,0-24.48-37.9-24.69-37.9-.28Z" style="fill:#363636; stroke-width:0px;"></path><path d="m320.74,122.69c23.27,0,46.52,0,69.79,0-27.25,27.25-54.51,54.51-81.77,81.76-17.27,17.27,9.63,43.97,26.94,26.66,27.21-27.2,54.41-54.4,81.62-81.6,0,23.16,0,46.33,0,69.5,0,24.47,37.91,24.68,37.91.27,0-38.46-.01-76.94-.01-115.4,0-10.27-8.44-19.09-18.82-19.09-38.46,0-76.93.01-115.4.01-24.48,0-24.69,37.9-.28,37.9Z" style="fill:#363636; stroke-width:0px;"></path><path d="m219.26,417.31c-23.27,0-46.53,0-69.79,0,27.25-27.25,54.51-54.51,81.76-81.76,17.27-17.27-9.63-43.97-26.94-26.66-27.21,27.2-54.41,54.41-81.61,81.61v-69.5c0-24.47-37.9
13241-24.68-37.91-.27v115.4c0,10.27,8.44,19.09,18.82,19.09,38.47,0,76.94-.01,115.4-.01,24.48,0,24.7-37.9.29-37.9Z" style="fill:#363636; stroke-width:0px;"></path></g><g id="reduce" style="opacity: 0;"><path d="m102.96,237.45h115.41c10.27,0,19.09-8.44,19.09-18.82,0-38.46-.01-76.94-.01-115.4,0-24.47-37.91-24.68-37.91-.27,0,23.27,0,46.53,0,69.8-27.25-27.25-54.52-54.51-81.77-81.76-17.27-17.27-43.97,9.63-26.66,26.94,27.21,27.21,54.41,54.41,81.62,81.61h-69.51c-24.46-.01-24.68,37.9-.27,37.9Z" style="fill:#363636; stroke-width:0px;"></path><path d="m340.45,437.04c0-23.27,0-46.52,0-69.79,27.25,27.25,54.51,54.51,81.77,81.77,17.27,17.27,43.97-9.63,26.66-26.94-27.21-27.21-54.41-54.41-81.62-81.62,23.17,0,46.34,0,69.51,0,24.47,0,24.68-37.91.27-37.91-38.47,0-76.95.01-115.41.01-10.27,0-19.09,8.44-19.09,18.82,0,38.46.01,76.93.01,115.4,0,24.48,37.9,24.69,37.9.28Z" style="fill:#363636; stroke-width:0px;"></path><path d="m437.05,199.54c-23.27,0-46.52,0-69.79,0,27.25-27.25,54.51-54.51,81.77-81.76,17.27-17.27-9.63-43.97-26.94-26.66-27.21,27.2-54.41,54.4-81.62,81.6,0-23.16,0-46.33,0-69.5,0-24.47-37.91-24.68-37.91-.27,0,38.46.01,76.94.01,115.4,0,10.27,8.44,19.09,18.82,19.09,38.46,0,76.93-.01,115.4-.01,24.48,0,24.69-37.9.28-37.9Z" style="fill:#363636; stroke-width:0px;"></path><path d="m102.95,340.45c23.27,0,46.53,0,69.79,0-27.25,27.25-54.51,54.51-81.76,81.76-17.27,17.27,9.63,43.97,26.94,26.66,27.21-27.2,54.41-54.41,81.61-81.61,0,23.17,0,46.34,0,69.5,0,24.47,37.91,24.68,37.91.27,0-38.46,0-76.94,0-115.4,0-10.27-8.44-19.09-18.82-19.09-38.47,0-76.94.01-115.4.01-24.48,0-24.7,37.9-.29,37.9Z" style="fill:#363636; stroke-width:0px;"></path></g><path d="m459.18,540H80.82c-44.56,0-80.82-36.25-80.82-80.82V80.82C0,36.25,36.25,0,80.82,0h378.37c44.56,0,80.82,36.25,80.82,80.82v378.37c0,44.56-36.25,80.82-80.82,80.82ZM80.82,30c-28.02,0-50.82,22.8-50.82,50.82v378.37c0,28.02,22.8,50.82,50.82,50.82h378.37c28.02,0,50.82-22.8,50.82-50.82V80.82c0-28.02-22.8-50.82-50.82-50.82H80.82Z" style="fill:#363636; stroke-width:0px;"></path></svg>',k=Kt(),bt&&bt.c(),D=Kt(),ee=mt("div"),lt&&lt.c(),Z=Kt(),o=mt("h3"),o.textContent="Rechercher :",U=Kt(),he=mt("div"),wn(De.$$.fragment),se=Kt(),Se&&Se.c(),de=Kt(),Ie=mt("div"),tt(b,"class","cap_map_white_box cap_map_toggle_fullscreen"),tt(he,"class","dropdown svelte-9uocjf"),tt(ee,"class","cap_map_white_box cap_map_filters"),tt(Ie,"id","map"),tt(x,"class",Pe="cap_map_mapbox "+(S[2]===!0?"loading":""))},m(Qe,ni){yt(Qe,x,ni),nt(x,b),nt(x,k),bt&&bt.m(x,null),nt(x,D),nt(x,ee),lt&&lt.m(ee,null),nt(ee,Z),nt(ee,o),nt(ee,U),nt(ee,he),pn(De,he,null),nt(ee,se),Se&&Se.m(ee,null),nt(x,de),nt(x,Ie),Me=!0,$e||(At=Ui(b,"click",S[15]),$e=!0)},p(Qe,ni){Qe[14].showstats?bt?bt.p(Qe,ni):(bt=uf(Qe),bt.c(),bt.m(x,D)):bt&&(bt.d(1),bt=null),Qe[6]&&Qe[7]&&lt.p(Qe,ni),(Qe[6]||Qe[7])&&Se.p(Qe,ni),(!Me||ni[0]&4&&Pe!==(Pe="cap_map_mapbox "+(Qe[2]===!0?"loading":"")))&&tt(x,"class",Pe)},i(Qe){Me||(Gt(De.$$.fragment,Qe),Gt(Se),Me=!0)},o(Qe){ti(De.$$.fragment,Qe),ti(Se),Me=!1},d(Qe){Qe&&ft(x),bt&&bt.d(),lt&&lt.d(),fn(De),Se&&Se.d(),$e=!1,At()}}}function jg(S){let x,b;return{c(){x=mt("p"),b=Ci(S[1]),tt(x,"class","cap_error cap_message"),ys(x,"padding","1em")},m(k,D){yt(k,x,D),nt(x,b)},p(k,D){D[0]&2&&sn(b,k[1])},i:on,o:on,d(k){k&&ft(x)}}}function uf(S){let x,b,k=S[6]&&Gg(S),D=S[7]&&Zg(S);return{c(){x=mt("div"),k&&k.c(),b=Kt(),D&&D.c(),tt(x,"class","cap_map_white_box cap_map_info")},m(ee,Z){yt(ee,x,Z),k&&k.m(x,null),nt(x,b),D&&D.m(x,null)},p(ee,Z){ee[6]&&k.p(ee,Z),ee[7]&&D.p(ee,Z)},d(ee){ee&&ft(x),k&&k.d(),D&&D.d()}}}function Gg(S){let x,b,k,D;return{c(){x=mt("span"),b=mt("span"),k=Ci(S[4]),D=Ci(" AMAP"),tt(b,"class","cap_map_pill cap_map_count"),tt(x,"class","cap_map_info_group cap_map_info_group_amap")},m(ee,Z){yt(ee,x,Z),nt(x,b),nt(b,k),nt(x,D)},p(ee,Z){Z[0]&16&&sn(k,ee[4])},d(ee){ee&&ft(x)}}}function Zg(S){let x,b,k,D;return{c(){x=mt("span"),b=mt("span"),k=Ci(S[5]),D=Ci(" Paysan·ne"),tt(b,"class","cap_map_pill cap_map_count"),tt(x,"class","cap_map_info_group cap_map_info_group_paysan")},m(ee,Z){yt(ee,x,Z),nt(x,b),nt(b,k),nt(x,D)},p(ee,Z){Z[0]&32&&sn(k,ee[5])},d(ee){ee&&ft(x)}}}function qg(S){let x,b,k,D,ee,Z,o,U,he,De,se,de,Ie;return{c(){x=mt("h3"),x.textContent="Filtrer par :",b=Kt(),k=mt("span"),D=mt("span"),Z=Ci(" AMAP"),o=Kt(),U=mt("span"),he=mt("span"),se=Ci(" Paysan·ne"),tt(D,"class",ee="cap_map_pill cap_map_radio "+(S[3].amap===!0?"active":"")),tt(k,"class","cap_map_info_group cap_map_info_group_amap"),tt(he,"class",De="cap_map_pill cap_map_radio "+(S[3].ferme===!0?"active":"")),tt(U,"class","cap_map_info_group cap_map_info_group_paysan")},m(Pe,Me){yt(Pe,x,Me),yt(Pe,b,Me),yt(Pe,k,Me),nt(k,D),nt(k,Z),yt(Pe,o,Me),yt(Pe,U,Me),nt(U,he),nt(U,se),de||(Ie=[Ui(k,"click",S[16]),Ui(U,"click",S[17])],de=!0)},p(Pe,Me){Me[0]&8&&ee!==(ee="cap_map_pill cap_map_radio "+(Pe[3].amap===!0?"active":""))&&tt(D,"class",ee),Me[0]&8&&De!==(De="cap_map_pill cap_map_radio "+(Pe[3].ferme===!0?"active":""))&&tt(he,"class",De)},d(Pe){Pe&&ft(x),Pe&&ft(b),Pe&&ft(k),Pe&&ft(o),Pe&&ft(U),de=!1,Cr(Ie)}}}function Wg(S){let x,b,k;return b=new Zp({props:{containerStyles:"width:100%",loadOptions:S[8],showChevron:!1,placeholder:S[6]&&S[7]?"PAYSAN·NE ou AMAP":S[6]?"AMAP":"PAYSAN·NE",placeholderAlwaysShow:!1,noOptionsMessage:"Saisissez un nom"}}),b.$on("select",S[10]),b.$on("clear",S[11]),{c(){x=mt("div"),wn(b.$$.fragment),tt(
1324x,"class","dropdown svelte-9uocjf")},m(D,ee){yt(D,x,ee),pn(b,x,null),k=!0},p:on,i(D){k||(Gt(b.$$.fragment,D),k=!0)},o(D){ti(b.$$.fragment,D),k=!1},d(D){D&&ft(x),fn(b)}}}function Xg(S){let x,b,k,D;const ee=[jg,Ng],Z=[];function o(U,he){return U[0]?0:1}return x=o(S),b=Z[x]=ee[x](S),{c(){b.c(),k=mr()},m(U,he){Z[x].m(U,he),yt(U,k,he),D=!0},p(U,he){let De=x;x=o(U),x===De?Z[x].p(U,he):(vn(),ti(Z[De],1,1,()=>{Z[De]=null}),bn(),b=Z[x],b?b.p(U,he):(b=Z[x]=ee[x](U),b.c()),Gt(b,1),b.m(k.parentNode,k))},i(U){D||(Gt(b),D=!0)},o(U){ti(b),D=!1},d(U){Z[x].d(U),U&&ft(k)}}}async function Hg(S){try{let x=await fetch("https://geo.api.gouv.fr/communes?fields=nom,centre&nom="+encodeURI(S));return x.ok?(await x.json()).map(D=>({value:D.nom,label:D.nom,coordinates:D.centre.coordinates})):[]}catch{return[]}}function Kg(S,x,b){let k=!1,D="";pl.accessToken=cap_vars.click_amap_mapboxapi,pl.accessToken||(k=!0,D="Clef d'API Mapbox non renseignée. Veuillez contacter l'administrateur du site.");let ee=cap_vars.amap_api_url,Z=cap_vars.amap_dropdown_url;const o=new URLSearchParams;o.set("show_amap",cap_vars.show_amap_layer?"1":"0"),o.set("show_ferme",cap_vars.show_ferme_layer?"1":"0"),o.set("show_etats",cap_vars.show_etats||"creation,attente,fonctionnement"),o.set("departement_ids",cap_vars.departement_ids||""),o.set("region_ids",cap_vars.region_ids||""),o.set("cap_token",cap_vars.cap_token||""),ee+="&"+o.toString(),Z+="&"+o.toString();const U=!!cap_vars.show_amap_layer,he=!!cap_vars.show_ferme_layer;let De=!0,se={amap:!0,ferme:!0},de={ferme:null,amap:null},Ie={ferme:null,amap:null},Pe=!1,Me,$e=[],At=[],bt=ee,lt=Z,Se="",Qe="";async function ni(){try{const vt=await(await fetch(bt)).json();if(vt.code&&vt.message){qt(vt);return}if(!vt.features||!Array.isArray(vt.features)){b(0,k=!0),b(1,D="Une erreur s'est produite lors du chargement de la carte."),b(2,De=!1);return}const ai=vt.features.filter($t=>$t.properties.type==="amap"),Mi=vt.features.filter($t=>$t.properties.type==="ferme");ai.length>0&&($e={type:"FeatureCollection",features:ai},de.amap=$e,Ie.amap=$e,b(4,Se=ai.length),at($e,"amap")),Mi.length>0&&(At={type:"FeatureCollection",features:Mi},de.ferme=At,Ie.ferme=At,b(5,Qe=Mi.length),at(At,"ferme"))}catch{b(0,k=!0),b(1,D="Une erreur s'est produite lors du chargement de la carte.")}finally{b(2,De=!1)}}function qt(Lt){b(0,k=!0),b(1,D=Lt.message||"Une erreur s'est produite lors du chargement de la carte."),b(2,De=!1)}async function It(Lt){try{let vt=await fetch(lt+"&filtername="+encodeURI(Lt));if(!vt.ok)return[];let ai=await vt.json();return ai.code?[]:ai}catch{return[]}}function Re(Lt){ui(),Me.easeTo({center:Lt.detail.coordinates,zoom:11,essential:!0})}function gt(Lt){Lt.detail.properties&&Lt.detail.properties,Pe=new pl.Popup().setLngLat(Lt.detail.coordinates).setDOMContent(Ct(Lt.detail.properties)).addTo(Me),Me.easeTo({center:Lt.detail.coordinates,zoom:11,essential:!0})}function ui(){Pe!==!1&&Pe.remove()}Zc(async()=>{console.log(x),Me=new pl.Map({container:"map",maxZoom:x.zoommax?parseInt(x.zoommax):20,minZoom:x.zoommin?parseInt(x.zoommin):5,style:"mapbox://styles/labubulle/ckv0jeyg30qj414vot4szbxyg"}),Me.on("error",Lt=>{var vt;Lt.error&&(Lt.error.status===401||(vt=Lt.error.message)!=null&&vt.includes("CORS")||!Lt.error.status)&&(b(0,k=!0),b(1,D="Clef d'API Mapbox invalide. Veuillez vérifier votre configuration dans les paramètres du plugin."),b(2,De=!1))}),Me.on("load",Lt=>{ni(),Me.resize(),Me.easeTo({center:x.position.split(","),zoom:parseFloat(x.zoom)+1})})});function at(Lt,vt){let ai=vt=="amap"?"#DF542F":"#3A7C3C";Me.addSource(vt,{type:"geojson",data:{type:"FeatureCollection",features:de[vt].features},cluster:!0,clusterMaxZoom:9,clusterRadius:80}),Me.addLayer({id:vt+"_clusters",type:"circle",source:vt,filter:["has","point_count"],paint:{"circle-color":"#ffffff","circle-stroke-width":2,"circle-stroke-color":ai,"circle-radius":["step",["get","point_count"],10,10,20,30,20,100,30]}}),Me.on("click",vt+"_clusters",Mi=>{const $t=Me.queryRenderedFeatures(Mi.point,{layers:[vt+"_clusters"]}),nn=$t[0].properties.cluster_id;Me.getSource(vt).getClusterExpansionZoom(nn,(Gn,Tn)=>{Gn||Me.easeTo({center:$t[0].geometry.coordinates,zoom:Tn+1})})}),Me.addLayer({id:vt+"_cluster_count",type:"symbol",source:vt,filter:["has","point_count"],layout:{"text-field":"{point_count_abbreviated}","text-font":["DIN Offc Pro Bold","Arial Unicode MS Bold"],"text-size":14},paint:{"text-color":ai}}
1324),Me.addLayer({id:vt+"_unclustered_point",type:"circle",source:vt,filter:["!",["has","point_count"]],paint:{"circle-color":ai,"circle-radius":7,"circle-stroke-width":2,"circle-stroke-color":"#fff"}}),Me.on("click",vt+"_unclustered_point",Mi=>{console.log(Mi.features[0].properties);const $t=Mi.features[0].geometry.coordinates.slice(),nn=Mi.features[0].properties;for(;Math.abs(Mi.lngLat.lng-$t[0])>180;)$t[0]+=Mi.lngLat.lng>$t[0]?360:-360;Me.on("mouseenter",vt+"_unclustered_point",()=>{Me.getCanvas().style.cursor="pointer"}),Me.on("mouseleave",vt+"_unclustered_point",()=>{Me.getCanvas().style.cursor=""}),Me.easeTo({center:[$t[0],$t[1]-.02],zoom:12}),setTimeout(()=>{Pe=new pl.Popup().setLngLat($t).setDOMContent(Ct(nn)).addTo(Me)},500)})}function Ct(Lt){const vt=document.createElement("div");return new Vg({target:vt,props:{properties:Lt}}),vt}function Qt(Lt){b(3,se[Lt]=!se[Lt],se),se[Lt]?(Me.setLayoutProperty(Lt+"_clusters","visibility","visible"),Me.setLayoutProperty(Lt+"_cluster_count","visibility","visible"),Me.setLayoutProperty(Lt+"_unclustered_point","visibility","visible")):(Me.setLayoutProperty(Lt+"_clusters","visibility","none"),Me.setLayoutProperty(Lt+"_cluster_count","visibility","none"),Me.setLayoutProperty(Lt+"_unclustered_point","visibility","none"))}const Ke=()=>{document.getElementById("cap_map_wrapper").classList.toggle("fullscreen"),Me.resize()},Tt=()=>Ke(),$i=()=>Qt("amap"),St=()=>Qt("ferme");return S.$$set=Lt=>{b(14,x=la(la({},x),up(Lt)))},x=up(x),[k,D,De,se,Se,Qe,U,he,It,Re,gt,ui,Qt,Ke,x,Tt,$i,St]}class Yg extends bo{constructor(x){super(),vo(this,x,Kg,Xg,yo,{},null,[-1,-1])}}let da=document.getElementById("cap_map_container");return new Yg({target:da,props:{zoom:da.dataset.zoom,zoommax:da.dataset.zoommax,zoommin:da.dataset.zoommin,position:da.dataset.position,showstats:da.dataset.showstats!=="false"}})}();
1325//# sourceMappingURL=bundle.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.