MCPcopy Index your code
hub / github.com/plotly/plotly.py / I

Function I

plotly/package_data/plotly.min.js:2718–2718  ·  view source on GitHub ↗
(U)

Source from the content-addressed store, hash-verified

2716`),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join(`
2717`),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":`content: ""; cursor: pointer; position: absolute; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;`,"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E')`}}});var Yk=ye((Pxr,GVe)=>{"use strict";var NVe=Pr(),UVe=ka().defaultLine,gjt=Cc().attributes,mjt=ec(),yjt=pf().textposition,_jt=mc().overrideAll,xjt=vl().templatedArray,sJ=m1(),VVe=mjt({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});VVe.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var bjt=GVe.exports=_jt({_arrayAttrRegexps:[NVe.counterRegex("mapbox",".layers",!0)],domain:gjt({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:sJ.styleValuesMapbox.concat(sJ.styleValuesNonMapbox),dflt:sJ.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:xjt("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:UVe},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:UVe}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:VVe,textposition:NVe.extendFlat({},yjt,{arrayOk:!1})}})},"plot","from-root");bjt.uirevision={valType:"any",editType:"none"}});var $z=ye((Ixr,XVe)=>{"use strict";var{hovertemplateAttrs:wjt,texttemplateAttrs:Tjt,templatefallbackAttrs:HVe}=Ll(),Ajt=Pg(),Kk=tw(),k5=pf(),jVe=Yk(),Sjt=Gl(),Mjt=Tu(),dw=Ao().extendFlat,Ejt=mc().overrideAll,kjt=Yk(),WVe=Kk.line,C5=Kk.marker;XVe.exports=Ejt({lon:Kk.lon,lat:Kk.lat,cluster:{enabled:{valType:"boolean"},maxzoom:dw({},kjt.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:dw({},C5.opacity,{dflt:1})},mode:dw({},k5.mode,{dflt:"markers"}),text:dw({},k5.text,{}),texttemplate:Tjt({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:HVe({editType:"plot"}),hovertext:dw({},k5.hovertext,{}),line:{color:WVe.color,width:WVe.width},connectgaps:k5.connectgaps,marker:dw({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:C5.opacity,size:C5.size,sizeref:C5.sizeref,sizemin:C5.sizemin,sizemode:C5.sizemode},Mjt("marker")),fill:Kk.fill,fillcolor:Ajt(),textfont:jVe.layers.symbol.textfont,textposition:jVe.layers.symbol.textposition,below:{valType:"string"},selected:{marker:k5.selected.marker},unselected:{marker:k5.unselected.marker},hoverinfo:dw({},Sjt.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:wjt(),hovertemplatefallback:HVe()},"calc","nested")});var lJ=ye((Rxr,ZVe)=>{"use strict";var Cjt=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];ZVe.exports={isSupportedFont:function(e){return Cjt.indexOf(e)!==-1}}});var JVe=ye((Dxr,KVe)=>{"use strict";var Jk=Pr(),uJ=Ru(),Ljt=$p(),Pjt=D0(),Ijt=F0(),Rjt=Fg(),YVe=$z(),Djt=lJ().isSupportedFont;KVe.exports=function(t,r,n,i){function a(p,k){return Jk.coerce(t,r,YVe,p,k)}function o(p,k){return Jk.coerce2(t,r,YVe,p,k)}var s=Fjt(t,r,a);if(!s){r.visible=!1;return}if(a("text"),a("texttemplate"),a("texttemplatefallback"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),a("mode"),a("below"),uJ.hasMarkers(r)){Ljt(t,r,n,i,a,{noLine:!0,noAngle:!0}),a("marker.allowoverlap"),a("marker.angle");var l=r.marker;l.symbol!=="circle"&&(Jk.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),Jk.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}uJ.hasLines(r)&&(Pjt(t,r,n,i,a,{noDash:!0}),a("connectgaps"));var u=o("cluster.maxzoom"),c=o("cluster.step"),f=o("cluster.color",r.marker&&r.marker.color||n),h=o("cluster.size"),d=o("cluster.opacity"),v=u!==!1||c!==!1||f!==!1||h!==!1||d!==!1,m=a("cluster.enabled",v);if(m||uJ.hasText(r)){var b=i.font.family;Ijt(t,r,i,a,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:Djt(b)?b:"Open Sans Regular",weight:i.font.weight,style:i.font.style,size:i.font.size,color:i.font.color}})}a("fill"),r.fill!=="none"&&Rjt(t,r,n,a),Jk.coerceSelectionMarkerOpacity(r,a)};function Fjt(e,t,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return t._length=a,a}});var cJ=ye((Fxr,QVe)=>{"use strict";var $Ve=ho();QVe.exports=function(t,r,n){var i={},a=n[r.subplot]._subplot,o=a.mockAxis,s=t.lonlat;return i.lonLabel=$Ve.tickText(o,o.c2l(s[0]),!0).text,i.latLabel=$Ve.tickText(o,o.c2l(s[1]),!0).text,i}});var fJ=ye((zxr,tGe)=>{"use strict";var eGe=Pr();tGe.exports=function(t,r){var n=t.split(" "),i=n[0],a=n[1],o=eGe.isArrayOrTypedArray(r)?eGe.mean(r):r,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(i){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l;break}switch(a){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s;break}var f;return u[0]&&u[1]?f=u.join("-"):u[0]?f=u[0]:u[1]?f=u[1]:f="center",{anchor:f,offset:c}}});var sGe=ye((qxr,oGe)=>{"use strict";var nGe=Eo(),ov=Pr(),zjt=fs().BADNUM,e7=fx(),rGe=tc(),qjt=So(),Ojt=B3(),t7=Ru(),Bjt=lJ().isSupportedFont,Njt=fJ(),Ujt=ip().appendArrayPointValue,Vjt=Zl().NEWLINES,Gjt=Zl().BR_TAG_ALL;oGe.exports=function(t,r){var n=r[0].trace,i=n.visible===!0&&n._length!==0,a=n.fill!=="none",o=t7.hasLines(n),s=t7.hasMarkers(n),l=t7.hasText(n),u=s&&n.marker.symbol==="circle",c=s&&n.marker.symbol!=="circle",f=n.cluster&&n.cluster.enabled,h=Qz("fill"),d=Qz("line"),v=Qz("circle"),m=Qz("symbol"),b={fill:h,line:d,circle:v,symbol:m};if(!i)return b;var p;if((a||o)&&(p=e7.calcTraceToLineCoords(r)),a&&(h.geojson=e7.makePolygon(p),h.layout.visibility="visible",ov.extendFlat(h.paint,{"fill-color":n.fillcolor})),o&&(d.geojson=e7.makeLine(p),d.layout.visibility="visible",ov.extendFlat(d.paint,{"line-width":n.line.width,"line-color":n.line.color,"line-opacity":n.opacity})),u){var k=Hjt(r);v.geojson=k.geojson,v.layout.visibility="visible",f&&(v.filter=["!",["has","point_count"]],b.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":dJ(n.cluster.color,n.cluster.step),"circle-radius":dJ(n.cluster.size,n.cluster.step),"circle-opacity":dJ(n.cluster.opacity,n.cluster.step)}},b.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":iGe(n),"text-size":12}}),ov.extendFlat(v.paint,{"circle-color":k.mcc,"circle-radius":k.mrc,"circle-opacity":k.mo})}if(u&&f&&(v.filter=["!",["has","point_count"]]),(c||l)&&(m.geojson=jjt(r,t),ov.extendFlat(m.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),c&&(ov.extendFlat(m.layout,{"icon-size":n.marker.size/10}),"angle"in n.marker&&n.marker.angle!=="auto"&&ov.extendFlat(m.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),m.layout["icon-allow-overlap"]=n.marker.allowoverlap,ov.extendFlat(m.paint,{"icon-opacity":n.opacity*n.marker.opacity,"icon-color":n.marker.color})),l)){var M=(n.marker||{}).size,T=Njt(n.textposition,M);ov.extendFlat(m.layout,{"text-size":n.textfont.size,"text-anchor":T.anchor,"text-offset":T.offset,"text-font":iGe(n)}),ov.extendFlat(m.paint,{"text-color":n.textfont.color,"text-opacity":n.opacity})}return b};function Qz(e){return{type:e,geojson:e7.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function Hjt(e){var t=e[0].trace,r=t.marker,n=t.selectedpoints,i=ov.isArrayOrTypedArray(r.color),a=ov.isArrayOrTypedArray(r.size),o=ov.isArrayOrTypedArray(r.opacity),s;function l(M){return t.opacity*M}function u(M){return M/2}var c;i&&(rGe.hasColorscale(t,"marker")?c=rGe.makeColorScaleFuncFromTrace(r):c=ov.identity);var f;a&&(f=Ojt(t));var h;o&&(h=function(M){var T=nGe(M)?+ov.constrain(M,0,1):0;return l(T)});var d=[];for(s=0;s<e.length;s++){var v=e[s],m=v.lonlat;if(!aGe(m)){var b={};c&&(b.mcc=v.mcc=c(v.mc)),f&&(b.mrc=v.mrc=f(v.ms)),h&&(b.mo=h(v.mo)),n&&(b.selected=v.selected||0),d.push({type:"Feature",id:s+1,geometry:{type:"Point",coordinates:m},properties:b})}}var p;if(n)for(p=qjt.makeSelectedPointStyleFns(t),s=0;s<d.length;s++){var k=d[s].properties;p.selectedOpacityFn&&(k.mo=l(p.selectedOpacityFn(k))),p.selectedColorFn&&(k.mcc=p.selectedColorFn(k)),p.selectedSizeFn&&(k.mrc=p.selectedSizeFn(k))}return{geojson:{type:"FeatureCollection",features:d},mcc:i||p&&p.selectedColorFn?{type:"identity",property:"mcc"}:r.color,mrc:a||p&&p.selectedSizeFn?{type:"identity",property:"mrc"}:u(r.size),mo:o||p&&p.selectedOpacityFn?{type:"identity",property:"mo"}:l(r.opacity)}}function jjt(e,t){for(var r=t._fullLayout,n=e[0].trace,i=n.marker||{},a=i.symbol,o=i.angle,s=a!=="circle"?hJ(a):r7,l=o!=="auto"?hJ(o,!0):r7,u=t7.hasText(n)?hJ(n.text):r7,c=[],f=0;f<e.length;f++){var h=e[f];if(!aGe(h.lonlat)){var d=n.texttemplate,v;if(d){var m=Array.isArray(d)?d[f]||"":d,b=n._module.formatLabels(h,n,r),p={};Ujt(p,n,h.i),v=ov.texttemplateString({data:[p,h,n._meta],fallback:n.texttemplatefallback,labels:b,locale:r._d3locale,template:m})}else v=u(f);v&&(v=v.replace(Vjt,"").replace(Gjt,`
2718`)),c.push({type:"Feature",geometry:{type:"Point",coordinates:h.lonlat},properties:{symbol:s(f),angle:l(f),text:v}})}}return{type:"FeatureCollection",features:c}}function hJ(e,t){return ov.isArrayOrTypedArray(e)?t?function(r){return nGe(e[r])?+e[r]:0}:function(r){return e[r]}:e?function(){return e}:r7}function r7(){return""}function aGe(e){return e[0]===zjt}function dJ(e,t){var r;if(ov.isArrayOrTypedArray(e)&&ov.isArrayOrTypedArray(t)){r=["step",["get","point_count"],e[0]];for(var n=1;n<e.length;n++)r.push(t[n-1],e[n])}else r=e;return r}function iGe(e){var t=e.textfont,r=t.family,n=t.style,i=t.weight,a=r.split(" "),o=a[a.length-1]==="Italic";o&&a.pop(),o=o||n==="italic";var s=a.join(" ");i==="bold"&&a.indexOf("Bold")===-1?s+=" Bold":i<=1e3&&(a[0]==="Metropolis"?(s="Metropolis",i>850?s+=" Black":i>750?s+=" Extra Bold":i>650?s+=" Bold":i>550?s+=" Semi Bold":i>450?s+=" Medium":i>350?s+=" Regular":i>250?s+=" Light":i>150?s+=" Extra Light":s+=" Thin"):a.slice(0,2).join(" ")==="Open Sans"?(s="Open Sans",i>750?s+=" Extrabold":i>650?s+=" Bold":i>550?s+=" Semibold":i>350?s+=" Regular":s+=" Light"):a.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(s="Klokantech Noto Sans",a[3]==="CJK"&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),s==="Open Sans Regular Italic"?s="Open Sans Italic":s==="Open Sans Regular Bold"?s="Open Sans Bold":s==="Open Sans Regular Bold Italic"?s="Open Sans Bold Italic":s==="Klokantech Noto Sans Regular Italic"&&(s="Klokantech Noto Sans Italic"),Bjt(s)||(s=r);var l=s.split(", ");return l}});var fGe=ye((Oxr,cGe)=>{"use strict";var Wjt=Pr(),lGe=sGe(),L5=m1().traceLayerPrefix,ng={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function uGe(e,t,r,n){this.type="scattermapbox",this.subplot=e,this.uid=t,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+t+"-fill",line:"source-"+t+"-line",circle:"source-"+t+"-circle",symbol:"source-"+t+"-symbol",cluster:"source-"+t+"-circle",clusterCount:"source-"+t+"-circle"},this.layerIds={fill:L5+t+"-fill",line:L5+t+"-line",circle:L5+t+"-circle",symbol:L5+t+"-symbol",cluster:L5+t+"-cluster",clusterCount:L5+t+"-cluster-count"},this.below=null}var $k=uGe.prototype;$k.addSource=function(e,t,r){var n={type:"geojson",data:t.geojson};r&&r.enabled&&Wjt.extendFlat(n,{cluster:!0,clusterMaxZoom:r.maxzoom});var i=this.subplot.map.getSource(this.sourceIds[e]);i?i.setData(t.geojson):this.subplot.map.addSource(this.sourceIds[e],n)};$k.setSourceData=function(e,t){this.subplot.map.getSource(this.sourceIds[e]).setData(t.geojson)};$k.addLayer=function(e,t,r){var n={type:t.type,id:this.layerIds[e],source:this.sourceIds[e],layout:t.layout,paint:t.paint};t.filter&&(n.filter=t.filter);for(var i=this.layerIds[e],a,o=this.subplot.getMapLayers(),s=0;s<o.length;s++)if(o[s].id===i){a=!0;break}a?(this.subplot.setOptions(i,"setLayoutProperty",n.layout),n.layout.visibility==="visible"&&this.subplot.setOptions(i,"setPaintProperty",n.paint)):this.subplot.addLayer(n,r)};$k.update=function(t){var r=t[0].trace,n=this.subplot,i=n.map,a=lGe(n.gd,t),o=n.belowLookup["trace-"+this.uid],s=!!(r.cluster&&r.cluster.enabled),l=!!this.clusterEnabled,u=this;function c(M){M||u.addSource("circle",a.circle,r.cluster);for(var T=ng.cluster,L=0;L<T.length;L++){var x=T[L],C=a[x];u.addLayer(x,C,o)}}function f(M){for(var T=ng.cluster,L=T.length-1;L>=0;L--){var x=T[L];i.removeLayer(u.layerIds[x])}M||i.removeSource(u.sourceIds.circle)}function h(M){for(var T=ng.nonCluster,L=0;L<T.length;L++){var x=T[L],C=a[x];M||u.addSource(x,C),u.addLayer(x,C,o)}}function d(M){for(var T=ng.nonCluster,L=T.length-1;L>=0;L--){var x=T[L];i.removeLayer(u.layerIds[x]),M||i.removeSource(u.sourceIds[x])}}function v(M){l?f(M):d(M)}function m(M){s?c(M):h(M)}function b(){for(var M=s?ng.cluster:ng.nonCluster,T=0;T<M.length;T++){var L=M[T],x=a[L];x&&(n.setOptions(u.layerIds[L],"setLayoutProperty",x.layout),x.layout.visibility==="visible"&&(L!=="cluster"&&u.setSourceData(L,x),n.setOptions(u.layerIds[L],"setPaintProperty",x.paint)))}}var p=this.isHidden,k=r.visible!==!0;k?p||v():p?k||m():l!==s?(v(),m()):(this.below!==o&&(v(!0),m(!0)),b()),this.clusterEnabled=s,this.isHidden=k,this.below=o,t[0].trace._glTrace=this};$k.dispose=function(){for(var t=this.subplot.map,r=this.clusterEnabled?ng.cluster:ng.nonCluster,n=r.length-1;n>=0;n--){var i=r[n];t.removeLayer(this.layerIds[i]),t.removeSource(this.sourceIds[i])}};cGe.exports=function(t,r){var n=r[0].trace,i=n.cluster&&n.cluster.enabled,a=n.visible!==!0,o=new uGe(t,n.uid,i,a),s=lGe(t.gd,r),l=o.below=t.belowLookup["trace-"+n.uid],u,c,f;if(i)for(o.addSource("circle",s.circle,n.cluster),u=0;u<ng.cluster.length;u++)c=ng.cluster[u],f=s[c],o.addLayer(c,f,l);else for(u=0;u<ng.nonCluster.length;u++)c=ng.nonCluster[u],f=s[c],o.addSource(c,f,n.cluster),o.addLayer(c,f,l);return r[0].trace._glTrace=o,o}});var i7=ye((Bxr,dGe)=>{"use strict";var Xjt=ef(),vJ=Pr(),Zjt=yT(),Yjt=vJ.fillText,Kjt=fs().BADNUM,Jjt=m1().traceLayerPrefix;function $jt(e,t,r){var n=e.cd,i=n[0].trace,a=e.xa,o=e.ya,s=e.subplot,l=[],u=Jjt+i.uid+"-circle",c=i.cluster&&i.cluster.enabled;if(c){var f=s.map.queryRenderedFeatures(null,{layers:[u]});l=f.map(function(S){return S.id})}var h=t>=0?Math.floor((t+180)/360):Math.ceil((t-180)/360),d=h*360,v=t-d;function m(S){var g=S.lonlat;if(g[0]===Kjt||c&&l.indexOf(S.i+1)===-1)return 1/0;var P=vJ.modHalf(g[0],360),E=g[1],z=s.project([P,E]),q=z.x-a.c2p([v,E]),V=z.y-o.c2p([P,r]),G=Math.max(3,S.mrc||0);return Math.max(Math.sqrt(q*q+V*V)-G,1-3/G)}if(Xjt.getClosest(n,m,e),e.index!==!1){var b=n[e.index],p=b.lonlat,k=[vJ.modHalf(p[0],360)+d,p[1]],M=a.c2p(k),T=o.c2p(k),L=b.mrc||1;e.x0=M-L,e.x1=M+L,e.y0=T-L,e.y1=T+L;var x={};x[i.subplot]={_subplot:s};var C=i._module.formatLabels(b,i,x);return e.lonLabel=C.lonLabel,e.latLabel=C.latLabel,e.color=Zjt(i,b),e.extraText=hGe(i,b,n[0].t.labels),e.hovertemplate=i.hovertemplate,[e]}}function hGe(e,t,r){if(e.hovertemplate)return;var n=t.hi||e.hoverinfo,i=n.split("+"),a=i.indexOf("all")!==-1,o=i.indexOf("lon")!==-1,s=i.indexOf("lat")!==-1,l=t.lonlat,u=[];function c(f){return f+"\xB0"}return a||o&&s?u.push("("+c(l[1])+", "+c(l[0])+")"):o?u.push(r.lon+c(l[0])):s&&u.push(r.lat+c(l[1])),(a||i.indexOf("text")!==-1)&&Yjt(t,e,u),u.join("<br>")}dGe.exports={hoverPoints:$jt,getExtraText:hGe}});var pGe=ye((Nxr,vGe)=>{"use strict";vGe.exports=function(t,r){return t.lon=r.lon,t.lat=r.lat,t}});var mGe=ye((Uxr,gGe)=>{"use strict";var Qjt=Pr(),eWt=Ru(),tWt=fs().BADNUM;gGe.exports=function(t,r){var n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s=n[0].trace,l;if(!eWt.hasMarkers(s))return[];if(r===!1)for(l=0;l<n.length;l++)n[l].selected=0;else for(l=0;l<n.length;l++){var u=n[l],c=u.lonlat;if(c[0]!==tWt){var f=[Qjt.modHalf(c[0],360),c[1]],h=[i.c2p(f),a.c2p(f)];r.contains(h,null,l,t)?(o.push({pointNumber:l,lon:c[0],lat:c[1]}),u.selected=1):u.selected=0}}return o}});var mJ=ye((pJ,gJ)=>{(function(e,t){typeof pJ=="object"&&typeof gJ!="undefined"?gJ.exports=t():(e=e||self,e.mapboxgl=t())})(pJ,function(){"use strict";var e,t,r;function n(i,a){if(!e)e=a;else if(!t)t=a;else{var o="var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk);",s={};e(s),r=a(s),typeof window!="undefined"&&(r.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}}return n(["exports"],function(i){"use strict";function a(y,_){return _={exports:{}},y(_,_.exports),_.exports}var o="1.13.4",s=l;function l(y,_,I,U){this.cx=3*y,this.bx=3*(I-y)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*_,this.by=3*(U-_)-this.cy,this.ay=1-this.cy-this.by,this.p1x=y,this.p1y=U,this.p2x=I,this.p2y=U}l.prototype.sampleCurveX=function(y){return((this.ax*y+this.bx)*y+this.cx)*y},l.prototype.sampleCurveY=function(y){return((this.ay*y+this.by)*y+this.cy)*y},l.prototype.sampleCurveDerivativeX=function(y){return(3*this.ax*y+2*this.bx)*y+this.cx},l.prototype.solveCurveX=function(y,_){typeof _=="undefined"&&(_=1e-6);var I,U,$,oe,he;for($=y,he=0;he<8;he++){if(oe=this.sampleCurveX($)-y,Math.abs(oe)<_)return $;var De=this.sampleCurveDerivativeX($);if(Math.abs(De)<1e-6)break;$=$-oe/De}if(I=0,U=1,$=y,$<I)return I;if($>U)return U;for(;I<U;){if(oe=this.sampleCurveX($),Math.abs(oe-y)<_)return $;y>oe?I=$:U=$,$=(U-I)*.5+I}return $},l.prototype.solve=function(y,_){return this.sampleCurveY(this.solveCurveX(y,_))};var u=c;function c(y,_){this.x=y,this.y=_}c.prototype={clone:function(){return new c(this.x,this.y)},add:function(y){return this.clone()._add(y)},sub:function(y){return this.clone()._sub(y)},multByPoint:function(y){return this.clone()._multByPoint(y)},divByPoint:function(y){return this.clone()._divByPoint(y)},mult:function(y){return this.clone()._mult(y)},div:function(y){return this.clone()._div(y)},rotate:function(y){return this.clone()._rotate(y)},rotateAround:function(y,_){return this.clone()._rotateAround(y,_)},matMult:function(y){return this.clone()._matMult(y)},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(y){return this.x===y.x&&this.y===y.y},dist:function(y){return Math.sqrt(this.distSqr(y))},distSqr:function(y){var _=y.x-this.x,I=y.y-this.y;return _*_+I*I},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(y){return Math.atan2(this.y-y.y,this.x-y.x)},angleWith:function(y){return this.angleWithSep(y.x,y.y)},angleWithSep:function(y,_){return Math.atan2(this.x*_-this.y*y,this.x*y+this.y*_)},_matMult:function(y){var _=y[0]*this.x+y[1]*this.y,I=y[2]*this.x+y[3]*this.y;return this.x=_,this.y=I,this},_add:function(y){return this.x+=y.x,this.y+=y.y,this},_sub:function(y){return this.x-=y.x,this.y-=y.y,this},_mult:function(y){return this.x*=y,this.y*=y,this},_div:function(y){return this.x/=y,this.y/=y,this},_multByPoint:function(y){return this.x*=y.x,this.y*=y.y,this},_divByPoint:function(y){return this.x/=y.x,this.y/=y.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var y=this.y;return this.y=this.x,this.x=-y,this},_rotate:function(y){var _=Math.cos(y),I=Math.sin(y),U=_*this.x-I*this.y,$=I*this.x+_*this.y;return this.x=U,this.y=$,this},_rotateAround:function(y,_){var I=Math.cos(y),U=Math.sin(y),$=_.x+I*(this.x-_.x)-U*(this.y-_.y),oe=_.y+U*(this.x-_.x)+I*(this.y-_.y);return this.x=$,this.y=oe,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},c.convert=function(y){return y instanceof c?y:Array.isArray(y)?new c(y[0],y[1]):y};var f=typeof self!="undefined"?self:{};function h(y,_){if(Array.isArray(y)){if(!Array.isArray(_)||y.length!==_.length)return!1;for(var I=0;I<y.length;I++)if(!h(y[I],_[I]))return!1;return!0}if(typeof y=="object"&&y!==null&&_!==null){if(typeof _!="object")return!1;var U=Object.keys(y);if(U.length!==Object.keys(_).length)return!1;for(var $ in y)if(!h(y[$],_[$]))return!1;return!0}return y===_}var d=Math.pow(2,53)-1;function v(y){if(y<=0)return 0;if(y>=1)return 1;var _=y*y,I=_*y;return 4*(y<.5?I:3*(y-_)+I-.75)}function m(y,_,I,U){var $=new s(y,_,I,U);return function(oe){return $.solve(oe)}}var b=m(.25,.1,.25,1);function p(y,_,I){return Math.min(I,Math.max(_,y))}function k(y,_,I){var U=I-_,$=((y-_)%U+U)%U+_;return $===_?I:$}function M(y,_,I){if(!y.length)return I(null,[]);var U=y.length,$=new Array(y.length),oe=null;y.forEach(function(he,De){_(he,function(it,yt){it&&(oe=it),$[De]=yt,--U===0&&I(oe,$)})})}function T(y){var _=[];for(var I in y)_.push(y[I]);return _}function L(y,_){var I=[];for(var U in y)U in _||I.push(U);return I}function x(y){for(var _=[],I=arguments.length-1;I-- >0;)_[I]=arguments[I+1];for(var U=0,$=_;U<$.length;U+=1){var oe=$[U];for(var he in oe)y[he]=oe[he]}return y}function C(y,_){for(var I={},U=0;U<_.length;U++){var $=_[U];$ in y&&(I[$]=y[$])}return I}var S=1;function g(){return S++}function P(){function y(_){return _?(_^Math.random()*16>>_/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,y)}return y()}function E(y){return y<=1?1:Math.pow(2,Math.ceil(Math.log(y)/Math.LN2))}function z(y){return y?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(y):!1}function q(y,_){y.forEach(function(I){_[I]&&(_[I]=_[I].bind(_))})}function V(y,_){return y.indexOf(_,y.length-_.length)!==-1}function G(y,_,I){var U={};for(var $ in y)U[$]=_.call(I||this,y[$],$,y);return U}function Z(y,_,I){var U={};for(var $ in y)_.call(I||this,y[$],$,y)&&(U[$]=y[$]);return U}function j(y){return Array.isArray(y)?y.map(j):typeof y=="object"&&y?G(y,j):y}function N(y,_){for(var I=0;I<y.length;I++)if(_.indexOf(y[I])>=0)return!0;return!1}var H={};function ie(y){H[y]||(typeof console!="undefined"&&console.warn(y),H[y]=!0)}function ae(y,_,I){return(I.y-y.y)*(_.x-y.x)>(_.y-y.y)*(I.x-y.x)}function _e(y){for(var _=0,I=0,U=y.length,$=U-1,oe=void 0,he=void 0;I<U;$=I++)oe=y[I],he=y[$],_+=(he.x-oe.x)*(oe.y+he.y);return _}function Ee(y){var _=y[0],I=y[1],U=y[2];return I+=90,I*=Math.PI/180,U*=Math.PI/180,{x:_*Math.cos(I)*Math.sin(U),y:_*Math.sin(I)*Math.sin(U),z:_*Math.cos(U)}}function Ce(){return typeof WorkerGlobalScope!="undefined"&&typeof self!="undefined"&&self instanceof WorkerGlobalScope}function ge(y){var _=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,I={};if(y.replace(_,function($,oe,he,De){var it=he||De;return I[oe]=it?it.toLowerCase():!0,""}),I["max-age"]){var U=parseInt(I["max-age"],10);isNaN(U)?delete I["max-age"]:I["max-age"]=U}return I}var re=null;function Se(y){if(re==null){var _=y.navigator?y.navigator.userAgent:null;re=!!y.safari||!!(_&&(/\b(iPad|iPhone|iPod)\b/.test(_)||_.match("Safari")&&!_.match("Chrome")))}return re}function ke(y){try{var _=f[y];return _.setItem("_mapbox_test_",1),_.removeItem("_mapbox_test_"),!0}catch(I){return!1}}function be(y){return f.btoa(encodeURIComponent(y).replace(/%([0-9A-F]{2})/g,function(_,I){return String.fromCharCode(+("0x"+I))}))}function Be(y){return decodeURIComponent(f.atob(y).split("").map(function(_){return"%"+("00"+_.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var Le=f.performance&&f.performance.now?f.performance.now.bind(f.performance):Date.now.bind(Date),me=f.requestAnimationFrame||f.mozRequestAnimationFrame||f.webkitRequestAnimationFrame||f.msRequestAnimationFrame,Pe=f.cancelAnimationFrame||f.mozCancelAnimationFrame||f.webkitCancelAnimationFrame||f.msCancelAnimationFrame,ce,He,lt={now:Le,frame:function(_){var I=me(_);return{cancel:function(){return Pe(I)}}},getImageData:function(_,I){I===void 0&&(I=0);var U=f.document.createElement("canvas"),$=U.getContext("2d");if(!$)throw new Error("failed to create canvas 2d context");return U.width=_.width,U.height=_.height,$.drawImage(_,0,0,_.width,_.height),$.getImageData(-I,-I,_.width+2*I,_.height+2*I)},resolveURL:function(_){return ce||(ce=f.document.createElement("a")),ce.href=_,ce.href},hardwareConcurrency:f.navigator&&f.navigator.hardwareConcurrency||4,get devicePixelRatio(){return f.devicePixelRatio},get prefersReducedMotion(){return f.matchMedia?(He==null&&(He=f.matchMedia("(prefers-reduced-motion: reduce)")),He.matches):!1}},mt={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Ht={supported:!1,testSupport:rr},at,ct=!1,ar,Vt=!1;f.document&&(ar=f.document.createElement("img"),ar.onload=function(){at&&tt(at),at=null,Vt=!0},ar.onerror=function(){ct=!0,at=null},ar.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function rr(y){ct||!ar||(Vt?tt(y):at=y)}function tt(y){var _=y.createTexture();y.bindTexture(y.TEXTURE_2D,_);try{if(y.texImage2D(y.TEXTURE_2D,0,y.RGBA,y.RGBA,y.UNSIGNED_BYTE,ar),y.isContextLost())return;Ht.supported=!0}catch(I){}y.deleteTexture(_),ct=!0}var je="01";function Ue(){for(var y="1",_="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",I="",U=0;U<10;U++)I+=_[Math.floor(Math.random()*62)];var $=12*60*60*1e3,oe=[y,je,I].join(""),he=Date.now()+$;return{token:oe,tokenExpiresAt:he}}var Ae=function(_,I){this._transformRequestFn=_,this._customAccessToken=I,this._createSkuToken()};Ae.prototype._createSkuToken=function(){var _=Ue();this._skuToken=_.token,this._skuTokenExpiresAt=_.tokenExpiresAt},Ae.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Ae.prototype.transformRequest=function(_,I){return this._transformRequestFn?this._transformRequestFn(_,I)||{url:_}:{url:_}},Ae.prototype.normalizeStyleURL=function(_,I){if(!rt(_))return _;var U=jt(_);return U.path="/styles/v1"+U.path,this._makeAPIURL(U,this._customAccessToken||I)},Ae.prototype.normalizeGlyphsURL=function(_,I){if(!rt(_))return _;var U=jt(_);return U.path="/fonts/v1"+U.path,this._makeAPIURL(U,this._customAccessToken||I)},Ae.prototype.normalizeSourceURL=function(_,I){if(!rt(_))return _;var U=jt(_);return U.path="/v4/"+U.authority+".json",U.params.push("secure"),this._makeAPIURL(U,this._customAccessToken||I)},Ae.prototype.normalizeSpriteURL=function(_,I,U,$){var oe=jt(_);return rt(_)?(oe.path="/styles/v1"+oe.path+"/sprite"+I+U,this._makeAPIURL(oe,this._customAccessToken||$)):(oe.path+=""+I+U,or(oe))},Ae.prototype.normalizeTileURL=function(_,I){if(this._isSkuTokenExpired()&&this._createSkuToken(),_&&!rt(_))return _;var U=jt(_),$=/(\.(png|jpg)\d*)(?=$)/,oe=/^.+\/v4\//,he=lt.devicePixelRatio>=2||I===512?"@2x":"",De=Ht.supported?".webp":"$1";U.path=U.path.replace($,""+he+De),U.path=U.path.replace(oe,"/"),U.path="/v4"+U.path;var it=this._customAccessToken||Et(U.params)||mt.ACCESS_TOKEN;return mt.REQUIRE_ACCESS_TOKEN&&it&&this._skuToken&&U.params.push("sku="+this._skuToken),this._makeAPIURL(U,it)},Ae.prototype.canonicalizeTileURL=function(_,I){var U="/v4/",$=/\.[\w]+$/,oe=jt(_);if(!oe.path.match(/(^\/v4\/)/)||!oe.path.match($))return _;var he="mapbox://tiles/";he+=oe.path.replace(U,"");var De=oe.params;return I&&(De=De.filter(function(it){return!it.match(/^access_token=/)})),De.length&&(he+="?"+De.join("&")),he},Ae.prototype.canonicalizeTileset=function(_,I){for(var U=I?rt(I):!1,$=[],oe=0,he=_.tiles||[];oe<he.length;oe+=1){var De=he[oe];Tt(De)?$.push(this.canonicalizeTileURL(De,U)):$.push(De)}return $},Ae.prototype._makeAPIURL=function(_,I){var U="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",$=jt(mt.API_URL);if(_.protocol=$.protocol,_.authority=$.authority,_.protocol==="http"){var oe=_.params.indexOf("secure");oe>=0&&_.params.splice(oe,1)}if($.path!=="/"&&(_.path=""+$.path+_.path),!mt.REQUIRE_ACCESS_TOKEN)return or(_);if(I=I||mt.ACCESS_TOKEN,!I)throw new Error("An API access token is required to use Mapbox GL. "+U);if(I[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+U);return _.params=_.params.filter(function(he){return he.indexOf("access_token")===-1}),_.params.push("access_token="+I),or(_)};function rt(y){return y.indexOf("mapbox:")===0}var St=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Tt(y){return St.test(y)}function dt(y){return y.indexOf("sku=")>0&&Tt(y)}function Et(y){for(var _=0,I=y;_<I.length;_+=1){var U=I[_],$=U.match(/^access_token=(.*)$/);if($)return $[1]}return null}var pt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function jt(y){var _=y.match(pt);if(!_)throw new Error("Unable to parse URL object");return{protocol:_[1],authority:_[2],path:_[3]||"/",params:_[4]?_[4].split("&"):[]}}function or(y){var _=y.params.length?"?"+y.params.join("&"):"";return y.protocol+"://"+y.authority+y.path+_}var mr="mapbox.eventData";function Ar(y){if(!y)return null;var _=y.split(".");if(!_||_.length!==3)return null;try{var I=JSON.parse(Be(_[1]));return I}catch(U){return null}}var ei=function(_){this.type=_,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};ei.prototype.getStorageKey=function(_){var I=Ar(mt.ACCESS_TOKEN),U="";return I&&I.u?U=be(I.u):U=mt.ACCESS_TOKEN||"",_?mr+"."+_+":"+U:mr+":"+U},ei.prototype.fetchEventData=function(){var _=ke("localStorage"),I=this.getStorageKey(),U=this.getStorageKey("uuid");if(_)try{var $=f.localStorage.getItem(I);$&&(this.eventData=JSON.parse($));var oe=f.localStorage.getItem(U);oe&&(this.anonId=oe)}catch(he){ie("Unable to read from LocalStorage")}},ei.prototype.saveEventData=function(){var _=ke("localStorage"),I=this.getStorageKey(),U=this.getStorageKey("uuid");if(_)try{f.localStorage.setItem(U,this.anonId),Object.keys(this.eventData).length>=1&&f.localStorage.setItem(I,JSON.stringify(this.eventData))}catch($){ie("Unable to write to LocalStorage")}},ei.prototype.processRequests=function(_){},ei.prototype.postEvent=function(_,I,U,$){var oe=this;if(mt.EVENTS_URL){var he=jt(mt.EVENTS_URL);he.params.push("access_token="+($||mt.ACCESS_TOKEN||""));var De={event:this.type,created:new Date(_).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:o,skuId:je,userId:this.anonId},it=I?x(De,I):De,yt={url:or(he),headers:{"Content-Type":"text/plain"},body:JSON.stringify([it])};this.pendingRequest=$r(yt,function(Lt){oe.pendingRequest=null,U(Lt),oe.saveEventData(),oe.processRequests($)})}},ei.prototype.queueRequest=function(_,I){this.queue.push(_),this.processRequests(I)};var qr=function(y){function _(){y.call(this,"map.load"),this.success={},this.skuToken=""}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.postMapLoadEvent=function(U,$,oe,he){this.skuToken=oe,(mt.EVENTS_URL&&he||mt.ACCESS_TOKEN&&Array.isArray(U)&&U.some(function(De){return rt(De)||Tt(De)}))&&this.queueRequest({id:$,timestamp:Date.now()},he)},_.prototype.processRequests=function(U){var $=this;if(!(this.pendingRequest||this.queue.length===0)){var oe=this.queue.shift(),he=oe.id,De=oe.timestamp;he&&this.success[he]||(this.anonId||this.fetchEventData(),z(this.anonId)||(this.anonId=P()),this.postEvent(De,{skuToken:this.skuToken},function(it){it||he&&($.success[he]=!0)},U))}},_}(ei),jr=function(y){function _(I){y.call(this,"appUserTurnstile"),this._customAccessToken=I}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.postTurnstileEvent=function(U,$){mt.EVENTS_URL&&mt.ACCESS_TOKEN&&Array.isArray(U)&&U.some(function(oe){return rt(oe)||Tt(oe)})&&this.queueRequest(Date.now(),$)},_.prototype.processRequests=function(U){var $=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var oe=Ar(mt.ACCESS_TOKEN),he=oe?oe.u:mt.ACCESS_TOKEN,De=he!==this.eventData.tokenU;z(this.anonId)||(this.anonId=P(),De=!0);var it=this.queue.shift();if(this.eventData.lastSuccess){var yt=new Date(this.eventData.lastSuccess),Lt=new Date(it),sr=(it-this.eventData.lastSuccess)/(24*60*60*1e3);De=De||sr>=1||sr<-1||yt.getDate()!==Lt.getDate()}else De=!0;if(!De)return this.processRequests();this.postEvent(it,{"enabled.telemetry":!1},function(gr){gr||($.eventData.lastSuccess=it,$.eventData.tokenU=he)},U)}},_}(ei),gt=new jr,Ge=gt.postTurnstileEvent.bind(gt),Je=new qr,We=Je.postMapLoadEvent.bind(Je),et="mapbox-tiles",xt=500,At=50,Kt=1e3*60*7,Qt;function Mr(){f.caches&&!Qt&&(Qt=f.caches.open(et))}var Gr;function Ir(y,_){if(Gr===void 0)try{new Response(new ReadableStream),Gr=!0}catch(I){Gr=!1}Gr?_(y.body):y.blob().then(_)}function Yr(y,_,I){if(Mr(),!!Qt){var U={status:_.status,statusText:_.statusText,headers:new f.Headers};_.headers.forEach(function(he,De){return U.headers.set(De,he)});var $=ge(_.headers.get("Cache-Control")||"");if(!$["no-store"]){$["max-age"]&&U.headers.set("Expires",new Date(I+$["max-age"]*1e3).toUTCString());var oe=new Date(U.headers.get("Expires")).getTime()-I;oe<Kt||Ir(_,function(he){var De=new f.Response(he,U);Mr(),Qt&&Qt.then(function(it){return it.put(_i(y.url),De)}).catch(function(it){return ie(it.message)})})}}}function _i(y){var _=y.indexOf("?");return _<0?y:y.slice(0,_)}function Pi(y,_){if(Mr(),!Qt)return _(null);var I=_i(y.url);Qt.then(function(U){U.match(I).then(function($){var oe=ai($);U.delete(I),oe&&U.put(I,$.clone()),_(null,$,oe)}).catch(_)}).catch(_)}function ai(y){if(!y)return!1;var _=new Date(y.headers.get("Expires")||0),I=ge(y.headers.get("Cache-Control")||"");return _>Date.now()&&!I["no-cache"]}var mi=1/0;function un(y){mi++,mi>At&&(y.getActor().send("enforceCacheSizeLimit",xt),mi=0)}function Fn(y){Mr(),Qt&&Qt.then(function(_){_.keys().then(function(I){for(var U=0;U<I.length-y;U++)_.delete(I[U])})})}function An(y){var _=f.caches.delete(et);y&&_.catch(y).then(function(){return y()})}function Hn(y,_){xt=y,At=_}var Qn;function Vi(){return Qn==null&&(Qn=f.OffscreenCanvas&&new f.OffscreenCanvas(1,1).getContext("2d")&&typeof f.createImageBitmap=="function"),Qn}var Kn={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Kn);var Jn=function(y){function _(I,U,$){U===401&&Tt($)&&(I+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),y.call(this,I),this.status=U,this.url=$,this.name=this.constructor.name,this.message=I}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},_}(Error),Gt=Ce()?function(){return self.worker&&self.worker.referrer}:function(){return(f.location.protocol==="blob:"?f.parent:f).location.href},wt=function(y){return/^file:/.test(y)||/^file:/.test(Gt())&&!/^\w+:/.test(y)};function tr(y,_){var I=new f.AbortController,U=new f.Request(y.url,{method:y.method||"GET",body:y.body,credentials:y.credentials,headers:y.headers,referrer:Gt(),signal:I.signal}),$=!1,oe=!1,he=dt(U.url);y.type==="json"&&U.headers.set("Accept","application/json");var De=function(yt,Lt,sr){if(!oe){if(yt&&yt.message!=="SecurityError"&&ie(yt),Lt&&sr)return it(Lt);var gr=Date.now();f.fetch(U).then(function(hr){if(hr.ok){var Rr=he?hr.clone():null;return it(hr,Rr,gr)}else return _(new Jn(hr.statusText,hr.status,y.url))}).catch(function(hr){hr.code!==20&&_(new Error(hr.message))})}},it=function(yt,Lt,sr){(y.type==="arrayBuffer"?yt.arrayBuffer():y.type==="json"?yt.json():yt.text()).then(function(gr){oe||(Lt&&sr&&Yr(U,Lt,sr),$=!0,_(null,gr,yt.headers.get("Cache-Control"),yt.headers.get("Expires")))}).catch(function(gr){oe||_(new Error(gr.message))})};return he?Pi(U,De):De(null,null),{cancel:function(){oe=!0,$||I.abort()}}}function ir(y,_){var I=new f.XMLHttpRequest;I.open(y.method||"GET",y.url,!0),y.type==="arrayBuffer"&&(I.responseType="arraybuffer");for(var U in y.headers)I.setRequestHeader(U,y.headers[U]);return y.type==="json"&&(I.responseType="text",I.setRequestHeader("Accept","application/json")),I.withCredentials=y.credentials==="include",I.onerror=function(){_(new Error(I.statusText))},I.onload=function(){if((I.status>=200&&I.status<300||I.status===0)&&I.response!==null){var $=I.response;if(y.type==="json")try{$=JSON.parse(I.response)}catch(oe){return _(oe)}_(null,$,I.getResponseHeader("Cache-Control"),I.getResponseHeader("Expires"))}else _(new Jn(I.statusText,I.status,y.url))},I.send(y.body),{cancel:function(){return I.abort()}}}var wr=function(y,_){if(!wt(y.url)){if(f.fetch&&f.Request&&f.AbortController&&f.Request.prototype.hasOwnProperty("signal"))return tr(y,_);if(Ce()&&self.worker&&self.worker.actor){var I=!0;return self.worker.actor.send("getResource",y,_,void 0,I)}}return ir(y,_)},Xr=function(y,_){return wr(x(y,{type:"json"}),_)},ti=function(y,_){return wr(x(y,{type:"arrayBuffer"}),_)},$r=function(y,_){return wr(x(y,{method:"POST"}),_)};function Ri(y){var _=f.document.createElement("a");return _.href=y,_.protocol===f.document.location.protocol&&_.host===f.document.location.host}var Zi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function en(y,_,I,U){var $=new f.Image,oe=f.URL;$.onload=function(){_(null,$),oe.revokeObjectURL($.src),$.onload=null,f.requestAnimationFrame(function(){$.src=Zi})},$.onerror=function(){return _(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var he=new f.Blob([new Uint8Array(y)],{type:"image/png"});$.cacheControl=I,$.expires=U,$.src=y.byteLength?oe.createObjectURL(he):Zi}function fn(y,_){var I=new f.Blob([new Uint8Array(y)],{type:"image/png"});f.createImageBitmap(I).then(function(U){_(null,U)}).catch(function(U){_(new Error("Could not load image because of "+U.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var yn,Mn,Ba=function(){yn=[],Mn=0};Ba();var ua=function(y,_){if(Ht.supported&&(y.headers||(y.headers={}),y.headers.accept="image/webp,*/*"),Mn>=mt.MAX_PARALLEL_IMAGE_REQUESTS){var I={requestParameters:y,callback:_,cancelled:!1,cancel:function(){this.cancelled=!0}};return yn.push(I),I}Mn++;var U=!1,$=function(){if(!U)for(U=!0,Mn--;yn.length&&Mn<mt.MAX_PARALLEL_IMAGE_REQUESTS;){var he=yn.shift(),De=he.requestParameters,it=he.callback,yt=he.cancelled;yt||(he.cancel=ua(De,it).cancel)}},oe=ti(y,function(he,De,it,yt){$(),he?_(he):De&&(Vi()?fn(De,_):en(De,_,it,yt))});return{cancel:function(){oe.cancel(),$()}}},ma=function(y,_){var I=f.document.createElement("video");I.muted=!0,I.onloadstart=function(){_(null,I)};for(var U=0;U<y.length;U++){var $=f.document.createElement("source");Ri(y[U])||(I.crossOrigin="Anonymous"),$.src=y[U],I.appendChild($)}return{cancel:function(){}}};function Wa(y,_,I){var U=I[y]&&I[y].indexOf(_)!==-1;U||(I[y]=I[y]||[],I[y].push(_))}function Fa(y,_,I){if(I&&I[y]){var U=I[y].indexOf(_);U!==-1&&I[y].splice(U,1)}}var Xo=function(_,I){I===void 0&&(I={}),x(this,I),this.type=_},da=function(y){function _(I,U){U===void 0&&(U={}),y.call(this,"error",x({error:I},U))}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_}(Xo),jn=function(){};jn.prototype.on=function(_,I){return this._listeners=this._listeners||{},Wa(_,I,this._listeners),this},jn.prototype.off=function(_,I){return Fa(_,I,this._listeners),Fa(_,I,this._oneTimeListeners),this},jn.prototype.once=function(_,I){return this._oneTimeListeners=this._oneTimeListeners||{},Wa(_,I,this._oneTimeListeners),this},jn.prototype.fire=function(_,I){typeof _=="string"&&(_=new Xo(_,I||{}));var U=_.type;if(this.listens(U)){_.target=this;for(var $=this._listeners&&this._listeners[U]?this._listeners[U].slice():[],oe=0,he=$;oe<he.length;oe+=1){var De=he[oe];De.call(this,_)}for(var it=this._oneTimeListeners&&this._oneTimeListeners[U]?this._oneTimeListeners[U].slice():[],yt=0,Lt=it;yt<Lt.length;yt+=1){var sr=Lt[yt];Fa(U,sr,this._oneTimeListeners),sr.call(this,_)}var gr=this._eventedParent;gr&&(x(_,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),gr.fire(_))}else _ instanceof da&&console.error(_.error);return this},jn.prototype.listens=function(_){return this._listeners&&this._listeners[_]&&this._listeners[_].length>0||this._oneTimeListeners&&this._oneTimeListeners[_]&&this._oneTimeListeners[_].length>0||this._eventedParent&&this._eventedParent.listens(_)},jn.prototype.setEventedParent=function(_,I){return this._eventedParent=_,this._eventedParentData=I,this};var Ha=8,vo={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},Gn={"*":{type:"source"}},Ct=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Sr={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Jr={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},hi={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},hn={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},Sn={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},En={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},ki={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},_n=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],ya={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ea={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ma={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},_o={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},No={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},po={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Lo={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ko={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ds={type:"array",value:"*"},Fs={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},ll={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},ul={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},zl={type:"array",value:"*",minimum:1},us={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},il=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],As={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},cl={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},Ks={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},zs={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Io={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},ls={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Yl={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Su={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},nc={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},bs={"*":{type:"string"}},Rn={$version:Ha,$root:vo,sources:Gn,source:Ct,source_vector:Sr,source_raster:Jr,source_raster_dem:hi,source_geojson:hn,source_video:Sn,source_image:En,layer:ki,layout:_n,layout_background:ya,layout_fill:ea,layout_circle:Ma,layout_heatmap:_o,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:No,layout_symbol:po,layout_raster:Lo,layout_hillshade:ko,filter:Ds,filter_operator:Fs,geometry_type:ll,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:ul,expression:zl,light:us,paint:il,paint_fill:As,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:cl,paint_circle:Ks,paint_heatmap:zs,paint_symbol:Io,paint_raster:ls,paint_hillshade:Yl,paint_background:Su,transition:nc,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:bs},_a=function(_,I,U,$){this.message=(_?_+": ":"")+U,$&&(this.identifier=$),I!=null&&I.__line__&&(this.line=I.__line__)};function Vu(y){var _=y.key,I=y.value;return I?[new _a(_,I,"constants have been deprecated as of v8")]:[]}function ql(y){for(var _=[],I=arguments.length-1;I-- >0;)_[I]=arguments[I+1];for(var U=0,$=_;U<$.length;U+=1){var oe=$[U];for(var he in oe)y[he]=oe[he]}return y}function xo(y){return y instanceof Number||y instanceof String||y instanceof Boolean?y.valueOf():y}function Kl(y){if(Array.isArray(y))return y.map(Kl);if(y instanceof Object&&!(y instanceof Number||y instanceof String||y instanceof Boolean)){var _={};for(var I in y)_[I]=Kl(y[I]);return _}return xo(y)}var Ns=function(y){function _(I,U){y.call(this,U),this.message=U,this.key=I}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_}(Error),Hl=function(_,I){I===void 0&&(I=[]),this.parent=_,this.bindings={};for(var U=0,$=I;U<$.length;U+=1){var oe=$[U],he=oe[0],De=oe[1];this.bindings[he]=De}};Hl.prototype.concat=function(_){return new Hl(this,_)},Hl.prototype.get=function(_){if(this.bindings[_])return this.bindings[_];if(this.parent)return this.parent.get(_);throw new Error(_+" not found in scope.")},Hl.prototype.has=function(_){return this.bindings[_]?!0:this.parent?this.parent.has(_):!1};var ac={kind:"null"},oa={kind:"number"},qo={kind:"string"},Oo={kind:"boolean"},Ol={kind:"color"},Pc={kind:"object"},Do={kind:"value"},nf={kind:"error"},Vf={kind:"collator"},pl={kind:"formatted"},Zc={kind:"resolvedImage"};function Jl(y,_){return{kind:"array",itemType:y,N:_}}function qs(y){if(y.kind==="array"){var _=qs(y.itemType);return typeof y.N=="number"?"array<"+_+", "+y.N+">":y.itemType.kind==="value"?"array":"array<"+_+">"}else return y.kind}var yu=[ac,oa,qo,Oo,Ol,pl,Pc,Jl(Do),Zc];function oc(y,_){if(_.kind==="error")return null;if(y.kind==="array"){if(_.kind==="array"&&(_.N===0&&_.itemType.kind==="value"||!oc(y.itemType,_.itemType))&&(typeof y.N!="number"||y.N===_.N))return null}else{if(y.kind===_.kind)return null;if(y.kind==="value")for(var I=0,U=yu;I<U.length;I+=1){var $=U[I];if(!oc($,_))return null}}return"Expected "+qs(y)+" but found "+qs(_)+" instead."}function Cf(y,_){return _.some(function(I){return I.kind===y.kind})}function sc(y,_){return _.some(function(I){return I==="null"?y===null:I==="array"?Array.isArray(y):I==="object"?y&&!Array.isArray(y)&&typeof y=="object":I===typeof y})}var jh=a(function(y,_){var I={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 U(yt){return yt=Math.round(yt),yt<0?0:yt>255?255:yt}function $(yt){return yt<0?0:yt>1?1:yt}function oe(yt){return yt[yt.length-1]==="%"?U(parseFloat(yt)/100*255):U(parseInt(yt))}function he(yt){return yt[yt.length-1]==="%"?$(parseFloat(yt)/100):$(parseFloat(yt))}function De(yt,Lt,sr){return sr<0?sr+=1:sr>1&&(sr-=1),sr*6<1?yt+(Lt-yt)*sr*6:sr*2<1?Lt:sr*3<2?yt+(Lt-yt)*(2/3-sr)*6:yt}function it(yt){var Lt=yt.replace(/ /g,"").toLowerCase();if(Lt in I)return I[Lt].slice();if(Lt[0]==="#"){if(Lt.length===4){var sr=parseInt(Lt.substr(1),16);return sr>=0&&sr<=4095?[(sr&3840)>>4|(sr&3840)>>8,sr&240|(sr&240)>>4,sr&15|(sr&15)<<4,1]:null}else if(Lt.length===7){var sr=parseInt(Lt.substr(1),16);return sr>=0&&sr<=16777215?[(sr&16711680)>>16,(sr&65280)>>8,sr&255,1]:null}return null}var gr=Lt.indexOf("("),hr=Lt.indexOf(")");if(gr!==-1&&hr+1===Lt.length){var Rr=Lt.substr(0,gr),ni=Lt.substr(gr+1,hr-(gr+1)).split(","),Hi=1;switch(Rr){case"rgba":if(ni.length!==4)return null;Hi=he(ni.pop());case"rgb":return ni.length!==3?null:[oe(ni[0]),oe(ni[1]),oe(ni[2]),Hi];case"hsla":if(ni.length!==4)return null;Hi=he(ni.pop());case"hsl":if(ni.length!==3)return null;var wi=(parseFloat(ni[0])%360+360)%360/360,bn=he(ni[1]),rn=he(ni[2]),xn=rn<=.5?rn*(bn+1):rn+bn-rn*bn,In=rn*2-xn;return[U(De(In,xn,wi+1/3)*255),U(De(In,xn,wi)*255),U(De(In,xn,wi-1/3)*255),Hi];default:return null}}return null}try{_.parseCSSColor=it}catch(yt){}}),Lf=jh.parseCSSColor,cs=function(_,I,U,$){$===void 0&&($=1),this.r=_,this.g=I,this.b=U,this.a=$};cs.parse=function(_){if(_){if(_ instanceof cs)return _;if(typeof _=="string"){var I=Lf(_);if(I)return new cs(I[0]/255*I[3],I[1]/255*I[3],I[2]/255*I[3],I[3])}}},cs.prototype.toString=function(){var _=this.toArray(),I=_[0],U=_[1],$=_[2],oe=_[3];return"rgba("+Math.round(I)+","+Math.round(U)+","+Math.round($)+","+oe+")"},cs.prototype.toArray=function(){var _=this,I=_.r,U=_.g,$=_.b,oe=_.a;return oe===0?[0,0,0,0]:[I*255/oe,U*255/oe,$*255/oe,oe]},cs.black=new cs(0,0,0,1),cs.white=new cs(1,1,1,1),cs.transparent=new cs(0,0,0,0),cs.red=new cs(1,0,0,1);var af=function(_,I,U){_?this.sensitivity=I?"variant":"case":this.sensitivity=I?"accent":"base",this.locale=U,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};af.prototype.compare=function(_,I){return this.collator.compare(_,I)},af.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Gf=function(_,I,U,$,oe){this.text=_,this.image=I,this.scale=U,this.fontStack=$,this.textColor=oe},$l=function(_){this.sections=_};$l.fromString=function(_){return new $l([new Gf(_,null,null,null,null)])},$l.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(_){return _.text.length!==0||_.image&&_.image.name.length!==0})},$l.factory=function(_){return _ instanceof $l?_:$l.fromString(_)},$l.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(_){return _.text}).join("")},$l.prototype.serialize=function(){for(var _=["format"],I=0,U=this.sections;I<U.length;I+=1){var $=U[I];if($.image){_.push(["image",$.image.name]);continue}_.push($.text);var oe={};$.fontStack&&(oe["text-font"]=["literal",$.fontStack.split(",")]),$.scale&&(oe["font-scale"]=$.scale),$.textColor&&(oe["text-color"]=["rgba"].concat($.textColor.toArray())),_.push(oe)}return _};var fl=function(_){this.name=_.name,this.available=_.available};fl.prototype.toString=function(){return this.name},fl.fromString=function(_){return _?new fl({name:_,available:!1}):null},fl.prototype.serialize=function(){return["image",this.name]};function lc(y,_,I,U){if(!(typeof y=="number"&&y>=0&&y<=255&&typeof _=="number"&&_>=0&&_<=255&&typeof I=="number"&&I>=0&&I<=255)){var $=typeof U=="number"?[y,_,I,U]:[y,_,I];return"Invalid rgba value ["+$.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof U=="undefined"||typeof U=="number"&&U>=0&&U<=1?null:"Invalid rgba value ["+[y,_,I,U].join(", ")+"]: 'a' must be between 0 and 1."}function Fu(y){if(y===null)return!0;if(typeof y=="string")return!0;if(typeof y=="boolean")return!0;if(typeof y=="number")return!0;if(y instanceof cs)return!0;if(y instanceof af)return!0;if(y instanceof $l)return!0;if(y instanceof fl)return!0;if(Array.isArray(y)){for(var _=0,I=y;_<I.length;_+=1){var U=I[_];if(!Fu(U))return!1}return!0}else if(typeof y=="object"){for(var $ in y)if(!Fu(y[$]))return!1;return!0}else return!1}function Es(y){if(y===null)return ac;if(typeof y=="string")return qo;if(typeof y=="boolean")return Oo;if(typeof y=="number")return oa;if(y instanceof cs)return Ol;if(y instanceof af)return Vf;if(y instanceof $l)return pl;if(y instanceof fl)return Zc;if(Array.isArray(y)){for(var _=y.length,I,U=0,$=y;U<$.length;U+=1){var oe=$[U],he=Es(oe);if(!I)I=he;else{if(I===he)continue;I=Do;break}}return Jl(I||Do,_)}else return Pc}function Hs(y){var _=typeof y;return y===null?"":_==="string"||_==="number"||_==="boolean"?String(y):y instanceof cs||y instanceof $l||y instanceof fl?y.toString():JSON.stringify(y)}var Go=function(_,I){this.type=_,this.value=I};Go.parse=function(_,I){if(_.length!==2)return I.error("'literal' expression requires exactly one argument, but found "+(_.length-1)+" instead.");if(!Fu(_[1]))return I.error("invalid value");var U=_[1],$=Es(U),oe=I.expectedType;return $.kind==="array"&&$.N===0&&oe&&oe.kind==="array"&&(typeof oe.N!="number"||oe.N===0)&&($=oe),new Go($,U)},Go.prototype.evaluate=function(){return this.value},Go.prototype.eachChild=function(){},Go.prototype.outputDefined=function(){return!0},Go.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof cs?["rgba"].concat(this.value.toArray()):this.value instanceof $l?this.value.serialize():this.value};var ps=function(_){this.name="ExpressionEvaluationError",this.message=_};ps.prototype.toJSON=function(){return this.message};var uc={string:qo,number:oa,boolean:Oo,object:Pc},xl=function(_,I){this.type=_,this.args=I};xl.parse=function(_,I){if(_.length<2)return I.error("Expected at least one argument.");var U=1,$,oe=_[0];if(oe==="array"){var he;if(_.length>2){var De=_[1];if(typeof De!="string"||!(De in uc)||De==="object")return I.error('The item type argument of "array" must be one of string, number, boolean',1);he=uc[De],U++}else he=Do;var it;if(_.length>3){if(_[2]!==null&&(typeof _[2]!="number"||_[2]<0||_[2]!==Math.floor(_[2])))return I.error('The length argument to "array" must be a positive integer literal',2);it=_[2],U++}$=Jl(he,it)}else $=uc[oe];for(var yt=[];U<_.length;U++){var Lt=I.parse(_[U],U,Do);if(!Lt)return null;yt.push(Lt)}return new xl($,yt)},xl.prototype.evaluate=function(_){for(var I=0;I<this.args.length;I++){var U=this.args[I].evaluate(_),$=oc(this.type,Es(U));if($){if(I===this.args.length-1)throw new ps("Expected value to be of type "+qs(this.type)+", but found "+qs(Es(U))+" instead.")}else return U}return null},xl.prototype.eachChild=function(_){this.args.forEach(_)},xl.prototype.outputDefined=function(){return this.args.every(function(_){return _.outputDefined()})},xl.prototype.serialize=function(){var _=this.type,I=[_.kind];if(_.kind==="array"){var U=_.itemType;if(U.kind==="string"||U.kind==="number"||U.kind==="boolean"){I.push(U.kind);var $=_.N;(typeof $=="number"||this.args.length>1)&&I.push($)}}return I.concat(this.args.map(function(oe){return oe.serialize()}))};var Gu=function(_){this.type=pl,this.sections=_};Gu.parse=function(_,I){if(_.length<2)return I.error("Expected at least one argument.");var U=_[1];if(!Array.isArray(U)&&typeof U=="object")return I.error("First argument must be an image or text section.");for(var $=[],oe=!1,he=1;he<=_.length-1;++he){var De=_[he];if(oe&&typeof De=="object"&&!Array.isArray(De)){oe=!1;var it=null;if(De["font-scale"]&&(it=I.parse(De["font-scale"],1,oa),!it))return null;var yt=null;if(De["text-font"]&&(yt=I.parse(De["text-font"],1,Jl(qo)),!yt))return null;var Lt=null;if(De["text-color"]&&(Lt=I.parse(De["text-color"],1,Ol),!Lt))return null;var sr=$[$.length-1];sr.scale=it,sr.font=yt,sr.textColor=Lt}else{var gr=I.parse(_[he],1,Do);if(!gr)return null;var hr=gr.type.kind;if(hr!=="string"&&hr!=="value"&&hr!=="null"&&hr!=="resolvedImage")return I.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");oe=!0,$.push({content:gr,scale:null,font:null,textColor:null})}}return new Gu($)},Gu.prototype.evaluate=function(_){var I=function(U){var $=U.content.evaluate(_);return Es($)===Zc?new Gf("",$,null,null,null):new Gf(Hs($),null,U.scale?U.scale.evaluate(_):null,U.font?U.font.evaluate(_).join(","):null,U.textColor?U.textColor.evaluate(_):null)};return new $l(this.sections.map(I))},Gu.prototype.eachChild=function(_){for(var I=0,U=this.sections;I<U.length;I+=1){var $=U[I];_($.content),$.scale&&_($.scale),$.font&&_($.font),$.textColor&&_($.textColor)}},Gu.prototype.outputDefined=function(){return!1},Gu.prototype.serialize=function(){for(var _=["format"],I=0,U=this.sections;I<U.length;I+=1){var $=U[I];_.push($.content.serialize());var oe={};$.scale&&(oe["font-scale"]=$.scale.serialize()),$.font&&(oe["text-font"]=$.font.serialize()),$.textColor&&(oe["text-color"]=$.textColor.serialize()),_.push(oe)}return _};var Os=function(_){this.type=Zc,this.input=_};Os.parse=function(_,I){if(_.length!==2)return I.error("Expected two arguments.");var U=I.parse(_[1],1,qo);return U?new Os(U):I.error("No image name provided.")},Os.prototype.evaluate=function(_){var I=this.input.evaluate(_),U=fl.fromString(I);return U&&_.availableImages&&(U.available=_.availableImages.indexOf(I)>-1),U},Os.prototype.eachChild=function(_){_(this.input)},Os.prototype.outputDefined=function(){return!1},Os.prototype.serialize=function(){return["image",this.input.serialize()]};var od={"to-boolean":Oo,"to-color":Ol,"to-number":oa,"to-string":qo},Po=function(_,I){this.type=_,this.args=I};Po.parse=function(_,I){if(_.length<2)return I.error("Expected at least one argument.");var U=_[0];if((U==="to-boolean"||U==="to-string")&&_.length!==2)return I.error("Expected one argument.");for(var $=od[U],oe=[],he=1;he<_.length;he++){var De=I.parse(_[he],he,Do);if(!De)return null;oe.push(De)}return new Po($,oe)},Po.prototype.evaluate=function(_){if(this.type.kind==="boolean")return!!this.args[0].evaluate(_);if(this.type.kind==="color"){for(var I,U,$=0,oe=this.args;$<oe.length;$+=1){var he=oe[$];if(I=he.evaluate(_),U=null,I instanceof cs)return I;if(typeof I=="string"){var De=_.parseColor(I);if(De)return De}else if(Array.isArray(I)&&(I.length<3||I.length>4?U="Invalid rbga value "+JSON.stringify(I)+": expected an array containing either three or four numeric values.":U=lc(I[0],I[1],I[2],I[3]),!U))return new cs(I[0]/255,I[1]/255,I[2]/255,I[3])}throw new ps(U||"Could not parse color from value '"+(typeof I=="string"?I:String(JSON.stringify(I)))+"'")}else if(this.type.kind==="number"){for(var it=null,yt=0,Lt=this.args;yt<Lt.length;yt+=1){var sr=Lt[yt];if(it=sr.evaluate(_),it===null)return 0;var gr=Number(it);if(!isNaN(gr))return gr}throw new ps("Could not convert "+JSON.stringify(it)+" to number.")}else return this.type.kind==="formatted"?$l.fromString(Hs(this.args[0].evaluate(_))):this.type.kind==="resolvedImage"?fl.fromString(Hs(this.args[0].evaluate(_))):Hs(this.args[0].evaluate(_))},Po.prototype.eachChild=function(_){this.args.forEach(_)},Po.prototype.outputDefined=function(){return this.args.every(function(_){return _.outputDefined()})},Po.prototype.serialize=function(){if(this.type.kind==="formatted")return new Gu([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Os(this.args[0]).serialize();var _=["to-"+this.type.kind];return this.eachChild(function(I){_.push(I.serialize())}),_};var sd=["Unknown","Point","LineString","Polygon"],Ko=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Ko.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Ko.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?sd[this.feature.type]:this.feature.type:null},Ko.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Ko.prototype.canonicalID=function(){return this.canonical},Ko.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Ko.prototype.parseColor=function(_){var I=this._parseColorCache[_];return I||(I=this._parseColorCache[_]=cs.parse(_)),I};var Pa=function(_,I,U,$){this.name=_,this.type=I,this._evaluate=U,this.args=$};Pa.prototype.evaluate=function(_){return this._evaluate(_,this.args)},Pa.prototype.eachChild=function(_){this.args.forEach(_)},Pa.prototype.outputDefined=function(){return!1},Pa.prototype.serialize=function(){return[this.name].concat(this.args.map(function(_){return _.serialize()}))},Pa.parse=function(_,I){var U,$=_[0],oe=Pa.definitions[$];if(!oe)return I.error('Unknown expression "'+$+'". If you wanted a literal array, use ["literal", [...]].',0);for(var he=Array.isArray(oe)?oe[0]:oe.type,De=Array.isArray(oe)?[[oe[1],oe[2]]]:oe.overloads,it=De.filter(function(to){var ao=to[0];return!Array.isArray(ao)||ao.length===_.length-1}),yt=null,Lt=0,sr=it;Lt<sr.length;Lt+=1){var gr=sr[Lt],hr=gr[0],Rr=gr[1];yt=new ks(I.registry,I.path,null,I.scope);for(var ni=[],Hi=!1,wi=1;wi<_.length;wi++){var bn=_[wi],rn=Array.isArray(hr)?hr[wi-1]:hr.type,xn=yt.parse(bn,1+ni.length,rn);if(!xn){Hi=!0;break}ni.push(xn)}if(!Hi){if(Array.isArray(hr)&&hr.length!==ni.length){yt.error("Expected "+hr.length+" arguments, but found "+ni.length+" instead.");continue}for(var In=0;In<ni.length;In++){var Xn=Array.isArray(hr)?hr[In]:hr.type,ga=ni[In];yt.concat(In+1).checkSubtype(Xn,ga.type)}if(yt.errors.length===0)return new Pa($,he,Rr,ni)}}if(it.length===1)(U=I.errors).push.apply(U,yt.errors);else{for(var ha=it.length?it:De,eo=ha.map(function(to){var ao=to[0];return of(ao)}).join(" | "),za=[],Za=1;Za<_.length;Za++){var Jo=I.parse(_[Za],1+za.length);if(!Jo)return null;za.push(qs(Jo.type))}I.error("Expected arguments of type "+eo+", but found ("+za.join(", ")+") instead.")}return null},Pa.register=function(_,I){Pa.definitions=I;for(var U in I)_[U]=Pa};function of(y){return Array.isArray(y)?"("+y.map(qs).join(", ")+")":"("+qs(y.type)+"...)"}var Hu=function(_,I,U){this.type=Vf,this.locale=U,this.caseSensitive=_,this.diacriticSensitive=I};Hu.parse=function(_,I){if(_.length!==2)return I.error("Expected one argument.");var U=_[1];if(typeof U!="object"||Array.isArray(U))return I.error("Collator options argument must be an object.");var $=I.parse(U["case-sensitive"]===void 0?!1:U["case-sensitive"],1,Oo);if(!$)return null;var oe=I.parse(U["diacritic-sensitive"]===void 0?!1:U["diacritic-sensitive"],1,Oo);if(!oe)return null;var he=null;return U.locale&&(he=I.parse(U.locale,1,qo),!he)?null:new Hu($,oe,he)},Hu.prototype.evaluate=function(_){return new af(this.caseSensitive.evaluate(_),this.diacriticSensitive.evaluate(_),this.locale?this.locale.evaluate(_):null)},Hu.prototype.eachChild=function(_){_(this.caseSensitive),_(this.diacriticSensitive),this.locale&&_(this.locale)},Hu.prototype.outputDefined=function(){return!1},Hu.prototype.serialize=function(){var _={};return _["case-sensitive"]=this.caseSensitive.serialize(),_["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(_.locale=this.locale.serialize()),["collator",_]};var bl=8192;function Hf(y,_){y[0]=Math.min(y[0],_[0]),y[1]=Math.min(y[1],_[1]),y[2]=Math.max(y[2],_[0]),y[3]=Math.max(y[3],_[1])}function Ic(y){return(180+y)/360}function yf(y){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+y*Math.PI/360)))/360}function Bl(y,_){return!(y[0]<=_[0]||y[2]>=_[2]||y[1]<=_[1]||y[3]>=_[3])}function Ah(y,_){var I=Ic(y[0]),U=yf(y[1]),$=Math.pow(2,_.z);return[Math.round(I*$*bl),Math.round(U*$*bl)]}function Qf(y,_,I){var U=y[0]-_[0],$=y[1]-_[1],oe=y[0]-I[0],he=y[1]-I[1];return U*he-oe*$===0&&U*oe<=0&&$*he<=0}function _f(y,_,I){return _[1]>y[1]!=I[1]>y[1]&&y[0]<(I[0]-_[0])*(y[1]-_[1])/(I[1]-_[1])+_[0]}function Yc(y,_){for(var I=!1,U=0,$=_.length;U<$;U++)for(var oe=_[U],he=0,De=oe.length;he<De-1;he++){if(Qf(y,oe[he],oe[he+1]))return!1;_f(y,oe[he],oe[he+1])&&(I=!I)}return I}function eh(y,_){for(var I=0;I<_.length;I++)if(Yc(y,_[I]))return!0;return!1}function th(y,_){return y[0]*_[1]-y[1]*_[0]}function ju(y,_,I,U){var $=y[0]-I[0],oe=y[1]-I[1],he=_[0]-I[0],De=_[1]-I[1],it=U[0]-I[0],yt=U[1]-I[1],Lt=$*yt-it*oe,sr=he*yt-it*De;return Lt>0&&sr<0||Lt<0&&sr>0}function jf(y,_,I,U){var $=[_[0]-y[0],_[1]-y[1]],oe=[U[0]-I[0],U[1]-I[1]];return th(oe,$)===0?!1:!!(ju(y,_,I,U)&&ju(I,U,y,_))}function cc(y,_,I){for(var U=0,$=I;U<$.length;U+=1)for(var oe=$[U],he=0;he<oe.length-1;++he)if(jf(y,_,oe[he],oe[he+1]))return!0;return!1}function sf(y,_){for(var I=0;I<y.length;++I)if(!Yc(y[I],_))return!1;for(var U=0;U<y.length-1;++U)if(cc(y[U],y[U+1],_))return!1;return!0}function Nl(y,_){for(var I=0;I<_.length;I++)if(sf(y,_[I]))return!0;return!1}function Kc(y,_,I){for(var U=[],$=0;$<y.length;$++){for(var oe=[],he=0;he<y[$].length;he++){var De=Ah(y[$][he],I);Hf(_,De),oe.push(De)}U.push(oe)}return U}function Rc(y,_,I){for(var U=[],$=0;$<y.length;$++){var oe=Kc(y[$],_,I);U.push(oe)}return U}function gs(y,_,I,U){if(y[0]<I[0]||y[0]>I[2]){var $=U*.5,oe=y[0]-I[0]>$?-U:I[0]-y[0]>$?U:0;oe===0&&(oe=y[0]-I[2]>$?-U:I[2]-y[0]>$?U:0),y[0]+=oe}Hf(_,y)}function Wf(y){y[0]=y[1]=1/0,y[2]=y[3]=-1/0}function Wh(y,_,I,U){for(var $=Math.pow(2,U.z)*bl,oe=[U.x*bl,U.y*bl],he=[],De=0,it=y;De<it.length;De+=1)for(var yt=it[De],Lt=0,sr=yt;Lt<sr.length;Lt+=1){var gr=sr[Lt],hr=[gr.x+oe[0],gr.y+oe[1]];gs(hr,_,I,$),he.push(hr)}return he}function rh(y,_,I,U){for(var $=Math.pow(2,U.z)*bl,oe=[U.x*bl,U.y*bl],he=[],De=0,it=y;De<it.length;De+=1){for(var yt=it[De],Lt=[],sr=0,gr=yt;sr<gr.length;sr+=1){var hr=gr[sr],Rr=[hr.x+oe[0],hr.y+oe[1]];Hf(_,Rr),Lt.push(Rr)}he.push(Lt)}if(_[2]-_[0]<=$/2){Wf(_);for(var ni=0,Hi=he;ni<Hi.length;ni+=1)for(var wi=Hi[ni],bn=0,rn=wi;bn<rn.length;bn+=1){var xn=rn[bn];gs(xn,_,I,$)}}return he}function lf(y,_){var I=[1/0,1/0,-1/0,-1/0],U=[1/0,1/0,-1/0,-1/0],$=y.canonicalID();if(_.type==="Polygon"){var oe=Kc(_.coordinates,U,$),he=Wh(y.geometry(),I,U,$);if(!Bl(I,U))return!1;for(var De=0,it=he;De<it.length;De+=1){var yt=it[De];if(!Yc(yt,oe))return!1}}if(_.type==="MultiPolygon"){var Lt=Rc(_.coordinates,U,$),sr=Wh(y.geometry(),I,U,$);if(!Bl(I,U))return!1;for(var gr=0,hr=sr;gr<hr.length;gr+=1){var Rr=hr[gr];if(!eh(Rr,Lt))return!1}}return!0}function Sh(y,_){var I=[1/0,1/0,-1/0,-1/0],U=[1/0,1/0,-1/0,-1/0],$=y.canonicalID();if(_.type==="Polygon"){var oe=Kc(_.coordinates,U,$),he=rh(y.geometry(),I,U,$);if(!Bl(I,U))return!1;for(var De=0,it=he;De<it.length;De+=1){var yt=it[De];if(!sf(yt,oe))return!1}}if(_.type==="MultiPolygon"){var Lt=Rc(_.coordinates,U,$),sr=rh(y.geometry(),I,U,$);if(!Bl(I,U))return!1;for(var gr=0,hr=sr;gr<hr.length;gr+=1){var Rr=hr[gr];if(!Nl(Rr,Lt))return!1}}return!0}var Mu=function(_,I){this.type=Oo,this.geojson=_,this.geometries=I};Mu.parse=function(_,I){if(_.length!==2)return I.error("'within' expression requires exactly one argument, but found "+(_.length-1)+" instead.");if(Fu(_[1])){var U=_[1];if(U.type==="FeatureCollection")for(var $=0;$<U.features.length;++$){var oe=U.features[$].geometry.type;if(oe==="Polygon"||oe==="MultiPolygon")return new Mu(U,U.features[$].geometry)}else if(U.type==="Feature"){var he=U.geometry.type;if(he==="Polygon"||he==="MultiPolygon")return new Mu(U,U.geometry)}else if(U.type==="Polygon"||U.type==="MultiPolygon")return new Mu(U,U)}return I.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Mu.prototype.evaluate=function(_){if(_.geometry()!=null&&_.canonicalID()!=null){if(_.geometryType()==="Point")return lf(_,this.geometries);if(_.geometryType()==="LineString")return Sh(_,this.geometries)}return!1},Mu.prototype.eachChild=function(){},Mu.prototype.outputDefined=function(){return!0},Mu.prototype.serialize=function(){return["within",this.geojson]};function ih(y){if(y instanceof Pa){if(y.name==="get"&&y.args.length===1)return!1;if(y.name==="feature-state")return!1;if(y.name==="has"&&y.args.length===1)return!1;if(y.name==="properties"||y.name==="geometry-type"||y.name==="id")return!1;if(/^filter-/.test(y.name))return!1}if(y instanceof Mu)return!1;var _=!0;return y.eachChild(function(I){_&&!ih(I)&&(_=!1)}),_}function js(y){if(y instanceof Pa&&y.name==="feature-state")return!1;var _=!0;return y.eachChild(function(I){_&&!js(I)&&(_=!1)}),_}function Eu(y,_){if(y instanceof Pa&&_.indexOf(y.name)>=0)return!1;var I=!0;return y.eachChild(function(U){I&&!Eu(U,_)&&(I=!1)}),I}var Dc=function(_,I){this.type=I.type,this.name=_,this.boundExpression=I};Dc.parse=function(_,I){if(_.length!==2||typeof _[1]!="string")return I.error("'var' expression requires exactly one string literal argument.");var U=_[1];return I.scope.has(U)?new Dc(U,I.scope.get(U)):I.error('Unknown variable "'+U+'". Make sure "'+U+'" has been bound in an enclosing "let" expression before using it.',1)},Dc.prototype.evaluate=function(_){return this.boundExpression.evaluate(_)},Dc.prototype.eachChild=function(){},Dc.prototype.outputDefined=function(){return!1},Dc.prototype.serialize=function(){return["var",this.name]};var ks=function(_,I,U,$,oe){I===void 0&&(I=[]),$===void 0&&($=new Hl),oe===void 0&&(oe=[]),this.registry=_,this.path=I,this.key=I.map(function(he){return"["+he+"]"}).join(""),this.scope=$,this.errors=oe,this.expectedType=U};ks.prototype.parse=function(_,I,U,$,oe){return oe===void 0&&(oe={}),I?this.concat(I,U,$)._parse(_,oe):this._parse(_,oe)},ks.prototype._parse=function(_,I){(_===null||typeof _=="string"||typeof _=="boolean"||typeof _=="number")&&(_=["literal",_]);function U(Lt,sr,gr){return gr==="assert"?new xl(sr,[Lt]):gr==="coerce"?new Po(sr,[Lt]):Lt}if(Array.isArray(_)){if(_.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var $=_[0];if(typeof $!="string")return this.error("Expression name must be a string, but found "+typeof $+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var oe=this.registry[$];if(oe){var he=oe.parse(_,this);if(!he)return null;if(this.expectedType){var De=this.expectedType,it=he.type;if((De.kind==="string"||De.kind==="number"||De.kind==="boolean"||De.kind==="object"||De.kind==="array")&&it.kind==="value")he=U(he,De,I.typeAnnotation||"assert");else if((De.kind==="color"||De.kind==="formatted"||De.kind==="resolvedImage")&&(it.kind==="value"||it.kind==="string"))he=U(he,De,I.typeAnnotation||"coerce");else if(this.checkSubtype(De,it))return null}if(!(he instanceof Go)&&he.type.kind!=="resolvedImage"&&bc(he)){var yt=new Ko;try{he=new Go(he.type,he.evaluate(yt))}catch(Lt){return this.error(Lt.message),null}}return he}return this.error('Unknown expression "'+$+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof _=="undefined"?this.error("'undefined' value invalid. Use null instead."):typeof _=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof _+" instead.")},ks.prototype.concat=function(_,I,U){var $=typeof _=="number"?this.path.concat(_):this.path,oe=U?this.scope.concat(U):this.scope;return new ks(this.registry,$,I||null,oe,this.errors)},ks.prototype.error=function(_){for(var I=[],U=arguments.length-1;U-- >0;)I[U]=arguments[U+1];var $=""+this.key+I.map(function(oe){return"["+oe+"]"}).join("");this.errors.push(new Ns($,_))},ks.prototype.checkSubtype=function(_,I){var U=oc(_,I);return U&&this.error(U),U};function bc(y){if(y instanceof Dc)return bc(y.boundExpression);if(y instanceof Pa&&y.name==="error")return!1;if(y instanceof Hu)return!1;if(y instanceof Mu)return!1;var _=y instanceof Po||y instanceof xl,I=!0;return y.eachChild(function(U){_?I=I&&bc(U):I=I&&U instanceof Go}),I?ih(y)&&Eu(y,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function hu(y,_){for(var I=y.length-1,U=0,$=I,oe=0,he,De;U<=$;)if(oe=Math.floor((U+$)/2),he=y[oe],De=y[oe+1],he<=_){if(oe===I||_<De)return oe;U=oe+1}else if(he>_)$=oe-1;else throw new ps("Input is not a number.");return 0}var _u=function(_,I,U){this.type=_,this.input=I,this.labels=[],this.outputs=[];for(var $=0,oe=U;$<oe.length;$+=1){var he=oe[$],De=he[0],it=he[1];this.labels.push(De),this.outputs.push(it)}};_u.parse=function(_,I){if(_.length-1<4)return I.error("Expected at least 4 arguments, but found only "+(_.length-1)+".");if((_.length-1)%2!==0)return I.error("Expected an even number of arguments.");var U=I.parse(_[1],1,oa);if(!U)return null;var $=[],oe=null;I.expectedType&&I.expectedType.kind!=="value"&&(oe=I.expectedType);for(var he=1;he<_.length;he+=2){var De=he===1?-1/0:_[he],it=_[he+1],yt=he,Lt=he+1;if(typeof De!="number")return I.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',yt);if($.length&&$[$.length-1][0]>=De)return I.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',yt);var sr=I.parse(it,Lt,oe);if(!sr)return null;oe=oe||sr.type,$.push([De,sr])}return new _u(oe,U,$)},_u.prototype.evaluate=function(_){var I=this.labels,U=this.outputs;if(I.length===1)return U[0].evaluate(_);var $=this.input.evaluate(_);if($<=I[0])return U[0].evaluate(_);var oe=I.length;if($>=I[oe-1])return U[oe-1].evaluate(_);var he=hu(I,$);return U[he].evaluate(_)},_u.prototype.eachChild=function(_){_(this.input);for(var I=0,U=this.outputs;I<U.length;I+=1){var $=U[I];_($)}},_u.prototype.outputDefined=function(){return this.outputs.every(function(_){return _.outputDefined()})},_u.prototype.serialize=function(){for(var _=["step",this.input.serialize()],I=0;I<this.labels.length;I++)I>0&&_.push(this.labels[I]),_.push(this.outputs[I].serialize());return _};function nl(y,_,I){return y*(1-I)+_*I}function nh(y,_,I){return new cs(nl(y.r,_.r,I),nl(y.g,_.g,I),nl(y.b,_.b,I),nl(y.a,_.a,I))}function Mh(y,_,I){return y.map(function(U,$){return nl(U,_[$],I)})}var zu=Object.freeze({__proto__:null,number:nl,color:nh,array:Mh}),Fc=.95047,wc=1,bd=1.08883,xf=4/29,Pf=6/29,qu=3*Pf*Pf,bf=Pf*Pf*Pf,jl=Math.PI/180,uf=180/Math.PI;function Xh(y){return y>bf?Math.pow(y,1/3):y/qu+xf}function If(y){return y>Pf?y*y*y:qu*(y-xf)}function Cs(y){return 255*(y<=.0031308?12.92*y:1.055*Math.pow(y,1/2.4)-.055)}function du(y){return y/=255,y<=.04045?y/12.92:Math.pow((y+.055)/1.055,2.4)}function ku(y){var _=du(y.r),I=du(y.g),U=du(y.b),$=Xh((.4124564*_+.3575761*I+.1804375*U)/Fc),oe=Xh((.2126729*_+.7151522*I+.072175*U)/wc),he=Xh((.0193339*_+.119192*I+.9503041*U)/bd);return{l:116*oe-16,a:500*($-oe),b:200*(oe-he),alpha:y.a}}function Xf(y){var _=(y.l+16)/116,I=isNaN(y.a)?_:_+y.a/500,U=isNaN(y.b)?_:_-y.b/200;return _=wc*If(_),I=Fc*If(I),U=bd*If(U),new cs(Cs(3.2404542*I-1.5371385*_-.4985314*U),Cs(-.969266*I+1.8760108*_+.041556*U),Cs(.0556434*I-.2040259*_+1.0572252*U),y.alpha)}function Us(y,_,I){return{l:nl(y.l,_.l,I),a:nl(y.a,_.a,I),b:nl(y.b,_.b,I),alpha:nl(y.alpha,_.alpha,I)}}function wf(y){var _=ku(y),I=_.l,U=_.a,$=_.b,oe=Math.atan2($,U)*uf;return{h:oe<0?oe+360:oe,c:Math.sqrt(U*U+$*$),l:I,alpha:y.a}}function zc(y){var _=y.h*jl,I=y.c,U=y.l;return Xf({l:U,a:Math.cos(_)*I,b:Math.sin(_)*I,alpha:y.alpha})}function Wu(y,_,I){var U=_-y;return y+I*(U>180||U<-180?U-360*Math.round(U/360):U)}function Rf(y,_,I){return{h:Wu(y.h,_.h,I),c:nl(y.c,_.c,I),l:nl(y.l,_.l,I),alpha:nl(y.alpha,_.alpha,I)}}var Xu={forward:ku,reverse:Xf,interpolate:Us},cf={forward:wf,reverse:zc,interpolate:Rf},Zf=Object.freeze({__proto__:null,lab:Xu,hcl:cf}),Wl=function(_,I,U,$,oe){this.type=_,this.operator=I,this.interpolation=U,this.input=$,this.labels=[],this.outputs=[];for(var he=0,De=oe;he<De.length;he+=1){var it=De[he],yt=it[0],Lt=it[1];this.labels.push(yt),this.outputs.push(Lt)}};Wl.interpolationFactor=function(_,I,U,$){var oe=0;if(_.name==="exponential")oe=ah(I,_.base,U,$);else if(_.name==="linear")oe=ah(I,1,U,$);else if(_.name==="cubic-bezier"){var he=_.controlPoints,De=new s(he[0],he[1],he[2],he[3]);oe=De.solve(ah(I,1,U,$))}return oe},Wl.parse=function(_,I){var U=_[0],$=_[1],oe=_[2],he=_.slice(3);if(!Array.isArray($)||$.length===0)return I.error("Expected an interpolation type expression.",1);if($[0]==="linear")$={name:"linear"};else if($[0]==="exponential"){var De=$[1];if(typeof De!="number")return I.error("Exponential interpolation requires a numeric base.",1,1);$={name:"exponential",base:De}}else if($[0]==="cubic-bezier"){var it=$.slice(1);if(it.length!==4||it.some(function(wi){return typeof wi!="number"||wi<0||wi>1}))return I.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);$={name:"cubic-bezier",controlPoints:it}}else return I.error("Unknown interpolation type "+String($[0]),1,0);if(_.length-1<4)return I.error("Expected at least 4 arguments, but found only "+(_.length-1)+".");if((_.length-1)%2!==0)return I.error("Expected an even number of arguments.");if(oe=I.parse(oe,2,oa),!oe)return null;var yt=[],Lt=null;U==="interpolate-hcl"||U==="interpolate-lab"?Lt=Ol:I.expectedType&&I.expectedType.kind!=="value"&&(Lt=I.expectedType);for(var sr=0;sr<he.length;sr+=2){var gr=he[sr],hr=he[sr+1],Rr=sr+3,ni=sr+4;if(typeof gr!="number")return I.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Rr);if(yt.length&&yt[yt.length-1][0]>=gr)return I.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Rr);var Hi=I.parse(hr,ni,Lt);if(!Hi)return null;Lt=Lt||Hi.type,yt.push([gr,Hi])}return Lt.kind!=="number"&&Lt.kind!=="color"&&!(Lt.kind==="array"&&Lt.itemType.kind==="number"&&typeof Lt.N=="number")?I.error("Type "+qs(Lt)+" is not interpolatable."):new Wl(Lt,U,$,oe,yt)},Wl.prototype.evaluate=function(_){var I=this.labels,U=this.outputs;if(I.length===1)return U[0].evaluate(_);var $=this.input.evaluate(_);if($<=I[0])return U[0].evaluate(_);var oe=I.length;if($>=I[oe-1])return U[oe-1].evaluate(_);var he=hu(I,$),De=I[he],it=I[he+1],yt=Wl.interpolationFactor(this.interpolation,$,De,it),Lt=U[he].evaluate(_),sr=U[he+1].evaluate(_);return this.operator==="interpolate"?zu[this.type.kind.toLowerCase()](Lt,sr,yt):this.operator==="interpolate-hcl"?cf.reverse(cf.interpolate(cf.forward(Lt),cf.forward(sr),yt)):Xu.reverse(Xu.interpolate(Xu.forward(Lt),Xu.forward(sr),yt))},Wl.prototype.eachChild=function(_){_(this.input);for(var I=0,U=this.outputs;I<U.length;I+=1){var $=U[I];_($)}},Wl.prototype.outputDefined=function(){return this.outputs.every(function(_){return _.outputDefined()})},Wl.prototype.serialize=function(){var _;this.interpolation.name==="linear"?_=["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?_=["linear"]:_=["exponential",this.interpolation.base]:_=["cubic-bezier"].concat(this.interpolation.controlPoints);for(var I=[this.operator,_,this.input.serialize()],U=0;U<this.labels.length;U++)I.push(this.labels[U],this.outputs[U].serialize());return I};function ah(y,_,I,U){var $=U-I,oe=y-I;return $===0?0:_===1?oe/$:(Math.pow(_,oe)-1)/(Math.pow(_,$)-1)}var Zu=function(_,I){this.type=_,this.args=I};Zu.parse=function(_,I){if(_.length<2)return I.error("Expectected at least one argument.");var U=null,$=I.expectedType;$&&$.kind!=="value"&&(U=$);for(var oe=[],he=0,De=_.slice(1);he<De.length;he+=1){var it=De[he],yt=I.parse(it,1+oe.length,U,void 0,{typeAnnotation:"omit"});if(!yt)return null;U=U||yt.type,oe.push(yt)}var Lt=$&&oe.some(function(sr){return oc($,sr.type)});return Lt?new Zu(Do,oe):new Zu(U,oe)},Zu.prototype.evaluate=function(_){for(var I=null,U=0,$,oe=0,he=this.args;oe<he.length;oe+=1){var De=he[oe];if(U++,I=De.evaluate(_),I&&I instanceof fl&&!I.available&&($||($=I.name),I=null,U===this.args.length&&(I=$)),I!==null)break}return I},Zu.prototype.eachChild=function(_){this.args.forEach(_)},Zu.prototype.outputDefined=function(){return this.args.every(function(_){return _.outputDefined()})},Zu.prototype.serialize=function(){var _=["coalesce"];return this.eachChild(function(I){_.push(I.serialize())}),_};var qc=function(_,I){this.type=I.type,this.bindings=[].concat(_),this.result=I};qc.prototype.evaluate=function(_){return this.result.evaluate(_)},qc.prototype.eachChild=function(_){for(var I=0,U=this.bindings;I<U.length;I+=1){var $=U[I];_($[1])}_(this.result)},qc.parse=function(_,I){if(_.length<4)return I.error("Expected at least 3 arguments, but found "+(_.length-1)+" instead.");for(var U=[],$=1;$<_.length-1;$+=2){var oe=_[$];if(typeof oe!="string")return I.error("Expected string, but found "+typeof oe+" instead.",$);if(/[^a-zA-Z0-9_]/.test(oe))return I.error("Variable names must contain only alphanumeric characters or '_'.",$);var he=I.parse(_[$+1],$+1);if(!he)return null;U.push([oe,he])}var De=I.parse(_[_.length-1],_.length-1,I.expectedType,U);return De?new qc(U,De):null},qc.prototype.outputDefined=function(){return this.result.outputDefined()},qc.prototype.serialize=function(){for(var _=["let"],I=0,U=this.bindings;I<U.length;I+=1){var $=U[I],oe=$[0],he=$[1];_.push(oe,he.serialize())}return _.push(this.result.serialize()),_};var Tc=function(_,I,U){this.type=_,this.index=I,this.input=U};Tc.parse=function(_,I){if(_.length!==3)return I.error("Expected 2 arguments, but found "+(_.length-1)+" instead.");var U=I.parse(_[1],1,oa),$=I.parse(_[2],2,Jl(I.expectedType||Do));if(!U||!$)return null;var oe=$.type;return new Tc(oe.itemType,U,$)},Tc.prototype.evaluate=function(_){var I=this.index.evaluate(_),U=this.input.evaluate(_);if(I<0)throw new ps("Array index out of bounds: "+I+" < 0.");if(I>=U.length)throw new ps("Array index out of bounds: "+I+" > "+(U.length-1)+".");if(I!==Math.floor(I))throw new ps("Array index must be an integer, but found "+I+" instead.");return U[I]},Tc.prototype.eachChild=function(_){_(this.index),_(this.input)},Tc.prototype.outputDefined=function(){return!1},Tc.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var wl=function(_,I){this.type=Oo,this.needle=_,this.haystack=I};wl.parse=function(_,I){if(_.length!==3)return I.error("Expected 2 arguments, but found "+(_.length-1)+" instead.");var U=I.parse(_[1],1,Do),$=I.parse(_[2],2,Do);return!U||!$?null:Cf(U.type,[Oo,qo,oa,ac,Do])?new wl(U,$):I.error("Expected first argument to be of type boolean, string, number or null, but found "+qs(U.type)+" instead")},wl.prototype.evaluate=function(_){var I=this.needle.evaluate(_),U=this.haystack.evaluate(_);if(!U)return!1;if(!sc(I,["boolean","string","number","null"]))throw new ps("Expected first argument to be of type boolean, string, number or null, but found "+qs(Es(I))+" instead.");if(!sc(U,["string","array"]))throw new ps("Expected second argument to be of type array or string, but found "+qs(Es(U))+" instead.");return U.indexOf(I)>=0},wl.prototype.eachChild=function(_){_(this.needle),_(this.haystack)},wl.prototype.outputDefined=function(){return!0},wl.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var vu=function(_,I,U){this.type=oa,this.needle=_,this.haystack=I,this.fromIndex=U};vu.parse=function(_,I){if(_.length<=2||_.length>=5)return I.error("Expected 3 or 4 arguments, but found "+(_.length-1)+" instead.");var U=I.parse(_[1],1,Do),$=I.parse(_[2],2,Do);if(!U||!$)return null;if(!Cf(U.type,[Oo,qo,oa,ac,Do]))return I.error("Expected first argument to be of type boolean, string, number or null, but found "+qs(U.type)+" instead");if(_.length===4){var oe=I.parse(_[3],3,oa);return oe?new vu(U,$,oe):null}else return new vu(U,$)},vu.prototype.evaluate=function(_){var I=this.needle.evaluate(_),U=this.haystack.evaluate(_);if(!sc(I,["boolean","string","number","null"]))throw new ps("Expected first argument to be of type boolean, string, number or null, but found "+qs(Es(I))+" instead.");if(!sc(U,["string","array"]))throw new ps("Expected second argument to be of type array or string, but found "+qs(Es(U))+" instead.");if(this.fromIndex){var $=this.fromIndex.evaluate(_);return U.indexOf(I,$)}return U.indexOf(I)},vu.prototype.eachChild=function(_){_(this.needle),_(this.haystack),this.fromIndex&&_(this.fromIndex)},vu.prototype.outputDefined=function(){return!1},vu.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var _=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),_]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Oc=function(_,I,U,$,oe,he){this.inputType=_,this.type=I,this.input=U,this.cases=$,this.outputs=oe,this.otherwise=he};Oc.parse=function(_,I){if(_.length<5)return I.error("Expected at least 4 arguments, but found only "+(_.length-1)+".");if(_.length%2!==1)return I.error("Expected an even number of arguments.");var U,$;I.expectedType&&I.expectedType.kind!=="value"&&($=I.expectedType);for(var oe={},he=[],De=2;De<_.length-1;De+=2){var it=_[De],yt=_[De+1];Array.isArray(it)||(it=[it]);var Lt=I.concat(De);if(it.length===0)return Lt.error("Expected at least one branch label.");for(var sr=0,gr=it;sr<gr.length;sr+=1){var hr=gr[sr];if(typeof hr!="number"&&typeof hr!="string")return Lt.error("Branch labels must be numbers or strings.");if(typeof hr=="number"&&Math.abs(hr)>Number.MAX_SAFE_INTEGER)return Lt.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof hr=="number"&&Math.floor(hr)!==hr)return Lt.error("Numeric branch labels must be integer values.");if(!U)U=Es(hr);else if(Lt.checkSubtype(U,Es(hr)))return null;if(typeof oe[String(hr)]!="undefined")return Lt.error("Branch labels must be unique.");oe[String(hr)]=he.length}var Rr=I.parse(yt,De,$);if(!Rr)return null;$=$||Rr.type,he.push(Rr)}var ni=I.parse(_[1],1,Do);if(!ni)return null;var Hi=I.parse(_[_.length-1],_.length-1,$);return!Hi||ni.type.kind!=="value"&&I.concat(1).checkSubtype(U,ni.type)?null:new Oc(U,$,ni,oe,he,Hi)},Oc.prototype.evaluate=function(_){var I=this.input.evaluate(_),U=Es(I)===this.inputType&&this.outputs[this.cases[I]]||this.otherwise;return U.evaluate(_)},Oc.prototype.eachChild=function(_){_(this.input),this.outputs.forEach(_),_(this.otherwise)},Oc.prototype.outputDefined=function(){return this.outputs.every(function(_){return _.outputDefined()})&&this.otherwise.outputDefined()},Oc.prototype.serialize=function(){for(var _=this,I=["match",this.input.serialize()],U=Object.keys(this.cases).sort(),$=[],oe={},he=0,De=U;he<De.length;he+=1){var it=De[he],yt=oe[this.cases[it]];yt===void 0?(oe[this.cases[it]]=$.length,$.push([this.cases[it],[it]])):$[yt][1].push(it)}for(var Lt=function(ni){return _.inputType.kind==="number"?Number(ni):ni},sr=0,gr=$;sr<gr.length;sr+=1){var hr=gr[sr],yt=hr[0],Rr=hr[1];Rr.length===1?I.push(Lt(Rr[0])):I.push(Rr.map(Lt)),I.push(this.outputs[outputIndex$1].serialize())}return I.push(this.otherwise.serialize()),I};var ff=function(_,I,U){this.type=_,this.branches=I,this.otherwise=U};ff.parse=function(_,I){if(_.length<4)return I.error("Expected at least 3 arguments, but found only "+(_.length-1)+".");if(_.length%2!==0)return I.error("Expected an odd number of arguments.");var U;I.expectedType&&I.expectedType.kind!=="value"&&(U=I.expectedType);for(var $=[],oe=1;oe<_.length-1;oe+=2){var he=I.parse(_[oe],oe,Oo);if(!he)return null;var De=I.parse(_[oe+1],oe+1,U);if(!De)return null;$.push([he,De]),U=U||De.type}var it=I.parse(_[_.length-1],_.length-1,U);return it?new ff(U,$,it):null},ff.prototype.evaluate=function(_){for(var I=0,U=this.branches;I<U.length;I+=1){var $=U[I],oe=$[0],he=$[1];if(oe.evaluate(_))return he.evaluate(_)}return this.otherwise.evaluate(_)},ff.prototype.eachChild=function(_){for(var I=0,U=this.branches;I<U.length;I+=1){var $=U[I],oe=$[0],he=$[1];_(oe),_(he)}_(this.otherwise)},ff.prototype.outputDefined=function(){return this.branches.every(function(_){var I=_[0],U=_[1];return U.outputDefined()})&&this.otherwise.outputDefined()},ff.prototype.serialize=function(){var _=["case"];return this.eachChild(function(I){_.push(I.serialize())}),_};var fc=function(_,I,U,$){this.type=_,this.input=I,this.beginIndex=U,this.endIndex=$};fc.parse=function(_,I){if(_.length<=2||_.length>=5)return I.error("Expected 3 or 4 arguments, but found "+(_.length-1)+" instead.");var U=I.parse(_[1],1,Do),$=I.parse(_[2],2,oa);if(!U||!$)return null;if(!Cf(U.type,[Jl(Do),qo,Do]))return I.error("Expected first argument to be of type array or string, but found "+qs(U.type)+" instead");if(_.length===4){var oe=I.parse(_[3],3,oa);return oe?new fc(U.type,U,$,oe):null}else return new fc(U.type,U,$)},fc.prototype.evaluate=function(_){var I=this.input.evaluate(_),U=this.beginIndex.evaluate(_);if(!sc(I,["string","array"]))throw new ps("Expected first argument to be of type array or string, but found "+qs(Es(I))+" instead.");if(this.endIndex){var $=this.endIndex.evaluate(_);return I.slice(U,$)}return I.slice(U)},fc.prototype.eachChild=function(_){_(this.input),_(this.beginIndex),this.endIndex&&_(this.endIndex)},fc.prototype.outputDefined=function(){return!1},fc.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var _=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),_]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function Bc(y,_){return y==="=="||y==="!="?_.kind==="boolean"||_.kind==="string"||_.kind==="number"||_.kind==="null"||_.kind==="value":_.kind==="string"||_.kind==="number"||_.kind==="value"}function kt(y,_,I){return _===I}function Zt(y,_,I){return _!==I}function Er(y,_,I){return _<I}function xr(y,_,I){return _>I}function Kr(y,_,I){return _<=I}function Mi(y,_,I){return _>=I}function Wi(y,_,I,U){return U.compare(_,I)===0}function dn(y,_,I,U){return!Wi(y,_,I,U)}function wn(y,_,I,U){return U.compare(_,I)<0}function On(y,_,I,U){return U.compare(_,I)>0}function Yi(y,_,I,U){return U.compare(_,I)<=0}function $i(y,_,I,U){return U.compare(_,I)>=0}function an(y,_,I){var U=y!=="=="&&y!=="!=";return function(){function $(oe,he,De){this.type=Oo,this.lhs=oe,this.rhs=he,this.collator=De,this.hasUntypedArgument=oe.type.kind==="value"||he.type.kind==="value"}return $.parse=function(he,De){if(he.length!==3&&he.length!==4)return De.error("Expected two or three arguments.");var it=he[0],yt=De.parse(he[1],1,Do);if(!yt)return null;if(!Bc(it,yt.type))return De.concat(1).error('"'+it+`" comparisons are not supported for type '`+qs(yt.type)+"'.");var Lt=De.parse(he[2],2,Do);if(!Lt)return null;if(!Bc(it,Lt.type))return De.concat(2).error('"'+it+`" comparisons are not supported for type '`+qs(Lt.type)+"'.");if(yt.type.kind!==Lt.type.kind&&yt.type.kind!=="value"&&Lt.type.kind!=="value")return De.error("Cannot compare types '"+qs(yt.type)+"' and '"+qs(Lt.type)+"'.");U&&(yt.type.kind==="value"&&Lt.type.kind!=="value"?yt=new xl(Lt.type,[yt]):yt.type.kind!=="value"&&Lt.type.kind==="value"&&(Lt=new xl(yt.type,[Lt])));var sr=null;if(he.length===4){if(yt.type.kind!=="string"&&Lt.type.kind!=="string"&&yt.type.kind!=="value"&&Lt.type.kind!=="value")return De.error("Cannot use collator to compare non-string types.");if(sr=De.parse(he[3],3,Vf),!sr)return null}return new $(yt,Lt,sr)},$.prototype.evaluate=function(he){var De=this.lhs.evaluate(he),it=this.rhs.evaluate(he);if(U&&this.hasUntypedArgument){var yt=Es(De),Lt=Es(it);if(yt.kind!==Lt.kind||!(yt.kind==="string"||yt.kind==="number"))throw new ps('Expected arguments for "'+y+'" to be (string, string) or (number, number), but found ('+yt.kind+", "+Lt.kind+") instead.")}if(this.collator&&!U&&this.hasUntypedArgument){var sr=Es(De),gr=Es(it);if(sr.kind!=="string"||gr.kind!=="string")return _(he,De,it)}return this.collator?I(he,De,it,this.collator.evaluate(he)):_(he,De,it)},$.prototype.eachChild=function(he){he(this.lhs),he(this.rhs),this.collator&&he(this.collator)},$.prototype.outputDefined=function(){return!0},$.prototype.serialize=function(){var he=[y];return this.eachChild(function(De){he.push(De.serialize())}),he},$}()}var Fi=an("==",kt,Wi),ta=an("!=",Zt,dn),Ca=an("<",Er,wn),Ra=an(">",xr,On),La=an("<=",Kr,Yi),Ua=an(">=",Mi,$i),Zn=function(_,I,U,$,oe){this.type=qo,this.number=_,this.locale=I,this.currency=U,this.minFractionDigits=$,this.maxFractionDigits=oe};Zn.parse=function(_,I){if(_.length!==3)return I.error("Expected two arguments.");var U=I.parse(_[1],1,oa);if(!U)return null;var $=_[2];if(typeof $!="object"||Array.isArray($))return I.error("NumberFormat options argument must be an object.");var oe=null;if($.locale&&(oe=I.parse($.locale,1,qo),!oe))return null;var he=null;if($.currency&&(he=I.parse($.currency,1,qo),!he))return null;var De=null;if($["min-fraction-digits"]&&(De=I.parse($["min-fraction-digits"],1,oa),!De))return null;var it=null;return $["max-fraction-digits"]&&(it=I.parse($["max-fraction-digits"],1,oa),!it)?null:new Zn(U,oe,he,De,it)},Zn.prototype.evaluate=function(_){return new Intl.NumberFormat(this.locale?this.locale.evaluate(_):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(_):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(_):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(_):void 0}).format(this.number.evaluate(_))},Zn.prototype.eachChild=function(_){_(this.number),this.locale&&_(this.locale),this.currency&&_(this.currency),this.minFractionDigits&&_(this.minFractionDigits),this.maxFractionDigits&&_(this.maxFractionDigits)},Zn.prototype.outputDefined=function(){return!1},Zn.prototype.serialize=function(){var _={};return this.locale&&(_.locale=this.locale.serialize()),this.currency&&(_.currency=this.currency.serialize()),this.minFractionDigits&&(_["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(_["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),_]};var Dn=function(_){this.type=oa,this.input=_};Dn.parse=function(_,I){if(_.length!==2)return I.error("Expected 1 argument, but found "+(_.length-1)+" instead.");var U=I.parse(_[1],1);return U?U.type.kind!=="array"&&U.type.kind!=="string"&&U.type.kind!=="value"?I.error("Expected argument of type string or array, but found "+qs(U.type)+" instead."):new Dn(U):null},Dn.prototype.evaluate=function(_){var I=this.input.evaluate(_);if(typeof I=="string")return I.length;if(Array.isArray(I))return I.length;throw new ps("Expected value to be of type string or array, but found "+qs(Es(I))+" instead.")},Dn.prototype.eachChild=function(_){_(this.input)},Dn.prototype.outputDefined=function(){return!1},Dn.prototype.serialize=function(){var _=["length"];return this.eachChild(function(I){_.push(I.serialize())}),_};var Ka={"==":Fi,"!=":ta,">":Ra,"<":Ca,">=":Ua,"<=":La,array:xl,at:Tc,boolean:xl,case:ff,coalesce:Zu,collator:Hu,format:Gu,image:Os,in:wl,"index-of":vu,interpolate:Wl,"interpolate-hcl":Wl,"interpolate-lab":Wl,length:Dn,let:qc,literal:Go,match:Oc,number:xl,"number-format":Zn,object:xl,slice:fc,step:_u,string:xl,"to-boolean":Po,"to-color":Po,"to-number":Po,"to-string":Po,var:Dc,within:Mu};function bo(y,_){var I=_[0],U=_[1],$=_[2],oe=_[3];I=I.evaluate(y),U=U.evaluate(y),$=$.evaluate(y);var he=oe?oe.evaluate(y):1,De=lc(I,U,$,he);if(De)throw new ps(De);return new cs(I/255*he,U/255*he,$/255*he,he)}function Zo(y,_){return y in _}function Ss(y,_){var I=_[y];return typeof I=="undefined"?null:I}function as(y,_,I,U){for(;I<=U;){var $=I+U>>1;if(_[$]===y)return!0;_[$]>y?U=$-1:I=$+1}return!1}function ws(y){return{type:y}}Pa.register(Ka,{error:[nf,[qo],function(y,_){var I=_[0];throw new ps(I.evaluate(y))}],typeof:[qo,[Do],function(y,_){var I=_[0];return qs(Es(I.evaluate(y)))}],"to-rgba":[Jl(oa,4),[Ol],function(y,_){var I=_[0];return I.evaluate(y).toArray()}],rgb:[Ol,[oa,oa,oa],bo],rgba:[Ol,[oa,oa,oa,oa],bo],has:{type:Oo,overloads:[[[qo],function(y,_){var I=_[0];return Zo(I.evaluate(y),y.properties())}],[[qo,Pc],function(y,_){var I=_[0],U=_[1];return Zo(I.evaluate(y),U.evaluate(y))}]]},get:{type:Do,overloads:[[[qo],function(y,_){var I=_[0];return Ss(I.evaluate(y),y.properties())}],[[qo,Pc],function(y,_){var I=_[0],U=_[1];return Ss(I.evaluate(y),U.evaluate(y))}]]},"feature-state":[Do,[qo],function(y,_){var I=_[0];return Ss(I.evaluate(y),y.featureState||{})}],properties:[Pc,[],function(y){return y.properties()}],"geometry-type":[qo,[],function(y){return y.geometryType()}],id:[Do,[],function(y){return y.id()}],zoom:[oa,[],function(y){return y.globals.zoom}],"heatmap-density":[oa,[],function(y){return y.globals.heatmapDensity||0}],"line-progress":[oa,[],function(y){return y.globals.lineProgress||0}],accumulated:[Do,[],function(y){return y.globals.accumulated===void 0?null:y.globals.accumulated}],"+":[oa,ws(oa),function(y,_){for(var I=0,U=0,$=_;U<$.length;U+=1){var oe=$[U];I+=oe.evaluate(y)}return I}],"*":[oa,ws(oa),function(y,_){for(var I=1,U=0,$=_;U<$.length;U+=1){var oe=$[U];I*=oe.evaluate(y)}return I}],"-":{type:oa,overloads:[[[oa,oa],function(y,_){var I=_[0],U=_[1];return I.evaluate(y)-U.evaluate(y)}],[[oa],function(y,_){var I=_[0];return-I.evaluate(y)}]]},"/":[oa,[oa,oa],function(y,_){var I=_[0],U=_[1];return I.evaluate(y)/U.evaluate(y)}],"%":[oa,[oa,oa],function(y,_){var I=_[0],U=_[1];return I.evaluate(y)%U.evaluate(y)}],ln2:[oa,[],function(){return Math.LN2}],pi:[oa,[],function(){return Math.PI}],e:[oa,[],function(){return Math.E}],"^":[oa,[oa,oa],function(y,_){var I=_[0],U=_[1];return Math.pow(I.evaluate(y),U.evaluate(y))}],sqrt:[oa,[oa],function(y,_){var I=_[0];return Math.sqrt(I.evaluate(y))}],log10:[oa,[oa],function(y,_){var I=_[0];return Math.log(I.evaluate(y))/Math.LN10}],ln:[oa,[oa],function(y,_){var I=_[0];return Math.log(I.evaluate(y))}],log2:[oa,[oa],function(y,_){var I=_[0];return Math.log(I.evaluate(y))/Math.LN2}],sin:[oa,[oa],function(y,_){var I=_[0];return Math.sin(I.evaluate(y))}],cos:[oa,[oa],function(y,_){var I=_[0];return Math.cos(I.evaluate(y))}],tan:[oa,[oa],function(y,_){var I=_[0];return Math.tan(I.evaluate(y))}],asin:[oa,[oa],function(y,_){var I=_[0];return Math.asin(I.evaluate(y))}],acos:[oa,[oa],function(y,_){var I=_[0];return Math.acos(I.evaluate(y))}],atan:[oa,[oa],function(y,_){var I=_[0];return Math.atan(I.evaluate(y))}],min:[oa,ws(oa),function(y,_){return Math.min.apply(Math,_.map(function(I){return I.evaluate(y)}))}],max:[oa,ws(oa),function(y,_){return Math.max.apply(Math,_.map(function(I){return I.evaluate(y)}))}],abs:[oa,[oa],function(y,_){var I=_[0];return Math.abs(I.evaluate(y))}],round:[oa,[oa],function(y,_){var I=_[0],U=I.evaluate(y);return U<0?-Math.round(-U):Math.round(U)}],floor:[oa,[oa],function(y,_){var I=_[0];return Math.floor(I.evaluate(y))}],ceil:[oa,[oa],function(y,_){var I=_[0];return Math.ceil(I.evaluate(y))}],"filter-==":[Oo,[qo,Do],function(y,_){var I=_[0],U=_[1];return y.properties()[I.value]===U.value}],"filter-id-==":[Oo,[Do],function(y,_){var I=_[0];return y.id()===I.value}],"filter-type-==":[Oo,[qo],function(y,_){var I=_[0];return y.geometryType()===I.value}],"filter-<":[Oo,[qo,Do],function(y,_){var I=_[0],U=_[1],$=y.properties()[I.value],oe=U.value;return typeof $==typeof oe&&$<oe}],"filter-id-<":[Oo,[Do],function(y,_){var I=_[0],U=y.id(),$=I.value;return typeof U==typeof $&&U<$}],"filter->":[Oo,[qo,Do],function(y,_){var I=_[0],U=_[1],$=y.properties()[I.value],oe=U.value;return typeof $==typeof oe&&$>oe}],"filter-id->":[Oo,[Do],function(y,_){var I=_[0],U=y.id(),$=I.value;return typeof U==typeof $&&U>$}],"filter-<=":[Oo,[qo,Do],function(y,_){var I=_[0],U=_[1],$=y.properties()[I.value],oe=U.value;return typeof $==typeof oe&&$<=oe}],"filter-id-<=":[Oo,[Do],function(y,_){var I=_[0],U=y.id(),$=I.value;return typeof U==typeof $&&U<=$}],"filter->=":[Oo,[qo,Do],function(y,_){var I=_[0],U=_[1],$=y.properties()[I.value],oe=U.value;return typeof $==typeof oe&&$>=oe}],"filter-id->=":[Oo,[Do],function(y,_){var I=_[0],U=y.id(),$=I.value;return typeof U==typeof $&&U>=$}],"filter-has":[Oo,[Do],function(y,_){var I=_[0];return I.value in y.properties()}],"filter-has-id":[Oo,[],function(y){return y.id()!==null&&y.id()!==void 0}],"filter-type-in":[Oo,[Jl(qo)],function(y,_){var I=_[0];return I.value.indexOf(y.geometryType())>=0}],"filter-id-in":[Oo,[Jl(Do)],function(y,_){var I=_[0];return I.value.indexOf(y.id())>=0}],"filter-in-small":[Oo,[qo,Jl(Do)],function(y,_){var I=_[0],U=_[1];return U.value.indexOf(y.properties()[I.value])>=0}],"filter-in-large":[Oo,[qo,Jl(Do)],function(y,_){var I=_[0],U=_[1];return as(y.properties()[I.value],U.value,0,U.value.length-1)}],all:{type:Oo,overloads:[[[Oo,Oo],function(y,_){var I=_[0],U=_[1];return I.evaluate(y)&&U.evaluate(y)}],[ws(Oo),function(y,_){for(var I=0,U=_;I<U.length;I+=1){var $=U[I];if(!$.evaluate(y))return!1}return!0}]]},any:{type:Oo,overloads:[[[Oo,Oo],function(y,_){var I=_[0],U=_[1];return I.evaluate(y)||U.evaluate(y)}],[ws(Oo),function(y,_){for(var I=0,U=_;I<U.length;I+=1){var $=U[I];if($.evaluate(y))return!0}return!1}]]},"!":[Oo,[Oo],function(y,_){var I=_[0];return!I.evaluate(y)}],"is-supported-script":[Oo,[qo],function(y,_){var I=_[0],U=y.globals&&y.globals.isSupportedScript;return U?U(I.evaluate(y)):!0}],upcase:[qo,[qo],function(y,_){var I=_[0];return I.evaluate(y).toUpperCase()}],downcase:[qo,[qo],function(y,_){var I=_[0];return I.evaluate(y).toLowerCase()}],concat:[qo,ws(Do),function(y,_){return _.map(function(I){return Hs(I.evaluate(y))}).join("")}],"resolved-locale":[qo,[Vf],function(y,_){var I=_[0];return I.evaluate(y).resolvedLocale()}]});function Ho(y){return{result:"success",value:y}}function ml(y){return{result:"error",value:y}}function Ws(y){return y["property-type"]==="data-driven"||y["property-type"]==="cross-faded-data-driven"}function Ls(y){return!!y.expression&&y.expression.parameters.indexOf("zoom")>-1}function va(y){return!!y.expression&&y.expression.interpolated}function no(y){return y instanceof Number?"number":y instanceof String?"string":y instanceof Boolean?"boolean":Array.isArray(y)?"array":y===null?"null":typeof y}function ys(y){return typeof y=="object"&&y!==null&&!Array.isArray(y)}function rs(y){return y}function Ql(y,_){var I=_.type==="color",U=y.stops&&typeof y.stops[0][0]=="object",$=U||y.property!==void 0,oe=U||!$,he=y.type||(va(_)?"exponential":"interval");if(I&&(y=ql({},y),y.stops&&(y.stops=y.stops.map(function(ha){return[ha[0],cs.parse(ha[1])]})),y.default?y.default=cs.parse(y.default):y.default=cs.parse(_.default)),y.colorSpace&&y.colorSpace!=="rgb"&&!Zf[y.colorSpace])throw new Error("Unknown color space: "+y.colorSpace);var De,it,yt;if(he==="exponential")De=pu;else if(he==="interval")De=Nc;else if(he==="categorical"){De=Yu,it=Object.create(null);for(var Lt=0,sr=y.stops;Lt<sr.length;Lt+=1){var gr=sr[Lt];it[gr[0]]=gr[1]}yt=typeof y.stops[0][0]}else if(he==="identity")De=Uc;else throw new Error('Unknown function type "'+he+'"');if(U){for(var hr={},Rr=[],ni=0;ni<y.stops.length;ni++){var Hi=y.stops[ni],wi=Hi[0].zoom;hr[wi]===void 0&&(hr[wi]={zoom:wi,type:y.type,property:y.property,default:y.default,stops:[]},Rr.push(wi)),hr[wi].stops.push([Hi[0].value,Hi[1]])}for(var bn=[],rn=0,xn=Rr;rn<xn.length;rn+=1){var In=xn[rn];bn.push([hr[In].zoom,Ql(hr[In],_)])}var Xn={name:"linear"};return{kind:"composite",interpolationType:Xn,interpolationFactor:Wl.interpolationFactor.bind(void 0,Xn),zoomStops:bn.map(function(ha){return ha[0]}),evaluate:function(eo,za){var Za=eo.zoom;return pu({stops:bn,base:y.base},_,Za).evaluate(Za,za)}}}else if(oe){var ga=he==="exponential"?{name:"exponential",base:y.base!==void 0?y.base:1}:null;return{kind:"camera",interpolationType:ga,interpolationFactor:Wl.interpolationFactor.bind(void 0,ga),zoomStops:y.stops.map(function(ha){return ha[0]}),evaluate:function(ha){var eo=ha.zoom;return De(y,_,eo,it,yt)}}}else return{kind:"source",evaluate:function(eo,za){var Za=za&&za.properties?za.properties[y.property]:void 0;return Za===void 0?Cu(y.default,_.default):De(y,_,Za,it,yt)}}}function Cu(y,_,I){if(y!==void 0)return y;if(_!==void 0)return _;if(I!==void 0)return I}function Yu(y,_,I,U,$){var oe=typeof I===$?U[I]:void 0;return Cu(oe,y.default,_.default)}function Nc(y,_,I){if(no(I)!=="number")return Cu(y.default,_.default);var U=y.stops.length;if(U===1||I<=y.stops[0][0])return y.stops[0][1];if(I>=y.stops[U-1][0])return y.stops[U-1][1];var $=hu(y.stops.map(function(oe){return oe[0]}),I);return y.stops[$][1]}function pu(y,_,I){var U=y.base!==void 0?y.base:1;if(no(I)!=="number")return Cu(y.default,_.default);var $=y.stops.length;if($===1||I<=y.stops[0][0])return y.stops[0][1];if(I>=y.stops[$-1][0])return y.stops[$-1][1];var oe=hu(y.stops.map(function(sr){return sr[0]}),I),he=xu(I,U,y.stops[oe][0],y.stops[oe+1][0]),De=y.stops[oe][1],it=y.stops[oe+1][1],yt=zu[_.type]||rs;if(y.colorSpace&&y.colorSpace!=="rgb"){var Lt=Zf[y.colorSpace];yt=function(sr,gr){return Lt.reverse(Lt.interpolate(Lt.forward(sr),Lt.forward(gr),he))}}return typeof De.evaluate=="function"?{evaluate:function(){for(var gr=[],hr=arguments.length;hr--;)gr[hr]=arguments[hr];var Rr=De.evaluate.apply(void 0,gr),ni=it.evaluate.apply(void 0,gr);if(!(Rr===void 0||ni===void 0))return yt(Rr,ni,he)}}:yt(De,it,he)}function Uc(y,_,I){return _.type==="color"?I=cs.parse(I):_.type==="formatted"?I=$l.fromString(I.toString()):_.type==="resolvedImage"?I=fl.fromString(I.toString()):no(I)!==_.type&&(_.type!=="enum"||!_.values[I])&&(I=void 0),Cu(I,y.default,_.default)}function xu(y,_,I,U){var $=U-I,oe=y-I;return $===0?0:_===1?oe/$:(Math.pow(_,oe)-1)/(Math.pow(_,$)-1)}var Ac=function(_,I){this.expression=_,this._warningHistory={},this._evaluator=new Ko,this._defaultValue=I?ee(I):null,this._enumValues=I&&I.type==="enum"?I.values:null};Ac.prototype.evaluateWithoutErrorHandling=function(_,I,U,$,oe,he){return this._evaluator.globals=_,this._evaluator.feature=I,this._evaluator.featureState=U,this._evaluator.canonical=$,this._evaluator.availableImages=oe||null,this._evaluator.formattedSection=he,this.expression.evaluate(this._evaluator)},Ac.prototype.evaluate=function(_,I,U,$,oe,he){this._evaluator.globals=_,this._evaluator.feature=I||null,this._evaluator.featureState=U||null,this._evaluator.canonical=$,this._evaluator.availableImages=oe||null,this._evaluator.formattedSection=he||null;try{var De=this.expression.evaluate(this._evaluator);if(De==null||typeof De=="number"&&De!==De)return this._defaultValue;if(this._enumValues&&!(De in this._enumValues))throw new ps("Expected value to be one of "+Object.keys(this._enumValues).map(function(it){return JSON.stringify(it)}).join(", ")+", but found "+JSON.stringify(De)+" instead.");return De}catch(it){return this._warningHistory[it.message]||(this._warningHistory[it.message]=!0,typeof console!="undefined"&&console.warn(it.message)),this._defaultValue}};function Va(y){return Array.isArray(y)&&y.length>0&&typeof y[0]=="string"&&y[0]in Ka}function oo(y,_){var I=new ks(Ka,[],_?Q(_):void 0),U=I.parse(y,void 0,void 0,void 0,_&&_.type==="string"?{typeAnnotation:"coerce"}:void 0);return U?Ho(new Ac(U,_)):ml(I.errors)}var Vc=function(_,I){this.kind=_,this._styleExpression=I,this.isStateDependent=_!=="constant"&&!js(I.expression)};Vc.prototype.evaluateWithoutErrorHandling=function(_,I,U,$,oe,he){return this._styleExpression.evaluateWithoutErrorHandling(_,I,U,$,oe,he)},Vc.prototype.evaluate=function(_,I,U,$,oe,he){return this._styleExpression.evaluate(_,I,U,$,oe,he)};var hc=function(_,I,U,$){this.kind=_,this.zoomStops=U,this._styleExpression=I,this.isStateDependent=_!=="camera"&&!js(I.expression),this.interpolationType=$};hc.prototype.evaluateWithoutErrorHandling=function(_,I,U,$,oe,he){return this._styleExpression.evaluateWithoutErrorHandling(_,I,U,$,oe,he)},hc.prototype.evaluate=function(_,I,U,$,oe,he){return this._styleExpression.evaluate(_,I,U,$,oe,he)},hc.prototype.interpolationFactor=function(_,I,U){return this.interpolationType?Wl.interpolationFactor(this.interpolationType,_,I,U):0};function Ku(y,_){if(y=oo(y,_),y.result==="error")return y;var I=y.value.expression,U=ih(I);if(!U&&!Ws(_))return ml([new Ns("","data expressions not supported")]);var $=Eu(I,["zoom"]);if(!$&&!Ls(_))return ml([new Ns("","zoom expressions not supported")]);var oe=B(I);if(!oe&&!$)return ml([new Ns("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(oe instanceof Ns)return ml([oe]);if(oe instanceof Wl&&!va(_))return ml([new Ns("",'"interpolate" expressions cannot be used with this property')]);if(!oe)return Ho(U?new Vc("constant",y.value):new Vc("source",y.value));var he=oe instanceof Wl?oe.interpolation:void 0;return Ho(U?new hc("camera",y.value,oe.labels,he):new hc("composite",y.value,oe.labels,he))}var ue=function(_,I){this._parameters=_,this._specification=I,ql(this,Ql(this._parameters,this._specification))};ue.deserialize=function(_){return new ue(_._parameters,_._specification)},ue.serialize=function(_){return{_parameters:_._parameters,_specification:_._specification}};function w(y,_){if(ys(y))return new ue(y,_);if(Va(y)){var I=Ku(y,_);if(I.result==="error")throw new Error(I.value.map(function($){return $.key+": "+$.message}).join(", "));return I.value}else{var U=y;return typeof y=="string"&&_.type==="color"&&(U=cs.parse(y)),{kind:"constant",evaluate:function(){return U}}}}function B(y){var _=null;if(y instanceof qc)_=B(y.result);else if(y instanceof Zu)for(var I=0,U=y.args;I<U.length;I+=1){var $=U[I];if(_=B($),_)break}else(y instanceof _u||y instanceof Wl)&&y.input instanceof Pa&&y.input.name==="zoom"&&(_=y);return _ instanceof Ns||y.eachChild(function(oe){var he=B(oe);he instanceof Ns?_=he:!_&&he?_=new Ns("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):_&&he&&_!==he&&(_=new Ns("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),_}function Q(y){var _={color:Ol,string:qo,number:oa,enum:qo,boolean:Oo,formatted:pl,resolvedImage:Zc};return y.type==="array"?Jl(_[y.value]||Do,y.length):_[y.type]}function ee(y){return y.type==="color"&&ys(y.default)?new cs(0,0,0,0):y.type==="color"?cs.parse(y.default)||null:y.default===void 0?null:y.default}function le(y){var _=y.key,I=y.value,U=y.valueSpec||{},$=y.objectElementValidators||{},oe=y.style,he=y.styleSpec,De=[],it=no(I);if(it!=="object")return[new _a(_,I,"object expected, "+it+" found")];for(var yt in I){var Lt=yt.split(".")[0],sr=U[Lt]||U["*"],gr=void 0;if($[Lt])gr=$[Lt];else if(U[Lt])gr=Qa;else if($["*"])gr=$["*"];else if(U["*"])gr=Qa;else{De.push(new _a(_,I[yt],'unknown property "'+yt+'"'));continue}De=De.concat(gr({key:(_&&_+".")+yt,value:I[yt],valueSpec:sr,style:oe,styleSpec:he,object:I,objectKey:yt},I))}for(var hr in U)$[hr]||U[hr].required&&U[hr].default===void 0&&I[hr]===void 0&&De.push(new _a(_,I,'missing required property "'+hr+'"'));return De}function Fe(y){var _=y.value,I=y.valueSpec,U=y.style,$=y.styleSpec,oe=y.key,he=y.arrayElementValidator||Qa;if(no(_)!=="array")return[new _a(oe,_,"array expected, "+no(_)+" found")];if(I.length&&_.length!==I.length)return[new _a(oe,_,"array length "+I.length+" expected, length "+_.length+" found")];if(I["min-length"]&&_.length<I["min-length"])return[new _a(oe,_,"array length at least "+I["min-length"]+" expected, length "+_.length+" found")];var De={type:I.value,values:I.values};$.$version<7&&(De.function=I.function),no(I.value)==="object"&&(De=I.value);for(var it=[],yt=0;yt<_.length;yt++)it=it.concat(he({array:_,arrayIndex:yt,value:_[yt],valueSpec:De,style:U,styleSpec:$,key:oe+"["+yt+"]"}));return it}function Ze(y){var _=y.key,I=y.value,U=y.valueSpec,$=no(I);return $==="number"&&I!==I&&($="NaN"),$!=="number"?[new _a(_,I,"number expected, "+$+" found")]:"minimum"in U&&I<U.minimum?[new _a(_,I,I+" is less than the minimum value "+U.minimum)]:"maximum"in U&&I>U.maximum?[new _a(_,I,I+" is greater than the maximum value "+U.maximum)]:[]}function ut(y){var _=y.valueSpec,I=xo(y.value.type),U,$={},oe,he,De=I!=="categorical"&&y.value.property===void 0,it=!De,yt=no(y.value.stops)==="array"&&no(y.value.stops[0])==="array"&&no(y.value.stops[0][0])==="object",Lt=le({key:y.key,value:y.value,valueSpec:y.styleSpec.function,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{stops:sr,default:Rr}});return I==="identity"&&De&&Lt.push(new _a(y.key,y.value,'missing required property "property"')),I!=="identity"&&!y.value.stops&&Lt.push(new _a(y.key,y.value,'missing required property "stops"')),I==="exponential"&&y.valueSpec.expression&&!va(y.valueSpec)&&Lt.push(new _a(y.key,y.value,"exponential functions not supported")),y.styleSpec.$version>=8&&(it&&!Ws(y.valueSpec)?Lt.push(new _a(y.key,y.value,"property functions not supported")):De&&!Ls(y.valueSpec)&&Lt.push(new _a(y.key,y.value,"zoom functions not supported"))),(I==="categorical"||yt)&&y.value.property===void 0&&Lt.push(new _a(y.key,y.value,'"property" property is required')),Lt;function sr(ni){if(I==="identity")return[new _a(ni.key,ni.value,'identity function may not have a "stops" property')];var Hi=[],wi=ni.value;return Hi=Hi.concat(Fe({key:ni.key,value:wi,valueSpec:ni.valueSpec,style:ni.style,styleSpec:ni.styleSpec,arrayElementValidator:gr})),no(wi)==="array"&&wi.length===0&&Hi.push(new _a(ni.key,wi,"array must have at least one stop")),Hi}function gr(ni){var Hi=[],wi=ni.value,bn=ni.key;if(no(wi)!=="array")return[new _a(bn,wi,"array expected, "+no(wi)+" found")];if(wi.length!==2)return[new _a(bn,wi,"array length 2 expected, length "+wi.length+" found")];if(yt){if(no(wi[0])!=="object")return[new _a(bn,wi,"object expected, "+no(wi[0])+" found")];if(wi[0].zoom===void 0)return[new _a(bn,wi,"object stop key must have zoom")];if(wi[0].value===void 0)return[new _a(bn,wi,"object stop key must have value")];if(he&&he>xo(wi[0].zoom))return[new _a(bn,wi[0].zoom,"stop zoom values must appear in ascending order")];xo(wi[0].zoom)!==he&&(he=xo(wi[0].zoom),oe=void 0,$={}),Hi=Hi.concat(le({key:bn+"[0]",value:wi[0],valueSpec:{zoom:{}},style:ni.style,styleSpec:ni.styleSpec,objectElementValidators:{zoom:Ze,value:hr}}))}else Hi=Hi.concat(hr({key:bn+"[0]",value:wi[0],valueSpec:{},style:ni.style,styleSpec:ni.styleSpec},wi));return Va(Kl(wi[1]))?Hi.concat([new _a(bn+"[1]",wi[1],"expressions are not allowed in function stops.")]):Hi.concat(Qa({key:bn+"[1]",value:wi[1],valueSpec:_,style:ni.style,styleSpec:ni.styleSpec}))}function hr(ni,Hi){var wi=no(ni.value),bn=xo(ni.value),rn=ni.value!==null?ni.value:Hi;if(!U)U=wi;else if(wi!==U)return[new _a(ni.key,rn,wi+" stop domain type must match previous stop domain type "+U)];if(wi!=="number"&&wi!=="string"&&wi!=="boolean")return[new _a(ni.key,rn,"stop domain value must be a number, string, or boolean")];if(wi!=="number"&&I!=="categorical"){var xn="number expected, "+wi+" found";return Ws(_)&&I===void 0&&(xn+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new _a(ni.key,rn,xn)]}return I==="categorical"&&wi==="number"&&(!isFinite(bn)||Math.floor(bn)!==bn)?[new _a(ni.key,rn,"integer expected, found "+bn)]:I!=="categorical"&&wi==="number"&&oe!==void 0&&bn<oe?[new _a(ni.key,rn,"stop domain values must appear in ascending order")]:(oe=bn,I==="categorical"&&bn in $?[new _a(ni.key,rn,"stop domain values must be unique")]:($[bn]=!0,[]))}function Rr(ni){return Qa({key:ni.key,value:ni.value,valueSpec:_,style:ni.style,styleSpec:ni.styleSpec})}}function Mt(y){var _=(y.expressionContext==="property"?Ku:oo)(Kl(y.value),y.valueSpec);if(_.result==="error")return _.value.map(function(U){return new _a(""+y.key+U.key,y.value,U.message)});var I=_.value.expression||_.value._styleExpression.expression;if(y.expressionContext==="property"&&y.propertyKey==="text-font"&&!I.outputDefined())return[new _a(y.key,y.value,'Invalid data expression for "'+y.propertyKey+'". Output values must be contained as literals within the expression.')];if(y.expressionContext==="property"&&y.propertyType==="layout"&&!js(I))return[new _a(y.key,y.value,'"feature-state" data expressions are not supported with layout properties.')];if(y.expressionContext==="filter"&&!js(I))return[new _a(y.key,y.value,'"feature-state" data expressions are not supported with filters.')];if(y.expressionContext&&y.expressionContext.indexOf("cluster")===0){if(!Eu(I,["zoom","feature-state"]))return[new _a(y.key,y.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(y.expressionContext==="cluster-initial"&&!ih(I))return[new _a(y.key,y.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Jt(y){var _=y.value,I=y.key,U=no(_);return U!=="boolean"?[new _a(I,_,"boolean expected, "+U+" found")]:[]}function $t(y){var _=y.key,I=y.value,U=no(I);return U!=="string"?[new _a(_,I,"color expected, "+U+" found")]:Lf(I)===null?[new _a(_,I,'color expected, "'+I+'" found')]:[]}function yr(y){var _=y.key,I=y.value,U=y.valueSpec,$=[];return Array.isArray(U.values)?U.values.indexOf(xo(I))===-1&&$.push(new _a(_,I,"expected one of ["+U.values.join(", ")+"], "+JSON.stringify(I)+" found")):Object.keys(U.values).indexOf(xo(I))===-1&&$.push(new _a(_,I,"expected one of ["+Object.keys(U.values).join(", ")+"], "+JSON.stringify(I)+" found")),$}function Cr(y){if(y===!0||y===!1)return!0;if(!Array.isArray(y)||y.length===0)return!1;switch(y[0]){case"has":return y.length>=2&&y[1]!=="$id"&&y[1]!=="$type";case"in":return y.length>=3&&(typeof y[1]!="string"||Array.isArray(y[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return y.length!==3||Array.isArray(y[1])||Array.isArray(y[2]);case"any":case"all":for(var _=0,I=y.slice(1);_<I.length;_+=1){var U=I[_];if(!Cr(U)&&typeof U!="boolean")return!1}return!0;default:return!0}}var ve={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function xe(y){if(y==null)return{filter:function(){return!0},needGeometry:!1};Cr(y)||(y=Qe(y));var _=oo(y,ve);if(_.result==="error")throw new Error(_.value.map(function(U){return U.key+": "+U.message}).join(", "));var I=ze(y);return{filter:function(U,$,oe){return _.value.evaluate(U,$,{},oe)},needGeometry:I}}function Ie(y,_){return y<_?-1:y>_?1:0}function ze(y){if(!Array.isArray(y))return!1;if(y[0]==="within")return!0;for(var _=1;_<y.length;_++)if(ze(y[_]))return!0;return!1}function Qe(y){if(!y)return!0;var _=y[0];if(y.length<=1)return _!=="any";var I=_==="=="?Xe(y[1],y[2],"=="):_==="!="?nr(Xe(y[1],y[2],"==")):_==="<"||_===">"||_==="<="||_===">="?Xe(y[1],y[2],_):_==="any"?nt(y.slice(1)):_==="all"?["all"].concat(y.slice(1).map(Qe)):_==="none"?["all"].concat(y.slice(1).map(Qe).map(nr)):_==="in"?qt(y[1],y.slice(2)):_==="!in"?nr(qt(y[1],y.slice(2))):_==="has"?Wt(y[1]):_==="!has"?nr(Wt(y[1])):_==="within"?y:!0;return I}function Xe(y,_,I){switch(y){case"$type":return["filter-type-"+I,_];case"$id":return["filter-id-"+I,_];default:return["filter-"+I,y,_]}}function nt(y){return["any"].concat(y.map(Qe))}function qt(y,_){if(_.length===0)return!1;switch(y){case"$type":return["filter-type-in",["literal",_]];case"$id":return["filter-id-in",["literal",_]];default:return _.length>200&&!_.some(function(I){return typeof I!=typeof _[0]})?["filter-in-large",y,["literal",_.sort(Ie)]]:["filter-in-small",y,["literal",_]]}}function Wt(y){switch(y){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",y]}}function nr(y){return["!",y]}function fr(y){return Cr(Kl(y.value))?Mt(ql({},y,{expressionContext:"filter",valueSpec:{value:"boolean"}})):br(y)}function br(y){var _=y.value,I=y.key;if(no(_)!=="array")return[new _a(I,_,"array expected, "+no(_)+" found")];var U=y.styleSpec,$,oe=[];if(_.length<1)return[new _a(I,_,"filter array must have at least 1 element")];switch(oe=oe.concat(yr({key:I+"[0]",value:_[0],valueSpec:U.filter_operator,style:y.style,styleSpec:y.styleSpec})),xo(_[0])){case"<":case"<=":case">":case">=":_.length>=2&&xo(_[1])==="$type"&&oe.push(new _a(I,_,'"$type" cannot be use with operator "'+_[0]+'"'));case"==":case"!=":_.length!==3&&oe.push(new _a(I,_,'filter array for operator "'+_[0]+'" must have 3 elements'));case"in":case"!in":_.length>=2&&($=no(_[1]),$!=="string"&&oe.push(new _a(I+"[1]",_[1],"string expected, "+$+" found")));for(var he=2;he<_.length;he++)$=no(_[he]),xo(_[1])==="$type"?oe=oe.concat(yr({key:I+"["+he+"]",value:_[he],valueSpec:U.geometry_type,style:y.style,styleSpec:y.styleSpec})):$!=="string"&&$!=="number"&&$!=="boolean"&&oe.push(new _a(I+"["+he+"]",_[he],"string, number, or boolean expected, "+$+" found"));break;case"any":case"all":case"none":for(var De=1;De<_.length;De++)oe=oe.concat(br({key:I+"["+De+"]",value:_[De],style:y.style,styleSpec:y.styleSpec}));break;case"has":case"!has":$=no(_[1]),_.length!==2?oe.push(new _a(I,_,'filter array for "'+_[0]+'" operator must have 2 elements')):$!=="string"&&oe.push(new _a(I+"[1]",_[1],"string expected, "+$+" found"));break;case"within":$=no(_[1]),_.length!==2?oe.push(new _a(I,_,'filter array for "'+_[0]+'" operator must have 2 elements')):$!=="object"&&oe.push(new _a(I+"[1]",_[1],"object expected, "+$+" found"));break}return oe}function Fr(y,_){var I=y.key,U=y.style,$=y.styleSpec,oe=y.value,he=y.objectKey,De=$[_+"_"+y.layerType];if(!De)return[];var it=he.match(/^(.*)-transition$/);if(_==="paint"&&it&&De[it[1]]&&De[it[1]].transition)return Qa({key:I,value:oe,valueSpec:$.transition,style:U,styleSpec:$});var yt=y.valueSpec||De[he];if(!yt)return[new _a(I,oe,'unknown property "'+he+'"')];var Lt;if(no(oe)==="string"&&Ws(yt)&&!yt.tokens&&(Lt=/^{([^}]+)}$/.exec(oe)))return[new _a(I,oe,'"'+he+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(Lt[1])+" }`.")];var sr=[];return y.layerType==="symbol"&&(he==="text-field"&&U&&!U.glyphs&&sr.push(new _a(I,oe,'use of "text-field" requires a style "glyphs" property')),he==="text-font"&&ys(Kl(oe))&&xo(oe.type)==="identity"&&sr.push(new _a(I,oe,'"text-font" does not support identity functions'))),sr.concat(Qa({key:y.key,value:oe,valueSpec:yt,style:U,styleSpec:$,expressionContext:"property",propertyType:_,propertyKey:he}))}function Hr(y){return Fr(y,"paint")}function ri(y){return Fr(y,"layout")}function Ci(y){var _=[],I=y.value,U=y.key,$=y.style,oe=y.styleSpec;!I.type&&!I.ref&&_.push(new _a(U,I,'either "type" or "ref" is required'));var he=xo(I.type),De=xo(I.ref);if(I.id)for(var it=xo(I.id),yt=0;yt<y.arrayIndex;yt++){var Lt=$.layers[yt];xo(Lt.id)===it&&_.push(new _a(U,I.id,'duplicate layer id "'+I.id+'", previously used at line '+Lt.id.__line__))}if("ref"in I){["type","source","source-layer","filter","layout"].forEach(function(Rr){Rr in I&&_.push(new _a(U,I[Rr],'"'+Rr+'" is prohibited for ref layers'))});var sr;$.layers.forEach(function(Rr){xo(Rr.id)===De&&(sr=Rr)}),sr?sr.ref?_.push(new _a(U,I.ref,"ref cannot reference another ref layer")):he=xo(sr.type):_.push(new _a(U,I.ref,'ref layer "'+De+'" not found'))}else if(he!=="background")if(!I.source)_.push(new _a(U,I,'missing required property "source"'));else{var gr=$.sources&&$.sources[I.source],hr=gr&&xo(gr.type);gr?hr==="vector"&&he==="raster"?_.push(new _a(U,I.source,'layer "'+I.id+'" requires a raster source')):hr==="raster"&&he!=="raster"?_.push(new _a(U,I.source,'layer "'+I.id+'" requires a vector source')):hr==="vector"&&!I["source-layer"]?_.push(new _a(U,I,'layer "'+I.id+'" must specify a "source-layer"')):hr==="raster-dem"&&he!=="hillshade"?_.push(new _a(U,I.source,"raster-dem source can only be used with layer type 'hillshade'.")):he==="line"&&I.paint&&I.paint["line-gradient"]&&(hr!=="geojson"||!gr.lineMetrics)&&_.push(new _a(U,I,'layer "'+I.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):_.push(new _a(U,I.source,'source "'+I.source+'" not found'))}return _=_.concat(le({key:U,value:I,valueSpec:oe.layer,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Qa({key:U+".type",value:I.type,valueSpec:oe.layer.type,style:y.style,styleSpec:y.styleSpec,object:I,objectKey:"type"})},filter:fr,layout:function(ni){return le({layer:I,key:ni.key,value:ni.value,style:ni.style,styleSpec:ni.styleSpec,objectElementValidators:{"*":function(wi){return ri(ql({layerType:he},wi))}}})},paint:function(ni){return le({layer:I,key:ni.key,value:ni.value,style:ni.style,styleSpec:ni.styleSpec,objectElementValidators:{"*":function(wi){return Hr(ql({layerType:he},wi))}}})}}})),_}function cn(y){var _=y.value,I=y.key,U=no(_);return U!=="string"?[new _a(I,_,"string expected, "+U+" found")]:[]}var sn={promoteId:Yn};function Ln(y){var _=y.value,I=y.key,U=y.styleSpec,$=y.style;if(!_.type)return[new _a(I,_,'"type" is required')];var oe=xo(_.type),he;switch(oe){case"vector":case"raster":case"raster-dem":return he=le({key:I,value:_,valueSpec:U["source_"+oe.replace("-","_")],style:y.style,styleSpec:U,objectElementValidators:sn}),he;case"geojson":if(he=le({key:I,value:_,valueSpec:U.source_geojson,style:$,styleSpec:U,objectElementValidators:sn}),_.cluster)for(var De in _.clusterProperties){var it=_.clusterProperties[De],yt=it[0],Lt=it[1],sr=typeof yt=="string"?[yt,["accumulated"],["get",De]]:yt;he.push.apply(he,Mt({key:I+"."+De+".map",value:Lt,expressionContext:"cluster-map"})),he.push.apply(he,Mt({key:I+"."+De+".reduce",value:sr,expressionContext:"cluster-reduce"}))}return he;case"video":return le({key:I,value:_,valueSpec:U.source_video,style:$,styleSpec:U});case"image":return le({key:I,value:_,valueSpec:U.source_image,style:$,styleSpec:U});case"canvas":return[new _a(I,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return yr({key:I+".type",value:_.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:$,styleSpec:U})}}function Yn(y){var _=y.key,I=y.value;if(no(I)==="string")return cn({key:_,value:I});var U=[];for(var $ in I)U.push.apply(U,cn({key:_+"."+$,value:I[$]}));return U}function Aa(y){var _=y.value,I=y.styleSpec,U=I.light,$=y.style,oe=[],he=no(_);if(_===void 0)return oe;if(he!=="object")return oe=oe.concat([new _a("light",_,"object expected, "+he+" found")]),oe;for(var De in _){var it=De.match(/^(.*)-transition$/);it&&U[it[1]]&&U[it[1]].transition?oe=oe.concat(Qa({key:De,value:_[De],valueSpec:I.transition,style:$,styleSpec:I})):U[De]?oe=oe.concat(Qa({key:De,value:_[De],valueSpec:U[De],style:$,styleSpec:I})):oe=oe.concat([new _a(De,_[De],'unknown property "'+De+'"')])}return oe}function fa(y){return cn(y).length===0?[]:Mt(y)}function $a(y){return cn(y).length===0?[]:Mt(y)}var Co={"*":function(){return[]},array:Fe,boolean:Jt,number:Ze,color:$t,constants:Vu,enum:yr,filter:fr,function:ut,layer:Ci,object:le,source:Ln,light:Aa,string:cn,formatted:fa,resolvedImage:$a};function Qa(y){var _=y.value,I=y.valueSpec,U=y.styleSpec;if(I.expression&&ys(xo(_)))return ut(y);if(I.expression&&Va(Kl(_)))return Mt(y);if(I.type&&Co[I.type])return Co[I.type](y);var $=le(ql({},y,{valueSpec:I.type?U[I.type]:I}));return $}function mo(y){var _=y.value,I=y.key,U=cn(y);return U.length||(_.indexOf("{fontstack}")===-1&&U.push(new _a(I,_,'"glyphs" url must include a "{fontstack}" token')),_.indexOf("{range}")===-1&&U.push(new _a(I,_,'"glyphs" url must include a "{range}" token'))),U}function Bo(y,_){_===void 0&&(_=Rn);var I=[];return I=I.concat(Qa({key:"",value:y,valueSpec:_.$root,styleSpec:_,style:y,objectElementValidators:{glyphs:mo,"*":function(){return[]}}})),y.constants&&(I=I.concat(Vu({key:"constants",value:y.constants,style:y,styleSpec:_}))),Ps(I)}Bo.source=Ts(Ln),Bo.light=Ts(Aa),Bo.layer=Ts(Ci),Bo.filter=Ts(fr),Bo.paintProperty=Ts(Hr),Bo.layoutProperty=Ts(ri);function Ps(y){return[].concat(y).sort(function(_,I){return _.line-I.line})}function Ts(y){return function(){for(var _=[],I=arguments.length;I--;)_[I]=arguments[I];return Ps(y.apply(this,_))}}var wo=Bo,To=wo.light,hl=wo.paintProperty,Ul=wo.layoutProperty;function Lu(y,_){var I=!1;if(_&&_.length)for(var U=0,$=_;U<$.length;U+=1){var oe=$[U];y.fire(new da(new Error(oe.message))),I=!0}return I}var au=eu,Js=3;function eu(y,_,I){var U=this.cells=[];if(y instanceof ArrayBuffer){this.arrayBuffer=y;var $=new Int32Array(this.arrayBuffer);y=$[0],_=$[1],I=$[2],this.d=_+2*I;for(var oe=0;oe<this.d*this.d;oe++){var he=$[Js+oe],De=$[Js+oe+1];U.push(he===De?null:$.subarray(he,De))}var it=$[Js+U.length],yt=$[Js+U.length+1];this.keys=$.subarray(it,yt),this.bboxes=$.subarray(yt),this.insert=this._insertReadonly}else{this.d=_+2*I;for(var Lt=0;Lt<this.d*this.d;Lt++)U.push([]);this.keys=[],this.bboxes=[]}this.n=_,this.extent=y,this.padding=I,this.scale=_/y,this.uid=0;var sr=I/_*y;this.min=-sr,this.max=y+sr}eu.prototype.insert=function(y,_,I,U,$){this._forEachCell(_,I,U,$,this._insertCell,this.uid++),this.keys.push(y),this.bboxes.push(_),this.bboxes.push(I),this.bboxes.push(U),this.bboxes.push($)},eu.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},eu.prototype._insertCell=function(y,_,I,U,$,oe){this.cells[$].push(oe)},eu.prototype.query=function(y,_,I,U,$){var oe=this.min,he=this.max;if(y<=oe&&_<=oe&&he<=I&&he<=U&&!$)return Array.prototype.slice.call(this.keys);var De=[],it={};return this._forEachCell(y,_,I,U,this._queryCell,De,it,$),De},eu.prototype._queryCell=function(y,_,I,U,$,oe,he,De){var it=this.cells[$];if(it!==null)for(var yt=this.keys,Lt=this.bboxes,sr=0;sr<it.length;sr++){var gr=it[sr];if(he[gr]===void 0){var hr=gr*4;(De?De(Lt[hr+0],Lt[hr+1],Lt[hr+2],Lt[hr+3]):y<=Lt[hr+2]&&_<=Lt[hr+3]&&I>=Lt[hr+0]&&U>=Lt[hr+1])?(he[gr]=!0,oe.push(yt[gr])):he[gr]=!1}}},eu.prototype._forEachCell=function(y,_,I,U,$,oe,he,De){for(var it=this._convertToCellCoord(y),yt=this._convertToCellCoord(_),Lt=this._convertToCellCoord(I),sr=this._convertToCellCoord(U),gr=it;gr<=Lt;gr++)for(var hr=yt;hr<=sr;hr++){var Rr=this.d*hr+gr;if(!(De&&!De(this._convertFromCellCoord(gr),this._convertFromCellCoord(hr),this._convertFromCellCoord(gr+1),this._convertFromCellCoord(hr+1)))&&$.call(this,y,_,I,U,Rr,oe,he,De))return}},eu.prototype._convertFromCellCoord=function(y){return(y-this.padding)/this.scale},eu.prototype._convertToCellCoord=function(y){return Math.max(0,Math.min(this.d-1,Math.floor(y*this.scale)+this.padding))},eu.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var y=this.cells,_=Js+this.cells.length+1+1,I=0,U=0;U<this.cells.length;U++)I+=this.cells[U].length;var $=new Int32Array(_+I+this.keys.length+this.bboxes.length);$[0]=this.extent,$[1]=this.n,$[2]=this.padding;for(var oe=_,he=0;he<y.length;he++){var De=y[he];$[Js+he]=oe,$.set(De,oe),oe+=De.length}return $[Js+y.length]=oe,$.set(this.keys,oe),oe+=this.keys.length,$[Js+y.length+1]=oe,$.set(this.bboxes,oe),oe+=this.bboxes.length,$.buffer};var dc=f.ImageData,Tl=f.ImageBitmap,Al={};function X(y,_,I){I===void 0&&(I={}),Object.defineProperty(_,"_classRegistryKey",{value:y,writeable:!1}),Al[y]={klass:_,omit:I.omit||[],shallow:I.shallow||[]}}X("Object",Object),au.serialize=function(_,I){var U=_.toArrayBuffer();return I&&I.push(U),{buffer:U}},au.deserialize=function(_){return new au(_.buffer)},X("Grid",au),X("Color",cs),X("Error",Error),X("ResolvedImage",fl),X("StylePropertyFunction",ue),X("StyleExpression",Ac,{omit:["_evaluator"]}),X("ZoomDependentExpression",hc),X("ZoomConstantExpression",Vc),X("CompoundExpression",Pa,{omit:["_evaluate"]});for(var se in Ka)Ka[se]._classRegistryKey||X("Expression_"+se,Ka[se]);function Te(y){return y&&typeof ArrayBuffer!="undefined"&&(y instanceof ArrayBuffer||y.constructor&&y.constructor.name==="ArrayBuffer")}function qe(y){return Tl&&y instanceof Tl}function Ve(y,_){if(y==null||typeof y=="boolean"||typeof y=="number"||typeof y=="string"||y instanceof Boolean||y instanceof Number||y instanceof String||y instanceof Date||y instanceof RegExp)return y;if(Te(y)||qe(y))return _&&_.push(y),y;if(ArrayBuffer.isView(y)){var I=y;return _&&_.push(I.buffer),I}if(y instanceof dc)return _&&_.push(y.data.buffer),y;if(Array.isArray(y)){for(var U=[],$=0,oe=y;$<oe.length;$+=1){var he=oe[$];U.push(Ve(he,_))}return U}if(typeof y=="object"){var De=y.constructor,it=De._classRegistryKey;if(!it)throw new Error("can't serialize object of unregistered class");var yt=De.serialize?De.serialize(y,_):{};if(!De.serialize){for(var Lt in y)if(y.hasOwnProperty(Lt)&&!(Al[it].omit.indexOf(Lt)>=0)){var sr=y[Lt];yt[Lt]=Al[it].shallow.indexOf(Lt)>=0?sr:Ve(sr,_)}y instanceof Error&&(yt.message=y.message)}if(yt.$name)throw new Error("$name property is reserved for worker serialization logic.");return it!=="Object"&&(yt.$name=it),yt}throw new Error("can't serialize object of type "+typeof y)}function Ye(y){if(y==null||typeof y=="boolean"||typeof y=="number"||typeof y=="string"||y instanceof Boolean||y instanceof Number||y instanceof String||y instanceof Date||y instanceof RegExp||Te(y)||qe(y)||ArrayBuffer.isView(y)||y instanceof dc)return y;if(Array.isArray(y))return y.map(Ye);if(typeof y=="object"){var _=y.$name||"Object",I=Al[_],U=I.klass;if(!U)throw new Error("can't deserialize unregistered class "+_);if(U.deserialize)return U.deserialize(y);for(var $=Object.create(U.prototype),oe=0,he=Object.keys(y);oe<he.length;oe+=1){var De=he[oe];if(De!=="$name"){var it=y[De];$[De]=Al[_].shallow.indexOf(De)>=0?it:Ye(it)}}return $}throw new Error("can't deserialize object of type "+typeof y)}var Pt=function(){this.first=!0};Pt.prototype.update=function(_,I){var U=Math.floor(_);return this.first?(this.first=!1,this.lastIntegerZoom=U,this.lastIntegerZoomTime=0,this.lastZoom=_,this.lastFloorZoom=U,!0):(this.lastFloorZoom>U?(this.lastIntegerZoom=U+1,this.lastIntegerZoomTime=I):this.lastFloorZoom<U&&(this.lastIntegerZoom=U,this.lastIntegerZoomTime=I),_!==this.lastZoom?(this.lastZoom=_,this.lastFloorZoom=U,!0):!1)};var ot={"Latin-1 Supplement":function(y){return y>=128&&y<=255},Arabic:function(y){return y>=1536&&y<=1791},"Arabic Supplement":function(y){return y>=1872&&y<=1919},"Arabic Extended-A":function(y){return y>=2208&&y<=2303},"Hangul Jamo":function(y){return y>=4352&&y<=4607},"Unified Canadian Aboriginal Syllabics":function(y){return y>=5120&&y<=5759},Khmer:function(y){return y>=6016&&y<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(y){return y>=6320&&y<=6399},"General Punctuation":function(y){return y>=8192&&y<=8303},"Letterlike Symbols":function(y){return y>=8448&&y<=8527},"Number Forms":function(y){return y>=8528&&y<=8591},"Miscellaneous Technical":function(y){return y>=8960&&y<=9215},"Control Pictures":function(y){return y>=9216&&y<=9279},"Optical Character Recognition":function(y){return y>=9280&&y<=9311},"Enclosed Alphanumerics":function(y){return y>=9312&&y<=9471},"Geometric Shapes":function(y){return y>=9632&&y<=9727},"Miscellaneous Symbols":function(y){return y>=9728&&y<=9983},"Miscellaneous Symbols and Arrows":function(y){return y>=11008&&y<=11263},"CJK Radicals Supplement":function(y){return y>=11904&&y<=12031},"Kangxi Radicals":function(y){return y>=12032&&y<=12255},"Ideographic Description Characters":function(y){return y>=12272&&y<=12287},"CJK Symbols and Punctuation":function(y){return y>=12288&&y<=12351},Hiragana:function(y){return y>=12352&&y<=12447},Katakana:function(y){return y>=12448&&y<=12543},Bopomofo:function(y){return y>=12544&&y<=12591},"Hangul Compatibility Jamo":function(y){return y>=12592&&y<=12687},Kanbun:function(y){return y>=12688&&y<=12703},"Bopomofo Extended":function(y){return y>=12704&&y<=12735},"CJK Strokes":function(y){return y>=12736&&y<=12783},"Katakana Phonetic Extensions":function(y){return y>=12784&&y<=12799},"Enclosed CJK Letters and Months":function(y){return y>=12800&&y<=13055},"CJK Compatibility":function(y){return y>=13056&&y<=13311},"CJK Unified Ideographs Extension A":function(y){return y>=13312&&y<=19903},"Yijing Hexagram Symbols":function(y){return y>=19904&&y<=19967},"CJK Unified Ideographs":function(y){return y>=19968&&y<=40959},"Yi Syllables":function(y){return y>=40960&&y<=42127},"Yi Radicals":function(y){return y>=42128&&y<=42191},"Hangul Jamo Extended-A":function(y){return y>=43360&&y<=43391},"Hangul Syllables":function(y){return y>=44032&&y<=55215},"Hangul Jamo Extended-B":function(y){return y>=55216&&y<=55295},"Private Use Area":function(y){return y>=57344&&y<=63743},"CJK Compatibility Ideographs":function(y){return y>=63744&&y<=64255},"Arabic Presentation Forms-A":function(y){return y>=64336&&y<=65023},"Vertical Forms":function(y){return y>=65040&&y<=65055},"CJK Compatibility Forms":function(y){return y>=65072&&y<=65103},"Small Form Variants":function(y){return y>=65104&&y<=65135},"Arabic Presentation Forms-B":function(y){return y>=65136&&y<=65279},"Halfwidth and Fullwidth Forms":function(y){return y>=65280&&y<=65519}};function Xt(y){for(var _=0,I=y;_<I.length;_+=1){var U=I[_];if(zr(U.charCodeAt(0)))return!0}return!1}function dr(y){for(var _=0,I=y;_<I.length;_+=1){var U=I[_];if(!pr(U.charCodeAt(0)))return!1}return!0}function pr(y){return!(ot.Arabic(y)||ot["Arabic Supplement"](y)||ot["Arabic Extended-A"](y)||ot["Arabic Presentation Forms-A"](y)||ot["Arabic Presentation Forms-B"](y))}function Ur(y){return y<11904?!1:!!(ot["Bopomofo Extended"](y)||ot.Bopomofo(y)||ot["CJK Compatibility Forms"](y)||ot["CJK Compatibility Ideographs"](y)||ot["CJK Compatibility"](y)||ot["CJK Radicals Supplement"](y)||ot["CJK Strokes"](y)||ot["CJK Symbols and Punctuation"](y)||ot["CJK Unified Ideographs Extension A"](y)||ot["CJK Unified Ideographs"](y)||ot["Enclosed CJK Letters and Months"](y)||ot["Halfwidth and Fullwidth Forms"](y)||ot.Hiragana(y)||ot["Ideographic Description Characters"](y)||ot["Kangxi Radicals"](y)||ot["Katakana Phonetic Extensions"](y)||ot.Katakana(y)||ot["Vertical Forms"](y)||ot["Yi Radicals"](y)||ot["Yi Syllables"](y))}function zr(y){return y===746||y===747?!0:y<4352?!1:!!(ot["Bopomofo Extended"](y)||ot.Bopomofo(y)||ot["CJK Compatibility Forms"](y)&&!(y>=65097&&y<=65103)||ot["CJK Compatibility Ideographs"](y)||ot["CJK Compatibility"](y)||ot["CJK Radicals Supplement"](y)||ot["CJK Strokes"](y)||ot["CJK Symbols and Punctuation"](y)&&!(y>=12296&&y<=12305)&&!(y>=12308&&y<=12319)&&y!==12336||ot["CJK Unified Ideographs Extension A"](y)||ot["CJK Unified Ideographs"](y)||ot["Enclosed CJK Letters and Months"](y)||ot["Hangul Compatibility Jamo"](y)||ot["Hangul Jamo Extended-A"](y)||ot["Hangul Jamo Extended-B"](y)||ot["Hangul Jamo"](y)||ot["Hangul Syllables"](y)||ot.Hiragana(y)||ot["Ideographic Description Characters"](y)||ot.Kanbun(y)||ot["Kangxi Radicals"](y)||ot["Katakana Phonetic Extensions"](y)||ot.Katakana(y)&&y!==12540||ot["Halfwidth and Fullwidth Forms"](y)&&y!==65288&&y!==65289&&y!==65293&&!(y>=65306&&y<=65310)&&y!==65339&&y!==65341&&y!==65343&&!(y>=65371&&y<=65503)&&y!==65507&&!(y>=65512&&y<=65519)||ot["Small Form Variants"](y)&&!(y>=65112&&y<=65118)&&!(y>=65123&&y<=65126)||ot["Unified Canadian Aboriginal Syllabics"](y)||ot["Unified Canadian Aboriginal Syllabics Extended"](y)||ot["Vertical Forms"](y)||ot["Yijing Hexagram Symbols"](y)||ot["Yi Syllables"](y)||ot["Yi Radicals"](y))}function gi(y){return!!(ot["Latin-1 Supplement"](y)&&(y===167||y===169||y===174||y===177||y===188||y===189||y===190||y===215||y===247)||ot["General Punctuation"](y)&&(y===8214||y===8224||y===8225||y===8240||y===8241||y===8251||y===8252||y===8258||y===8263||y===8264||y===8265||y===8273)||ot["Letterlike Symbols"](y)||ot["Number Forms"](y)||ot["Miscellaneous Technical"](y)&&(y>=8960&&y<=8967||y>=8972&&y<=8991||y>=8996&&y<=9e3||y===9003||y>=9085&&y<=9114||y>=9150&&y<=9165||y===9167||y>=9169&&y<=9179||y>=9186&&y<=9215)||ot["Control Pictures"](y)&&y!==9251||ot["Optical Character Recognition"](y)||ot["Enclosed Alphanumerics"](y)||ot["Geometric Shapes"](y)||ot["Miscellaneous Symbols"](y)&&!(y>=9754&&y<=9759)||ot["Miscellaneous Symbols and Arrows"](y)&&(y>=11026&&y<=11055||y>=11088&&y<=11097||y>=11192&&y<=11243)||ot["CJK Symbols and Punctuation"](y)||ot.Katakana(y)||ot["Private Use Area"](y)||ot["CJK Compatibility Forms"](y)||ot["Small Form Variants"](y)||ot["Halfwidth and Fullwidth Forms"](y)||y===8734||y===8756||y===8757||y>=9984&&y<=10087||y>=10102&&y<=10131||y===65532||y===65533)}function xi(y){return!(zr(y)||gi(y))}function Wr(y){return ot.Arabic(y)||ot["Arabic Supplement"](y)||ot["Arabic Extended-A"](y)||ot["Arabic Presentation Forms-A"](y)||ot["Arabic Presentation Forms-B"](y)}function ii(y){return y>=1424&&y<=2303||ot["Arabic Presentation Forms-A"](y)||ot["Arabic Presentation Forms-B"](y)}function di(y,_){return!(!_&&ii(y)||y>=2304&&y<=3583||y>=3840&&y<=4255||ot.Khmer(y))}function Li(y){for(var _=0,I=y;_<I.length;_+=1){var U=I[_];if(ii(U.charCodeAt(0)))return!0}return!1}function Ti(y,_){for(var I=0,U=y;I<U.length;I+=1){var $=U[I];if(!di($.charCodeAt(0),_))return!1}return!0}var Qr={unavailable:"unavailable",deferred:"deferred",loading:"loading",loaded:"loaded",error:"error"},Pn=null,kn=Qr.unavailable,Bn=null,na=function(y){y&&typeof y=="string"&&y.indexOf("NetworkError")>-1&&(kn=Qr.error),Pn&&Pn(y)};function Ea(){Ia.fire(new Xo("pluginStateChange",{pluginStatus:kn,pluginURL:Bn}))}var Ia=new jn,yo=function(){return kn},Da=function(y){return y({pluginStatus:kn,pluginURL:Bn}),Ia.on("pluginStateChange",y),y},go=function(y,_,I){if(I===void 0&&(I=!1),kn===Qr.deferred||kn===Qr.loading||kn===Qr.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");Bn=lt.resolveURL(y),kn=Qr.deferred,Pn=_,Ea(),I||Is()},Is=function(){if(kn!==Qr.deferred||!Bn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");kn=Qr.loading,Ea(),Bn&&ti({url:Bn},function(y){y?na(y):(kn=Qr.loaded,Ea())})},Ms={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return kn===Qr.loaded||Ms.applyArabicShaping!=null},isLoading:function(){return kn===Qr.loading},setState:function(_){kn=_.pluginStatus,Bn=_.pluginURL},isParsed:function(){return Ms.applyArabicShaping!=null&&Ms.processBidirectionalText!=null&&Ms.processStyledBidirectionalText!=null},getPluginURL:function(){return Bn}},Xs=function(){!Ms.isLoading()&&!Ms.isLoaded()&&yo()==="deferred"&&Is()},Un=function(_,I){this.zoom=_,I?(this.now=I.now,this.fadeDuration=I.fadeDuration,this.zoomHistory=I.zoomHistory,this.transition=I.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Pt,this.transition={})};Un.prototype.isSupportedScript=function(_){return Ti(_,Ms.isLoaded())},Un.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Un.prototype.getCrossfadeParameters=function(){var _=this.zoom,I=_-Math.floor(_),U=this.crossFadingFactor();return _>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:I+(1-I)*U}:{fromScale:.5,toScale:1,t:1-(1-U)*I}};var ja=function(_,I){this.property=_,this.value=I,this.expression=w(I===void 0?_.specification.default:I,_.specification)};ja.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},ja.prototype.possiblyEvaluate=function(_,I,U){return this.property.possiblyEvaluate(this,_,I,U)};var Fo=function(_){this.property=_,this.value=new ja(_,void 0)};Fo.prototype.transitioned=function(_,I){return new $s(this.property,this.value,I,x({},_.transition,this.transition),_.now)},Fo.prototype.untransitioned=function(){return new $s(this.property,this.value,null,{},0)};var Uo=function(_){this._properties=_,this._values=Object.create(_.defaultTransitionablePropertyValues)};Uo.prototype.getValue=function(_){return j(this._values[_].value.value)},Uo.prototype.setValue=function(_,I){this._values.hasOwnProperty(_)||(this._values[_]=new Fo(this._values[_].property)),this._values[_].value=new ja(this._values[_].property,I===null?void 0:j(I))},Uo.prototype.getTransition=function(_){return j(this._values[_].transition)},Uo.prototype.setTransition=function(_,I){this._values.hasOwnProperty(_)||(this._values[_]=new Fo(this._values[_].property)),this._values[_].transition=j(I)||void 0},Uo.prototype.serialize=function(){for(var _={},I=0,U=Object.keys(this._values);I<U.length;I+=1){var $=U[I],oe=this.getValue($);oe!==void 0&&(_[$]=oe);var he=this.getTransition($);he!==void 0&&(_[$+"-transition"]=he)}return _},Uo.prototype.transitioned=function(_,I){for(var U=new Sl(this._properties),$=0,oe=Object.keys(this._values);$<oe.length;$+=1){var he=oe[$];U._values[he]=this._values[he].transitioned(_,I._values[he])}return U},Uo.prototype.untransitioned=function(){for(var _=new Sl(this._properties),I=0,U=Object.keys(this._values);I<U.length;I+=1){var $=U[I];_._values[$]=this._values[$].untransitioned()}return _};var $s=function(_,I,U,$,oe){this.property=_,this.value=I,this.begin=oe+$.delay||0,this.end=this.begin+$.duration||0,_.specification.transition&&($.delay||$.duration)&&(this.prior=U)};$s.prototype.possiblyEvaluate=function(_,I,U){var $=_.now||0,oe=this.value.possiblyEvaluate(_,I,U),he=this.prior;if(he){if($>this.end)return this.prior=null,oe;if(this.value.isDataDriven())return this.prior=null,oe;if($<this.begin)return he.possiblyEvaluate(_,I,U);var De=($-this.begin)/(this.end-this.begin);return this.property.interpolate(he.possiblyEvaluate(_,I,U),oe,v(De))}else return oe};var Sl=function(_){this._properties=_,this._values=Object.create(_.defaultTransitioningPropertyValues)};Sl.prototype.possiblyEvaluate=function(_,I,U){for(var $=new Sc(this._properties),oe=0,he=Object.keys(this._values);oe<he.length;oe+=1){var De=he[oe];$._values[De]=this._values[De].possiblyEvaluate(_,I,U)}return $},Sl.prototype.hasTransition=function(){for(var _=0,I=Object.keys(this._values);_<I.length;_+=1){var U=I[_];if(this._values[U].prior)return!0}return!1};var bu=function(_){this._properties=_,this._values=Object.create(_.defaultPropertyValues)};bu.prototype.getValue=function(_){return j(this._values[_].value)},bu.prototype.setValue=function(_,I){this._values[_]=new ja(this._values[_].property,I===null?void 0:j(I))},bu.prototype.serialize=function(){for(var _={},I=0,U=Object.keys(this._values);I<U.length;I+=1){var $=U[I],oe=this.getValue($);oe!==void 0&&(_[$]=oe)}return _},bu.prototype.possiblyEvaluate=function(_,I,U){for(var $=new Sc(this._properties),oe=0,he=Object.keys(this._values);oe<he.length;oe+=1){var De=he[oe];$._values[De]=this._values[De].possiblyEvaluate(_,I,U)}return $};var dl=function(_,I,U){this.property=_,this.value=I,this.parameters=U};dl.prototype.isConstant=function(){return this.value.kind==="constant"},dl.prototype.constantOr=function(_){return this.value.kind==="constant"?this.value.value:_},dl.prototype.evaluate=function(_,I,U,$){return this.property.evaluate(this.value,this.parameters,_,I,U,$)};var Sc=function(_){this._properties=_,this._values=Object.create(_.defaultPossiblyEvaluatedValues)};Sc.prototype.get=function(_){return this._values[_]};var Me=function(_){this.specification=_};Me.prototype.possiblyEvaluate=function(_,I){return _.expression.evaluate(I)},Me.prototype.interpolate=function(_,I,U){var $=zu[this.specification.type];return $?$(_,I,U):_};var bt=function(_,I){this.specification=_,this.overrides=I};bt.prototype.possiblyEvaluate=function(_,I,U,$){return _.expression.kind==="constant"||_.expression.kind==="camera"?new dl(this,{kind:"constant",value:_.expression.evaluate(I,null,{},U,$)},I):new dl(this,_.expression,I)},bt.prototype.interpolate=function(_,I,U){if(_.value.kind!=="constant"||I.value.kind!=="constant")return _;if(_.value.value===void 0||I.value.value===void 0)return new dl(this,{kind:"constant",value:void 0},_.parameters);var $=zu[this.specification.type];return $?new dl(this,{kind:"constant",value:$(_.value.value,I.value.value,U)},_.parameters):_},bt.prototype.evaluate=function(_,I,U,$,oe,he){return _.kind==="constant"?_.value:_.evaluate(I,U,$,oe,he)};var Ot=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.possiblyEvaluate=function(U,$,oe,he){if(U.value===void 0)return new dl(this,{kind:"constant",value:void 0},$);if(U.expression.kind==="constant"){var De=U.expression.evaluate($,null,{},oe,he),it=U.property.specification.type==="resolvedImage",yt=it&&typeof De!="string"?De.name:De,Lt=this._calculate(yt,yt,yt,$);return new dl(this,{kind:"constant",value:Lt},$)}else if(U.expression.kind==="camera"){var sr=this._calculate(U.expression.evaluate({zoom:$.zoom-1}),U.expression.evaluate({zoom:$.zoom}),U.expression.evaluate({zoom:$.zoom+1}),$);return new dl(this,{kind:"constant",value:sr},$)}else return new dl(this,U.expression,$)},_.prototype.evaluate=function(U,$,oe,he,De,it){if(U.kind==="source"){var yt=U.evaluate($,oe,he,De,it);return this._calculate(yt,yt,yt,$)}else return U.kind==="composite"?this._calculate(U.evaluate({zoom:Math.floor($.zoom)-1},oe,he),U.evaluate({zoom:Math.floor($.zoom)},oe,he),U.evaluate({zoom:Math.floor($.zoom)+1},oe,he),$):U.value},_.prototype._calculate=function(U,$,oe,he){var De=he.zoom;return De>he.zoomHistory.lastIntegerZoom?{from:U,to:$}:{from:oe,to:$}},_.prototype.interpolate=function(U){return U},_}(bt),Lr=function(_){this.specification=_};Lr.prototype.possiblyEvaluate=function(_,I,U,$){if(_.value!==void 0)if(_.expression.kind==="constant"){var oe=_.expression.evaluate(I,null,{},U,$);return this._calculate(oe,oe,oe,I)}else return this._calculate(_.expression.evaluate(new Un(Math.floor(I.zoom-1),I)),_.expression.evaluate(new Un(Math.floor(I.zoom),I)),_.expression.evaluate(new Un(Math.floor(I.zoom+1),I)),I)},Lr.prototype._calculate=function(_,I,U,$){var oe=$.zoom;return oe>$.zoomHistory.lastIntegerZoom?{from:_,to:I}:{from:U,to:I}},Lr.prototype.interpolate=function(_){return _};var Vr=function(_){this.specification=_};Vr.prototype.possiblyEvaluate=function(_,I,U,$){return!!_.expression.evaluate(I,null,{},U,$)},Vr.prototype.interpolate=function(){return!1};var Or=function(_){this.properties=_,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var I in _){var U=_[I];U.specification.overridable&&this.overridableProperties.push(I);var $=this.defaultPropertyValues[I]=new ja(U,void 0),oe=this.defaultTransitionablePropertyValues[I]=new Fo(U);this.defaultTransitioningPropertyValues[I]=oe.untransitioned(),this.defaultPossiblyEvaluatedValues[I]=$.possiblyEvaluate({})}};X("DataDrivenProperty",bt),X("DataConstantProperty",Me),X("CrossFadedDataDrivenProperty",Ot),X("CrossFadedProperty",Lr),X("ColorRampProperty",Vr);var Nr="-transition",vi=function(y){function _(I,U){if(y.call(this),this.id=I.id,this.type=I.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},I.type!=="custom"&&(I=I,this.metadata=I.metadata,this.minzoom=I.minzoom,this.maxzoom=I.maxzoom,I.type!=="background"&&(this.source=I.source,this.sourceLayer=I["source-layer"],this.filter=I.filter),U.layout&&(this._unevaluatedLayout=new bu(U.layout)),U.paint)){this._transitionablePaint=new Uo(U.paint);for(var $ in I.paint)this.setPaintProperty($,I.paint[$],{validate:!1});for(var oe in I.layout)this.setLayoutProperty(oe,I.layout[oe],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Sc(U.paint)}}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},_.prototype.getLayoutProperty=function(U){return U==="visibility"?this.visibility:this._unevaluatedLayout.getValue(U)},_.prototype.setLayoutProperty=function(U,$,oe){if(oe===void 0&&(oe={}),$!=null){var he="layers."+this.id+".layout."+U;if(this._validate(Ul,he,U,$,oe))return}if(U==="visibility"){this.visibility=$;return}this._unevaluatedLayout.setValue(U,$)},_.prototype.getPaintProperty=function(U){return V(U,Nr)?this._transitionablePaint.getTransition(U.slice(0,-Nr.length)):this._transitionablePaint.getValue(U)},_.prototype.setPaintProperty=function(U,$,oe){if(oe===void 0&&(oe={}),$!=null){var he="layers."+this.id+".paint."+U;if(this._validate(hl,he,U,$,oe))return!1}if(V(U,Nr))return this._transitionablePaint.setTransition(U.slice(0,-Nr.length),$||void 0),!1;var De=this._transitionablePaint._values[U],it=De.property.specification["property-type"]==="cross-faded-data-driven",yt=De.value.isDataDriven(),Lt=De.value;this._transitionablePaint.setValue(U,$),this._handleSpecialPaintPropertyUpdate(U);var sr=this._transitionablePaint._values[U].value,gr=sr.isDataDriven();return gr||yt||it||this._handleOverridablePaintPropertyUpdate(U,Lt,sr)},_.prototype._handleSpecialPaintPropertyUpdate=function(U){},_.prototype._handleOverridablePaintPropertyUpdate=function(U,$,oe){return!1},_.prototype.isHidden=function(U){return this.minzoom&&U<this.minzoom||this.maxzoom&&U>=this.maxzoom?!0:this.visibility==="none"},_.prototype.updateTransitions=function(U){this._transitioningPaint=this._transitionablePaint.transitioned(U,this._transitioningPaint)},_.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},_.prototype.recalculate=function(U,$){U.getCrossfadeParameters&&(this._crossfadeParameters=U.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(U,void 0,$)),this.paint=this._transitioningPaint.possiblyEvaluate(U,void 0,$)},_.prototype.serialize=function(){var U={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&&(U.layout=U.layout||{},U.layout.visibility=this.visibility),Z(U,function($,oe){return $!==void 0&&!(oe==="layout"&&!Object.keys($).length)&&!(oe==="paint"&&!Object.keys($).length)})},_.prototype._validate=function(U,$,oe,he,De){return De===void 0&&(De={}),De&&De.validate===!1?!1:Lu(this,U.call(wo,{key:$,layerType:this.type,objectKey:oe,value:he,styleSpec:Rn,style:{glyphs:!0,sprite:!0}}))},_.prototype.is3D=function(){return!1},_.prototype.isTileClipped=function(){return!1},_.prototype.hasOffscreenPass=function(){return!1},_.prototype.resize=function(){},_.prototype.isStateDependent=function(){for(var U in this.paint._values){var $=this.paint.get(U);if(!(!($ instanceof dl)||!Ws($.property.specification))&&($.value.kind==="source"||$.value.kind==="composite")&&$.value.isStateDependent)return!0}return!1},_}(jn),Ni={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},qi=function(_,I){this._structArray=_,this._pos1=I*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Si=128,Vn=5,Qi=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};Qi.serialize=function(_,I){return _._trim(),I&&(_.isTransferred=!0,I.push(_.arrayBuffer)),{length:_.length,arrayBuffer:_.arrayBuffer}},Qi.deserialize=function(_){var I=Object.create(this.prototype);return I.arrayBuffer=_.arrayBuffer,I.length=_.length,I.capacity=_.arrayBuffer.byteLength/I.bytesPerElement,I._refreshViews(),I},Qi.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Qi.prototype.clear=function(){this.length=0},Qi.prototype.resize=function(_){this.reserve(_),this.length=_},Qi.prototype.reserve=function(_){if(_>this.capacity){this.capacity=Math.max(_,Math.floor(this.capacity*Vn),Si),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var I=this.uint8;this._refreshViews(),I&&this.uint8.set(I)}},Qi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function ji(y,_){_===void 0&&(_=1);var I=0,U=0,$=y.map(function(he){var De=oi(he.type),it=I=Tr(I,Math.max(_,De)),yt=he.components||1;return U=Math.max(U,De),I+=De*yt,{name:he.name,type:he.type,components:yt,offset:it}}),oe=Tr(I,Math.max(U,_));return{members:$,size:oe,alignment:_}}function oi(y){return Ni[y].BYTES_PER_ELEMENT}function Tr(y,_){return Math.ceil(y/_)*_}var Zr=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$){var oe=this.length;return this.resize(oe+1),this.emplace(oe,U,$)},_.prototype.emplace=function(U,$,oe){var he=U*2;return this.int16[he+0]=$,this.int16[he+1]=oe,U},_}(Qi);Zr.prototype.bytesPerElement=4,X("StructArrayLayout2i4",Zr);var yi=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe,he){var De=this.length;return this.resize(De+1),this.emplace(De,U,$,oe,he)},_.prototype.emplace=function(U,$,oe,he,De){var it=U*4;return this.int16[it+0]=$,this.int16[it+1]=oe,this.int16[it+2]=he,this.int16[it+3]=De,U},_}(Qi);yi.prototype.bytesPerElement=8,X("StructArrayLayout4i8",yi);var Ii=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe,he,De,it){var yt=this.length;return this.resize(yt+1),this.emplace(yt,U,$,oe,he,De,it)},_.prototype.emplace=function(U,$,oe,he,De,it,yt){var Lt=U*6;return this.int16[Lt+0]=$,this.int16[Lt+1]=oe,this.int16[Lt+2]=he,this.int16[Lt+3]=De,this.int16[Lt+4]=it,this.int16[Lt+5]=yt,U},_}(Qi);Ii.prototype.bytesPerElement=12,X("StructArrayLayout2i4i12",Ii);var ui=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe,he,De,it){var yt=this.length;return this.resize(yt+1),this.emplace(yt,U,$,oe,he,De,it)},_.prototype.emplace=function(U,$,oe,he,De,it,yt){var Lt=U*4,sr=U*8;return this.int16[Lt+0]=$,this.int16[Lt+1]=oe,this.uint8[sr+4]=he,this.uint8[sr+5]=De,this.uint8[sr+6]=it,this.uint8[sr+7]=yt,U},_}(Qi);ui.prototype.bytesPerElement=8,X("StructArrayLayout2i4ub8",ui);var nn=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$){var oe=this.length;return this.resize(oe+1),this.emplace(oe,U,$)},_.prototype.emplace=function(U,$,oe){var he=U*2;return this.float32[he+0]=$,this.float32[he+1]=oe,U},_}(Qi);nn.prototype.bytesPerElement=8,X("StructArrayLayout2f8",nn);var Xi=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe,he,De,it,yt,Lt,sr,gr){var hr=this.length;return this.resize(hr+1),this.emplace(hr,U,$,oe,he,De,it,yt,Lt,sr,gr)},_.prototype.emplace=function(U,$,oe,he,De,it,yt,Lt,sr,gr,hr){var Rr=U*10;return this.uint16[Rr+0]=$,this.uint16[Rr+1]=oe,this.uint16[Rr+2]=he,this.uint16[Rr+3]=De,this.uint16[Rr+4]=it,this.uint16[Rr+5]=yt,this.uint16[Rr+6]=Lt,this.uint16[Rr+7]=sr,this.uint16[Rr+8]=gr,this.uint16[Rr+9]=hr,U},_}(Qi);Xi.prototype.bytesPerElement=20,X("StructArrayLayout10ui20",Xi);var qn=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe,he,De,it,yt,Lt,sr,gr,hr,Rr){var ni=this.length;return this.resize(ni+1),this.emplace(ni,U,$,oe,he,De,it,yt,Lt,sr,gr,hr,Rr)},_.prototype.emplace=function(U,$,oe,he,De,it,yt,Lt,sr,gr,hr,Rr,ni){var Hi=U*12;return this.int16[Hi+0]=$,this.int16[Hi+1]=oe,this.int16[Hi+2]=he,this.int16[Hi+3]=De,this.uint16[Hi+4]=it,this.uint16[Hi+5]=yt,this.uint16[Hi+6]=Lt,this.uint16[Hi+7]=sr,this.int16[Hi+8]=gr,this.int16[Hi+9]=hr,this.int16[Hi+10]=Rr,this.int16[Hi+11]=ni,U},_}(Qi);qn.prototype.bytesPerElement=24,X("StructArrayLayout4i4ui4i24",qn);var fi=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe){var he=this.length;return this.resize(he+1),this.emplace(he,U,$,oe)},_.prototype.emplace=function(U,$,oe,he){var De=U*3;return this.float32[De+0]=$,this.float32[De+1]=oe,this.float32[De+2]=he,U},_}(Qi);fi.prototype.bytesPerElement=12,X("StructArrayLayout3f12",fi);var si=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U){var $=this.length;return this.resize($+1),this.emplace($,U)},_.prototype.emplace=function(U,$){var oe=U*1;return this.uint32[oe+0]=$,U},_}(Qi);si.prototype.bytesPerElement=4,X("StructArrayLayout1ul4",si);var mn=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe,he,De,it,yt,Lt,sr){var gr=this.length;return this.resize(gr+1),this.emplace(gr,U,$,oe,he,De,it,yt,Lt,sr)},_.prototype.emplace=function(U,$,oe,he,De,it,yt,Lt,sr,gr){var hr=U*10,Rr=U*5;return this.int16[hr+0]=$,this.int16[hr+1]=oe,this.int16[hr+2]=he,this.int16[hr+3]=De,this.int16[hr+4]=it,this.int16[hr+5]=yt,this.uint32[Rr+3]=Lt,this.uint16[hr+8]=sr,this.uint16[hr+9]=gr,U},_}(Qi);mn.prototype.bytesPerElement=20,X("StructArrayLayout6i1ul2ui20",mn);var Ji=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe,he,De,it){var yt=this.length;return this.resize(yt+1),this.emplace(yt,U,$,oe,he,De,it)},_.prototype.emplace=function(U,$,oe,he,De,it,yt){var Lt=U*6;return this.int16[Lt+0]=$,this.int16[Lt+1]=oe,this.int16[Lt+2]=he,this.int16[Lt+3]=De,this.int16[Lt+4]=it,this.int16[Lt+5]=yt,U},_}(Qi);Ji.prototype.bytesPerElement=12,X("StructArrayLayout2i2i2i12",Ji);var Ui=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe,he,De){var it=this.length;return this.resize(it+1),this.emplace(it,U,$,oe,he,De)},_.prototype.emplace=function(U,$,oe,he,De,it){var yt=U*4,Lt=U*8;return this.float32[yt+0]=$,this.float32[yt+1]=oe,this.float32[yt+2]=he,this.int16[Lt+6]=De,this.int16[Lt+7]=it,U},_}(Qi);Ui.prototype.bytesPerElement=16,X("StructArrayLayout2f1f2i16",Ui);var Bi=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe,he){var De=this.length;return this.resize(De+1),this.emplace(De,U,$,oe,he)},_.prototype.emplace=function(U,$,oe,he,De){var it=U*12,yt=U*3;return this.uint8[it+0]=$,this.uint8[it+1]=oe,this.float32[yt+1]=he,this.float32[yt+2]=De,U},_}(Qi);Bi.prototype.bytesPerElement=12,X("StructArrayLayout2ub2f12",Bi);var pn=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe){var he=this.length;return this.resize(he+1),this.emplace(he,U,$,oe)},_.prototype.emplace=function(U,$,oe,he){var De=U*3;return this.uint16[De+0]=$,this.uint16[De+1]=oe,this.uint16[De+2]=he,U},_}(Qi);pn.prototype.bytesPerElement=6,X("StructArrayLayout3ui6",pn);var Nn=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe,he,De,it,yt,Lt,sr,gr,hr,Rr,ni,Hi,wi,bn,rn){var xn=this.length;return this.resize(xn+1),this.emplace(xn,U,$,oe,he,De,it,yt,Lt,sr,gr,hr,Rr,ni,Hi,wi,bn,rn)},_.prototype.emplace=function(U,$,oe,he,De,it,yt,Lt,sr,gr,hr,Rr,ni,Hi,wi,bn,rn,xn){var In=U*24,Xn=U*12,ga=U*48;return this.int16[In+0]=$,this.int16[In+1]=oe,this.uint16[In+2]=he,this.uint16[In+3]=De,this.uint32[Xn+2]=it,this.uint32[Xn+3]=yt,this.uint32[Xn+4]=Lt,this.uint16[In+10]=sr,this.uint16[In+11]=gr,this.uint16[In+12]=hr,this.float32[Xn+7]=Rr,this.float32[Xn+8]=ni,this.uint8[ga+36]=Hi,this.uint8[ga+37]=wi,this.uint8[ga+38]=bn,this.uint32[Xn+10]=rn,this.int16[In+22]=xn,U},_}(Qi);Nn.prototype.bytesPerElement=48,X("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Nn);var aa=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe,he,De,it,yt,Lt,sr,gr,hr,Rr,ni,Hi,wi,bn,rn,xn,In,Xn,ga,ha,eo,za,Za,Jo,to,ao){var _s=this.length;return this.resize(_s+1),this.emplace(_s,U,$,oe,he,De,it,yt,Lt,sr,gr,hr,Rr,ni,Hi,wi,bn,rn,xn,In,Xn,ga,ha,eo,za,Za,Jo,to,ao)},_.prototype.emplace=function(U,$,oe,he,De,it,yt,Lt,sr,gr,hr,Rr,ni,Hi,wi,bn,rn,xn,In,Xn,ga,ha,eo,za,Za,Jo,to,ao,_s){var jo=U*34,El=U*17;return this.int16[jo+0]=$,this.int16[jo+1]=oe,this.int16[jo+2]=he,this.int16[jo+3]=De,this.int16[jo+4]=it,this.int16[jo+5]=yt,this.int16[jo+6]=Lt,this.int16[jo+7]=sr,this.uint16[jo+8]=gr,this.uint16[jo+9]=hr,this.uint16[jo+10]=Rr,this.uint16[jo+11]=ni,this.uint16[jo+12]=Hi,this.uint16[jo+13]=wi,this.uint16[jo+14]=bn,this.uint16[jo+15]=rn,this.uint16[jo+16]=xn,this.uint16[jo+17]=In,this.uint16[jo+18]=Xn,this.uint16[jo+19]=ga,this.uint16[jo+20]=ha,this.uint16[jo+21]=eo,this.uint16[jo+22]=za,this.uint32[El+12]=Za,this.float32[El+13]=Jo,this.float32[El+14]=to,this.float32[El+15]=ao,this.float32[El+16]=_s,U},_}(Qi);aa.prototype.bytesPerElement=68,X("StructArrayLayout8i15ui1ul4f68",aa);var Ki=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U){var $=this.length;return this.resize($+1),this.emplace($,U)},_.prototype.emplace=function(U,$){var oe=U*1;return this.float32[oe+0]=$,U},_}(Qi);Ki.prototype.bytesPerElement=4,X("StructArrayLayout1f4",Ki);var Cn=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe){var he=this.length;return this.resize(he+1),this.emplace(he,U,$,oe)},_.prototype.emplace=function(U,$,oe,he){var De=U*3;return this.int16[De+0]=$,this.int16[De+1]=oe,this.int16[De+2]=he,U},_}(Qi);Cn.prototype.bytesPerElement=6,X("StructArrayLayout3i6",Cn);var ia=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe){var he=this.length;return this.resize(he+1),this.emplace(he,U,$,oe)},_.prototype.emplace=function(U,$,oe,he){var De=U*2,it=U*4;return this.uint32[De+0]=$,this.uint16[it+2]=oe,this.uint16[it+3]=he,U},_}(Qi);ia.prototype.bytesPerElement=8,X("StructArrayLayout1ul2ui8",ia);var sa=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$){var oe=this.length;return this.resize(oe+1),this.emplace(oe,U,$)},_.prototype.emplace=function(U,$,oe){var he=U*2;return this.uint16[he+0]=$,this.uint16[he+1]=oe,U},_}(Qi);sa.prototype.bytesPerElement=4,X("StructArrayLayout2ui4",sa);var ba=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U){var $=this.length;return this.resize($+1),this.emplace($,U)},_.prototype.emplace=function(U,$){var oe=U*1;return this.uint16[oe+0]=$,U},_}(Qi);ba.prototype.bytesPerElement=2,X("StructArrayLayout1ui2",ba);var is=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},_.prototype.emplaceBack=function(U,$,oe,he){var De=this.length;return this.resize(De+1),this.emplace(De,U,$,oe,he)},_.prototype.emplace=function(U,$,oe,he,De){var it=U*4;return this.float32[it+0]=$,this.float32[it+1]=oe,this.float32[it+2]=he,this.float32[it+3]=De,U},_}(Qi);is.prototype.bytesPerElement=16,X("StructArrayLayout4f16",is);var Zs=function(y){function _(){y.apply(this,arguments)}y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_;var I={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return I.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},I.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},I.x1.get=function(){return this._structArray.int16[this._pos2+2]},I.y1.get=function(){return this._structArray.int16[this._pos2+3]},I.x2.get=function(){return this._structArray.int16[this._pos2+4]},I.y2.get=function(){return this._structArray.int16[this._pos2+5]},I.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},I.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},I.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},I.anchorPoint.get=function(){return new u(this.anchorPointX,this.anchorPointY)},Object.defineProperties(_.prototype,I),_}(qi);Zs.prototype.size=20;var Ga=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.get=function(U){return new Zs(this,U)},_}(mn);X("CollisionBoxArray",Ga);var Ml=function(y){function _(){y.apply(this,arguments)}y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_;var I={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return I.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},I.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},I.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},I.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},I.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},I.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},I.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},I.segment.get=function(){return this._structArray.uint16[this._pos2+10]},I.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},I.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},I.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},I.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},I.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},I.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},I.placedOrientation.set=function(U){this._structArray.uint8[this._pos1+37]=U},I.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},I.hidden.set=function(U){this._structArray.uint8[this._pos1+38]=U},I.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},I.crossTileID.set=function(U){this._structArray.uint32[this._pos4+10]=U},I.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(_.prototype,I),_}(qi);Ml.prototype.size=48;var zo=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.get=function(U){return new Ml(this,U)},_}(Nn);X("PlacedSymbolArray",zo);var Qs=function(y){function _(){y.apply(this,arguments)}y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_;var I={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return I.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},I.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},I.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},I.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},I.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},I.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},I.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},I.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},I.key.get=function(){return this._structArray.uint16[this._pos2+8]},I.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},I.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},I.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},I.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},I.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},I.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},I.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},I.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},I.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},I.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},I.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},I.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},I.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},I.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},I.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},I.crossTileID.set=function(U){this._structArray.uint32[this._pos4+12]=U},I.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},I.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},I.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},I.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(_.prototype,I),_}(qi);Qs.prototype.size=68;var al=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.get=function(U){return new Qs(this,U)},_}(aa);X("SymbolInstanceArray",al);var Vl=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.getoffsetX=function(U){return this.float32[U*1+0]},_}(Ki);X("GlyphOffsetArray",Vl);var ss=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.getx=function(U){return this.int16[U*3+0]},_.prototype.gety=function(U){return this.int16[U*3+1]},_.prototype.gettileUnitDistanceFromAnchor=function(U){return this.int16[U*3+2]},_}(Cn);X("SymbolLineVertexArray",ss);var Vs=function(y){function _(){y.apply(this,arguments)}y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_;var I={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return I.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},I.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},I.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(_.prototype,I),_}(qi);Vs.prototype.size=8;var Ys=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.get=function(U){return new Vs(this,U)},_}(ia);X("FeatureIndexArray",Ys);var wa=ji([{name:"a_pos",components:2,type:"Int16"}],4),ol=wa.members,io=function(_){_===void 0&&(_=[]),this.segments=_};io.prototype.prepareSegment=function(_,I,U,$){var oe=this.segments[this.segments.length-1];return _>io.MAX_VERTEX_ARRAY_LENGTH&&ie("Max vertices per segment is "+io.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+_),(!oe||oe.vertexLength+_>io.MAX_VERTEX_ARRAY_LENGTH||oe.sortKey!==$)&&(oe={vertexOffset:I.length,primitiveOffset:U.length,vertexLength:0,primitiveLength:0},$!==void 0&&(oe.sortKey=$),this.segments.push(oe)),oe},io.prototype.get=function(){return this.segments},io.prototype.destroy=function(){for(var _=0,I=this.segments;_<I.length;_+=1){var U=I[_];for(var $ in U.vaos)U.vaos[$].destroy()}},io.simpleSegment=function(_,I,U,$){return new io([{vertexOffset:_,primitiveOffset:I,vertexLength:U,primitiveLength:$,vaos:{},sortKey:0}])},io.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,X("SegmentVector",io);function Y(y,_){return y=p(Math.floor(y),0,255),_=p(Math.floor(_),0,255),256*y+_}var D=ji([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),J=a(function(y){function _(I,U){var $,oe,he,De,it,yt,Lt,sr;for($=I.length&3,oe=I.length-$,he=U,it=3432918353,yt=461845907,sr=0;sr<oe;)Lt=I.charCodeAt(sr)&255|(I.charCodeAt(++sr)&255)<<8|(I.charCodeAt(++sr)&255)<<16|(I.charCodeAt(++sr)&255)<<24,++sr,Lt=(Lt&65535)*it+(((Lt>>>16)*it&65535)<<16)&4294967295,Lt=Lt<<15|Lt>>>17,Lt=(Lt&65535)*yt+(((Lt>>>16)*yt&65535)<<16)&4294967295,he^=Lt,he=he<<13|he>>>19,De=(he&65535)*5+(((he>>>16)*5&65535)<<16)&4294967295,he=(De&65535)+27492+(((De>>>16)+58964&65535)<<16);switch(Lt=0,$){case 3:Lt^=(I.charCodeAt(sr+2)&255)<<16;case 2:Lt^=(I.charCodeAt(sr+1)&255)<<8;case 1:Lt^=I.charCodeAt(sr)&255,Lt=(Lt&65535)*it+(((Lt>>>16)*it&65535)<<16)&4294967295,Lt=Lt<<15|Lt>>>17,Lt=(Lt&65535)*yt+(((Lt>>>16)*yt&65535)<<16)&4294967295,he^=Lt}return he^=I.length,he^=he>>>16,he=(he&65535)*2246822507+(((he>>>16)*2246822507&65535)<<16)&4294967295,he^=he>>>13,he=(he&65535)*3266489909+(((he>>>16)*3266489909&65535)<<16)&4294967295,he^=he>>>16,he>>>0}y.exports=_}),O=a(function(y){function _(I,U){for(var $=I.length,oe=U^$,he=0,De;$>=4;)De=I.charCodeAt(he)&255|(I.charCodeAt(++he)&255)<<8|(I.charCodeAt(++he)&255)<<16|(I.charCodeAt(++he)&255)<<24,De=(De&65535)*1540483477+(((De>>>16)*1540483477&65535)<<16),De^=De>>>24,De=(De&65535)*1540483477+(((De>>>16)*1540483477&65535)<<16),oe=(oe&65535)*1540483477+(((oe>>>16)*1540483477&65535)<<16)^De,$-=4,++he;switch($){case 3:oe^=(I.charCodeAt(he+2)&255)<<16;case 2:oe^=(I.charCodeAt(he+1)&255)<<8;case 1:oe^=I.charCodeAt(he)&255,oe=(oe&65535)*1540483477+(((oe>>>16)*1540483477&65535)<<16)}return oe^=oe>>>13,oe=(oe&65535)*1540483477+(((oe>>>16)*1540483477&65535)<<16),oe^=oe>>>15,oe>>>0}y.exports=_}),K=J,de=J,ne=O;K.murmur3=de,K.murmur2=ne;var we=function(){this.ids=[],this.positions=[],this.indexed=!1};we.prototype.add=function(_,I,U,$){this.ids.push(ht(_)),this.positions.push(I,U,$)},we.prototype.getPositions=function(_){for(var I=ht(_),U=0,$=this.ids.length-1;U<$;){var oe=U+$>>1;this.ids[oe]>=I?$=oe:U=oe+1}for(var he=[];this.ids[U]===I;){var De=this.positions[3*U],it=this.positions[3*U+1],yt=this.positions[3*U+2];he.push({index:De,start:it,end:yt}),U++}return he},we.serialize=function(_,I){var U=new Float64Array(_.ids),$=new Uint32Array(_.positions);return Yt(U,$,0,U.length-1),I&&I.push(U.buffer,$.buffer),{ids:U,positions:$}},we.deserialize=function(_){var I=new we;return I.ids=_.ids,I.positions=_.positions,I.indexed=!0,I};var Oe=Math.pow(2,53)-1;function ht(y){var _=+y;return!isNaN(_)&&_<=Oe?_:K(String(y))}function Yt(y,_,I,U){for(;I<U;){for(var $=y[I+U>>1],oe=I-1,he=U+1;;){do oe++;while(y[oe]<$);do he--;while(y[he]>$);if(oe>=he)break;cr(y,oe,he),cr(_,3*oe,3*he),cr(_,3*oe+1,3*he+1),cr(_,3*oe+2,3*he+2)}he-I<U-he?(Yt(y,_,I,he),I=he+1):(Yt(y,_,he+1,U),U=he)}}function cr(y,_,I){var U=y[_];y[_]=y[I],y[I]=U}X("FeaturePositionMap",we);var Nt=function(_,I){this.gl=_.gl,this.location=I},Ne=function(y){function _(I,U){y.call(this,I,U),this.current=0}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.set=function(U){this.current!==U&&(this.current=U,this.gl.uniform1i(this.location,U))},_}(Nt),$e=function(y){function _(I,U){y.call(this,I,U),this.current=0}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.set=function(U){this.current!==U&&(this.current=U,this.gl.uniform1f(this.location,U))},_}(Nt),st=function(y){function _(I,U){y.call(this,I,U),this.current=[0,0]}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.set=function(U){(U[0]!==this.current[0]||U[1]!==this.current[1])&&(this.current=U,this.gl.uniform2f(this.location,U[0],U[1]))},_}(Nt),It=function(y){function _(I,U){y.call(this,I,U),this.current=[0,0,0]}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.set=function(U){(U[0]!==this.current[0]||U[1]!==this.current[1]||U[2]!==this.current[2])&&(this.current=U,this.gl.uniform3f(this.location,U[0],U[1],U[2]))},_}(Nt),Bt=function(y){function _(I,U){y.call(this,I,U),this.current=[0,0,0,0]}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.set=function(U){(U[0]!==this.current[0]||U[1]!==this.current[1]||U[2]!==this.current[2]||U[3]!==this.current[3])&&(this.current=U,this.gl.uniform4f(this.location,U[0],U[1],U[2],U[3]))},_}(Nt),Ft=function(y){function _(I,U){y.call(this,I,U),this.current=cs.transparent}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.set=function(U){(U.r!==this.current.r||U.g!==this.current.g||U.b!==this.current.b||U.a!==this.current.a)&&(this.current=U,this.gl.uniform4f(this.location,U.r,U.g,U.b,U.a))},_}(Nt),Ut=new Float32Array(16),zt=function(y){function _(I,U){y.call(this,I,U),this.current=Ut}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.set=function(U){if(U[12]!==this.current[12]||U[0]!==this.current[0]){this.current=U,this.gl.uniformMatrix4fv(this.location,!1,U);return}for(var $=1;$<16;$++)if(U[$]!==this.current[$]){this.current=U,this.gl.uniformMatrix4fv(this.location,!1,U);break}},_}(Nt);function _t(y){return[Y(255*y.r,255*y.g),Y(255*y.b,255*y.a)]}var Dt=function(_,I,U){this.value=_,this.uniformNames=I.map(function($){return"u_"+$}),this.type=U};Dt.prototype.setUniform=function(_,I,U){_.set(U.constantOr(this.value))},Dt.prototype.getBinding=function(_,I,U){return this.type==="color"?new Ft(_,I):new $e(_,I)};var vt=function(_,I){this.uniformNames=I.map(function(U){return"u_"+U}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};vt.prototype.setConstantPatternPositions=function(_,I){this.pixelRatioFrom=I.pixelRatio,this.pixelRatioTo=_.pixelRatio,this.patternFrom=I.tlbr,this.patternTo=_.tlbr},vt.prototype.setUniform=function(_,I,U,$){var oe=$==="u_pattern_to"?this.patternTo:$==="u_pattern_from"?this.patternFrom:$==="u_pixel_ratio_to"?this.pixelRatioTo:$==="u_pixel_ratio_from"?this.pixelRatioFrom:null;oe&&_.set(oe)},vt.prototype.getBinding=function(_,I,U){return U.substr(0,9)==="u_pattern"?new Bt(_,I):new $e(_,I)};var lr=function(_,I,U,$){this.expression=_,this.type=U,this.maxValue=0,this.paintVertexAttributes=I.map(function(oe){return{name:"a_"+oe,type:"Float32",components:U==="color"?2:1,offset:0}}),this.paintVertexArray=new $};lr.prototype.populatePaintArray=function(_,I,U,$,oe){var he=this.paintVertexArray.length,De=this.expression.evaluate(new Un(0),I,{},$,[],oe);this.paintVertexArray.resize(_),this._setPaintValue(he,_,De)},lr.prototype.updatePaintArray=function(_,I,U,$){var oe=this.expression.evaluate({zoom:0},U,$);this._setPaintValue(_,I,oe)},lr.prototype._setPaintValue=function(_,I,U){if(this.type==="color")for(var $=_t(U),oe=_;oe<I;oe++)this.paintVertexArray.emplace(oe,$[0],$[1]);else{for(var he=_;he<I;he++)this.paintVertexArray.emplace(he,U);this.maxValue=Math.max(this.maxValue,Math.abs(U))}},lr.prototype.upload=function(_){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=_.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},lr.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var _r=function(_,I,U,$,oe,he){this.expression=_,this.uniformNames=I.map(function(De){return"u_"+De+"_t"}),this.type=U,this.useIntegerZoom=$,this.zoom=oe,this.maxValue=0,this.paintVertexAttributes=I.map(function(De){return{name:"a_"+De,type:"Float32",components:U==="color"?4:2,offset:0}}),this.paintVertexArray=new he};_r.prototype.populatePaintArray=function(_,I,U,$,oe){var he=this.expression.evaluate(new Un(this.zoom),I,{},$,[],oe),De=this.expression.evaluate(new Un(this.zoom+1),I,{},$,[],oe),it=this.paintVertexArray.length;this.paintVertexArray.resize(_),this._setPaintValue(it,_,he,De)},_r.prototype.updatePaintArray=function(_,I,U,$){var oe=this.expression.evaluate({zoom:this.zoom},U,$),he=this.expression.evaluate({zoom:this.zoom+1},U,$);this._setPaintValue(_,I,oe,he)},_r.prototype._setPaintValue=function(_,I,U,$){if(this.type==="color")for(var oe=_t(U),he=_t($),De=_;De<I;De++)this.paintVertexArray.emplace(De,oe[0],oe[1],he[0],he[1]);else{for(var it=_;it<I;it++)this.paintVertexArray.emplace(it,U,$);this.maxValue=Math.max(this.maxValue,Math.abs(U),Math.abs($))}},_r.prototype.upload=function(_){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=_.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},_r.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},_r.prototype.setUniform=function(_,I){var U=this.useIntegerZoom?Math.floor(I.zoom):I.zoom,$=p(this.expression.interpolationFactor(U,this.zoom,this.zoom+1),0,1);_.set($)},_r.prototype.getBinding=function(_,I,U){return new $e(_,I)};var Br=function(_,I,U,$,oe,he){this.expression=_,this.type=I,this.useIntegerZoom=U,this.zoom=$,this.layerId=he,this.zoomInPaintVertexArray=new oe,this.zoomOutPaintVertexArray=new oe};Br.prototype.populatePaintArray=function(_,I,U){var $=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(_),this.zoomOutPaintVertexArray.resize(_),this._setPaintValues($,_,I.patterns&&I.patterns[this.layerId],U)},Br.prototype.updatePaintArray=function(_,I,U,$,oe){this._setPaintValues(_,I,U.patterns&&U.patterns[this.layerId],oe)},Br.prototype._setPaintValues=function(_,I,U,$){if(!(!$||!U)){var oe=U.min,he=U.mid,De=U.max,it=$[oe],yt=$[he],Lt=$[De];if(!(!it||!yt||!Lt))for(var sr=_;sr<I;sr++)this.zoomInPaintVertexArray.emplace(sr,yt.tl[0],yt.tl[1],yt.br[0],yt.br[1],it.tl[0],it.tl[1],it.br[0],it.br[1],yt.pixelRatio,it.pixelRatio),this.zoomOutPaintVertexArray.emplace(sr,yt.tl[0],yt.tl[1],yt.br[0],yt.br[1],Lt.tl[0],Lt.tl[1],Lt.br[0],Lt.br[1],yt.pixelRatio,Lt.pixelRatio)}},Br.prototype.upload=function(_){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=_.createVertexBuffer(this.zoomInPaintVertexArray,D.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=_.createVertexBuffer(this.zoomOutPaintVertexArray,D.members,this.expression.isStateDependent))},Br.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Di=function(_,I,U){this.binders={},this._buffers=[];var $=[];for(var oe in _.paint._values)if(U(oe)){var he=_.paint.get(oe);if(!(!(he instanceof dl)||!Ws(he.property.specification))){var De=bi(oe,_.type),it=he.value,yt=he.property.specification.type,Lt=he.property.useIntegerZoom,sr=he.property.specification["property-type"],gr=sr==="cross-faded"||sr==="cross-faded-data-driven";if(it.kind==="constant")this.binders[oe]=gr?new vt(it.value,De):new Dt(it.value,De,yt),$.push("/u_"+oe);else if(it.kind==="source"||gr){var hr=tn(oe,yt,"source");this.binders[oe]=gr?new Br(it,yt,Lt,I,hr,_.id):new lr(it,De,yt,hr),$.push("/a_"+oe)}else{var Rr=tn(oe,yt,"composite");this.binders[oe]=new _r(it,De,yt,Lt,I,Rr),$.push("/z_"+oe)}}}this.cacheKey=$.sort().join("")};Di.prototype.getMaxValue=function(_){var I=this.binders[_];return I instanceof lr||I instanceof _r?I.maxValue:0},Di.prototype.populatePaintArrays=function(_,I,U,$,oe){for(var he in this.binders){var De=this.binders[he];(De instanceof lr||De instanceof _r||De instanceof Br)&&De.populatePaintArray(_,I,U,$,oe)}},Di.prototype.setConstantPatternPositions=function(_,I){for(var U in this.binders){var $=this.binders[U];$ instanceof vt&&$.setConstantPatternPositions(_,I)}},Di.prototype.updatePaintArrays=function(_,I,U,$,oe){var he=!1;for(var De in _)for(var it=I.getPositions(De),yt=0,Lt=it;yt<Lt.length;yt+=1){var sr=Lt[yt],gr=U.feature(sr.index);for(var hr in this.binders){var Rr=this.binders[hr];if((Rr instanceof lr||Rr instanceof _r||Rr instanceof Br)&&Rr.expression.isStateDependent===!0){var ni=$.paint.get(hr);Rr.expression=ni.value,Rr.updatePaintArray(sr.start,sr.end,gr,_[De],oe),he=!0}}}return he},Di.prototype.defines=function(){var _=[];for(var I in this.binders){var U=this.binders[I];(U instanceof Dt||U instanceof vt)&&_.push.apply(_,U.uniformNames.map(function($){return"#define HAS_UNIFORM_"+$}))}return _},Di.prototype.getBinderAttributes=function(){var _=[];for(var I in this.binders){var U=this.binders[I];if(U instanceof lr||U instanceof _r)for(var $=0;$<U.paintVertexAttributes.length;$++)_.push(U.paintVertexAttributes[$].name);else if(U instanceof Br)for(var oe=0;oe<D.members.length;oe++)_.push(D.members[oe].name)}return _},Di.prototype.getBinderUniforms=function(){var _=[];for(var I in this.binders){var U=this.binders[I];if(U instanceof Dt||U instanceof vt||U instanceof _r)for(var $=0,oe=U.uniformNames;$<oe.length;$+=1){var he=oe[$];_.push(he)}}return _},Di.prototype.getPaintVertexBuffers=function(){return this._buffers},Di.prototype.getUniforms=function(_,I){var U=[];for(var $ in this.binders){var oe=this.binders[$];if(oe instanceof Dt||oe instanceof vt||oe instanceof _r)for(var he=0,De=oe.uniformNames;he<De.length;he+=1){var it=De[he];if(I[it]){var yt=oe.getBinding(_,I[it],it);U.push({name:it,property:$,binding:yt})}}}return U},Di.prototype.setUniforms=function(_,I,U,$){for(var oe=0,he=I;oe<he.length;oe+=1){var De=he[oe],it=De.name,yt=De.property,Lt=De.binding;this.binders[yt].setUniform(Lt,$,U.get(yt),it)}},Di.prototype.updatePaintBuffers=function(_){this._buffers=[];for(var I in this.binders){var U=this.binders[I];if(_&&U instanceof Br){var $=_.fromScale===2?U.zoomInPaintVertexBuffer:U.zoomOutPaintVertexBuffer;$&&this._buffers.push($)}else(U instanceof lr||U instanceof _r)&&U.paintVertexBuffer&&this._buffers.push(U.paintVertexBuffer)}},Di.prototype.upload=function(_){for(var I in this.binders){var U=this.binders[I];(U instanceof lr||U instanceof _r||U instanceof Br)&&U.upload(_)}this.updatePaintBuffers()},Di.prototype.destroy=function(){for(var _ in this.binders){var I=this.binders[_];(I instanceof lr||I instanceof _r||I instanceof Br)&&I.destroy()}};var ci=function(_,I,U){U===void 0&&(U=function(){return!0}),this.programConfigurations={};for(var $=0,oe=_;$<oe.length;$+=1){var he=oe[$];this.programConfigurations[he.id]=new Di(he,I,U)}this.needsUpload=!1,this._featureMap=new we,this._bufferOffset=0};ci.prototype.populatePaintArrays=function(_,I,U,$,oe,he){for(var De in this.programConfigurations)this.programConfigurations[De].populatePaintArrays(_,I,$,oe,he);I.id!==void 0&&this._featureMap.add(I.id,U,this._bufferOffset,_),this._bufferOffset=_,this.needsUpload=!0},ci.prototype.updatePaintArrays=function(_,I,U,$){for(var oe=0,he=U;oe<he.length;oe+=1){var De=he[oe];this.needsUpload=this.programConfigurations[De.id].updatePaintArrays(_,this._featureMap,I,De,$)||this.needsUpload}},ci.prototype.get=function(_){return this.programConfigurations[_]},ci.prototype.upload=function(_){if(this.needsUpload){for(var I in this.programConfigurations)this.programConfigurations[I].upload(_);this.needsUpload=!1}},ci.prototype.destroy=function(){for(var _ in this.programConfigurations)this.programConfigurations[_].destroy()};function bi(y,_){var I={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]};return I[y]||[y.replace(_+"-","").replace(/-/g,"_")]}function gn(y){var _={"line-pattern":{source:Xi,composite:Xi},"fill-pattern":{source:Xi,composite:Xi},"fill-extrusion-pattern":{source:Xi,composite:Xi}};return _[y]}function tn(y,_,I){var U={color:{source:nn,composite:is},number:{source:Ki,composite:nn}},$=gn(y);return $&&$[I]||U[_][I]}X("ConstantBinder",Dt),X("CrossFadedConstantBinder",vt),X("SourceExpressionBinder",lr),X("CrossFadedCompositeBinder",Br),X("CompositeExpressionBinder",_r),X("ProgramConfiguration",Di,{omit:["_buffers"]}),X("ProgramConfigurationSet",ci);var Ei=8192,Oi=15,Gi=Math.pow(2,Oi-1)-1,on=-Gi-1;function zn(y){for(var _=Ei/y.extent,I=y.loadGeometry(),U=0;U<I.length;U++)for(var $=I[U],oe=0;oe<$.length;oe++){var he=$[oe],De=Math.round(he.x*_),it=Math.round(he.y*_);he.x=p(De,on,Gi),he.y=p(it,on,Gi),(De<he.x||De>he.x+1||it<he.y||it>he.y+1)&&ie("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return I}function Ja(y,_){return{type:y.type,id:y.id,properties:y.properties,geometry:_?zn(y):[]}}function co(y,_,I,U,$){y.emplaceBack(_*2+(U+1)/2,I*2+($+1)/2)}var ts=function(_){this.zoom=_.zoom,this.overscaling=_.overscaling,this.layers=_.layers,this.layerIds=this.layers.map(function(I){return I.id}),this.index=_.index,this.hasPattern=!1,this.layoutVertexArray=new Zr,this.indexArray=new pn,this.segments=new io,this.programConfigurations=new ci(_.layers,_.zoom),this.stateDependentLayerIds=this.layers.filter(function(I){return I.isStateDependent()}).map(function(I){return I.id})};ts.prototype.populate=function(_,I,U){var $=this.layers[0],oe=[],he=null;$.type==="circle"&&(he=$.layout.get("circle-sort-key"));for(var De=0,it=_;De<it.length;De+=1){var yt=it[De],Lt=yt.feature,sr=yt.id,gr=yt.index,hr=yt.sourceLayerIndex,Rr=this.layers[0]._featureFilter.needGeometry,ni=Ja(Lt,Rr);if(this.layers[0]._featureFilter.filter(new Un(this.zoom),ni,U)){var Hi=he?he.evaluate(ni,{},U):void 0,wi={id:sr,properties:Lt.properties,type:Lt.type,sourceLayerIndex:hr,index:gr,geometry:Rr?ni.geometry:zn(Lt),patterns:{},sortKey:Hi};oe.push(wi)}}he&&oe.sort(function(za,Za){return za.sortKey-Za.sortKey});for(var bn=0,rn=oe;bn<rn.length;bn+=1){var xn=rn[bn],In=xn,Xn=In.geometry,ga=In.index,ha=In.sourceLayerIndex,eo=_[ga].feature;this.addFeature(xn,Xn,ga,U),I.featureIndex.insert(eo,Xn,ga,ha,this.index)}},ts.prototype.update=function(_,I,U){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(_,I,this.stateDependentLayers,U)},ts.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},ts.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ts.prototype.upload=function(_){this.uploaded||(this.layoutVertexBuffer=_.createVertexBuffer(this.layoutVertexArray,ol),this.indexBuffer=_.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(_),this.uploaded=!0},ts.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},ts.prototype.addFeature=function(_,I,U,$){for(var oe=0,he=I;oe<he.length;oe+=1)for(var De=he[oe],it=0,yt=De;it<yt.length;it+=1){var Lt=yt[it],sr=Lt.x,gr=Lt.y;if(!(sr<0||sr>=Ei||gr<0||gr>=Ei)){var hr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,_.sortKey),Rr=hr.vertexLength;co(this.layoutVertexArray,sr,gr,-1,-1),co(this.layoutVertexArray,sr,gr,1,-1),co(this.layoutVertexArray,sr,gr,1,1),co(this.layoutVertexArray,sr,gr,-1,1),this.indexArray.emplaceBack(Rr,Rr+1,Rr+2),this.indexArray.emplaceBack(Rr,Rr+3,Rr+2),hr.vertexLength+=4,hr.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,_,U,{},$)},X("CircleBucket",ts,{omit:["layers"]});function so(y,_){for(var I=0;I<y.length;I++)if(Td(_,y[I]))return!0;for(var U=0;U<_.length;U++)if(Td(y,_[U]))return!0;return!!Lv(y,_)}function Yo(y,_,I){return!!(Td(y,_)||Kv(_,y,I))}function ms(y,_){if(y.length===1)return gp(_,y[0]);for(var I=0;I<_.length;I++)for(var U=_[I],$=0;$<U.length;$++)if(Td(y,U[$]))return!0;for(var oe=0;oe<y.length;oe++)if(gp(_,y[oe]))return!0;for(var he=0;he<_.length;he++)if(Lv(y,_[he]))return!0;return!1}function ou(y,_,I){for(var U=0;U<_.length;U++){var $=_[U];if(y.length>=3){for(var oe=0;oe<$.length;oe++)if(Td(y,$[oe]))return!0}if(Cv(y,$,I))return!0}return!1}function Cv(y,_,I){if(y.length>1){if(Lv(y,_))return!0;for(var U=0;U<_.length;U++)if(Kv(_[U],y,I))return!0}for(var $=0;$<y.length;$++)if(Kv(y[$],_,I))return!0;return!1}function Lv(y,_){if(y.length===0||_.length===0)return!1;for(var I=0;I<y.length-1;I++)for(var U=y[I],$=y[I+1],oe=0;oe<_.length-1;oe++){var he=_[oe],De=_[oe+1];if(wd(U,$,he,De))return!0}return!1}function wd(y,_,I,U){return ae(y,I,U)!==ae(_,I,U)&&ae(y,_,I)!==ae(y,_,U)}function Kv(y,_,I){var U=I*I;if(_.length===1)return y.distSqr(_[0])<U;for(var $=1;$<_.length;$++){var oe=_[$-1],he=_[$];if(hg(y,oe,he)<U)return!0}return!1}function hg(y,_,I){var U=_.distSqr(I);if(U===0)return y.distSqr(_);var $=((y.x-_.x)*(I.x-_.x)+(y.y-_.y)*(I.y-_.y))/U;return $<0?y.distSqr(_):$>1?y.distSqr(I):y.distSqr(I.sub(_)._mult($)._add(_))}function gp(y,_){for(var I=!1,U,$,oe,he=0;he<y.length;he++){U=y[he];for(var De=0,it=U.length-1;De<U.length;it=De++)$=U[De],oe=U[it],$.y>_.y!=oe.y>_.y&&_.x<(oe.x-$.x)*(_.y-$.y)/(oe.y-$.y)+$.x&&(I=!I)}return I}function Td(y,_){for(var I=!1,U=0,$=y.length-1;U<y.length;$=U++){var oe=y[U],he=y[$];oe.y>_.y!=he.y>_.y&&_.x<(he.x-oe.x)*(_.y-oe.y)/(he.y-oe.y)+oe.x&&(I=!I)}return I}function mp(y,_,I,U,$){for(var oe=0,he=y;oe<he.length;oe+=1){var De=he[oe];if(_<=De.x&&I<=De.y&&U>=De.x&&$>=De.y)return!0}var it=[new u(_,I),new u(_,$),new u(U,$),new u(U,I)];if(y.length>2)for(var yt=0,Lt=it;yt<Lt.length;yt+=1){var sr=Lt[yt];if(Td(y,sr))return!0}for(var gr=0;gr<y.length-1;gr++){var hr=y[gr],Rr=y[gr+1];if(Vd(hr,Rr,it))return!0}return!1}function Vd(y,_,I){var U=I[0],$=I[2];if(y.x<U.x&&_.x<U.x||y.x>$.x&&_.x>$.x||y.y<U.y&&_.y<U.y||y.y>$.y&&_.y>$.y)return!1;var oe=ae(y,_,I[0]);return oe!==ae(y,_,I[1])||oe!==ae(y,_,I[2])||oe!==ae(y,_,I[3])}function Ad(y,_,I){var U=_.paint.get(y).value;return U.kind==="constant"?U.value:I.programConfigurations.get(_.id).getMaxValue(y)}function Pv(y){return Math.sqrt(y[0]*y[0]+y[1]*y[1])}function Jv(y,_,I,U,$){if(!_[0]&&!_[1])return y;var oe=u.convert(_)._mult($);I==="viewport"&&oe._rotate(-U);for(var he=[],De=0;De<y.length;De++){var it=y[De];he.push(it.sub(oe))}return he}var Iv=new Or({"circle-sort-key":new bt(Rn.layout_circle["circle-sort-key"])}),hy=new Or({"circle-radius":new bt(Rn.paint_circle["circle-radius"]),"circle-color":new bt(Rn.paint_circle["circle-color"]),"circle-blur":new bt(Rn.paint_circle["circle-blur"]),"circle-opacity":new bt(Rn.paint_circle["circle-opacity"]),"circle-translate":new Me(Rn.paint_circle["circle-translate"]),"circle-translate-anchor":new Me(Rn.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Me(Rn.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Me(Rn.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new bt(Rn.paint_circle["circle-stroke-width"]),"circle-stroke-color":new bt(Rn.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new bt(Rn.paint_circle["circle-stroke-opacity"])}),dg={paint:hy,layout:Iv},oh=typeof Float32Array!="undefined"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var y=arguments,_=0,I=arguments.length;I--;)_+=y[I]*y[I];return Math.sqrt(_)});function vg(){var y=new oh(4);return oh!=Float32Array&&(y[1]=0,y[2]=0),y[0]=1,y[3]=1,y}function dy(y,_,I){var U=_[0],$=_[1],oe=_[2],he=_[3],De=Math.sin(I),it=Math.cos(I);return y[0]=U*it+oe*De,y[1]=$*it+he*De,y[2]=U*-De+oe*it,y[3]=$*-De+he*it,y}function Zh(){var y=new oh(9);return oh!=Float32Array&&(y[1]=0,y[2]=0,y[3]=0,y[5]=0,y[6]=0,y[7]=0),y[0]=1,y[4]=1,y[8]=1,y}function am(y,_){var I=Math.sin(_),U=Math.cos(_);return y[0]=U,y[1]=I,y[2]=0,y[3]=-I,y[4]=U,y[5]=0,y[6]=0,y[7]=0,y[8]=1,y}function k1(){var y=new oh(16);return oh!=Float32Array&&(y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[11]=0,y[12]=0,y[13]=0,y[14]=0),y[0]=1,y[5]=1,y[10]=1,y[15]=1,y}function C1(y){var _=new oh(16);return _[0]=y[0],_[1]=y[1],_[2]=y[2],_[3]=y[3],_[4]=y[4],_[5]=y[5],_[6]=y[6],_[7]=y[7],_[8]=y[8],_[9]=y[9],_[10]=y[10],_[11]=y[11],_[12]=y[12],_[13]=y[13],_[14]=y[14],_[15]=y[15],_}function vy(y){return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}function om(y,_){var I=_[0],U=_[1],$=_[2],oe=_[3],he=_[4],De=_[5],it=_[6],yt=_[7],Lt=_[8],sr=_[9],gr=_[10],hr=_[11],Rr=_[12],ni=_[13],Hi=_[14],wi=_[15],bn=I*De-U*he,rn=I*it-$*he,xn=I*yt-oe*he,In=U*it-$*De,Xn=U*yt-oe*De,ga=$*yt-oe*it,ha=Lt*ni-sr*Rr,eo=Lt*Hi-gr*Rr,za=Lt*wi-hr*Rr,Za=sr*Hi-gr*ni,Jo=sr*wi-hr*ni,to=gr*wi-hr*Hi,ao=bn*to-rn*Jo+xn*Za+In*za-Xn*eo+ga*ha;return ao?(ao=1/ao,y[0]=(De*to-it*Jo+yt*Za)*ao,y[1]=($*Jo-U*to-oe*Za)*ao,y[2]=(ni*ga-Hi*Xn+wi*In)*ao,y[3]=(gr*Xn-sr*ga-hr*In)*ao,y[4]=(it*za-he*to-yt*eo)*ao,y[5]=(I*to-$*za+oe*eo)*ao,y[6]=(Hi*xn-Rr*ga-wi*rn)*ao,y[7]=(Lt*ga-gr*xn+hr*rn)*ao,y[8]=(he*Jo-De*za+yt*ha)*ao,y[9]=(U*za-I*Jo-oe*ha)*ao,y[10]=(Rr*Xn-ni*xn+wi*bn)*ao,y[11]=(sr*xn-Lt*Xn-hr*bn)*ao,y[12]=(De*eo-he*Za-it*ha)*ao,y[13]=(I*Za-U*eo+$*ha)*ao,y[14]=(ni*rn-Rr*In-Hi*bn)*ao,y[15]=(Lt*In-sr*rn+gr*bn)*ao,y):null}function sm(y,_,I){var U=_[0],$=_[1],oe=_[2],he=_[3],De=_[4],it=_[5],yt=_[6],Lt=_[7],sr=_[8],gr=_[9],hr=_[10],Rr=_[11],ni=_[12],Hi=_[13],wi=_[14],bn=_[15],rn=I[0],xn=I[1],In=I[2],Xn=I[3];return y[0]=rn*U+xn*De+In*sr+Xn*ni,y[1]=rn*$+xn*it+In*gr+Xn*Hi,y[2]=rn*oe+xn*yt+In*hr+Xn*wi,y[3]=rn*he+xn*Lt+In*Rr+Xn*bn,rn=I[4],xn=I[5],In=I[6],Xn=I[7],y[4]=rn*U+xn*De+In*sr+Xn*ni,y[5]=rn*$+xn*it+In*gr+Xn*Hi,y[6]=rn*oe+xn*yt+In*hr+Xn*wi,y[7]=rn*he+xn*Lt+In*Rr+Xn*bn,rn=I[8],xn=I[9],In=I[10],Xn=I[11],y[8]=rn*U+xn*De+In*sr+Xn*ni,y[9]=rn*$+xn*it+In*gr+Xn*Hi,y[10]=rn*oe+xn*yt+In*hr+Xn*wi,y[11]=rn*he+xn*Lt+In*Rr+Xn*bn,rn=I[12],xn=I[13],In=I[14],Xn=I[15],y[12]=rn*U+xn*De+In*sr+Xn*ni,y[13]=rn*$+xn*it+In*gr+Xn*Hi,y[14]=rn*oe+xn*yt+In*hr+Xn*wi,y[15]=rn*he+xn*Lt+In*Rr+Xn*bn,y}function vc(y,_,I){var U=I[0],$=I[1],oe=I[2],he,De,it,yt,Lt,sr,gr,hr,Rr,ni,Hi,wi;return _===y?(y[12]=_[0]*U+_[4]*$+_[8]*oe+_[12],y[13]=_[1]*U+_[5]*$+_[9]*oe+_[13],y[14]=_[2]*U+_[6]*$+_[10]*oe+_[14],y[15]=_[3]*U+_[7]*$+_[11]*oe+_[15]):(he=_[0],De=_[1],it=_[2],yt=_[3],Lt=_[4],sr=_[5],gr=_[6],hr=_[7],Rr=_[8],ni=_[9],Hi=_[10],wi=_[11],y[0]=he,y[1]=De,y[2]=it,y[3]=yt,y[4]=Lt,y[5]=sr,y[6]=gr,y[7]=hr,y[8]=Rr,y[9]=ni,y[10]=Hi,y[11]=wi,y[12]=he*U+Lt*$+Rr*oe+_[12],y[13]=De*U+sr*$+ni*oe+_[13],y[14]=it*U+gr*$+Hi*oe+_[14],y[15]=yt*U+hr*$+wi*oe+_[15]),y}function tu(y,_,I){var U=I[0],$=I[1],oe=I[2];return y[0]=_[0]*U,y[1]=_[1]*U,y[2]=_[2]*U,y[3]=_[3]*U,y[4]=_[4]*$,y[5]=_[5]*$,y[6]=_[6]*$,y[7]=_[7]*$,y[8]=_[8]*oe,y[9]=_[9]*oe,y[10]=_[10]*oe,y[11]=_[11]*oe,y[12]=_[12],y[13]=_[13],y[14]=_[14],y[15]=_[15],y}function Sd(y,_,I){var U=Math.sin(I),$=Math.cos(I),oe=_[4],he=_[5],De=_[6],it=_[7],yt=_[8],Lt=_[9],sr=_[10],gr=_[11];return _!==y&&(y[0]=_[0],y[1]=_[1],y[2]=_[2],y[3]=_[3],y[12]=_[12],y[13]=_[13],y[14]=_[14],y[15]=_[15]),y[4]=oe*$+yt*U,y[5]=he*$+Lt*U,y[6]=De*$+sr*U,y[7]=it*$+gr*U,y[8]=yt*$-oe*U,y[9]=Lt*$-he*U,y[10]=sr*$-De*U,y[11]=gr*$-it*U,y}function py(y,_,I){var U=Math.sin(I),$=Math.cos(I),oe=_[0],he=_[1],De=_[2],it=_[3],yt=_[4],Lt=_[5],sr=_[6],gr=_[7];return _!==y&&(y[8]=_[8],y[9]=_[9],y[10]=_[10],y[11]=_[11],y[12]=_[12],y[13]=_[13],y[14]=_[14],y[15]=_[15]),y[0]=oe*$+yt*U,y[1]=he*$+Lt*U,y[2]=De*$+sr*U,y[3]=it*$+gr*U,y[4]=yt*$-oe*U,y[5]=Lt*$-he*U,y[6]=sr*$-De*U,y[7]=gr*$-it*U,y}function L1(y,_,I,U,$){var oe=1/Math.tan(_/2),he;return y[0]=oe/I,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=oe,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[11]=-1,y[12]=0,y[13]=0,y[15]=0,$!=null&&$!==1/0?(he=1/(U-$),y[10]=($+U)*he,y[14]=2*$*U*he):(y[10]=-1,y[14]=-2*U),y}function wu(y,_,I,U,$,oe,he){var De=1/(_-I),it=1/(U-$),yt=1/(oe-he);return y[0]=-2*De,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=-2*it,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=2*yt,y[11]=0,y[12]=(_+I)*De,y[13]=($+U)*it,y[14]=(he+oe)*yt,y[15]=1,y}var Kx=sm;function lm(){var y=new oh(3);return oh!=Float32Array&&(y[0]=0,y[1]=0,y[2]=0),y}function Bw(y){var _=new oh(3);return _[0]=y[0],_[1]=y[1],_[2]=y[2],_}function Rv(y,_,I){return y[0]=_[0]+I[0],y[1]=_[1]+I[1],y[2]=_[2]+I[2],y}function um(y,_,I){return y[0]=_[0]-I[0],y[1]=_[1]-I[1],y[2]=_[2]-I[2],y}function Nw(y,_,I){return y[0]=_[0]*I,y[1]=_[1]*I,y[2]=_[2]*I,y}function Jx(y,_){var I=_[0],U=_[1],$=_[2],oe=I*I+U*U+$*$;return oe>0&&(oe=1/Math.sqrt(oe)),y[0]=_[0]*oe,y[1]=_[1]*oe,y[2]=_[2]*oe,y}function H9(y,_){return y[0]*_[0]+y[1]*_[1]+y[2]*_[2]}function j9(y,_,I){var U=_[0],$=_[1],oe=_[2],he=I[0],De=I[1],it=I[2];return y[0]=$*it-oe*De,y[1]=oe*he-U*it,y[2]=U*De-$*he,y}function W9(y,_,I){var U=_[0],$=_[1],oe=_[2];return y[0]=U*I[0]+$*I[3]+oe*I[6],y[1]=U*I[1]+$*I[4]+oe*I[7],y[2]=U*I[2]+$*I[5]+oe*I[8],y}var X9=um,OQ=function(){var y=lm();return function(_,I,U,$,oe,he){var De,it;for(I||(I=3),U||(U=0),$?it=Math.min($*I+U,_.length):it=_.length,De=U;De<it;De+=I)y[0]=_[De],y[1]=_[De+1],y[2]=_[De+2],oe(y,y,he),_[De]=y[0],_[De+1]=y[1],_[De+2]=y[2];return _}}();function Z9(){var y=new oh(4);return oh!=Float32Array&&(y[0]=0,y[1]=0,y[2]=0,y[3]=0),y}function Y9(y,_,I){return y[0]=_[0]*I,y[1]=_[1]*I,y[2]=_[2]*I,y[3]=_[3]*I,y}function K9(y,_){return y[0]*_[0]+y[1]*_[1]+y[2]*_[2]+y[3]*_[3]}function gy(y,_,I){var U=_[0],$=_[1],oe=_[2],he=_[3];return y[0]=I[0]*U+I[4]*$+I[8]*oe+I[12]*he,y[1]=I[1]*U+I[5]*$+I[9]*oe+I[13]*he,y[2]=I[2]*U+I[6]*$+I[10]*oe+I[14]*he,y[3]=I[3]*U+I[7]*$+I[11]*oe+I[15]*he,y}var $x=function(){var y=Z9();return function(_,I,U,$,oe,he){var De,it;for(I||(I=4),U||(U=0),$?it=Math.min($*I+U,_.length):it=_.length,De=U;De<it;De+=I)y[0]=_[De],y[1]=_[De+1],y[2]=_[De+2],y[3]=_[De+3],oe(y,y,he),_[De]=y[0],_[De+1]=y[1],_[De+2]=y[2],_[De+3]=y[3];return _}}();function MC(){var y=new oh(2);return oh!=Float32Array&&(y[0]=0,y[1]=0),y}function uS(y){var _=y[0],I=y[1];return _*_+I*I}var cS=uS,BQ=function(){var y=MC();return function(_,I,U,$,oe,he){var De,it;for(I||(I=2),U||(U=0),$?it=Math.min($*I+U,_.length):it=_.length,De=U;De<it;De+=I)y[0]=_[De],y[1]=_[De+1],oe(y,y,he),_[De]=y[0],_[De+1]=y[1];return _}}(),J9=function(y){function _(I){y.call(this,I,dg)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.createBucket=function(U){return new ts(U)},_.prototype.queryRadius=function(U){var $=U;return Ad("circle-radius",this,$)+Ad("circle-stroke-width",this,$)+Pv(this.paint.get("circle-translate"))},_.prototype.queryIntersectsFeature=function(U,$,oe,he,De,it,yt,Lt){for(var sr=Jv(U,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),it.angle,yt),gr=this.paint.get("circle-radius").evaluate($,oe),hr=this.paint.get("circle-stroke-width").evaluate($,oe),Rr=gr+hr,ni=this.paint.get("circle-pitch-alignment")==="map",Hi=ni?sr:kC(sr,Lt),wi=ni?Rr*yt:Rr,bn=0,rn=he;bn<rn.length;bn+=1)for(var xn=rn[bn],In=0,Xn=xn;In<Xn.length;In+=1){var ga=Xn[In],ha=ni?ga:EC(ga,Lt),eo=wi,za=gy([],[ga.x,ga.y,0,1],Lt);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?eo*=za[3]/it.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(eo*=it.cameraToCenterDistance/za[3]),Yo(Hi,ha,eo))return!0}return!1},_}(vi);function EC(y,_){var I=gy([],[y.x,y.y,0,1],_);return new u(I[0]/I[3],I[1]/I[3])}function kC(y,_){return y.map(function(I){return EC(I,_)})}var fS=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_}(ts);X("HeatmapBucket",fS,{omit:["layers"]});function Md(y,_,I,U){var $=_.width,oe=_.height;if(!U)U=new Uint8Array($*oe*I);else if(U instanceof Uint8ClampedArray)U=new Uint8Array(U.buffer);else if(U.length!==$*oe*I)throw new RangeError("mismatched image size");return y.width=$,y.height=oe,y.data=U,y}function Uw(y,_,I){var U=_.width,$=_.height;if(!(U===y.width&&$===y.height)){var oe=Md({},{width:U,height:$},I);Vw(y,oe,{x:0,y:0},{x:0,y:0},{width:Math.min(y.width,U),height:Math.min(y.height,$)},I),y.width=U,y.height=$,y.data=oe.data}}function Vw(y,_,I,U,$,oe){if($.width===0||$.height===0)return _;if($.width>y.width||$.height>y.height||I.x>y.width-$.width||I.y>y.height-$.height)throw new RangeError("out of range source coordinates for image copy");if($.width>_.width||$.height>_.height||U.x>_.width-$.width||U.y>_.height-$.height)throw new RangeError("out of range destination coordinates for image copy");for(var he=y.data,De=_.data,it=0;it<$.height;it++)for(var yt=((I.y+it)*y.width+I.x)*oe,Lt=((U.y+it)*_.width+U.x)*oe,sr=0;sr<$.width*oe;sr++)De[Lt+sr]=he[yt+sr];return _}var Dv=function(_,I){Md(this,_,1,I)};Dv.prototype.resize=function(_){Uw(this,_,1)},Dv.prototype.clone=function(){return new Dv({width:this.width,height:this.height},new Uint8Array(this.data))},Dv.copy=function(_,I,U,$,oe){Vw(_,I,U,$,oe,1)};var Eh=function(_,I){Md(this,_,4,I)};Eh.prototype.resize=function(_){Uw(this,_,4)},Eh.prototype.replace=function(_,I){I?this.data.set(_):_ instanceof Uint8ClampedArray?this.data=new Uint8Array(_.buffer):this.data=_},Eh.prototype.clone=function(){return new Eh({width:this.width,height:this.height},new Uint8Array(this.data))},Eh.copy=function(_,I,U,$,oe){Vw(_,I,U,$,oe,4)},X("AlphaImage",Dv),X("RGBAImage",Eh);var Qx=new Or({"heatmap-radius":new bt(Rn.paint_heatmap["heatmap-radius"]),"heatmap-weight":new bt(Rn.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Me(Rn.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Vr(Rn.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Me(Rn.paint_heatmap["heatmap-opacity"])}),P1={paint:Qx};function eb(y){var _={},I=y.resolution||256,U=y.clips?y.clips.length:1,$=y.image||new Eh({width:I,height:U}),oe=function(bn,rn,xn){_[y.evaluationKey]=xn;var In=y.expression.evaluate(_);$.data[bn+rn+0]=Math.floor(In.r*255/In.a),$.data[bn+rn+1]=Math.floor(In.g*255/In.a),$.data[bn+rn+2]=Math.floor(In.b*255/In.a),$.data[bn+rn+3]=Math.floor(In.a*255)};if(y.clips)for(var yt=0,Lt=0;yt<U;++yt,Lt+=I*4)for(var sr=0,gr=0;sr<I;sr++,gr+=4){var hr=sr/(I-1),Rr=y.clips[yt],ni=Rr.start,Hi=Rr.end,wi=ni*(1-hr)+Hi*hr;oe(Lt,gr,wi)}else for(var he=0,De=0;he<I;he++,De+=4){var it=he/(I-1);oe(0,De,it)}return $}var Gw=function(y){function _(I){y.call(this,I,P1),this._updateColorRamp()}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.createBucket=function(U){return new fS(U)},_.prototype._handleSpecialPaintPropertyUpdate=function(U){U==="heatmap-color"&&this._updateColorRamp()},_.prototype._updateColorRamp=function(){var U=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=eb({expression:U,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},_.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},_.prototype.queryRadius=function(){return 0},_.prototype.queryIntersectsFeature=function(){return!1},_.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},_}(vi),$9=new Or({"hillshade-illumination-direction":new Me(Rn.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Me(Rn.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Me(Rn.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Me(Rn.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Me(Rn.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Me(Rn.paint_hillshade["hillshade-accent-color"])}),Q9={paint:$9},CC=function(y){function _(I){y.call(this,I,Q9)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},_}(vi),LC=ji([{name:"a_pos",components:2,type:"Int16"}],4),eq=LC.members,Hw=I1,PC=I1;function I1(y,_,I){I=I||2;var U=_&&_.length,$=U?_[0]*I:y.length,oe=jw(y,0,$,I,!0),he=[];if(!oe||oe.next===oe.prev)return he;var De,it,yt,Lt,sr,gr,hr;if(U&&(oe=fm(y,_,oe,I)),y.length>80*I){De=yt=y[0],it=Lt=y[1];for(var Rr=I;Rr<$;Rr+=I)sr=y[Rr],gr=y[Rr+1],sr<De&&(De=sr),gr<it&&(it=gr),sr>yt&&(yt=sr),gr>Lt&&(Lt=gr);hr=Math.max(yt-De,Lt-it),hr=hr!==0?1/hr:0}return tb(oe,he,I,De,it,hr),he}function jw(y,_,I,U,$){var oe,he;if($===yS(y,_,I,U)>0)for(oe=_;oe<I;oe+=U)he=zC(oe,y[oe],y[oe+1],he);else for(oe=I-U;oe>=_;oe-=U)he=zC(oe,y[oe],y[oe+1],he);return he&&ib(he,he.next)&&(ob(he),he=he.next),he}function cm(y,_){if(!y)return y;_||(_=y);var I=y,U;do if(U=!1,!I.steiner&&(ib(I,I.next)||Tf(I.prev,I,I.next)===0)){if(ob(I),I=_=I.prev,I===I.next)break;U=!0}else I=I.next;while(U||I!==_);return _}function tb(y,_,I,U,$,oe,he){if(y){!he&&oe&&Ww(y,U,$,oe);for(var De=y,it,yt;y.prev!==y.next;){if(it=y.prev,yt=y.next,oe?RC(y,U,$,oe):IC(y)){_.push(it.i/I),_.push(y.i/I),_.push(yt.i/I),ob(y),y=yt.next,De=yt.next;continue}if(y=yt,y===De){he?he===1?(y=rb(cm(y),_,I),tb(y,_,I,U,$,oe,2)):he===2&&v0(y,_,I,U,$,oe):tb(cm(y),_,I,U,$,oe,1);break}}}}function IC(y){var _=y.prev,I=y,U=y.next;if(Tf(_,I,U)>=0)return!1;for(var $=y.next.next;$!==y.prev;){if(hm(_.x,_.y,I.x,I.y,U.x,U.y,$.x,$.y)&&Tf($.prev,$,$.next)>=0)return!1;$=$.next}return!0}function RC(y,_,I,U){var $=y.prev,oe=y,he=y.next;if(Tf($,oe,he)>=0)return!1;for(var De=$.x<oe.x?$.x<he.x?$.x:he.x:oe.x<he.x?oe.x:he.x,it=$.y<oe.y?$.y<he.y?$.y:he.y:oe.y<he.y?oe.y:he.y,yt=$.x>oe.x?$.x>he.x?$.x:he.x:oe.x>he.x?oe.x:he.x,Lt=$.y>oe.y?$.y>he.y?$.y:he.y:oe.y>he.y?oe.y:he.y,sr=vS(De,it,_,I,U),gr=vS(yt,Lt,_,I,U),hr=y.prevZ,Rr=y.nextZ;hr&&hr.z>=sr&&Rr&&Rr.z<=gr;){if(hr!==y.prev&&hr!==y.next&&hm($.x,$.y,oe.x,oe.y,he.x,he.y,hr.x,hr.y)&&Tf(hr.prev,hr,hr.next)>=0||(hr=hr.prevZ,Rr!==y.prev&&Rr!==y.next&&hm($.x,$.y,oe.x,oe.y,he.x,he.y,Rr.x,Rr.y)&&Tf(Rr.prev,Rr,Rr.next)>=0))return!1;Rr=Rr.nextZ}for(;hr&&hr.z>=sr;){if(hr!==y.prev&&hr!==y.next&&hm($.x,$.y,oe.x,oe.y,he.x,he.y,hr.x,hr.y)&&Tf(hr.prev,hr,hr.next)>=0)return!1;hr=hr.prevZ}for(;Rr&&Rr.z<=gr;){if(Rr!==y.prev&&Rr!==y.next&&hm($.x,$.y,oe.x,oe.y,he.x,he.y,Rr.x,Rr.y)&&Tf(Rr.prev,Rr,Rr.next)>=0)return!1;Rr=Rr.nextZ}return!0}function rb(y,_,I){var U=y;do{var $=U.prev,oe=U.next.next;!ib($,oe)&&Xw($,U,U.next,oe)&&ab($,oe)&&ab(oe,$)&&(_.push($.i/I),_.push(U.i/I),_.push(oe.i/I),ob(U),ob(U.next),U=y=oe),U=U.next}while(U!==y);return cm(U)}function v0(y,_,I,U,$,oe){var he=y;do{for(var De=he.next.next;De!==he.prev;){if(he.i!==De.i&&R1(he,De)){var it=gS(he,De);he=cm(he,he.next),it=cm(it,it.next),tb(he,_,I,U,$,oe),tb(it,_,I,U,$,oe);return}De=De.next}he=he.next}while(he!==y)}function fm(y,_,I,U){var $=[],oe,he,De,it,yt;for(oe=0,he=_.length;oe<he;oe++)De=_[oe]*U,it=oe<he-1?_[oe+1]*U:y.length,yt=jw(y,De,it,U,!1),yt===yt.next&&(yt.steiner=!0),$.push(pS(yt));for($.sort(DC),oe=0;oe<$.length;oe++)hS($[oe],I),I=cm(I,I.next);return I}function DC(y,_){return y.x-_.x}function hS(y,_){if(_=tq(y,_),_){var I=gS(_,y);cm(_,_.next),cm(I,I.next)}}function tq(y,_){var I=_,U=y.x,$=y.y,oe=-1/0,he;do{if($<=I.y&&$>=I.next.y&&I.next.y!==I.y){var De=I.x+($-I.y)*(I.next.x-I.x)/(I.next.y-I.y);if(De<=U&&De>oe){if(oe=De,De===U){if($===I.y)return I;if($===I.next.y)return I.next}he=I.x<I.next.x?I:I.next}}I=I.next}while(I!==_);if(!he)return null;if(U===oe)return he;var it=he,yt=he.x,Lt=he.y,sr=1/0,gr;I=he;do U>=I.x&&I.x>=yt&&U!==I.x&&hm($<Lt?U:oe,$,yt,Lt,$<Lt?oe:U,$,I.x,I.y)&&(gr=Math.abs($-I.y)/(U-I.x),ab(I,y)&&(gr<sr||gr===sr&&(I.x>he.x||I.x===he.x&&rq(he,I)))&&(he=I,sr=gr)),I=I.next;while(I!==it);return he}function rq(y,_){return Tf(y.prev,y,_.prev)<0&&Tf(_.next,y,y.next)<0}function Ww(y,_,I,U){var $=y;do $.z===null&&($.z=vS($.x,$.y,_,I,U)),$.prevZ=$.prev,$.nextZ=$.next,$=$.next;while($!==y);$.prevZ.nextZ=null,$.prevZ=null,dS($)}function dS(y){var _,I,U,$,oe,he,De,it,yt=1;do{for(I=y,y=null,oe=null,he=0;I;){for(he++,U=I,De=0,_=0;_<yt&&(De++,U=U.nextZ,!!U);_++);for(it=yt;De>0||it>0&&U;)De!==0&&(it===0||!U||I.z<=U.z)?($=I,I=I.nextZ,De--):($=U,U=U.nextZ,it--),oe?oe.nextZ=$:y=$,$.prevZ=oe,oe=$;I=U}oe.nextZ=null,yt*=2}while(he>1);return y}function vS(y,_,I,U,$){return y=32767*(y-I)*$,_=32767*(_-U)*$,y=(y|y<<8)&16711935,y=(y|y<<4)&252645135,y=(y|y<<2)&858993459,y=(y|y<<1)&1431655765,_=(_|_<<8)&16711935,_=(_|_<<4)&252645135,_=(_|_<<2)&858993459,_=(_|_<<1)&1431655765,y|_<<1}function pS(y){var _=y,I=y;do(_.x<I.x||_.x===I.x&&_.y<I.y)&&(I=_),_=_.next;while(_!==y);return I}function hm(y,_,I,U,$,oe,he,De){return($-he)*(_-De)-(y-he)*(oe-De)>=0&&(y-he)*(U-De)-(I-he)*(_-De)>=0&&(I-he)*(oe-De)-($-he)*(U-De)>=0}function R1(y,_){return y.next.i!==_.i&&y.prev.i!==_.i&&!FC(y,_)&&(ab(y,_)&&ab(_,y)&&iq(y,_)&&(Tf(y.prev,y,_.prev)||Tf(y,_.prev,_))||ib(y,_)&&Tf(y.prev,y,y.next)>0&&Tf(_.prev,_,_.next)>0)}function Tf(y,_,I){return(_.y-y.y)*(I.x-_.x)-(_.x-y.x)*(I.y-_.y)}function ib(y,_){return y.x===_.x&&y.y===_.y}function Xw(y,_,I,U){var $=my(Tf(y,_,I)),oe=my(Tf(y,_,U)),he=my(Tf(I,U,y)),De=my(Tf(I,U,_));return!!($!==oe&&he!==De||$===0&&nb(y,I,_)||oe===0&&nb(y,U,_)||he===0&&nb(I,y,U)||De===0&&nb(I,_,U))}function nb(y,_,I){return _.x<=Math.max(y.x,I.x)&&_.x>=Math.min(y.x,I.x)&&_.y<=Math.max(y.y,I.y)&&_.y>=Math.min(y.y,I.y)}function my(y){return y>0?1:y<0?-1:0}function FC(y,_){var I=y;do{if(I.i!==y.i&&I.next.i!==y.i&&I.i!==_.i&&I.next.i!==_.i&&Xw(I,I.next,y,_))return!0;I=I.next}while(I!==y);return!1}function ab(y,_){return Tf(y.prev,y,y.next)<0?Tf(y,_,y.next)>=0&&Tf(y,y.prev,_)>=0:Tf(y,_,y.prev)<0||Tf(y,y.next,_)<0}function iq(y,_){var I=y,U=!1,$=(y.x+_.x)/2,oe=(y.y+_.y)/2;do I.y>oe!=I.next.y>oe&&I.next.y!==I.y&&$<(I.next.x-I.x)*(oe-I.y)/(I.next.y-I.y)+I.x&&(U=!U),I=I.next;while(I!==y);return U}function gS(y,_){var I=new mS(y.i,y.x,y.y),U=new mS(_.i,_.x,_.y),$=y.next,oe=_.prev;return y.next=_,_.prev=y,I.next=$,$.prev=I,U.next=I,I.prev=U,oe.next=U,U.prev=oe,U}function zC(y,_,I,U){var $=new mS(y,_,I);return U?($.next=U.next,$.prev=U,U.next.prev=$,U.next=$):($.prev=$,$.next=$),$}function ob(y){y.next.prev=y.prev,y.prev.next=y.next,y.prevZ&&(y.prevZ.nextZ=y.nextZ),y.nextZ&&(y.nextZ.prevZ=y.prevZ)}function mS(y,_,I){this.i=y,this.x=_,this.y=I,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}I1.deviation=function(y,_,I,U){var $=_&&_.length,oe=$?_[0]*I:y.length,he=Math.abs(yS(y,0,oe,I));if($)for(var De=0,it=_.length;De<it;De++){var yt=_[De]*I,Lt=De<it-1?_[De+1]*I:y.length;he-=Math.abs(yS(y,yt,Lt,I))}var sr=0;for(De=0;De<U.length;De+=3){var gr=U[De]*I,hr=U[De+1]*I,Rr=U[De+2]*I;sr+=Math.abs((y[gr]-y[Rr])*(y[hr+1]-y[gr+1])-(y[gr]-y[hr])*(y[Rr+1]-y[gr+1]))}return he===0&&sr===0?0:Math.abs((sr-he)/he)};function yS(y,_,I,U){for(var $=0,oe=_,he=I-U;oe<I;oe+=U)$+=(y[he]-y[oe])*(y[oe+1]+y[he+1]),he=oe;return $}I1.flatten=function(y){for(var _=y[0][0].length,I={vertices:[],holes:[],dimensions:_},U=0,$=0;$<y.length;$++){for(var oe=0;oe<y[$].length;oe++)for(var he=0;he<_;he++)I.vertices.push(y[$][oe][he]);$>0&&(U+=y[$-1].length,I.holes.push(U))}return I},Hw.default=PC;function _S(y,_,I,U,$){pg(y,_,I||0,U||y.length-1,$||qC)}function pg(y,_,I,U,$){for(;U>I;){if(U-I>600){var oe=U-I+1,he=_-I+1,De=Math.log(oe),it=.5*Math.exp(2*De/3),yt=.5*Math.sqrt(De*it*(oe-it)/oe)*(he-oe/2<0?-1:1),Lt=Math.max(I,Math.floor(_-he*it/oe+yt)),sr=Math.min(U,Math.floor(_+(oe-he)*it/oe+yt));pg(y,_,Lt,sr,$)}var gr=y[_],hr=I,Rr=U;for(D1(y,I,_),$(y[U],gr)>0&&D1(y,I,U);hr<Rr;){for(D1(y,hr,Rr),hr++,Rr--;$(y[hr],gr)<0;)hr++;for(;$(y[Rr],gr)>0;)Rr--}$(y[I],gr)===0?D1(y,I,Rr):(Rr++,D1(y,Rr,U)),Rr<=_&&(I=Rr+1),_<=Rr&&(U=Rr-1)}}function D1(y,_,I){var U=y[_];y[_]=y[I],y[I]=U}function qC(y,_){return y<_?-1:y>_?1:0}function Zw(y,_){var I=y.length;if(I<=1)return[y];for(var U=[],$,oe,he=0;he<I;he++){var De=_e(y[he]);De!==0&&(y[he].area=Math.abs(De),oe===void 0&&(oe=De<0),oe===De<0?($&&U.push($),$=[y[he]]):$.push(y[he]))}if($&&U.push($),_>1)for(var it=0;it<U.length;it++)U[it].length<=_||(_S(U[it],_,1,U[it].length-1,OC),U[it]=U[it].slice(0,_));return U}function OC(y,_){return _.area-y.area}function Yw(y,_,I){for(var U=I.patternDependencies,$=!1,oe=0,he=_;oe<he.length;oe+=1){var De=he[oe],it=De.paint.get(y+"-pattern");it.isConstant()||($=!0);var yt=it.constantOr(null);yt&&($=!0,U[yt.to]=!0,U[yt.from]=!0)}return $}function sb(y,_,I,U,$){for(var oe=$.patternDependencies,he=0,De=_;he<De.length;he+=1){var it=De[he],yt=it.paint.get(y+"-pattern"),Lt=yt.value;if(Lt.kind!=="constant"){var sr=Lt.evaluate({zoom:U-1},I,{},$.availableImages),gr=Lt.evaluate({zoom:U},I,{},$.availableImages),hr=Lt.evaluate({zoom:U+1},I,{},$.availableImages);sr=sr&&sr.name?sr.name:sr,gr=gr&&gr.name?gr.name:gr,hr=hr&&hr.name?hr.name:hr,oe[sr]=!0,oe[gr]=!0,oe[hr]=!0,I.patterns[it.id]={min:sr,mid:gr,max:hr}}}return I}var lb=500,yp=function(_){this.zoom=_.zoom,this.overscaling=_.overscaling,this.layers=_.layers,this.layerIds=this.layers.map(function(I){return I.id}),this.index=_.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Zr,this.indexArray=new pn,this.indexArray2=new sa,this.programConfigurations=new ci(_.layers,_.zoom),this.segments=new io,this.segments2=new io,this.stateDependentLayerIds=this.layers.filter(function(I){return I.isStateDependent()}).map(function(I){return I.id})};yp.prototype.populate=function(_,I,U){this.hasPattern=Yw("fill",this.layers,I);for(var $=this.layers[0].layout.get("fill-sort-key"),oe=[],he=0,De=_;he<De.length;he+=1){var it=De[he],yt=it.feature,Lt=it.id,sr=it.index,gr=it.sourceLayerIndex,hr=this.layers[0]._featureFilter.needGeometry,Rr=Ja(yt,hr);if(this.layers[0]._featureFilter.filter(new Un(this.zoom),Rr,U)){var ni=$?$.evaluate(Rr,{},U,I.availableImages):void 0,Hi={id:Lt,properties:yt.properties,type:yt.type,sourceLayerIndex:gr,index:sr,geometry:hr?Rr.geometry:zn(yt),patterns:{},sortKey:ni};oe.push(Hi)}}$&&oe.sort(function(za,Za){return za.sortKey-Za.sortKey});for(var wi=0,bn=oe;wi<bn.length;wi+=1){var rn=bn[wi],xn=rn,In=xn.geometry,Xn=xn.index,ga=xn.sourceLayerIndex;if(this.hasPattern){var ha=sb("fill",this.layers,rn,this.zoom,I);this.patternFeatures.push(ha)}else this.addFeature(rn,In,Xn,U,{});var eo=_[Xn].feature;I.featureIndex.insert(eo,In,Xn,ga,this.index)}},yp.prototype.update=function(_,I,U){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(_,I,this.stateDependentLayers,U)},yp.prototype.addFeatures=function(_,I,U){for(var $=0,oe=this.patternFeatures;$<oe.length;$+=1){var he=oe[$];this.addFeature(he,he.geometry,he.index,I,U)}},yp.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},yp.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},yp.prototype.upload=function(_){this.uploaded||(this.layoutVertexBuffer=_.createVertexBuffer(this.layoutVertexArray,eq),this.indexBuffer=_.createIndexBuffer(this.indexArray),this.indexBuffer2=_.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(_),this.uploaded=!0},yp.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},yp.prototype.addFeature=function(_,I,U,$,oe){for(var he=0,De=Zw(I,lb);he<De.length;he+=1){for(var it=De[he],yt=0,Lt=0,sr=it;Lt<sr.length;Lt+=1){var gr=sr[Lt];yt+=gr.length}for(var hr=this.segments.prepareSegment(yt,this.layoutVertexArray,this.indexArray),Rr=hr.vertexLength,ni=[],Hi=[],wi=0,bn=it;wi<bn.length;wi+=1){var rn=bn[wi];if(rn.length!==0){rn!==it[0]&&Hi.push(ni.length/2);var xn=this.segments2.prepareSegment(rn.length,this.layoutVertexArray,this.indexArray2),In=xn.vertexLength;this.layoutVertexArray.emplaceBack(rn[0].x,rn[0].y),this.indexArray2.emplaceBack(In+rn.length-1,In),ni.push(rn[0].x),ni.push(rn[0].y);for(var Xn=1;Xn<rn.length;Xn++)this.layoutVertexArray.emplaceBack(rn[Xn].x,rn[Xn].y),this.indexArray2.emplaceBack(In+Xn-1,In+Xn),ni.push(rn[Xn].x),ni.push(rn[Xn].y);xn.vertexLength+=rn.length,xn.primitiveLength+=rn.length}}for(var ga=Hw(ni,Hi),ha=0;ha<ga.length;ha+=3)this.indexArray.emplaceBack(Rr+ga[ha],Rr+ga[ha+1],Rr+ga[ha+2]);hr.vertexLength+=yt,hr.primitiveLength+=ga.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,_,U,oe,$)},X("FillBucket",yp,{omit:["layers","patternFeatures"]});var xS=new Or({"fill-sort-key":new bt(Rn.layout_fill["fill-sort-key"])}),BC=new Or({"fill-antialias":new Me(Rn.paint_fill["fill-antialias"]),"fill-opacity":new bt(Rn.paint_fill["fill-opacity"]),"fill-color":new bt(Rn.paint_fill["fill-color"]),"fill-outline-color":new bt(Rn.paint_fill["fill-outline-color"]),"fill-translate":new Me(Rn.paint_fill["fill-translate"]),"fill-translate-anchor":new Me(Rn.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ot(Rn.paint_fill["fill-pattern"])}),$v={paint:BC,layout:xS},ub=function(y){function _(I){y.call(this,I,$v)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.recalculate=function(U,$){y.prototype.recalculate.call(this,U,$);var oe=this.paint._values["fill-outline-color"];oe.value.kind==="constant"&&oe.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},_.prototype.createBucket=function(U){return new yp(U)},_.prototype.queryRadius=function(){return Pv(this.paint.get("fill-translate"))},_.prototype.queryIntersectsFeature=function(U,$,oe,he,De,it,yt){var Lt=Jv(U,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),it.angle,yt);return ms(Lt,he)},_.prototype.isTileClipped=function(){return!0},_}(vi),NC=ji([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),UC=NC.members,bS=yy;function yy(y,_,I,U,$){this.properties={},this.extent=I,this.type=0,this._pbf=y,this._geometry=-1,this._keys=U,this._values=$,y.readFields(VC,this,_)}function VC(y,_,I){y==1?_.id=I.readVarint():y==2?GC(I,_):y==3?_.type=I.readVarint():y==4&&(_._geometry=I.pos)}function GC(y,_){for(var I=y.readVarint()+y.pos;y.pos<I;){var U=_._keys[y.readVarint()],$=_._values[y.readVarint()];_.properties[U]=$}}yy.types=["Unknown","Point","LineString","Polygon"],yy.prototype.loadGeometry=function(){var y=this._pbf;y.pos=this._geometry;for(var _=y.readVarint()+y.pos,I=1,U=0,$=0,oe=0,he=[],De;y.pos<_;){if(U<=0){var it=y.readVarint();I=it&7,U=it>>3}if(U--,I===1||I===2)$+=y.readSVarint(),oe+=y.readSVarint(),I===1&&(De&&he.push(De),De=[]),De.push(new u($,oe));else if(I===7)De&&De.push(De[0].clone());else throw new Error("unknown command "+I)}return De&&he.push(De),he},yy.prototype.bbox=function(){var y=this._pbf;y.pos=this._geometry;for(var _=y.readVarint()+y.pos,I=1,U=0,$=0,oe=0,he=1/0,De=-1/0,it=1/0,yt=-1/0;y.pos<_;){if(U<=0){var Lt=y.readVarint();I=Lt&7,U=Lt>>3}if(U--,I===1||I===2)$+=y.readSVarint(),oe+=y.readSVarint(),$<he&&(he=$),$>De&&(De=$),oe<it&&(it=oe),oe>yt&&(yt=oe);else if(I!==7)throw new Error("unknown command "+I)}return[he,it,De,yt]},yy.prototype.toGeoJSON=function(y,_,I){var U=this.extent*Math.pow(2,I),$=this.extent*y,oe=this.extent*_,he=this.loadGeometry(),De=yy.types[this.type],it,yt;function Lt(hr){for(var Rr=0;Rr<hr.length;Rr++){var ni=hr[Rr],Hi=180-(ni.y+oe)*360/U;hr[Rr]=[(ni.x+$)*360/U-180,360/Math.PI*Math.atan(Math.exp(Hi*Math.PI/180))-90]}}switch(this.type){case 1:var sr=[];for(it=0;it<he.length;it++)sr[it]=he[it][0];he=sr,Lt(he);break;case 2:for(it=0;it<he.length;it++)Lt(he[it]);break;case 3:for(he=nq(he),it=0;it<he.length;it++)for(yt=0;yt<he[it].length;yt++)Lt(he[it][yt]);break}he.length===1?he=he[0]:De="Multi"+De;var gr={type:"Feature",geometry:{type:De,coordinates:he},properties:this.properties};return"id"in this&&(gr.id=this.id),gr};function nq(y){var _=y.length;if(_<=1)return[y];for(var I=[],U,$,oe=0;oe<_;oe++){var he=HC(y[oe]);he!==0&&($===void 0&&($=he<0),$===he<0?(U&&I.push(U),U=[y[oe]]):U.push(y[oe]))}return U&&I.push(U),I}function HC(y){for(var _=0,I=0,U=y.length,$=U-1,oe,he;I<U;$=I++)oe=y[I],he=y[$],_+=(he.x-oe.x)*(oe.y+he.y);return _}var gg=wS;function wS(y,_){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=y,this._keys=[],this._values=[],this._features=[],y.readFields(jC,this,_),this.length=this._features.length}function jC(y,_,I){y===15?_.version=I.readVarint():y===1?_.name=I.readString():y===5?_.extent=I.readVarint():y===2?_._features.push(I.pos):y===3?_._keys.push(I.readString()):y===4&&_._values.push(WC(I))}function WC(y){for(var _=null,I=y.readVarint()+y.pos;y.pos<I;){var U=y.readVarint()>>3;_=U===1?y.readString():U===2?y.readFloat():U===3?y.readDouble():U===4?y.readVarint64():U===5?y.readVarint():U===6?y.readSVarint():U===7?y.readBoolean():null}return _}wS.prototype.feature=function(y){if(y<0||y>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[y];var _=this._pbf.readVarint()+this._pbf.pos;return new bS(this._pbf,_,this.extent,this._keys,this._values)};var XC=aq;function aq(y,_){this.layers=y.readFields(oq,{},_)}function oq(y,_,I){if(y===3){var U=new gg(I,I.readVarint()+I.pos);U.length&&(_[U.name]=U)}}var ZC=XC,F1=bS,YC=gg,mg={VectorTile:ZC,VectorTileFeature:F1,VectorTileLayer:YC},KC=mg.VectorTileFeature.types,Kw=500,z1=Math.pow(2,13);function dm(y,_,I,U,$,oe,he,De){y.emplaceBack(_,I,Math.floor(U*z1)*2+he,$*z1*2,oe*z1*2,Math.round(De))}var Vp=function(_){this.zoom=_.zoom,this.overscaling=_.overscaling,this.layers=_.layers,this.layerIds=this.layers.map(function(I){return I.id}),this.index=_.index,this.hasPattern=!1,this.layoutVertexArray=new Ii,this.indexArray=new pn,this.programConfigurations=new ci(_.layers,_.zoom),this.segments=new io,this.stateDependentLayerIds=this.layers.filter(function(I){return I.isStateDependent()}).map(function(I){return I.id})};Vp.prototype.populate=function(_,I,U){this.features=[],this.hasPattern=Yw("fill-extrusion",this.layers,I);for(var $=0,oe=_;$<oe.length;$+=1){var he=oe[$],De=he.feature,it=he.id,yt=he.index,Lt=he.sourceLayerIndex,sr=this.layers[0]._featureFilter.needGeometry,gr=Ja(De,sr);if(this.layers[0]._featureFilter.filter(new Un(this.zoom),gr,U)){var hr={id:it,sourceLayerIndex:Lt,index:yt,geometry:sr?gr.geometry:zn(De),properties:De.properties,type:De.type,patterns:{}};this.hasPattern?this.features.push(sb("fill-extrusion",this.layers,hr,this.zoom,I)):this.addFeature(hr,hr.geometry,yt,U,{}),I.featureIndex.insert(De,hr.geometry,yt,Lt,this.index,!0)}}},Vp.prototype.addFeatures=function(_,I,U){for(var $=0,oe=this.features;$<oe.length;$+=1){var he=oe[$],De=he.geometry;this.addFeature(he,De,he.index,I,U)}},Vp.prototype.update=function(_,I,U){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(_,I,this.stateDependentLayers,U)},Vp.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Vp.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Vp.prototype.upload=function(_){this.uploaded||(this.layoutVertexBuffer=_.createVertexBuffer(this.layoutVertexArray,UC),this.indexBuffer=_.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(_),this.uploaded=!0},Vp.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Vp.prototype.addFeature=function(_,I,U,$,oe){for(var he=0,De=Zw(I,Kw);he<De.length;he+=1){for(var it=De[he],yt=0,Lt=0,sr=it;Lt<sr.length;Lt+=1){var gr=sr[Lt];yt+=gr.length}for(var hr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),Rr=0,ni=it;Rr<ni.length;Rr+=1){var Hi=ni[Rr];if(Hi.length!==0&&!lq(Hi))for(var wi=0,bn=0;bn<Hi.length;bn++){var rn=Hi[bn];if(bn>=1){var xn=Hi[bn-1];if(!sq(rn,xn)){hr.vertexLength+4>io.MAX_VERTEX_ARRAY_LENGTH&&(hr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var In=rn.sub(xn)._perp()._unit(),Xn=xn.dist(rn);wi+Xn>32768&&(wi=0),dm(this.layoutVertexArray,rn.x,rn.y,In.x,In.y,0,0,wi),dm(this.layoutVertexArray,rn.x,rn.y,In.x,In.y,0,1,wi),wi+=Xn,dm(this.layoutVertexArray,xn.x,xn.y,In.x,In.y,0,0,wi),dm(this.layoutVertexArray,xn.x,xn.y,In.x,In.y,0,1,wi);var ga=hr.vertexLength;this.indexArray.emplaceBack(ga,ga+2,ga+1),this.indexArray.emplaceBack(ga+1,ga+2,ga+3),hr.vertexLength+=4,hr.primitiveLength+=2}}}}if(hr.vertexLength+yt>io.MAX_VERTEX_ARRAY_LENGTH&&(hr=this.segments.prepareSegment(yt,this.layoutVertexArray,this.indexArray)),KC[_.type]==="Polygon"){for(var ha=[],eo=[],za=hr.vertexLength,Za=0,Jo=it;Za<Jo.length;Za+=1){var to=Jo[Za];if(to.length!==0){to!==it[0]&&eo.push(ha.length/2);for(var ao=0;ao<to.length;ao++){var _s=to[ao];dm(this.layoutVertexArray,_s.x,_s.y,0,0,1,1,0),ha.push(_s.x),ha.push(_s.y)}}}for(var jo=Hw(ha,eo),El=0;El<jo.length;El+=3)this.indexArray.emplaceBack(za+jo[El],za+jo[El+2],za+jo[El+1]);hr.primitiveLength+=jo.length/3,hr.vertexLength+=yt}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,_,U,oe,$)},X("FillExtrusionBucket",Vp,{omit:["layers","features"]});function sq(y,_){return y.x===_.x&&(y.x<0||y.x>Ei)||y.y===_.y&&(y.y<0||y.y>Ei)}function lq(y){return y.every(function(_){return _.x<0})||y.every(function(_){return _.x>Ei})||y.every(function(_){return _.y<0})||y.every(function(_){return _.y>Ei})}var q1=new Or({"fill-extrusion-opacity":new Me(Rn["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new bt(Rn["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Me(Rn["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Me(Rn["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ot(Rn["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new bt(Rn["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new bt(Rn["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Me(Rn["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),ld={paint:q1},vm=function(y){function _(I){y.call(this,I,ld)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.createBucket=function(U){return new Vp(U)},_.prototype.queryRadius=function(){return Pv(this.paint.get("fill-extrusion-translate"))},_.prototype.is3D=function(){return!0},_.prototype.queryIntersectsFeature=function(U,$,oe,he,De,it,yt,Lt){var sr=Jv(U,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),it.angle,yt),gr=this.paint.get("fill-extrusion-height").evaluate($,oe),hr=this.paint.get("fill-extrusion-base").evaluate($,oe),Rr=uq(sr,Lt,it,0),ni=AS(he,hr,gr,Lt),Hi=ni[0],wi=ni[1];return JC(Hi,wi,Rr)},_}(vi);function _y(y,_){return y.x*_.x+y.y*_.y}function TS(y,_){if(y.length===1){for(var I=0,U=_[I++],$;!$||U.equals($);)if($=_[I++],!$)return 1/0;for(;I<_.length;I++){var oe=_[I],he=y[0],De=$.sub(U),it=oe.sub(U),yt=he.sub(U),Lt=_y(De,De),sr=_y(De,it),gr=_y(it,it),hr=_y(yt,De),Rr=_y(yt,it),ni=Lt*gr-sr*sr,Hi=(gr*hr-sr*Rr)/ni,wi=(Lt*Rr-sr*hr)/ni,bn=1-Hi-wi,rn=U.z*bn+$.z*Hi+oe.z*wi;if(isFinite(rn))return rn}return 1/0}else{for(var xn=1/0,In=0,Xn=_;In<Xn.length;In+=1){var ga=Xn[In];xn=Math.min(xn,ga.z)}return xn}}function JC(y,_,I){var U=1/0;ms(I,_)&&(U=TS(I,_[0]));for(var $=0;$<_.length;$++)for(var oe=_[$],he=y[$],De=0;De<oe.length-1;De++){var it=oe[De],yt=oe[De+1],Lt=he[De],sr=he[De+1],gr=[it,yt,sr,Lt,it];so(I,gr)&&(U=Math.min(U,TS(I,gr)))}return U===1/0?!1:U}function AS(y,_,I,U){for(var $=[],oe=[],he=U[8]*_,De=U[9]*_,it=U[10]*_,yt=U[11]*_,Lt=U[8]*I,sr=U[9]*I,gr=U[10]*I,hr=U[11]*I,Rr=0,ni=y;Rr<ni.length;Rr+=1){for(var Hi=ni[Rr],wi=[],bn=[],rn=0,xn=Hi;rn<xn.length;rn+=1){var In=xn[rn],Xn=In.x,ga=In.y,ha=U[0]*Xn+U[4]*ga+U[12],eo=U[1]*Xn+U[5]*ga+U[13],za=U[2]*Xn+U[6]*ga+U[14],Za=U[3]*Xn+U[7]*ga+U[15],Jo=ha+he,to=eo+De,ao=za+it,_s=Za+yt,jo=ha+Lt,El=eo+sr,Iu=za+gr,kl=Za+hr,Cl=new u(Jo/_s,to/_s);Cl.z=ao/_s,wi.push(Cl);var yl=new u(jo/kl,El/kl);yl.z=Iu/kl,bn.push(yl)}$.push(wi),oe.push(bn)}return[$,oe]}function uq(y,_,I,U){for(var $=[],oe=0,he=y;oe<he.length;oe+=1){var De=he[oe],it=[De.x,De.y,U,1];gy(it,it,_),$.push(new u(it[0]/it[3],it[1]/it[3]))}return $}var $C=ji([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),QC=$C.members,cq=ji([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),e6=cq.members,SS=mg.VectorTileFeature.types,Jw=63,t6=Math.cos(75/2*(Math.PI/180)),cb=15,MS=20,r6=15,$w=1/2,fb=Math.pow(2,r6-1)/$w,sh=function(_){var I=this;this.zoom=_.zoom,this.overscaling=_.overscaling,this.layers=_.layers,this.layerIds=this.layers.map(function(U){return U.id}),this.index=_.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(U){I.gradients[U.id]={}}),this.layoutVertexArray=new ui,this.layoutVertexArray2=new nn,this.indexArray=new pn,this.programConfigurations=new ci(_.layers,_.zoom),this.segments=new io,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(U){return U.isStateDependent()}).map(function(U){return U.id})};sh.prototype.populate=function(_,I,U){this.hasPattern=Yw("line",this.layers,I);for(var $=this.layers[0].layout.get("line-sort-key"),oe=[],he=0,De=_;he<De.length;he+=1){var it=De[he],yt=it.feature,Lt=it.id,sr=it.index,gr=it.sourceLayerIndex,hr=this.layers[0]._featureFilter.needGeometry,Rr=Ja(yt,hr);if(this.layers[0]._featureFilter.filter(new Un(this.zoom),Rr,U)){var ni=$?$.evaluate(Rr,{},U):void 0,Hi={id:Lt,properties:yt.properties,type:yt.type,sourceLayerIndex:gr,index:sr,geometry:hr?Rr.geometry:zn(yt),patterns:{},sortKey:ni};oe.push(Hi)}}$&&oe.sort(function(za,Za){return za.sortKey-Za.sortKey});for(var wi=0,bn=oe;wi<bn.length;wi+=1){var rn=bn[wi],xn=rn,In=xn.geometry,Xn=xn.index,ga=xn.sourceLayerIndex;if(this.hasPattern){var ha=sb("line",this.layers,rn,this.zoom,I);this.patternFeatures.push(ha)}else this.addFeature(rn,In,Xn,U,{});var eo=_[Xn].feature;I.featureIndex.insert(eo,In,Xn,ga,this.index)}},sh.prototype.update=function(_,I,U){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(_,I,this.stateDependentLayers,U)},sh.prototype.addFeatures=function(_,I,U){for(var $=0,oe=this.patternFeatures;$<oe.length;$+=1){var he=oe[$];this.addFeature(he,he.geometry,he.index,I,U)}},sh.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},sh.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},sh.prototype.upload=function(_){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=_.createVertexBuffer(this.layoutVertexArray2,e6)),this.layoutVertexBuffer=_.createVertexBuffer(this.layoutVertexArray,QC),this.indexBuffer=_.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(_),this.uploaded=!0},sh.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},sh.prototype.lineFeatureClips=function(_){if(_.properties&&_.properties.hasOwnProperty("mapbox_clip_start")&&_.properties.hasOwnProperty("mapbox_clip_end")){var I=+_.properties.mapbox_clip_start,U=+_.properties.mapbox_clip_end;return{start:I,end:U}}},sh.prototype.addFeature=function(_,I,U,$,oe){var he=this.layers[0].layout,De=he.get("line-join").evaluate(_,{}),it=he.get("line-cap"),yt=he.get("line-miter-limit"),Lt=he.get("line-round-limit");this.lineClips=this.lineFeatureClips(_);for(var sr=0,gr=I;sr<gr.length;sr+=1){var hr=gr[sr];this.addLine(hr,_,De,it,yt,Lt)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,_,U,oe,$)},sh.prototype.addLine=function(_,I,U,$,oe,he){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var De=0;De<_.length-1;De++)this.totalDistance+=_[De].dist(_[De+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var it=SS[I.type]==="Polygon",yt=_.length;yt>=2&&_[yt-1].equals(_[yt-2]);)yt--;for(var Lt=0;Lt<yt-1&&_[Lt].equals(_[Lt+1]);)Lt++;if(!(yt<(it?3:2))){U==="bevel"&&(oe=1.05);var sr=this.overscaling<=16?cb*Ei/(512*this.overscaling):0,gr=this.segments.prepareSegment(yt*10,this.layoutVertexArray,this.indexArray),hr,Rr=void 0,ni=void 0,Hi=void 0,wi=void 0;this.e1=this.e2=-1,it&&(hr=_[yt-2],wi=_[Lt].sub(hr)._unit()._perp());for(var bn=Lt;bn<yt;bn++)if(ni=bn===yt-1?it?_[Lt+1]:void 0:_[bn+1],!(ni&&_[bn].equals(ni))){wi&&(Hi=wi),hr&&(Rr=hr),hr=_[bn],wi=ni?ni.sub(hr)._unit()._perp():Hi,Hi=Hi||wi;var rn=Hi.add(wi);(rn.x!==0||rn.y!==0)&&rn._unit();var xn=Hi.x*wi.x+Hi.y*wi.y,In=rn.x*wi.x+rn.y*wi.y,Xn=In!==0?1/In:1/0,ga=2*Math.sqrt(2-2*In),ha=In<t6&&Rr&&ni,eo=Hi.x*wi.y-Hi.y*wi.x>0;if(ha&&bn>Lt){var za=hr.dist(Rr);if(za>2*sr){var Za=hr.sub(hr.sub(Rr)._mult(sr/za)._round());this.updateDistance(Rr,Za),this.addCurrentVertex(Za,Hi,0,0,gr),Rr=Za}}var Jo=Rr&&ni,to=Jo?U:it?"butt":$;if(Jo&&to==="round"&&(Xn<he?to="miter":Xn<=2&&(to="fakeround")),to==="miter"&&Xn>oe&&(to="bevel"),to==="bevel"&&(Xn>2&&(to="flipbevel"),Xn<oe&&(to="miter")),Rr&&this.updateDistance(Rr,hr),to==="miter")rn._mult(Xn),this.addCurrentVertex(hr,rn,0,0,gr);else if(to==="flipbevel"){if(Xn>100)rn=wi.mult(-1);else{var ao=Xn*Hi.add(wi).mag()/Hi.sub(wi).mag();rn._perp()._mult(ao*(eo?-1:1))}this.addCurrentVertex(hr,rn,0,0,gr),this.addCurrentVertex(hr,rn.mult(-1),0,0,gr)}else if(to==="bevel"||to==="fakeround"){var _s=-Math.sqrt(Xn*Xn-1),jo=eo?_s:0,El=eo?0:_s;if(Rr&&this.addCurrentVertex(hr,Hi,jo,El,gr),to==="fakeround")for(var Iu=Math.round(ga*180/Math.PI/MS),kl=1;kl<Iu;kl++){var Cl=kl/Iu;if(Cl!==.5){var yl=Cl-.5,Qu=1.0904+xn*(-3.2452+xn*(3.55645-xn*1.43519)),gc=.848013+xn*(-1.06021+xn*.215638);Cl=Cl+Cl*yl*(Cl-1)*(Qu*yl*yl+gc)}var Sf=wi.sub(Hi)._mult(Cl)._add(Hi)._unit()._mult(eo?-1:1);this.addHalfVertex(hr,Sf.x,Sf.y,!1,eo,0,gr)}ni&&this.addCurrentVertex(hr,wi,-jo,-El,gr)}else if(to==="butt")this.addCurrentVertex(hr,rn,0,0,gr);else if(to==="square"){var Ff=Rr?1:-1;this.addCurrentVertex(hr,rn,Ff,Ff,gr)}else to==="round"&&(Rr&&(this.addCurrentVertex(hr,Hi,0,0,gr),this.addCurrentVertex(hr,Hi,1,1,gr,!0)),ni&&(this.addCurrentVertex(hr,wi,-1,-1,gr,!0),this.addCurrentVertex(hr,wi,0,0,gr)));if(ha&&bn<yt-1){var $h=hr.dist(ni);if($h>2*sr){var ch=hr.add(ni.sub(hr)._mult(sr/$h)._round());this.updateDistance(hr,ch),this.addCurrentVertex(ch,wi,0,0,gr),hr=ch}}}}},sh.prototype.addCurrentVertex=function(_,I,U,$,oe,he){he===void 0&&(he=!1);var De=I.x+I.y*U,it=I.y-I.x*U,yt=-I.x+I.y*$,Lt=-I.y-I.x*$;this.addHalfVertex(_,De,it,he,!1,U,oe),this.addHalfVertex(_,yt,Lt,he,!0,-$,oe),this.distance>fb/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(_,I,U,$,oe,he))},sh.prototype.addHalfVertex=function(_,I,U,$,oe,he,De){var it=_.x,yt=_.y,Lt=this.lineClips?this.scaledDistance*(fb-1):this.scaledDistance,sr=Lt*$w;if(this.layoutVertexArray.emplaceBack((it<<1)+($?1:0),(yt<<1)+(oe?1:0),Math.round(Jw*I)+128,Math.round(Jw*U)+128,(he===0?0:he<0?-1:1)+1|(sr&63)<<2,sr>>6),this.lineClips){var gr=this.scaledDistance-this.lineClips.start,hr=this.lineClips.end-this.lineClips.start,Rr=gr/hr;this.layoutVertexArray2.emplaceBack(Rr,this.lineClipsArray.length)}var ni=De.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,ni),De.primitiveLength++),oe?this.e2=ni:this.e1=ni},sh.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},sh.prototype.updateDistance=function(_,I){this.distance+=_.dist(I),this.updateScaledDistance()},X("LineBucket",sh,{omit:["layers","patternFeatures"]});var ES=new Or({"line-cap":new Me(Rn.layout_line["line-cap"]),"line-join":new bt(Rn.layout_line["line-join"]),"line-miter-limit":new Me(Rn.layout_line["line-miter-limit"]),"line-round-limit":new Me(Rn.layout_line["line-round-limit"]),"line-sort-key":new bt(Rn.layout_line["line-sort-key"])}),kS=new Or({"line-opacity":new bt(Rn.paint_line["line-opacity"]),"line-color":new bt(Rn.paint_line["line-color"]),"line-translate":new Me(Rn.paint_line["line-translate"]),"line-translate-anchor":new Me(Rn.paint_line["line-translate-anchor"]),"line-width":new bt(Rn.paint_line["line-width"]),"line-gap-width":new bt(Rn.paint_line["line-gap-width"]),"line-offset":new bt(Rn.paint_line["line-offset"]),"line-blur":new bt(Rn.paint_line["line-blur"]),"line-dasharray":new Lr(Rn.paint_line["line-dasharray"]),"line-pattern":new Ot(Rn.paint_line["line-pattern"]),"line-gradient":new Vr(Rn.paint_line["line-gradient"])}),Qw={paint:kS,layout:ES},fq=function(y){function _(){y.apply(this,arguments)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.possiblyEvaluate=function(U,$){return $=new Un(Math.floor($.zoom),{now:$.now,fadeDuration:$.fadeDuration,zoomHistory:$.zoomHistory,transition:$.transition}),y.prototype.possiblyEvaluate.call(this,U,$)},_.prototype.evaluate=function(U,$,oe,he){return $=x({},$,{zoom:Math.floor($.zoom)}),y.prototype.evaluate.call(this,U,$,oe,he)},_}(bt),R=new fq(Qw.paint.properties["line-width"].specification);R.useIntegerZoom=!0;var A=function(y){function _(I){y.call(this,I,Qw),this.gradientVersion=0}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype._handleSpecialPaintPropertyUpdate=function(U){if(U==="line-gradient"){var $=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=$._styleExpression.expression instanceof _u,this.gradientVersion=(this.gradientVersion+1)%d}},_.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},_.prototype.recalculate=function(U,$){y.prototype.recalculate.call(this,U,$),this.paint._values["line-floorwidth"]=R.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,U)},_.prototype.createBucket=function(U){return new sh(U)},_.prototype.queryRadius=function(U){var $=U,oe=F(Ad("line-width",this,$),Ad("line-gap-width",this,$)),he=Ad("line-offset",this,$);return oe/2+Math.abs(he)+Pv(this.paint.get("line-translate"))},_.prototype.queryIntersectsFeature=function(U,$,oe,he,De,it,yt){var Lt=Jv(U,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),it.angle,yt),sr=yt/2*F(this.paint.get("line-width").evaluate($,oe),this.paint.get("line-gap-width").evaluate($,oe)),gr=this.paint.get("line-offset").evaluate($,oe);return gr&&(he=W(he,gr*yt)),ou(Lt,he,sr)},_.prototype.isTileClipped=function(){return!0},_}(vi);function F(y,_){return _>0?_+2*y:y}function W(y,_){for(var I=[],U=new u(0,0),$=0;$<y.length;$++){for(var oe=y[$],he=[],De=0;De<oe.length;De++){var it=oe[De-1],yt=oe[De],Lt=oe[De+1],sr=De===0?U:yt.sub(it)._unit()._perp(),gr=De===oe.length-1?U:Lt.sub(yt)._unit()._perp(),hr=sr._add(gr)._unit(),Rr=hr.x*gr.x+hr.y*gr.y;hr._mult(1/Rr),he.push(hr._mult(_)._add(yt))}I.push(he)}return I}var te=ji([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),fe=ji([{name:"a_projected_pos",components:3,type:"Float32"}],4),pe=ji([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Re=ji([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Ke=ji([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),ft=ji([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Rt=ji([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),er=ji([{name:"triangle",components:3,type:"Uint16"}]),ur=ji([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),vr=ji([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),kr=ji([{type:"Float32",name:"offsetX"}]),Dr=ji([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function li(y,_,I){var U=_.layout.get("text-transform").evaluate(I,{});return U==="uppercase"?y=y.toLocaleUpperCase():U==="lowercase"&&(y=y.toLocaleLowerCase()),Ms.applyArabicShaping&&(y=Ms.applyArabicShaping(y)),y}function pi(y,_,I){return y.sections.forEach(function(U){U.text=li(U.text,_,I)}),y}function vn(y){var _={},I={},U=[],$=0;function oe(wi){U.push(y[wi]),$++}function he(wi,bn,rn){var xn=I[wi];return delete I[wi],I[bn]=xn,U[xn].geometry[0].pop(),U[xn].geometry[0]=U[xn].geometry[0].concat(rn[0]),xn}function De(wi,bn,rn){var xn=_[bn];return delete _[bn],_[wi]=xn,U[xn].geometry[0].shift(),U[xn].geometry[0]=rn[0].concat(U[xn].geometry[0]),xn}function it(wi,bn,rn){var xn=rn?bn[0][bn[0].length-1]:bn[0][0];return wi+":"+xn.x+":"+xn.y}for(var yt=0;yt<y.length;yt++){var Lt=y[yt],sr=Lt.geometry,gr=Lt.text?Lt.text.toString():null;if(!gr){oe(yt);continue}var hr=it(gr,sr),Rr=it(gr,sr,!0);if(hr in I&&Rr in _&&I[hr]!==_[Rr]){var ni=De(hr,Rr,sr),Hi=he(hr,Rr,U[ni].geometry);delete _[hr],delete I[Rr],I[it(gr,U[Hi].geometry,!0)]=Hi,U[ni].geometry=null}else hr in I?he(hr,Rr,sr):Rr in _?De(hr,Rr,sr):(oe(yt),_[hr]=$-1,I[Rr]=$-1)}return U.filter(function(wi){return wi.geometry})}var zi={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};function ln(y){for(var _="",I=0;I<y.length;I++){var U=y.charCodeAt(I+1)||null,$=y.charCodeAt(I-1)||null,oe=(!U||!xi(U)||zi[y[I+1]])&&(!$||!xi($)||zi[y[I-1]]);oe&&zi[y[I]]?_+=zi[y[I]]:_+=y[I]}return _}var Tn=24,pa=function(y,_,I,U,$){var oe,he,De=$*8-U-1,it=(1<<De)-1,yt=it>>1,Lt=-7,sr=I?$-1:0,gr=I?-1:1,hr=y[_+sr];for(sr+=gr,oe=hr&(1<<-Lt)-1,hr>>=-Lt,Lt+=De;Lt>0;oe=oe*256+y[_+sr],sr+=gr,Lt-=8);for(he=oe&(1<<-Lt)-1,oe>>=-Lt,Lt+=U;Lt>0;he=he*256+y[_+sr],sr+=gr,Lt-=8);if(oe===0)oe=1-yt;else{if(oe===it)return he?NaN:(hr?-1:1)*(1/0);he=he+Math.pow(2,U),oe=oe-yt}return(hr?-1:1)*he*Math.pow(2,oe-U)},ro=function(y,_,I,U,$,oe){var he,De,it,yt=oe*8-$-1,Lt=(1<<yt)-1,sr=Lt>>1,gr=$===23?Math.pow(2,-24)-Math.pow(2,-77):0,hr=U?0:oe-1,Rr=U?1:-1,ni=_<0||_===0&&1/_<0?1:0;for(_=Math.abs(_),isNaN(_)||_===1/0?(De=isNaN(_)?1:0,he=Lt):(he=Math.floor(Math.log(_)/Math.LN2),_*(it=Math.pow(2,-he))<1&&(he--,it*=2),he+sr>=1?_+=gr/it:_+=gr*Math.pow(2,1-sr),_*it>=2&&(he++,it/=2),he+sr>=Lt?(De=0,he=Lt):he+sr>=1?(De=(_*it-1)*Math.pow(2,$),he=he+sr):(De=_*Math.pow(2,sr-1)*Math.pow(2,$),he=0));$>=8;y[I+hr]=De&255,hr+=Rr,De/=256,$-=8);for(he=he<<$|De,yt+=$;yt>0;y[I+hr]=he&255,hr+=Rr,he/=256,yt-=8);y[I+hr-Rr]|=ni*128},Vo={read:pa,write:ro},Xa=la;function la(y){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(y)?y:new Uint8Array(y||0),this.pos=0,this.type=0,this.length=this.buf.length}la.Varint=0,la.Fixed64=1,la.Bytes=2,la.Fixed32=5;var Mo=65536*65536,fo=1/Mo,lo=12,Wn=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");la.prototype={destroy:function(){this.buf=null},readFields:function(y,_,I){for(I=I||this.length;this.pos<I;){var U=this.readVarint(),$=U>>3,oe=this.pos;this.type=U&7,y($,_,this),this.pos===oe&&this.skip(U)}return _},readMessage:function(y,_){return this.readFields(y,_,this.readVarint()+this.pos)},readFixed32:function(){var y=Yh(this.buf,this.pos);return this.pos+=4,y},readSFixed32:function(){var y=Fv(this.buf,this.pos);return this.pos+=4,y},readFixed64:function(){var y=Yh(this.buf,this.pos)+Yh(this.buf,this.pos+4)*Mo;return this.pos+=8,y},readSFixed64:function(){var y=Yh(this.buf,this.pos)+Fv(this.buf,this.pos+4)*Mo;return this.pos+=8,y},readFloat:function(){var y=Vo.read(this.buf,this.pos,!0,23,4);return this.pos+=4,y},readDouble:function(){var y=Vo.read(this.buf,this.pos,!0,52,8);return this.pos+=8,y},readVarint:function(y){var _=this.buf,I,U;return U=_[this.pos++],I=U&127,U<128||(U=_[this.pos++],I|=(U&127)<<7,U<128)||(U=_[this.pos++],I|=(U&127)<<14,U<128)||(U=_[this.pos++],I|=(U&127)<<21,U<128)?I:(U=_[this.pos],I|=(U&15)<<28,Ro(I,y,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var y=this.readVarint();return y%2===1?(y+1)/-2:y/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var y=this.readVarint()+this.pos,_=this.pos;return this.pos=y,y-_>=lo&&Wn?ru(this.buf,_,y):uv(this.buf,_,y)},readBytes:function(){var y=this.readVarint()+this.pos,_=this.buf.subarray(this.pos,y);return this.pos=y,_},readPackedVarint:function(y,_){if(this.type!==la.Bytes)return y.push(this.readVarint(_));var I=uo(this);for(y=y||[];this.pos<I;)y.push(this.readVarint(_));return y},readPackedSVarint:function(y){if(this.type!==la.Bytes)return y.push(this.readSVarint());var _=uo(this);for(y=y||[];this.pos<_;)y.push(this.readSVarint());return y},readPackedBoolean:function(y){if(this.type!==la.Bytes)return y.push(this.readBoolean());var _=uo(this);for(y=y||[];this.pos<_;)y.push(this.readBoolean());return y},readPackedFloat:function(y){if(this.type!==la.Bytes)return y.push(this.readFloat());var _=uo(this);for(y=y||[];this.pos<_;)y.push(this.readFloat());return y},readPackedDouble:function(y){if(this.type!==la.Bytes)return y.push(this.readDouble());var _=uo(this);for(y=y||[];this.pos<_;)y.push(this.readDouble());return y},readPackedFixed32:function(y){if(this.type!==la.Bytes)return y.push(this.readFixed32());var _=uo(this);for(y=y||[];this.pos<_;)y.push(this.readFixed32());return y},readPackedSFixed32:function(y){if(this.type!==la.Bytes)return y.push(this.readSFixed32());var _=uo(this);for(y=y||[];this.pos<_;)y.push(this.readSFixed32());return y},readPackedFixed64:function(y){if(this.type!==la.Bytes)return y.push(this.readFixed64());var _=uo(this);for(y=y||[];this.pos<_;)y.push(this.readFixed64());return y},readPackedSFixed64:function(y){if(this.type!==la.Bytes)return y.push(this.readSFixed64());var _=uo(this);for(y=y||[];this.pos<_;)y.push(this.readSFixed64());return y},skip:function(y){var _=y&7;if(_===la.Varint)for(;this.buf[this.pos++]>127;);else if(_===la.Bytes)this.pos=this.readVarint()+this.pos;else if(_===la.Fixed32)this.pos+=4;else if(_===la.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+_)},writeTag:function(y,_){this.writeVarint(y<<3|_)},realloc:function(y){for(var _=this.length||16;_<this.pos+y;)_*=2;if(_!==this.length){var I=new Uint8Array(_);I.set(this.buf),this.buf=I,this.length=_}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(y){this.realloc(4),Df(this.buf,y,this.pos),this.pos+=4},writeSFixed32:function(y){this.realloc(4),Df(this.buf,y,this.pos),this.pos+=4},writeFixed64:function(y){this.realloc(8),Df(this.buf,y&-1,this.pos),Df(this.buf,Math.floor(y*fo),this.pos+4),this.pos+=8},writeSFixed64:function(y){this.realloc(8),Df(this.buf,y&-1,this.pos),Df(this.buf,Math.floor(y*fo),this.pos+4),this.pos+=8},writeVarint:function(y){if(y=+y||0,y>268435455||y<0){Ju(y,this);return}this.realloc(4),this.buf[this.pos++]=y&127|(y>127?128:0),!(y<=127)&&(this.buf[this.pos++]=(y>>>=7)&127|(y>127?128:0),!(y<=127)&&(this.buf[this.pos++]=(y>>>=7)&127|(y>127?128:0),!(y<=127)&&(this.buf[this.pos++]=y>>>7&127)))},writeSVarint:function(y){this.writeVarint(y<0?-y*2-1:y*2)},writeBoolean:function(y){this.writeVarint(!!y)},writeString:function(y){y=String(y),this.realloc(y.length*4),this.pos++;var _=this.pos;this.pos=pc(this.buf,y,this.pos);var I=this.pos-_;I>=128&&Qv(_,I,this),this.pos=_-1,this.writeVarint(I),this.pos+=I},writeFloat:function(y){this.realloc(4),Vo.write(this.buf,y,this.pos,!0,23,4),this.pos+=4},writeDouble:function(y){this.realloc(8),Vo.write(this.buf,y,this.pos,!0,52,8),this.pos+=8},writeBytes:function(y){var _=y.length;this.writeVarint(_),this.realloc(_);for(var I=0;I<_;I++)this.buf[this.pos++]=y[I]},writeRawMessage:function(y,_){this.pos++;var I=this.pos;y(_,this);var U=this.pos-I;U>=128&&Qv(I,U,this),this.pos=I-1,this.writeVarint(U),this.pos+=U},writeMessage:function(y,_,I){this.writeTag(y,la.Bytes),this.writeRawMessage(_,I)},writePackedVarint:function(y,_){_.length&&this.writeMessage(y,ud,_)},writePackedSVarint:function(y,_){_.length&&this.writeMessage(y,Ch,_)},writePackedBoolean:function(y,_){_.length&&this.writeMessage(y,jd,_)},writePackedFloat:function(y,_){_.length&&this.writeMessage(y,Gd,_)},writePackedDouble:function(y,_){_.length&&this.writeMessage(y,Hd,_)},writePackedFixed32:function(y,_){_.length&&this.writeMessage(y,Af,_)},writePackedSFixed32:function(y,_){_.length&&this.writeMessage(y,Lh,_)},writePackedFixed64:function(y,_){_.length&&this.writeMessage(y,Ed,_)},writePackedSFixed64:function(y,_){_.length&&this.writeMessage(y,cd,_)},writeBytesField:function(y,_){this.writeTag(y,la.Bytes),this.writeBytes(_)},writeFixed32Field:function(y,_){this.writeTag(y,la.Fixed32),this.writeFixed32(_)},writeSFixed32Field:function(y,_){this.writeTag(y,la.Fixed32),this.writeSFixed32(_)},writeFixed64Field:function(y,_){this.writeTag(y,la.Fixed64),this.writeFixed64(_)},writeSFixed64Field:function(y,_){this.writeTag(y,la.Fixed64),this.writeSFixed64(_)},writeVarintField:function(y,_){this.writeTag(y,la.Varint),this.writeVarint(_)},writeSVarintField:function(y,_){this.writeTag(y,la.Varint),this.writeSVarint(_)},writeStringField:function(y,_){this.writeTag(y,la.Bytes),this.writeString(_)},writeFloatField:function(y,_){this.writeTag(y,la.Fixed32),this.writeFloat(_)},writeDoubleField:function(y,_){this.writeTag(y,la.Fixed64),this.writeDouble(_)},writeBooleanField:function(y,_){this.writeVarintField(y,!!_)}};function Ro(y,_,I){var U=I.buf,$,oe;if(oe=U[I.pos++],$=(oe&112)>>4,oe<128||(oe=U[I.pos++],$|=(oe&127)<<3,oe<128)||(oe=U[I.pos++],$|=(oe&127)<<10,oe<128)||(oe=U[I.pos++],$|=(oe&127)<<17,oe<128)||(oe=U[I.pos++],$|=(oe&127)<<24,oe<128)||(oe=U[I.pos++],$|=(oe&1)<<31,oe<128))return $o(y,$,_);throw new Error("Expected varint not more than 10 bytes")}function uo(y){return y.type===la.Bytes?y.readVarint()+y.pos:y.pos+1}function $o(y,_,I){return I?_*4294967296+(y>>>0):(_>>>0)*4294967296+(y>>>0)}function Ju(y,_){var I,U;if(y>=0?(I=y%4294967296|0,U=y/4294967296|0):(I=~(-y%4294967296),U=~(-y/4294967296),I^4294967295?I=I+1|0:(I=0,U=U+1|0)),y>=18446744073709552e3||y<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");_.realloc(10),Ou(I,U,_),kh(U,_)}function Ou(y,_,I){I.buf[I.pos++]=y&127|128,y>>>=7,I.buf[I.pos++]=y&127|128,y>>>=7,I.buf[I.pos++]=y&127|128,y>>>=7,I.buf[I.pos++]=y&127|128,y>>>=7,I.buf[I.pos]=y&127}function kh(y,_){var I=(y&7)<<4;_.buf[_.pos++]|=I|((y>>>=3)?128:0),y&&(_.buf[_.pos++]=y&127|((y>>>=7)?128:0),y&&(_.buf[_.pos++]=y&127|((y>>>=7)?128:0),y&&(_.buf[_.pos++]=y&127|((y>>>=7)?128:0),y&&(_.buf[_.pos++]=y&127|((y>>>=7)?128:0),y&&(_.buf[_.pos++]=y&127)))))}function Qv(y,_,I){var U=_<=16383?1:_<=2097151?2:_<=268435455?3:Math.floor(Math.log(_)/(Math.LN2*7));I.realloc(U);for(var $=I.pos-1;$>=y;$--)I.buf[$+U]=I.buf[$]}function ud(y,_){for(var I=0;I<y.length;I++)_.writeVarint(y[I])}function Ch(y,_){for(var I=0;I<y.length;I++)_.writeSVarint(y[I])}function Gd(y,_){for(var I=0;I<y.length;I++)_.writeFloat(y[I])}function Hd(y,_){for(var I=0;I<y.length;I++)_.writeDouble(y[I])}function jd(y,_){for(var I=0;I<y.length;I++)_.writeBoolean(y[I])}function Af(y,_){for(var I=0;I<y.length;I++)_.writeFixed32(y[I])}function Lh(y,_){for(var I=0;I<y.length;I++)_.writeSFixed32(y[I])}function Ed(y,_){for(var I=0;I<y.length;I++)_.writeFixed64(y[I])}function cd(y,_){for(var I=0;I<y.length;I++)_.writeSFixed64(y[I])}function Yh(y,_){return(y[_]|y[_+1]<<8|y[_+2]<<16)+y[_+3]*16777216}function Df(y,_,I){y[I]=_,y[I+1]=_>>>8,y[I+2]=_>>>16,y[I+3]=_>>>24}function Fv(y,_){return(y[_]|y[_+1]<<8|y[_+2]<<16)+(y[_+3]<<24)}function uv(y,_,I){for(var U="",$=_;$<I;){var oe=y[$],he=null,De=oe>239?4:oe>223?3:oe>191?2:1;if($+De>I)break;var it,yt,Lt;De===1?oe<128&&(he=oe):De===2?(it=y[$+1],(it&192)===128&&(he=(oe&31)<<6|it&63,he<=127&&(he=null))):De===3?(it=y[$+1],yt=y[$+2],(it&192)===128&&(yt&192)===128&&(he=(oe&15)<<12|(it&63)<<6|yt&63,(he<=2047||he>=55296&&he<=57343)&&(he=null))):De===4&&(it=y[$+1],yt=y[$+2],Lt=y[$+3],(it&192)===128&&(yt&192)===128&&(Lt&192)===128&&(he=(oe&15)<<18|(it&63)<<12|(yt&63)<<6|Lt&63,(he<=65535||he>=1114112)&&(he=null))),he===null?(he=65533,De=1):he>65535&&(he-=65536,U+=String.fromCharCode(he>>>10&1023|55296),he=56320|he&1023),U+=String.fromCharCode(he),$+=De}return U}function ru(y,_,I){return Wn.decode(y.subarray(_,I))}function pc(y,_,I){for(var U=0,$,oe;U<_.length;U++){if($=_.charCodeAt(U),$>55295&&$<57344)if(oe)if($<56320){y[I++]=239,y[I++]=191,y[I++]=189,oe=$;continue}else $=oe-55296<<10|$-56320|65536,oe=null;else{$>56319||U+1===_.length?(y[I++]=239,y[I++]=191,y[I++]=189):oe=$;continue}else oe&&(y[I++]=239,y[I++]=191,y[I++]=189,oe=null);$<128?y[I++]=$:($<2048?y[I++]=$>>6|192:($<65536?y[I++]=$>>12|224:(y[I++]=$>>18|240,y[I++]=$>>12&63|128),y[I++]=$>>6&63|128),y[I++]=$&63|128)}return I}var $u=3;function zv(y,_,I){y===1&&I.readMessage(hf,_)}function hf(y,_,I){if(y===3){var U=I.readMessage(O1,{}),$=U.id,oe=U.bitmap,he=U.width,De=U.height,it=U.left,yt=U.top,Lt=U.advance;_.push({id:$,bitmap:new Dv({width:he+2*$u,height:De+2*$u},oe),metrics:{width:he,height:De,left:it,top:yt,advance:Lt}})}}function O1(y,_,I){y===1?_.id=I.readVarint():y===2?_.bitmap=I.readBytes():y===3?_.width=I.readVarint():y===4?_.height=I.readVarint():y===5?_.left=I.readSVarint():y===6?_.top=I.readSVarint():y===7&&(_.advance=I.readVarint())}function p0(y){return new Xa(y).readFields(zv,[])}var Gp=$u;function ep(y){for(var _=0,I=0,U=0,$=y;U<$.length;U+=1){var oe=$[U];_+=oe.w*oe.h,I=Math.max(I,oe.w)}y.sort(function(Hi,wi){return wi.h-Hi.h});for(var he=Math.max(Math.ceil(Math.sqrt(_/.95)),I),De=[{x:0,y:0,w:he,h:1/0}],it=0,yt=0,Lt=0,sr=y;Lt<sr.length;Lt+=1)for(var gr=sr[Lt],hr=De.length-1;hr>=0;hr--){var Rr=De[hr];if(!(gr.w>Rr.w||gr.h>Rr.h)){if(gr.x=Rr.x,gr.y=Rr.y,yt=Math.max(yt,gr.y+gr.h),it=Math.max(it,gr.x+gr.w),gr.w===Rr.w&&gr.h===Rr.h){var ni=De.pop();hr<De.length&&(De[hr]=ni)}else gr.h===Rr.h?(Rr.x+=gr.w,Rr.w-=gr.w):gr.w===Rr.w?(Rr.y+=gr.h,Rr.h-=gr.h):(De.push({x:Rr.x+gr.w,y:Rr.y,w:Rr.w-gr.w,h:gr.h}),Rr.y+=gr.h,Rr.h-=gr.h);break}}return{w:it,h:yt,fill:_/(it*yt)||0}}var Gc=1,Yf=function(_,I){var U=I.pixelRatio,$=I.version,oe=I.stretchX,he=I.stretchY,De=I.content;this.paddedRect=_,this.pixelRatio=U,this.stretchX=oe,this.stretchY=he,this.content=De,this.version=$},tp={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};tp.tl.get=function(){return[this.paddedRect.x+Gc,this.paddedRect.y+Gc]},tp.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-Gc,this.paddedRect.y+this.paddedRect.h-Gc]},tp.tlbr.get=function(){return this.tl.concat(this.br)},tp.displaySize.get=function(){return[(this.paddedRect.w-Gc*2)/this.pixelRatio,(this.paddedRect.h-Gc*2)/this.pixelRatio]},Object.defineProperties(Yf.prototype,tp);var yg=function(_,I){var U={},$={};this.haveRenderCallbacks=[];var oe=[];this.addImages(_,U,oe),this.addImages(I,$,oe);var he=ep(oe),De=he.w,it=he.h,yt=new Eh({width:De||1,height:it||1});for(var Lt in _){var sr=_[Lt],gr=U[Lt].paddedRect;Eh.copy(sr.data,yt,{x:0,y:0},{x:gr.x+Gc,y:gr.y+Gc},sr.data)}for(var hr in I){var Rr=I[hr],ni=$[hr].paddedRect,Hi=ni.x+Gc,wi=ni.y+Gc,bn=Rr.data.width,rn=Rr.data.height;Eh.copy(Rr.data,yt,{x:0,y:0},{x:Hi,y:wi},Rr.data),Eh.copy(Rr.data,yt,{x:0,y:rn-1},{x:Hi,y:wi-1},{width:bn,height:1}),Eh.copy(Rr.data,yt,{x:0,y:0},{x:Hi,y:wi+rn},{width:bn,height:1}),Eh.copy(Rr.data,yt,{x:bn-1,y:0},{x:Hi-1,y:wi},{width:1,height:rn}),Eh.copy(Rr.data,yt,{x:0,y:0},{x:Hi+bn,y:wi},{width:1,height:rn})}this.image=yt,this.iconPositions=U,this.patternPositions=$};yg.prototype.addImages=function(_,I,U){for(var $ in _){var oe=_[$],he={x:0,y:0,w:oe.data.width+2*Gc,h:oe.data.height+2*Gc};U.push(he),I[$]=new Yf(he,oe),oe.hasRenderCallback&&this.haveRenderCallbacks.push($)}},yg.prototype.patchUpdatedImages=function(_,I){_.dispatchRenderCallbacks(this.haveRenderCallbacks);for(var U in _.updatedImages)this.patchUpdatedImage(this.iconPositions[U],_.getImage(U),I),this.patchUpdatedImage(this.patternPositions[U],_.getImage(U),I)},yg.prototype.patchUpdatedImage=function(_,I,U){if(!(!_||!I)&&_.version!==I.version){_.version=I.version;var $=_.tl,oe=$[0],he=$[1];U.update(I.data,void 0,{x:oe,y:he})}},X("ImagePosition",Yf),X("ImageAtlas",yg);var cv={horizontal:1,vertical:2,horizontalOnly:3},B1=-17;function CS(y){for(var _=0,I=y;_<I.length;_+=1){var U=I[_];if(U.positionedGlyphs.length!==0)return!1}return!0}var e3=57344,g0=63743,xy=function(){this.scale=1,this.fontStack="",this.imageName=null};xy.forText=function(_,I){var U=new xy;return U.scale=_||1,U.fontStack=I,U},xy.forImage=function(_){var I=new xy;return I.imageName=_,I};var Kh=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};Kh.fromFeature=function(_,I){for(var U=new Kh,$=0;$<_.sections.length;$++){var oe=_.sections[$];oe.image?U.addImageSection(oe):U.addTextSection(oe,I)}return U},Kh.prototype.length=function(){return this.text.length},Kh.prototype.getSection=function(_){return this.sections[this.sectionIndex[_]]},Kh.prototype.getSectionIndex=function(_){return this.sectionIndex[_]},Kh.prototype.getCharCode=function(_){return this.text.charCodeAt(_)},Kh.prototype.verticalizePunctuation=function(){this.text=ln(this.text)},Kh.prototype.trim=function(){for(var _=0,I=0;I<this.text.length&&m0[this.text.charCodeAt(I)];I++)_++;for(var U=this.text.length,$=this.text.length-1;$>=0&&$>=_&&m0[this.text.charCodeAt($)];$--)U--;this.text=this.text.substring(_,U),this.sectionIndex=this.sectionIndex.slice(_,U)},Kh.prototype.substring=function(_,I){var U=new Kh;return U.text=this.text.substring(_,I),U.sectionIndex=this.sectionIndex.slice(_,I),U.sections=this.sections,U},Kh.prototype.toString=function(){return this.text},Kh.prototype.getMaxScale=function(){var _=this;return this.sectionIndex.reduce(function(I,U){return Math.max(I,_.sections[U].scale)},0)},Kh.prototype.addTextSection=function(_,I){this.text+=_.text,this.sections.push(xy.forText(_.scale,_.fontStack||I));for(var U=this.sections.length-1,$=0;$<_.text.length;++$)this.sectionIndex.push(U)},Kh.prototype.addImageSection=function(_){var I=_.image?_.image.name:"";if(I.length===0){ie("Can't add FormattedSection with an empty image.");return}var U=this.getNextImageSectionCharCode();if(!U){ie("Reached maximum number of images "+(g0-e3+2));return}this.text+=String.fromCharCode(U),this.sections.push(xy.forImage(I)),this.sectionIndex.push(this.sections.length-1)},Kh.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=g0?null:++this.imageSectionID:(this.imageSectionID=e3,this.imageSectionID)};function hq(y,_){for(var I=[],U=y.text,$=0,oe=0,he=_;oe<he.length;oe+=1){var De=he[oe];I.push(y.substring($,De)),$=De}return $<U.length&&I.push(y.substring($,U.length)),I}function t3(y,_,I,U,$,oe,he,De,it,yt,Lt,sr,gr,hr,Rr,ni){var Hi=Kh.fromFeature(y,$);sr===cv.vertical&&Hi.verticalizePunctuation();var wi,bn=Ms.processBidirectionalText,rn=Ms.processStyledBidirectionalText;if(bn&&Hi.sections.length===1){wi=[];for(var xn=bn(Hi.toString(),r3(Hi,yt,oe,_,U,hr,Rr)),In=0,Xn=xn;In<Xn.length;In+=1){var ga=Xn[In],ha=new Kh;ha.text=ga,ha.sections=Hi.sections;for(var eo=0;eo<ga.length;eo++)ha.sectionIndex.push(0);wi.push(ha)}}else if(rn){wi=[];for(var za=rn(Hi.text,Hi.sectionIndex,r3(Hi,yt,oe,_,U,hr,Rr)),Za=0,Jo=za;Za<Jo.length;Za+=1){var to=Jo[Za],ao=new Kh;ao.text=to[0],ao.sectionIndex=to[1],ao.sections=Hi.sections,wi.push(ao)}}else wi=hq(Hi,r3(Hi,yt,oe,_,U,hr,Rr));var _s=[],jo={positionedLines:_s,text:Hi.toString(),top:Lt[1],bottom:Lt[1],left:Lt[0],right:Lt[0],writingMode:sr,iconsInText:!1,verticalizable:!1};return pq(jo,_,I,U,wi,he,De,it,sr,yt,gr,ni),CS(_s)?!1:jo}var m0={};m0[9]=!0,m0[10]=!0,m0[11]=!0,m0[12]=!0,m0[13]=!0,m0[32]=!0;var fv={};fv[10]=!0,fv[32]=!0,fv[38]=!0,fv[40]=!0,fv[41]=!0,fv[43]=!0,fv[45]=!0,fv[47]=!0,fv[173]=!0,fv[183]=!0,fv[8203]=!0,fv[8208]=!0,fv[8211]=!0,fv[8231]=!0;function i6(y,_,I,U,$,oe){if(_.imageName){var it=U[_.imageName];return it?it.displaySize[0]*_.scale*Tn/oe+$:0}else{var he=I[_.fontStack],De=he&&he[y];return De?De.metrics.advance*_.scale+$:0}}function dq(y,_,I,U,$,oe){for(var he=0,De=0;De<y.length();De++){var it=y.getSection(De);he+=i6(y.getCharCode(De),it,U,$,_,oe)}var yt=Math.max(1,Math.ceil(he/I));return he/yt}function n6(y,_,I,U){var $=Math.pow(y-_,2);return U?y<_?$/2:$*2:$+Math.abs(I)*I}function vq(y,_,I){var U=0;return y===10&&(U-=1e4),I&&(U+=150),(y===40||y===65288)&&(U+=50),(_===41||_===65289)&&(U+=50),U}function _p(y,_,I,U,$,oe){for(var he=null,De=n6(_,I,$,oe),it=0,yt=U;it<yt.length;it+=1){var Lt=yt[it],sr=_-Lt.x,gr=n6(sr,I,$,oe)+Lt.badness;gr<=De&&(he=Lt,De=gr)}return{index:y,x:_,priorBreak:he,badness:De}}function hb(y){return y?hb(y.priorBreak).concat(y.index):[]}function r3(y,_,I,U,$,oe,he){if(oe!=="point")return[];if(!y)return[];for(var De=[],it=dq(y,_,I,U,$,he),yt=y.text.indexOf("\u200B")>=0,Lt=0,sr=0;sr<y.length();sr++){var gr=y.getSection(sr),hr=y.getCharCode(sr);if(m0[hr]||(Lt+=i6(hr,gr,U,$,_,he)),sr<y.length()-1){var Rr=Ur(hr);(fv[hr]||Rr||gr.imageName)&&De.push(_p(sr+1,Lt,it,De,vq(hr,y.getCharCode(sr+1),Rr&&yt),!1))}}return hb(_p(y.length(),Lt,it,De,0,!0))}function LS(y){var _=.5,I=.5;switch(y){case"right":case"top-right":case"bottom-right":_=1;break;case"left":case"top-left":case"bottom-left":_=0;break}switch(y){case"bottom":case"bottom-right":case"bottom-left":I=1;break;case"top":case"top-right":case"top-left":I=0;break}return{horizontalAlign:_,verticalAlign:I}}function pq(y,_,I,U,$,oe,he,De,it,yt,Lt,sr){for(var gr=0,hr=B1,Rr=0,ni=0,Hi=De==="right"?1:De==="left"?0:.5,wi=0,bn=0,rn=$;bn<rn.length;bn+=1){var xn=rn[bn];xn.trim();var In=xn.getMaxScale(),Xn=(In-1)*Tn,ga={positionedGlyphs:[],lineOffset:0};y.positionedLines[wi]=ga;var ha=ga.positionedGlyphs,eo=0;if(!xn.length()){hr+=oe,++wi;continue}for(var za=0;za<xn.length();za++){var Za=xn.getSection(za),Jo=xn.getSectionIndex(za),to=xn.getCharCode(za),ao=0,_s=null,jo=null,El=null,Iu=Tn,kl=!(it===cv.horizontal||!Lt&&!zr(to)||Lt&&(m0[to]||Wr(to)));if(Za.imageName){var Sf=U[Za.imageName];if(!Sf)continue;El=Za.imageName,y.iconsInText=y.iconsInText||!0,jo=Sf.paddedRect;var Ff=Sf.displaySize;Za.scale=Za.scale*Tn/sr,_s={width:Ff[0],height:Ff[1],left:Gc,top:-Gp,advance:kl?Ff[1]:Ff[0]};var $h=Tn-Ff[1]*Za.scale;ao=Xn+$h,Iu=_s.advance;var ch=kl?Ff[0]*Za.scale-Tn*In:Ff[1]*Za.scale-Tn*In;ch>0&&ch>eo&&(eo=ch)}else{var Cl=I[Za.fontStack],yl=Cl&&Cl[to];if(yl&&yl.rect)jo=yl.rect,_s=yl.metrics;else{var Qu=_[Za.fontStack],gc=Qu&&Qu[to];if(!gc)continue;_s=gc.metrics}ao=(In-Za.scale)*Tn}kl?(y.verticalizable=!0,ha.push({glyph:to,imageName:El,x:gr,y:hr+ao,vertical:kl,scale:Za.scale,fontStack:Za.fontStack,sectionIndex:Jo,metrics:_s,rect:jo}),gr+=Iu*Za.scale+yt):(ha.push({glyph:to,imageName:El,x:gr,y:hr+ao,vertical:kl,scale:Za.scale,fontStack:Za.fontStack,sectionIndex:Jo,metrics:_s,rect:jo}),gr+=_s.advance*Za.scale+yt)}if(ha.length!==0){var Xd=gr-yt;Rr=Math.max(Xd,Rr),gq(ha,0,ha.length-1,Hi,eo)}gr=0;var Zd=oe*In+eo;ga.lineOffset=Math.max(eo,Xn),hr+=Zd,ni=Math.max(Zd,ni),++wi}var Qh=hr-B1,hv=LS(he),dv=hv.horizontalAlign,Ph=hv.verticalAlign;kd(y.positionedLines,Hi,dv,Ph,Rr,ni,oe,Qh,$.length),y.top+=-Ph*Qh,y.bottom=y.top+Qh,y.left+=-dv*Rr,y.right=y.left+Rr}function gq(y,_,I,U,$){if(!(!U&&!$))for(var oe=y[I],he=oe.metrics.advance*oe.scale,De=(y[I].x+he)*U,it=_;it<=I;it++)y[it].x-=De,y[it].y+=$}function kd(y,_,I,U,$,oe,he,De,it){var yt=(_-I)*$,Lt=0;oe!==he?Lt=-De*U-B1:Lt=(-U*it+.5)*he;for(var sr=0,gr=y;sr<gr.length;sr+=1)for(var hr=gr[sr],Rr=0,ni=hr.positionedGlyphs;Rr<ni.length;Rr+=1){var Hi=ni[Rr];Hi.x+=yt,Hi.y+=Lt}}function rp(y,_,I){var U=LS(I),$=U.horizontalAlign,oe=U.verticalAlign,he=_[0],De=_[1],it=he-y.displaySize[0]*$,yt=it+y.displaySize[0],Lt=De-y.displaySize[1]*oe,sr=Lt+y.displaySize[1];return{image:y,top:Lt,bottom:sr,left:it,right:yt}}function pm(y,_,I,U,$,oe){var he=y.image,De;if(he.content){var it=he.content,yt=he.pixelRatio||1;De=[it[0]/yt,it[1]/yt,he.displaySize[0]-it[2]/yt,he.displaySize[1]-it[3]/yt]}var Lt=_.left*oe,sr=_.right*oe,gr,hr,Rr,ni;I==="width"||I==="both"?(ni=$[0]+Lt-U[3],hr=$[0]+sr+U[1]):(ni=$[0]+(Lt+sr-he.displaySize[0])/2,hr=ni+he.displaySize[0]);var Hi=_.top*oe,wi=_.bottom*oe;return I==="height"||I==="both"?(gr=$[1]+Hi-U[0],Rr=$[1]+wi+U[2]):(gr=$[1]+(Hi+wi-he.displaySize[1])/2,Rr=gr+he.displaySize[1]),{image:he,top:gr,right:hr,bottom:Rr,left:ni,collisionPadding:De}}var Wd=function(y){function _(I,U,$,oe){y.call(this,I,U),this.angle=$,oe!==void 0&&(this.segment=oe)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.clone=function(){return new _(this.x,this.y,this.angle,this.segment)},_}(u);X("Anchor",Wd);var Cd=128;function xp(y,_){var I=_.expression;if(I.kind==="constant"){var U=I.evaluate(new Un(y+1));return{kind:"constant",layoutSize:U}}else{if(I.kind==="source")return{kind:"source"};for(var $=I.zoomStops,oe=I.interpolationType,he=0;he<$.length&&$[he]<=y;)he++;he=Math.max(0,he-1);for(var De=he;De<$.length&&$[De]<y+1;)De++;De=Math.min($.length-1,De);var it=$[he],yt=$[De];if(I.kind==="composite")return{kind:"composite",minZoom:it,maxZoom:yt,interpolationType:oe};var Lt=I.evaluate(new Un(it)),sr=I.evaluate(new Un(yt));return{kind:"camera",minZoom:it,maxZoom:yt,minSize:Lt,maxSize:sr,interpolationType:oe}}}function NQ(y,_,I){var U=_.uSize,$=_.uSizeT,oe=I.lowerSize,he=I.upperSize;return y.kind==="source"?oe/Cd:y.kind==="composite"?nl(oe/Cd,he/Cd,$):U}function UQ(y,_){var I=0,U=0;if(y.kind==="constant")U=y.layoutSize;else if(y.kind!=="source"){var $=y.interpolationType,oe=y.minZoom,he=y.maxZoom,De=$?p(Wl.interpolationFactor($,_,oe,he),0,1):0;y.kind==="camera"?U=nl(y.minSize,y.maxSize,De):I=De}return{uSizeT:I,uSize:U}}var qet=Object.freeze({__proto__:null,getSizeData:xp,evaluateSizeForFeature:NQ,evaluateSizeForZoom:UQ,SIZE_PACK_FACTOR:Cd});function VQ(y,_,I,U,$){if(_.segment===void 0)return!0;for(var oe=_,he=_.segment+1,De=0;De>-I/2;){if(he--,he<0)return!1;De-=y[he].dist(oe),oe=y[he]}De+=y[he].dist(y[he+1]),he++;for(var it=[],yt=0;De<I/2;){var Lt=y[he-1],sr=y[he],gr=y[he+1];if(!gr)return!1;var hr=Lt.angleTo(sr)-sr.angleTo(gr);for(hr=Math.abs((hr+3*Math.PI)%(Math.PI*2)-Math.PI),it.push({distance:De,angleDelta:hr}),yt+=hr;De-it[0].distance>U;)yt-=it.shift().angleDelta;if(yt>$)return!1;he++,De+=sr.dist(gr)}return!0}function GQ(y){for(var _=0,I=0;I<y.length-1;I++)_+=y[I].dist(y[I+1]);return _}function HQ(y,_,I){return y?3/5*_*I:0}function jQ(y,_){return Math.max(y?y.right-y.left:0,_?_.right-_.left:0)}function Oet(y,_,I,U,$,oe){for(var he=HQ(I,$,oe),De=jQ(I,U)*oe,it=0,yt=GQ(y)/2,Lt=0;Lt<y.length-1;Lt++){var sr=y[Lt],gr=y[Lt+1],hr=sr.dist(gr);if(it+hr>yt){var Rr=(yt-it)/hr,ni=nl(sr.x,gr.x,Rr),Hi=nl(sr.y,gr.y,Rr),wi=new Wd(ni,Hi,gr.angleTo(sr),Lt);return wi._round(),!he||VQ(y,wi,De,he,_)?wi:void 0}it+=hr}}function Bet(y,_,I,U,$,oe,he,De,it){var yt=HQ(U,oe,he),Lt=jQ(U,$),sr=Lt*he,gr=y[0].x===0||y[0].x===it||y[0].y===0||y[0].y===it;_-sr<_/4&&(_=sr+_/4);var hr=oe*2,Rr=gr?_/2*De%_:(Lt/2+hr)*he*De%_;return WQ(y,Rr,_,yt,I,sr,gr,!1,it)}function WQ(y,_,I,U,$,oe,he,De,it){for(var yt=oe/2,Lt=GQ(y),sr=0,gr=_-I,hr=[],Rr=0;Rr<y.length-1;Rr++){for(var ni=y[Rr],Hi=y[Rr+1],wi=ni.dist(Hi),bn=Hi.angleTo(ni);gr+I<sr+wi;){gr+=I;var rn=(gr-sr)/wi,xn=nl(ni.x,Hi.x,rn),In=nl(ni.y,Hi.y,rn);if(xn>=0&&xn<it&&In>=0&&In<it&&gr-yt>=0&&gr+yt<=Lt){var Xn=new Wd(xn,In,bn,Rr);Xn._round(),(!U||VQ(y,Xn,oe,U,$))&&hr.push(Xn)}}sr+=wi}return!De&&!hr.length&&!he&&(hr=WQ(y,sr/2,I,U,$,oe,he,!0,it)),hr}function XQ(y,_,I,U,$){for(var oe=[],he=0;he<y.length;he++)for(var De=y[he],it=void 0,yt=0;yt<De.length-1;yt++){var Lt=De[yt],sr=De[yt+1];Lt.x<_&&sr.x<_||(Lt.x<_?Lt=new u(_,Lt.y+(sr.y-Lt.y)*((_-Lt.x)/(sr.x-Lt.x)))._round():sr.x<_&&(sr=new u(_,Lt.y+(sr.y-Lt.y)*((_-Lt.x)/(sr.x-Lt.x)))._round()),!(Lt.y<I&&sr.y<I)&&(Lt.y<I?Lt=new u(Lt.x+(sr.x-Lt.x)*((I-Lt.y)/(sr.y-Lt.y)),I)._round():sr.y<I&&(sr=new u(Lt.x+(sr.x-Lt.x)*((I-Lt.y)/(sr.y-Lt.y)),I)._round()),!(Lt.x>=U&&sr.x>=U)&&(Lt.x>=U?Lt=new u(U,Lt.y+(sr.y-Lt.y)*((U-Lt.x)/(sr.x-Lt.x)))._round():sr.x>=U&&(sr=new u(U,Lt.y+(sr.y-Lt.y)*((U-Lt.x)/(sr.x-Lt.x)))._round()),!(Lt.y>=$&&sr.y>=$)&&(Lt.y>=$?Lt=new u(Lt.x+(sr.x-Lt.x)*(($-Lt.y)/(sr.y-Lt.y)),$)._round():sr.y>=$&&(sr=new u(Lt.x+(sr.x-Lt.x)*(($-Lt.y)/(sr.y-Lt.y)),$)._round()),(!it||!Lt.equals(it[it.length-1]))&&(it=[Lt],oe.push(it)),it.push(sr)))))}return oe}var i3=Gc;function ZQ(y,_,I,U){var $=[],oe=y.image,he=oe.pixelRatio,De=oe.paddedRect.w-2*i3,it=oe.paddedRect.h-2*i3,yt=y.right-y.left,Lt=y.bottom-y.top,sr=oe.stretchX||[[0,De]],gr=oe.stretchY||[[0,it]],hr=function(Cl,yl){return Cl+yl[1]-yl[0]},Rr=sr.reduce(hr,0),ni=gr.reduce(hr,0),Hi=De-Rr,wi=it-ni,bn=0,rn=Rr,xn=0,In=ni,Xn=0,ga=Hi,ha=0,eo=wi;if(oe.content&&U){var za=oe.content;bn=a6(sr,0,za[0]),xn=a6(gr,0,za[1]),rn=a6(sr,za[0],za[2]),In=a6(gr,za[1],za[3]),Xn=za[0]-bn,ha=za[1]-xn,ga=za[2]-za[0]-rn,eo=za[3]-za[1]-In}var Za=function(Cl,yl,Qu,gc){var Sf=o6(Cl.stretch-bn,rn,yt,y.left),Ff=s6(Cl.fixed-Xn,ga,Cl.stretch,Rr),$h=o6(yl.stretch-xn,In,Lt,y.top),ch=s6(yl.fixed-ha,eo,yl.stretch,ni),Xd=o6(Qu.stretch-bn,rn,yt,y.left),Zd=s6(Qu.fixed-Xn,ga,Qu.stretch,Rr),Qh=o6(gc.stretch-xn,In,Lt,y.top),hv=s6(gc.fixed-ha,eo,gc.stretch,ni),dv=new u(Sf,$h),Ph=new u(Xd,$h),vv=new u(Xd,Qh),bp=new u(Sf,Qh),Ty=new u(Ff/he,ch/he),V1=new u(Zd/he,hv/he),G1=_*Math.PI/180;if(G1){var H1=Math.sin(G1),f3=Math.cos(G1),y0=[f3,-H1,H1,f3];dv._matMult(y0),Ph._matMult(y0),bp._matMult(y0),vv._matMult(y0)}var d6=Cl.stretch+Cl.fixed,Aq=Qu.stretch+Qu.fixed,v6=yl.stretch+yl.fixed,Sq=gc.stretch+gc.fixed,Hp={x:oe.paddedRect.x+i3+d6,y:oe.paddedRect.y+i3+v6,w:Aq-d6,h:Sq-v6},h3=ga/he/yt,p6=eo/he/Lt;return{tl:dv,tr:Ph,bl:bp,br:vv,tex:Hp,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ty,pixelOffsetBR:V1,minFontScaleX:h3,minFontScaleY:p6,isSDF:I}};if(!U||!oe.stretchX&&!oe.stretchY)$.push(Za({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:De+1},{fixed:0,stretch:it+1}));else for(var Jo=YQ(sr,Hi,Rr),to=YQ(gr,wi,ni),ao=0;ao<Jo.length-1;ao++)for(var _s=Jo[ao],jo=Jo[ao+1],El=0;El<to.length-1;El++){var Iu=to[El],kl=to[El+1];$.push(Za(_s,Iu,jo,kl))}return $}function a6(y,_,I){for(var U=0,$=0,oe=y;$<oe.length;$+=1){var he=oe[$];U+=Math.max(_,Math.min(I,he[1]))-Math.max(_,Math.min(I,he[0]))}return U}function YQ(y,_,I){for(var U=[{fixed:-i3,stretch:0}],$=0,oe=y;$<oe.length;$+=1){var he=oe[$],De=he[0],it=he[1],yt=U[U.length-1];U.push({fixed:De-yt.stretch,stretch:yt.stretch}),U.push({fixed:De-yt.stretch,stretch:yt.stretch+(it-De)})}return U.push({fixed:_+i3,stretch:I}),U}function o6(y,_,I,U){return y/_*I+U}function s6(y,_,I,U){return y-_*I/U}function Net(y,_,I,U,$,oe,he,De){for(var it=U.layout.get("text-rotate").evaluate(oe,{})*Math.PI/180,yt=[],Lt=0,sr=_.positionedLines;Lt<sr.length;Lt+=1)for(var gr=sr[Lt],hr=0,Rr=gr.positionedGlyphs;hr<Rr.length;hr+=1){var ni=Rr[hr];if(ni.rect){var Hi=ni.rect||{},wi=1,bn=Gp+wi,rn=!0,xn=1,In=0,Xn=($||De)&&ni.vertical,ga=ni.metrics.advance*ni.scale/2;if(De&&_.verticalizable){var ha=(ni.scale-1)*Tn,eo=(Tn-ni.metrics.width*ni.scale)/2;In=gr.lineOffset/2-(ni.imageName?-eo:ha)}if(ni.imageName){var za=he[ni.imageName];rn=za.sdf,xn=za.pixelRatio,bn=Gc/xn}var Za=$?[ni.x+ga,ni.y]:[0,0],Jo=$?[0,0]:[ni.x+ga+I[0],ni.y+I[1]-In],to=[0,0];Xn&&(to=Jo,Jo=[0,0]);var ao=(ni.metrics.left-bn)*ni.scale-ga+Jo[0],_s=(-ni.metrics.top-bn)*ni.scale+Jo[1],jo=ao+Hi.w*ni.scale/xn,El=_s+Hi.h*ni.scale/xn,Iu=new u(ao,_s),kl=new u(jo,_s),Cl=new u(ao,El),yl=new u(jo,El);if(Xn){var Qu=new u(-ga,ga-B1),gc=-Math.PI/2,Sf=Tn/2-ga,Ff=ni.imageName?Sf:0,$h=new u(5-B1-Sf,-Ff),ch=new(Function.prototype.bind.apply(u,[null].concat(to)));Iu._rotateAround(gc,Qu)._add($h)._add(ch),kl._rotateAround(gc,Qu)._add($h)._add(ch),Cl._rotateAround(gc,Qu)._add($h)._add(ch),yl._rotateAround(gc,Qu)._add($h)._add(ch)}if(it){var Xd=Math.sin(it),Zd=Math.cos(it),Qh=[Zd,-Xd,Xd,Zd];Iu._matMult(Qh),kl._matMult(Qh),Cl._matMult(Qh),yl._matMult(Qh)}var hv=new u(0,0),dv=new u(0,0),Ph=0,vv=0;yt.push({tl:Iu,tr:kl,bl:Cl,br:yl,tex:Hi,writingMode:_.writingMode,glyphOffset:Za,sectionIndex:ni.sectionIndex,isSDF:rn,pixelOffsetTL:hv,pixelOffsetBR:dv,minFontScaleX:Ph,minFontScaleY:vv})}}return yt}var l6=function(_,I,U,$,oe,he,De,it,yt,Lt){if(this.boxStartIndex=_.length,yt){var sr=he.top,gr=he.bottom,hr=he.collisionPadding;hr&&(sr-=hr[1],gr+=hr[3]);var Rr=gr-sr;Rr>0&&(Rr=Math.max(10,Rr),this.circleDiameter=Rr)}else{var ni=he.top*De-it,Hi=he.bottom*De+it,wi=he.left*De-it,bn=he.right*De+it,rn=he.collisionPadding;if(rn&&(wi-=rn[0]*De,ni-=rn[1]*De,bn+=rn[2]*De,Hi+=rn[3]*De),Lt){var xn=new u(wi,ni),In=new u(bn,ni),Xn=new u(wi,Hi),ga=new u(bn,Hi),ha=Lt*Math.PI/180;xn._rotate(ha),In._rotate(ha),Xn._rotate(ha),ga._rotate(ha),wi=Math.min(xn.x,In.x,Xn.x,ga.x),bn=Math.max(xn.x,In.x,Xn.x,ga.x),ni=Math.min(xn.y,In.y,Xn.y,ga.y),Hi=Math.max(xn.y,In.y,Xn.y,ga.y)}_.emplaceBack(I.x,I.y,wi,ni,bn,Hi,U,$,oe)}this.boxEndIndex=_.length},n3=function(_,I){if(_===void 0&&(_=[]),I===void 0&&(I=Uet),this.data=_,this.length=this.data.length,this.compare=I,this.length>0)for(var U=(this.length>>1)-1;U>=0;U--)this._down(U)};n3.prototype.push=function(_){this.data.push(_),this.length++,this._up(this.length-1)},n3.prototype.pop=function(){if(this.length!==0){var _=this.data[0],I=this.data.pop();return this.length--,this.length>0&&(this.data[0]=I,this._down(0)),_}},n3.prototype.peek=function(){return this.data[0]},n3.prototype._up=function(_){for(var I=this,U=I.data,$=I.compare,oe=U[_];_>0;){var he=_-1>>1,De=U[he];if($(oe,De)>=0)break;U[_]=De,_=he}U[_]=oe},n3.prototype._down=function(_){for(var I=this,U=I.data,$=I.compare,oe=this.length>>1,he=U[_];_<oe;){var De=(_<<1)+1,it=U[De],yt=De+1;if(yt<this.length&&$(U[yt],it)<0&&(De=yt,it=U[yt]),$(it,he)>=0)break;U[_]=it,_=De}U[_]=he};function Uet(y,_){return y<_?-1:y>_?1:0}function Vet(y,_,I){_===void 0&&(_=1),I===void 0&&(I=!1);for(var U=1/0,$=1/0,oe=-1/0,he=-1/0,De=y[0],it=0;it<De.length;it++){var yt=De[it];(!it||yt.x<U)&&(U=yt.x),(!it||yt.y<$)&&($=yt.y),(!it||yt.x>oe)&&(oe=yt.x),(!it||yt.y>he)&&(he=yt.y)}var Lt=oe-U,sr=he-$,gr=Math.min(Lt,sr),hr=gr/2,Rr=new n3([],Get);if(gr===0)return new u(U,$);for(var ni=U;ni<oe;ni+=gr)for(var Hi=$;Hi<he;Hi+=gr)Rr.push(new a3(ni+hr,Hi+hr,hr,y));for(var wi=jet(y),bn=Rr.length;Rr.length;){var rn=Rr.pop();(rn.d>wi.d||!wi.d)&&(wi=rn,I&&console.log("found best %d after %d probes",Math.round(1e4*rn.d)/1e4,bn)),!(rn.max-wi.d<=_)&&(hr=rn.h/2,Rr.push(new a3(rn.p.x-hr,rn.p.y-hr,hr,y)),Rr.push(new a3(rn.p.x+hr,rn.p.y-hr,hr,y)),Rr.push(new a3(rn.p.x-hr,rn.p.y+hr,hr,y)),Rr.push(new a3(rn.p.x+hr,rn.p.y+hr,hr,y)),bn+=4)}return I&&(console.log("num probes: "+bn),console.log("best distance: "+wi.d)),wi.p}function Get(y,_){return _.max-y.max}function a3(y,_,I,U){this.p=new u(y,_),this.h=I,this.d=Het(this.p,U),this.max=this.d+this.h*Math.SQRT2}function Het(y,_){for(var I=!1,U=1/0,$=0;$<_.length;$++)for(var oe=_[$],he=0,De=oe.length,it=De-1;he<De;it=he++){var yt=oe[he],Lt=oe[it];yt.y>y.y!=Lt.y>y.y&&y.x<(Lt.x-yt.x)*(y.y-yt.y)/(Lt.y-yt.y)+yt.x&&(I=!I),U=Math.min(U,hg(y,yt,Lt))}return(I?1:-1)*Math.sqrt(U)}function jet(y){for(var _=0,I=0,U=0,$=y[0],oe=0,he=$.length,De=he-1;oe<he;De=oe++){var it=$[oe],yt=$[De],Lt=it.x*yt.y-yt.x*it.y;I+=(it.x+yt.x)*Lt,U+=(it.y+yt.y)*Lt,_+=Lt*3}return new a3(I/_,U/_,0,y)}var o3=7,mq=Number.POSITIVE_INFINITY;function KQ(y,_){function I($,oe){var he=0,De=0;oe<0&&(oe=0);var it=oe/Math.sqrt(2);switch($){case"top-right":case"top-left":De=it-o3;break;case"bottom-right":case"bottom-left":De=-it+o3;break;case"bottom":De=-oe+o3;break;case"top":De=oe-o3;break}switch($){case"top-right":case"bottom-right":he=-it;break;case"top-left":case"bottom-left":he=it;break;case"left":he=oe;break;case"right":he=-oe;break}return[he,De]}function U($,oe,he){var De=0,it=0;switch(oe=Math.abs(oe),he=Math.abs(he),$){case"top-right":case"top-left":case"top":it=he-o3;break;case"bottom-right":case"bottom-left":case"bottom":it=-he+o3;break}switch($){case"top-right":case"bottom-right":case"right":De=-oe;break;case"top-left":case"bottom-left":case"left":De=oe;break}return[De,it]}return _[1]!==mq?U(y,_[0],_[1]):I(y,_[0])}function Wet(y,_,I,U,$,oe,he){y.createArrays();var De=512*y.overscaling;y.tilePixelRatio=Ei/De,y.compareText={},y.iconsNeedLinear=!1;var it=y.layers[0].layout,yt=y.layers[0]._unevaluatedLayout._values,Lt={};if(y.textSizeData.kind==="composite"){var sr=y.textSizeData,gr=sr.minZoom,hr=sr.maxZoom;Lt.compositeTextSizes=[yt["text-size"].possiblyEvaluate(new Un(gr),he),yt["text-size"].possiblyEvaluate(new Un(hr),he)]}if(y.iconSizeData.kind==="composite"){var Rr=y.iconSizeData,ni=Rr.minZoom,Hi=Rr.maxZoom;Lt.compositeIconSizes=[yt["icon-size"].possiblyEvaluate(new Un(ni),he),yt["icon-size"].possiblyEvaluate(new Un(Hi),he)]}Lt.layoutTextSize=yt["text-size"].possiblyEvaluate(new Un(y.zoom+1),he),Lt.layoutIconSize=yt["icon-size"].possiblyEvaluate(new Un(y.zoom+1),he),Lt.textMaxSize=yt["text-size"].possiblyEvaluate(new Un(18));for(var wi=it.get("text-line-height")*Tn,bn=it.get("text-rotation-alignment")==="map"&&it.get("symbol-placement")!=="point",rn=it.get("text-keep-upright"),xn=it.get("text-size"),In=function(){var ha=ga[Xn],eo=it.get("text-font").evaluate(ha,{},he).join(","),za=xn.evaluate(ha,{},he),Za=Lt.layoutTextSize.evaluate(ha,{},he),Jo=Lt.layoutIconSize.evaluate(ha,{},he),to={horizontal:{},vertical:void 0},ao=ha.text,_s=[0,0];if(ao){var jo=ao.toString(),El=it.get("text-letter-spacing").evaluate(ha,{},he)*Tn,Iu=dr(jo)?El:0,kl=it.get("text-anchor").evaluate(ha,{},he),Cl=it.get("text-variable-anchor");if(!Cl){var yl=it.get("text-radial-offset").evaluate(ha,{},he);yl?_s=KQ(kl,[yl*Tn,mq]):_s=it.get("text-offset").evaluate(ha,{},he).map(function(Ty){return Ty*Tn})}var Qu=bn?"center":it.get("text-justify").evaluate(ha,{},he),gc=it.get("symbol-placement"),Sf=gc==="point"?it.get("text-max-width").evaluate(ha,{},he)*Tn:0,Ff=function(){y.allowVerticalPlacement&&Xt(jo)&&(to.vertical=t3(ao,_,I,$,eo,Sf,wi,kl,"left",Iu,_s,cv.vertical,!0,gc,Za,za))};if(!bn&&Cl){for(var $h=Qu==="auto"?Cl.map(function(Ty){return yq(Ty)}):[Qu],ch=!1,Xd=0;Xd<$h.length;Xd++){var Zd=$h[Xd];if(!to.horizontal[Zd])if(ch)to.horizontal[Zd]=to.horizontal[0];else{var Qh=t3(ao,_,I,$,eo,Sf,wi,"center",Zd,Iu,_s,cv.horizontal,!1,gc,Za,za);Qh&&(to.horizontal[Zd]=Qh,ch=Qh.positionedLines.length===1)}}Ff()}else{Qu==="auto"&&(Qu=yq(kl));var hv=t3(ao,_,I,$,eo,Sf,wi,kl,Qu,Iu,_s,cv.horizontal,!1,gc,Za,za);hv&&(to.horizontal[Qu]=hv),Ff(),Xt(jo)&&bn&&rn&&(to.vertical=t3(ao,_,I,$,eo,Sf,wi,kl,Qu,Iu,_s,cv.vertical,!1,gc,Za,za))}}var dv=void 0,Ph=!1;if(ha.icon&&ha.icon.name){var vv=U[ha.icon.name];vv&&(dv=rp($[ha.icon.name],it.get("icon-offset").evaluate(ha,{},he),it.get("icon-anchor").evaluate(ha,{},he)),Ph=vv.sdf,y.sdfIcons===void 0?y.sdfIcons=vv.sdf:y.sdfIcons!==vv.sdf&&ie("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(vv.pixelRatio!==y.pixelRatio||it.get("icon-rotate").constantOr(1)!==0)&&(y.iconsNeedLinear=!0))}var bp=$Q(to.horizontal)||to.vertical;y.iconsInText=bp?bp.iconsInText:!1,(bp||dv)&&Xet(y,ha,to,dv,U,Lt,Za,Jo,_s,Ph,he)},Xn=0,ga=y.features;Xn<ga.length;Xn+=1)In();oe&&y.generateCollisionDebugBuffers()}function yq(y){switch(y){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Xet(y,_,I,U,$,oe,he,De,it,yt,Lt){var sr=oe.textMaxSize.evaluate(_,{});sr===void 0&&(sr=he);var gr=y.layers[0].layout,hr=gr.get("icon-offset").evaluate(_,{},Lt),Rr=$Q(I.horizontal),ni=24,Hi=he/ni,wi=y.tilePixelRatio*Hi,bn=y.tilePixelRatio*sr/ni,rn=y.tilePixelRatio*De,xn=y.tilePixelRatio*gr.get("symbol-spacing"),In=gr.get("text-padding")*y.tilePixelRatio,Xn=gr.get("icon-padding")*y.tilePixelRatio,ga=gr.get("text-max-angle")/180*Math.PI,ha=gr.get("text-rotation-alignment")==="map"&&gr.get("symbol-placement")!=="point",eo=gr.get("icon-rotation-alignment")==="map"&&gr.get("symbol-placement")!=="point",za=gr.get("symbol-placement"),Za=xn/2,Jo=gr.get("icon-text-fit"),to;U&&Jo!=="none"&&(y.allowVerticalPlacement&&I.vertical&&(to=pm(U,I.vertical,Jo,gr.get("icon-text-fit-padding"),hr,Hi)),Rr&&(U=pm(U,Rr,Jo,gr.get("icon-text-fit-padding"),hr,Hi)));var ao=function(f3,y0){y0.x<0||y0.x>=Ei||y0.y<0||y0.y>=Ei||Zet(y,y0,f3,I,U,$,to,y.layers[0],y.collisionBoxArray,_.index,_.sourceLayerIndex,y.index,wi,In,ha,it,rn,Xn,eo,hr,_,oe,yt,Lt,he)};if(za==="line")for(var _s=0,jo=XQ(_.geometry,0,0,Ei,Ei);_s<jo.length;_s+=1)for(var El=jo[_s],Iu=Bet(El,xn,ga,I.vertical||Rr,U,ni,bn,y.overscaling,Ei),kl=0,Cl=Iu;kl<Cl.length;kl+=1){var yl=Cl[kl],Qu=Rr;(!Qu||!Yet(y,Qu.text,Za,yl))&&ao(El,yl)}else if(za==="line-center")for(var gc=0,Sf=_.geometry;gc<Sf.length;gc+=1){var Ff=Sf[gc];if(Ff.length>1){var $h=Oet(Ff,ga,I.vertical||Rr,U,ni,bn);$h&&ao(Ff,$h)}}else if(_.type==="Polygon")for(var ch=0,Xd=Zw(_.geometry,0);ch<Xd.length;ch+=1){var Zd=Xd[ch],Qh=Vet(Zd,16);ao(Zd[0],new Wd(Qh.x,Qh.y,0))}else if(_.type==="LineString")for(var hv=0,dv=_.geometry;hv<dv.length;hv+=1){var Ph=dv[hv];ao(Ph,new Wd(Ph[0].x,Ph[0].y,0))}else if(_.type==="Point")for(var vv=0,bp=_.geometry;vv<bp.length;vv+=1)for(var Ty=bp[vv],V1=0,G1=Ty;V1<G1.length;V1+=1){var H1=G1[V1];ao([H1],new Wd(H1.x,H1.y,0))}}var PS=255,N1=PS*Cd;function JQ(y,_,I,U,$,oe,he,De,it,yt,Lt,sr,gr,hr,Rr){var ni=Net(_,I,De,$,oe,he,U,y.allowVerticalPlacement),Hi=y.textSizeData,wi=null;Hi.kind==="source"?(wi=[Cd*$.layout.get("text-size").evaluate(he,{})],wi[0]>N1&&ie(y.layerIds[0]+': Value for "text-size" is >= '+PS+'. Reduce your "text-size".')):Hi.kind==="composite"&&(wi=[Cd*hr.compositeTextSizes[0].evaluate(he,{},Rr),Cd*hr.compositeTextSizes[1].evaluate(he,{},Rr)],(wi[0]>N1||wi[1]>N1)&&ie(y.layerIds[0]+': Value for "text-size" is >= '+PS+'. Reduce your "text-size".')),y.addSymbols(y.text,ni,wi,De,oe,he,yt,_,it.lineStartIndex,it.lineLength,gr,Rr);for(var bn=0,rn=Lt;bn<rn.length;bn+=1){var xn=rn[bn];sr[xn]=y.text.placedSymbolArray.length-1}return ni.length*4}function $Q(y){for(var _ in y)return y[_];return null}function Zet(y,_,I,U,$,oe,he,De,it,yt,Lt,sr,gr,hr,Rr,ni,Hi,wi,bn,rn,xn,In,Xn,ga,ha){var eo,za=y.addToLineVertexArray(_,I),Za,Jo,to,ao,_s=0,jo=0,El=0,Iu=0,kl=-1,Cl=-1,yl={},Qu=K(""),gc=0,Sf=0;if(De._unevaluatedLayout.getValue("text-radial-offset")===void 0?(eo=De.layout.get("text-offset").evaluate(xn,{},ga).map(function(DS){return DS*Tn}),gc=eo[0],Sf=eo[1]):(gc=De.layout.get("text-radial-offset").evaluate(xn,{},ga)*Tn,Sf=mq),y.allowVerticalPlacement&&U.vertical){var Ff=De.layout.get("text-rotate").evaluate(xn,{},ga),$h=Ff+90,ch=U.vertical;to=new l6(it,_,yt,Lt,sr,ch,gr,hr,Rr,$h),he&&(ao=new l6(it,_,yt,Lt,sr,he,Hi,wi,Rr,$h))}if($){var Xd=De.layout.get("icon-rotate").evaluate(xn,{}),Zd=De.layout.get("icon-text-fit")!=="none",Qh=ZQ($,Xd,Xn,Zd),hv=he?ZQ(he,Xd,Xn,Zd):void 0;Jo=new l6(it,_,yt,Lt,sr,$,Hi,wi,!1,Xd),_s=Qh.length*4;var dv=y.iconSizeData,Ph=null;dv.kind==="source"?(Ph=[Cd*De.layout.get("icon-size").evaluate(xn,{})],Ph[0]>N1&&ie(y.layerIds[0]+': Value for "icon-size" is >= '+PS+'. Reduce your "icon-size".')):dv.kind==="composite"&&(Ph=[Cd*In.compositeIconSizes[0].evaluate(xn,{},ga),Cd*In.compositeIconSizes[1].evaluate(xn,{},ga)],(Ph[0]>N1||Ph[1]>N1)&&ie(y.layerIds[0]+': Value for "icon-size" is >= '+PS+'. Reduce your "icon-size".')),y.addSymbols(y.icon,Qh,Ph,rn,bn,xn,!1,_,za.lineStartIndex,za.lineLength,-1,ga),kl=y.icon.placedSymbolArray.length-1,hv&&(jo=hv.length*4,y.addSymbols(y.icon,hv,Ph,rn,bn,xn,cv.vertical,_,za.lineStartIndex,za.lineLength,-1,ga),Cl=y.icon.placedSymbolArray.length-1)}for(var vv in U.horizontal){var bp=U.horizontal[vv];if(!Za){Qu=K(bp.text);var Ty=De.layout.get("text-rotate").evaluate(xn,{},ga);Za=new l6(it,_,yt,Lt,sr,bp,gr,hr,Rr,Ty)}var V1=bp.positionedLines.length===1;if(El+=JQ(y,_,bp,oe,De,Rr,xn,ni,za,U.vertical?cv.horizontal:cv.horizontalOnly,V1?Object.keys(U.horizontal):[vv],yl,kl,In,ga),V1)break}U.vertical&&(Iu+=JQ(y,_,U.vertical,oe,De,Rr,xn,ni,za,cv.vertical,["vertical"],yl,Cl,In,ga));var G1=Za?Za.boxStartIndex:y.collisionBoxArray.length,H1=Za?Za.boxEndIndex:y.collisionBoxArray.length,f3=to?to.boxStartIndex:y.collisionBoxArray.length,y0=to?to.boxEndIndex:y.collisionBoxArray.length,d6=Jo?Jo.boxStartIndex:y.collisionBoxArray.length,Aq=Jo?Jo.boxEndIndex:y.collisionBoxArray.length,v6=ao?ao.boxStartIndex:y.collisionBoxArray.length,Sq=ao?ao.boxEndIndex:y.collisionBoxArray.length,Hp=-1,h3=function(DS,vee){return DS&&DS.circleDiameter?Math.max(DS.circleDiameter,vee):vee};Hp=h3(Za,Hp),Hp=h3(to,Hp),Hp=h3(Jo,Hp),Hp=h3(ao,Hp);var p6=Hp>-1?1:0;p6&&(Hp*=ha/Tn),y.glyphOffsetArray.length>=Pu.MAX_GLYPHS&&ie("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),xn.sortKey!==void 0&&y.addToSortKeyRanges(y.symbolInstances.length,xn.sortKey),y.symbolInstances.emplaceBack(_.x,_.y,yl.right>=0?yl.right:-1,yl.center>=0?yl.center:-1,yl.left>=0?yl.left:-1,yl.vertical||-1,kl,Cl,Qu,G1,H1,f3,y0,d6,Aq,v6,Sq,yt,El,Iu,_s,jo,p6,0,gr,gc,Sf,Hp)}function Yet(y,_,I,U){var $=y.compareText;if(!(_ in $))$[_]=[];else for(var oe=$[_],he=oe.length-1;he>=0;he--)if(U.dist(oe[he])<I)return!0;return $[_].push(U),!1}var Ket=mg.VectorTileFeature.types,Jet=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function u6(y,_,I,U,$,oe,he,De,it,yt,Lt,sr,gr){var hr=De?Math.min(N1,Math.round(De[0])):0,Rr=De?Math.min(N1,Math.round(De[1])):0;y.emplaceBack(_,I,Math.round(U*32),Math.round($*32),oe,he,(hr<<1)+(it?1:0),Rr,yt*16,Lt*16,sr*256,gr*256)}function _q(y,_,I){y.emplaceBack(_.x,_.y,I),y.emplaceBack(_.x,_.y,I),y.emplaceBack(_.x,_.y,I),y.emplaceBack(_.x,_.y,I)}function $et(y){for(var _=0,I=y.sections;_<I.length;_+=1){var U=I[_];if(Li(U.text))return!0}return!1}var s3=function(_){this.layoutVertexArray=new qn,this.indexArray=new pn,this.programConfigurations=_,this.segments=new io,this.dynamicLayoutVertexArray=new fi,this.opacityVertexArray=new si,this.placedSymbolArray=new zo};s3.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},s3.prototype.upload=function(_,I,U,$){this.isEmpty()||(U&&(this.layoutVertexBuffer=_.createVertexBuffer(this.layoutVertexArray,te.members),this.indexBuffer=_.createIndexBuffer(this.indexArray,I),this.dynamicLayoutVertexBuffer=_.createVertexBuffer(this.dynamicLayoutVertexArray,fe.members,!0),this.opacityVertexBuffer=_.createVertexBuffer(this.opacityVertexArray,Jet,!0),this.opacityVertexBuffer.itemSize=1),(U||$)&&this.programConfigurations.upload(_))},s3.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},X("SymbolBuffers",s3);var IS=function(_,I,U){this.layoutVertexArray=new _,this.layoutAttributes=I,this.indexArray=new U,this.segments=new io,this.collisionVertexArray=new Bi};IS.prototype.upload=function(_){this.layoutVertexBuffer=_.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=_.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=_.createVertexBuffer(this.collisionVertexArray,Re.members,!0)},IS.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},X("CollisionBuffers",IS);var Pu=function(_){this.collisionBoxArray=_.collisionBoxArray,this.zoom=_.zoom,this.overscaling=_.overscaling,this.layers=_.layers,this.layerIds=this.layers.map(function(it){return it.id}),this.index=_.index,this.pixelRatio=_.pixelRatio,this.sourceLayerIndex=_.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=vy([]),this.placementViewportMatrix=vy([]);var I=this.layers[0],U=I._unevaluatedLayout._values;this.textSizeData=xp(this.zoom,U["text-size"]),this.iconSizeData=xp(this.zoom,U["icon-size"]);var $=this.layers[0].layout,oe=$.get("symbol-sort-key"),he=$.get("symbol-z-order");this.canOverlap=$.get("text-allow-overlap")||$.get("icon-allow-overlap")||$.get("text-ignore-placement")||$.get("icon-ignore-placement"),this.sortFeaturesByKey=he!=="viewport-y"&&oe.constantOr(1)!==void 0;var De=he==="viewport-y"||he==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=De&&this.canOverlap,$.get("symbol-placement")==="point"&&(this.writingModes=$.get("text-writing-mode").map(function(it){return cv[it]})),this.stateDependentLayerIds=this.layers.filter(function(it){return it.isStateDependent()}).map(function(it){return it.id}),this.sourceID=_.sourceID};Pu.prototype.createArrays=function(){this.text=new s3(new ci(this.layers,this.zoom,function(_){return/^text/.test(_)})),this.icon=new s3(new ci(this.layers,this.zoom,function(_){return/^icon/.test(_)})),this.glyphOffsetArray=new Vl,this.lineVertexArray=new ss,this.symbolInstances=new al},Pu.prototype.calculateGlyphDependencies=function(_,I,U,$,oe){for(var he=0;he<_.length;he++)if(I[_.charCodeAt(he)]=!0,(U||$)&&oe){var De=zi[_.charAt(he)];De&&(I[De.charCodeAt(0)]=!0)}},Pu.prototype.populate=function(_,I,U){var $=this.layers[0],oe=$.layout,he=oe.get("text-font"),De=oe.get("text-field"),it=oe.get("icon-image"),yt=(De.value.kind!=="constant"||De.value.value instanceof $l&&!De.value.value.isEmpty()||De.value.value.toString().length>0)&&(he.value.kind!=="constant"||he.value.value.length>0),Lt=it.value.kind!=="constant"||!!it.value.value||Object.keys(it.parameters).length>0,sr=oe.get("symbol-sort-key");if(this.features=[],!(!yt&&!Lt)){for(var gr=I.iconDependencies,hr=I.glyphDependencies,Rr=I.availableImages,ni=new Un(this.zoom),Hi=0,wi=_;Hi<wi.length;Hi+=1){var bn=wi[Hi],rn=bn.feature,xn=bn.id,In=bn.index,Xn=bn.sourceLayerIndex,ga=$._featureFilter.needGeometry,ha=Ja(rn,ga);if($._featureFilter.filter(ni,ha,U)){ga||(ha.geometry=zn(rn));var eo=void 0;if(yt){var za=$.getValueAndResolveTokens("text-field",ha,U,Rr),Za=$l.factory(za);$et(Za)&&(this.hasRTLText=!0),(!this.hasRTLText||yo()==="unavailable"||this.hasRTLText&&Ms.isParsed())&&(eo=pi(Za,$,ha))}var Jo=void 0;if(Lt){var to=$.getValueAndResolveTokens("icon-image",ha,U,Rr);to instanceof fl?Jo=to:Jo=fl.fromString(to)}if(!(!eo&&!Jo)){var ao=this.sortFeaturesByKey?sr.evaluate(ha,{},U):void 0,_s={id:xn,text:eo,icon:Jo,index:In,sourceLayerIndex:Xn,geometry:ha.geometry,properties:rn.properties,type:Ket[rn.type],sortKey:ao};if(this.features.push(_s),Jo&&(gr[Jo.name]=!0),eo){var jo=he.evaluate(ha,{},U).join(","),El=oe.get("text-rotation-alignment")==="map"&&oe.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(cv.vertical)>=0;for(var Iu=0,kl=eo.sections;Iu<kl.length;Iu+=1){var Cl=kl[Iu];if(Cl.image)gr[Cl.image.name]=!0;else{var yl=Xt(eo.toString()),Qu=Cl.fontStack||jo,gc=hr[Qu]=hr[Qu]||{};this.calculateGlyphDependencies(Cl.text,gc,El,this.allowVerticalPlacement,yl)}}}}}}oe.get("symbol-placement")==="line"&&(this.features=vn(this.features)),this.sortFeaturesByKey&&this.features.sort(function(Sf,Ff){return Sf.sortKey-Ff.sortKey})}},Pu.prototype.update=function(_,I,U){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(_,I,this.layers,U),this.icon.programConfigurations.updatePaintArrays(_,I,this.layers,U))},Pu.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},Pu.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Pu.prototype.upload=function(_){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(_),this.iconCollisionBox.upload(_)),this.text.upload(_,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(_,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Pu.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Pu.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Pu.prototype.addToLineVertexArray=function(_,I){var U=this.lineVertexArray.length;if(_.segment!==void 0){for(var $=_.dist(I[_.segment+1]),oe=_.dist(I[_.segment]),he={},De=_.segment+1;De<I.length;De++)he[De]={x:I[De].x,y:I[De].y,tileUnitDistanceFromAnchor:$},De<I.length-1&&($+=I[De+1].dist(I[De]));for(var it=_.segment||0;it>=0;it--)he[it]={x:I[it].x,y:I[it].y,tileUnitDistanceFromAnchor:oe},it>0&&(oe+=I[it-1].dist(I[it]));for(var yt=0;yt<I.length;yt++){var Lt=he[yt];this.lineVertexArray.emplaceBack(Lt.x,Lt.y,Lt.tileUnitDistanceFromAnchor)}}return{lineStartIndex:U,lineLength:this.lineVertexArray.length-U}},Pu.prototype.addSymbols=function(_,I,U,$,oe,he,De,it,yt,Lt,sr,gr){for(var hr=_.indexArray,Rr=_.layoutVertexArray,ni=_.segments.prepareSegment(4*I.length,Rr,hr,this.canOverlap?he.sortKey:void 0),Hi=this.glyphOffsetArray.length,wi=ni.vertexLength,bn=this.allowVerticalPlacement&&De===cv.vertical?Math.PI/2:0,rn=he.text&&he.text.sections,xn=0;xn<I.length;xn++){var In=I[xn],Xn=In.tl,ga=In.tr,ha=In.bl,eo=In.br,za=In.tex,Za=In.pixelOffsetTL,Jo=In.pixelOffsetBR,to=In.minFontScaleX,ao=In.minFontScaleY,_s=In.glyphOffset,jo=In.isSDF,El=In.sectionIndex,Iu=ni.vertexLength,kl=_s[1];u6(Rr,it.x,it.y,Xn.x,kl+Xn.y,za.x,za.y,U,jo,Za.x,Za.y,to,ao),u6(Rr,it.x,it.y,ga.x,kl+ga.y,za.x+za.w,za.y,U,jo,Jo.x,Za.y,to,ao),u6(Rr,it.x,it.y,ha.x,kl+ha.y,za.x,za.y+za.h,U,jo,Za.x,Jo.y,to,ao),u6(Rr,it.x,it.y,eo.x,kl+eo.y,za.x+za.w,za.y+za.h,U,jo,Jo.x,Jo.y,to,ao),_q(_.dynamicLayoutVertexArray,it,bn),hr.emplaceBack(Iu,Iu+1,Iu+2),hr.emplaceBack(Iu+1,Iu+2,Iu+3),ni.vertexLength+=4,ni.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(_s[0]),(xn===I.length-1||El!==I[xn+1].sectionIndex)&&_.programConfigurations.populatePaintArrays(Rr.length,he,he.index,{},gr,rn&&rn[El])}_.placedSymbolArray.emplaceBack(it.x,it.y,Hi,this.glyphOffsetArray.length-Hi,wi,yt,Lt,it.segment,U?U[0]:0,U?U[1]:0,$[0],$[1],De,0,!1,0,sr)},Pu.prototype._addCollisionDebugVertex=function(_,I,U,$,oe,he){return I.emplaceBack(0,0),_.emplaceBack(U.x,U.y,$,oe,Math.round(he.x),Math.round(he.y))},Pu.prototype.addCollisionDebugVertices=function(_,I,U,$,oe,he,De){var it=oe.segments.prepareSegment(4,oe.layoutVertexArray,oe.indexArray),yt=it.vertexLength,Lt=oe.layoutVertexArray,sr=oe.collisionVertexArray,gr=De.anchorX,hr=De.anchorY;this._addCollisionDebugVertex(Lt,sr,he,gr,hr,new u(_,I)),this._addCollisionDebugVertex(Lt,sr,he,gr,hr,new u(U,I)),this._addCollisionDebugVertex(Lt,sr,he,gr,hr,new u(U,$)),this._addCollisionDebugVertex(Lt,sr,he,gr,hr,new u(_,$)),it.vertexLength+=4;var Rr=oe.indexArray;Rr.emplaceBack(yt,yt+1),Rr.emplaceBack(yt+1,yt+2),Rr.emplaceBack(yt+2,yt+3),Rr.emplaceBack(yt+3,yt),it.primitiveLength+=4},Pu.prototype.addDebugCollisionBoxes=function(_,I,U,$){for(var oe=_;oe<I;oe++){var he=this.collisionBoxArray.get(oe),De=he.x1,it=he.y1,yt=he.x2,Lt=he.y2;this.addCollisionDebugVertices(De,it,yt,Lt,$?this.textCollisionBox:this.iconCollisionBox,he.anchorPoint,U)}},Pu.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new IS(Ji,ft.members,sa),this.iconCollisionBox=new IS(Ji,ft.members,sa);for(var _=0;_<this.symbolInstances.length;_++){var I=this.symbolInstances.get(_);this.addDebugCollisionBoxes(I.textBoxStartIndex,I.textBoxEndIndex,I,!0),this.addDebugCollisionBoxes(I.verticalTextBoxStartIndex,I.verticalTextBoxEndIndex,I,!0),this.addDebugCollisionBoxes(I.iconBoxStartIndex,I.iconBoxEndIndex,I,!1),this.addDebugCollisionBoxes(I.verticalIconBoxStartIndex,I.verticalIconBoxEndIndex,I,!1)}},Pu.prototype._deserializeCollisionBoxesForSymbol=function(_,I,U,$,oe,he,De,it,yt){for(var Lt={},sr=I;sr<U;sr++){var gr=_.get(sr);Lt.textBox={x1:gr.x1,y1:gr.y1,x2:gr.x2,y2:gr.y2,anchorPointX:gr.anchorPointX,anchorPointY:gr.anchorPointY},Lt.textFeatureIndex=gr.featureIndex;break}for(var hr=$;hr<oe;hr++){var Rr=_.get(hr);Lt.verticalTextBox={x1:Rr.x1,y1:Rr.y1,x2:Rr.x2,y2:Rr.y2,anchorPointX:Rr.anchorPointX,anchorPointY:Rr.anchorPointY},Lt.verticalTextFeatureIndex=Rr.featureIndex;break}for(var ni=he;ni<De;ni++){var Hi=_.get(ni);Lt.iconBox={x1:Hi.x1,y1:Hi.y1,x2:Hi.x2,y2:Hi.y2,anchorPointX:Hi.anchorPointX,anchorPointY:Hi.anchorPointY},Lt.iconFeatureIndex=Hi.featureIndex;break}for(var wi=it;wi<yt;wi++){var bn=_.get(wi);Lt.verticalIconBox={x1:bn.x1,y1:bn.y1,x2:bn.x2,y2:bn.y2,anchorPointX:bn.anchorPointX,anchorPointY:bn.anchorPointY},Lt.verticalIconFeatureIndex=bn.featureIndex;break}return Lt},Pu.prototype.deserializeCollisionBoxes=function(_){this.collisionArrays=[];for(var I=0;I<this.symbolInstances.length;I++){var U=this.symbolInstances.get(I);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(_,U.textBoxStartIndex,U.textBoxEndIndex,U.verticalTextBoxStartIndex,U.verticalTextBoxEndIndex,U.iconBoxStartIndex,U.iconBoxEndIndex,U.verticalIconBoxStartIndex,U.verticalIconBoxEndIndex))}},Pu.prototype.hasTextData=function(){return this.text.segments.get().length>0},Pu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Pu.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Pu.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Pu.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Pu.prototype.addIndicesForPlacedSymbol=function(_,I){for(var U=_.placedSymbolArray.get(I),$=U.vertexStartIndex+U.numGlyphs*4,oe=U.vertexStartIndex;oe<$;oe+=4)_.indexArray.emplaceBack(oe,oe+1,oe+2),_.indexArray.emplaceBack(oe+1,oe+2,oe+3)},Pu.prototype.getSortedSymbolIndexes=function(_){if(this.sortedAngle===_&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var I=Math.sin(_),U=Math.cos(_),$=[],oe=[],he=[],De=0;De<this.symbolInstances.length;++De){he.push(De);var it=this.symbolInstances.get(De);$.push(Math.round(I*it.anchorX+U*it.anchorY)|0),oe.push(it.featureIndex)}return he.sort(function(yt,Lt){return $[yt]-$[Lt]||oe[Lt]-oe[yt]}),he},Pu.prototype.addToSortKeyRanges=function(_,I){var U=this.sortKeyRanges[this.sortKeyRanges.length-1];U&&U.sortKey===I?U.symbolInstanceEnd=_+1:this.sortKeyRanges.push({sortKey:I,symbolInstanceStart:_,symbolInstanceEnd:_+1})},Pu.prototype.sortFeatures=function(_){var I=this;if(this.sortFeaturesByY&&this.sortedAngle!==_&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(_),this.sortedAngle=_,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var U=0,$=this.symbolInstanceIndexes;U<$.length;U+=1){var oe=$[U],he=this.symbolInstances.get(oe);this.featureSortOrder.push(he.featureIndex),[he.rightJustifiedTextSymbolIndex,he.centerJustifiedTextSymbolIndex,he.leftJustifiedTextSymbolIndex].forEach(function(De,it,yt){De>=0&&yt.indexOf(De)===it&&I.addIndicesForPlacedSymbol(I.text,De)}),he.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,he.verticalPlacedTextSymbolIndex),he.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,he.placedIconSymbolIndex),he.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,he.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},X("SymbolBucket",Pu,{omit:["layers","collisionBoxArray","features","compareText"]}),Pu.MAX_GLYPHS=65535,Pu.addDynamicAttributes=_q;function Qet(y,_){return _.replace(/{([^{}]+)}/g,function(I,U){return U in y?String(y[U]):""})}var ett=new Or({"symbol-placement":new Me(Rn.layout_symbol["symbol-placement"]),"symbol-spacing":new Me(Rn.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Me(Rn.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new bt(Rn.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Me(Rn.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Me(Rn.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Me(Rn.layout_symbol["icon-ignore-placement"]),"icon-optional":new Me(Rn.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Me(Rn.layout_symbol["icon-rotation-alignment"]),"icon-size":new bt(Rn.layout_symbol["icon-size"]),"icon-text-fit":new Me(Rn.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Me(Rn.layout_symbol["icon-text-fit-padding"]),"icon-image":new bt(Rn.layout_symbol["icon-image"]),"icon-rotate":new bt(Rn.layout_symbol["icon-rotate"]),"icon-padding":new Me(Rn.layout_symbol["icon-padding"]),"icon-keep-upright":new Me(Rn.layout_symbol["icon-keep-upright"]),"icon-offset":new bt(Rn.layout_symbol["icon-offset"]),"icon-anchor":new bt(Rn.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Me(Rn.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Me(Rn.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Me(Rn.layout_symbol["text-rotation-alignment"]),"text-field":new bt(Rn.layout_symbol["text-field"]),"text-font":new bt(Rn.layout_symbol["text-font"]),"text-size":new bt(Rn.layout_symbol["text-size"]),"text-max-width":new bt(Rn.layout_symbol["text-max-width"]),"text-line-height":new Me(Rn.layout_symbol["text-line-height"]),"text-letter-spacing":new bt(Rn.layout_symbol["text-letter-spacing"]),"text-justify":new bt(Rn.layout_symbol["text-justify"]),"text-radial-offset":new bt(Rn.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Me(Rn.layout_symbol["text-variable-anchor"]),"text-anchor":new bt(Rn.layout_symbol["text-anchor"]),"text-max-angle":new Me(Rn.layout_symbol["text-max-angle"]),"text-writing-mode":new Me(Rn.layout_symbol["text-writing-mode"]),"text-rotate":new bt(Rn.layout_symbol["text-rotate"]),"text-padding":new Me(Rn.layout_symbol["text-padding"]),"text-keep-upright":new Me(Rn.layout_symbol["text-keep-upright"]),"text-transform":new bt(Rn.layout_symbol["text-transform"]),"text-offset":new bt(Rn.layout_symbol["text-offset"]),"text-allow-overlap":new Me(Rn.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Me(Rn.layout_symbol["text-ignore-placement"]),"text-optional":new Me(Rn.layout_symbol["text-optional"])}),ttt=new Or({"icon-opacity":new bt(Rn.paint_symbol["icon-opacity"]),"icon-color":new bt(Rn.paint_symbol["icon-color"]),"icon-halo-color":new bt(Rn.paint_symbol["icon-halo-color"]),"icon-halo-width":new bt(Rn.paint_symbol["icon-halo-width"]),"icon-halo-blur":new bt(Rn.paint_symbol["icon-halo-blur"]),"icon-translate":new Me(Rn.paint_symbol["icon-translate"]),"icon-translate-anchor":new Me(Rn.paint_symbol["icon-translate-anchor"]),"text-opacity":new bt(Rn.paint_symbol["text-opacity"]),"text-color":new bt(Rn.paint_symbol["text-color"],{runtimeType:Ol,getOverride:function(y){return y.textColor},hasOverride:function(y){return!!y.textColor}}),"text-halo-color":new bt(Rn.paint_symbol["text-halo-color"]),"text-halo-width":new bt(Rn.paint_symbol["text-halo-width"]),"text-halo-blur":new bt(Rn.paint_symbol["text-halo-blur"]),"text-translate":new Me(Rn.paint_symbol["text-translate"]),"text-translate-anchor":new Me(Rn.paint_symbol["text-translate-anchor"])}),xq={paint:ttt,layout:ett},l3=function(_){this.type=_.property.overrides?_.property.overrides.runtimeType:ac,this.defaultValue=_};l3.prototype.evaluate=function(_){if(_.formattedSection){var I=this.defaultValue.property.overrides;if(I&&I.hasOverride(_.formattedSection))return I.getOverride(_.formattedSection)}return _.feature&&_.featureState?this.defaultValue.evaluate(_.feature,_.featureState):this.defaultValue.property.specification.default},l3.prototype.eachChild=function(_){if(!this.defaultValue.isConstant()){var I=this.defaultValue.value;_(I._styleExpression.expression)}},l3.prototype.outputDefined=function(){return!1},l3.prototype.serialize=function(){return null},X("FormatSectionOverride",l3,{omit:["defaultValue"]});var rtt=function(y){function _(I){y.call(this,I,xq)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.recalculate=function(U,$){if(y.prototype.recalculate.call(this,U,$),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var oe=this.layout.get("text-writing-mode");if(oe){for(var he=[],De=0,it=oe;De<it.length;De+=1){var yt=it[De];he.indexOf(yt)<0&&he.push(yt)}this.layout._values["text-writing-mode"]=he}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},_.prototype.getValueAndResolveTokens=function(U,$,oe,he){var De=this.layout.get(U).evaluate($,{},oe,he),it=this._unevaluatedLayout._values[U];return!it.isDataDriven()&&!Va(it.value)&&De?Qet($.properties,De):De},_.prototype.createBucket=function(U){return new Pu(U)},_.prototype.queryRadius=function(){return 0},_.prototype.queryIntersectsFeature=function(){return!1},_.prototype._setPaintOverrides=function(){for(var U=0,$=xq.paint.overridableProperties;U<$.length;U+=1){var oe=$[U];if(_.hasPaintOverride(this.layout,oe)){var he=this.paint.get(oe),De=new l3(he),it=new Ac(De,he.property.specification),yt=null;he.value.kind==="constant"||he.value.kind==="source"?yt=new Vc("source",it):yt=new hc("composite",it,he.value.zoomStops,he.value._interpolationType),this.paint._values[oe]=new dl(he.property,yt,he.parameters)}}},_.prototype._handleOverridablePaintPropertyUpdate=function(U,$,oe){return!this.layout||$.isDataDriven()||oe.isDataDriven()?!1:_.hasPaintOverride(this.layout,U)},_.hasPaintOverride=function(U,$){var oe=U.get("text-field"),he=xq.paint.properties[$],De=!1,it=function(sr){for(var gr=0,hr=sr;gr<hr.length;gr+=1){var Rr=hr[gr];if(he.overrides&&he.overrides.hasOverride(Rr)){De=!0;return}}};if(oe.value.kind==="constant"&&oe.value.value instanceof $l)it(oe.value.value.sections);else if(oe.value.kind==="source"){var yt=function(sr){if(!De)if(sr instanceof Go&&Es(sr.value)===pl){var gr=sr.value;it(gr.sections)}else sr instanceof Gu?it(sr.sections):sr.eachChild(yt)},Lt=oe.value;Lt._styleExpression&&yt(Lt._styleExpression.expression)}return De},_}(vi),itt=new Or({"background-color":new Me(Rn.paint_background["background-color"]),"background-pattern":new Lr(Rn.paint_background["background-pattern"]),"background-opacity":new Me(Rn.paint_background["background-opacity"])}),ntt={paint:itt},att=function(y){function _(I){y.call(this,I,ntt)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_}(vi),ott=new Or({"raster-opacity":new Me(Rn.paint_raster["raster-opacity"]),"raster-hue-rotate":new Me(Rn.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Me(Rn.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Me(Rn.paint_raster["raster-brightness-max"]),"raster-saturation":new Me(Rn.paint_raster["raster-saturation"]),"raster-contrast":new Me(Rn.paint_raster["raster-contrast"]),"raster-resampling":new Me(Rn.paint_raster["raster-resampling"]),"raster-fade-duration":new Me(Rn.paint_raster["raster-fade-duration"])}),stt={paint:ott},ltt=function(y){function _(I){y.call(this,I,stt)}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_}(vi);function utt(y){var _=[],I=y.id;return I===void 0&&_.push({message:"layers."+I+': missing required property "id"'}),y.render===void 0&&_.push({message:"layers."+I+': missing required method "render"'}),y.renderingMode&&y.renderingMode!=="2d"&&y.renderingMode!=="3d"&&_.push({message:"layers."+I+': property "renderingMode" must be either "2d" or "3d"'}),_}var ctt=function(y){function _(I){y.call(this,I,{}),this.implementation=I}return y&&(_.__proto__=y),_.prototype=Object.create(y&&y.prototype),_.prototype.constructor=_,_.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},_.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},_.prototype.recalculate=function(){},_.prototype.updateTransitions=function(){},_.prototype.hasTransition=function(){},_.prototype.serialize=function(){},_.prototype.onAdd=function(U){this.implementation.onAdd&&this.implementation.onAdd(U,U.painter.context.gl)},_.prototype.onRemove=function(U){this.implementation.onRemove&&this.implementation.onRemove(U,U.painter.context.gl)},_}(vi),ftt={circle:J9,heatmap:Gw,hillshade:CC,fill:ub,"fill-extrusion":vm,line:A,symbol:rtt,background:att,raster:ltt};function htt(y){return y.type==="custom"?new ctt(y):new ftt[y.type](y)}var QQ=f.HTMLImageElement,eee=f.HTMLCanvasElement,tee=f.HTMLVideoElement,ree=f.ImageData,c6=f.ImageBitmap,db=function(_,I,U,$){this.context=_,this.format=U,this.texture=_.gl.createTexture(),this.update(I,$)};db.prototype.update=function(_,I,U){var $=_.width,oe=_.height,he=(!this.size||this.size[0]!==$||this.size[1]!==oe)&&!U,De=this,it=De.context,yt=it.gl;if(this.useMipmap=!!(I&&I.useMipmap),yt.bindTexture(yt.TEXTURE_2D,this.texture),it.pixelStoreUnpackFlipY.set(!1),it.pixelStoreUnpack.set(1),it.pixelStoreUnpackPremultiplyAlpha.set(this.format===yt.RGBA&&(!I||I.premultiply!==!1)),he)this.size=[$,oe],_ instanceof QQ||_ instanceof eee||_ instanceof tee||_ instanceof ree||c6&&_ instanceof c6?yt.texImage2D(yt.TEXTURE_2D,0,this.format,this.format,yt.UNSIGNED_BYTE,_):yt.texImage2D(yt.TEXTURE_2D,0,this.format,$,oe,0,this.format,yt.UNSIGNED_BYTE,_.data);else{var Lt=U||{x:0,y:0},sr=Lt.x,gr=Lt.y;_ instanceof QQ||_ instanceof eee||_ instanceof tee||_ instanceof ree||c6&&_ instanceof c6?yt.texSubImage2D(yt.TEXTURE_2D,0,sr,gr,yt.RGBA,yt.UNSIGNED_BYTE,_):yt.texSubImage2D(yt.TEXTURE_2D,0,sr,gr,$,oe,yt.RGBA,yt.UNSIGNED_BYTE,_.data)}this.useMipmap&&this.isSizePowerOfTwo()&&yt.generateMipmap(yt.TEXTURE_2D)},db.prototype.bind=function(_,I,U){var $=this,oe=$.context,he=oe.gl;he.bindTexture(he.TEXTURE_2D,this.texture),U===he.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(U=he.LINEAR),_!==this.filter&&(he.texParameteri(he.TEXTURE_2D,he.TEXTURE_MAG_FILTER,_),he.texParameteri(he.TEXTURE_2D,he.TEXTURE_MIN_FILTER,U||_),this.filter=_),I!==this.wrap&&(he.texParameteri(he.TEXTURE_2D,he.TEXTURE_WRAP_S,I),he.texParameteri(he.TEXTURE_2D,he.TEXTURE_WRAP_T,I),this.wrap=I)},db.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1===0},db.prototype.destroy=function(){var _=this.context,I=_.gl;I.deleteTexture(this.texture),this.texture=null};var bq=function(_){var I=this;this._callback=_,this._triggered=!1,typeof MessageChannel!="undefined"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){I._triggered=!1,I._callback()})};bq.prototype.trigger=function(){var _=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){_._triggered=!1,_._callback()},0))},bq.prototype.remove=function(){delete this._channel,this._callback=function(){}};var u3=function(_,I,U){this.target=_,this.parent=I,this.mapId=U,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},q(["receive","process"],this),this.invoker=new bq(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Ce()?_:f};u3.prototype.send=function(_,I,U,$,oe){var he=this;oe===void 0&&(oe=!1);var De=Math.round(Math.random()*1e18).toString(36).substring(0,10);U&&(this.callbacks[De]=U);var it=Se(this.globalScope)?void 0:[];return this.target.postMessage({id:De,type:_,hasCallback:!!U,targetMapId:$,mustQueue:oe,sourceMapId:this.mapId,data:Ve(I,it)},it),{cancel:function(){U&&delete he.callbacks[De],he.target.postMessage({id:De,type:"<cancel>",targetMapId:$,sourceMapId:he.mapId})}}},u3.prototype.receive=function(_){var I=_.data,U=I.id;if(U&&!(I.targetMapId&&this.mapId!==I.targetMapId))if(I.type==="<cancel>"){delete this.tasks[U];var $=this.cancelCallbacks[U];delete this.cancelCallbacks[U],$&&$()}else Ce()||I.mustQueue?(this.tasks[U]=I,this.taskQueue.push(U),this.invoker.trigger()):this.processTask(U,I)},u3.prototype.process=function(){if(this.taskQueue.length){var _=this.taskQueue.shift(),I=this.tasks[_];delete this.tasks[_],this.taskQueue.length&&this.invoker.trigger(),I&&this.processTask(_,I)}},u3.prototype.processTask=function(_,I){var U=this;if(I.type==="<response>"){var $=this.callbacks[_];delete this.callbacks[_],$&&(I.error?$(Ye(I.error)):$(null,Ye(I.data)))}else{var oe=!1,he=Se(this.globalScope)?void 0:[],De=I.hasCallback?function(gr,hr){oe=!0,delete U.cancelCallbacks[_],U.target.postMessage({id:_,type:"<response>",sourceMapId:U.mapId,error:gr?Ve(gr):null,data:Ve(hr,he)},he)}:function(gr){oe=!0},it=null,yt=Ye(I.data);if(this.parent[I.type])it=this.parent[I.type](I.sourceMapId,yt,De);else if(this.parent.getWorkerSource){var Lt=I.type.split("."),sr=this.parent.getWorkerSource(I.sourceMapId,Lt[0],yt.source);it=sr[Lt[1]](yt,De)}else De(new Error("Could not find function "+I.type));!oe&&it&&it.cancel&&(this.cancelCallbacks[_]=it.cancel)}},u3.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function dtt(y,_,I){_=Math.pow(2,I)-_-1;var U=iee(y*256,_*256,I),$=iee((y+1)*256,(_+1)*256,I);return U[0]+","+U[1]+","+$[0]+","+$[1]}function iee(y,_,I){var U=2*Math.PI*6378137/256/Math.pow(2,I),$=y*U-2*Math.PI*6378137/2,oe=_*U-2*Math.PI*6378137/2;return[$,oe]}var lh=function(_,I){_&&(I?this.setSouthWest(_).setNorthEast(I):_.length===4?this.setSouthWest([_[0],_[1]]).setNorthEast([_[2],_[3]]):this.setSouthWest(_[0]).setNorthEast(_[1]))};lh.prototype.setNorthEast=function(_){return this._ne=_ instanceof Hc?new Hc(_.lng,_.lat):Hc.convert(_),this},lh.prototype.setSouthWest=function(_){return this._sw=_ instanceof Hc?new Hc(_.lng,_.lat):Hc.convert(_),this},lh.prototype.extend=function(_){var I=this._sw,U=this._ne,$,oe;if(_ instanceof Hc)$=_,oe=_;else if(_ instanceof lh){if($=_._sw,oe=_._ne,!$||!oe)return this}else{if(Array.isArray(_))if(_.length===4||_.every(Array.isArray)){var he=_;return this.extend(lh.convert(he))}else{var De=_;return this.extend(Hc.convert(De))}return this}return!I&&!U?(this._sw=new Hc($.lng,$.lat),this._ne=new Hc(oe.lng,oe.lat)):(I.lng=Math.min($.lng,I.lng),I.lat=Math.min($.lat,I.lat),U.lng=Math.max(oe.lng,U.lng),U.lat=Math.max(oe.lat,U.lat)),this},lh.prototype.getCenter=function(){return new Hc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},lh.prototype.getSouthWest=function(){return this._sw},lh.prototype.getNorthEast=function(){return this._ne},lh.prototype.getNorthWest=function(){return new Hc(this.getWest(),this.getNorth())},lh.prototype.getSouthEast=function(){return new Hc(this.getEast(),this.getSouth())},lh.prototype.getWest=function(){return this._sw.lng},lh.prototype.getSouth=function(){return this._sw.lat},lh.prototype.getEast=function(){return this._ne.lng},lh.prototype.getNorth=function(){return this._ne.lat},lh.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},lh.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},lh.prototype.isEmpty=function(){return!(this._sw&&this._ne)},lh.prototype.contains=function(_){var I=Hc.convert(_),U=I.lng,$=I.lat,oe=this._sw.lat<=$&&$<=this._ne.lat,he=this._sw.lng<=U&&U<=this._ne.lng;return this._sw.lng>this._ne.lng&&(he=this._sw.lng>=U&&U>=this._ne.lng),oe&&he},lh.convert=function(_){return!_||_ instanceof lh?_:new lh(_)};var nee=63710088e-1,Hc=function(_,I){if(isNaN(_)||isNaN(I))throw new Error("Invalid LngLat object: ("+_+", "+I+")");if(this.lng=+_,this.lat=+I,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Hc.prototype.wrap=function(){return new Hc(k(this.lng,-180,180),this.lat)},Hc.prototype.toArray=function(){return[this.lng,this.lat]},Hc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Hc.prototype.distanceTo=function(_){var I=Math.PI/180,U=this.lat*I,$=_.lat*I,oe=Math.sin(U)*Math.sin($)+Math.cos(U)*Math.cos($)*Math.cos((_.lng-this.lng)*I),he=nee*Math.acos(Math.min(oe,1));return he},Hc.prototype.toBounds=function(_){_===void 0&&(_=0);var I=40075017,U=360*_/I,$=U/Math.cos(Math.PI/180*this.lat);return new lh(new Hc(this.lng-$,this.lat-U),new Hc(this.lng+$,this.lat+U))},Hc.convert=function(_){if(_ instanceof Hc)return _;if(Array.isArray(_)&&(_.length===2||_.length===3))return new Hc(Number(_[0]),Number(_[1]));if(!Array.isArray(_)&&typeof _=="object"&&_!==null)return new Hc(Number("lng"in _?_.lng:_.lon),Number(_.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 aee=2*Math.PI*nee;function oee(y){return aee*Math.cos(y*Math.PI/180)}function see(y){return(180+y)/360}function lee(y){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+y*Math.PI/360)))/360}function uee(y,_){return y/oee(_)}function vtt(y){return y*360-180}function wq(y){var _=180-y*360;return 360/Math.PI*Math.atan(Math.exp(_*Math.PI/180))-90}function ptt(y,_){return y*oee(wq(_))}function gtt(y){return 1/Math.cos(y*Math.PI/180)}var vb=function(_,I,U){U===void 0&&(U=0),this.x=+_,this.y=+I,this.z=+U};vb.fromLngLat=function(_,I){I===void 0&&(I=0);var U=Hc.convert(_);return new vb(see(U.lng),lee(U.lat),uee(I,U.lat))},vb.prototype.toLngLat=function(){return new Hc(vtt(this.x),wq(this.y))},vb.prototype.toAltitude=function(){return ptt(this.z,this.y)},vb.prototype.meterInMercatorCoordinateUnits=function(){return 1/aee*gtt(wq(this.y))};var pb=function(_,I,U){this.z=_,this.x=I,this.y=U,this.key=RS(0,_,_,I,U)};pb.prototype.equals=function(_){return this.z===_.z&&this.x===_.x&&this.y===_.y},pb.prototype.url=function(_,I){var U=dtt(this.x,this.y,this.z),$=mtt(this.z,this.x,this.y);return _[(this.x+this.y)%_.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(I==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",$).replace("{bbox-epsg-3857}",U)},pb.prototype.getTilePoint=function(_){var I=Math.pow(2,this.z);return new u((_.x*I-this.x)*Ei,(_.y*I-this.y)*Ei)},pb.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var cee=function(_,I){this.wrap=_,this.canonical=I,this.key=RS(_,I.z,I.z,I.x,I.y)},uh=function(_,I,U,$,oe){this.overscaledZ=_,this.wrap=I,this.canonical=new pb(U,+$,+oe),this.key=RS(I,_,U,$,oe)};uh.prototype.equals=function(_){return this.overscaledZ===_.overscaledZ&&this.wrap===_.wrap&&this.canonical.equals(_.canonical)},uh.prototype.scaledTo=function(_){var I=this.canonical.z-_;return _>this.canonical.z?new uh(_,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new uh(_,this.wrap,_,this.canonical.x>>I,this.canonical.y>>I)},uh.prototype.calculateScaledKey=function(_,I){var U=this.canonical.z-_;return _>this.canonical.z?RS(this.wrap*+I,_,this.canonical.z,this.canonical.x,this.canonical.y):RS(this.wrap*+I,_,_,this.canonical.x>>U,this.canonical.y>>U)},uh.prototype.isChildOf=function(_){if(_.wrap!==this.wrap)return!1;var I=this.canonical.z-_.canonical.z;return _.overscaledZ===0||_.overscaledZ<this.overscaledZ&&_.canonical.x===this.canonical.x>>I&&_.canonical.y===this.canonical.y>>I},uh.prototype.children=function(_){if(this.overscaledZ>=_)return[new uh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var I=this.canonical.z+1,U=this.canonical.x*2,$=this.canonical.y*2;return[new uh(I,this.wrap,I,U,$),new uh(I,this.wrap,I,U+1,$),new uh(I,this.wrap,I,U,$+1),new uh(I,this.wrap,I,U+1,$+1)]},uh.prototype.isLessThan=function(_){return this.wrap<_.wrap?!0:this.wrap>_.wrap?!1:this.overscaledZ<_.overscaledZ?!0:this.overscaledZ>_.overscaledZ?!1:this.canonical.x<_.canonical.x?!0:this.canonical.x>_.canonical.x?!1:this.canonical.y<_.canonical.y},uh.prototype.wrapped=function(){return new uh(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},uh.prototype.unwrapTo=function(_){return new uh(this.overscaledZ,_,this.canonical.z,this.canonical.x,this.canonical.y)},uh.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},uh.prototype.toUnwrapped=function(){return new cee(this.wrap,this.canonical)},uh.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},uh.prototype.getTilePoint=function(_){return this.canonical.getTilePoint(new vb(_.x-this.wrap,_.y))};function RS(y,_,I,U,$){y*=2,y<0&&(y=y*-1-1);var oe=1<<I;return(oe*oe*y+oe*$+U).toString(36)+I.toString(36)+_.toString(36)}function mtt(y,_,I){for(var U="",$,oe=y;oe>0;oe--)$=1<<oe-1,U+=(_&$?1:0)+(I&$?2:0);return U}X("CanonicalTileID",pb),X("OverscaledTileID",uh,{omit:["posMatrix"]});var by=function(_,I,U){if(this.uid=_,I.height!==I.width)throw new RangeError("DEM tiles must be square");if(U&&U!=="mapbox"&&U!=="terrarium")return ie('"'+U+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=I.height;var $=this.dim=I.height-2;this.data=new Uint32Array(I.data.buffer),this.encoding=U||"mapbox";for(var oe=0;oe<$;oe++)this.data[this._idx(-1,oe)]=this.data[this._idx(0,oe)],this.data[this._idx($,oe)]=this.data[this._idx($-1,oe)],this.data[this._idx(oe,-1)]=this.data[this._idx(oe,0)],this.data[this._idx(oe,$)]=this.data[this._idx(oe,$-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx($,-1)]=this.data[this._idx($-1,0)],this.data[this._idx(-1,$)]=this.data[this._idx(0,$-1)],this.data[this._idx($,$)]=this.data[this._idx($-1,$-1)]};by.prototype.get=function(_,I){var U=new Uint8Array(this.data.buffer),$=this._idx(_,I)*4,oe=this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox;return oe(U[$],U[$+1],U[$+2])},by.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},by.prototype._idx=function(_,I){if(_<-1||_>=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+(_+1)},by.prototype._unpackMapbox=function(_,I,U){return(_*256*256+I*256+U)/10-1e4},by.prototype._unpackTerrarium=function(_,I,U){return _*256+I+U/256-32768},by.prototype.getPixels=function(){return new Eh({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},by.prototype.backfillBorder=function(_,I,U){if(this.dim!==_.dim)throw new Error("dem dimension mismatch");var $=I*this.dim,oe=I*this.dim+this.dim,he=U*this.dim,De=U*this.dim+this.dim;switch(I){case-1:$=oe-1;break;case 1:oe=$+1;break}switch(U){case-1:he=De-1;break;case 1:De=he+1;break}for(var it=-I*this.dim,yt=-U*this.dim,Lt=he;Lt<De;Lt++)for(var sr=$;sr<oe;sr++)this.data[this._idx(sr,Lt)]=_.data[this._idx(sr+it,Lt+yt)]},X("DEMData",by);function ytt(y,_){var I={};if(!_)return I;for(var U=function(){var he=oe[$],De=he.layerIds.map(function(sr){return _.getLayer(sr)}).filter(Boolean);if(De.length!==0){he.layers=De,he.stateDependentLayerIds&&(he.stateDependentLayers=he.stateDependentLayerIds.map(function(sr){return De.filter(function(gr){return gr.id===sr})[0]}));for(var it=0,yt=De;it<yt.length;it+=1){var Lt=yt[it];I[Lt.id]=he}}},$=0,oe=y;$<oe.length;$+=1)U();return I}var f6=function(_){this._stringToNumber={},this._numberToString=[];for(var I=0;I<_.length;I++){var U=_[I];this._stringToNumber[U]=I,this._numberToString[I]=U}};f6.prototype.encode=function(_){return this._stringToNumber[_]},f6.prototype.decode=function(_){return this._numberToString[_]};var h6=function(_,I,U,$,oe){this.type="Feature",this._vectorTileFeature=_,_._z=I,_._x=U,_._y=$,this.properties=_.properties,this.id=oe},Tq={geometry:{configurable:!0}};Tq.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Tq.geometry.set=function(y){this._geometry=y},h6.prototype.toJSON=function(){var _={geometry:this.geometry};for(var I in this)I==="_geometry"||I==="_vectorTileFeature"||(_[I]=this[I]);return _},Object.defineProperties(h6.prototype,Tq);var c3=function(){this.state={},this.stateChanges={},this.deletedStates={}};c3.prototype.updateState=function(_,I,U){var $=String(I);if(this.stateChanges[_]=this.stateChanges[_]||{},this.stateChanges[_][$]=this.stateChanges[_][$]||{},x(this.stateChanges[_][$],U),this.deletedStates[_]===null){this.deletedStates[_]={};for(var oe in this.state[_])oe!==$&&(this.deletedStates[_][oe]=null)}else{var he=this.deletedStates[_]&&this.deletedStates[_][$]===null;if(he){this.deletedStates[_][$]={};for(var De in this.state[_][$])U[De]||(this.deletedStates[_][$][De]=null)}else for(var it in U){var yt=this.deletedStates[_]&&this.deletedStates[_][$]&&this.deletedStates[_][$][it]===null;yt&&delete this.deletedStates[_][$][it]}}},c3.prototype.removeFeatureState=function(_,I,U){var $=this.deletedStates[_]===null;if(!$){var oe=String(I);if(this.deletedStates[_]=this.deletedStates[_]||{},U&&I!==void 0)this.deletedStates[_][oe]!==null&&(this.deletedStates[_][oe]=this.deletedStates[_][oe]||{},this.deletedStates[_][oe][U]=null);else if(I!==void 0){var he=this.stateChanges[_]&&this.stateChanges[_][oe];if(he){this.deletedStates[_][oe]={};for(U in this.stateChanges[_][oe])this.deletedStates[_][oe][U]=null}else this.deletedStates[_][oe]=null}else this.deletedStates[_]=null}},c3.prototype.getState=function(_,I){var U=String(I),$=this.state[_]||{},oe=this.stateChanges[_]||{},he=x({},$[U],oe[U]);if(this.deletedStates[_]===null)return{};if(this.deletedStates[_]){var De=this.deletedStates[_][I];if(De===null)return{};for(var it in De)delete he[it]}return he},c3.prototype.initializeTileState=function(_,I){_.setFeatureState(this.state,I)},c3.prototype.coalesceChanges=function(_,I){var U={};for(var $ in this.stateChanges){this.state[$]=this.state[$]||{};var oe={};for(var he in this.stateChanges[$])this.state[$][he]||(this.state[$][he]={}),x(this.state[$][he],this.stateChanges[$][he]),oe[he]=this.state[$][he];U[$]=oe}for(var De in this.deletedStates){this.state[De]=this.state[De]||{};var it={};if(this.deletedStates[De]===null)for(var yt in this.state[De])it[yt]={},this.state[De][yt]={};else for(var Lt in this.deletedStates[De]){var sr=this.deletedStates[De][Lt]===null;if(sr)this.state[De][Lt]={};else for(var gr=0,hr=Object.keys(this.deletedStates[De][Lt]);gr<hr.length;gr+=1){var Rr=hr[gr];delete this.state[De][Lt][Rr]}it[Lt]=this.state[De][Lt]}U[De]=U[De]||{},x(U[De],it)}if(this.stateChanges={},this.deletedStates={},Object.keys(U).length!==0)for(var ni in _){var Hi=_[ni];Hi.setFeatureState(U,I)}};var wy=function(_,I){this.tileID=_,this.x=_.canonical.x,this.y=_.canonical.y,this.z=_.canonical.z,this.grid=new au(Ei,16,0),this.grid3D=new au(Ei,16,0),this.featureIndexArray=new Ys,this.promoteId=I};wy.prototype.insert=function(_,I,U,$,oe,he){var De=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(U,$,oe);for(var it=he?this.grid3D:this.grid,yt=0;yt<I.length;yt++){for(var Lt=I[yt],sr=[1/0,1/0,-1/0,-1/0],gr=0;gr<Lt.length;gr++){var hr=Lt[gr];sr[0]=Math.min(sr[0],hr.x),sr[1]=Math.min(sr[1],hr.y),sr[2]=Math.max(sr[2],hr.x),sr[3]=Math.max(sr[3],hr.y)}sr[0]<Ei&&sr[1]<Ei&&sr[2]>=0&&sr[3]>=0&&it.insert(De,sr[0],sr[1],sr[2],sr[3])}},wy.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new mg.VectorTile(new Xa(this.rawTileData)).layers,this.sourceLayerCoder=new f6(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},wy.prototype.query=function(_,I,U,$){var oe=this;this.loadVTLayers();for(var he=_.params||{},De=Ei/_.tileSize/_.scale,it=xe(he.filter),yt=_.queryGeometry,Lt=_.queryPadding*De,sr=hee(yt),gr=this.grid.query(sr.minX-Lt,sr.minY-Lt,sr.maxX+Lt,sr.maxY+Lt),hr=hee(_.cameraQueryGeometry),Rr=this.grid3D.query(hr.minX-Lt,hr.minY-Lt,hr.maxX+Lt,hr.maxY+Lt,function(Xn,ga,ha,eo){return mp(_.cameraQueryGeometry,Xn-Lt,ga-Lt,ha+Lt,eo+Lt)}),ni=0,Hi=Rr;ni<Hi.length;ni+=1){var wi=Hi[ni];gr.push(wi)}gr.sort(_tt);for(var bn={},rn,xn=function(Xn){var ga=gr[Xn];if(ga!==rn){rn=ga;var ha=oe.featureIndexArray.get(ga),eo=null;oe.loadMatchingFeature(bn,ha.bucketIndex,ha.sourceLayerIndex,ha.featureIndex,it,he.layers,he.availableImages,I,U,$,function(za,Za,Jo){return eo||(eo=zn(za)),Za.queryIntersectsFeature(yt,za,Jo,eo,oe.z,_.transform,De,_.pixelPosMatrix)})}},In=0;In<gr.length;In++)xn(In);return bn},wy.prototype.loadMatchingFeature=function(_,I,U,$,oe,he,De,it,yt,Lt,sr){var gr=this.bucketLayerIDs[I];if(!(he&&!N(he,gr))){var hr=this.sourceLayerCoder.decode(U),Rr=this.vtLayers[hr],ni=Rr.feature($);if(oe.needGeometry){var Hi=Ja(ni,!0);if(!oe.filter(new Un(this.tileID.overscaledZ),Hi,this.tileID.canonical))return}else if(!oe.filter(new Un(this.tileID.overscaledZ),ni))return;for(var wi=this.getId(ni,hr),bn=0;bn<gr.length;bn++){var rn=gr[bn];if(!(he&&he.indexOf(rn)<0)){var xn=it[rn];if(xn){var In={};wi!==void 0&&Lt&&(In=Lt.getState(xn.sourceLayer||"_geojsonTileLayer",wi));var Xn=x({},yt[rn]);Xn.paint=fee(Xn.paint,xn.paint,ni,In,De),Xn.layout=fee(Xn.layout,xn.layout,ni,In,De);var ga=!sr||sr(ni,xn,In);if(ga){var ha=new h6(ni,this.z,this.x,this.y,wi);ha.layer=Xn;var eo=_[rn];eo===void 0&&(eo=_[rn]=[]),eo.push({featureIndex:$,feature:ha,intersectionZ:ga})}}}}}},wy.prototype.lookupSymbolFeatures=function(_,I,U,$,oe,he,De,it){var yt={};this.loadVTLayers();for(var Lt=xe(oe),sr=0,gr=_;sr<gr.length;sr+=1){var hr=gr[sr];this.loadMatchingFeature(yt,U,$,hr,Lt,he,De,it,I)}return yt},wy.prototype.hasLayer=function(_){for(var I=0,U=this.bucketLayerIDs;I<U.length;I+=1)for(var $=U[I],oe=0,he=$;oe<he.length;oe+=1){var De=he[oe];if(_===De)return!0}return!1},wy.prototype.getId=function(_,I){var U=_.id;if(this.promoteId){var $=typeof this.promoteId=="string"?this.promoteId:this.promoteId[I];U=_.properties[$],typeof U=="boolean"&&(U=Number(U))}return U},X("FeatureIndex",wy,{omit:["rawTileData","sourceLayerCoder"]});function fee(y,_,I,U,$){return G(y,function(oe,he){var De=_ instanceof Sc?_.get(he):null;return De&&De.evaluate?De.evaluate(I,U,$):De})}function hee(y){for(var _=1/0,I=1/0,U=-1/0,$=-1/0,oe=0,he=y;oe<he.length;oe+=1){var De=he[oe];_=Math.min(_,De.x),I=Math.min(I,De.y),U=Math.max(U,De.x),$=Math.max($,De.y)}return{minX:_,minY:I,maxX:U,maxY:$}}function _tt(y,_){return _-y}var xtt=3e4,Jh=function(_,I){this.tileID=_,this.uid=g(),this.uses=0,this.tileSize=I,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};Jh.prototype.registerFadeDuration=function(_){var I=_+this.timeAdded;I<lt.now()||this.fadeEndTime&&I<this.fadeEndTime||(this.fadeEndTime=I)},Jh.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},Jh.prototype.loadVectorData=function(_,I,U){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!_){this.collisionBoxArray=new Ga;return}_.featureIndex&&(this.latestFeatureIndex=_.featureIndex,_.rawTileData?(this.latestRawTileData=_.rawTileData,this.latestFeatureIndex.rawTileData=_.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=_.collisionBoxArray,this.buckets=ytt(_.buckets,I.style),this.hasSymbolBuckets=!1;for(var $ in this.buckets){var oe=this.buckets[$];if(oe instanceof Pu)if(this.hasSymbolBuckets=!0,U)oe.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var he in this.buckets){var De=this.buckets[he];if(De instanceof Pu&&De.hasRTLText){this.hasRTLText=!0,Xs();break}}this.queryPadding=0;for(var it in this.buckets){var yt=this.buckets[it];this.queryPadding=Math.max(this.queryPadding,I.style.getLayer(it).queryRadius(yt))}_.imageAtlas&&(this.imageAtlas=_.imageAtlas),_.glyphAtlasImage&&(this.glyphAtlasImage=_.glyphAtlasImage)},Jh.prototype.unloadVectorData=function(){for(var _ in this.buckets)this.buckets[_].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Jh.prototype.getBucket=function(_){return this.buckets[_.id]},Jh.prototype.upload=function(_){for(var I in this.buckets){var U=this.buckets[I];U.uploadPending()&&U.upload(_)}var $=_.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new db(_,this.imageAtlas.image,$.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new db(_,this.glyphAtlasImage,$.ALPHA),this.glyphAtlasImage=null)},Jh.prototype.prepare=function(_){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(_,this.imageAtlasTexture)},Jh.prototype.queryRenderedFeatures=function(_,I,U,$,oe,he,De,it,yt,Lt){return!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData?{}:this.latestFeatureIndex.query({queryGeometry:$,cameraQueryGeometry:oe,scale:he,tileSize:this.tileSize,pixelPosMatrix:Lt,transform:it,params:De,queryPadding:this.queryPadding*yt},_,I,U)},Jh.prototype.querySourceFeatures=function(_,I){var U=this.latestFeatureIndex;if(!(!U||!U.rawTileData)){var $=U.loadVTLayers(),oe=I?I.sourceLayer:"",he=$._geojsonTileLayer||$[oe];if(he)for(var De=xe(I&&I.filter),it=this.tileID.canonical,yt=it.z,Lt=it.x,sr=it.y,gr={z:yt,x:Lt,y:sr},hr=0;hr<he.length;hr++){var Rr=he.feature(hr);if(De.needGeometry){var ni=Ja(Rr,!0);if(!De.filter(new Un(this.tileID.overscaledZ),ni,this.tileID.canonical))continue}else if(!De.filter(new Un(this.tileID.overscaledZ),Rr))continue;var Hi=U.getId(Rr,oe),wi=new h6(Rr,yt,Lt,sr,Hi);wi.tile=gr,_.push(wi)}}},Jh.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},Jh.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Jh.prototype.setExpiryData=function(_){var I=this.expirationTime;if(_.cacheControl){var U=ge(_.cacheControl);U["max-age"]&&(this.expirationTime=Date.now()+U["max-age"]*1e3)}else _.expires&&(this.expirationTime=new Date(_.expires).getTime());if(this.expirationTime){var $=Date.now(),oe=!1;if(this.expirationTime>$)oe=!1;else if(!I)oe=!0;else if(this.expirationTime<I)oe=!0;else{var he=this.expirationTime-I;he?this.expirationTime=$+Math.max(he,xtt):oe=!0}oe?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Jh.prototype.getExpiryTimeout=function(){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)},Jh.prototype.setFeatureState=function(_,I){if(!(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(_).length===0)){var U=this.latestFeatureIndex.loadVTLayers();for(var $ in this.buckets)if(I.style.hasLayer($)){var oe=this.buckets[$],he=oe.layers[0].sourceLayer||"_geojsonTileLayer",De=U[he],it=_[he];if(!(!De||!it||Object.keys(it).length===0)){oe.update(it,De,this.imageAtlas&&this.imageAtlas.patternPositions||{});var yt=I&&I.style&&I.style.getLayer($);yt&&(this.queryPadding=Math.max(this.queryPadding,yt.queryRadius(oe)))}}}},Jh.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},Jh.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<lt.now()},Jh.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Jh.prototype.setHoldDuration=function(_){this.symbolFadeHoldUntil=lt.now()+_},Jh.prototype.setDependencies=function(_,I){for(var U={},$=0,oe=I;$<oe.length;$+=1){var he=oe[$];U[he]=!0}this.dependencies[_]=U},Jh.prototype.hasDependency=function(_,I){for(var U=0,$=_;U<$.length;U+=1){var oe=$[U],he=this.dependencies[oe];if(he)for(var De=0,it=I;De<it.length;De+=1){var yt=it[De];if(he[yt])return!0}}return!1};var btt=["type","source","source-layer","minzoom","maxzoom","filter","layout"],U1=f.performance,dee=function(_){this._marks={start:[_.url,"start"].join("#"),end:[_.url,"end"].join("#"),measure:_.url.toString()},U1.mark(this._marks.start)};dee.prototype.finish=function(){U1.mark(this._marks.end);var _=U1.getEntriesByName(this._marks.measure);return _.length===0&&(U1.measure(this._marks.measure,this._marks.start,this._marks.end),_=U1.getEntriesByName(this._marks.measure),U1.clearMarks(this._marks.start),U1.clearMarks(this._marks.end),U1.clearMeasures(this._marks.measure)),_},i.Actor=u3,i.AlphaImage=Dv,i.CanonicalTileID=pb,i.CollisionBoxArray=Ga,i.Color=cs,i.DEMData=by,i.DataConstantProperty=Me,i.DictionaryCoder=f6,i.EXTENT=Ei,i.ErrorEvent=da,i.EvaluationParameters=Un,i.Event=Xo,i.Evented=jn,i.FeatureIndex=wy,i.FillBucket=yp,i.FillExtrusionBucket=Vp,i.ImageAtlas=yg,i.ImagePosition=Yf,i.LineBucket=sh,i.LngLat=Hc,i.LngLatBounds=lh,i.MercatorCoordinate=vb,i.ONE_EM=Tn,i.OverscaledTileID=uh,i.Point=u,i.Point$1=u,i.Properties=Or,i.Protobuf=Xa,i.RGBAImage=Eh,i.RequestManager=Ae,i.RequestPerformance=dee,i.ResourceType=Kn,i.SegmentVector=io,i.SourceFeatureState=c3,i.StructArrayLayout1ui2=ba,i.StructArrayLayout2f1f2i16=Ui,i.StructArrayLayout2i4=Zr,i.StructArrayLayout3ui6=pn,i.StructArrayLayout4i8=yi,i.SymbolBucket=Pu,i.Texture=db,i.Tile=Jh,i.Transitionable=Uo,i.Uniform1f=$e,i.Uniform1i=Ne,i.Uniform2f=st,i.Uniform3f=It,i.Uniform4f=Bt,i.UniformColor=Ft,i.UniformMatrix4f=zt,i.UnwrappedTileID=cee,i.ValidationError=_a,i.WritingMode=cv,i.ZoomHistory=Pt,i.add=Rv,i.addDynamicAttributes=_q,i.asyncAll=M,i.bezier=m,i.bindAll=q,i.browser=lt,i.cacheEntryPossiblyAdded=un,i.clamp=p,i.clearTileCache=An,i.clipLine=XQ,i.clone=C1,i.clone$1=j,i.clone$2=Bw,i.collisionCircleLayout=Rt,i.config=mt,i.create=k1,i.create$1=Zh,i.create$2=vg,i.createCommonjsModule=a,i.createExpression=oo,i.createLayout=ji,i.createStyleLayer=htt,i.cross=j9,i.deepEqual=h,i.dot=H9,i.dot$1=K9,i.ease=b,i.emitValidationErrors=Lu,i.endsWith=V,i.enforceCacheSizeLimit=Fn,i.evaluateSizeForFeature=NQ,i.evaluateSizeForZoom=UQ,i.evaluateVariableOffset=KQ,i.evented=Ia,i.extend=x,i.featureFilter=xe,i.filterObject=Z,i.fromRotation=am,i.getAnchorAlignment=LS,i.getAnchorJustification=yq,i.getArrayBuffer=ti,i.getImage=ua,i.getJSON=Xr,i.getRTLTextPluginStatus=yo,i.getReferrer=Gt,i.getVideo=ma,i.identity=vy,i.invert=om,i.isChar=ot,i.isMapboxURL=rt,i.keysDifference=L,i.makeRequest=wr,i.mapObject=G,i.mercatorXfromLng=see,i.mercatorYfromLat=lee,i.mercatorZfromAltitude=uee,i.mul=Kx,i.multiply=sm,i.mvt=mg,i.nextPowerOfTwo=E,i.normalize=Jx,i.number=nl,i.offscreenCanvasSupported=Vi,i.ortho=wu,i.parseGlyphPBF=p0,i.pbf=Xa,i.performSymbolLayout=Wet,i.perspective=L1,i.pick=C,i.plugin=Ms,i.polygonIntersectsPolygon=so,i.postMapLoadEvent=We,i.postTurnstileEvent=Ge,i.potpack=ep,i.refProperties=btt,i.register=X,i.registerForPluginStateChange=Da,i.renderColorRamp=eb,i.rotate=dy,i.rotateX=Sd,i.rotateZ=py,i.scale=tu,i.scale$1=Y9,i.scale$2=Nw,i.setCacheLimits=Hn,i.setRTLTextPlugin=go,i.sphericalToCartesian=Ee,i.sqrLen=cS,i.styleSpec=Rn,i.sub=X9,i.symbolSize=qet,i.transformMat3=W9,i.transformMat4=gy,i.translate=vc,i.triggerPluginCompletionEvent=na,i.uniqueId=g,i.validateCustomStyleLayer=utt,i.validateLight=To,i.validateStyle=wo,i.values=T,i.vectorTile=mg,i.version=o,i.warnOnce=ie,i.webpSupported=Ht,i.window=f,i.wrap=k}),n(["./shared"],function(i){"use strict";function a(Gt){var wt=typeof Gt;if(wt==="number"||wt==="boolean"||wt==="string"||Gt===void 0||Gt===null)return JSON.stringify(Gt);if(Array.isArray(Gt)){for(var tr="[",ir=0,wr=Gt;ir<wr.length;ir+=1){var Xr=wr[ir];tr+=a(Xr)+","}return tr+"]"}for(var ti=Object.keys(Gt).sort(),$r="{",Ri=0;Ri<ti.length;Ri++)$r+=JSON.stringify(ti[Ri])+":"+a(Gt[ti[Ri]])+",";return $r+"}"}function o(Gt){for(var wt="",tr=0,ir=i.refProperties;tr<ir.length;tr+=1){var wr=ir[tr];wt+="/"+a(Gt[wr])}return wt}function s(Gt,wt){for(var tr={},ir=0;ir<Gt.length;ir++){var wr=wt&&wt[Gt[ir].id]||o(Gt[ir]);wt&&(wt[Gt[ir].id]=wr);var Xr=tr[wr];Xr||(Xr=tr[wr]=[]),Xr.push(Gt[ir])}var ti=[];for(var $r in tr)ti.push(tr[$r]);return ti}var l=function(wt){this.keyCache={},wt&&this.replace(wt)};l.prototype.replace=function(wt){this._layerConfigs={},this._layers={},this.update(wt,[])},l.prototype.update=function(wt,tr){for(var ir=this,wr=0,Xr=wt;wr<Xr.length;wr+=1){var ti=Xr[wr];this._layerConfigs[ti.id]=ti;var $r=this._layers[ti.id]=i.createStyleLayer(ti);$r._featureFilter=i.featureFilter($r.filter),this.keyCache[ti.id]&&delete this.keyCache[ti.id]}for(var Ri=0,Zi=tr;Ri<Zi.length;Ri+=1){var en=Zi[Ri];delete this.keyCache[en],delete this._layerConfigs[en],delete this._layers[en]}this.familiesBySource={};for(var fn=s(i.values(this._layerConfigs),this.keyCache),yn=0,Mn=fn;yn<Mn.length;yn+=1){var Ba=Mn[yn],ua=Ba.map(function(jn){return ir._layers[jn.id]}),ma=ua[0];if(ma.visibility!=="none"){var Wa=ma.source||"",Fa=this.familiesBySource[Wa];Fa||(Fa=this.familiesBySource[Wa]={});var Xo=ma.sourceLayer||"_geojsonTileLayer",da=Fa[Xo];da||(da=Fa[Xo]=[]),da.push(ua)}}};var u=1,c=function(wt){var tr={},ir=[];for(var wr in wt){var Xr=wt[wr],ti=tr[wr]={};for(var $r in Xr){var Ri=Xr[+$r];if(!(!Ri||Ri.bitmap.width===0||Ri.bitmap.height===0)){var Zi={x:0,y:0,w:Ri.bitmap.width+2*u,h:Ri.bitmap.height+2*u};ir.push(Zi),ti[$r]={rect:Zi,metrics:Ri.metrics}}}}var en=i.potpack(ir),fn=en.w,yn=en.h,Mn=new i.AlphaImage({width:fn||1,height:yn||1});for(var Ba in wt){var ua=wt[Ba];for(var ma in ua){var Wa=ua[+ma];if(!(!Wa||Wa.bitmap.width===0||Wa.bitmap.height===0)){var Fa=tr[Ba][ma].rect;i.AlphaImage.copy(Wa.bitmap,Mn,{x:0,y:0},{x:Fa.x+u,y:Fa.y+u},Wa.bitmap)}}}this.image=Mn,this.positions=tr};i.register("GlyphAtlas",c);var f=function(wt){this.tileID=new i.OverscaledTileID(wt.tileID.overscaledZ,wt.tileID.wrap,wt.tileID.canonical.z,wt.tileID.canonical.x,wt.tileID.canonical.y),this.uid=wt.uid,this.zoom=wt.zoom,this.pixelRatio=wt.pixelRatio,this.tileSize=wt.tileSize,this.source=wt.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=wt.showCollisionBoxes,this.collectResourceTiming=!!wt.collectResourceTiming,this.returnDependencies=!!wt.returnDependencies,this.promoteId=wt.promoteId};f.prototype.parse=function(wt,tr,ir,wr,Xr){var ti=this;this.status="parsing",this.data=wt,this.collisionBoxArray=new i.CollisionBoxArray;var $r=new i.DictionaryCoder(Object.keys(wt.layers).sort()),Ri=new i.FeatureIndex(this.tileID,this.promoteId);Ri.bucketLayerIDs=[];var Zi={},en={featureIndex:Ri,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:ir},fn=tr.familiesBySource[this.source];for(var yn in fn){var Mn=wt.layers[yn];if(Mn){Mn.version===1&&i.warnOnce('Vector tile source "'+this.source+'" layer "'+yn+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var Ba=$r.encode(yn),ua=[],ma=0;ma<Mn.length;ma++){var Wa=Mn.feature(ma),Fa=Ri.getId(Wa,yn);ua.push({feature:Wa,id:Fa,index:ma,sourceLayerIndex:Ba})}for(var Xo=0,da=fn[yn];Xo<da.length;Xo+=1){var jn=da[Xo],Ha=jn[0];if(!(Ha.minzoom&&this.zoom<Math.floor(Ha.minzoom))&&!(Ha.maxzoom&&this.zoom>=Ha.maxzoom)&&Ha.visibility!=="none"){h(jn,this.zoom,ir);var vo=Zi[Ha.id]=Ha.createBucket({index:Ri.bucketLayerIDs.length,layers:jn,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Ba,sourceID:this.source});vo.populate(ua,en,this.tileID.canonical),Ri.bucketLayerIDs.push(jn.map(function(ki){return ki.id}))}}}}var Gn,Ct,Sr,Jr,hi=i.mapObject(en.glyphDependencies,function(ki){return Object.keys(ki).map(Number)});Object.keys(hi).length?wr.send("getGlyphs",{uid:this.uid,stacks:hi},function(ki,_n){Gn||(Gn=ki,Ct=_n,En.call(ti))}):Ct={};var hn=Object.keys(en.iconDependencies);hn.length?wr.send("getImages",{icons:hn,source:this.source,tileID:this.tileID,type:"icons"},function(ki,_n){Gn||(Gn=ki,Sr=_n,En.call(ti))}):Sr={};var Sn=Object.keys(en.patternDependencies);Sn.length?wr.send("getImages",{icons:Sn,source:this.source,tileID:this.tileID,type:"patterns"},function(ki,_n){Gn||(Gn=ki,Jr=_n,En.call(ti))}):Jr={},En.call(this);function En(){if(Gn)return Xr(Gn);if(Ct&&Sr&&Jr){var ki=new c(Ct),_n=new i.ImageAtlas(Sr,Jr);for(var ya in Zi){var ea=Zi[ya];ea instanceof i.SymbolBucket?(h(ea.layers,this.zoom,ir),i.performSymbolLayout(ea,Ct,ki.positions,Sr,_n.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):ea.hasPattern&&(ea instanceof i.LineBucket||ea instanceof i.FillBucket||ea instanceof i.FillExtrusionBucket)&&(h(ea.layers,this.zoom,ir),ea.addFeatures(en,this.tileID.canonical,_n.patternPositions))}this.status="done",Xr(null,{buckets:i.values(Zi).filter(function(Ma){return!Ma.isEmpty()}),featureIndex:Ri,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ki.image,imageAtlas:_n,glyphMap:this.returnDependencies?Ct:null,iconMap:this.returnDependencies?Sr:null,glyphPositions:this.returnDependencies?ki.positions:null})}}};function h(Gt,wt,tr){for(var ir=new i.EvaluationParameters(wt),wr=0,Xr=Gt;wr<Xr.length;wr+=1){var ti=Xr[wr];ti.recalculate(ir,tr)}}function d(Gt,wt){var tr=i.getArrayBuffer(Gt.request,function(ir,wr,Xr,ti){ir?wt(ir):wr&&wt(null,{vectorTile:new i.vectorTile.VectorTile(new i.pbf(wr)),rawData:wr,cacheControl:Xr,expires:ti})});return function(){tr.cancel(),wt()}}var v=function(wt,tr,ir,wr){this.actor=wt,this.layerIndex=tr,this.availableImages=ir,this.loadVectorData=wr||d,this.loading={},this.loaded={}};v.prototype.loadTile=function(wt,tr){var ir=this,wr=wt.uid;this.loading||(this.loading={});var Xr=wt&&wt.request&&wt.request.collectResourceTiming?new i.RequestPerformance(wt.request):!1,ti=this.loading[wr]=new f(wt);ti.abort=this.loadVectorData(wt,function($r,Ri){if(delete ir.loading[wr],$r||!Ri)return ti.status="done",ir.loaded[wr]=ti,tr($r);var Zi=Ri.rawData,en={};Ri.expires&&(en.expires=Ri.expires),Ri.cacheControl&&(en.cacheControl=Ri.cacheControl);var fn={};if(Xr){var yn=Xr.finish();yn&&(fn.resourceTiming=JSON.parse(JSON.stringify(yn)))}ti.vectorTile=Ri.vectorTile,ti.parse(Ri.vectorTile,ir.layerIndex,ir.availableImages,ir.actor,function(Mn,Ba){if(Mn||!Ba)return tr(Mn);tr(null,i.extend({rawTileData:Zi.slice(0)},Ba,en,fn))}),ir.loaded=ir.loaded||{},ir.loaded[wr]=ti})},v.prototype.reloadTile=function(wt,tr){var ir=this,wr=this.loaded,Xr=wt.uid,ti=this;if(wr&&wr[Xr]){var $r=wr[Xr];$r.showCollisionBoxes=wt.showCollisionBoxes;var Ri=function(Zi,en){var fn=$r.reloadCallback;fn&&(delete $r.reloadCallback,$r.parse($r.vectorTile,ti.layerIndex,ir.availableImages,ti.actor,fn)),tr(Zi,en)};$r.status==="parsing"?$r.reloadCallback=Ri:$r.status==="done"&&($r.vectorTile?$r.parse($r.vectorTile,this.layerIndex,this.availableImages,this.actor,Ri):Ri())}},v.prototype.abortTile=function(wt,tr){var ir=this.loading,wr=wt.uid;ir&&ir[wr]&&ir[wr].abort&&(ir[wr].abort(),delete ir[wr]),tr()},v.prototype.removeTile=function(wt,tr){var ir=this.loaded,wr=wt.uid;ir&&ir[wr]&&delete ir[wr],tr()};var m=i.window.ImageBitmap,b=function(){this.loaded={}};b.prototype.loadTile=function(wt,tr){var ir=wt.uid,wr=wt.encoding,Xr=wt.rawImageData,ti=m&&Xr instanceof m?this.getImageData(Xr):Xr,$r=new i.DEMData(ir,ti,wr);this.loaded=this.loaded||{},this.loaded[ir]=$r,tr(null,$r)},b.prototype.getImageData=function(wt){(!this.offscreenCanvas||!this.offscreenCanvasContext)&&(this.offscreenCanvas=new OffscreenCanvas(wt.width,wt.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=wt.width,this.offscreenCanvas.height=wt.height,this.offscreenCanvasContext.drawImage(wt,0,0,wt.width,wt.height);var tr=this.offscreenCanvasContext.getImageData(-1,-1,wt.width+2,wt.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new i.RGBAImage({width:tr.width,height:tr.height},tr.data)},b.prototype.removeTile=function(wt){var tr=this.loaded,ir=wt.uid;tr&&tr[ir]&&delete tr[ir]};var p=k;function k(Gt,wt){var tr=Gt&&Gt.type,ir;if(tr==="FeatureCollection")for(ir=0;ir<Gt.features.length;ir++)k(Gt.features[ir],wt);else if(tr==="GeometryCollection")for(ir=0;ir<Gt.geometries.length;ir++)k(Gt.geometries[ir],wt);else if(tr==="Feature")k(Gt.geometry,wt);else if(tr==="Polygon")M(Gt.coordinates,wt);else if(tr==="MultiPolygon")for(ir=0;ir<Gt.coordinates.length;ir++)M(Gt.coordinates[ir],wt);return Gt}function M(Gt,wt){if(Gt.length!==0){T(Gt[0],wt);for(var tr=1;tr<Gt.length;tr++)T(Gt[tr],!wt)}}function T(Gt,wt){for(var tr=0,ir=0,wr=Gt.length,Xr=wr-1;ir<wr;Xr=ir++)tr+=(Gt[ir][0]-Gt[Xr][0])*(Gt[Xr][1]+Gt[ir][1]);tr>=0!=!!wt&&Gt.reverse()}var L=i.vectorTile.VectorTileFeature.prototype.toGeoJSON,x=function(wt){this._feature=wt,this.extent=i.EXTENT,this.type=wt.type,this.properties=wt.tags,"id"in wt&&!isNaN(wt.id)&&(this.id=parseInt(wt.id,10))};x.prototype.loadGeometry=function(){if(this._feature.type===1){for(var wt=[],tr=0,ir=this._feature.geometry;tr<ir.length;tr+=1){var wr=ir[tr];wt.push([new i.Point$1(wr[0],wr[1])])}return wt}else{for(var Xr=[],ti=0,$r=this._feature.geometry;ti<$r.length;ti+=1){for(var Ri=$r[ti],Zi=[],en=0,fn=Ri;en<fn.length;en+=1){var yn=fn[en];Zi.push(new i.Point$1(yn[0],yn[1]))}Xr.push(Zi)}return Xr}},x.prototype.toGeoJSON=function(wt,tr,ir){return L.call(this,wt,tr,ir)};var C=function(wt){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=i.EXTENT,this.length=wt.length,this._features=wt};C.prototype.feature=function(wt){return new x(this._features[wt])};var S=i.vectorTile.VectorTileFeature,g=P;function P(Gt,wt){this.options=wt||{},this.features=Gt,this.length=Gt.length}P.prototype.feature=function(Gt){return new E(this.features[Gt],this.options.extent)};function E(Gt,wt){this.id=typeof Gt.id=="number"?Gt.id:void 0,this.type=Gt.type,this.rawGeometry=Gt.type===1?[Gt.geometry]:Gt.geometry,this.properties=Gt.tags,this.extent=wt||4096}E.prototype.loadGeometry=function(){var Gt=this.rawGeometry;this.geometry=[];for(var wt=0;wt<Gt.length;wt++){for(var tr=Gt[wt],ir=[],wr=0;wr<tr.length;wr++)ir.push(new i.Point$1(tr[wr][0],tr[wr][1]));this.geometry.push(ir)}return this.geometry},E.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Gt=this.geometry,wt=1/0,tr=-1/0,ir=1/0,wr=-1/0,Xr=0;Xr<Gt.length;Xr++)for(var ti=Gt[Xr],$r=0;$r<ti.length;$r++){var Ri=ti[$r];wt=Math.min(wt,Ri.x),tr=Math.max(tr,Ri.x),ir=Math.min(ir,Ri.y),wr=Math.max(wr,Ri.y)}return[wt,ir,tr,wr]},E.prototype.toGeoJSON=S.prototype.toGeoJSON;var z=Z,q=Z,V=j,G=g;function Z(Gt){var wt=new i.pbf;return N(Gt,wt),wt.finish()}function j(Gt,wt){wt=wt||{};var tr={};for(var ir in Gt)tr[ir]=new g(Gt[ir].features,wt),tr[ir].name=ir,tr[ir].version=wt.version,tr[ir].extent=wt.extent;return Z({layers:tr})}function N(Gt,wt){for(var tr in Gt.layers)wt.writeMessage(3,H,Gt.layers[tr])}function H(Gt,wt){wt.writeVarintField(15,Gt.version||1),wt.writeStringField(1,Gt.name||""),wt.writeVarintField(5,Gt.extent||4096);var tr,ir={keys:[],values:[],keycache:{},valuecache:{}};for(tr=0;tr<Gt.length;tr++)ir.feature=Gt.feature(tr),wt.writeMessage(2,ie,ir);var wr=ir.keys;for(tr=0;tr<wr.length;tr++)wt.writeStringField(3,wr[tr]);var Xr=ir.values;for(tr=0;tr<Xr.length;tr++)wt.writeMessage(4,ge,Xr[tr])}function ie(Gt,wt){var tr=Gt.feature;tr.id!==void 0&&wt.writeVarintField(1,tr.id),wt.writeMessage(2,ae,Gt),wt.writeVarintField(3,tr.type),wt.writeMessage(4,Ce,tr)}function ae(Gt,wt){var tr=Gt.feature,ir=Gt.keys,wr=Gt.values,Xr=Gt.keycache,ti=Gt.valuecache;for(var $r in tr.properties){var Ri=Xr[$r];typeof Ri=="undefined"&&(ir.push($r),Ri=ir.length-1,Xr[$r]=Ri),wt.writeVarint(Ri);var Zi=tr.properties[$r],en=typeof Zi;en!=="string"&&en!=="boolean"&&en!=="number"&&(Zi=JSON.stringify(Zi));var fn=en+":"+Zi,yn=ti[fn];typeof yn=="undefined"&&(wr.push(Zi),yn=wr.length-1,ti[fn]=yn),wt.writeVarint(yn)}}function _e(Gt,wt){return(wt<<3)+(Gt&7)}function Ee(Gt){return Gt<<1^Gt>>31}function Ce(Gt,wt){for(var tr=Gt.loadGeometry(),ir=Gt.type,wr=0,Xr=0,ti=tr.length,$r=0;$r<ti;$r++){var Ri=tr[$r],Zi=1;ir===1&&(Zi=Ri.length),wt.writeVarint(_e(1,Zi));for(var en=ir===3?Ri.length-1:Ri.length,fn=0;fn<en;fn++){fn===1&&ir!==1&&wt.writeVarint(_e(2,en-1));var yn=Ri[fn].x-wr,Mn=Ri[fn].y-Xr;wt.writeVarint(Ee(yn)),wt.writeVarint(Ee(Mn)),wr+=yn,Xr+=Mn}ir===3&&wt.writeVarint(_e(7,1))}}function ge(Gt,wt){var tr=typeof Gt;tr==="string"?wt.writeStringField(1,Gt):tr==="boolean"?wt.writeBooleanField(7,Gt):tr==="number"&&(Gt%1!==0?wt.writeDoubleField(3,Gt):Gt<0?wt.writeSVarintField(6,Gt):wt.writeVarintField(5,Gt))}z.fromVectorTileJs=q,z.fromGeojsonVt=V,z.GeoJSONWrapper=G;function re(Gt,wt,tr,ir,wr,Xr){if(!(wr-ir<=tr)){var ti=ir+wr>>1;Se(Gt,wt,ti,ir,wr,Xr%2),re(Gt,wt,tr,ir,ti-1,Xr+1),re(Gt,wt,tr,ti+1,wr,Xr+1)}}function Se(Gt,wt,tr,ir,wr,Xr){for(;wr>ir;){if(wr-ir>600){var ti=wr-ir+1,$r=tr-ir+1,Ri=Math.log(ti),Zi=.5*Math.exp(2*Ri/3),en=.5*Math.sqrt(Ri*Zi*(ti-Zi)/ti)*($r-ti/2<0?-1:1),fn=Math.max(ir,Math.floor(tr-$r*Zi/ti+en)),yn=Math.min(wr,Math.floor(tr+(ti-$r)*Zi/ti+en));Se(Gt,wt,tr,fn,yn,Xr)}var Mn=wt[2*tr+Xr],Ba=ir,ua=wr;for(ke(Gt,wt,ir,tr),wt[2*wr+Xr]>Mn&&ke(Gt,wt,ir,wr);Ba<ua;){for(ke(Gt,wt,Ba,ua),Ba++,ua--;wt[2*Ba+Xr]<Mn;)Ba++;for(;wt[2*ua+Xr]>Mn;)ua--}wt[2*ir+Xr]===Mn?ke(Gt,wt,ir,ua):(ua++,ke(Gt,wt,ua,wr)),ua<=tr&&(ir=ua+1),tr<=ua&&(wr=ua-1)}}function ke(Gt,wt,tr,ir){be(Gt,tr,ir),be(wt,2*tr,2*ir),be(wt,2*tr+1,2*ir+1)}function be(Gt,wt,tr){var ir=Gt[wt];Gt[wt]=Gt[tr],Gt[tr]=ir}function Be(Gt,wt,tr,ir,wr,Xr,ti){for(var $r=[0,Gt.length-1,0],Ri=[],Zi,en;$r.length;){var fn=$r.pop(),yn=$r.pop(),Mn=$r.pop();if(yn-Mn<=ti){for(var Ba=Mn;Ba<=yn;Ba++)Zi=wt[2*Ba],en=wt[2*Ba+1],Zi>=tr&&Zi<=wr&&en>=ir&&en<=Xr&&Ri.push(Gt[Ba]);continue}var ua=Math.floor((Mn+yn)/2);Zi=wt[2*ua],en=wt[2*ua+1],Zi>=tr&&Zi<=wr&&en>=ir&&en<=Xr&&Ri.push(Gt[ua]);var ma=(fn+1)%2;(fn===0?tr<=Zi:ir<=en)&&($r.push(Mn),$r.push(ua-1),$r.push(ma)),(fn===0?wr>=Zi:Xr>=en)&&($r.push(ua+1),$r.push(yn),$r.push(ma))}return Ri}function Le(Gt,wt,tr,ir,wr,Xr){for(var ti=[0,Gt.length-1,0],$r=[],Ri=wr*wr;ti.length;){var Zi=ti.pop(),en=ti.pop(),fn=ti.pop();if(en-fn<=Xr){for(var yn=fn;yn<=en;yn++)me(wt[2*yn],wt[2*yn+1],tr,ir)<=Ri&&$r.push(Gt[yn]);continue}var Mn=Math.floor((fn+en)/2),Ba=wt[2*Mn],ua=wt[2*Mn+1];me(Ba,ua,tr,ir)<=Ri&&$r.push(Gt[Mn]);var ma=(Zi+1)%2;(Zi===0?tr-wr<=Ba:ir-wr<=ua)&&(ti.push(fn),ti.push(Mn-1),ti.push(ma)),(Zi===0?tr+wr>=Ba:ir+wr>=ua)&&(ti.push(Mn+1),ti.push(en),ti.push(ma))}return $r}function me(Gt,wt,tr,ir){var wr=Gt-tr,Xr=wt-ir;return wr*wr+Xr*Xr}var Pe=function(Gt){return Gt[0]},ce=function(Gt){return Gt[1]},He=function(wt,tr,ir,wr,Xr){tr===void 0&&(tr=Pe),ir===void 0&&(ir=ce),wr===void 0&&(wr=64),Xr===void 0&&(Xr=Float64Array),this.nodeSize=wr,this.points=wt;for(var ti=wt.length<65536?Uint16Array:Uint32Array,$r=this.ids=new ti(wt.length),Ri=this.coords=new Xr(wt.length*2),Zi=0;Zi<wt.length;Zi++)$r[Zi]=Zi,Ri[2*Zi]=tr(wt[Zi]),Ri[2*Zi+1]=ir(wt[Zi]);re($r,Ri,wr,0,$r.length-1,0)};He.prototype.range=function(wt,tr,ir,wr){return Be(this.ids,this.coords,wt,tr,ir,wr,this.nodeSize)},He.prototype.within=function(wt,tr,ir){return Le(this.ids,this.coords,wt,tr,ir,this.nodeSize)};var lt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(Gt){return Gt}},mt=function(wt){this.options=Ue(Object.create(lt),wt),this.trees=new Array(this.options.maxZoom+1)};mt.prototype.load=function(wt){var tr=this.options,ir=tr.log,wr=tr.minZoom,Xr=tr.maxZoom,ti=tr.nodeSize;ir&&console.time("total time");var $r="prepare "+wt.length+" points";ir&&console.time($r),this.points=wt;for(var Ri=[],Zi=0;Zi<wt.length;Zi++)wt[Zi].geometry&&Ri.push(at(wt[Zi],Zi));this.trees[Xr+1]=new He(Ri,Ae,rt,ti,Float32Array),ir&&console.timeEnd($r);for(var en=Xr;en>=wr;en--){var fn=+Date.now();Ri=this._cluster(Ri,en),this.trees[en]=new He(Ri,Ae,rt,ti,Float32Array),ir&&console.log("z%d: %d clusters in %dms",en,Ri.length,+Date.now()-fn)}return ir&&console.timeEnd("total time"),this},mt.prototype.getClusters=function(wt,tr){var ir=((wt[0]+180)%360+360)%360-180,wr=Math.max(-90,Math.min(90,wt[1])),Xr=wt[2]===180?180:((wt[2]+180)%360+360)%360-180,ti=Math.max(-90,Math.min(90,wt[3]));if(wt[2]-wt[0]>=360)ir=-180,Xr=180;else if(ir>Xr){var $r=this.getClusters([ir,wr,180,ti],tr),Ri=this.getClusters([-180,wr,Xr,ti],tr);return $r.concat(Ri)}for(var Zi=this.trees[this._limitZoom(tr)],en=Zi.range(Vt(ir),rr(ti),Vt(Xr),rr(wr)),fn=[],yn=0,Mn=en;yn<Mn.length;yn+=1){var Ba=Mn[yn],ua=Zi.points[Ba];fn.push(ua.numPoints?ct(ua):this.points[ua.index])}return fn},mt.prototype.getChildren=function(wt){var tr=this._getOriginId(wt),ir=this._getOriginZoom(wt),wr="No cluster with the specified id.",Xr=this.trees[ir];if(!Xr)throw new Error(wr);var ti=Xr.points[tr];if(!ti)throw new Error(wr);for(var $r=this.options.radius/(this.options.extent*Math.pow(2,ir-1)),Ri=Xr.within(ti.x,ti.y,$r),Zi=[],en=0,fn=Ri;en<fn.length;en+=1){var yn=fn[en],Mn=Xr.points[yn];Mn.parentId===wt&&Zi.push(Mn.numPoints?ct(Mn):this.points[Mn.index])}if(Zi.length===0)throw new Error(wr);return Zi},mt.prototype.getLeaves=function(wt,tr,ir){tr=tr||10,ir=ir||0;var wr=[];return this._appendLeaves(wr,wt,tr,ir,0),wr},mt.prototype.getTile=function(wt,tr,ir){var wr=this.trees[this._limitZoom(wt)],Xr=Math.pow(2,wt),ti=this.options,$r=ti.extent,Ri=ti.radius,Zi=Ri/$r,en=(ir-Zi)/Xr,fn=(ir+1+Zi)/Xr,yn={features:[]};return this._addTileFeatures(wr.range((tr-Zi)/Xr,en,(tr+1+Zi)/Xr,fn),wr.points,tr,ir,Xr,yn),tr===0&&this._addTileFeatures(wr.range(1-Zi/Xr,en,1,fn),wr.points,Xr,ir,Xr,yn),tr===Xr-1&&this._addTileFeatures(wr.range(0,en,Zi/Xr,fn),wr.points,-1,ir,Xr,yn),yn.features.length?yn:null},mt.prototype.getClusterExpansionZoom=function(wt){for(var tr=this._getOriginZoom(wt)-1;tr<=this.options.maxZoom;){var ir=this.getChildren(wt);if(tr++,ir.length!==1)break;wt=ir[0].properties.cluster_id}return tr},mt.prototype._appendLeaves=function(wt,tr,ir,wr,Xr){for(var ti=this.getChildren(tr),$r=0,Ri=ti;$r<Ri.length;$r+=1){var Zi=Ri[$r],en=Zi.properties;if(en&&en.cluster?Xr+en.point_count<=wr?Xr+=en.point_count:Xr=this._appendLeaves(wt,en.cluster_id,ir,wr,Xr):Xr<wr?Xr++:wt.push(Zi),wt.length===ir)break}return Xr},mt.prototype._addTileFeatures=function(wt,tr,ir,wr,Xr,ti){for(var $r=0,Ri=wt;$r<Ri.length;$r+=1){var Zi=Ri[$r],en=tr[Zi],fn=en.numPoints,yn={type:1,geometry:[[Math.round(this.options.extent*(en.x*Xr-ir)),Math.round(this.options.extent*(en.y*Xr-wr))]],tags:fn?ar(en):this.points[en.index].properties},Mn=void 0;fn?Mn=en.id:this.options.generateId?Mn=en.index:this.points[en.index].id&&(Mn=this.points[en.index].id),Mn!==void 0&&(yn.id=Mn),ti.features.push(yn)}},mt.prototype._limitZoom=function(wt){return Math.max(this.options.minZoom,Math.min(+wt,this.options.maxZoom+1))},mt.prototype._cluster=function(wt,tr){for(var ir=[],wr=this.options,Xr=wr.radius,ti=wr.extent,$r=wr.reduce,Ri=wr.minPoints,Zi=Xr/(ti*Math.pow(2,tr)),en=0;en<wt.length;en++){var fn=wt[en];if(!(fn.zoom<=tr)){fn.zoom=tr;for(var yn=this.trees[tr+1],Mn=yn.within(fn.x,fn.y,Zi),Ba=fn.numPoints||1,ua=Ba,ma=0,Wa=Mn;ma<Wa.length;ma+=1){var Fa=Wa[ma],Xo=yn.points[Fa];Xo.zoom>tr&&(ua+=Xo.numPoints||1)}if(ua>=Ri){for(var da=fn.x*Ba,jn=fn.y*Ba,Ha=$r&&Ba>1?this._map(fn,!0):null,vo=(en<<5)+(tr+1)+this.points.length,Gn=0,Ct=Mn;Gn<Ct.length;Gn+=1){var Sr=Ct[Gn],Jr=yn.points[Sr];if(!(Jr.zoom<=tr)){Jr.zoom=tr;var hi=Jr.numPoints||1;da+=Jr.x*hi,jn+=Jr.y*hi,Jr.parentId=vo,$r&&(Ha||(Ha=this._map(fn,!0)),$r(Ha,this._map(Jr)))}}fn.parentId=vo,ir.push(Ht(da/ua,jn/ua,vo,ua,Ha))}else if(ir.push(fn),ua>1)for(var hn=0,Sn=Mn;hn<Sn.length;hn+=1){var En=Sn[hn],ki=yn.points[En];ki.zoom<=tr||(ki.zoom=tr,ir.push(ki))}}}return ir},mt.prototype._getOriginId=function(wt){return wt-this.points.length>>5},mt.prototype._getOriginZoom=function(wt){return(wt-this.points.length)%32},mt.prototype._map=function(wt,tr){if(wt.numPoints)return tr?Ue({},wt.properties):wt.properties;var ir=this.points[wt.index].properties,wr=this.options.map(ir);return tr&&wr===ir?Ue({},wr):wr};function Ht(Gt,wt,tr,ir,wr){return{x:Gt,y:wt,zoom:1/0,id:tr,parentId:-1,numPoints:ir,properties:wr}}function at(Gt,wt){var tr=Gt.geometry.coordinates,ir=tr[0],wr=tr[1];return{x:Vt(ir),y:rr(wr),zoom:1/0,index:wt,parentId:-1}}function ct(Gt){return{type:"Feature",id:Gt.id,properties:ar(Gt),geometry:{type:"Point",coordinates:[tt(Gt.x),je(Gt.y)]}}}function ar(Gt){var wt=Gt.numPoints,tr=wt>=1e4?Math.round(wt/1e3)+"k":wt>=1e3?Math.round(wt/100)/10+"k":wt;return Ue(Ue({},Gt.properties),{cluster:!0,cluster_id:Gt.id,point_count:wt,point_count_abbreviated:tr})}function Vt(Gt){return Gt/360+.5}function rr(Gt){var wt=Math.sin(Gt*Math.PI/180),tr=.5-.25*Math.log((1+wt)/(1-wt))/Math.PI;return tr<0?0:tr>1?1:tr}function tt(Gt){return(Gt-.5)*360}function je(Gt){var wt=(180-Gt*360)*Math.PI/180;return 360*Math.atan(Math.exp(wt))/Math.PI-90}function Ue(Gt,wt){for(var tr in wt)Gt[tr]=wt[tr];return Gt}function Ae(Gt){return Gt.x}function rt(Gt){return Gt.y}function St(Gt,wt,tr,ir){for(var wr=ir,Xr=tr-wt>>1,ti=tr-wt,$r,Ri=Gt[wt],Zi=Gt[wt+1],en=Gt[tr],fn=Gt[tr+1],yn=wt+3;yn<tr;yn+=3){var Mn=Tt(Gt[yn],Gt[yn+1],Ri,Zi,en,fn);if(Mn>wr)$r=yn,wr=Mn;else if(Mn===wr){var Ba=Math.abs(yn-Xr);Ba<ti&&($r=yn,ti=Ba)}}wr>ir&&($r-wt>3&&St(Gt,wt,$r,ir),Gt[$r+2]=wr,tr-$r>3&&St(Gt,$r,tr,ir))}function Tt(Gt,wt,tr,ir,wr,Xr){var ti=wr-tr,$r=Xr-ir;if(ti!==0||$r!==0){var Ri=((Gt-tr)*ti+(wt-ir)*$r)/(ti*ti+$r*$r);Ri>1?(tr=wr,ir=Xr):Ri>0&&(tr+=ti*Ri,ir+=$r*Ri)}return ti=Gt-tr,$r=wt-ir,ti*ti+$r*$r}function dt(Gt,wt,tr,ir){var wr={id:typeof Gt=="undefined"?null:Gt,type:wt,geometry:tr,tags:ir,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Et(wr),wr}function Et(Gt){var wt=Gt.geometry,tr=Gt.type;if(tr==="Point"||tr==="MultiPoint"||tr==="LineString")pt(Gt,wt);else if(tr==="Polygon"||tr==="MultiLineString")for(var ir=0;ir<wt.length;ir++)pt(Gt,wt[ir]);else if(tr==="MultiPolygon")for(ir=0;ir<wt.length;ir++)for(var wr=0;wr<wt[ir].length;wr++)pt(Gt,wt[ir][wr])}function pt(Gt,wt){for(var tr=0;tr<wt.length;tr+=3)Gt.minX=Math.min(Gt.minX,wt[tr]),Gt.minY=Math.min(Gt.minY,wt[tr+1]),Gt.maxX=Math.max(Gt.maxX,wt[tr]),Gt.maxY=Math.max(Gt.maxY,wt[tr+1])}function jt(Gt,wt){var tr=[];if(Gt.type==="FeatureCollection")for(var ir=0;ir<Gt.features.length;ir++)or(tr,Gt.features[ir],wt,ir);else Gt.type==="Feature"?or(tr,Gt,wt):or(tr,{geometry:Gt},wt);return tr}function or(Gt,wt,tr,ir){if(wt.geometry){var wr=wt.geometry.coordinates,Xr=wt.geometry.type,ti=Math.pow(tr.tolerance/((1<<tr.maxZoom)*tr.extent),2),$r=[],Ri=wt.id;if(tr.promoteId?Ri=wt.properties[tr.promoteId]:tr.generateId&&(Ri=ir||0),Xr==="Point")mr(wr,$r);else if(Xr==="MultiPoint")for(var Zi=0;Zi<wr.length;Zi++)mr(wr[Zi],$r);else if(Xr==="LineString")Ar(wr,$r,ti,!1);else if(Xr==="MultiLineString")if(tr.lineMetrics){for(Zi=0;Zi<wr.length;Zi++)$r=[],Ar(wr[Zi],$r,ti,!1),Gt.push(dt(Ri,"LineString",$r,wt.properties));return}else ei(wr,$r,ti,!1);else if(Xr==="Polygon")ei(wr,$r,ti,!0);else if(Xr==="MultiPolygon")for(Zi=0;Zi<wr.length;Zi++){var en=[];ei(wr[Zi],en,ti,!0),$r.push(en)}else if(Xr==="GeometryCollection"){for(Zi=0;Zi<wt.geometry.geometries.length;Zi++)or(Gt,{id:Ri,geometry:wt.geometry.geometries[Zi],properties:wt.properties},tr,ir);return}else throw new Error("Input data is not a valid GeoJSON object.");Gt.push(dt(Ri,Xr,$r,wt.properties))}}function mr(Gt,wt){wt.push(qr(Gt[0])),wt.push(jr(Gt[1])),wt.push(0)}function Ar(Gt,wt,tr,ir){for(var wr,Xr,ti=0,$r=0;$r<Gt.length;$r++){var Ri=qr(Gt[$r][0]),Zi=jr(Gt[$r][1]);wt.push(Ri),wt.push(Zi),wt.push(0),$r>0&&(ir?ti+=(wr*Zi-Ri*Xr)/2:ti+=Math.sqrt(Math.pow(Ri-wr,2)+Math.pow(Zi-Xr,2))),wr=Ri,Xr=Zi}var en=wt.length-3;wt[2]=1,St(wt,0,en,tr),wt[en+2]=1,wt.size=Math.abs(ti),wt.start=0,wt.end=wt.size}function ei(Gt,wt,tr,ir){for(var wr=0;wr<Gt.length;wr++){var Xr=[];Ar(Gt[wr],Xr,tr,ir),wt.push(Xr)}}function qr(Gt){return Gt/360+.5}function jr(Gt){var wt=Math.sin(Gt*Math.PI/180),tr=.5-.25*Math.log((1+wt)/(1-wt))/Math.PI;return tr<0?0:tr>1?1:tr}function gt(Gt,wt,tr,ir,wr,Xr,ti,$r){if(tr/=wt,ir/=wt,Xr>=tr&&ti<ir)return Gt;if(ti<tr||Xr>=ir)return null;for(var Ri=[],Zi=0;Zi<Gt.length;Zi++){var en=Gt[Zi],fn=en.geometry,yn=en.type,Mn=wr===0?en.minX:en.minY,Ba=wr===0?en.maxX:en.maxY;if(Mn>=tr&&Ba<ir){Ri.push(en);continue}else if(Ba<tr||Mn>=ir)continue;var ua=[];if(yn==="Point"||yn==="MultiPoint")Ge(fn,ua,tr,ir,wr);else if(yn==="LineString")Je(fn,ua,tr,ir,wr,!1,$r.lineMetrics);else if(yn==="MultiLineString")et(fn,ua,tr,ir,wr,!1);else if(yn==="Polygon")et(fn,ua,tr,ir,wr,!0);else if(yn==="MultiPolygon")for(var ma=0;ma<fn.length;ma++){var Wa=[];et(fn[ma],Wa,tr,ir,wr,!0),Wa.length&&ua.push(Wa)}if(ua.length){if($r.lineMetrics&&yn==="LineString"){for(ma=0;ma<ua.length;ma++)Ri.push(dt(en.id,yn,ua[ma],en.tags));continue}(yn==="LineString"||yn==="MultiLineString")&&(ua.length===1?(yn="LineString",ua=ua[0]):yn="MultiLineString"),(yn==="Point"||yn==="MultiPoint")&&(yn=ua.length===3?"Point":"MultiPoint"),Ri.push(dt(en.id,yn,ua,en.tags))}}return Ri.length?Ri:null}function Ge(Gt,wt,tr,ir,wr){for(var Xr=0;Xr<Gt.length;Xr+=3){var ti=Gt[Xr+wr];ti>=tr&&ti<=ir&&(wt.push(Gt[Xr]),wt.push(Gt[Xr+1]),wt.push(Gt[Xr+2]))}}function Je(Gt,wt,tr,ir,wr,Xr,ti){for(var $r=We(Gt),Ri=wr===0?At:Kt,Zi=Gt.start,en,fn,yn=0;yn<Gt.length-3;yn+=3){var Mn=Gt[yn],Ba=Gt[yn+1],ua=Gt[yn+2],ma=Gt[yn+3],Wa=Gt[yn+4],Fa=wr===0?Mn:Ba,Xo=wr===0?ma:Wa,da=!1;ti&&(en=Math.sqrt(Math.pow(Mn-ma,2)+Math.pow(Ba-Wa,2))),Fa<tr?Xo>tr&&(fn=Ri($r,Mn,Ba,ma,Wa,tr),ti&&($r.start=Zi+en*fn)):Fa>ir?Xo<ir&&(fn=Ri($r,Mn,Ba,ma,Wa,ir),ti&&($r.start=Zi+en*fn)):xt($r,Mn,Ba,ua),Xo<tr&&Fa>=tr&&(fn=Ri($r,Mn,Ba,ma,Wa,tr),da=!0),Xo>ir&&Fa<=ir&&(fn=Ri($r,Mn,Ba,ma,Wa,ir),da=!0),!Xr&&da&&(ti&&($r.end=Zi+en*fn),wt.push($r),$r=We(Gt)),ti&&(Zi+=en)}var jn=Gt.length-3;Mn=Gt[jn],Ba=Gt[jn+1],ua=Gt[jn+2],Fa=wr===0?Mn:Ba,Fa>=tr&&Fa<=ir&&xt($r,Mn,Ba,ua),jn=$r.length-3,Xr&&jn>=3&&($r[jn]!==$r[0]||$r[jn+1]!==$r[1])&&xt($r,$r[0],$r[1],$r[2]),$r.length&&wt.push($r)}function We(Gt){var wt=[];return wt.size=Gt.size,wt.start=Gt.start,wt.end=Gt.end,wt}function et(Gt,wt,tr,ir,wr,Xr){for(var ti=0;ti<Gt.length;ti++)Je(Gt[ti],wt,tr,ir,wr,Xr,!1)}function xt(Gt,wt,tr,ir){Gt.push(wt),Gt.push(tr),Gt.push(ir)}function At(Gt,wt,tr,ir,wr,Xr){var ti=(Xr-wt)/(ir-wt);return Gt.push(Xr),Gt.push(tr+(wr-tr)*ti),Gt.push(1),ti}function Kt(Gt,wt,tr,ir,wr,Xr){var ti=(Xr-tr)/(wr-tr);return Gt.push(wt+(ir-wt)*ti),Gt.push(Xr),Gt.push(1),ti}function Qt(Gt,wt){var tr=wt.buffer/wt.extent,ir=Gt,wr=gt(Gt,1,-1-tr,tr,0,-1,2,wt),Xr=gt(Gt,1,1-tr,2+tr,0,-1,2,wt);return(wr||Xr)&&(ir=gt(Gt,1,-tr,1+tr,0,-1,2,wt)||[],wr&&(ir=Mr(wr,1).concat(ir)),Xr&&(ir=ir.concat(Mr(Xr,-1)))),ir}function Mr(Gt,wt){for(var tr=[],ir=0;ir<Gt.length;ir++){var wr=Gt[ir],Xr=wr.type,ti;if(Xr==="Point"||Xr==="MultiPoint"||Xr==="LineString")ti=Gr(wr.geometry,wt);else if(Xr==="MultiLineString"||Xr==="Polygon"){ti=[];for(var $r=0;$r<wr.geometry.length;$r++)ti.push(Gr(wr.geometry[$r],wt))}else if(Xr==="MultiPolygon")for(ti=[],$r=0;$r<wr.geometry.length;$r++){for(var Ri=[],Zi=0;Zi<wr.geometry[$r].length;Zi++)Ri.push(Gr(wr.geometry[$r][Zi],wt));ti.push(Ri)}tr.push(dt(wr.id,Xr,ti,wr.tags))}return tr}function Gr(Gt,wt){var tr=[];tr.size=Gt.size,Gt.start!==void 0&&(tr.start=Gt.start,tr.end=Gt.end);for(var ir=0;ir<Gt.length;ir+=3)tr.push(Gt[ir]+wt,Gt[ir+1],Gt[ir+2]);return tr}function Ir(Gt,wt){if(Gt.transformed)return Gt;var tr=1<<Gt.z,ir=Gt.x,wr=Gt.y,Xr,ti,$r;for(Xr=0;Xr<Gt.features.length;Xr++){var Ri=Gt.features[Xr],Zi=Ri.geometry,en=Ri.type;if(Ri.geometry=[],en===1)for(ti=0;ti<Zi.length;ti+=2)Ri.geometry.push(Yr(Zi[ti],Zi[ti+1],wt,tr,ir,wr));else for(ti=0;ti<Zi.length;ti++){var fn=[];for($r=0;$r<Zi[ti].length;$r+=2)fn.push(Yr(Zi[ti][$r],Zi[ti][$r+1],wt,tr,ir,wr));Ri.geometry.push(fn)}}return Gt.transformed=!0,Gt}function Yr(Gt,wt,tr,ir,wr,Xr){return[Math.round(tr*(Gt*ir-wr)),Math.round(tr*(wt*ir-Xr))]}function _i(Gt,wt,tr,ir,wr){for(var Xr=wt===wr.maxZoom?0:wr.tolerance/((1<<wt)*wr.extent),ti={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:tr,y:ir,z:wt,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},$r=0;$r<Gt.length;$r++){ti.numFeatures++,Pi(ti,Gt[$r],Xr,wr);var Ri=Gt[$r].minX,Zi=Gt[$r].minY,en=Gt[$r].maxX,fn=Gt[$r].maxY;Ri<ti.minX&&(ti.minX=Ri),Zi<ti.minY&&(ti.minY=Zi),en>ti.maxX&&(ti.maxX=en),fn>ti.maxY&&(ti.maxY=fn)}return ti}function Pi(Gt,wt,tr,ir){var wr=wt.geometry,Xr=wt.type,ti=[];if(Xr==="Point"||Xr==="MultiPoint")for(var $r=0;$r<wr.length;$r+=3)ti.push(wr[$r]),ti.push(wr[$r+1]),Gt.numPoints++,Gt.numSimplified++;else if(Xr==="LineString")ai(ti,wr,Gt,tr,!1,!1);else if(Xr==="MultiLineString"||Xr==="Polygon")for($r=0;$r<wr.length;$r++)ai(ti,wr[$r],Gt,tr,Xr==="Polygon",$r===0);else if(Xr==="MultiPolygon")for(var Ri=0;Ri<wr.length;Ri++){var Zi=wr[Ri];for($r=0;$r<Zi.length;$r++)ai(ti,Zi[$r],Gt,tr,!0,$r===0)}if(ti.length){var en=wt.tags||null;if(Xr==="LineString"&&ir.lineMetrics){en={};for(var fn in wt.tags)en[fn]=wt.tags[fn];en.mapbox_clip_start=wr.start/wr.size,en.mapbox_clip_end=wr.end/wr.size}var yn={geometry:ti,type:Xr==="Polygon"||Xr==="MultiPolygon"?3:Xr==="LineString"||Xr==="MultiLineString"?2:1,tags:en};wt.id!==null&&(yn.id=wt.id),Gt.features.push(yn)}}function ai(Gt,wt,tr,ir,wr,Xr){var ti=ir*ir;if(ir>0&&wt.size<(wr?ti:ir)){tr.numPoints+=wt.length/3;return}for(var $r=[],Ri=0;Ri<wt.length;Ri+=3)(ir===0||wt[Ri+2]>ti)&&(tr.numSimplified++,$r.push(wt[Ri]),$r.push(wt[Ri+1])),tr.numPoints++;wr&&mi($r,Xr),Gt.push($r)}function mi(Gt,wt){for(var tr=0,ir=0,wr=Gt.length,Xr=wr-2;ir<wr;Xr=ir,ir+=2)tr+=(Gt[ir]-Gt[Xr])*(Gt[ir+1]+Gt[Xr+1]);if(tr>0===wt)for(ir=0,wr=Gt.length;ir<wr/2;ir+=2){var ti=Gt[ir],$r=Gt[ir+1];Gt[ir]=Gt[wr-2-ir],Gt[ir+1]=Gt[wr-1-ir],Gt[wr-2-ir]=ti,Gt[wr-1-ir]=$r}}function un(Gt,wt){return new Fn(Gt,wt)}function Fn(Gt,wt){wt=this.options=Hn(Object.create(this.options),wt);var tr=wt.debug;if(tr&&console.time("preprocess data"),wt.maxZoom<0||wt.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(wt.promoteId&&wt.generateId)throw new Error("promoteId and generateId cannot be used together.");var ir=jt(Gt,wt);this.tiles={},this.tileCoords=[],tr&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",wt.indexMaxZoom,wt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),ir=Qt(ir,wt),ir.length&&this.splitTile(ir,0,0,0),tr&&(ir.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)))}Fn.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Fn.prototype.splitTile=function(Gt,wt,tr,ir,wr,Xr,ti){for(var $r=[Gt,wt,tr,ir],Ri=this.options,Zi=Ri.debug;$r.length;){ir=$r.pop(),tr=$r.pop(),wt=$r.pop(),Gt=$r.pop();var en=1<<wt,fn=An(wt,tr,ir),yn=this.tiles[fn];if(!yn&&(Zi>1&&console.time("creation"),yn=this.tiles[fn]=_i(Gt,wt,tr,ir,Ri),this.tileCoords.push({z:wt,x:tr,y:ir}),Zi)){Zi>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",wt,tr,ir,yn.numFeatures,yn.numPoints,yn.numSimplified),console.timeEnd("creation"));var Mn="z"+wt;this.stats[Mn]=(this.stats[Mn]||0)+1,this.total++}if(yn.source=Gt,wr){if(wt===Ri.maxZoom||wt===wr)continue;var Ba=1<<wr-wt;if(tr!==Math.floor(Xr/Ba)||ir!==Math.floor(ti/Ba))continue}else if(wt===Ri.indexMaxZoom||yn.numPoints<=Ri.indexMaxPoints)continue;if(yn.source=null,Gt.length!==0){Zi>1&&console.time("clipping");var ua=.5*Ri.buffer/Ri.extent,ma=.5-ua,Wa=.5+ua,Fa=1+ua,Xo,da,jn,Ha,vo,Gn;Xo=da=jn=Ha=null,vo=gt(Gt,en,tr-ua,tr+Wa,0,yn.minX,yn.maxX,Ri),Gn=gt(Gt,en,tr+ma,tr+Fa,0,yn.minX,yn.maxX,Ri),Gt=null,vo&&(Xo=gt(vo,en,ir-ua,ir+Wa,1,yn.minY,yn.maxY,Ri),da=gt(vo,en,ir+ma,ir+Fa,1,yn.minY,yn.maxY,Ri),vo=null),Gn&&(jn=gt(Gn,en,ir-ua,ir+Wa,1,yn.minY,yn.maxY,Ri),Ha=gt(Gn,en,ir+ma,ir+Fa,1,yn.minY,yn.maxY,Ri),Gn=null),Zi>1&&console.timeEnd("clipping"),$r.push(Xo||[],wt+1,tr*2,ir*2),$r.push(da||[],wt+1,tr*2,ir*2+1),$r.push(jn||[],wt+1,tr*2+1,ir*2),$r.push(Ha||[],wt+1,tr*2+1,ir*2+1)}}},Fn.prototype.getTile=function(Gt,wt,tr){var ir=this.options,wr=ir.extent,Xr=ir.debug;if(Gt<0||Gt>24)return null;var ti=1<<Gt;wt=(wt%ti+ti)%ti;var $r=An(Gt,wt,tr);if(this.tiles[$r])return Ir(this.tiles[$r],wr);Xr>1&&console.log("drilling down to z%d-%d-%d",Gt,wt,tr);for(var Ri=Gt,Zi=wt,en=tr,fn;!fn&&Ri>0;)Ri--,Zi=Math.floor(Zi/2),en=Math.floor(en/2),fn=this.tiles[An(Ri,Zi,en)];return!fn||!fn.source?null:(Xr>1&&console.log("found parent tile z%d-%d-%d",Ri,Zi,en),Xr>1&&console.time("drilling down"),this.splitTile(fn.source,Ri,Zi,en,Gt,wt,tr),Xr>1&&console.timeEnd("drilling down"),this.tiles[$r]?Ir(this.tiles[$r],wr):null)};function An(Gt,wt,tr){return((1<<Gt)*tr+wt)*32+Gt}function Hn(Gt,wt){for(var tr in wt)Gt[tr]=wt[tr];return Gt}function Qn(Gt,wt){var tr=Gt.tileID.canonical;if(!this._geoJSONIndex)return wt(null,null);var ir=this._geoJSONIndex.getTile(tr.z,tr.x,tr.y);if(!ir)return wt(null,null);var wr=new C(ir.features),Xr=z(wr);(Xr.byteOffset!==0||Xr.byteLength!==Xr.buffer.byteLength)&&(Xr=new Uint8Array(Xr)),wt(null,{vectorTile:wr,rawData:Xr.buffer})}var Vi=function(Gt){function wt(tr,ir,wr,Xr){Gt.call(this,tr,ir,wr,Qn),Xr&&(this.loadGeoJSON=Xr)}return Gt&&(wt.__proto__=Gt),wt.prototype=Object.create(Gt&&Gt.prototype),wt.prototype.constructor=wt,wt.prototype.loadData=function(ir,wr){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=wr,this._pendingLoadDataParams=ir,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},wt.prototype._loadData=function(){var ir=this;if(!(!this._pendingCallback||!this._pendingLoadDataParams)){var wr=this._pendingCallback,Xr=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var ti=Xr&&Xr.request&&Xr.request.collectResourceTiming?new i.RequestPerformance(Xr.request):!1;this.loadGeoJSON(Xr,function($r,Ri){if($r||!Ri)return wr($r);if(typeof Ri!="object")return wr(new Error("Input data given to '"+Xr.source+"' is not a valid GeoJSON object."));p(Ri,!0);try{if(Xr.filter){var Zi=i.createExpression(Xr.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Zi.result==="error")throw new Error(Zi.value.map(function(Mn){return Mn.key+": "+Mn.message}).join(", "));var en=Ri.features.filter(function(Mn){return Zi.value.evaluate({zoom:0},Mn)});Ri={type:"FeatureCollection",features:en}}ir._geoJSONIndex=Xr.cluster?new mt(Kn(Xr)).load(Ri.features):un(Ri,Xr.geojsonVtOptions)}catch(Mn){return wr(Mn)}ir.loaded={};var fn={};if(ti){var yn=ti.finish();yn&&(fn.resourceTiming={},fn.resourceTiming[Xr.source]=JSON.parse(JSON.stringify(yn)))}wr(null,fn)})}},wt.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},wt.prototype.reloadTile=function(ir,wr){var Xr=this.loaded,ti=ir.uid;return Xr&&Xr[ti]?Gt.prototype.reloadTile.call(this,ir,wr):this.loadTile(ir,wr)},wt.prototype.loadGeoJSON=function(ir,wr){if(ir.request)i.getJSON(ir.request,wr);else if(typeof ir.data=="string")try{return wr(null,JSON.parse(ir.data))}catch(Xr){return wr(new Error("Input data given to '"+ir.source+"' is not a valid GeoJSON object."))}else return wr(new Error("Input data given to '"+ir.source+"' is not a valid GeoJSON object."))},wt.prototype.removeSource=function(ir,wr){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),wr()},wt.prototype.getClusterExpansionZoom=function(ir,wr){try{wr(null,this._geoJSONIndex.getClusterExpansionZoom(ir.clusterId))}catch(Xr){wr(Xr)}},wt.prototype.getClusterChildren=function(ir,wr){try{wr(null,this._geoJSONIndex.getChildren(ir.clusterId))}catch(Xr){wr(Xr)}},wt.prototype.getClusterLeaves=function(ir,wr){try{wr(null,this._geoJSONIndex.getLeaves(ir.clusterId,ir.limit,ir.offset))}catch(Xr){wr(Xr)}},wt}(v);function Kn(Gt){var wt=Gt.superclusterOptions,tr=Gt.clusterProperties;if(!tr||!wt)return wt;for(var ir={},wr={},Xr={accumulated:null,zoom:0},ti={properties:null},$r=Object.keys(tr),Ri=0,Zi=$r;Ri<Zi.length;Ri+=1){var en=Zi[Ri],fn=tr[en],yn=fn[0],Mn=fn[1],Ba=i.createExpression(Mn),ua=i.createExpression(typeof yn=="string"?[yn,["accumulated"],["get",en]]:yn);ir[en]=Ba.value,wr[en]=ua.value}return wt.map=function(ma){ti.properties=ma;for(var Wa={},Fa=0,Xo=$r;Fa<Xo.length;Fa+=1){var da=Xo[Fa];Wa[da]=ir[da].evaluate(Xr,ti)}return Wa},wt.reduce=function(ma,Wa){ti.properties=Wa;for(var Fa=0,Xo=$r;Fa<Xo.length;Fa+=1){var da=Xo[Fa];Xr.accumulated=ma[da],ma[da]=wr[da].evaluate(Xr,ti)}},wt}var Jn=function(wt){var tr=this;this.self=wt,this.actor=new i.Actor(wt,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:v,geojson:Vi},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(ir,wr){if(tr.workerSourceTypes[ir])throw new Error('Worker source with name "'+ir+'" already registered.');tr.workerSourceTypes[ir]=wr},this.self.registerRTLTextPlugin=function(ir){if(i.plugin.isParsed())throw new Error("RTL text plugin already registered.");i.plugin.applyArabicShaping=ir.applyArabicShaping,i.plugin.processBidirectionalText=ir.processBidirectionalText,i.plugin.processStyledBidirectionalText=ir.processStyledBidirectionalText}};return Jn.prototype.setReferrer=function(wt,tr){this.referrer=tr},Jn.prototype.setImages=function(wt,tr,ir){this.availableImages[wt]=tr;for(var wr in this.workerSources[wt]){var Xr=this.workerSources[wt][wr];for(var ti in Xr)Xr[ti].availableImages=tr}ir()},Jn.prototype.setLayers=function(wt,tr,ir){this.getLayerIndex(wt).replace(tr),ir()},Jn.prototype.updateLayers=function(wt,tr,ir){this.getLayerIndex(wt).update(tr.layers,tr.removedIds),ir()},Jn.prototype.loadTile=function(wt,tr,ir){this.getWorkerSource(wt,tr.type,tr.source).loadTile(tr,ir)},Jn.prototype.loadDEMTile=function(wt,tr,ir){this.getDEMWorkerSource(wt,tr.source).loadTile(tr,ir)},Jn.prototype.reloadTile=function(wt,tr,ir){this.getWorkerSource(wt,tr.type,tr.source).reloadTile(tr,ir)},Jn.prototype.abortTile=function(wt,tr,ir){this.getWorkerSource(wt,tr.type,tr.source).abortTile(tr,ir)},Jn.prototype.removeTile=function(wt,tr,ir){this.getWorkerSource(wt,tr.type,tr.source).removeTile(tr,ir)},Jn.prototype.removeDEMTile=function(wt,tr){this.getDEMWorkerSource(wt,tr.source).removeTile(tr)},Jn.prototype.removeSource=function(wt,tr,ir){if(!(!this.workerSources[wt]||!this.workerSources[wt][tr.type]||!this.workerSources[wt][tr.type][tr.source])){var wr=this.workerSources[wt][tr.type][tr.source];delete this.workerSources[wt][tr.type][tr.source],wr.removeSource!==void 0?wr.removeSource(tr,ir):ir()}},Jn.prototype.loadWorkerSource=function(wt,tr,ir){try{this.self.importScripts(tr.url),ir()}catch(wr){ir(wr.toString())}},Jn.prototype.syncRTLPluginState=function(wt,tr,ir){try{i.plugin.setState(tr);var wr=i.plugin.getPluginURL();if(i.plugin.isLoaded()&&!i.plugin.isParsed()&&wr!=null){this.self.importScripts(wr);var Xr=i.plugin.isParsed(),ti=Xr?void 0:new Error("RTL Text Plugin failed to import scripts from "+wr);ir(ti,Xr)}}catch($r){ir($r.toString())}},Jn.prototype.getAvailableImages=function(wt){var tr=this.availableImages[wt];return tr||(tr=[]),tr},Jn.prototype.getLayerIndex=function(wt){var tr=this.layerIndexes[wt];return tr||(tr=this.layerIndexes[wt]=new l),tr},Jn.prototype.getWorkerSource=function(wt,tr,ir){var wr=this;if(this.workerSources[wt]||(this.workerSources[wt]={}),this.workerSources[wt][tr]||(this.workerSources[wt][tr]={}),!this.workerSources[wt][tr][ir]){var Xr={send:function(ti,$r,Ri){wr.actor.send(ti,$r,Ri,wt)}};this.workerSources[wt][tr][ir]=new this.workerSourceTypes[tr](Xr,this.getLayerIndex(wt),this.getAvailableImages(wt))}return this.workerSources[wt][tr][ir]},Jn.prototype.getDEMWorkerSource=function(wt,tr){return this.demWorkerSources[wt]||(this.demWorkerSources[wt]={}),this.demWorkerSources[wt][tr]||(this.demWorkerSources[wt][tr]=new b),this.demWorkerSources[wt][tr]},Jn.prototype.enforceCacheSizeLimit=function(wt,tr){i.enforceCacheSizeLimit(tr)},typeof WorkerGlobalScope!="undefined"&&typeof self!="undefined"&&self instanceof WorkerGlobalScope&&(self.worker=new Jn(self)),Jn}),n(["./shared"],function(i){"use strict";var a=i.createCommonjsModule(function(Y){Y.exports?Y.exports=D:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=D,window.mapboxgl.notSupportedReason=J);function D(It){return!J(It)}function J(It){if(!O())return"not a browser";if(!K())return"insufficent Array support";if(!de())return"insufficient Function support";if(!ne())return"insufficient Object support";if(!we())return"insufficient JSON support";if(!Oe())return"insufficient worker support";if(!ht())return"insufficient Uint8ClampedArray support";if(!Yt())return"insufficient ArrayBuffer support";if(!cr())return"insufficient Canvas/getImageData support";if(!Ne(It&&It.failIfMajorPerformanceCaveat))return"insufficient WebGL support"}function O(){return typeof window!="undefined"&&typeof document!="undefined"}function K(){return 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 de(){return Function.prototype&&Function.prototype.bind}function ne(){return 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}function we(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function Oe(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var It=new Blob([""],{type:"text/javascript"}),Bt=URL.createObjectURL(It),Ft,Ut;try{Ut=new Worker(Bt),Ft=!0}catch(zt){Ft=!1}return Ut&&Ut.terminate(),URL.revokeObjectURL(Bt),Ft}function ht(){return"Uint8ClampedArray"in window}function Yt(){return ArrayBuffer.isView}function cr(){var It=document.createElement("canvas");It.width=It.height=1;var Bt=It.getContext("2d");if(!Bt)return!1;var Ft=Bt.getImageData(0,0,1,1);return Ft&&Ft.width===It.width}var Nt={};function Ne(It){return Nt[It]===void 0&&(Nt[It]=st(It)),Nt[It]}D.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};function $e(It){var Bt=document.createElement("canvas"),Ft=Object.create(D.webGLContextAttributes);return Ft.failIfMajorPerformanceCaveat=It,Bt.probablySupportsContext?Bt.probablySupportsContext("webgl",Ft)||Bt.probablySupportsContext("experimental-webgl",Ft):Bt.supportsContext?Bt.supportsContext("webgl",Ft)||Bt.supportsContext("experimental-webgl",Ft):Bt.getContext("webgl",Ft)||Bt.getContext("experimental-webgl",Ft)}function st(It){var Bt=$e(It);if(!Bt)return!1;var Ft=Bt.createShader(Bt.VERTEX_SHADER);return!Ft||Bt.isContextLost()?!1:(Bt.shaderSource(Ft,"void main() {}"),Bt.compileShader(Ft),Bt.getShaderParameter(Ft,Bt.COMPILE_STATUS)===!0)}}),o={};o.create=function(Y,D,J){var O=i.window.document.createElement(Y);return D!==void 0&&(O.className=D),J&&J.appendChild(O),O},o.createNS=function(Y,D){var J=i.window.document.createElementNS(Y,D);return J};var s=i.window.document&&i.window.document.documentElement.style;function l(Y){if(!s)return Y[0];for(var D=0;D<Y.length;D++)if(Y[D]in s)return Y[D];return Y[0]}var u=l(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),c;o.disableDrag=function(){s&&u&&(c=s[u],s[u]="none")},o.enableDrag=function(){s&&u&&(s[u]=c)};var f=l(["transform","WebkitTransform"]);o.setTransform=function(Y,D){Y.style[f]=D};var h=!1;try{var d=Object.defineProperty({},"passive",{get:function(){h=!0}});i.window.addEventListener("test",d,d),i.window.removeEventListener("test",d,d)}catch(Y){h=!1}o.addEventListener=function(Y,D,J,O){O===void 0&&(O={}),"passive"in O&&h?Y.addEventListener(D,J,O):Y.addEventListener(D,J,O.capture)},o.removeEventListener=function(Y,D,J,O){O===void 0&&(O={}),"passive"in O&&h?Y.removeEventListener(D,J,O):Y.removeEventListener(D,J,O.capture)};var v=function(Y){Y.preventDefault(),Y.stopPropagation(),i.window.removeEventListener("click",v,!0)};o.suppressClick=function(){i.window.addEventListener("click",v,!0),i.window.setTimeout(function(){i.window.removeEventListener("click",v,!0)},0)},o.mousePos=function(Y,D){var J=Y.getBoundingClientRect();return new i.Point(D.clientX-J.left-Y.clientLeft,D.clientY-J.top-Y.clientTop)},o.touchPos=function(Y,D){for(var J=Y.getBoundingClientRect(),O=[],K=0;K<D.length;K++)O.push(new i.Point(D[K].clientX-J.left-Y.clientLeft,D[K].clientY-J.top-Y.clientTop));return O},o.mouseButton=function(Y){return typeof i.window.InstallTrigger!="undefined"&&Y.button===2&&Y.ctrlKey&&i.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:Y.button},o.remove=function(Y){Y.parentNode&&Y.parentNode.removeChild(Y)};function m(Y,D,J){var O,K,de,ne=i.browser.devicePixelRatio>1?"@2x":"",we=i.getJSON(D.transformRequest(D.normalizeSpriteURL(Y,ne,".json"),i.ResourceType.SpriteJSON),function(Yt,cr){we=null,de||(de=Yt,O=cr,ht())}),Oe=i.getImage(D.transformRequest(D.normalizeSpriteURL(Y,ne,".png"),i.ResourceType.SpriteImage),function(Yt,cr){Oe=null,de||(de=Yt,K=cr,ht())});function ht(){if(de)J(de);else if(O&&K){var Yt=i.browser.getImageData(K),cr={};for(var Nt in O){var Ne=O[Nt],$e=Ne.width,st=Ne.height,It=Ne.x,Bt=Ne.y,Ft=Ne.sdf,Ut=Ne.pixelRatio,zt=Ne.stretchX,_t=Ne.stretchY,Dt=Ne.content,vt=new i.RGBAImage({width:$e,height:st});i.RGBAImage.copy(Yt,vt,{x:It,y:Bt},{x:0,y:0},{width:$e,height:st}),cr[Nt]={data:vt,pixelRatio:Ut,sdf:Ft,stretchX:zt,stretchY:_t,content:Dt}}J(null,cr)}}return{cancel:function(){we&&(we.cancel(),we=null),Oe&&(Oe.cancel(),Oe=null)}}}function b(Y){var D=Y.userImage;if(D&&D.render){var J=D.render();if(J)return Y.data.replace(new Uint8Array(D.data.buffer)),!0}return!1}var p=1,k=function(Y){function D(){Y.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new i.RGBAImage({width:1,height:1}),this.dirty=!0}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.isLoaded=function(){return this.loaded},D.prototype.setLoaded=function(O){if(this.loaded!==O&&(this.loaded=O,O)){for(var K=0,de=this.requestors;K<de.length;K+=1){var ne=de[K],we=ne.ids,Oe=ne.callback;this._notify(we,Oe)}this.requestors=[]}},D.prototype.getImage=function(O){return this.images[O]},D.prototype.addImage=function(O,K){this._validate(O,K)&&(this.images[O]=K)},D.prototype._validate=function(O,K){var de=!0;return this._validateStretch(K.stretchX,K.data&&K.data.width)||(this.fire(new i.ErrorEvent(new Error('Image "'+O+'" has invalid "stretchX" value'))),de=!1),this._validateStretch(K.stretchY,K.data&&K.data.height)||(this.fire(new i.ErrorEvent(new Error('Image "'+O+'" has invalid "stretchY" value'))),de=!1),this._validateContent(K.content,K)||(this.fire(new i.ErrorEvent(new Error('Image "'+O+'" has invalid "content" value'))),de=!1),de},D.prototype._validateStretch=function(O,K){if(!O)return!0;for(var de=0,ne=0,we=O;ne<we.length;ne+=1){var Oe=we[ne];if(Oe[0]<de||Oe[1]<Oe[0]||K<Oe[1])return!1;de=Oe[1]}return!0},D.prototype._validateContent=function(O,K){return O?!(O.length!==4||O[0]<0||K.data.width<O[0]||O[1]<0||K.data.height<O[1]||O[2]<0||K.data.width<O[2]||O[3]<0||K.data.height<O[3]||O[2]<O[0]||O[3]<O[1]):!0},D.prototype.updateImage=function(O,K){var de=this.images[O];K.version=de.version+1,this.images[O]=K,this.updatedImages[O]=!0},D.prototype.removeImage=function(O){var K=this.images[O];delete this.images[O],delete this.patterns[O],K.userImage&&K.userImage.onRemove&&K.userImage.onRemove()},D.prototype.listImages=function(){return Object.keys(this.images)},D.prototype.getImages=function(O,K){var de=!0;if(!this.isLoaded())for(var ne=0,we=O;ne<we.length;ne+=1){var Oe=we[ne];this.images[Oe]||(de=!1)}this.isLoaded()||de?this._notify(O,K):this.requestors.push({ids:O,callback:K})},D.prototype._notify=function(O,K){for(var de={},ne=0,we=O;ne<we.length;ne+=1){var Oe=we[ne];this.images[Oe]||this.fire(new i.Event("styleimagemissing",{id:Oe}));var ht=this.images[Oe];ht?de[Oe]={data:ht.data.clone(),pixelRatio:ht.pixelRatio,sdf:ht.sdf,version:ht.version,stretchX:ht.stretchX,stretchY:ht.stretchY,content:ht.content,hasRenderCallback:!!(ht.userImage&&ht.userImage.render)}:i.warnOnce('Image "'+Oe+'" 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.')}K(null,de)},D.prototype.getPixelSize=function(){var O=this.atlasImage,K=O.width,de=O.height;return{width:K,height:de}},D.prototype.getPattern=function(O){var K=this.patterns[O],de=this.getImage(O);if(!de)return null;if(K&&K.position.version===de.version)return K.position;if(K)K.position.version=de.version;else{var ne=de.data.width+p*2,we=de.data.height+p*2,Oe={w:ne,h:we,x:0,y:0},ht=new i.ImagePosition(Oe,de);this.patterns[O]={bin:Oe,position:ht}}return this._updatePatternAtlas(),this.patterns[O].position},D.prototype.bind=function(O){var K=O.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new i.Texture(O,this.atlasImage,K.RGBA),this.atlasTexture.bind(K.LINEAR,K.CLAMP_TO_EDGE)},D.prototype._updatePatternAtlas=function(){var O=[];for(var K in this.patterns)O.push(this.patterns[K].bin);var de=i.potpack(O),ne=de.w,we=de.h,Oe=this.atlasImage;Oe.resize({width:ne||1,height:we||1});for(var ht in this.patterns){var Yt=this.patterns[ht],cr=Yt.bin,Nt=cr.x+p,Ne=cr.y+p,$e=this.images[ht].data,st=$e.width,It=$e.height;i.RGBAImage.copy($e,Oe,{x:0,y:0},{x:Nt,y:Ne},{width:st,height:It}),i.RGBAImage.copy($e,Oe,{x:0,y:It-1},{x:Nt,y:Ne-1},{width:st,height:1}),i.RGBAImage.copy($e,Oe,{x:0,y:0},{x:Nt,y:Ne+It},{width:st,height:1}),i.RGBAImage.copy($e,Oe,{x:st-1,y:0},{x:Nt-1,y:Ne},{width:1,height:It}),i.RGBAImage.copy($e,Oe,{x:0,y:0},{x:Nt+st,y:Ne},{width:1,height:It})}this.dirty=!0},D.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},D.prototype.dispatchRenderCallbacks=function(O){for(var K=0,de=O;K<de.length;K+=1){var ne=de[K];if(!this.callbackDispatchedThisFrame[ne]){this.callbackDispatchedThisFrame[ne]=!0;var we=this.images[ne],Oe=b(we);Oe&&this.updateImage(ne,we)}}},D}(i.Evented);function M(Y,D,J,O,K){var de=D*256,ne=de+255,we=O.transformRequest(O.normalizeGlyphsURL(J).replace("{fontstack}",Y).replace("{range}",de+"-"+ne),i.ResourceType.Glyphs);i.getArrayBuffer(we,function(Oe,ht){if(Oe)K(Oe);else if(ht){for(var Yt={},cr=0,Nt=i.parseGlyphPBF(ht);cr<Nt.length;cr+=1){var Ne=Nt[cr];Yt[Ne.id]=Ne}K(null,Yt)}})}var T=C,L=C,x=1e20;function C(Y,D,J,O,K,de){this.fontSize=Y||24,this.buffer=D===void 0?3:D,this.cutoff=O||.25,this.fontFamily=K||"sans-serif",this.fontWeight=de||"normal",this.radius=J||8;var ne=this.size=this.fontSize+this.buffer*2;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=ne,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(ne*ne),this.gridInner=new Float64Array(ne*ne),this.f=new Float64Array(ne),this.d=new Float64Array(ne),this.z=new Float64Array(ne+1),this.v=new Int16Array(ne),this.middle=Math.round(ne/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}C.prototype.draw=function(Y){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(Y,this.buffer,this.middle);for(var D=this.ctx.getImageData(0,0,this.size,this.size),J=new Uint8ClampedArray(this.size*this.size),O=0;O<this.size*this.size;O++){var K=D.data[O*4+3]/255;this.gridOuter[O]=K===1?0:K===0?x:Math.pow(Math.max(0,.5-K),2),this.gridInner[O]=K===1?x:K===0?0:Math.pow(Math.max(0,K-.5),2)}for(S(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),S(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),O=0;O<this.size*this.size;O++){var de=this.gridOuter[O]-this.gridInner[O];J[O]=Math.max(0,Math.min(255,Math.round(255-255*(de/this.radius+this.cutoff))))}return J};function S(Y,D,J,O,K,de,ne){for(var we=0;we<D;we++){for(var Oe=0;Oe<J;Oe++)O[Oe]=Y[Oe*D+we];for(g(O,K,de,ne,J),Oe=0;Oe<J;Oe++)Y[Oe*D+we]=K[Oe]}for(Oe=0;Oe<J;Oe++){for(we=0;we<D;we++)O[we]=Y[Oe*D+we];for(g(O,K,de,ne,D),we=0;we<D;we++)Y[Oe*D+we]=Math.sqrt(K[we])}}function g(Y,D,J,O,K){J[0]=0,O[0]=-x,O[1]=+x;for(var de=1,ne=0;de<K;de++){for(var we=(Y[de]+de*de-(Y[J[ne]]+J[ne]*J[ne]))/(2*de-2*J[ne]);we<=O[ne];)ne--,we=(Y[de]+de*de-(Y[J[ne]]+J[ne]*J[ne]))/(2*de-2*J[ne]);ne++,J[ne]=de,O[ne]=we,O[ne+1]=+x}for(de=0,ne=0;de<K;de++){for(;O[ne+1]<de;)ne++;D[de]=(de-J[ne])*(de-J[ne])+Y[J[ne]]}}T.default=L;var P=function(D,J){this.requestManager=D,this.localIdeographFontFamily=J,this.entries={}};P.prototype.setURL=function(D){this.url=D},P.prototype.getGlyphs=function(D,J){var O=this,K=[];for(var de in D)for(var ne=0,we=D[de];ne<we.length;ne+=1){var Oe=we[ne];K.push({stack:de,id:Oe})}i.asyncAll(K,function(ht,Yt){var cr=ht.stack,Nt=ht.id,Ne=O.entries[cr];Ne||(Ne=O.entries[cr]={glyphs:{},requests:{},ranges:{}});var $e=Ne.glyphs[Nt];if($e!==void 0){Yt(null,{stack:cr,id:Nt,glyph:$e});return}if($e=O._tinySDF(Ne,cr,Nt),$e){Ne.glyphs[Nt]=$e,Yt(null,{stack:cr,id:Nt,glyph:$e});return}var st=Math.floor(Nt/256);if(st*256>65535){Yt(new Error("glyphs > 65535 not supported"));return}if(Ne.ranges[st]){Yt(null,{stack:cr,id:Nt,glyph:$e});return}var It=Ne.requests[st];It||(It=Ne.requests[st]=[],P.loadGlyphRange(cr,st,O.url,O.requestManager,function(Bt,Ft){if(Ft){for(var Ut in Ft)O._doesCharSupportLocalGlyph(+Ut)||(Ne.glyphs[+Ut]=Ft[+Ut]);Ne.ranges[st]=!0}for(var zt=0,_t=It;zt<_t.length;zt+=1){var Dt=_t[zt];Dt(Bt,Ft)}delete Ne.requests[st]})),It.push(function(Bt,Ft){Bt?Yt(Bt):Ft&&Yt(null,{stack:cr,id:Nt,glyph:Ft[Nt]||null})})},function(ht,Yt){if(ht)J(ht);else if(Yt){for(var cr={},Nt=0,Ne=Yt;Nt<Ne.length;Nt+=1){var $e=Ne[Nt],st=$e.stack,It=$e.id,Bt=$e.glyph;(cr[st]||(cr[st]={}))[It]=Bt&&{id:Bt.id,bitmap:Bt.bitmap.clone(),metrics:Bt.metrics}}J(null,cr)}})},P.prototype._doesCharSupportLocalGlyph=function(D){return!!this.localIdeographFontFamily&&(i.isChar["CJK Unified Ideographs"](D)||i.isChar["Hangul Syllables"](D)||i.isChar.Hiragana(D)||i.isChar.Katakana(D))},P.prototype._tinySDF=function(D,J,O){var K=this.localIdeographFontFamily;if(K&&this._doesCharSupportLocalGlyph(O)){var de=D.tinySDF;if(!de){var ne="400";/bold/i.test(J)?ne="900":/medium/i.test(J)?ne="500":/light/i.test(J)&&(ne="200"),de=D.tinySDF=new P.TinySDF(24,3,8,.25,K,ne)}return{id:O,bitmap:new i.AlphaImage({width:30,height:30},de.draw(String.fromCharCode(O))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},P.loadGlyphRange=M,P.TinySDF=T;var E=function(){this.specification=i.styleSpec.light.position};E.prototype.possiblyEvaluate=function(D,J){return i.sphericalToCartesian(D.expression.evaluate(J))},E.prototype.interpolate=function(D,J,O){return{x:i.number(D.x,J.x,O),y:i.number(D.y,J.y,O),z:i.number(D.z,J.z,O)}};var z=new i.Properties({anchor:new i.DataConstantProperty(i.styleSpec.light.anchor),position:new E,color:new i.DataConstantProperty(i.styleSpec.light.color),intensity:new i.DataConstantProperty(i.styleSpec.light.intensity)}),q="-transition",V=function(Y){function D(J){Y.call(this),this._transitionable=new i.Transitionable(z),this.setLight(J),this._transitioning=this._transitionable.untransitioned()}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getLight=function(){return this._transitionable.serialize()},D.prototype.setLight=function(O,K){if(K===void 0&&(K={}),!this._validate(i.validateLight,O,K))for(var de in O){var ne=O[de];i.endsWith(de,q)?this._transitionable.setTransition(de.slice(0,-q.length),ne):this._transitionable.setValue(de,ne)}},D.prototype.updateTransitions=function(O){this._transitioning=this._transitionable.transitioned(O,this._transitioning)},D.prototype.hasTransition=function(){return this._transitioning.hasTransition()},D.prototype.recalculate=function(O){this.properties=this._transitioning.possiblyEvaluate(O)},D.prototype._validate=function(O,K,de){return de&&de.validate===!1?!1:i.emitValidationErrors(this,O.call(i.validateStyle,i.extend({value:K,style:{glyphs:!0,sprite:!0},styleSpec:i.styleSpec})))},D}(i.Evented),G=function(D,J){this.width=D,this.height=J,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};G.prototype.getDash=function(D,J){var O=D.join(",")+String(J);return this.dashEntry[O]||(this.dashEntry[O]=this.addDash(D,J)),this.dashEntry[O]},G.prototype.getDashRanges=function(D,J,O){var K=D.length%2===1,de=[],ne=K?-D[D.length-1]*O:0,we=D[0]*O,Oe=!0;de.push({left:ne,right:we,isDash:Oe,zeroLength:D[0]===0});for(var ht=D[0],Yt=1;Yt<D.length;Yt++){Oe=!Oe;var cr=D[Yt];ne=ht*O,ht+=cr,we=ht*O,de.push({left:ne,right:we,isDash:Oe,zeroLength:cr===0})}return de},G.prototype.addRoundDash=function(D,J,O){for(var K=J/2,de=-O;de<=O;de++)for(var ne=this.nextRow+O+de,we=this.width*ne,Oe=0,ht=D[Oe],Yt=0;Yt<this.width;Yt++){Yt/ht.right>1&&(ht=D[++Oe]);var cr=Math.abs(Yt-ht.left),Nt=Math.abs(Yt-ht.right),Ne=Math.min(cr,Nt),$e=void 0,st=de/O*(K+1);if(ht.isDash){var It=K-Math.abs(st);$e=Math.sqrt(Ne*Ne+It*It)}else $e=K-Math.sqrt(Ne*Ne+st*st);this.data[we+Yt]=Math.max(0,Math.min(255,$e+128))}},G.prototype.addRegularDash=function(D){for(var J=D.length-1;J>=0;--J){var O=D[J],K=D[J+1];O.zeroLength?D.splice(J,1):K&&K.isDash===O.isDash&&(K.left=O.left,D.splice(J,1))}var de=D[0],ne=D[D.length-1];de.isDash===ne.isDash&&(de.left=ne.left-this.width,ne.right=de.right+this.width);for(var we=this.width*this.nextRow,Oe=0,ht=D[Oe],Yt=0;Yt<this.width;Yt++){Yt/ht.right>1&&(ht=D[++Oe]);var cr=Math.abs(Yt-ht.left),Nt=Math.abs(Yt-ht.right),Ne=Math.min(cr,Nt),$e=ht.isDash?Ne:-Ne;this.data[we+Yt]=Math.max(0,Math.min(255,$e+128))}},G.prototype.addDash=function(D,J){var O=J?7:0,K=2*O+1;if(this.nextRow+K>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var de=0,ne=0;ne<D.length;ne++)de+=D[ne];if(de!==0){var we=this.width/de,Oe=this.getDashRanges(D,this.width,we);J?this.addRoundDash(Oe,we,O):this.addRegularDash(Oe)}var ht={y:(this.nextRow+O+.5)/this.height,height:2*O/this.height,width:de};return this.nextRow+=K,this.dirty=!0,ht},G.prototype.bind=function(D){var J=D.gl;this.texture?(J.bindTexture(J.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,J.texSubImage2D(J.TEXTURE_2D,0,0,0,this.width,this.height,J.ALPHA,J.UNSIGNED_BYTE,this.data))):(this.texture=J.createTexture(),J.bindTexture(J.TEXTURE_2D,this.texture),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_WRAP_S,J.REPEAT),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_WRAP_T,J.REPEAT),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MIN_FILTER,J.LINEAR),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MAG_FILTER,J.LINEAR),J.texImage2D(J.TEXTURE_2D,0,J.ALPHA,this.width,this.height,0,J.ALPHA,J.UNSIGNED_BYTE,this.data))};var Z=function Y(D,J){this.workerPool=D,this.actors=[],this.currentActor=0,this.id=i.uniqueId();for(var O=this.workerPool.acquire(this.id),K=0;K<O.length;K++){var de=O[K],ne=new Y.Actor(de,J,this.id);ne.name="Worker "+K,this.actors.push(ne)}};Z.prototype.broadcast=function(D,J,O){O=O||function(){},i.asyncAll(this.actors,function(K,de){K.send(D,J,de)},O)},Z.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},Z.prototype.remove=function(){this.actors.forEach(function(D){D.remove()}),this.actors=[],this.workerPool.release(this.id)},Z.Actor=i.Actor;function j(Y,D,J){var O=function(K,de){if(K)return J(K);if(de){var ne=i.pick(i.extend(de,Y),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);de.vector_layers&&(ne.vectorLayers=de.vector_layers,ne.vectorLayerIds=ne.vectorLayers.map(function(we){return we.id})),ne.tiles=D.canonicalizeTileset(ne,Y.url),J(null,ne)}};return Y.url?i.getJSON(D.transformRequest(D.normalizeSourceURL(Y.url),i.ResourceType.Source),O):i.browser.frame(function(){return O(null,Y)})}var N=function(D,J,O){this.bounds=i.LngLatBounds.convert(this.validateBounds(D)),this.minzoom=J||0,this.maxzoom=O||24};N.prototype.validateBounds=function(D){return!Array.isArray(D)||D.length!==4?[-180,-90,180,90]:[Math.max(-180,D[0]),Math.max(-90,D[1]),Math.min(180,D[2]),Math.min(90,D[3])]},N.prototype.contains=function(D){var J=Math.pow(2,D.z),O={minX:Math.floor(i.mercatorXfromLng(this.bounds.getWest())*J),minY:Math.floor(i.mercatorYfromLat(this.bounds.getNorth())*J),maxX:Math.ceil(i.mercatorXfromLng(this.bounds.getEast())*J),maxY:Math.ceil(i.mercatorYfromLat(this.bounds.getSouth())*J)},K=D.x>=O.minX&&D.x<O.maxX&&D.y>=O.minY&&D.y<O.maxY;return K};var H=function(Y){function D(J,O,K,de){if(Y.call(this),this.id=J,this.dispatcher=K,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,i.extend(this,i.pick(O,["url","scheme","tileSize","promoteId"])),this._options=i.extend({type:"vector"},O),this._collectResourceTiming=O.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(de)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.load=function(){var O=this;this._loaded=!1,this.fire(new i.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=j(this._options,this.map._requestManager,function(K,de){O._tileJSONRequest=null,O._loaded=!0,K?O.fire(new i.ErrorEvent(K)):de&&(i.extend(O,de),de.bounds&&(O.tileBounds=new N(de.bounds,O.minzoom,O.maxzoom)),i.postTurnstileEvent(de.tiles,O.map._requestManager._customAccessToken),i.postMapLoadEvent(de.tiles,O.map._getMapId(),O.map._requestManager._skuToken,O.map._requestManager._customAccessToken),O.fire(new i.Event("data",{dataType:"source",sourceDataType:"metadata"})),O.fire(new i.Event("data",{dataType:"source",sourceDataType:"content"})))})},D.prototype.loaded=function(){return this._loaded},D.prototype.hasTile=function(O){return!this.tileBounds||this.tileBounds.contains(O.canonical)},D.prototype.onAdd=function(O){this.map=O,this.load()},D.prototype.setSourceProperty=function(O){this._tileJSONRequest&&this._tileJSONRequest.cancel(),O();var K=this.map.style.sourceCaches[this.id];K.clearTiles(),this.load()},D.prototype.setTiles=function(O){var K=this;return this.setSourceProperty(function(){K._options.tiles=O}),this},D.prototype.setUrl=function(O){var K=this;return this.setSourceProperty(function(){K.url=O,K._options.url=O}),this},D.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},D.prototype.serialize=function(){return i.extend({},this._options)},D.prototype.loadTile=function(O,K){var de=this.map._requestManager.normalizeTileURL(O.tileID.canonical.url(this.tiles,this.scheme)),ne={request:this.map._requestManager.transformRequest(de,i.ResourceType.Tile),uid:O.uid,tileID:O.tileID,zoom:O.tileID.overscaledZ,tileSize:this.tileSize*O.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:i.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};ne.request.collectResourceTiming=this._collectResourceTiming,!O.actor||O.state==="expired"?(O.actor=this.dispatcher.getActor(),O.request=O.actor.send("loadTile",ne,we.bind(this))):O.state==="loading"?O.reloadCallback=K:O.request=O.actor.send("reloadTile",ne,we.bind(this));function we(Oe,ht){if(delete O.request,O.aborted)return K(null);if(Oe&&Oe.status!==404)return K(Oe);ht&&ht.resourceTiming&&(O.resourceTiming=ht.resourceTiming),this.map._refreshExpiredTiles&&ht&&O.setExpiryData(ht),O.loadVectorData(ht,this.map.painter),i.cacheEntryPossiblyAdded(this.dispatcher),K(null),O.reloadCallback&&(this.loadTile(O,O.reloadCallback),O.reloadCallback=null)}},D.prototype.abortTile=function(O){O.request&&(O.request.cancel(),delete O.request),O.actor&&O.actor.send("abortTile",{uid:O.uid,type:this.type,source:this.id},void 0)},D.prototype.unloadTile=function(O){O.unloadVectorData(),O.actor&&O.actor.send("removeTile",{uid:O.uid,type:this.type,source:this.id},void 0)},D.prototype.hasTransition=function(){return!1},D}(i.Evented),ie=function(Y){function D(J,O,K,de){Y.call(this),this.id=J,this.dispatcher=K,this.setEventedParent(de),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=i.extend({type:"raster"},O),i.extend(this,i.pick(O,["url","scheme","tileSize"]))}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.load=function(){var O=this;this._loaded=!1,this.fire(new i.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=j(this._options,this.map._requestManager,function(K,de){O._tileJSONRequest=null,O._loaded=!0,K?O.fire(new i.ErrorEvent(K)):de&&(i.extend(O,de),de.bounds&&(O.tileBounds=new N(de.bounds,O.minzoom,O.maxzoom)),i.postTurnstileEvent(de.tiles),i.postMapLoadEvent(de.tiles,O.map._getMapId(),O.map._requestManager._skuToken),O.fire(new i.Event("data",{dataType:"source",sourceDataType:"metadata"})),O.fire(new i.Event("data",{dataType:"source",sourceDataType:"content"})))})},D.prototype.loaded=function(){return this._loaded},D.prototype.onAdd=function(O){this.map=O,this.load()},D.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},D.prototype.serialize=function(){return i.extend({},this._options)},D.prototype.hasTile=function(O){return!this.tileBounds||this.tileBounds.contains(O.canonical)},D.prototype.loadTile=function(O,K){var de=this,ne=this.map._requestManager.normalizeTileURL(O.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);O.request=i.getImage(this.map._requestManager.transformRequest(ne,i.ResourceType.Tile),function(we,Oe){if(delete O.request,O.aborted)O.state="unloaded",K(null);else if(we)O.state="errored",K(we);else if(Oe){de.map._refreshExpiredTiles&&O.setExpiryData(Oe),delete Oe.cacheControl,delete Oe.expires;var ht=de.map.painter.context,Yt=ht.gl;O.texture=de.map.painter.getTileTexture(Oe.width),O.texture?O.texture.update(Oe,{useMipmap:!0}):(O.texture=new i.Texture(ht,Oe,Yt.RGBA,{useMipmap:!0}),O.texture.bind(Yt.LINEAR,Yt.CLAMP_TO_EDGE,Yt.LINEAR_MIPMAP_NEAREST),ht.extTextureFilterAnisotropic&&Yt.texParameterf(Yt.TEXTURE_2D,ht.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,ht.extTextureFilterAnisotropicMax)),O.state="loaded",i.cacheEntryPossiblyAdded(de.dispatcher),K(null)}})},D.prototype.abortTile=function(O,K){O.request&&(O.request.cancel(),delete O.request),K()},D.prototype.unloadTile=function(O,K){O.texture&&this.map.painter.saveTileTexture(O.texture),K()},D.prototype.hasTransition=function(){return!1},D}(i.Evented),ae=function(Y){function D(J,O,K,de){Y.call(this,J,O,K,de),this.type="raster-dem",this.maxzoom=22,this._options=i.extend({type:"raster-dem"},O),this.encoding=O.encoding||"mapbox"}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},D.prototype.loadTile=function(O,K){var de=this.map._requestManager.normalizeTileURL(O.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);O.request=i.getImage(this.map._requestManager.transformRequest(de,i.ResourceType.Tile),ne.bind(this)),O.neighboringTiles=this._getNeighboringTiles(O.tileID);function ne(Oe,ht){if(delete O.request,O.aborted)O.state="unloaded",K(null);else if(Oe)O.state="errored",K(Oe);else if(ht){this.map._refreshExpiredTiles&&O.setExpiryData(ht),delete ht.cacheControl,delete ht.expires;var Yt=i.window.ImageBitmap&&ht instanceof i.window.ImageBitmap&&i.offscreenCanvasSupported(),cr=Yt?ht:i.browser.getImageData(ht,1),Nt={uid:O.uid,coord:O.tileID,source:this.id,rawImageData:cr,encoding:this.encoding};(!O.actor||O.state==="expired")&&(O.actor=this.dispatcher.getActor(),O.actor.send("loadDEMTile",Nt,we.bind(this)))}}function we(Oe,ht){Oe&&(O.state="errored",K(Oe)),ht&&(O.dem=ht,O.needsHillshadePrepare=!0,O.state="loaded",K(null))}},D.prototype._getNeighboringTiles=function(O){var K=O.canonical,de=Math.pow(2,K.z),ne=(K.x-1+de)%de,we=K.x===0?O.wrap-1:O.wrap,Oe=(K.x+1+de)%de,ht=K.x+1===de?O.wrap+1:O.wrap,Yt={};return Yt[new i.OverscaledTileID(O.overscaledZ,we,K.z,ne,K.y).key]={backfilled:!1},Yt[new i.OverscaledTileID(O.overscaledZ,ht,K.z,Oe,K.y).key]={backfilled:!1},K.y>0&&(Yt[new i.OverscaledTileID(O.overscaledZ,we,K.z,ne,K.y-1).key]={backfilled:!1},Yt[new i.OverscaledTileID(O.overscaledZ,O.wrap,K.z,K.x,K.y-1).key]={backfilled:!1},Yt[new i.OverscaledTileID(O.overscaledZ,ht,K.z,Oe,K.y-1).key]={backfilled:!1}),K.y+1<de&&(Yt[new i.OverscaledTileID(O.overscaledZ,we,K.z,ne,K.y+1).key]={backfilled:!1},Yt[new i.OverscaledTileID(O.overscaledZ,O.wrap,K.z,K.x,K.y+1).key]={backfilled:!1},Yt[new i.OverscaledTileID(O.overscaledZ,ht,K.z,Oe,K.y+1).key]={backfilled:!1}),Yt},D.prototype.unloadTile=function(O){O.demTexture&&this.map.painter.saveTileTexture(O.demTexture),O.fbo&&(O.fbo.destroy(),delete O.fbo),O.dem&&delete O.dem,delete O.neighboringTiles,O.state="unloaded",O.actor&&O.actor.send("removeDEMTile",{uid:O.uid,source:this.id})},D}(ie),_e=function(Y){function D(J,O,K,de){Y.call(this),this.id=J,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=K.getActor(),this.setEventedParent(de),this._data=O.data,this._options=i.extend({},O),this._collectResourceTiming=O.collectResourceTiming,this._resourceTiming=[],O.maxzoom!==void 0&&(this.maxzoom=O.maxzoom),O.type&&(this.type=O.type),O.attribution&&(this.attribution=O.attribution),this.promoteId=O.promoteId;var ne=i.EXTENT/this.tileSize;this.workerOptions=i.extend({source:this.id,cluster:O.cluster||!1,geojsonVtOptions:{buffer:(O.buffer!==void 0?O.buffer:128)*ne,tolerance:(O.tolerance!==void 0?O.tolerance:.375)*ne,extent:i.EXTENT,maxZoom:this.maxzoom,lineMetrics:O.lineMetrics||!1,generateId:O.generateId||!1},superclusterOptions:{maxZoom:O.clusterMaxZoom!==void 0?Math.min(O.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,O.clusterMinPoints||2),extent:i.EXTENT,radius:(O.clusterRadius||50)*ne,log:!1,generateId:O.generateId||!1},clusterProperties:O.clusterProperties,filter:O.filter},O.workerOptions)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.load=function(){var O=this;this.fire(new i.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(K){if(K){O.fire(new i.ErrorEvent(K));return}var de={dataType:"source",sourceDataType:"metadata"};O._collectResourceTiming&&O._resourceTiming&&O._resourceTiming.length>0&&(de.resourceTiming=O._resourceTiming,O._resourceTiming=[]),O.fire(new i.Event("data",de))})},D.prototype.onAdd=function(O){this.map=O,this.load()},D.prototype.setData=function(O){var K=this;return this._data=O,this.fire(new i.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(de){if(de){K.fire(new i.ErrorEvent(de));return}var ne={dataType:"source",sourceDataType:"content"};K._collectResourceTiming&&K._resourceTiming&&K._resourceTiming.length>0&&(ne.resourceTiming=K._resourceTiming,K._resourceTiming=[]),K.fire(new i.Event("data",ne))}),this},D.prototype.getClusterExpansionZoom=function(O,K){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:O,source:this.id},K),this},D.prototype.getClusterChildren=function(O,K){return this.actor.send("geojson.getClusterChildren",{clusterId:O,source:this.id},K),this},D.prototype.getClusterLeaves=function(O,K,de,ne){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:O,limit:K,offset:de},ne),this},D.prototype._updateWorkerData=function(O){var K=this;this._loaded=!1;var de=i.extend({},this.workerOptions),ne=this._data;typeof ne=="string"?(de.request=this.map._requestManager.transformRequest(i.browser.resolveURL(ne),i.ResourceType.Source),de.request.collectResourceTiming=this._collectResourceTiming):de.data=JSON.stringify(ne),this.actor.send(this.type+".loadData",de,function(we,Oe){K._removed||Oe&&Oe.abandoned||(K._loaded=!0,Oe&&Oe.resourceTiming&&Oe.resourceTiming[K.id]&&(K._resourceTiming=Oe.resourceTiming[K.id].slice(0)),K.actor.send(K.type+".coalesce",{source:de.source},null),O(we))})},D.prototype.loaded=function(){return this._loaded},D.prototype.loadTile=function(O,K){var de=this,ne=O.actor?"reloadTile":"loadTile";O.actor=this.actor;var we={type:this.type,uid:O.uid,tileID:O.tileID,zoom:O.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:i.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};O.request=this.actor.send(ne,we,function(Oe,ht){return delete O.request,O.unloadVectorData(),O.aborted?K(null):Oe?K(Oe):(O.loadVectorData(ht,de.map.painter,ne==="reloadTile"),K(null))})},D.prototype.abortTile=function(O){O.request&&(O.request.cancel(),delete O.request),O.aborted=!0},D.prototype.unloadTile=function(O){O.unloadVectorData(),this.actor.send("removeTile",{uid:O.uid,type:this.type,source:this.id})},D.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},D.prototype.serialize=function(){return i.extend({},this._options,{type:this.type,data:this._data})},D.prototype.hasTransition=function(){return!1},D}(i.Evented),Ee=i.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Ce=function(Y){function D(J,O,K,de){Y.call(this),this.id=J,this.dispatcher=K,this.coordinates=O.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(de),this.options=O}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.load=function(O,K){var de=this;this._loaded=!1,this.fire(new i.Event("dataloading",{dataType:"source"})),this.url=this.options.url,i.getImage(this.map._requestManager.transformRequest(this.url,i.ResourceType.Image),function(ne,we){de._loaded=!0,ne?de.fire(new i.ErrorEvent(ne)):we&&(de.image=we,O&&(de.coordinates=O),K&&K(),de._finishLoading())})},D.prototype.loaded=function(){return this._loaded},D.prototype.updateImage=function(O){var K=this;return!this.image||!O.url?this:(this.options.url=O.url,this.load(O.coordinates,function(){K.texture=null}),this)},D.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new i.Event("data",{dataType:"source",sourceDataType:"metadata"})))},D.prototype.onAdd=function(O){this.map=O,this.load()},D.prototype.setCoordinates=function(O){var K=this;this.coordinates=O;var de=O.map(i.MercatorCoordinate.fromLngLat);this.tileID=ge(de),this.minzoom=this.maxzoom=this.tileID.z;var ne=de.map(function(we){return K.tileID.getTilePoint(we)._round()});return this._boundsArray=new i.StructArrayLayout4i8,this._boundsArray.emplaceBack(ne[0].x,ne[0].y,0,0),this._boundsArray.emplaceBack(ne[1].x,ne[1].y,i.EXTENT,0),this._boundsArray.emplaceBack(ne[3].x,ne[3].y,0,i.EXTENT),this._boundsArray.emplaceBack(ne[2].x,ne[2].y,i.EXTENT,i.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new i.Event("data",{dataType:"source",sourceDataType:"content"})),this},D.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var O=this.map.painter.context,K=O.gl;this.boundsBuffer||(this.boundsBuffer=O.createVertexBuffer(this._boundsArray,Ee.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new i.Texture(O,this.image,K.RGBA),this.texture.bind(K.LINEAR,K.CLAMP_TO_EDGE));for(var de in this.tiles){var ne=this.tiles[de];ne.state!=="loaded"&&(ne.state="loaded",ne.texture=this.texture)}}},D.prototype.loadTile=function(O,K){this.tileID&&this.tileID.equals(O.tileID.canonical)?(this.tiles[String(O.tileID.wrap)]=O,O.buckets={},K(null)):(O.state="errored",K(null))},D.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},D.prototype.hasTransition=function(){return!1},D}(i.Evented);function ge(Y){for(var D=1/0,J=1/0,O=-1/0,K=-1/0,de=0,ne=Y;de<ne.length;de+=1){var we=ne[de];D=Math.min(D,we.x),J=Math.min(J,we.y),O=Math.max(O,we.x),K=Math.max(K,we.y)}var Oe=O-D,ht=K-J,Yt=Math.max(Oe,ht),cr=Math.max(0,Math.floor(-Math.log(Yt)/Math.LN2)),Nt=Math.pow(2,cr);return new i.CanonicalTileID(cr,Math.floor((D+O)/2*Nt),Math.floor((J+K)/2*Nt))}var re=function(Y){function D(J,O,K,de){Y.call(this,J,O,K,de),this.roundZoom=!0,this.type="video",this.options=O}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.load=function(){var O=this;this._loaded=!1;var K=this.options;this.urls=[];for(var de=0,ne=K.urls;de<ne.length;de+=1){var we=ne[de];this.urls.push(this.map._requestManager.transformRequest(we,i.ResourceType.Source).url)}i.getVideo(this.urls,function(Oe,ht){O._loaded=!0,Oe?O.fire(new i.ErrorEvent(Oe)):ht&&(O.video=ht,O.video.loop=!0,O.video.addEventListener("playing",function(){O.map.triggerRepaint()}),O.map&&O.video.play(),O._finishLoading())})},D.prototype.pause=function(){this.video&&this.video.pause()},D.prototype.play=function(){this.video&&this.video.play()},D.prototype.seek=function(O){if(this.video){var K=this.video.seekable;O<K.start(0)||O>K.end(0)?this.fire(new i.ErrorEvent(new i.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+K.start(0)+" and "+K.end(0)+"-second mark."))):this.video.currentTime=O}},D.prototype.getVideo=function(){return this.video},D.prototype.onAdd=function(O){this.map||(this.map=O,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},D.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var O=this.map.painter.context,K=O.gl;this.boundsBuffer||(this.boundsBuffer=O.createVertexBuffer(this._boundsArray,Ee.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(K.LINEAR,K.CLAMP_TO_EDGE),K.texSubImage2D(K.TEXTURE_2D,0,0,0,K.RGBA,K.UNSIGNED_BYTE,this.video)):(this.texture=new i.Texture(O,this.video,K.RGBA),this.texture.bind(K.LINEAR,K.CLAMP_TO_EDGE));for(var de in this.tiles){var ne=this.tiles[de];ne.state!=="loaded"&&(ne.state="loaded",ne.texture=this.texture)}}},D.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},D.prototype.hasTransition=function(){return this.video&&!this.video.paused},D}(Ce),Se=function(Y){function D(J,O,K,de){Y.call(this,J,O,K,de),O.coordinates?(!Array.isArray(O.coordinates)||O.coordinates.length!==4||O.coordinates.some(function(ne){return!Array.isArray(ne)||ne.length!==2||ne.some(function(we){return typeof we!="number"})}))&&this.fire(new i.ErrorEvent(new i.ValidationError("sources."+J,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new i.ErrorEvent(new i.ValidationError("sources."+J,null,'missing required property "coordinates"'))),O.animate&&typeof O.animate!="boolean"&&this.fire(new i.ErrorEvent(new i.ValidationError("sources."+J,null,'optional "animate" property must be a boolean value'))),O.canvas?typeof O.canvas!="string"&&!(O.canvas instanceof i.window.HTMLCanvasElement)&&this.fire(new i.ErrorEvent(new i.ValidationError("sources."+J,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 i.ErrorEvent(new i.ValidationError("sources."+J,null,'missing required property "canvas"'))),this.options=O,this.animate=O.animate!==void 0?O.animate:!0}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof i.window.HTMLCanvasElement?this.options.canvas:i.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new i.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},D.prototype.getCanvas=function(){return this.canvas},D.prototype.onAdd=function(O){this.map=O,this.load(),this.canvas&&this.animate&&this.play()},D.prototype.onRemove=function(){this.pause()},D.prototype.prepare=function(){var O=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,O=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,O=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var K=this.map.painter.context,de=K.gl;this.boundsBuffer||(this.boundsBuffer=K.createVertexBuffer(this._boundsArray,Ee.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(O||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new i.Texture(K,this.canvas,de.RGBA,{premultiply:!0});for(var ne in this.tiles){var we=this.tiles[ne];we.state!=="loaded"&&(we.state="loaded",we.texture=this.texture)}}},D.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},D.prototype.hasTransition=function(){return this._playing},D.prototype._hasInvalidDimensions=function(){for(var O=0,K=[this.canvas.width,this.canvas.height];O<K.length;O+=1){var de=K[O];if(isNaN(de)||de<=0)return!0}return!1},D}(Ce),ke={vector:H,raster:ie,"raster-dem":ae,geojson:_e,video:re,image:Ce,canvas:Se},be=function(Y,D,J,O){var K=new ke[D.type](Y,D,J,O);if(K.id!==Y)throw new Error("Expected Source id to be "+Y+" instead of "+K.id);return i.bindAll(["load","abort","unload","serialize","prepare"],K),K},Be=function(Y){return ke[Y]},Le=function(Y,D){ke[Y]=D};function me(Y,D){var J=i.identity([]);return i.translate(J,J,[1,1,0]),i.scale(J,J,[Y.width*.5,Y.height*.5,1]),i.multiply(J,J,Y.calculatePosMatrix(D.toUnwrapped()))}function Pe(Y,D,J){if(Y)for(var O=0,K=Y;O<K.length;O+=1){var de=K[O],ne=D[de];if(ne&&ne.source===J&&ne.type==="fill-extrusion")return!0}else for(var we in D){var Oe=D[we];if(Oe.source===J&&Oe.type==="fill-extrusion")return!0}return!1}function ce(Y,D,J,O,K,de){var ne=Pe(K&&K.layers,D,Y.id),we=de.maxPitchScaleFactor(),Oe=Y.tilesIn(O,we,ne);Oe.sort(mt);for(var ht=[],Yt=0,cr=Oe;Yt<cr.length;Yt+=1){var Nt=cr[Yt];ht.push({wrappedTileID:Nt.tileID.wrapped().key,queryResults:Nt.tile.queryRenderedFeatures(D,J,Y._state,Nt.queryGeometry,Nt.cameraQueryGeometry,Nt.scale,K,de,we,me(Y.transform,Nt.tileID))})}var Ne=Ht(ht);for(var $e in Ne)Ne[$e].forEach(function(st){var It=st.feature,Bt=Y.getFeatureState(It.layer["source-layer"],It.id);It.source=It.layer.source,It.layer["source-layer"]&&(It.sourceLayer=It.layer["source-layer"]),It.state=Bt});return Ne}function He(Y,D,J,O,K,de,ne){for(var we={},Oe=de.queryRenderedSymbols(O),ht=[],Yt=0,cr=Object.keys(Oe).map(Number);Yt<cr.length;Yt+=1){var Nt=cr[Yt];ht.push(ne[Nt])}ht.sort(mt);for(var Ne=function(){var Ft=st[$e],Ut=Ft.featureIndex.lookupSymbolFeatures(Oe[Ft.bucketInstanceId],D,Ft.bucketIndex,Ft.sourceLayerIndex,K.filter,K.layers,K.availableImages,Y);for(var zt in Ut){var _t=we[zt]=we[zt]||[],Dt=Ut[zt];Dt.sort(function(Br,Di){var ci=Ft.featureSortOrder;if(ci){var bi=ci.indexOf(Br.featureIndex),gn=ci.indexOf(Di.featureIndex);return gn-bi}else return Di.featureIndex-Br.featureIndex});for(var vt=0,lr=Dt;vt<lr.length;vt+=1){var _r=lr[vt];_t.push(_r)}}},$e=0,st=ht;$e<st.length;$e+=1)Ne();var It=function(Ft){we[Ft].forEach(function(Ut){var zt=Ut.feature,_t=Y[Ft],Dt=J[_t.source],vt=Dt.getFeatureState(zt.layer["source-layer"],zt.id);zt.source=zt.layer.source,zt.layer["source-layer"]&&(zt.sourceLayer=zt.layer["source-layer"]),zt.state=vt})};for(var Bt in we)It(Bt);return we}function lt(Y,D){for(var J=Y.getRenderableIds().map(function(Oe){return Y.getTileByID(Oe)}),O=[],K={},de=0;de<J.length;de++){var ne=J[de],we=ne.tileID.canonical.key;K[we]||(K[we]=!0,ne.querySourceFeatures(O,D))}return O}function mt(Y,D){var J=Y.tileID,O=D.tileID;return J.overscaledZ-O.overscaledZ||J.canonical.y-O.canonical.y||J.wrap-O.wrap||J.canonical.x-O.canonical.x}function Ht(Y){for(var D={},J={},O=0,K=Y;O<K.length;O+=1){var de=K[O],ne=de.queryResults,we=de.wrappedTileID,Oe=J[we]=J[we]||{};for(var ht in ne)for(var Yt=ne[ht],cr=Oe[ht]=Oe[ht]||{},Nt=D[ht]=D[ht]||[],Ne=0,$e=Yt;Ne<$e.length;Ne+=1){var st=$e[Ne];cr[st.featureIndex]||(cr[st.featureIndex]=!0,Nt.push(st))}}return D}var at=function(D,J){this.max=D,this.onRemove=J,this.reset()};at.prototype.reset=function(){for(var D in this.data)for(var J=0,O=this.data[D];J<O.length;J+=1){var K=O[J];K.timeout&&clearTimeout(K.timeout),this.onRemove(K.value)}return this.data={},this.order=[],this},at.prototype.add=function(D,J,O){var K=this,de=D.wrapped().key;this.data[de]===void 0&&(this.data[de]=[]);var ne={value:J,timeout:void 0};if(O!==void 0&&(ne.timeout=setTimeout(function(){K.remove(D,ne)},O)),this.data[de].push(ne),this.order.push(de),this.order.length>this.max){var we=this._getAndRemoveByKey(this.order[0]);we&&this.onRemove(we)}return this},at.prototype.has=function(D){return D.wrapped().key in this.data},at.prototype.getAndRemove=function(D){return this.has(D)?this._getAndRemoveByKey(D.wrapped().key):null},at.prototype._getAndRemoveByKey=function(D){var J=this.data[D].shift();return J.timeout&&clearTimeout(J.timeout),this.data[D].length===0&&delete this.data[D],this.order.splice(this.order.indexOf(D),1),J.value},at.prototype.getByKey=function(D){var J=this.data[D];return J?J[0].value:null},at.prototype.get=function(D){if(!this.has(D))return null;var J=this.data[D.wrapped().key][0];return J.value},at.prototype.remove=function(D,J){if(!this.has(D))return this;var O=D.wrapped().key,K=J===void 0?0:this.data[O].indexOf(J),de=this.data[O][K];return this.data[O].splice(K,1),de.timeout&&clearTimeout(de.timeout),this.data[O].length===0&&delete this.data[O],this.onRemove(de.value),this.order.splice(this.order.indexOf(O),1),this},at.prototype.setMaxSize=function(D){for(this.max=D;this.order.length>this.max;){var J=this._getAndRemoveByKey(this.order[0]);J&&this.onRemove(J)}return this},at.prototype.filter=function(D){var J=[];for(var O in this.data)for(var K=0,de=this.data[O];K<de.length;K+=1){var ne=de[K];D(ne.value)||J.push(ne)}for(var we=0,Oe=J;we<Oe.length;we+=1){var ht=Oe[we];this.remove(ht.value.tileID,ht)}};var ct=function(D,J,O){this.context=D;var K=D.gl;this.buffer=K.createBuffer(),this.dynamicDraw=!!O,this.context.unbindVAO(),D.bindElementBuffer.set(this.buffer),K.bufferData(K.ELEMENT_ARRAY_BUFFER,J.arrayBuffer,this.dynamicDraw?K.DYNAMIC_DRAW:K.STATIC_DRAW),this.dynamicDraw||delete J.arrayBuffer};ct.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},ct.prototype.updateData=function(D){var J=this.context.gl;this.context.unbindVAO(),this.bind(),J.bufferSubData(J.ELEMENT_ARRAY_BUFFER,0,D.arrayBuffer)},ct.prototype.destroy=function(){var D=this.context.gl;this.buffer&&(D.deleteBuffer(this.buffer),delete this.buffer)};var ar={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Vt=function(D,J,O,K){this.length=J.length,this.attributes=O,this.itemSize=J.bytesPerElement,this.dynamicDraw=K,this.context=D;var de=D.gl;this.buffer=de.createBuffer(),D.bindVertexBuffer.set(this.buffer),de.bufferData(de.ARRAY_BUFFER,J.arrayBuffer,this.dynamicDraw?de.DYNAMIC_DRAW:de.STATIC_DRAW),this.dynamicDraw||delete J.arrayBuffer};Vt.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Vt.prototype.updateData=function(D){var J=this.context.gl;this.bind(),J.bufferSubData(J.ARRAY_BUFFER,0,D.arrayBuffer)},Vt.prototype.enableAttributes=function(D,J){for(var O=0;O<this.attributes.length;O++){var K=this.attributes[O],de=J.attributes[K.name];de!==void 0&&D.enableVertexAttribArray(de)}},Vt.prototype.setVertexAttribPointers=function(D,J,O){for(var K=0;K<this.attributes.length;K++){var de=this.attributes[K],ne=J.attributes[de.name];ne!==void 0&&D.vertexAttribPointer(ne,de.components,D[ar[de.type]],!1,this.itemSize,de.offset+this.itemSize*(O||0))}},Vt.prototype.destroy=function(){var D=this.context.gl;this.buffer&&(D.deleteBuffer(this.buffer),delete this.buffer)};var rr=function(D){this.gl=D.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};rr.prototype.get=function(){return this.current},rr.prototype.set=function(D){},rr.prototype.getDefault=function(){return this.default},rr.prototype.setDefault=function(){this.set(this.default)};var tt=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return i.Color.transparent},D.prototype.set=function(O){var K=this.current;O.r===K.r&&O.g===K.g&&O.b===K.b&&O.a===K.a&&!this.dirty||(this.gl.clearColor(O.r,O.g,O.b,O.a),this.current=O,this.dirty=!1)},D}(rr),je=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return 1},D.prototype.set=function(O){O===this.current&&!this.dirty||(this.gl.clearDepth(O),this.current=O,this.dirty=!1)},D}(rr),Ue=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return 0},D.prototype.set=function(O){O===this.current&&!this.dirty||(this.gl.clearStencil(O),this.current=O,this.dirty=!1)},D}(rr),Ae=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return[!0,!0,!0,!0]},D.prototype.set=function(O){var K=this.current;O[0]===K[0]&&O[1]===K[1]&&O[2]===K[2]&&O[3]===K[3]&&!this.dirty||(this.gl.colorMask(O[0],O[1],O[2],O[3]),this.current=O,this.dirty=!1)},D}(rr),rt=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return!0},D.prototype.set=function(O){O===this.current&&!this.dirty||(this.gl.depthMask(O),this.current=O,this.dirty=!1)},D}(rr),St=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return 255},D.prototype.set=function(O){O===this.current&&!this.dirty||(this.gl.stencilMask(O),this.current=O,this.dirty=!1)},D}(rr),Tt=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},D.prototype.set=function(O){var K=this.current;O.func===K.func&&O.ref===K.ref&&O.mask===K.mask&&!this.dirty||(this.gl.stencilFunc(O.func,O.ref,O.mask),this.current=O,this.dirty=!1)},D}(rr),dt=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){var O=this.gl;return[O.KEEP,O.KEEP,O.KEEP]},D.prototype.set=function(O){var K=this.current;O[0]===K[0]&&O[1]===K[1]&&O[2]===K[2]&&!this.dirty||(this.gl.stencilOp(O[0],O[1],O[2]),this.current=O,this.dirty=!1)},D}(rr),Et=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return!1},D.prototype.set=function(O){if(!(O===this.current&&!this.dirty)){var K=this.gl;O?K.enable(K.STENCIL_TEST):K.disable(K.STENCIL_TEST),this.current=O,this.dirty=!1}},D}(rr),pt=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return[0,1]},D.prototype.set=function(O){var K=this.current;O[0]===K[0]&&O[1]===K[1]&&!this.dirty||(this.gl.depthRange(O[0],O[1]),this.current=O,this.dirty=!1)},D}(rr),jt=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return!1},D.prototype.set=function(O){if(!(O===this.current&&!this.dirty)){var K=this.gl;O?K.enable(K.DEPTH_TEST):K.disable(K.DEPTH_TEST),this.current=O,this.dirty=!1}},D}(rr),or=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return this.gl.LESS},D.prototype.set=function(O){O===this.current&&!this.dirty||(this.gl.depthFunc(O),this.current=O,this.dirty=!1)},D}(rr),mr=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return!1},D.prototype.set=function(O){if(!(O===this.current&&!this.dirty)){var K=this.gl;O?K.enable(K.BLEND):K.disable(K.BLEND),this.current=O,this.dirty=!1}},D}(rr),Ar=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){var O=this.gl;return[O.ONE,O.ZERO]},D.prototype.set=function(O){var K=this.current;O[0]===K[0]&&O[1]===K[1]&&!this.dirty||(this.gl.blendFunc(O[0],O[1]),this.current=O,this.dirty=!1)},D}(rr),ei=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return i.Color.transparent},D.prototype.set=function(O){var K=this.current;O.r===K.r&&O.g===K.g&&O.b===K.b&&O.a===K.a&&!this.dirty||(this.gl.blendColor(O.r,O.g,O.b,O.a),this.current=O,this.dirty=!1)},D}(rr),qr=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return this.gl.FUNC_ADD},D.prototype.set=function(O){O===this.current&&!this.dirty||(this.gl.blendEquation(O),this.current=O,this.dirty=!1)},D}(rr),jr=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return!1},D.prototype.set=function(O){if(!(O===this.current&&!this.dirty)){var K=this.gl;O?K.enable(K.CULL_FACE):K.disable(K.CULL_FACE),this.current=O,this.dirty=!1}},D}(rr),gt=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return this.gl.BACK},D.prototype.set=function(O){O===this.current&&!this.dirty||(this.gl.cullFace(O),this.current=O,this.dirty=!1)},D}(rr),Ge=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return this.gl.CCW},D.prototype.set=function(O){O===this.current&&!this.dirty||(this.gl.frontFace(O),this.current=O,this.dirty=!1)},D}(rr),Je=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return null},D.prototype.set=function(O){O===this.current&&!this.dirty||(this.gl.useProgram(O),this.current=O,this.dirty=!1)},D}(rr),We=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return this.gl.TEXTURE0},D.prototype.set=function(O){O===this.current&&!this.dirty||(this.gl.activeTexture(O),this.current=O,this.dirty=!1)},D}(rr),et=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){var O=this.gl;return[0,0,O.drawingBufferWidth,O.drawingBufferHeight]},D.prototype.set=function(O){var K=this.current;O[0]===K[0]&&O[1]===K[1]&&O[2]===K[2]&&O[3]===K[3]&&!this.dirty||(this.gl.viewport(O[0],O[1],O[2],O[3]),this.current=O,this.dirty=!1)},D}(rr),xt=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return null},D.prototype.set=function(O){if(!(O===this.current&&!this.dirty)){var K=this.gl;K.bindFramebuffer(K.FRAMEBUFFER,O),this.current=O,this.dirty=!1}},D}(rr),At=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return null},D.prototype.set=function(O){if(!(O===this.current&&!this.dirty)){var K=this.gl;K.bindRenderbuffer(K.RENDERBUFFER,O),this.current=O,this.dirty=!1}},D}(rr),Kt=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return null},D.prototype.set=function(O){if(!(O===this.current&&!this.dirty)){var K=this.gl;K.bindTexture(K.TEXTURE_2D,O),this.current=O,this.dirty=!1}},D}(rr),Qt=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return null},D.prototype.set=function(O){if(!(O===this.current&&!this.dirty)){var K=this.gl;K.bindBuffer(K.ARRAY_BUFFER,O),this.current=O,this.dirty=!1}},D}(rr),Mr=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return null},D.prototype.set=function(O){var K=this.gl;K.bindBuffer(K.ELEMENT_ARRAY_BUFFER,O),this.current=O,this.dirty=!1},D}(rr),Gr=function(Y){function D(J){Y.call(this,J),this.vao=J.extVertexArrayObject}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return null},D.prototype.set=function(O){!this.vao||O===this.current&&!this.dirty||(this.vao.bindVertexArrayOES(O),this.current=O,this.dirty=!1)},D}(rr),Ir=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return 4},D.prototype.set=function(O){if(!(O===this.current&&!this.dirty)){var K=this.gl;K.pixelStorei(K.UNPACK_ALIGNMENT,O),this.current=O,this.dirty=!1}},D}(rr),Yr=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return!1},D.prototype.set=function(O){if(!(O===this.current&&!this.dirty)){var K=this.gl;K.pixelStorei(K.UNPACK_PREMULTIPLY_ALPHA_WEBGL,O),this.current=O,this.dirty=!1}},D}(rr),_i=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return!1},D.prototype.set=function(O){if(!(O===this.current&&!this.dirty)){var K=this.gl;K.pixelStorei(K.UNPACK_FLIP_Y_WEBGL,O),this.current=O,this.dirty=!1}},D}(rr),Pi=function(Y){function D(J,O){Y.call(this,J),this.context=J,this.parent=O}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.getDefault=function(){return null},D}(rr),ai=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.setDirty=function(){this.dirty=!0},D.prototype.set=function(O){if(!(O===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var K=this.gl;K.framebufferTexture2D(K.FRAMEBUFFER,K.COLOR_ATTACHMENT0,K.TEXTURE_2D,O,0),this.current=O,this.dirty=!1}},D}(Pi),mi=function(Y){function D(){Y.apply(this,arguments)}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.set=function(O){if(!(O===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var K=this.gl;K.framebufferRenderbuffer(K.FRAMEBUFFER,K.DEPTH_ATTACHMENT,K.RENDERBUFFER,O),this.current=O,this.dirty=!1}},D}(Pi),un=function(D,J,O,K){this.context=D,this.width=J,this.height=O;var de=D.gl,ne=this.framebuffer=de.createFramebuffer();this.colorAttachment=new ai(D,ne),K&&(this.depthAttachment=new mi(D,ne))};un.prototype.destroy=function(){var D=this.context.gl,J=this.colorAttachment.get();if(J&&D.deleteTexture(J),this.depthAttachment){var O=this.depthAttachment.get();O&&D.deleteRenderbuffer(O)}D.deleteFramebuffer(this.framebuffer)};var Fn=519,An=function(D,J,O){this.func=D,this.mask=J,this.range=O};An.ReadOnly=!1,An.ReadWrite=!0,An.disabled=new An(Fn,An.ReadOnly,[0,1]);var Hn=519,Qn=7680,Vi=function(D,J,O,K,de,ne){this.test=D,this.ref=J,this.mask=O,this.fail=K,this.depthFail=de,this.pass=ne};Vi.disabled=new Vi({func:Hn,mask:0},0,0,Qn,Qn,Qn);var Kn=0,Jn=1,Gt=771,wt=function(D,J,O){this.blendFunction=D,this.blendColor=J,this.mask=O};wt.Replace=[Jn,Kn],wt.disabled=new wt(wt.Replace,i.Color.transparent,[!1,!1,!1,!1]),wt.unblended=new wt(wt.Replace,i.Color.transparent,[!0,!0,!0,!0]),wt.alphaBlended=new wt([Jn,Gt],i.Color.transparent,[!0,!0,!0,!0]);var tr=1029,ir=2305,wr=function(D,J,O){this.enable=D,this.mode=J,this.frontFace=O};wr.disabled=new wr(!1,tr,ir),wr.backCCW=new wr(!0,tr,ir);var Xr=function(D){this.gl=D,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new tt(this),this.clearDepth=new je(this),this.clearStencil=new Ue(this),this.colorMask=new Ae(this),this.depthMask=new rt(this),this.stencilMask=new St(this),this.stencilFunc=new Tt(this),this.stencilOp=new dt(this),this.stencilTest=new Et(this),this.depthRange=new pt(this),this.depthTest=new jt(this),this.depthFunc=new or(this),this.blend=new mr(this),this.blendFunc=new Ar(this),this.blendColor=new ei(this),this.blendEquation=new qr(this),this.cullFace=new jr(this),this.cullFaceSide=new gt(this),this.frontFace=new Ge(this),this.program=new Je(this),this.activeTexture=new We(this),this.viewport=new et(this),this.bindFramebuffer=new xt(this),this.bindRenderbuffer=new At(this),this.bindTexture=new Kt(this),this.bindVertexBuffer=new Qt(this),this.bindElementBuffer=new Mr(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new Gr(this),this.pixelStoreUnpack=new Ir(this),this.pixelStoreUnpackPremultiplyAlpha=new Yr(this),this.pixelStoreUnpackFlipY=new _i(this),this.extTextureFilterAnisotropic=D.getExtension("EXT_texture_filter_anisotropic")||D.getExtension("MOZ_EXT_texture_filter_anisotropic")||D.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=D.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=D.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(D.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=D.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=D.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=D.getParameter(D.MAX_TEXTURE_SIZE)};Xr.prototype.setDefault=function(){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()},Xr.prototype.setDirty=function(){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},Xr.prototype.createIndexBuffer=function(D,J){return new ct(this,D,J)},Xr.prototype.createVertexBuffer=function(D,J,O){return new Vt(this,D,J,O)},Xr.prototype.createRenderbuffer=function(D,J,O){var K=this.gl,de=K.createRenderbuffer();return this.bindRenderbuffer.set(de),K.renderbufferStorage(K.RENDERBUFFER,D,J,O),this.bindRenderbuffer.set(null),de},Xr.prototype.createFramebuffer=function(D,J,O){return new un(this,D,J,O)},Xr.prototype.clear=function(D){var J=D.color,O=D.depth,K=this.gl,de=0;J&&(de|=K.COLOR_BUFFER_BIT,this.clearColor.set(J),this.colorMask.set([!0,!0,!0,!0])),typeof O!="undefined"&&(de|=K.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(O),this.depthMask.set(!0)),K.clear(de)},Xr.prototype.setCullFace=function(D){D.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(D.mode),this.frontFace.set(D.frontFace))},Xr.prototype.setDepthMode=function(D){D.func===this.gl.ALWAYS&&!D.mask?this.depthTest.set(!1):(this.depthTest.set(!0),this.depthFunc.set(D.func),this.depthMask.set(D.mask),this.depthRange.set(D.range))},Xr.prototype.setStencilMode=function(D){D.test.func===this.gl.ALWAYS&&!D.mask?this.stencilTest.set(!1):(this.stencilTest.set(!0),this.stencilMask.set(D.mask),this.stencilOp.set([D.fail,D.depthFail,D.pass]),this.stencilFunc.set({func:D.test.func,ref:D.ref,mask:D.test.mask}))},Xr.prototype.setColorMode=function(D){i.deepEqual(D.blendFunction,wt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(D.blendFunction),this.blendColor.set(D.blendColor)),this.colorMask.set(D.mask)},Xr.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var ti=function(Y){function D(J,O,K){var de=this;Y.call(this),this.id=J,this.dispatcher=K,this.on("data",function(ne){ne.dataType==="source"&&ne.sourceDataType==="metadata"&&(de._sourceLoaded=!0),de._sourceLoaded&&!de._paused&&ne.dataType==="source"&&ne.sourceDataType==="content"&&(de.reload(),de.transform&&de.update(de.transform))}),this.on("error",function(){de._sourceErrored=!0}),this._source=be(J,O,K,this),this._tiles={},this._cache=new at(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new i.SourceFeatureState}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.onAdd=function(O){this.map=O,this._maxTileCacheSize=O?O._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(O)},D.prototype.onRemove=function(O){this._source&&this._source.onRemove&&this._source.onRemove(O)},D.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var O in this._tiles){var K=this._tiles[O];if(K.state!=="loaded"&&K.state!=="errored")return!1}return!0},D.prototype.getSource=function(){return this._source},D.prototype.pause=function(){this._paused=!0},D.prototype.resume=function(){if(this._paused){var O=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,O&&this.reload(),this.transform&&this.update(this.transform)}},D.prototype._loadTile=function(O,K){return this._source.loadTile(O,K)},D.prototype._unloadTile=function(O){if(this._source.unloadTile)return this._source.unloadTile(O,function(){})},D.prototype._abortTile=function(O){if(this._source.abortTile)return this._source.abortTile(O,function(){})},D.prototype.serialize=function(){return this._source.serialize()},D.prototype.prepare=function(O){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(var K in this._tiles){var de=this._tiles[K];de.upload(O),de.prepare(this.map.style.imageManager)}},D.prototype.getIds=function(){return i.values(this._tiles).map(function(O){return O.tileID}).sort($r).map(function(O){return O.key})},D.prototype.getRenderableIds=function(O){var K=this,de=[];for(var ne in this._tiles)this._isIdRenderable(ne,O)&&de.push(this._tiles[ne]);return O?de.sort(function(we,Oe){var ht=we.tileID,Yt=Oe.tileID,cr=new i.Point(ht.canonical.x,ht.canonical.y)._rotate(K.transform.angle),Nt=new i.Point(Yt.canonical.x,Yt.canonical.y)._rotate(K.transform.angle);return ht.overscaledZ-Yt.overscaledZ||Nt.y-cr.y||Nt.x-cr.x}).map(function(we){return we.tileID.key}):de.map(function(we){return we.tileID}).sort($r).map(function(we){return we.key})},D.prototype.hasRenderableParent=function(O){var K=this.findLoadedParent(O,0);return K?this._isIdRenderable(K.tileID.key):!1},D.prototype._isIdRenderable=function(O,K){return this._tiles[O]&&this._tiles[O].hasData()&&!this._coveredTiles[O]&&(K||!this._tiles[O].holdingForFade())},D.prototype.reload=function(){if(this._paused){this._shouldReloadOnResume=!0;return}this._cache.reset();for(var O in this._tiles)this._tiles[O].state!=="errored"&&this._reloadTile(O,"reloading")},D.prototype._reloadTile=function(O,K){var de=this._tiles[O];de&&(de.state!=="loading"&&(de.state=K),this._loadTile(de,this._tileLoaded.bind(this,de,O,K)))},D.prototype._tileLoaded=function(O,K,de,ne){if(ne){O.state="errored",ne.status!==404?this._source.fire(new i.ErrorEvent(ne,{tile:O})):this.update(this.transform);return}O.timeAdded=i.browser.now(),de==="expired"&&(O.refreshedUponExpiration=!0),this._setTileReloadTimer(K,O),this.getSource().type==="raster-dem"&&O.dem&&this._backfillDEM(O),this._state.initializeTileState(O,this.map?this.map.painter:null),this._source.fire(new i.Event("data",{dataType:"source",tile:O,coord:O.tileID}))},D.prototype._backfillDEM=function(O){for(var K=this.getRenderableIds(),de=0;de<K.length;de++){var ne=K[de];if(O.neighboringTiles&&O.neighboringTiles[ne]){var we=this.getTileByID(ne);Oe(O,we),Oe(we,O)}}function Oe(ht,Yt){ht.needsHillshadePrepare=!0;var cr=Yt.tileID.canonical.x-ht.tileID.canonical.x,Nt=Yt.tileID.canonical.y-ht.tileID.canonical.y,Ne=Math.pow(2,ht.tileID.canonical.z),$e=Yt.tileID.key;cr===0&&Nt===0||Math.abs(Nt)>1||(Math.abs(cr)>1&&(Math.abs(cr+Ne)===1?cr+=Ne:Math.abs(cr-Ne)===1&&(cr-=Ne)),!(!Yt.dem||!ht.dem)&&(ht.dem.backfillBorder(Yt.dem,cr,Nt),ht.neighboringTiles&&ht.neighboringTiles[$e]&&(ht.neighboringTiles[$e].backfilled=!0)))}},D.prototype.getTile=function(O){return this.getTileByID(O.key)},D.prototype.getTileByID=function(O){return this._tiles[O]},D.prototype._retainLoadedChildren=function(O,K,de,ne){for(var we in this._tiles){var Oe=this._tiles[we];if(!(ne[we]||!Oe.hasData()||Oe.tileID.overscaledZ<=K||Oe.tileID.overscaledZ>de)){for(var ht=Oe.tileID;Oe&&Oe.tileID.overscaledZ>K+1;){var Yt=Oe.tileID.scaledTo(Oe.tileID.overscaledZ-1);Oe=this._tiles[Yt.key],Oe&&Oe.hasData()&&(ht=Yt)}for(var cr=ht;cr.overscaledZ>K;)if(cr=cr.scaledTo(cr.overscaledZ-1),O[cr.key]){ne[ht.key]=ht;break}}}},D.prototype.findLoadedParent=function(O,K){if(O.key in this._loadedParentTiles){var de=this._loadedParentTiles[O.key];return de&&de.tileID.overscaledZ>=K?de:null}for(var ne=O.overscaledZ-1;ne>=K;ne--){var we=O.scaledTo(ne),Oe=this._getLoadedTile(we);if(Oe)return Oe}},D.prototype._getLoadedTile=function(O){var K=this._tiles[O.key];if(K&&K.hasData())return K;var de=this._cache.getByKey(O.wrapped().key);return de},D.prototype.updateCacheSize=function(O){var K=Math.ceil(O.width/this._source.tileSize)+1,de=Math.ceil(O.height/this._source.tileSize)+1,ne=K*de,we=5,Oe=Math.floor(ne*we),ht=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Oe):Oe;this._cache.setMaxSize(ht)},D.prototype.handleWrapJump=function(O){var K=this._prevLng===void 0?O:this._prevLng,de=O-K,ne=de/360,we=Math.round(ne);if(this._prevLng=O,we){var Oe={};for(var ht in this._tiles){var Yt=this._tiles[ht];Yt.tileID=Yt.tileID.unwrapTo(Yt.tileID.wrap+we),Oe[Yt.tileID.key]=Yt}this._tiles=Oe;for(var cr in this._timers)clearTimeout(this._timers[cr]),delete this._timers[cr];for(var Nt in this._tiles){var Ne=this._tiles[Nt];this._setTileReloadTimer(Nt,Ne)}}},D.prototype.update=function(O){var K=this;if(this.transform=O,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(O),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var de;this.used?this._source.tileID?de=O.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(Br){return new i.OverscaledTileID(Br.canonical.z,Br.wrap,Br.canonical.z,Br.canonical.x,Br.canonical.y)}):(de=O.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(de=de.filter(function(Br){return K._source.hasTile(Br)}))):de=[];var ne=O.coveringZoomLevel(this._source),we=Math.max(ne-D.maxOverzooming,this._source.minzoom),Oe=Math.max(ne+D.maxUnderzooming,this._source.minzoom),ht=this._updateRetainedTiles(de,ne);if(Ri(this._source.type)){for(var Yt={},cr={},Nt=Object.keys(ht),Ne=0,$e=Nt;Ne<$e.length;Ne+=1){var st=$e[Ne],It=ht[st],Bt=this._tiles[st];if(!(!Bt||Bt.fadeEndTime&&Bt.fadeEndTime<=i.browser.now())){var Ft=this.findLoadedParent(It,we);Ft&&(this._addTile(Ft.tileID),Yt[Ft.tileID.key]=Ft.tileID),cr[st]=It}}this._retainLoadedChildren(cr,ne,Oe,ht);for(var Ut in Yt)ht[Ut]||(this._coveredTiles[Ut]=!0,ht[Ut]=Yt[Ut])}for(var zt in ht)this._tiles[zt].clearFadeHold();for(var _t=i.keysDifference(this._tiles,ht),Dt=0,vt=_t;Dt<vt.length;Dt+=1){var lr=vt[Dt],_r=this._tiles[lr];_r.hasSymbolBuckets&&!_r.holdingForFade()?_r.setHoldDuration(this.map._fadeDuration):(!_r.hasSymbolBuckets||_r.symbolFadeFinished())&&this._removeTile(lr)}this._updateLoadedParentTileCache()}},D.prototype.releaseSymbolFadeTiles=function(){for(var O in this._tiles)this._tiles[O].holdingForFade()&&this._removeTile(O)},D.prototype._updateRetainedTiles=function(O,K){for(var de={},ne={},we=Math.max(K-D.maxOverzooming,this._source.minzoom),Oe=Math.max(K+D.maxUnderzooming,this._source.minzoom),ht={},Yt=0,cr=O;Yt<cr.length;Yt+=1){var Nt=cr[Yt],Ne=this._addTile(Nt);de[Nt.key]=Nt,!Ne.hasData()&&K<this._source.maxzoom&&(ht[Nt.key]=Nt)}this._retainLoadedChildren(ht,K,Oe,de);for(var $e=0,st=O;$e<st.length;$e+=1){var It=st[$e],Bt=this._tiles[It.key];if(!Bt.hasData()){if(K+1>this._source.maxzoom){var Ft=It.children(this._source.maxzoom)[0],Ut=this.getTile(Ft);if(Ut&&Ut.hasData()){de[Ft.key]=Ft;continue}}else{var zt=It.children(this._source.maxzoom);if(de[zt[0].key]&&de[zt[1].key]&&de[zt[2].key]&&de[zt[3].key])continue}for(var _t=Bt.wasRequested(),Dt=It.overscaledZ-1;Dt>=we;--Dt){var vt=It.scaledTo(Dt);if(ne[vt.key]||(ne[vt.key]=!0,Bt=this.getTile(vt),!Bt&&_t&&(Bt=this._addTile(vt)),Bt&&(de[vt.key]=vt,_t=Bt.wasRequested(),Bt.hasData())))break}}}return de},D.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var O in this._tiles){for(var K=[],de=void 0,ne=this._tiles[O].tileID;ne.overscaledZ>0;){if(ne.key in this._loadedParentTiles){de=this._loadedParentTiles[ne.key];break}K.push(ne.key);var we=ne.scaledTo(ne.overscaledZ-1);if(de=this._getLoadedTile(we),de)break;ne=we}for(var Oe=0,ht=K;Oe<ht.length;Oe+=1){var Yt=ht[Oe];this._loadedParentTiles[Yt]=de}}},D.prototype._addTile=function(O){var K=this._tiles[O.key];if(K)return K;K=this._cache.getAndRemove(O),K&&(this._setTileReloadTimer(O.key,K),K.tileID=O,this._state.initializeTileState(K,this.map?this.map.painter:null),this._cacheTimers[O.key]&&(clearTimeout(this._cacheTimers[O.key]),delete this._cacheTimers[O.key],this._setTileReloadTimer(O.key,K)));var de=!!K;return de||(K=new i.Tile(O,this._source.tileSize*O.overscaleFactor()),this._loadTile(K,this._tileLoaded.bind(this,K,O.key,K.state))),K?(K.uses++,this._tiles[O.key]=K,de||this._source.fire(new i.Event("dataloading",{tile:K,coord:K.tileID,dataType:"source"})),K):null},D.prototype._setTileReloadTimer=function(O,K){var de=this;O in this._timers&&(clearTimeout(this._timers[O]),delete this._timers[O]);var ne=K.getExpiryTimeout();ne&&(this._timers[O]=setTimeout(function(){de._reloadTile(O,"expired"),delete de._timers[O]},ne))},D.prototype._removeTile=function(O){var K=this._tiles[O];K&&(K.uses--,delete this._tiles[O],this._timers[O]&&(clearTimeout(this._timers[O]),delete this._timers[O]),!(K.uses>0)&&(K.hasData()&&K.state!=="reloading"?this._cache.add(K.tileID,K,K.getExpiryTimeout()):(K.aborted=!0,this._abortTile(K),this._unloadTile(K))))},D.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var O in this._tiles)this._removeTile(O);this._cache.reset()},D.prototype.tilesIn=function(O,K,de){var ne=this,we=[],Oe=this.transform;if(!Oe)return we;for(var ht=de?Oe.getCameraQueryGeometry(O):O,Yt=O.map(function(Dt){return Oe.pointCoordinate(Dt)}),cr=ht.map(function(Dt){return Oe.pointCoordinate(Dt)}),Nt=this.getIds(),Ne=1/0,$e=1/0,st=-1/0,It=-1/0,Bt=0,Ft=cr;Bt<Ft.length;Bt+=1){var Ut=Ft[Bt];Ne=Math.min(Ne,Ut.x),$e=Math.min($e,Ut.y),st=Math.max(st,Ut.x),It=Math.max(It,Ut.y)}for(var zt=function(Dt){var vt=ne._tiles[Nt[Dt]];if(!vt.holdingForFade()){var lr=vt.tileID,_r=Math.pow(2,Oe.zoom-vt.tileID.overscaledZ),Br=K*vt.queryPadding*i.EXTENT/vt.tileSize/_r,Di=[lr.getTilePoint(new i.MercatorCoordinate(Ne,$e)),lr.getTilePoint(new i.MercatorCoordinate(st,It))];if(Di[0].x-Br<i.EXTENT&&Di[0].y-Br<i.EXTENT&&Di[1].x+Br>=0&&Di[1].y+Br>=0){var ci=Yt.map(function(gn){return lr.getTilePoint(gn)}),bi=cr.map(function(gn){return lr.getTilePoint(gn)});we.push({tile:vt,tileID:lr,queryGeometry:ci,cameraQueryGeometry:bi,scale:_r})}}},_t=0;_t<Nt.length;_t++)zt(_t);return we},D.prototype.getVisibleCoordinates=function(O){for(var K=this,de=this.getRenderableIds(O).map(function(ht){return K._tiles[ht].tileID}),ne=0,we=de;ne<we.length;ne+=1){var Oe=we[ne];Oe.posMatrix=this.transform.calculatePosMatrix(Oe.toUnwrapped())}return de},D.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Ri(this._source.type))for(var O in this._tiles){var K=this._tiles[O];if(K.fadeEndTime!==void 0&&K.fadeEndTime>=i.browser.now())return!0}return!1},D.prototype.setFeatureState=function(O,K,de){O=O||"_geojsonTileLayer",this._state.updateState(O,K,de)},D.prototype.removeFeatureState=function(O,K,de){O=O||"_geojsonTileLayer",this._state.removeFeatureState(O,K,de)},D.prototype.getFeatureState=function(O,K){return O=O||"_geojsonTileLayer",this._state.getState(O,K)},D.prototype.setDependencies=function(O,K,de){var ne=this._tiles[O];ne&&ne.setDependencies(K,de)},D.prototype.reloadTilesForDependencies=function(O,K){for(var de in this._tiles){var ne=this._tiles[de];ne.hasDependency(O,K)&&this._reloadTile(de,"reloading")}this._cache.filter(function(we){return!we.hasDependency(O,K)})},D}(i.Evented);ti.maxOverzooming=10,ti.maxUnderzooming=3;function $r(Y,D){var J=Math.abs(Y.wrap*2)-+(Y.wrap<0),O=Math.abs(D.wrap*2)-+(D.wrap<0);return Y.overscaledZ-D.overscaledZ||O-J||D.canonical.y-Y.canonical.y||D.canonical.x-Y.canonical.x}function Ri(Y){return Y==="raster"||Y==="image"||Y==="video"}function Zi(){return new i.window.Worker(io.workerUrl)}var en="mapboxgl_preloaded_worker_pool",fn=function(){this.active={}};fn.prototype.acquire=function(D){if(!this.workers)for(this.workers=[];this.workers.length<fn.workerCount;)this.workers.push(new Zi);return this.active[D]=!0,this.workers.slice()},fn.prototype.release=function(D){delete this.active[D],this.numActive()===0&&(this.workers.forEach(function(J){J.terminate()}),this.workers=null)},fn.prototype.isPreloaded=function(){return!!this.active[en]},fn.prototype.numActive=function(){return Object.keys(this.active).length};var yn=Math.floor(i.browser.hardwareConcurrency/2);fn.workerCount=Math.max(Math.min(yn,6),1);var Mn;function Ba(){return Mn||(Mn=new fn),Mn}function ua(){var Y=Ba();Y.acquire(en)}function ma(){var Y=Mn;Y&&(Y.isPreloaded()&&Y.numActive()===1?(Y.release(en),Mn=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()"))}function Wa(Y,D){var J={};for(var O in Y)O!=="ref"&&(J[O]=Y[O]);return i.refProperties.forEach(function(K){K in D&&(J[K]=D[K])}),J}function Fa(Y){Y=Y.slice();for(var D=Object.create(null),J=0;J<Y.length;J++)D[Y[J].id]=Y[J];for(var O=0;O<Y.length;O++)"ref"in Y[O]&&(Y[O]=Wa(Y[O],D[Y[O].ref]));return Y}function Xo(){var Y={},D=i.styleSpec.$version;for(var J in i.styleSpec.$root){var O=i.styleSpec.$root[J];if(O.required){var K=null;J==="version"?K=D:O.type==="array"?K=[]:K={},K!=null&&(Y[J]=K)}}return Y}var da={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"};function jn(Y,D,J){J.push({command:da.addSource,args:[Y,D[Y]]})}function Ha(Y,D,J){D.push({command:da.removeSource,args:[Y]}),J[Y]=!0}function vo(Y,D,J,O){Ha(Y,J,O),jn(Y,D,J)}function Gn(Y,D,J){var O;for(O in Y[J])if(Y[J].hasOwnProperty(O)&&O!=="data"&&!i.deepEqual(Y[J][O],D[J][O]))return!1;for(O in D[J])if(D[J].hasOwnProperty(O)&&O!=="data"&&!i.deepEqual(Y[J][O],D[J][O]))return!1;return!0}function Ct(Y,D,J,O){Y=Y||{},D=D||{};var K;for(K in Y)Y.hasOwnProperty(K)&&(D.hasOwnProperty(K)||Ha(K,J,O));for(K in D)D.hasOwnProperty(K)&&(Y.hasOwnProperty(K)?i.deepEqual(Y[K],D[K])||(Y[K].type==="geojson"&&D[K].type==="geojson"&&Gn(Y,D,K)?J.push({command:da.setGeoJSONSourceData,args:[K,D[K].data]}):vo(K,D,J,O)):jn(K,D,J))}function Sr(Y,D,J,O,K,de){Y=Y||{},D=D||{};var ne;for(ne in Y)Y.hasOwnProperty(ne)&&(i.deepEqual(Y[ne],D[ne])||J.push({command:de,args:[O,ne,D[ne],K]}));for(ne in D)!D.hasOwnProperty(ne)||Y.hasOwnProperty(ne)||i.deepEqual(Y[ne],D[ne])||J.push({command:de,args:[O,ne,D[ne],K]})}function Jr(Y){return Y.id}function hi(Y,D){return Y[D.id]=D,Y}function hn(Y,D,J){Y=Y||[],D=D||[];var O=Y.map(Jr),K=D.map(Jr),de=Y.reduce(hi,{}),ne=D.reduce(hi,{}),we=O.slice(),Oe=Object.create(null),ht,Yt,cr,Nt,Ne,$e,st;for(ht=0,Yt=0;ht<O.length;ht++)cr=O[ht],ne.hasOwnProperty(cr)?Yt++:(J.push({command:da.removeLayer,args:[cr]}),we.splice(we.indexOf(cr,Yt),1));for(ht=0,Yt=0;ht<K.length;ht++)cr=K[K.length-1-ht],we[we.length-1-ht]!==cr&&(de.hasOwnProperty(cr)?(J.push({command:da.removeLayer,args:[cr]}),we.splice(we.lastIndexOf(cr,we.length-Yt),1)):Yt++,$e=we[we.length-ht],J.push({command:da.addLayer,args:[ne[cr],$e]}),we.splice(we.length-ht,0,cr),Oe[cr]=!0);for(ht=0;ht<K.length;ht++)if(cr=K[ht],Nt=de[cr],Ne=ne[cr],!(Oe[cr]||i.deepEqual(Nt,Ne))){if(!i.deepEqual(Nt.source,Ne.source)||!i.deepEqual(Nt["source-layer"],Ne["source-layer"])||!i.deepEqual(Nt.type,Ne.type)){J.push({command:da.removeLayer,args:[cr]}),$e=we[we.lastIndexOf(cr)+1],J.push({command:da.addLayer,args:[Ne,$e]});continue}Sr(Nt.layout,Ne.layout,J,cr,null,da.setLayoutProperty),Sr(Nt.paint,Ne.paint,J,cr,null,da.setPaintProperty),i.deepEqual(Nt.filter,Ne.filter)||J.push({command:da.setFilter,args:[cr,Ne.filter]}),(!i.deepEqual(Nt.minzoom,Ne.minzoom)||!i.deepEqual(Nt.maxzoom,Ne.maxzoom))&&J.push({command:da.setLayerZoomRange,args:[cr,Ne.minzoom,Ne.maxzoom]});for(st in Nt)Nt.hasOwnProperty(st)&&(st==="layout"||st==="paint"||st==="filter"||st==="metadata"||st==="minzoom"||st==="maxzoom"||(st.indexOf("paint.")===0?Sr(Nt[st],Ne[st],J,cr,st.slice(6),da.setPaintProperty):i.deepEqual(Nt[st],Ne[st])||J.push({command:da.setLayerProperty,args:[cr,st,Ne[st]]})));for(st in Ne)!Ne.hasOwnProperty(st)||Nt.hasOwnProperty(st)||st==="layout"||st==="paint"||st==="filter"||st==="metadata"||st==="minzoom"||st==="maxzoom"||(st.indexOf("paint.")===0?Sr(Nt[st],Ne[st],J,cr,st.slice(6),da.setPaintProperty):i.deepEqual(Nt[st],Ne[st])||J.push({command:da.setLayerProperty,args:[cr,st,Ne[st]]}))}}function Sn(Y,D){if(!Y)return[{command:da.setStyle,args:[D]}];var J=[];try{if(!i.deepEqual(Y.version,D.version))return[{command:da.setStyle,args:[D]}];i.deepEqual(Y.center,D.center)||J.push({command:da.setCenter,args:[D.center]}),i.deepEqual(Y.zoom,D.zoom)||J.push({command:da.setZoom,args:[D.zoom]}),i.deepEqual(Y.bearing,D.bearing)||J.push({command:da.setBearing,args:[D.bearing]}),i.deepEqual(Y.pitch,D.pitch)||J.push({command:da.setPitch,args:[D.pitch]}),i.deepEqual(Y.sprite,D.sprite)||J.push({command:da.setSprite,args:[D.sprite]}),i.deepEqual(Y.glyphs,D.glyphs)||J.push({command:da.setGlyphs,args:[D.glyphs]}),i.deepEqual(Y.transition,D.transition)||J.push({command:da.setTransition,args:[D.transition]}),i.deepEqual(Y.light,D.light)||J.push({command:da.setLight,args:[D.light]});var O={},K=[];Ct(Y.sources,D.sources,K,O);var de=[];Y.layers&&Y.layers.forEach(function(ne){O[ne.source]?J.push({command:da.removeLayer,args:[ne.id]}):de.push(ne)}),J=J.concat(K),hn(de,D.layers,J)}catch(ne){console.warn("Unable to compute style diff:",ne),J=[{command:da.setStyle,args:[D]}]}return J}var En=function(D,J){this.reset(D,J)};En.prototype.reset=function(D,J){this.points=D||[],this._distances=[0];for(var O=1;O<this.points.length;O++)this._distances[O]=this._distances[O-1]+this.points[O].dist(this.points[O-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(J||0,this.length*.5),this.paddedLength=this.length-this.padding*2},En.prototype.lerp=function(D){if(this.points.length===1)return this.points[0];D=i.clamp(D,0,1);for(var J=1,O=this._distances[J],K=D*this.paddedLength+this.padding;O<K&&J<this._distances.length;)O=this._distances[++J];var de=J-1,ne=this._distances[de],we=O-ne,Oe=we>0?(K-ne)/we:0;return this.points[de].mult(1-Oe).add(this.points[J].mult(Oe))};var ki=function(D,J,O){var K=this.boxCells=[],de=this.circleCells=[];this.xCellCount=Math.ceil(D/O),this.yCellCount=Math.ceil(J/O);for(var ne=0;ne<this.xCellCount*this.yCellCount;ne++)K.push([]),de.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=D,this.height=J,this.xScale=this.xCellCount/D,this.yScale=this.yCellCount/J,this.boxUid=0,this.circleUid=0};ki.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},ki.prototype.insert=function(D,J,O,K,de){this._forEachCell(J,O,K,de,this._insertBoxCell,this.boxUid++),this.boxKeys.push(D),this.bboxes.push(J),this.bboxes.push(O),this.bboxes.push(K),this.bboxes.push(de)},ki.prototype.insertCircle=function(D,J,O,K){this._forEachCell(J-K,O-K,J+K,O+K,this._insertCircleCell,this.circleUid++),this.circleKeys.push(D),this.circles.push(J),this.circles.push(O),this.circles.push(K)},ki.prototype._insertBoxCell=function(D,J,O,K,de,ne){this.boxCells[de].push(ne)},ki.prototype._insertCircleCell=function(D,J,O,K,de,ne){this.circleCells[de].push(ne)},ki.prototype._query=function(D,J,O,K,de,ne){if(O<0||D>this.width||K<0||J>this.height)return de?!1:[];var we=[];if(D<=0&&J<=0&&this.width<=O&&this.height<=K){if(de)return!0;for(var Oe=0;Oe<this.boxKeys.length;Oe++)we.push({key:this.boxKeys[Oe],x1:this.bboxes[Oe*4],y1:this.bboxes[Oe*4+1],x2:this.bboxes[Oe*4+2],y2:this.bboxes[Oe*4+3]});for(var ht=0;ht<this.circleKeys.length;ht++){var Yt=this.circles[ht*3],cr=this.circles[ht*3+1],Nt=this.circles[ht*3+2];we.push({key:this.circleKeys[ht],x1:Yt-Nt,y1:cr-Nt,x2:Yt+Nt,y2:cr+Nt})}return ne?we.filter(ne):we}else{var Ne={hitTest:de,seenUids:{box:{},circle:{}}};return this._forEachCell(D,J,O,K,this._queryCell,we,Ne,ne),de?we.length>0:we}},ki.prototype._queryCircle=function(D,J,O,K,de){var ne=D-O,we=D+O,Oe=J-O,ht=J+O;if(we<0||ne>this.width||ht<0||Oe>this.height)return K?!1:[];var Yt=[],cr={hitTest:K,circle:{x:D,y:J,radius:O},seenUids:{box:{},circle:{}}};return this._forEachCell(ne,Oe,we,ht,this._queryCellCircle,Yt,cr,de),K?Yt.length>0:Yt},ki.prototype.query=function(D,J,O,K,de){return this._query(D,J,O,K,!1,de)},ki.prototype.hitTest=function(D,J,O,K,de){return this._query(D,J,O,K,!0,de)},ki.prototype.hitTestCircle=function(D,J,O,K){return this._queryCircle(D,J,O,!0,K)},ki.prototype._queryCell=function(D,J,O,K,de,ne,we,Oe){var ht=we.seenUids,Yt=this.boxCells[de];if(Yt!==null)for(var cr=this.bboxes,Nt=0,Ne=Yt;Nt<Ne.length;Nt+=1){var $e=Ne[Nt];if(!ht.box[$e]){ht.box[$e]=!0;var st=$e*4;if(D<=cr[st+2]&&J<=cr[st+3]&&O>=cr[st+0]&&K>=cr[st+1]&&(!Oe||Oe(this.boxKeys[$e]))){if(we.hitTest)return ne.push(!0),!0;ne.push({key:this.boxKeys[$e],x1:cr[st],y1:cr[st+1],x2:cr[st+2],y2:cr[st+3]})}}}var It=this.circleCells[de];if(It!==null)for(var Bt=this.circles,Ft=0,Ut=It;Ft<Ut.length;Ft+=1){var zt=Ut[Ft];if(!ht.circle[zt]){ht.circle[zt]=!0;var _t=zt*3;if(this._circleAndRectCollide(Bt[_t],Bt[_t+1],Bt[_t+2],D,J,O,K)&&(!Oe||Oe(this.circleKeys[zt]))){if(we.hitTest)return ne.push(!0),!0;var Dt=Bt[_t],vt=Bt[_t+1],lr=Bt[_t+2];ne.push({key:this.circleKeys[zt],x1:Dt-lr,y1:vt-lr,x2:Dt+lr,y2:vt+lr})}}}},ki.prototype._queryCellCircle=function(D,J,O,K,de,ne,we,Oe){var ht=we.circle,Yt=we.seenUids,cr=this.boxCells[de];if(cr!==null)for(var Nt=this.bboxes,Ne=0,$e=cr;Ne<$e.length;Ne+=1){var st=$e[Ne];if(!Yt.box[st]){Yt.box[st]=!0;var It=st*4;if(this._circleAndRectCollide(ht.x,ht.y,ht.radius,Nt[It+0],Nt[It+1],Nt[It+2],Nt[It+3])&&(!Oe||Oe(this.boxKeys[st])))return ne.push(!0),!0}}var Bt=this.circleCells[de];if(Bt!==null)for(var Ft=this.circles,Ut=0,zt=Bt;Ut<zt.length;Ut+=1){var _t=zt[Ut];if(!Yt.circle[_t]){Yt.circle[_t]=!0;var Dt=_t*3;if(this._circlesCollide(Ft[Dt],Ft[Dt+1],Ft[Dt+2],ht.x,ht.y,ht.radius)&&(!Oe||Oe(this.circleKeys[_t])))return ne.push(!0),!0}}},ki.prototype._forEachCell=function(D,J,O,K,de,ne,we,Oe){for(var ht=this._convertToXCellCoord(D),Yt=this._convertToYCellCoord(J),cr=this._convertToXCellCoord(O),Nt=this._convertToYCellCoord(K),Ne=ht;Ne<=cr;Ne++)for(var $e=Yt;$e<=Nt;$e++){var st=this.xCellCount*$e+Ne;if(de.call(this,D,J,O,K,st,ne,we,Oe))return}},ki.prototype._convertToXCellCoord=function(D){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(D*this.xScale)))},ki.prototype._convertToYCellCoord=function(D){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(D*this.yScale)))},ki.prototype._circlesCollide=function(D,J,O,K,de,ne){var we=K-D,Oe=de-J,ht=O+ne;return ht*ht>we*we+Oe*Oe},ki.prototype._circleAndRectCollide=function(D,J,O,K,de,ne,we){var Oe=(ne-K)/2,ht=Math.abs(D-(K+Oe));if(ht>Oe+O)return!1;var Yt=(we-de)/2,cr=Math.abs(J-(de+Yt));if(cr>Yt+O)return!1;if(ht<=Oe||cr<=Yt)return!0;var Nt=ht-Oe,Ne=cr-Yt;return Nt*Nt+Ne*Ne<=O*O};function _n(Y,D,J,O,K){var de=i.create();return D?(i.scale(de,de,[1/K,1/K,1]),J||i.rotateZ(de,de,O.angle)):i.multiply(de,O.labelPlaneMatrix,Y),de}function ya(Y,D,J,O,K){if(D){var de=i.clone(Y);return i.scale(de,de,[K,K,1]),J||i.rotateZ(de,de,-O.angle),de}else return O.glCoordMatrix}function ea(Y,D){var J=[Y.x,Y.y,0,1];zl(J,J,D);var O=J[3];return{point:new i.Point(J[0]/O,J[1]/O),signedDistanceFromCamera:O}}function Ma(Y,D){return .5+.5*(Y/D)}function _o(Y,D){var J=Y[0]/Y[3],O=Y[1]/Y[3],K=J>=-D[0]&&J<=D[0]&&O>=-D[1]&&O<=D[1];return K}function No(Y,D,J,O,K,de,ne,we){var Oe=O?Y.textSizeData:Y.iconSizeData,ht=i.evaluateSizeForZoom(Oe,J.transform.zoom),Yt=[256/J.width*2+1,256/J.height*2+1],cr=O?Y.text.dynamicLayoutVertexArray:Y.icon.dynamicLayoutVertexArray;cr.clear();for(var Nt=Y.lineVertexArray,Ne=O?Y.text.placedSymbolArray:Y.icon.placedSymbolArray,$e=J.transform.width/J.transform.height,st=!1,It=0;It<Ne.length;It++){var Bt=Ne.get(It);if(Bt.hidden||Bt.writingMode===i.WritingMode.vertical&&!st){ul(Bt.numGlyphs,cr);continue}st=!1;var Ft=[Bt.anchorX,Bt.anchorY,0,1];if(i.transformMat4(Ft,Ft,D),!_o(Ft,Yt)){ul(Bt.numGlyphs,cr);continue}var Ut=Ft[3],zt=Ma(J.transform.cameraToCenterDistance,Ut),_t=i.evaluateSizeForFeature(Oe,ht,Bt),Dt=ne?_t/zt:_t*zt,vt=new i.Point(Bt.anchorX,Bt.anchorY),lr=ea(vt,K).point,_r={},Br=ko(Bt,Dt,!1,we,D,K,de,Y.glyphOffsetArray,Nt,cr,lr,vt,_r,$e);st=Br.useVertical,(Br.notEnoughRoom||st||Br.needsFlipping&&ko(Bt,Dt,!0,we,D,K,de,Y.glyphOffsetArray,Nt,cr,lr,vt,_r,$e).notEnoughRoom)&&ul(Bt.numGlyphs,cr)}O?Y.text.dynamicLayoutVertexBuffer.updateData(cr):Y.icon.dynamicLayoutVertexBuffer.updateData(cr)}function po(Y,D,J,O,K,de,ne,we,Oe,ht,Yt){var cr=we.glyphStartIndex+we.numGlyphs,Nt=we.lineStartIndex,Ne=we.lineStartIndex+we.lineLength,$e=D.getoffsetX(we.glyphStartIndex),st=D.getoffsetX(cr-1),It=Fs(Y*$e,J,O,K,de,ne,we.segment,Nt,Ne,Oe,ht,Yt);if(!It)return null;var Bt=Fs(Y*st,J,O,K,de,ne,we.segment,Nt,Ne,Oe,ht,Yt);return Bt?{first:It,last:Bt}:null}function Lo(Y,D,J,O){if(Y===i.WritingMode.horizontal){var K=Math.abs(J.y-D.y),de=Math.abs(J.x-D.x)*O;if(K>de)return{useVertical:!0}}return(Y===i.WritingMode.vertical?D.y<J.y:D.x>J.x)?{needsFlipping:!0}:null}function ko(Y,D,J,O,K,de,ne,we,Oe,ht,Yt,cr,Nt,Ne){var $e=D/24,st=Y.lineOffsetX*$e,It=Y.lineOffsetY*$e,Bt;if(Y.numGlyphs>1){var Ft=Y.glyphStartIndex+Y.numGlyphs,Ut=Y.lineStartIndex,zt=Y.lineStartIndex+Y.lineLength,_t=po($e,we,st,It,J,Yt,cr,Y,Oe,de,Nt);if(!_t)return{notEnoughRoom:!0};var Dt=ea(_t.first.point,ne).point,vt=ea(_t.last.point,ne).point;if(O&&!J){var lr=Lo(Y.writingMode,Dt,vt,Ne);if(lr)return lr}Bt=[_t.first];for(var _r=Y.glyphStartIndex+1;_r<Ft-1;_r++)Bt.push(Fs($e*we.getoffsetX(_r),st,It,J,Yt,cr,Y.segment,Ut,zt,Oe,de,Nt));Bt.push(_t.last)}else{if(O&&!J){var Br=ea(cr,K).point,Di=Y.lineStartIndex+Y.segment+1,ci=new i.Point(Oe.getx(Di),Oe.gety(Di)),bi=ea(ci,K),gn=bi.signedDistanceFromCamera>0?bi.point:Ds(cr,ci,Br,1,K),tn=Lo(Y.writingMode,Br,gn,Ne);if(tn)return tn}var Ei=Fs($e*we.getoffsetX(Y.glyphStartIndex),st,It,J,Yt,cr,Y.segment,Y.lineStartIndex,Y.lineStartIndex+Y.lineLength,Oe,de,Nt);if(!Ei)return{notEnoughRoom:!0};Bt=[Ei]}for(var Oi=0,Gi=Bt;Oi<Gi.length;Oi+=1){var on=Gi[Oi];i.addDynamicAttributes(ht,on.point,on.angle)}return{}}function Ds(Y,D,J,O,K){var de=ea(Y.add(Y.sub(D)._unit()),K).point,ne=J.sub(de);return J.add(ne._mult(O/ne.mag()))}function Fs(Y,D,J,O,K,de,ne,we,Oe,ht,Yt,cr){var Nt=O?Y-D:Y+D,Ne=Nt>0?1:-1,$e=0;O&&(Ne*=-1,$e=Math.PI),Ne<0&&($e+=Math.PI);for(var st=Ne>0?we+ne:we+ne+1,It=K,Bt=K,Ft=0,Ut=0,zt=Math.abs(Nt),_t=[];Ft+Ut<=zt;){if(st+=Ne,st<we||st>=Oe)return null;if(Bt=It,_t.push(It),It=cr[st],It===void 0){var Dt=new i.Point(ht.getx(st),ht.gety(st)),vt=ea(Dt,Yt);if(vt.signedDistanceFromCamera>0)It=cr[st]=vt.point;else{var lr=st-Ne,_r=Ft===0?de:new i.Point(ht.getx(lr),ht.gety(lr));It=Ds(_r,Dt,Bt,zt-Ft+1,Yt)}}Ft+=Ut,Ut=Bt.dist(It)}var Br=(zt-Ft)/Ut,Di=It.sub(Bt),ci=Di.mult(Br)._add(Bt);ci._add(Di._unit()._perp()._mult(J*Ne));var bi=$e+Math.atan2(It.y-Bt.y,It.x-Bt.x);return _t.push(ci),{point:ci,angle:bi,path:_t}}var ll=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ul(Y,D){for(var J=0;J<Y;J++){var O=D.length;D.resize(O+4),D.float32.set(ll,O*3)}}function zl(Y,D,J){var O=D[0],K=D[1];return Y[0]=J[0]*O+J[4]*K+J[12],Y[1]=J[1]*O+J[5]*K+J[13],Y[3]=J[3]*O+J[7]*K+J[15],Y}var us=100,il=function(D,J,O){J===void 0&&(J=new ki(D.width+2*us,D.height+2*us,25)),O===void 0&&(O=new ki(D.width+2*us,D.height+2*us,25)),this.transform=D,this.grid=J,this.ignoredGrid=O,this.pitchfactor=Math.cos(D._pitch)*D.cameraToCenterDistance,this.screenRightBoundary=D.width+us,this.screenBottomBoundary=D.height+us,this.gridRightBoundary=D.width+2*us,this.gridBottomBoundary=D.height+2*us};il.prototype.placeCollisionBox=function(D,J,O,K,de){var ne=this.projectAndGetPerspectiveRatio(K,D.anchorPointX,D.anchorPointY),we=O*ne.perspectiveRatio,Oe=D.x1*we+ne.point.x,ht=D.y1*we+ne.point.y,Yt=D.x2*we+ne.point.x,cr=D.y2*we+ne.point.y;return!this.isInsideGrid(Oe,ht,Yt,cr)||!J&&this.grid.hitTest(Oe,ht,Yt,cr,de)?{box:[],offscreen:!1}:{box:[Oe,ht,Yt,cr],offscreen:this.isOffscreen(Oe,ht,Yt,cr)}},il.prototype.placeCollisionCircles=function(D,J,O,K,de,ne,we,Oe,ht,Yt,cr,Nt,Ne){var $e=[],st=new i.Point(J.anchorX,J.anchorY),It=ea(st,ne),Bt=Ma(this.transform.cameraToCenterDistance,It.signedDistanceFromCamera),Ft=Yt?de/Bt:de*Bt,Ut=Ft/i.ONE_EM,zt=ea(st,we).point,_t={},Dt=J.lineOffsetX*Ut,vt=J.lineOffsetY*Ut,lr=po(Ut,K,Dt,vt,!1,zt,st,J,O,we,_t),_r=!1,Br=!1,Di=!0;if(lr){for(var ci=Nt*.5*Bt+Ne,bi=new i.Point(-us,-us),gn=new i.Point(this.screenRightBoundary,this.screenBottomBoundary),tn=new En,Ei=lr.first,Oi=lr.last,Gi=[],on=Ei.path.length-1;on>=1;on--)Gi.push(Ei.path[on]);for(var zn=1;zn<Oi.path.length;zn++)Gi.push(Oi.path[zn]);var Ja=ci*2.5;if(Oe){var co=Gi.map(function(Iv){return ea(Iv,Oe)});co.some(function(Iv){return Iv.signedDistanceFromCamera<=0})?Gi=[]:Gi=co.map(function(Iv){return Iv.point})}var ts=[];if(Gi.length>0){for(var so=Gi[0].clone(),Yo=Gi[0].clone(),ms=1;ms<Gi.length;ms++)so.x=Math.min(so.x,Gi[ms].x),so.y=Math.min(so.y,Gi[ms].y),Yo.x=Math.max(Yo.x,Gi[ms].x),Yo.y=Math.max(Yo.y,Gi[ms].y);so.x>=bi.x&&Yo.x<=gn.x&&so.y>=bi.y&&Yo.y<=gn.y?ts=[Gi]:Yo.x<bi.x||so.x>gn.x||Yo.y<bi.y||so.y>gn.y?ts=[]:ts=i.clipLine([Gi],bi.x,bi.y,gn.x,gn.y)}for(var ou=0,Cv=ts;ou<Cv.length;ou+=1){var Lv=Cv[ou];tn.reset(Lv,ci*.25);var wd=0;tn.length<=.5*ci?wd=1:wd=Math.ceil(tn.paddedLength/Ja)+1;for(var Kv=0;Kv<wd;Kv++){var hg=Kv/Math.max(wd-1,1),gp=tn.lerp(hg),Td=gp.x+us,mp=gp.y+us;$e.push(Td,mp,ci,0);var Vd=Td-ci,Ad=mp-ci,Pv=Td+ci,Jv=mp+ci;if(Di=Di&&this.isOffscreen(Vd,Ad,Pv,Jv),Br=Br||this.isInsideGrid(Vd,Ad,Pv,Jv),!D&&this.grid.hitTestCircle(Td,mp,ci,cr)&&(_r=!0,!ht))return{circles:[],offscreen:!1,collisionDetected:_r}}}}return{circles:!ht&&_r||!Br?[]:$e,offscreen:Di,collisionDetected:_r}},il.prototype.queryRenderedSymbols=function(D){if(D.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var J=[],O=1/0,K=1/0,de=-1/0,ne=-1/0,we=0,Oe=D;we<Oe.length;we+=1){var ht=Oe[we],Yt=new i.Point(ht.x+us,ht.y+us);O=Math.min(O,Yt.x),K=Math.min(K,Yt.y),de=Math.max(de,Yt.x),ne=Math.max(ne,Yt.y),J.push(Yt)}for(var cr=this.grid.query(O,K,de,ne).concat(this.ignoredGrid.query(O,K,de,ne)),Nt={},Ne={},$e=0,st=cr;$e<st.length;$e+=1){var It=st[$e],Bt=It.key;if(Nt[Bt.bucketInstanceId]===void 0&&(Nt[Bt.bucketInstanceId]={}),!Nt[Bt.bucketInstanceId][Bt.featureIndex]){var Ft=[new i.Point(It.x1,It.y1),new i.Point(It.x2,It.y1),new i.Point(It.x2,It.y2),new i.Point(It.x1,It.y2)];i.polygonIntersectsPolygon(J,Ft)&&(Nt[Bt.bucketInstanceId][Bt.featureIndex]=!0,Ne[Bt.bucketInstanceId]===void 0&&(Ne[Bt.bucketInstanceId]=[]),Ne[Bt.bucketInstanceId].push(Bt.featureIndex))}}return Ne},il.prototype.insertCollisionBox=function(D,J,O,K,de){var ne=J?this.ignoredGrid:this.grid,we={bucketInstanceId:O,featureIndex:K,collisionGroupID:de};ne.insert(we,D[0],D[1],D[2],D[3])},il.prototype.insertCollisionCircles=function(D,J,O,K,de){for(var ne=J?this.ignoredGrid:this.grid,we={bucketInstanceId:O,featureIndex:K,collisionGroupID:de},Oe=0;Oe<D.length;Oe+=4)ne.insertCircle(we,D[Oe],D[Oe+1],D[Oe+2])},il.prototype.projectAndGetPerspectiveRatio=function(D,J,O){var K=[J,O,0,1];zl(K,K,D);var de=new i.Point((K[0]/K[3]+1)/2*this.transform.width+us,(-K[1]/K[3]+1)/2*this.transform.height+us);return{point:de,perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/K[3])}},il.prototype.isOffscreen=function(D,J,O,K){return O<us||D>=this.screenRightBoundary||K<us||J>this.screenBottomBoundary},il.prototype.isInsideGrid=function(D,J,O,K){return O>=0&&D<this.gridRightBoundary&&K>=0&&J<this.gridBottomBoundary},il.prototype.getViewportMatrix=function(){var D=i.identity([]);return i.translate(D,D,[-us,-us,0]),D};function As(Y,D,J){return D*(i.EXTENT/(Y.tileSize*Math.pow(2,J-Y.tileID.overscaledZ)))}var cl=function(D,J,O,K){D?this.opacity=Math.max(0,Math.min(1,D.opacity+(D.placed?J:-J))):this.opacity=K&&O?1:0,this.placed=O};cl.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var Ks=function(D,J,O,K,de){this.text=new cl(D?D.text:null,J,O,de),this.icon=new cl(D?D.icon:null,J,K,de)};Ks.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var zs=function(D,J,O){this.text=D,this.icon=J,this.skipFade=O},Io=function(){this.invProjMatrix=i.create(),this.viewportMatrix=i.create(),this.circles=[]},ls=function(D,J,O,K,de){this.bucketInstanceId=D,this.featureIndex=J,this.sourceLayerIndex=O,this.bucketIndex=K,this.tileID=de},Yl=function(D){this.crossSourceCollisions=D,this.maxGroupID=0,this.collisionGroups={}};Yl.prototype.get=function(D){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[D]){var J=++this.maxGroupID;this.collisionGroups[D]={ID:J,predicate:function(O){return O.collisionGroupID===J}}}return this.collisionGroups[D]};function Su(Y,D,J,O,K){var de=i.getAnchorAlignment(Y),ne=de.horizontalAlign,we=de.verticalAlign,Oe=-(ne-.5)*D,ht=-(we-.5)*J,Yt=i.evaluateVariableOffset(Y,O);return new i.Point(Oe+Yt[0]*K,ht+Yt[1]*K)}function nc(Y,D,J,O,K,de){var ne=Y.x1,we=Y.x2,Oe=Y.y1,ht=Y.y2,Yt=Y.anchorPointX,cr=Y.anchorPointY,Nt=new i.Point(D,J);return O&&Nt._rotate(K?de:-de),{x1:ne+Nt.x,y1:Oe+Nt.y,x2:we+Nt.x,y2:ht+Nt.y,anchorPointX:Yt,anchorPointY:cr}}var bs=function(D,J,O,K){this.transform=D.clone(),this.collisionIndex=new il(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=J,this.retainedQueryData={},this.collisionGroups=new Yl(O),this.collisionCircleArrays={},this.prevPlacement=K,K&&(K.prevPlacement=void 0),this.placedOrientations={}};bs.prototype.getBucketParts=function(D,J,O,K){var de=O.getBucket(J),ne=O.latestFeatureIndex;if(!(!de||!ne||J.id!==de.layerIds[0])){var we=O.collisionBoxArray,Oe=de.layers[0].layout,ht=Math.pow(2,this.transform.zoom-O.tileID.overscaledZ),Yt=O.tileSize/i.EXTENT,cr=this.transform.calculatePosMatrix(O.tileID.toUnwrapped()),Nt=Oe.get("text-pitch-alignment")==="map",Ne=Oe.get("text-rotation-alignment")==="map",$e=As(O,1,this.transform.zoom),st=_n(cr,Nt,Ne,this.transform,$e),It=null;if(Nt){var Bt=ya(cr,Nt,Ne,this.transform,$e);It=i.multiply([],this.transform.labelPlaneMatrix,Bt)}this.retainedQueryData[de.bucketInstanceId]=new ls(de.bucketInstanceId,ne,de.sourceLayerIndex,de.index,O.tileID);var Ft={bucket:de,layout:Oe,posMatrix:cr,textLabelPlaneMatrix:st,labelToScreenMatrix:It,scale:ht,textPixelRatio:Yt,holdingForFade:O.holdingForFade(),collisionBoxArray:we,partiallyEvaluatedTextSize:i.evaluateSizeForZoom(de.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(de.sourceID)};if(K)for(var Ut=0,zt=de.sortKeyRanges;Ut<zt.length;Ut+=1){var _t=zt[Ut],Dt=_t.sortKey,vt=_t.symbolInstanceStart,lr=_t.symbolInstanceEnd;D.push({sortKey:Dt,symbolInstanceStart:vt,symbolInstanceEnd:lr,parameters:Ft})}else D.push({symbolInstanceStart:0,symbolInstanceEnd:de.symbolInstances.length,parameters:Ft})}},bs.prototype.attemptAnchorPlacement=function(D,J,O,K,de,ne,we,Oe,ht,Yt,cr,Nt,Ne,$e,st){var It=[Nt.textOffset0,Nt.textOffset1],Bt=Su(D,O,K,It,de),Ft=this.collisionIndex.placeCollisionBox(nc(J,Bt.x,Bt.y,ne,we,this.transform.angle),cr,Oe,ht,Yt.predicate);if(st){var Ut=this.collisionIndex.placeCollisionBox(nc(st,Bt.x,Bt.y,ne,we,this.transform.angle),cr,Oe,ht,Yt.predicate);if(Ut.box.length===0)return}if(Ft.box.length>0){var zt;return this.prevPlacement&&this.prevPlacement.variableOffsets[Nt.crossTileID]&&this.prevPlacement.placements[Nt.crossTileID]&&this.prevPlacement.placements[Nt.crossTileID].text&&(zt=this.prevPlacement.variableOffsets[Nt.crossTileID].anchor),this.variableOffsets[Nt.crossTileID]={textOffset:It,width:O,height:K,anchor:D,textBoxScale:de,prevAnchor:zt},this.markUsedJustification(Ne,D,Nt,$e),Ne.allowVerticalPlacement&&(this.markUsedOrientation(Ne,$e,Nt),this.placedOrientations[Nt.crossTileID]=$e),{shift:Bt,placedGlyphBoxes:Ft}}},bs.prototype.placeLayerBucketPart=function(D,J,O){var K=this,de=D.parameters,ne=de.bucket,we=de.layout,Oe=de.posMatrix,ht=de.textLabelPlaneMatrix,Yt=de.labelToScreenMatrix,cr=de.textPixelRatio,Nt=de.holdingForFade,Ne=de.collisionBoxArray,$e=de.partiallyEvaluatedTextSize,st=de.collisionGroup,It=we.get("text-optional"),Bt=we.get("icon-optional"),Ft=we.get("text-allow-overlap"),Ut=we.get("icon-allow-overlap"),zt=we.get("text-rotation-alignment")==="map",_t=we.get("text-pitch-alignment")==="map",Dt=we.get("icon-text-fit")!=="none",vt=we.get("symbol-z-order")==="viewport-y",lr=Ft&&(Ut||!ne.hasIconData()||Bt),_r=Ut&&(Ft||!ne.hasTextData()||It);!ne.collisionArrays&&Ne&&ne.deserializeCollisionBoxes(Ne);var Br=function(Ei,Oi){if(!J[Ei.crossTileID]){if(Nt){K.placements[Ei.crossTileID]=new zs(!1,!1,!1);return}var Gi=!1,on=!1,zn=!0,Ja=null,co={box:null,offscreen:null},ts={box:null,offscreen:null},so=null,Yo=null,ms=null,ou=0,Cv=0,Lv=0;Oi.textFeatureIndex?ou=Oi.textFeatureIndex:Ei.useRuntimeCollisionCircles&&(ou=Ei.featureIndex),Oi.verticalTextFeatureIndex&&(Cv=Oi.verticalTextFeatureIndex);var wd=Oi.textBox;if(wd){var Kv=function(vc){var tu=i.WritingMode.horizontal;if(ne.allowVerticalPlacement&&!vc&&K.prevPlacement){var Sd=K.prevPlacement.placedOrientations[Ei.crossTileID];Sd&&(K.placedOrientations[Ei.crossTileID]=Sd,tu=Sd,K.markUsedOrientation(ne,tu,Ei))}return tu},hg=function(vc,tu){if(ne.allowVerticalPlacement&&Ei.numVerticalGlyphVertices>0&&Oi.verticalTextBox)for(var Sd=0,py=ne.writingModes;Sd<py.length;Sd+=1){var L1=py[Sd];if(L1===i.WritingMode.vertical?(co=tu(),ts=co):co=vc(),co&&co.box&&co.box.length)break}else co=vc()};if(we.get("text-variable-anchor")){var Vd=we.get("text-variable-anchor");if(K.prevPlacement&&K.prevPlacement.variableOffsets[Ei.crossTileID]){var Ad=K.prevPlacement.variableOffsets[Ei.crossTileID];Vd.indexOf(Ad.anchor)>0&&(Vd=Vd.filter(function(vc){return vc!==Ad.anchor}),Vd.unshift(Ad.anchor))}var Pv=function(vc,tu,Sd){for(var py=vc.x2-vc.x1,L1=vc.y2-vc.y1,wu=Ei.textBoxScale,Kx=Dt&&!Ut?tu:null,lm={box:[],offscreen:!1},Bw=Ft?Vd.length*2:Vd.length,Rv=0;Rv<Bw;++Rv){var um=Vd[Rv%Vd.length],Nw=Rv>=Vd.length,Jx=K.attemptAnchorPlacement(um,vc,py,L1,wu,zt,_t,cr,Oe,st,Nw,Ei,ne,Sd,Kx);if(Jx&&(lm=Jx.placedGlyphBoxes,lm&&lm.box&&lm.box.length)){Gi=!0,Ja=Jx.shift;break}}return lm},Jv=function(){return Pv(wd,Oi.iconBox,i.WritingMode.horizontal)},Iv=function(){var vc=Oi.verticalTextBox,tu=co&&co.box&&co.box.length;return ne.allowVerticalPlacement&&!tu&&Ei.numVerticalGlyphVertices>0&&vc?Pv(vc,Oi.verticalIconBox,i.WritingMode.vertical):{box:null,offscreen:null}};hg(Jv,Iv),co&&(Gi=co.box,zn=co.offscreen);var hy=Kv(co&&co.box);if(!Gi&&K.prevPlacement){var dg=K.prevPlacement.variableOffsets[Ei.crossTileID];dg&&(K.variableOffsets[Ei.crossTileID]=dg,K.markUsedJustification(ne,dg.anchor,Ei,hy))}}else{var gp=function(vc,tu){var Sd=K.collisionIndex.placeCollisionBox(vc,Ft,cr,Oe,st.predicate);return Sd&&Sd.box&&Sd.box.length&&(K.markUsedOrientation(ne,tu,Ei),K.placedOrientations[Ei.crossTileID]=tu),Sd},Td=function(){return gp(wd,i.WritingMode.horizontal)},mp=function(){var vc=Oi.verticalTextBox;return ne.allowVerticalPlacement&&Ei.numVerticalGlyphVertices>0&&vc?gp(vc,i.WritingMode.vertical):{box:null,offscreen:null}};hg(Td,mp),Kv(co&&co.box&&co.box.length)}}if(so=co,Gi=so&&so.box&&so.box.length>0,zn=so&&so.offscreen,Ei.useRuntimeCollisionCircles){var oh=ne.text.placedSymbolArray.get(Ei.centerJustifiedTextSymbolIndex),vg=i.evaluateSizeForFeature(ne.textSizeData,$e,oh),dy=we.get("text-padding"),Zh=Ei.collisionCircleDiameter;Yo=K.collisionIndex.placeCollisionCircles(Ft,oh,ne.lineVertexArray,ne.glyphOffsetArray,vg,Oe,ht,Yt,O,_t,st.predicate,Zh,dy),Gi=Ft||Yo.circles.length>0&&!Yo.collisionDetected,zn=zn&&Yo.offscreen}if(Oi.iconFeatureIndex&&(Lv=Oi.iconFeatureIndex),Oi.iconBox){var am=function(vc){var tu=Dt&&Ja?nc(vc,Ja.x,Ja.y,zt,_t,K.transform.angle):vc;return K.collisionIndex.placeCollisionBox(tu,Ut,cr,Oe,st.predicate)};ts&&ts.box&&ts.box.length&&Oi.verticalIconBox?(ms=am(Oi.verticalIconBox),on=ms.box.length>0):(ms=am(Oi.iconBox),on=ms.box.length>0),zn=zn&&ms.offscreen}var k1=It||Ei.numHorizontalGlyphVertices===0&&Ei.numVerticalGlyphVertices===0,C1=Bt||Ei.numIconVertices===0;if(!k1&&!C1?on=Gi=on&&Gi:C1?k1||(on=on&&Gi):Gi=on&&Gi,Gi&&so&&so.box&&(ts&&ts.box&&Cv?K.collisionIndex.insertCollisionBox(so.box,we.get("text-ignore-placement"),ne.bucketInstanceId,Cv,st.ID):K.collisionIndex.insertCollisionBox(so.box,we.get("text-ignore-placement"),ne.bucketInstanceId,ou,st.ID)),on&&ms&&K.collisionIndex.insertCollisionBox(ms.box,we.get("icon-ignore-placement"),ne.bucketInstanceId,Lv,st.ID),Yo&&(Gi&&K.collisionIndex.insertCollisionCircles(Yo.circles,we.get("text-ignore-placement"),ne.bucketInstanceId,ou,st.ID),O)){var vy=ne.bucketInstanceId,om=K.collisionCircleArrays[vy];om===void 0&&(om=K.collisionCircleArrays[vy]=new Io);for(var sm=0;sm<Yo.circles.length;sm+=4)om.circles.push(Yo.circles[sm+0]),om.circles.push(Yo.circles[sm+1]),om.circles.push(Yo.circles[sm+2]),om.circles.push(Yo.collisionDetected?1:0)}K.placements[Ei.crossTileID]=new zs(Gi||lr,on||_r,zn||ne.justReloaded),J[Ei.crossTileID]=!0}};if(vt)for(var Di=ne.getSortedSymbolIndexes(this.transform.angle),ci=Di.length-1;ci>=0;--ci){var bi=Di[ci];Br(ne.symbolInstances.get(bi),ne.collisionArrays[bi])}else for(var gn=D.symbolInstanceStart;gn<D.symbolInstanceEnd;gn++)Br(ne.symbolInstances.get(gn),ne.collisionArrays[gn]);if(O&&ne.bucketInstanceId in this.collisionCircleArrays){var tn=this.collisionCircleArrays[ne.bucketInstanceId];i.invert(tn.invProjMatrix,Oe),tn.viewportMatrix=this.collisionIndex.getViewportMatrix()}ne.justReloaded=!1},bs.prototype.markUsedJustification=function(D,J,O,K){var de={left:O.leftJustifiedTextSymbolIndex,center:O.centerJustifiedTextSymbolIndex,right:O.rightJustifiedTextSymbolIndex},ne;K===i.WritingMode.vertical?ne=O.verticalPlacedTextSymbolIndex:ne=de[i.getAnchorJustification(J)];for(var we=[O.leftJustifiedTextSymbolIndex,O.centerJustifiedTextSymbolIndex,O.rightJustifiedTextSymbolIndex,O.verticalPlacedTextSymbolIndex],Oe=0,ht=we;Oe<ht.length;Oe+=1){var Yt=ht[Oe];Yt>=0&&(ne>=0&&Yt!==ne?D.text.placedSymbolArray.get(Yt).crossTileID=0:D.text.placedSymbolArray.get(Yt).crossTileID=O.crossTileID)}},bs.prototype.markUsedOrientation=function(D,J,O){for(var K=J===i.WritingMode.horizontal||J===i.WritingMode.horizontalOnly?J:0,de=J===i.WritingMode.vertical?J:0,ne=[O.leftJustifiedTextSymbolIndex,O.centerJustifiedTextSymbolIndex,O.rightJustifiedTextSymbolIndex],we=0,Oe=ne;we<Oe.length;we+=1){var ht=Oe[we];D.text.placedSymbolArray.get(ht).placedOrientation=K}O.verticalPlacedTextSymbolIndex&&(D.text.placedSymbolArray.get(O.verticalPlacedTextSymbolIndex).placedOrientation=de)},bs.prototype.commit=function(D){this.commitTime=D,this.zoomAtLastRecencyCheck=this.transform.zoom;var J=this.prevPlacement,O=!1;this.prevZoomAdjustment=J?J.zoomAdjustment(this.transform.zoom):0;var K=J?J.symbolFadeChange(D):1,de=J?J.opacities:{},ne=J?J.variableOffsets:{},we=J?J.placedOrientations:{};for(var Oe in this.placements){var ht=this.placements[Oe],Yt=de[Oe];Yt?(this.opacities[Oe]=new Ks(Yt,K,ht.text,ht.icon),O=O||ht.text!==Yt.text.placed||ht.icon!==Yt.icon.placed):(this.opacities[Oe]=new Ks(null,K,ht.text,ht.icon,ht.skipFade),O=O||ht.text||ht.icon)}for(var cr in de){var Nt=de[cr];if(!this.opacities[cr]){var Ne=new Ks(Nt,K,!1,!1);Ne.isHidden()||(this.opacities[cr]=Ne,O=O||Nt.text.placed||Nt.icon.placed)}}for(var $e in ne)!this.variableOffsets[$e]&&this.opacities[$e]&&!this.opacities[$e].isHidden()&&(this.variableOffsets[$e]=ne[$e]);for(var st in we)!this.placedOrientations[st]&&this.opacities[st]&&!this.opacities[st].isHidden()&&(this.placedOrientations[st]=we[st]);O?this.lastPlacementChangeTime=D:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=J?J.lastPlacementChangeTime:D)},bs.prototype.updateLayerOpacities=function(D,J){for(var O={},K=0,de=J;K<de.length;K+=1){var ne=de[K],we=ne.getBucket(D);we&&ne.latestFeatureIndex&&D.id===we.layerIds[0]&&this.updateBucketOpacities(we,O,ne.collisionBoxArray)}},bs.prototype.updateBucketOpacities=function(D,J,O){var K=this;D.hasTextData()&&D.text.opacityVertexArray.clear(),D.hasIconData()&&D.icon.opacityVertexArray.clear(),D.hasIconCollisionBoxData()&&D.iconCollisionBox.collisionVertexArray.clear(),D.hasTextCollisionBoxData()&&D.textCollisionBox.collisionVertexArray.clear();var de=D.layers[0].layout,ne=new Ks(null,0,!1,!1,!0),we=de.get("text-allow-overlap"),Oe=de.get("icon-allow-overlap"),ht=de.get("text-variable-anchor"),Yt=de.get("text-rotation-alignment")==="map",cr=de.get("text-pitch-alignment")==="map",Nt=de.get("icon-text-fit")!=="none",Ne=new Ks(null,0,we&&(Oe||!D.hasIconData()||de.get("icon-optional")),Oe&&(we||!D.hasTextData()||de.get("text-optional")),!0);!D.collisionArrays&&O&&(D.hasIconCollisionBoxData()||D.hasTextCollisionBoxData())&&D.deserializeCollisionBoxes(O);for(var $e=function(Ft,Ut,zt){for(var _t=0;_t<Ut/4;_t++)Ft.opacityVertexArray.emplaceBack(zt)},st=function(Ft){var Ut=D.symbolInstances.get(Ft),zt=Ut.numHorizontalGlyphVertices,_t=Ut.numVerticalGlyphVertices,Dt=Ut.crossTileID,vt=J[Dt],lr=K.opacities[Dt];vt?lr=ne:lr||(lr=Ne,K.opacities[Dt]=lr),J[Dt]=!0;var _r=zt>0||_t>0,Br=Ut.numIconVertices>0,Di=K.placedOrientations[Ut.crossTileID],ci=Di===i.WritingMode.vertical,bi=Di===i.WritingMode.horizontal||Di===i.WritingMode.horizontalOnly;if(_r){var gn=ac(lr.text),tn=ci?oa:gn;$e(D.text,zt,tn);var Ei=bi?oa:gn;$e(D.text,_t,Ei);var Oi=lr.text.isHidden();[Ut.rightJustifiedTextSymbolIndex,Ut.centerJustifiedTextSymbolIndex,Ut.leftJustifiedTextSymbolIndex].forEach(function(Lv){Lv>=0&&(D.text.placedSymbolArray.get(Lv).hidden=Oi||ci?1:0)}),Ut.verticalPlacedTextSymbolIndex>=0&&(D.text.placedSymbolArray.get(Ut.verticalPlacedTextSymbolIndex).hidden=Oi||bi?1:0);var Gi=K.variableOffsets[Ut.crossTileID];Gi&&K.markUsedJustification(D,Gi.anchor,Ut,Di);var on=K.placedOrientations[Ut.crossTileID];on&&(K.markUsedJustification(D,"left",Ut,on),K.markUsedOrientation(D,on,Ut))}if(Br){var zn=ac(lr.icon),Ja=!(Nt&&Ut.verticalPlacedIconSymbolIndex&&ci);if(Ut.placedIconSymbolIndex>=0){var co=Ja?zn:oa;$e(D.icon,Ut.numIconVertices,co),D.icon.placedSymbolArray.get(Ut.placedIconSymbolIndex).hidden=lr.icon.isHidden()}if(Ut.verticalPlacedIconSymbolIndex>=0){var ts=Ja?oa:zn;$e(D.icon,Ut.numVerticalIconVertices,ts),D.icon.placedSymbolArray.get(Ut.verticalPlacedIconSymbolIndex).hidden=lr.icon.isHidden()}}if(D.hasIconCollisionBoxData()||D.hasTextCollisionBoxData()){var so=D.collisionArrays[Ft];if(so){var Yo=new i.Point(0,0);if(so.textBox||so.verticalTextBox){var ms=!0;if(ht){var ou=K.variableOffsets[Dt];ou?(Yo=Su(ou.anchor,ou.width,ou.height,ou.textOffset,ou.textBoxScale),Yt&&Yo._rotate(cr?K.transform.angle:-K.transform.angle)):ms=!1}so.textBox&&Rn(D.textCollisionBox.collisionVertexArray,lr.text.placed,!ms||ci,Yo.x,Yo.y),so.verticalTextBox&&Rn(D.textCollisionBox.collisionVertexArray,lr.text.placed,!ms||bi,Yo.x,Yo.y)}var Cv=!!(!bi&&so.verticalIconBox);so.iconBox&&Rn(D.iconCollisionBox.collisionVertexArray,lr.icon.placed,Cv,Nt?Yo.x:0,Nt?Yo.y:0),so.verticalIconBox&&Rn(D.iconCollisionBox.collisionVertexArray,lr.icon.placed,!Cv,Nt?Yo.x:0,Nt?Yo.y:0)}}},It=0;It<D.symbolInstances.length;It++)st(It);if(D.sortFeatures(this.transform.angle),this.retainedQueryData[D.bucketInstanceId]&&(this.retainedQueryData[D.bucketInstanceId].featureSortOrder=D.featureSortOrder),D.hasTextData()&&D.text.opacityVertexBuffer&&D.text.opacityVertexBuffer.updateData(D.text.opacityVertexArray),D.hasIconData()&&D.icon.opacityVertexBuffer&&D.icon.opacityVertexBuffer.updateData(D.icon.opacityVertexArray),D.hasIconCollisionBoxData()&&D.iconCollisionBox.collisionVertexBuffer&&D.iconCollisionBox.collisionVertexBuffer.updateData(D.iconCollisionBox.collisionVertexArray),D.hasTextCollisionBoxData()&&D.textCollisionBox.collisionVertexBuffer&&D.textCollisionBox.collisionVertexBuffer.updateData(D.textCollisionBox.collisionVertexArray),D.bucketInstanceId in this.collisionCircleArrays){var Bt=this.collisionCircleArrays[D.bucketInstanceId];D.placementInvProjMatrix=Bt.invProjMatrix,D.placementViewportMatrix=Bt.viewportMatrix,D.collisionCircleArray=Bt.circles,delete this.collisionCircleArrays[D.bucketInstanceId]}},bs.prototype.symbolFadeChange=function(D){return this.fadeDuration===0?1:(D-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},bs.prototype.zoomAdjustment=function(D){return Math.max(0,(this.transform.zoom-D)/1.5)},bs.prototype.hasTransitions=function(D){return this.stale||D-this.lastPlacementChangeTime<this.fadeDuration},bs.prototype.stillRecent=function(D,J){var O=this.zoomAtLastRecencyCheck===J?1-this.zoomAdjustment(J):1;return this.zoomAtLastRecencyCheck=J,this.commitTime+this.fadeDuration*O>D},bs.prototype.setStale=function(){this.stale=!0};function Rn(Y,D,J,O,K){Y.emplaceBack(D?1:0,J?1:0,O||0,K||0),Y.emplaceBack(D?1:0,J?1:0,O||0,K||0),Y.emplaceBack(D?1:0,J?1:0,O||0,K||0),Y.emplaceBack(D?1:0,J?1:0,O||0,K||0)}var _a=Math.pow(2,25),Vu=Math.pow(2,24),ql=Math.pow(2,17),xo=Math.pow(2,16),Kl=Math.pow(2,9),Ns=Math.pow(2,8),Hl=Math.pow(2,1);function ac(Y){if(Y.opacity===0&&!Y.placed)return 0;if(Y.opacity===1&&Y.placed)return 4294967295;var D=Y.placed?1:0,J=Math.floor(Y.opacity*127);return J*_a+D*Vu+J*ql+D*xo+J*Kl+D*Ns+J*Hl+D}var oa=0,qo=function(D){this._sortAcrossTiles=D.layout.get("symbol-z-order")!=="viewport-y"&&D.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};qo.prototype.continuePlacement=function(D,J,O,K,de){for(var ne=this._bucketParts;this._currentTileIndex<D.length;){var we=D[this._currentTileIndex];if(J.getBucketParts(ne,K,we,this._sortAcrossTiles),this._currentTileIndex++,de())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,ne.sort(function(ht,Yt){return ht.sortKey-Yt.sortKey}));this._currentPartIndex<ne.length;){var Oe=ne[this._currentPartIndex];if(J.placeLayerBucketPart(Oe,this._seenCrossTileIDs,O),this._currentPartIndex++,de())return!0}return!1};var Oo=function(D,J,O,K,de,ne,we){this.placement=new bs(D,de,ne,we),this._currentPlacementIndex=J.length-1,this._forceFullPlacement=O,this._showCollisionBoxes=K,this._done=!1};Oo.prototype.isDone=function(){return this._done},Oo.prototype.continuePlacement=function(D,J,O){for(var K=this,de=i.browser.now(),ne=function(){var cr=i.browser.now()-de;return K._forceFullPlacement?!1:cr>2};this._currentPlacementIndex>=0;){var we=D[this._currentPlacementIndex],Oe=J[we],ht=this.placement.collisionIndex.transform.zoom;if(Oe.type==="symbol"&&(!Oe.minzoom||Oe.minzoom<=ht)&&(!Oe.maxzoom||Oe.maxzoom>ht)){this._inProgressLayer||(this._inProgressLayer=new qo(Oe));var Yt=this._inProgressLayer.continuePlacement(O[Oe.source],this.placement,this._showCollisionBoxes,Oe,ne);if(Yt)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Oo.prototype.commit=function(D){return this.placement.commit(D),this.placement};var Ol=512/i.EXTENT/2,Pc=function(D,J,O){this.tileID=D,this.indexedSymbolInstances={},this.bucketInstanceId=O;for(var K=0;K<J.length;K++){var de=J.get(K),ne=de.key;this.indexedSymbolInstances[ne]||(this.indexedSymbolInstances[ne]=[]),this.indexedSymbolInstances[ne].push({crossTileID:de.crossTileID,coord:this.getScaledCoordinates(de,D)})}};Pc.prototype.getScaledCoordinates=function(D,J){var O=J.canonical.z-this.tileID.canonical.z,K=Ol/Math.pow(2,O);return{x:Math.floor((J.canonical.x*i.EXTENT+D.anchorX)*K),y:Math.floor((J.canonical.y*i.EXTENT+D.anchorY)*K)}},Pc.prototype.findMatches=function(D,J,O){for(var K=this.tileID.canonical.z<J.canonical.z?1:Math.pow(2,this.tileID.canonical.z-J.canonical.z),de=0;de<D.length;de++){var ne=D.get(de);if(!ne.crossTileID){var we=this.indexedSymbolInstances[ne.key];if(we)for(var Oe=this.getScaledCoordinates(ne,J),ht=0,Yt=we;ht<Yt.length;ht+=1){var cr=Yt[ht];if(Math.abs(cr.coord.x-Oe.x)<=K&&Math.abs(cr.coord.y-Oe.y)<=K&&!O[cr.crossTileID]){O[cr.crossTileID]=!0,ne.crossTileID=cr.crossTileID;break}}}}};var Do=function(){this.maxCrossTileID=0};Do.prototype.generate=function(){return++this.maxCrossTileID};var nf=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};nf.prototype.handleWrapJump=function(D){var J=Math.round((D-this.lng)/360);if(J!==0)for(var O in this.indexes){var K=this.indexes[O],de={};for(var ne in K){var we=K[ne];we.tileID=we.tileID.unwrapTo(we.tileID.wrap+J),de[we.tileID.key]=we}this.indexes[O]=de}this.lng=D},nf.prototype.addBucket=function(D,J,O){if(this.indexes[D.overscaledZ]&&this.indexes[D.overscaledZ][D.key]){if(this.indexes[D.overscaledZ][D.key].bucketInstanceId===J.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(D.overscaledZ,this.indexes[D.overscaledZ][D.key])}for(var K=0;K<J.symbolInstances.length;K++){var de=J.symbolInstances.get(K);de.crossTileID=0}this.usedCrossTileIDs[D.overscaledZ]||(this.usedCrossTileIDs[D.overscaledZ]={});var ne=this.usedCrossTileIDs[D.overscaledZ];for(var we in this.indexes){var Oe=this.indexes[we];if(Number(we)>D.overscaledZ)for(var ht in Oe){var Yt=Oe[ht];Yt.tileID.isChildOf(D)&&Yt.findMatches(J.symbolInstances,D,ne)}else{var cr=D.scaledTo(Number(we)),Nt=Oe[cr.key];Nt&&Nt.findMatches(J.symbolInstances,D,ne)}}for(var Ne=0;Ne<J.symbolInstances.length;Ne++){var $e=J.symbolInstances.get(Ne);$e.crossTileID||($e.crossTileID=O.generate(),ne[$e.crossTileID]=!0)}return this.indexes[D.overscaledZ]===void 0&&(this.indexes[D.overscaledZ]={}),this.indexes[D.overscaledZ][D.key]=new Pc(D,J.symbolInstances,J.bucketInstanceId),!0},nf.prototype.removeBucketCrossTileIDs=function(D,J){for(var O in J.indexedSymbolInstances)for(var K=0,de=J.indexedSymbolInstances[O];K<de.length;K+=1){var ne=de[K];delete this.usedCrossTileIDs[D][ne.crossTileID]}},nf.prototype.removeStaleBuckets=function(D){var J=!1;for(var O in this.indexes){var K=this.indexes[O];for(var de in K)D[K[de].bucketInstanceId]||(this.removeBucketCrossTileIDs(O,K[de]),delete K[de],J=!0)}return J};var Vf=function(){this.layerIndexes={},this.crossTileIDs=new Do,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Vf.prototype.addLayer=function(D,J,O){var K=this.layerIndexes[D.id];K===void 0&&(K=this.layerIndexes[D.id]=new nf);var de=!1,ne={};K.handleWrapJump(O);for(var we=0,Oe=J;we<Oe.length;we+=1){var ht=Oe[we],Yt=ht.getBucket(D);!Yt||D.id!==Yt.layerIds[0]||(Yt.bucketInstanceId||(Yt.bucketInstanceId=++this.maxBucketInstanceId),K.addBucket(ht.tileID,Yt,this.crossTileIDs)&&(de=!0),ne[Yt.bucketInstanceId]=!0)}return K.removeStaleBuckets(ne)&&(de=!0),de},Vf.prototype.pruneUnusedLayers=function(D){var J={};D.forEach(function(K){J[K]=!0});for(var O in this.layerIndexes)J[O]||delete this.layerIndexes[O]};var pl=function(Y,D){return i.emitValidationErrors(Y,D&&D.filter(function(J){return J.identifier!=="source.canvas"}))},Zc=i.pick(da,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Jl=i.pick(da,["setCenter","setZoom","setBearing","setPitch"]),qs=Xo(),yu=function(Y){function D(J,O){var K=this;O===void 0&&(O={}),Y.call(this),this.map=J,this.dispatcher=new Z(Ba(),this),this.imageManager=new k,this.imageManager.setEventedParent(this),this.glyphManager=new P(J._requestManager,O.localIdeographFontFamily),this.lineAtlas=new G(256,512),this.crossTileSymbolIndex=new Vf,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new i.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",i.getReferrer());var de=this;this._rtlTextPluginCallback=D.registerForPluginStateChange(function(ne){var we={pluginStatus:ne.pluginStatus,pluginURL:ne.pluginURL};de.dispatcher.broadcast("syncRTLPluginState",we,function(Oe,ht){if(i.triggerPluginCompletionEvent(Oe),ht){var Yt=ht.every(function(Nt){return Nt});if(Yt)for(var cr in de.sourceCaches)de.sourceCaches[cr].reload()}})}),this.on("data",function(ne){if(!(ne.dataType!=="source"||ne.sourceDataType!=="metadata")){var we=K.sourceCaches[ne.sourceId];if(we){var Oe=we.getSource();if(!(!Oe||!Oe.vectorLayerIds))for(var ht in K._layers){var Yt=K._layers[ht];Yt.source===Oe.id&&K._validateLayer(Yt)}}}})}return Y&&(D.__proto__=Y),D.prototype=Object.create(Y&&Y.prototype),D.prototype.constructor=D,D.prototype.loadURL=function(O,K){var de=this;K===void 0&&(K={}),this.fire(new i.Event("dataloading",{dataType:"style"}));var ne=typeof K.validate=="boolean"?K.validate:!i.isMapboxURL(O);O=this.map._requestManager.normalizeStyleURL(O,K.accessToken);var we=this.map._requestManager.transformRequest(O,i.ResourceType.Style);this._request=i.getJSON(we,function(Oe,ht){de._request=null,Oe?de.fire(new i.ErrorEvent(Oe)):ht&&de._load(ht,ne)})},D.prototype.loadJSON=function(O,K){var de=this;K===void 0&&(K={}),this.fire(new i.Event("dataloading",{dataType:"style"})),this._request=i.browser.frame(function(){de._request=null,de._load(O,K.validate!==!1)})},D.prototype.loadEmpty=function(){this.fire(new i.Event("dataloading",{dataType:"style"})),this._load(qs,!1)},D.prototype._load=function(O,K){if(!(K&&pl(this,i.validateStyle(O)))){this._loaded=!0,this.stylesheet=O;for(var de in O.sources)this.addSource(de,O.sources[de],{validate:!1});O.sprite?this._loadSprite(O.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(O.glyphs);var ne=Fa(this.stylesheet.layers);this._order=ne.map(function(Yt){return Yt.id}),this._layers={},this._serializedLayers={};for(var we=0,Oe=ne;we<Oe.length;we+=1){var ht=Oe[we];ht=i.createStyleLayer(ht),ht.setEventedParent(this,{layer:{id:ht.id}}),this._layers[ht.id]=ht,this._serializedLayers[ht.id]=ht.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new V(this.stylesheet.light),this.fire(new i.Event("data",{dataType:"style"})),this.fire(new i.Event("style.load"))}},D.prototype._loadSprite=function(O){var K=this;this._spriteRequest=m(O,this.map._requestManager,function(de,ne){if(K._spriteRequest=null,de)K.fire(new i.ErrorEvent(de));else if(ne)for(var we in ne)K.imageManager.addImage(we,ne[we]);K.imageManager.setLoaded(!0),K._availableImages=K.imageManager.listImages(),K.dispatcher.broadcast("setImages",K._availableImages),K.fire(new i.Event("data",{dataType:"style"}))})},D.prototype._validateLayer=function(O){var K=this.sourceCaches[O.source];if(K){var de=O.sourceLayer;if(de){var ne=K.getSource();(ne.type==="geojson"||ne.vectorLayerIds&&ne.vectorLayerIds.indexOf(de)===-1)&&this.fire(new i.ErrorEvent(new Error('Source layer "'+de+'" does not exist on source "'+ne.id+'" as specified by style layer "'+O.id+'"')))}}},D.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var O in this.sourceCaches)if(!this.sourceCaches[O].loaded())return!1;return!!this.imageManager.isLoaded()},D.prototype._serializeLayers=function(O){for(var K=[],de=0,ne=O;de<ne.length;de+=1){var we=ne[de],Oe=this._layers[we];Oe.type!=="custom"&&K.push(Oe.serialize())}return K},D.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var O in this.sourceCaches)if(this.sourceCaches[O].hasTransition())return!0;for(var K in this._layers)if(this._layers[K].hasTransition())return!0;return!1},D.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},D.prototype.update=function(O){if(this._loaded){var K=this._changed;if(this._changed){var de=Object.keys(this._updatedLayers),ne=Object.keys(this._removedLayers);(de.length||ne.length)&&this._updateWorkerLayers(de,ne);for(var we in this._updatedSources){var Oe=this._updatedSources[we];Oe==="reload"?this._reloadSource(we):Oe==="clear"&&this._clearSource(we)}this._updateTilesForChangedImages();for(var ht in this._updatedPaintProps)this._layers[ht].updateTransitions(O);this.light.updateTransitions(O),this._resetUpdates()}var Yt={};for(var cr in this.sourceCaches){var Nt=this.sourceCaches[cr];Yt[cr]=Nt.used,Nt.used=!1}for(var Ne=0,$e=this._order;Ne<$e.length;Ne+=1){var st=$e[Ne],It=this._layers[st];It.recalculate(O,this._availableImages),!It.isHidden(O.zoom)&&It.source&&(this.sourceCaches[It.source].used=!0)}for(var Bt in Yt){var Ft=this.sourceCaches[Bt];Yt[Bt]!==Ft.used&&Ft.fire(new i.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:Bt}))}this.light.recalculate(O),this.z=O.zoom,K&&this.fire(new i.Event("data",{dataType:"style"}))}},D.prototype._updateTilesForChangedImages=function(){var O=Object.keys(this._changedImages);if(O.length){for(var K in this.sourceCaches)this.sourceCaches[K].reloadTilesForDependencies(["icons","patterns"],O);this._changedImages={}}},D.prototype._updateWorkerLayers=function(O,K){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(O),removedIds:K})},D.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},D.prototype.setState=function(O){var K=this;if(this._checkLoaded(),pl(this,i.validateStyle(O)))return!1;O=i.clone$1(O),O.layers=Fa(O.layers);var de=Sn(this.serialize(),O).filter(function(we){return!(we.command in Jl)});if(de.length===0)return!1;var ne=de.filter(function(we){return!(we.command in Zc)});if(ne.length>0)throw new Error("Unimplemented: "+ne.map(function(we){return we.command}).join(", ")+".");return de.forEach(function(we){we.command!=="setTransition"&&K[we.command].apply(K,we.args)}),this.stylesheet=O,!0},D.prototype.addImage=function(O,K){if(this.getImage(O))return this.fire(new i.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(O,K),this._afterImageUpdated(O)},D.prototype.updateImage=function(O,K){this.imageManager.updateImage(O,K)},D.prototype.getImage=function(O){return this.imageManager.getImage(O)},D.prototype.removeImage=function(O){if(!this.getImage(O))return this.fire(new i.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(O),this._afterImageUpdated(O)},D.prototype._afterImageUpdated=function(O){this._availableImages=this.imageManager.listImages(),this._changedImages[O]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new i.Event("data",{dataType:"style"}))},D.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},D.prototype.addSource=function(O,K,de){var ne=this;if(de===void 0&&(de={}),this._checkLoaded(),this.sourceCaches[O]!==void 0)throw new Error("There is already a source with this ID");if(!K.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(K).join(", ")+".");var we=["vector","raster","geojson","video","image"],Oe=we.indexOf(K.type)>=0;if(!(Oe&&this._validate(i.validateStyle.source,"sources."+O,K,null,de))){this.map&&this.map._collectResourceTiming&&(K.collectResourceTiming=!0);var ht=this.sourceCaches[O]=new ti(O,K,this.dispatcher);ht.style=this,ht.setEventedParent(this,function(){return{isSourceLoaded:ne.loaded(),source:ht.serialize(),sourceId:O}}),ht.onAdd(this.map),this._changed=!0}},D.prototype.removeSource=function(O){if(this._checkLoaded(),this.sourceCaches[O]===void 0)throw new Error("There is no source with this ID");for(var K in this._layers)if(this._layers[K].source===O)return this.fire(new i.ErrorEvent(new Error('Source "'+O+'" cannot be removed while layer "'+K+'" is using it.')));var de=this.sourceCaches[O];delete this.sourceCaches[O],delete this._updatedSources[O],de.fire(new i.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:O})),de.setEventedParent(null),de.clearTiles(),de.onRemove&&de.onRemove(this.map),this._changed=!0},D.prototype.setGeoJSONSourceData=function(O,K){this._checkLoaded();var de=this.sourceCaches[O].getSource();de.setData(K),this._changed=!0},D.prototype.getSource=function(O){return this.sourceCaches[O]&&this.sourceCaches[O].getSource()},D.prototype.addLayer=function(O,K,de){de===void 0&&(de={}),this._checkLoaded();var ne=O.id;if(this.getLayer(ne)){this.fire(new i.ErrorEvent(new Error('Layer with id "'+ne+'" already exists on this map')));return}var we;if(O.type==="custom"){if(pl(this,i.validateCustomStyleLayer(O)))return;we=i.createStyleLayer(O)}else{if(typeof O.source=="object"&&(this.addSource(ne,O.source),O=i.clone$1(O),O=i.extend(O,{source:ne})),this._validate(i.validateStyle.layer,"layers."+ne,O,{arrayIndex:-1},de))return;we=i.createStyleLayer(O),this._validateLayer(we),we.setEventedParent(this,{layer:{id:ne}}),this._serializedLayers[we.id]=we.serialize()}var Oe=K?this._order.indexOf(K):this._order.length;if(K&&Oe===-1){this.fire(new i.ErrorEvent(new Error('Layer with id "'+K+'" does not exist on this map.')));return}if(this._order.splice(Oe,0,ne),this._layerOrderChanged=!0,this._layers[ne]=we,this._removedLayers[ne]&&we.source&&we.type!=="custom"){var ht=this._removedLayers[ne];delete this._removedLayers[ne],ht.type!==we.type?this._updatedSources[we.source]="clear":(this._updatedSources[we.source]="reload",this.sourceCaches[we.source].pause())}this._updateLayer(we),we.onAdd&&we.onAdd(this.map)},D.prototype.moveLayer=function(O,K){this._checkLoaded(),this._changed=!0;var de=this._layers[O];if(!de){this.fire(new i.ErrorEvent(new Error("The layer '"+O+"' does not exist in the map's style and cannot be moved.")));return}if(O!==K){var ne=this._order.indexOf(O);this._order.splice(ne,1);var we=K?this._order.indexOf(K):this._order.length;if(K&&we===-1){this.fire(new i.ErrorEvent(new Error('Layer with id "'+K+'" does not exist on this map.')));return}this._order.splice(we,0,O),this._layerOrderChanged=!0}},D.prototype.removeLayer=function(O){this._checkLoaded();var K=this._layers[O];if(!K){this.fire(new i.ErrorEvent(new Error("The layer '"+O+"' does not exist in the map's style and cannot be removed.")));return}K.setEventedParent(null);var de=this._order.indexOf(O);this._order.splice(de,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[O]=K,delete this._layers[O],delete this._serializedLayers[O],delete this._updatedLayers[O],delete this._updatedPaintProps[O],K.onRemove&&K.onRemove(this.map)},D.prototype.getLayer=function(O){return this._layers[O]},D.prototype.hasLayer=function(O){return O in this._layers},D.prototype.setLayerZoomRange=function(O,K,de){this._checkLoaded();var ne=this.getLayer(O);if(!ne){this.fire(new i.ErrorEvent(new Error("The layer '"+O+"' does not exist in the map's style and cannot have zoom extent.")));return}ne.minzoom===K&&ne.maxzoom===de||(K!=null&&(ne.minzoom=K),de!=null&&(ne.maxzoom=de),this._updateLayer(ne))},D.prototype.setFilter=function(O,K,de){de===void 0&&(de={}),this._checkLoaded();var ne=this.getLayer(O);if(!ne){this.fire(new i.ErrorEvent(new Error("The layer '"+O+"' does not exist in the map's style and cannot be filtered.")));return}if(!i.deepEqual(ne.filter,K)){if(K==null){ne.filter=void 0,this._updateLayer(ne);return}this._validate(i.validateStyle.filter,"layers."+ne.id+".filter",K,null,de)||(ne.filter=i.clone$1(K),this._updateLayer(ne))}},D.prototype.getFilter=function(O){return i.clone$1(this.getLayer(O).filter)},D.prototype.setLayoutProperty=function(O,K,de,ne){ne===void 0&&(ne={}),this._checkLoaded();var we=this.getLayer(O);if(!we){this.fire(new i.ErrorEvent(new Error("The layer '"+O+"' does not exist in the map's style and cannot be styled.")));return}i.deepEqual(we.getLayoutProperty(K),de)||(we.setLayoutProperty(K,de,ne),this._updateLayer(we))},D.prototype.getLayoutProperty=function(O,K){var de=this.getLayer(O);if(!de){this.fire(new i.ErrorEvent(new Error("The layer '"+O+"' does not exist in the map's style.")));return}return de.getLayoutProperty(K)},D.prototype.setPaintProperty=function(O,K,de,ne){ne===void 0&&(ne={}),this._checkLoaded();var we=this.getLayer(O);if(!we){this.fire(new i.ErrorEvent(new Error("The layer '"+O+"' does not exist in the map's style and cannot be styled.")));return}if(!i.deepEqual(we.getPaintProperty(K),de)){var Oe=we.setPaintProperty(K,de,ne);Oe&&this._updateLayer(we),this._changed=!0,this._updatedPaintProps[O]=!0}},D.prototype.getPaintProperty=function(O,K){return this.getLayer(O).getPaintProperty(K)},D.prototype.setFeatureState=function(O,K){this._checkLoaded();var de=O.source,ne=O.sourceLayer,we=this.sourceCaches[de];if(we===void 0){this.fire(new i.ErrorEvent(new Error("The source '"+de+"' does not exist in the map's style.")));return}var Oe=we.getSource().type;if(Oe==="geojson"&&ne){this.fire(new i.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(Oe==="vector"&&!ne){this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}O.id===void 0&&this.fire(new i.ErrorEvent(new Error("The feature id parameter must be provided."))),we.setFeatureState(ne,O.id,K)},D.prototype.removeFeatureState=function(O,K){this._checkLoaded();var de=O.source,ne=this.sourceCaches[de];if(ne===void 0){this.fire(new i.ErrorEvent(new Error("The source '"+de+"' does not exist in the map's style.")));return}var we=ne.getSource().type,Oe=we==="vector"?O.sourceLayer:void 0;if(we==="vector"&&!Oe){this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(K&&typeof O.id!="string"&&typeof O.id!="number"){this.fire(new i.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}ne.removeFeatureState(Oe,O.id,K)},D.prototype.getFeatureState=function(O){this._checkLoaded();var K=O.source,de=O.sourceLayer,ne=this.sourceCaches[K];if(ne===void 0){this.fire(new i.ErrorEvent(new Error("The source '"+K+"' does not exist in the map's style.")));return}var we=ne.getSource().type;if(we==="vector"&&!de){this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return O.id===void 0&&this.fire(new i.ErrorEvent(new Error("The feature id parameter must be provided."))),ne.getFeatureState(de,O.id)},D.prototype.getTransition=function(){return i.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},D.prototype.serialize=function(){return i.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:i.mapObject(this.sourceCaches,function(O){return O.serialize()}),layers:this._serializeLayers(this._order)},function(O){return O!==void 0})},D.prototype._updateLayer=function(O){this._updatedLayers[O.id]=!0,O.source&&!this._updatedSources[O.source]&&this.sourceCaches[O.source].getSource().type!=="raster"&&(this._updatedSources[O.source]="reload",this.sourceCaches[O.source].pause()),this._changed=!0},D.prototype._flattenAndSortRenderedFeatures=function(O){for(var K=this,de=function(bi){return K._layers[bi].type==="fill-extrusion"},ne={},we=[],Oe=this._order.length-1;Oe>=0;Oe--){var ht=this._order[Oe];if(de(ht)){ne[ht]=Oe;for(var Yt=0,cr=O;Yt<cr.length;Yt+=1){var Nt=cr[Yt],Ne=Nt[ht];if(Ne)for(var $e=0,st=Ne;$e<st.length;$e+=1){var It=st[$e];we.push(It)}}}}we.sort(function(bi,gn){return gn.intersectionZ-bi.intersectionZ});for(var Bt=[],Ft=this._order.length-1;Ft>=0;Ft--){var Ut=this._order[Ft];if(de(Ut))for(var zt=we.length-1;zt>=0;zt--){var _t=we[zt].feature;if(ne[_t.layer.id]<Ft)break;Bt.push(_t),we.pop()}else for(var Dt=0,vt=O;Dt<vt.length;Dt+=1){var lr=vt[Dt],_r=lr[Ut];if(_r)for(var Br=0,Di=_r;Br<Di.length;Br+=1){var ci=Di[Br];Bt.push(ci.feature)}}}return Bt},D.prototype.queryRenderedFeatures=function(O,K,de){K&&K.filter&&this._validate(i.validateStyle.filter,"queryRenderedFeatures.filter",K.filter,null,K);var ne={};if(K&&K.layers){if(!Array.isArray(K.layers))return this.fire(new i.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var we=0,Oe=K.layers;we<Oe.length;we+=1){var ht=Oe[we],Yt=this._layers[ht];if(!Yt)return this.fire(new i.ErrorEvent(new Error("The layer '"+ht+"' does not exist in the map's style and cannot be queried for features."))),[];ne[Yt.source]=!0}}var cr=[];K.availableImages=this._availableImages;for(var Nt in this.sourceCaches)K.layers&&!ne[Nt]||cr.push(ce(this.sourceCaches[Nt],this._layers,this._serializedLayers,O,K,de));return this.placement&&cr.push(He(this._layers,this._serializedLayers,this.sourceCaches,O,K,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(cr)},D.prototype.querySourceFeatures=function(O,K){K&&K.filter&&this._validate(i.validateStyle.filter,"querySourceFeatures.filter",K.filter,null,K);var de=this.sourceCaches[O];return de?lt(de,K):[]},D.prototype.addSourceType=function(O,K,de){if(D.getSourceType(O))return de(new Error('A source type called "'+O+'" already exists.'));if(D.setSourceType(O,K),!K.workerSourceURL)return de(null,null);this.dispatcher.broadcast("loadWorkerSource",{name:O,url:K.workerSourceURL},de)},D.prototype.getLight=function(){return this.light.getLight()},D.prototype.setLight=function(O,K){K===void 0&&(K={}),this._checkLoaded();var de=this.light.getLight(),ne=!1;for(var we in O)if(!i.deepEqual(O[we],de[we])){ne=!0;break}if(ne){var Oe={now:i.browser.now(),transition:i.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(O,K),this.light.updateTransitions(Oe)}},D.prototype._validate=function(O,K,de,ne,we){return we===void 0&&(we={}),we&&we.validate===!1?!1:pl(this,O.call(i.validateStyle,i.extend({key:K,style:this.serialize(),value:de,styleSpec:i.styleSpec},ne)))},D.prototype._remove=function(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),i.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(var O in this._layers){var K=this._layers[O];K.setEventedParent(null)}for(var de in this.sourceCaches)this.sourceCaches[de].clearTiles(),this.sourceCaches[de].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},D.prototype._clearSource=function(O){this.sourceCaches[O].clearTiles()},D.prototype._reloadSource=function(O){this.sourceCaches[O].resume(),this.sourceCaches[O].reload()},D.prototype._updateSources=function(O){for(var K in this.sourceCaches)this.sourceCaches[K].update(O)},D.prototype._generateCollisionBoxes=function(){for(var O in this.sourceCaches)this._reloadSource(O)},D.prototype._updatePlacement=function(O,K,de,ne,we){we===void 0&&(we=!1);for(var Oe=!1,ht=!1,Yt={},cr=0,Nt=this._order;cr<Nt.length;cr+=1){var Ne=Nt[cr],$e=this._layers[Ne];if($e.type==="symbol"){if(!Yt[$e.source]){var st=this.sourceCaches[$e.source];Yt[$e.source]=st.getRenderableIds(!0).map(function(Dt){return st.getTileByID(Dt)}).sort(function(Dt,vt){return vt.tileID.overscaledZ-Dt.tileID.overscaledZ||(Dt.tileID.isLessThan(vt.tileID)?-1:1)})}var It=this.crossTileSymbolIndex.addLayer($e,Yt[$e.source],O.center.lng);Oe=Oe||It}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),we=we||this._layerOrderChanged||de===0,(we||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(i.browser.now(),O.zoom))&&(this.pauseablePlacement=new Oo(O,this._order,we,K,de,ne,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Yt),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.browser.now()),ht=!0),Oe&&this.pauseablePlacement.placement.setStale()),ht||Oe)for(var Bt=0,Ft=this._order;Bt<Ft.length;Bt+=1){var Ut=Ft[Bt],zt=this._layers[Ut];zt.type==="symbol"&&this.placement.updateLayerOpacities(zt,Yt[zt.source])}var _t=!this.pauseablePlacement.isDone()||this.placement.hasTransitions(i.browser.now());return _t},D.prototype._releaseSymbolFadeTiles=function(){for(var O in this.sourceCaches)this.sourceCaches[O].releaseSymbolFadeTiles()},D.prototype.getImages=function(O,K,de){this.imageManager.getImages(K.icons,de),this._updateTilesForChangedImages();var ne=this.sourceCaches[K.source];ne&&ne.setDependencies(K.tileID.key,K.type,K.icons)},D.prototype.getGlyphs=function(O,K,de){this.glyphManager.getGlyphs(K.stacks,de)},D.prototype.getResource=function(O,K,de){return i.makeRequest(K,de)},D}(i.Evented);yu.getSourceType=Be,yu.setSourceType=Le,yu.registerForPluginStateChange=i.registerForPluginStateChange;var oc=i.createLayout([{name:"a_pos",type:"Int16",components:2}]),Cf=`#ifdef GL_ES
2719precision mediump float;
2720#else
2721#if !defined(lowp)

Callers 3

MFunction · 0.70
anFunction · 0.70
KQFunction · 0.70

Calls 3

EsFunction · 0.70
HsFunction · 0.70
evaluateMethod · 0.45

Tested by

no test coverage detected