PageSourceSearch

https://westphillyporchfest.com/232.281b4ed87b734329.js

js westphillyporchfest.com collected 2026-10-02 06:55:12 UTC 997,050 bytes, 1 lines download raw bytes

1(self.webpackChunkngPorchFest=self.webpackChunkngPorchFest||[]).push([[232],{4232:(od,Fo,it)=>{"use strict";it.r(Fo),it.d(Fo,{PagesModule:()=>na});var zr=it(9808),xl=it(4980),ls=it(7249),s=it(3075),Ie=it(7531),An=it(2081),Ji=it(7423),ut=it(5245),vt=it(4107),Ci=it(9224),Fi=it(3251),ve=(it(3191),it(5e3)),Zi=it(508),Zn=it(727),Ve=(it(7579),it(9770),it(6451),it(9646),it(4968),it(925),it(9776)),Bo=it(8962),$i=it(1159),di=(it(7429),it(3489));it(8675),it(3900),it(5698),it(9300),it(4004),it(8505),it(4986),it(7272),it(4482),it(5403),it(5032),it(5577),it(5963),it(226);const Nr={provide:new ve.OlP("mat-autocomplete-scroll-strategy"),deps:[Ve.aV],useFactory:function Xn(O){return()=>O.scrollStrategies.reposition()}};let Ur=(()=>{class O{}return O.\u0275fac=function(g){return new(g||O)},O.\u0275mod=ve.oAB({type:O}),O.\u0275inj=ve.cJS({providers:[Nr],imports:[[Ve.U8,Zi.Ng,Zi.BQ,zr.ez],Bo.ZD,Zi.Ng,Zi.BQ]}),O})();var lo=it(7446),pr=it(8966);it(1135),it(8306),it(9841),it(2722);let bl=(()=>{class O{}return O.\u0275fac=function(g){return new(g||O)},O.\u0275mod=ve.oAB({type:O}),O.\u0275inj=ve.cJS({}),O})();var Go=it(520);const nn=new ve.OlP("ngx-mat-date-formats");class ms extends Zi._A{isSameTime(Z,g){return null==Z||null==g||this.getHour(Z)===this.getHour(g)&&this.getMinute(Z)===this.getMinute(g)&&this.getSecond(Z)===this.getSecond(g)}copyTime(Z,g){this.setHour(Z,this.getHour(g)),this.setMinute(Z,this.getMinute(g)),this.setSecond(Z,this.getSecond(g))}compareDateWithTime(Z,g,A){let q=super.compareDate(Z,g)||this.getHour(Z)-this.getHour(g)||this.getMinute(Z)-this.getMinute(g);
1return A&&(q=q||this.getSecond(Z)-this.getSecond(g)),q}setTimeByDefaultValues(Z,g){if(!Array.isArray(g))throw Error("@Input DefaultTime should be an array");this.setHour(Z,g[0]||0),this.setMinute(Z,g[1]||0),this.setSecond(Z,g[2]||0)}}function Sa(O){return Error(`NgxMatDatepicker: No provider found for ${O}. You must import one of the following modules at your application root: NgxMatNativeDateModule, NgxMatMomentModule, or provide a custom implementation.`)}new ve.OlP("NGX_MAT_DATE_RANGE_SELECTION_STRATEGY"),(0,Zi.pj)(class{constructor(O){this._elementRef=O}});const go={provide:s.JU,useExisting:(0,ve.Gpc)(()=>gr),multi:!0},On={provide:s.Cf,useExisting:(0,ve.Gpc)(()=>gr),multi:!0};class fr{constructor(Z,g){this.target=Z,this.targetElement=g,this.value=this.target.value}}let yo,gr=(()=>{class O{constructor(g,A,q,de){if(this._elementRef=g,this._dateAdapter=A,this._dateFormats=q,this._formField=de,this.dateChange=new ve.vpe,this.dateInput=new ve.vpe,this._valueChange=new ve.vpe,this.stateChanges=new ve.vpe,this._onTouched=()=>{},this._cvaOnChange=()=>{},this._validatorOnChange=()=>{},this._datepickerSubscription=Zn.w0.EMPTY,this._localeSubscription=Zn.w0.EMPTY,this._parseValidator=()=>this._lastValueValid?null:{matDatetimePickerParse:{text:this._elementRef.nativeElement.value}},this._minValidator=He=>{const nt=this._getValidDateOrNull(this._dateAdapter.deserialize(He.value));return!this.min||!nt||this._dateAdapter.compareDateWithTime(this.min,nt,this._datepicker.showSeconds)<=0?null:{matDatetimePickerMin:{min:this.min,actual:nt}}},this._maxValidator=He=>{const nt=this._getValidDateOrNull(this._dateAdapter.deserialize(He.value));return!this.max||!nt||this._dateAdapter.compareDateWithTime(this.max,nt,this._datepicker.showSeconds)>=0?null:{matDatetimePickerMax:{max:this.max,actual:nt}}},this._filterValidator=He=>{const nt=this._getValidDateOrNull(this._dateAdapter.deserialize(He.value));return this._dateFilter&&nt&&!this._dateFilter(nt)?{matDatetimePickerFilter:!0}:null},this._validator=s.kI.compose([this._parseValidator,this._minValidator,this._maxValidator,this._filterValidator]),this._lastValueValid=!1,!this._dateAdapter)throw Sa("NgxMatDateAdapter");if(!this._dateFormats)throw Sa("NGX_MAT_DATE_FORMATS");this._localeSubscription=A.localeChanges.subscribe(()=>{this.value=this.value})}set ngxMatDatetimePicker(g){!g||(this._datepicker=g,this._datepicker._registerInput(this),this._datepickerSubscription.unsubscribe(),this._datepickerSubscription=this._datepicker._selectedChanged.subscribe(A=>{this.value=A,this._cvaOnChange(A),this._onTouched(),this.dateInput.emit(new fr(this,this._elementRef.nativeElement)),this.dateChange.emit(new fr(this,this._elementRef.nativeElement))}))}set ngxMatDatetimePickerFilter(g){this._dateFilter=g,this._validatorOnChange()}get value(){return this._value}set value(g){g=this._dateAdapter.deserialize(g),this._lastValueValid=!g||this._dateAdapter.isValid(g),g=this._getValidDateOrNull(g);const A=this.value;this._value=g,this._formatValue(g),this._dateAdapter.sameDate(A,g)||this._valueChange.emit(g)}get min(){return this._min}set min(g){this._min=this._getValidDateOrNull(this._dateAdapter.deserialize(g)),this._validatorOnChange()}get max(){return this._max}set max(g){this._max=this._getValidDateOrNull(this._dateAdapter.deserialize(g)),this._validatorOnChange()}get disabled(){return!!this._disabled}set disabled(g){const A=null!=g&&"false"!=`${g}`,q=this._elementRef.nativeElement;this._disabled!==A&&(this._disabled=A,this.stateChanges.emit(void 0)),A&&q.blur&&q.blur()}ngOnDestroy(){this._datepickerSubscription.unsubscribe(),this._localeSubscription.unsubscribe(),this._valueChange.complete(),this.stateChanges.complete()}registerOnValidatorChange(g){this._validatorOnChange=g}validate(g){return this._validator?this._validator(g):null}getPopupConnectionElementRef(){return this.getConnectedOverlayOrigin()}getConnectedOverlayOrigin(){return this._formField?this._formField.getConnectedOverlayOrigin():this._elementRef}writeValue(g){this.value=g}registerOnChange(g){this._cvaOnChange=g}registerOnTouched(g){this._onTouched=g}setDisabledState(g){this.disabled=g}_onKeydown(g){this._datepicker&&g.altKey&&g.keyCode===$i.JH&&!this._elementRef.nativeElement.readOnly&&(this._datepicker.open(),g.preventDefault())}_onInput(g){const A=this._lastValueValid;let q=this._dateAdapter.parse(g,this._dateFormats.parse.dateInput);this._lastValueValid=!q||this._dateAdapter.isValid(q),q=this._getValidDateOrNull(q);const de=this._dateAdapter.isSameTime(q,this._value);null!=q&&(!de||!this._dateAdapter.sameDate(q,this._value))||null==q&&null!=this._value?(this._value=q,this._cvaOnChange(q),this._valueChange.emit(q),this.dateInput.emit(new fr(this,this._elementRef.nativeElement))):A!==this._lastValueValid&&this._val
1idatorOnChange()}_onChange(){this.dateChange.emit(new fr(this,this._elementRef.nativeElement))}_getThemePalette(){return this._formField?this._formField.color:void 0}_onBlur(){this.value&&this._formatValue(this.value),this._onTouched()}_onFocus(){this._datepicker&&this._datepicker.opened&&this._datepicker.cancel()}_formatValue(g){this._elementRef.nativeElement.value=g?this._dateAdapter.format(g,this._dateFormats.display.dateInput):""}_getValidDateOrNull(g){return this._dateAdapter.isDateInstance(g)&&this._dateAdapter.isValid(g)?g:null}}return O.\u0275fac=function(g){return new(g||O)(ve.Y36(ve.SBq),ve.Y36(ms,8),ve.Y36(nn,8),ve.Y36(di.KE,8))},O.\u0275dir=ve.lG2({type:O,selectors:[["input","ngxMatDatetimePicker",""]],hostVars:5,hostBindings:function(g,A){1&g&&ve.NdJ("input",function(de){return A._onInput(de.target.value)})("change",function(){return A._onChange()})("blur",function(){return A._onBlur()})("focus",function(){return A._onFocus()})("keydown",function(de){return A._onKeydown(de)}),2&g&&(ve.Ikx("disabled",A.disabled),ve.uIk("aria-haspopup",A._datepicker?"dialog":null)("aria-owns",(null==A._datepicker?null:A._datepicker.opened)&&A._datepicker.id||null)("min",A.min?A._dateAdapter.toIso8601(A.min):null)("max",A.max?A._dateAdapter.toIso8601(A.max):null))},inputs:{ngxMatDatetimePicker:"ngxMatDatetimePicker",ngxMatDatetimePickerFilter:"ngxMatDatetimePickerFilter",value:"value",min:"min",max:"max",disabled:"disabled"},outputs:{dateChange:"dateChange",dateInput:"dateInput"},exportAs:["ngxMatDatetimePickerInput"],features:[ve._Bn([go,On,{provide:Ie.Jk,useExisting:O}])]}),O})(),_o=(()=>{class O{}return O.\u0275fac=function(g){return new(g||O)},O.\u0275mod=ve.oAB({type:O}),O.\u0275inj=ve.cJS({imports:[[zr.ez,Ie.c,s.UX,s.u5,ut.Ps,Ji.ot]]}),O})();try{yo="undefined"!=typeof Intl}catch(O){yo=!1}!function Sl(O,Z){const g=Array(O);for(let A=0;A<O;A++)g[A]=Z(A)}(31,O=>String(O+1)),it(9898);const Qo=new ve.OlP("MapboxApiKey"),Fs=new ve.OlP("MapboxApiKey");let Oa=(()=>{class O{static withConfig(g){return{ngModule:O,providers:[{provide:Qo,useValue:g.accessToken},{provide:Fs,useValue:g.geocoderAccessToken||g.accessToken}]}}}return O.\u0275fac=function(g){return new(g||O)},O.\u0275mod=ve.oAB({type:O}),O.\u0275inj=ve.cJS({imports:[[zr.ez]]}),O})();var Pl=it(2340),Fa=it(9814);let na=(()=>{class O{}return O.\u0275fac=function(g){return new(g||O)},O.\u0275mod=ve.oAB({type:O}),O.\u0275inj=ve.cJS({providers:[ls.je,ls.qT,ls.sM],imports:[[zr.ez,xl.M,ls.UO,Oa.withConfig({accessToken:Pl.N.mapbox.apiKey}),s.u5,s.UX,Ie.c,An.T5,Ji.ot,ut.Ps,vt.LD,lo.p9,pr.Is,Ur,Ci.QW,Fi.Nh,_o,bl,Go.JF,Go.Ed,Fa.Fk]]}),O})()},9898:function(od){od.exports=function(){"use strict";var Fo,it,zr;function xl(s,Ie){if(Fo)if(it){var An="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+Fo+")(sharedChunk); ("+it+")(sharedChunk); self.onerror = null;",Ji={};Fo(Ji),zr=Ie(Ji),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(zr.workerUrl=window.URL.createObjectURL(new Blob([An],{type:"text/javascript"})))}else it=Ie;else Fo=Ie}return xl(0,function(s){var Ie="undefined"!=typeof self?self:{},An="2.15.0";let Ji;const ut={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==Ji){const t=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{Ji=null!=process.env.API_URL_REGEX?new RegExp(process.env.API_URL_REGEX):t}catch(e){Ji=t}}return Ji},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!ut.API_URL)return null;try{const t=new URL(ut.API_URL);return"api.mapbox.cn"===t.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===t.hostname?"https://events.mapbox.com/events/v2":null}catch(t){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16}
1,vt={supported:!1,testSupport:function(t){!In&&Fi&&(ve?Zi(t):Ci=t)}};let Ci,Fi,In=!1,ve=!1;function Zi(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,Fi),t.isContextLost())return;vt.supported=!0}catch(i){}t.deleteTexture(e),In=!0}Ie.document&&(Fi=Ie.document.createElement("img"),Fi.onload=function(){Ci&&Zi(Ci),Ci=null,ve=!0},Fi.onerror=function(){In=!0,Ci=null},Fi.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Zn="01";function li(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Pr=Bi;function Bi(t,e,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=r}Bi.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var a=this.sampleCurveX(i)-t;if(Math.abs(a)<e)return i;var c=this.sampleCurveDerivativeX(i);if(Math.abs(c)<1e-6)break;i-=a/c}var u=0,p=1;for(i=t,r=0;r<20&&(a=this.sampleCurveX(i),!(Math.abs(a-t)<e));r++)t>a?u=i:p=i,i=.5*(p-u)+u;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var hr=li(Pr),Dn=un;function un(t,e){this.x=t,this.y=e}un.prototype={clone:function(){return new un(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),r=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=r,this},_rotateAround:function(t,e){var i=Math.cos(t),r=Math.sin(t),a=e.y+r*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-r*(this.y-e.y),this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},un.convert=function(t){return t instanceof un?t:Array.isArray(t)?new un(t[0],t[1]):t};var Ve=li(Dn);const Bo=Math.PI/180,$i=180/Math.PI;function wt(t){return t*Bo}function di(t){return t*$i}const Ma=[[0,0],[1,0],[1,1],[0,1]];function ur(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}function Ti(t,e,i,r){const a=new hr(t,e,i,r);return function(c){return a.solve(c)}}const Lr=Ti(.25,.1,.25,1);function rt(t,e,i){return Math.min(i,Math.max(e,t))}function Rr(t,e,i){return(i=rt((i-t)/(e-t),0,1))*i*(3-2*i)}function pi(t,e,i){const r=i-e,a=((t-e)%r+r)%r+e;return a===e?i:a}function bi(t,e,i){if(!t.length)return i(null,[]);let r=t.length;const a=new Array(t.length);let c=null;t.forEach((u,p)=>{e(u,(f,_)=>{f&&(c=f),a[p]=_,0==--r&&i(c,a)})})}function $n(t){const e=[];for(const i in t)e.push(t[i]);return e}function ni(t,...e){for(const i of e)for(const r in i)t[r]=i[r];return t}let qn=1;function Or(){return qn++}function Wn(){return function t(e){return e?(e^Math.random()*(16>>e/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function kn(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function oo(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function dr(t,e){t.forEach(i=>
1{e[i]&&(e[i]=e[i].bind(e))})}function Fr(t,e){return-1!==t.indexOf(e,t.length-e.length)}function Mt(t,e,i){const r={};for(const a in t)r[a]=e.call(i||this,t[a],a,t);return r}function ao(t,e,i){const r={};for(const a in t)e.call(i||this,t[a],a,t)&&(r[a]=t[a]);return r}function Qi(t){return Array.isArray(t)?t.map(Qi):"object"==typeof t&&t?Mt(t,Qi):t}const No={};function Ht(t){No[t]||("undefined"!=typeof console&&console.warn(t),No[t]=!0)}function dn(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function Ea(t){let e=0;for(let i,r,a=0,c=t.length,u=c-1;a<c;u=a++)i=t[a],r=t[u],e+=(r.x-i.x)*(i.y+r.y);return e}function zn(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function qi(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,r,a,c)=>{const u=a||c;return e[r]=!u||u.toLowerCase(),""}),e["max-age"]){const i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e}let Vo=null;function so(t){if(null==Vo){const e=t.navigator?t.navigator.userAgent:null;Vo=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Vo}function Br(t){try{const e=Ie[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(e){return!1}}function Xn(t,e){return[t[4*e],t[4*e+1],t[4*e+2],t[4*e+3]]}const Nr="mapbox-tiles";let en,Yn,Uo=500,Ca=50;function jo(){try{return Ie.caches}catch(t){}}function Vr(){jo()&&!en&&(en=Ie.caches.open(Nr))}function Ur(t){const e=t.indexOf("?");if(e<0)return t;const r=function(a){const c=a.indexOf("?");return c>0?a.slice(c+1).split("&"):[]}(t).filter(a=>{const c=a.split("=");return"language"===c[0]||"worldview"===c[0]});return r.length?`${t.slice(0,e)}?${r.join("&")}`:t.slice(0,e)}let lo=1/0;const pr={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(pr);class qt extends Error{constructor(e,i,r){401===i&&ce(r)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=i,this.url=r}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const mr=zn()?()=>self.worker&&self.worker.referrer:()=>("blob:"===Ie.location.protocol?Ie.parent:Ie).location.href,tn=function(t,e){if(!(/^file:/.test(i=t.url)||/^file:/.test(mr())&&!/^\w+:/.test(i))){if(Ie.fetch&&Ie.Request&&Ie.AbortController&&Ie.Request.prototype.hasOwnProperty("signal"))return function(r,a){const c=new Ie.AbortController,u=new Ie.Request(r.url,{method:r.method||"GET",body:r.body,credentials:r.credentials,headers:r.headers,referrer:mr(),referrerPolicy:r.referrerPolicy,signal:c.signal});let p=!1,f=!1;const _=(x=u.url).indexOf("sku=")>0&&ce(x);var x;"json"===r.type&&u.headers.set("Accept","application/json");const w=(T,S,k)=>{if(f)return;if(T&&"SecurityError"!==T.message&&Ht(T.toString()),S&&k)return M(S);const R=Date.now();Ie.fetch(u).then(j=>{if(j.ok){const K=_?j.clone():null;return M(j,K,R)}return a(new qt(j.statusText,j.status,r.url))}).catch(j=>{"AbortError"!==j.name&&a(new Error(`${j.message} ${r.url}`))})},M=(T,S,k)=>{("arrayBuffer"===r.type?T.arrayBuffer():"json"===r.type?T.json():T.text()).then(R=>{f||(S&&k&&function(j,K,G){if(Vr(),!en)return;const H={status:K.status,statusText:K.statusText,headers:new Ie.Headers};K.headers.forEach((fe,ue)=>H.headers.set(ue,fe));const ee=qi(K.headers.get("Cache-Control")||"");if(ee["no-store"])return;ee["max-age"]&&H.headers.set("Expires",new Date(G+1e3*ee["max-age"]).toUTCString());const Q=H.headers.get("Expires");Q&&(new Date(Q).getTime()-G<42e4||function(fe,ue){if(void 0===Yn)try{new Response(new ReadableStream),Yn=!0}catch(we){Yn=!1}Yn?ue(fe.body):fe.blob().then(ue)}(K,fe=>{const ue=new Ie.Response(fe,H);Vr(),en&&en.then(we=>we.put(Ur(j.url),ue)).catch(we=>Ht(we.message))}))}(u,S,k),p=!0,a(null,R,T.headers.get("Cache-Control"),T.headers.get("Expires")))}).catch(R=>{f||a(new Error(R.message))})};return _?function(T,S){if(Vr(),!en)return S(null);const k=Ur(T.url);en.then(R=>{R.match(k).then(j=>{const K=function(G){if(!G)return!1;const H=new Date(G.headers.get("Expires")||0),ee=qi(G.headers.get("Cache-Control")||"");return H>
1Date.now()&&!ee["no-cache"]}(j);R.delete(k),K&&R.put(k,j.clone()),S(null,j,K)}).catch(S)}).catch(S)}(u,w):w(null,null),{cancel:()=>{f=!0,p||c.abort()}}}(t,e);if(zn()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var i;return function(r,a){const c=new Ie.XMLHttpRequest;c.open(r.method||"GET",r.url,!0),"arrayBuffer"===r.type&&(c.responseType="arraybuffer");for(const u in r.headers)c.setRequestHeader(u,r.headers[u]);return"json"===r.type&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials="include"===r.credentials,c.onerror=()=>{a(new Error(c.statusText))},c.onload=()=>{if((c.status>=200&&c.status<300||0===c.status)&&null!==c.response){let u=c.response;if("json"===r.type)try{u=JSON.parse(c.response)}catch(p){return a(p)}a(null,u,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else a(new qt(c.statusText,c.status,r.url))},c.send(r.body),{cancel:()=>c.abort()}}(t,e)},Jt=function(t,e){return tn(ni(t,{type:"arrayBuffer"}),e)};function co(t){const e=Ie.document.createElement("a");return e.href=t,e.protocol===Ie.document.location.protocol&&e.host===Ie.document.location.host}const Y="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let z,P;z=[],P=0;const X=function(t,e){if(vt.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),P>=ut.MAX_PARALLEL_IMAGE_REQUESTS){const c={requestParameters:t,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return z.push(c),c}P++;let i=!1;const r=()=>{if(!i)for(i=!0,P--;z.length&&P<ut.MAX_PARALLEL_IMAGE_REQUESTS;){const c=z.shift(),{requestParameters:u,callback:p,cancelled:f}=c;f||(c.cancel=X(u,p).cancel)}},a=Jt(t,(c,u,p,f)=>{r(),c?e(c):u&&(Ie.createImageBitmap?function(_,x){const w=new Ie.Blob([new Uint8Array(_)],{type:"image/png"});Ie.createImageBitmap(w).then(M=>{x(null,M)}).catch(M=>{x(new Error(`Could not load image because of ${M.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(u,(_,x)=>e(_,x,p,f)):function(_,x){const w=new Ie.Image,M=Ie.URL;w.onload=()=>{x(null,w),M.revokeObjectURL(w.src),w.onload=null,Ie.requestAnimationFrame(()=>{w.src=Y})},w.onerror=()=>x(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const T=new Ie.Blob([new Uint8Array(_)],{type:"image/png"});w.src=_.byteLength?M.createObjectURL(T):Y}(u,(_,x)=>e(_,x,p,f)))});return{cancel:()=>{a.cancel(),r()}}},J="NO_ACCESS_TOKEN";function oe(t){return 0===t.indexOf("mapbox:")}function ce(t){return ut.API_URL_REGEX.test(t)}function le(t){return ut.API_CDN_URL_REGEX.test(t)}function re(t){return ut.API_STYLE_REGEX.test(t)&&!ge(t)}function ge(t){return ut.API_SPRITE_REGEX.test(t)}const Fe=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Ne(t){const e=t.match(Fe);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function Le(t){const e=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${e}`}const st="mapbox.eventData";function mt(t){if(!t)return null;const e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(Ie.atob(e[1]).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch(i){return null}}class at{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const i=mt(ut.ACCESS_TOKEN);let r="";return r=i&&i.u?Ie.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(a,c)=>String.fromCharCode(Number("0x"+c)))):ut.ACCESS_TOKEN||"",e?`${st}.${e}:${r}`:`${st}:${r}`}fetchEventData(){const e=Br("localStorage"),i=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{const a=Ie.localStorage.getItem(i);a&&(this.eventData=JSON.parse(a));const c=Ie.localStorage.getItem(r);c&&(this.anonId=c)}catch(a){Ht("Unable to read from LocalStorage")}}saveEventData(){const e=Br("localStorage"),i=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{Ie.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&Ie.localStorage.setItem(i,JSON.stringify(this.eventData))}catch(a){Ht("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,i,r,a){if(!ut.EVENTS_URL)return;const c=Ne(ut.EVENTS_URL);c.params.push(`access_token=${a||ut.ACCESS_TOKEN||""}`);const u={event:this.type,created:new Date(e).toISOString()},p=i?ni(u,i):u,f={url:Le(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([p])};var x;this.pendingRequest=(x=_=>{this.pendingRequest=null,r(_),this.saveEventData(),this.processRequests(a)},tn(ni(f,{method:"POST"}),x))}queueRequest(e,i){this.queue.push(e),this.processRequests(i)}}const ft=new class extends at{constructor(t){super("appUserTurnstile"),this._customAccessToken=t}postTurnstileEvent(t,e){ut.EVENTS_URL&&ut.ACCESS_TOKEN&&Array.isArray(t)&&t.some(i=>oe(i)||ce(i))&&this.queueRequest(Date.now(),e)}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const e=mt(ut.ACCESS_TOKEN),i=e?e.u:ut.ACCESS_TOKEN;let r=i!==this.eventData.tokenU;oo(this.anonId)||(this.anonId=Wn(),r=!0);const a=this.queue.shift();if(this.eventData.lastSuccess){const c=new Date(this.eventData.lastSuccess),u=new Date(a),p=(a-this.eventData.lastSuccess)/864e5;r=r||p>=1||p<-1||c.getDate()!==u.getDate()}else r=!0;r?this.postEvent(a,{sdkIdentifier:"mapbox-gl-js",sdkVersion:An,skuId:Zn,"enabled.telemetry":!1,userId:this.anonId},c=>{c||(this.eventData.lastSuccess=a,this.eventData.tokenU=i)},t):this.processRequests()}},Et=ft.postTurnstileEvent.bind(ft),Wt=new class extends at{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(t,e,i,r){this.skuToken=e,this.errorCb=r,ut.EVENTS_URL&&(i||ut.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(J)))}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||(this.anonId||this.fetchEventData(),oo(this.anonId)||(this.anonId=Wn()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:An,skuId:Zn,skuToken:this.skuToken,userId:this.anonId},r=>{r?this.errorCb(r):e&&(this.success[e]=!0)},t))}},ri=Wt.postMapLoadEvent.bind(Wt),Si=new class extends at{constructor(){super("gljs.performance")}postPerformanceEvent(t,e){ut.EVENTS_URL&&(t||ut.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:e},t)}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:e,performanceData:i}=this.queue.shift(),r=function(a){const c=Ie.performance.getEntriesByType("resource"),u=Ie.performance.getEntriesByType("mark"),p=function(M){const T={};
1if(M)for(const S in M)if("other"!==S)for(const k of M[S]){const R=`${S}ResolveRangeMin`,j=`${S}ResolveRangeMax`,K=`${S}RequestCount`,G=`${S}RequestCachedCount`;T[R]=Math.min(T[R]||1/0,k.startTime),T[j]=Math.max(T[j]||-1/0,k.responseEnd);const H=ee=>{void 0===T[ee]&&(T[ee]=0),++T[ee]};void 0!==k.transferSize&&0===k.transferSize&&H(G),H(K)}return T}(function(M,T){const S={};if(M)for(const k of M){const R=T(k);void 0===S[R]&&(S[R]=[]),S[R].push(k)}return S}(c,wl)),f=Ie.devicePixelRatio,_=Ie.navigator.connection||Ie.navigator.mozConnection||Ie.navigator.webkitConnection,x={counters:[],metadata:[],attributes:[]},w=(M,T,S)=>{null!=S&&M.push({name:T,value:S.toString()})};for(const M in p)w(x.counters,M,p[M]);if(a.interactionRange[0]!==1/0&&a.interactionRange[1]!==-1/0&&(w(x.counters,"interactionRangeMin",a.interactionRange[0]),w(x.counters,"interactionRangeMax",a.interactionRange[1])),u)for(const M of Object.keys(ho)){const T=ho[M],S=u.find(k=>k.name===T);S&&w(x.counters,T,S.startTime)}return w(x.counters,"visibilityHidden",a.visibilityHidden),w(x.attributes,"style",function(M){if(M)for(const T of M){const S=T.name.split("?")[0];if(re(S)){const k=S.split("/").slice(-2);if(2===k.length)return`mapbox://styles/${k[0]}/${k[1]}`}}}(c)),w(x.attributes,"terrainEnabled",a.terrainEnabled?"true":"false"),w(x.attributes,"fogEnabled",a.fogEnabled?"true":"false"),w(x.attributes,"projection",a.projection),w(x.attributes,"zoom",a.zoom),w(x.metadata,"devicePixelRatio",f),w(x.metadata,"connectionEffectiveType",_?_.effectiveType:void 0),w(x.metadata,"navigatorUserAgent",Ie.navigator.userAgent),w(x.metadata,"screenWidth",Ie.screen.width),w(x.metadata,"screenHeight",Ie.screen.height),w(x.metadata,"windowWidth",Ie.innerWidth),w(x.metadata,"windowHeight",Ie.innerHeight),w(x.metadata,"mapWidth",a.width/f),w(x.metadata,"mapHeight",a.height/f),w(x.metadata,"webglRenderer",a.renderer),w(x.metadata,"webglVendor",a.vendor),w(x.metadata,"sdkVersion",An),w(x.metadata,"sdkIdentifier","mapbox-gl-js"),x}(i);for(const a of r.metadata);for(const a of r.counters);for(const a of r.attributes);this.postEvent(e,r,()=>{},t)}},ci=Si.postPerformanceEvent.bind(Si),_n=new class extends at{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(t,e,i,r){if(!ut.API_URL||!ut.SESSION_PATH)return;const a=Ne(ut.API_URL+ut.SESSION_PATH);a.params.push(`sku=${e||""}`),a.params.push(`access_token=${r||ut.ACCESS_TOKEN||""}`);const c={url:Le(a),headers:{"Content-Type":"text/plain"}};var p;this.pendingRequest=(p=u=>{this.pendingRequest=null,i(u),this.saveEventData(),this.processRequests(r)},tn(ni(c,{method:"GET"}),p))}getSessionAPI(t,e,i,r){this.skuToken=e,this.errorCb=r,ut.SESSION_PATH&&ut.API_URL&&(i||ut.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(J)))}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||this.getSession(i,this.skuToken,r=>{r?this.errorCb(r):e&&(this.success[e]=!0)},t)}},wi=_n.getSessionAPI.bind(_n),Li=new Set,ho={create:"create",load:"load",fullLoad:"fullLoad"},bl={mark(t){Ie.performance.mark(t)},measure(t,e,i){Ie.performance.measure(t,e,i)}};function wl(t){const e=t.name.split("?")[0];return le(e)&&e.includes("mapbox-gl.js")?"javascript":le(e)&&e.includes("mapbox-gl.css")?"css":ut.API_FONTS_REGEX.test(e)?"fontRange":ge(e)?"sprite":re(e)?"style":ut.API_TILEJSON_REGEX.test(e)?"tilejson":"other"}const At=Ie.performance;function Go(t){const e=t?t.url.toString():void 0;return At.getEntriesByName(e)}let Zo,cs,$o,yn;const Hn={now:()=>void 0!==$o?$o:Ie.performance.now(),setNow(t){$o=t},restoreNow(){$o=void 0},frame(t){const e=Ie.requestAnimationFrame(t);return{cancel:()=>Ie.cancelAnimationFrame(e)}},getImageData(t,e=0){const{width:i,height:r}=t;yn||(yn=Ie.document.createElement("canvas"));const a=yn.getContext("2d",{willReadFrequently:!0});if(!a)throw new Error("failed to create canvas 2d context");return(i>yn.width||r>yn.height)&&(yn.width=i,yn.height=r),a.clearRect(-e,-e,i+2*e,r+2*e),a.drawImage(t,0,0,i,r),a.getImageData(-e,-e,i+2*e,r+2*e)},resolveURL:t=>(Zo||(Zo=Ie.document.createElement("a")),Zo.href=t,Zo.href),get devicePixelRatio(){return Ie.devicePixelRatio},get prefersReducedMotion(){return!!Ie.matchMedia&&(null==cs&&(cs=Ie.matchMedia("(prefers-reduced-motion: reduce)")),cs.matches)}};function hs(t,e,i){i[t]&&-1!==i[t].indexOf(e)||(i[t]=i[t]||[],i[t].push(e))}function us(t,e,i){if(i&&i[t]){const r=i[t].indexOf(e);-1!==r&&i[t].splice(r,1)}}class jr{constructor(e,i={}){ni(this,i),this.type=e}}class Kn extends jr{constructor(e,i={}){super("error",ni({error:e},i))}}class qo{on(e,i){return this._listeners=this._listeners||{},hs(e,i,this._listeners),this}off(e,i){return us(e,i,this._listeners),us(e,i,this._oneTimeListeners),this}
vendor: 6,374 bytes, line 1
1once(e,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},hs(e,i,this._oneTimeListeners),this):new Promise(r=>this.once(e,r))}fire(e,i){"string"==typeof e&&(e=new jr(e,i||{}));const r=e.type;if(this.listens(r)){e.target=this;const a=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const p of a)p.call(this,e);const c=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const p of c)us(r,p,this._oneTimeListeners),p.call(this,e);const u=this._eventedParent;u&&(ni(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),u.fire(e))}else e instanceof Kn&&console.error(e.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}var be=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360,"units":"degrees"},"pitch":{"type":"number","default":0,"units":"degrees"},"light":{"type":"light"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":{},"mapbox":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"minzoom":{"type":"number","minimum":0,"maximum":24},"maxzoom":{"type":"number","minimum":0,"maximum":24},"filter":{"type":"filter"},"layout":{"type":"layout"},"paint":{"type":"paint"}},"layout":["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1
vendor: 16,128 bytes, line 1
1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":{},"line":{},"line-center":{}},"default":"point","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"units":"factor of the original icon size","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":{},"width":{},"height":{},"both":{}},"default":"none","requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"units":"pixels","requires":["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","units":"ems","default":0,"requires":["text-field"],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["text-field",{"!":"text-variable-anchor"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"units":"degrees","requires":["text-field",{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","units":"ems","length":2,"default":[0,0],"requires":["text-field",{"!":"text-radial-offset"}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"geometry_type":{"type":"enum","values":{"Point":{},"LineString":{},"Polygon":{}}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":{},"exponential":{},"interval":{},"categorical":{}},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":{},"lab":{},"hcl":{}},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":
vendor: 3,928 bytes, line 1
1false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}
1,"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"transition":{"duration":{"type":"number","default":300,"minimum":0,"units":"milliseconds"},"delay":{"type":"number","default":0,"minimum":0,"units":"milliseconds"}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function Pn(t,...e){for(const i of e)for(const r in i)t[r]=i[r];return t}function oi(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Mi(t){if(Array.isArray(t))return t.map(Mi);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=Mi(t[i]);return e}return oi(t)}
vendor: 11,501 bytes, line 1
1class Ml extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}var Ln=Ml;class ds{constructor(e,i=[]){this.parent=e,this.bindings={};for(const[r,a]of i)this.bindings[r]=a}concat(e){return new ds(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}var El=ds;const uo={kind:"null"},je={kind:"number"},xt={kind:"string"},gt={kind:"boolean"},Wi={kind:"color"},vn={kind:"object"},_t={kind:"value"},Xi={kind:"collator"},po={kind:"formatted"},Gr={kind:"resolvedImage"};function nn(t,e){return{kind:"array",itemType:t,N:e}}function Xt(t){if("array"===t.kind){const e=Xt(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const Cl=[uo,je,xt,gt,Wi,po,vn,nn(_t),Gr];function Jn(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Jn(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const i of Cl)if(!Jn(i,e))return null}return`Expected ${Xt(t)} but found ${Xt(e)} instead.`}function Wo(t,e){return e.some(i=>i.kind===t.kind)}function Xo(t,e){return e.some(i=>"null"===i?null===t:"array"===i?Array.isArray(t):"object"===i?t&&!Array.isArray(t)&&"object"==typeof t:i===typeof t)}var ps,ms={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 Yo(t){return(t=Math.round(t))<0?0:t>255?255:t}function Ho(t){return Yo("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function Ta(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function mo(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{ps={}.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in ms)return ms[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var r=i.indexOf("("),a=i.indexOf(")");if(-1!==r&&a+1===i.length){var c=i.substr(0,r),u=i.substr(r+1,a-(r+1)).split(","),p=1;switch(c){case"rgba":if(4!==u.length)return null;p=Ta(u.pop());case"rgb":return 3!==u.length?null:[Ho(u[0]),Ho(u[1]),Ho(u[2]),p];case"hsla":if(4!==u.length)return null;p=Ta(u.pop());case"hsl":if(3!==u.length)return null;var f=(parseFloat(u[0])%360+360)%360/360,_=Ta(u[1]),x=Ta(u[2]),w=x<=.5?x*(_+1):x+_-x*_,M=2*x-w;return[Yo(255*mo(M,w,f+1/3)),Yo(255*mo(M,w,f)),Yo(255*mo(M,w,f-1/3)),p];default:return null}}return null}}catch(t){}class Yi{constructor(e,i,r,a=1){this.r=e,this.g=i,this.b=r,this.a=a}static parse(e){if(!e)return;if(e instanceof Yi)return e;if("string"!=typeof e)return;const i=ps(e);return i?new Yi(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toString(){const[e,i,r,a]=this.toArray();return`rgba(${Math.round(e)},${Math.round(i)},${Math.round(r)},${a})`}toArray(){const{r:e,g:i,b:r,a}=this;return 0===a?[0,0,0,0]:[255*e/a,255*i/a,255*r/a,a]}toArray01(){const{r:e,g:i,b:r,a}=this;return 0===a?[0,0,0,0]:[e/a,i/a,r/a,a]}toArray01PremultipliedAlpha(){const{r:e,g:i,b:r,a}=this;return[e,i,r,a]}}Yi.black=new Yi(0,0,0,1),Yi.white=new Yi(1,1,1,1),Yi.transparent=new Yi(0,0,0,0),Yi.red=new Yi(1,0,0,1),Yi.blue=new Yi(0,0,1,1);var ai=Yi;class fs{constructor(e,i,r){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class gs{constructor(e,i,r,a,c){this.text=e.normalize?e.normalize():e,this.image=i,this.scale=r,this.fontStack=a,this.textColor=c}}class Hi{constructor(e){this.sections=e}static fromString(e){return new Hi([new gs(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||e.image&&0!==e.image.name.length)}static factory(e){return e instanceof Hi?e:Hi.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const i of this.sections){if(i.image){e.push(["image",i.image.name]);continue}e.push(i.text);const r={};i.fontStack&&(r["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(r["font-scale"]=i.scale),i.textColor&&(r["text-color"]=["rgba"].concat(i.textColor.toArray())),e.push(r)}return e}}class pn{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new pn({name:e,available:!1}):null}serialize(){return["image",this.name]}}function Sa(t,e,i,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid rgba value [${[t,e,i,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof r?[t,e,i,r]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ko(t){if(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t||t instanceof ai||t instanceof fs||t instanceof Hi||t instanceof pn)return!0;if(Array.isArray(t)){for(const e of t)if(!Ko(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!Ko(t[e]))return!1;return!0}return!1}function ti(t){if(null===t)return uo;if("string"==typeof t)return xt;if("boolean"==typeof t)return gt;if("number"==typeof t)return je;if(t instanceof ai)return Wi;if(t instanceof fs)return Xi;if(t instanceof Hi)return po;if(t instanceof pn)return Gr;if(Array.isArray(t)){const e=t.length;let i;for(const r of t){const a=ti(r);if(i){if(i===a)continue;i=_t;break}i=a}return nn(i||_t,e)}return vn}function Jo(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof ai||t instanceof Hi||t instanceof pn?t.toString():JSON.stringify(t)}class Zr{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(2!==e.length)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Ko(e[1]))return i.error("invalid value");const r=e[1];let a=ti(r);const c=i.expectedType;return"array"!==a.kind||0!==a.N||!c||"array"!==c.kind||"number"==typeof c.N&&0!==c.N||(a=c),new Zr(a,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof ai?["rgba"].concat(this.value.toArray()):this.value instanceof Hi?this.value.serialize():this.value}}var $r=Zr,Ai=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const _s={string:xt,number:je,boolean:gt,object:vn};class ys{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let r,a=1;const c=e[0];if("array"===c){let p,f;if(e.length>2){const _=e[1];if("string"!=typeof _||!(_ in _s)||"object"===_)return i.error('The item type argument of "array" must be one of string, number, boolean',1);p=_s[_],a++}else p=_t;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);f=e[2],a++}r=nn(p,f)}else r=_s[c];const u=[];for(;a<e.length;a++){const p=i.parse(e[a],a,_t);if(!p)return null;u.push(p)}return new ys(r,u)}evaluate(e){for(let i=0;i<this.args.length;i++){const r=this.args[i].evaluate(e);if(!Jn(this.type,ti(r)))return r;if(i===this.args.length-1)throw new Ai(`Expected value to be of type ${Xt(this.t
1ype)}, but found ${Xt(ti(r))} instead.`)}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=this.type,i=[e.kind];if("array"===e.kind){const r=e.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){i.push(r.kind);const a=e.N;("number"==typeof a||this.args.length>1)&&i.push(a)}}return i.concat(this.args.map(r=>r.serialize()))}}var xn=ys;class Qn{constructor(e){this.type=po,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return i.error("First argument must be an image or text section.");const a=[];let c=!1;for(let u=1;u<=e.length-1;++u){const p=e[u];if(c&&"object"==typeof p&&!Array.isArray(p)){c=!1;let f=null;if(p["font-scale"]&&(f=i.parse(p["font-scale"],1,je),!f))return null;let _=null;if(p["text-font"]&&(_=i.parse(p["text-font"],1,nn(xt)),!_))return null;let x=null;if(p["text-color"]&&(x=i.parse(p["text-color"],1,Wi),!x))return null;const w=a[a.length-1];w.scale=f,w.font=_,w.textColor=x}else{const f=i.parse(e[u],1,_t);if(!f)return null;const _=f.type.kind;if("string"!==_&&"value"!==_&&"null"!==_&&"resolvedImage"!==_)return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");c=!0,a.push({content:f,scale:null,font:null,textColor:null})}}return new Qn(a)}evaluate(e){return new Hi(this.sections.map(i=>{const r=i.content.evaluate(e);return ti(r)===Gr?new gs("",r,null,null,null):new gs(Jo(r),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null)}))}eachChild(e){for(const i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const i of this.sections){e.push(i.content.serialize());const r={};i.scale&&(r["font-scale"]=i.scale.serialize()),i.font&&(r["text-font"]=i.font.serialize()),i.textColor&&(r["text-color"]=i.textColor.serialize()),e.push(r)}return e}}class Aa{constructor(e){this.type=Gr,this.input=e}static parse(e,i){if(2!==e.length)return i.error("Expected two arguments.");const r=i.parse(e[1],1,xt);return r?new Aa(r):i.error("No image name provided.")}evaluate(e){const i=this.input.evaluate(e),r=pn.fromString(i);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(i)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const zc={"to-boolean":gt,"to-color":Wi,"to-number":je,"to-string":xt};class vs{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const r=e[0];if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return i.error("Expected one argument.");const a=zc[r],c=[];for(let u=1;u<e.length;u++){const p=i.parse(e[u],u,_t);if(!p)return null;c.push(p)}return new vs(a,c)}evaluate(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){let i,r;for(const a of this.args){if(i=a.evaluate(e),r=null,i instanceof ai)return i;if("string"==typeof i){const c=e.parseColor(i);if(c)return c}else if(Array.isArray(i)&&(r=i.length<3||i.length>4?`Invalid rbga value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:Sa(i[0],i[1],i[2],i[3]),!r))return new ai(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new Ai(r||`Could not parse color from value '${"string"==typeof i?i:String(JSON.stringify(i))}'`)}if("number"===this.type.kind){let i=null;for(const r of this.args){if(i=r.evaluate(e),null===i)return 0;const a=Number(i);if(!isNaN(a))return a}throw new Ai(`Could not convert ${JSON.stringify(i)} to number.`)}return"formatted"===this.type.kind?Hi.fromString(Jo(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?pn.fromString(Jo(this.args[0].evaluate(e))):Jo(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if("formatted"===this.type.kind)return new Qn([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Aa(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild(i=>{e.push(i.serialize())}),e}}var fo=vs;const Rn=["Unknown","Point","LineString","Polygon"];var xs=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Rn[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:r}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*e-t[0])+this.featureDistanceData.bearing[1]*(r*e-t[1])}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=ai.parse(t)),e}};class qr{constructor(e,i,r,a){this.name=e,this.type=i,this._evaluate=r,this.args=a}evaluate(e){return this._evaluate(e,this.args)}
vendor: 10,816 bytes, line 1
1eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,i){const r=e[0],a=qr.definitions[r];if(!a)return i.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const c=Array.isArray(a)?a[0]:a.type,u=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,p=u.filter(([_])=>!Array.isArray(_)||_.length===e.length-1);let f=null;for(const[_,x]of p){f=new ka(i.registry,i.path,null,i.scope);const w=[];let M=!1;for(let T=1;T<e.length;T++){const S=e[T],k=Array.isArray(_)?_[T-1]:_.type,R=f.parse(S,1+w.length,k);if(!R){M=!0;break}w.push(R)}if(!M)if(Array.isArray(_)&&_.length!==w.length)f.error(`Expected ${_.length} arguments, but found ${w.length} instead.`);else{for(let T=0;T<w.length;T++){const S=Array.isArray(_)?_[T]:_.type,k=w[T];f.concat(T+1).checkSubtype(S,k.type)}if(0===f.errors.length)return new qr(r,c,x,w)}}if(1===p.length)i.errors.push(...f.errors);else{const _=(p.length?p:u).map(([w])=>{return M=w,Array.isArray(M)?`(${M.map(Xt).join(", ")})`:`(${Xt(M.type)}...)`;var M}).join(" | "),x=[];for(let w=1;w<e.length;w++){const M=i.parse(e[w],1+x.length);if(!M)return null;x.push(Xt(M.type))}i.error(`Expected arguments of type ${_}, but found (${x.join(", ")}) instead.`)}return null}static register(e,i){qr.definitions=i;for(const r in i)e[r]=qr}}var er=qr;class go{constructor(e,i,r){this.type=Xi,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=i}static parse(e,i){if(2!==e.length)return i.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return i.error("Collator options argument must be an object.");const a=i.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,gt);if(!a)return null;const c=i.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,gt);if(!c)return null;let u=null;return r.locale&&(u=i.parse(r.locale,1,xt),!u)?null:new go(a,c,u)}evaluate(e){return new fs(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}const On=8192;function fr(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function gr(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function _o(t,e){const i=(180+t[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,a=Math.pow(2,e.z);return[Math.round(i*a*On),Math.round(r*a*On)]}function Tl(t,e,i){const r=t[0]-e[0],a=t[1]-e[1],c=t[0]-i[0],u=t[1]-i[1];return r*u-c*a==0&&r*c<=0&&a*u<=0}function yo(t,e){let i=!1;for(let u=0,p=e.length;u<p;u++){const f=e[u];for(let _=0,x=f.length;_<x-1;_++){if(Tl(t,f[_],f[_+1]))return!1;(a=f[_])[1]>(r=t)[1]!=(c=f[_+1])[1]>r[1]&&r[0]<(c[0]-a[0])*(r[1]-a[1])/(c[1]-a[1])+a[0]&&(i=!i)}}var r,a,c;return i}function bs(t,e){for(let i=0;i<e.length;i++)if(yo(t,e[i]))return!0;return!1}function ws(t,e,i,r){const a=r[0]-i[0],c=r[1]-i[1],u=(t[0]-i[0])*c-a*(t[1]-i[1]),p=(e[0]-i[0])*c-a*(e[1]-i[1]);return u>0&&p<0||u<0&&p>0}function vo(t,e,i){for(const _ of i)for(let x=0;x<_.length-1;++x)if((p=[(u=_[x+1])[0]-(c=_[x])[0],u[1]-c[1]])[0]*(f=[(a=e)[0]-(r=t)[0],a[1]-r[1]])[1]-p[1]*f[0]!=0&&ws(r,a,c,u)&&ws(c,u,r,a))return!0;var r,a,c,u,p,f;return!1}function It(t,e){for(let i=0;i<t.length;++i)if(!yo(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(vo(t[i],t[i+1],e))return!1;return!0}function Sl(t,e){for(let i=0;i<e.length;i++)if(It(t,e[i]))return!0;return!1}function Ms(t,e,i){const r=[];for(let a=0;a<t.length;a++){const c=[];for(let u=0;u<t[a].length;u++){const p=_o(t[a][u],i);fr(e,p),c.push(p)}r.push(c)}return r}function Ia(t,e,i){const r=[];for(let a=0;a<t.length;a++){const c=Ms(t[a],e,i);r.push(c)}return r}function Es(t,e,i,r){if(t[0]<i[0]||t[0]>i[2]){const a=.5*r;let c=t[0]-i[0]>a?-r:i[0]-t[0]>a?r:0;0===c&&(c=t[0]-i[2]>a?-r:i[2]-t[0]>a?r:0),t[0]+=c}fr(e,t)}function Al(t,e,i,r){const a=Math.pow(2,r.z)*On,c=[r.x*On,r.y*On],u=[];if(!t)return u;for(const p of t)for(const f of p){const _=[f.x+c[0],f.y+c[1]];Es(_,e,i,a),u.push(_)}return u}function Cs(t,e,i,r){const a=Math.pow(2,r.z)*On,c=[r.x*On,r.y*On],u=[];if(!t)return u;for(const f of t){const _=[];for(const x of f){const w=[x.x+c[0],x.y+c[1]];fr(e,w),_.push(w)}u.push(_)}if(e[2]-e[0]<=a/2){(p=e)[0]=p[1]=1/0,p[2]=p[3]=-1/0;for(const f of u)for(const _ of f)Es(_,e,i,a)}var p;return u}class xo{constructor(e,i){this.type=gt,this.geojson=e,this.geometries=i}static parse(e,i){if(2!==e.length)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Ko(e[1])){const r=e[1];if("FeatureCollection"===r.type)for(let a=0;a<r.features.length;++a){const c=r.features[a].geometry.type;if("Polygon"===c||"MultiPolygon"===c)return new xo(r,r.features[a].geometry)}else if("Feature"===r.type){const a=r.geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new xo(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new xo(r,r)}return i.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(i,r){const a=[1/0,1/0,-1/0,-1/0],c=[1/0,1/0,-1/0,-1/0],u=i.canonicalID();if(!u)return!1;if("Polygon"===r.type){const p=Ms(r.coordinates,c,u),f=Al(i.geometry(),a,c,u);if(!gr(a,c))return!1;for(const _ of f)if(!yo(_,p))return!1}if("MultiPolygon"===r.type){const p=Ia(r.coordinates,c,u),f=Al(i.geometry(),a,c,u);if(!gr(a,c))return!1;for(const _ of f)if(!bs(_,p))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(i,r){const a=[1/0,1/0,-1/0,-1/0],c=[1/0,1/0,-1/0,-1/0],u=i.canonicalID();if(!u)return!1;if("Polygon"===r.type){const p=Ms(r.coordinates,c,u),f=Cs(i.geometry(),a,c,u);if(!gr(a,c))return!1;for(const _ of f)if(!It(_,p))return!1}if("MultiPolygon"===r.type){const p=Ia(r.coordinates,c,u),f=Cs(i.geometry(),a,c,u);if(!gr(a,c))return!1;for(const _ of f)if(!Sl(_,p))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var Da=xo;function bo(t){if(t instanceof er&&("get"===t.name&&1===t.args.length||"feature-state"===t.name||"has"===t.name&&1===t.args.length||"properties"===t.name||"geometry-type"===t.name||"id"===t.name||/^filter-/.test(t.name))||t instanceof Da)return!1;let e=!0;return t.eachChild(i=>{e&&!bo(i)&&(e=!1)}),e}function tr(t){if(t instanceof er&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild(i=>{e&&!tr(i)&&(e=!1)}),e}function _r(t,e){if(t instanceof er&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild(r=>{i&&!_r(r,e)&&(i=!1)}),i}class wo{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(2!==e.length||"string"!=typeof e[1])return i.error("'var' expression requires exactly one string literal argument.");const r=e[1];return i.scope.has(r)?new wo(r,i.scope.get(r)):i.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var Ts=wo;class Mo{constructor(e,i=[],r,a=new El,c=[]){this.registry=e,this.path=i,this.key=i.map(u=>`[${u}]`).join(""),this.scope=a,this.errors=c,this.expectedType=r}parse(e,i,r,a,c={}){return i?this.concat(i,r,a)._parse(e,c):this._parse(e,c)}_parse(e,i){function r(a,c,u){return"assert"===u?new xn(c,[a]):"coerce"===u?new fo(c,[a]):a}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const a=e[0];if("string"!=typeof a)return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const c=this.registry[a];if(c){let u=c.parse(e,this);if(!u)return null;if(this.expectedType){const p=this.expectedType,f=u.type;if("string"!==p.kind&&"number"!==p.kind&&"boolean"!==p.kind&&"object"!==p.kind&&"array"!==p.kind||"value"!==f.kind)if("color"!==p.kind&&"formatted"!==p.kind&&"resolvedImage"!==p.kind||"value"!==f.kind&&"string"!==f.kind){if(this.checkSubtype(p,f))return null}else u=r(u,p,i.typeAnnotation||"coerce");else u=r(u,p,i.typeAnnotation||"assert")}if(!(u instanceof $r)&&"resolvedImage"!==u.type.kind&&Ss(u)){const p=new xs;try{u=new $r(u.type,u.evaluate(p))}catch(f){return this.error(f.message),null}}return u}return this.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,i,r){const a="number"==typeof e?this.path.concat(e):this.path,c=r?this.scope.concat(r):this.scope;return new Mo(this.registry,a,i||null,c,this.errors)}error(e,...i){const r=`${this.key}${i.map(a=>`[${a}]`).join("")}`;this.errors.push(new Ln(r,e))}checkSubtype(e,i){const r=Jn(e,i);return r&&this.error(r),r}}var ka=Mo;function Ss(t){if(t instanceof Ts)return Ss(t.boundExpression);if(t instanceof er&&"error"===t.name||t instanceof go||t instanceof Da)return!1;const e=t instanceof fo||t instanceof xn;let i=!0;return t.eachChild(r=>{i=e?i&&Ss(r):i&&r instanceof $r}),!!i&&bo(t)&&_r(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function za(t,e){const i=t.length-1;let r,a,c=0,u=i,p=0;for(;c<=u;)if(p=Math.floor((c+u)/2),r=t[p],a=t[p+1],r<=e){if(p===i||e<a)return p;c=p+1}else{if(!(r>e))throw new Ai("Input is not a number.");u=p-1}return 0}class Qo{constructor(e,i,r){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(const[a,c]of r)this.labels.push(a),this.outputs.push(c)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");const r=i.parse(e[1],1,je);if(!r)return null;const a=[];let c=null;i.expectedType&&"value"!==i.expectedType.kind&&(c=i.expectedType);for(let u=1;u<e.length;u+=2){const p=1===u?-1/0:e[u],f=e[u+1],_=u,x=u+1;if("number"!=typeof p)return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not c
1omputed expressions) for the input values.',_);if(a.length&&a[a.length-1][0]>=p)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',_);const w=i.parse(f,x,c);if(!w)return null;c=c||w.type,a.push([p,w])}return new Qo(c,r,a)}evaluate(e){const i=this.labels,r=this.outputs;if(1===i.length)return r[0].evaluate(e);const a=this.input.evaluate(e);if(a<=i[0])return r[0].evaluate(e);const c=i.length;return a>=i[c-1]?r[c-1].evaluate(e):r[za(i,a)].evaluate(e)}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let i=0;i<this.labels.length;i++)i>0&&e.push(this.labels[i]),e.push(this.outputs[i].serialize());return e}}var As=Qo;function Ct(t,e,i){return t*(1-i)+e*i}var ea=Object.freeze({__proto__:null,array:function(t,e,i){return t.map((r,a)=>Ct(r,e[a],i))},color:function(t,e,i){return new ai(Ct(t.r,e.r,i),Ct(t.g,e.g,i),Ct(t.b,e.b,i),Ct(t.a,e.a,i))},number:Ct});const Dl=4/29,Wr=6/29,Ds=3*Wr*Wr,Lc=Math.PI/180,Rc=180/Math.PI;function ks(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ds+Dl}function zs(t){return t>Wr?t*t*t:Ds*(t-Dl)}
vendor: 1,197 bytes, line 1
1function Ps(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Pa(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function kl(t){const e=Pa(t.r),i=Pa(t.g),r=Pa(t.b),a=ks((.4124564*e+.3575761*i+.1804375*r)/.95047),c=ks((.2126729*e+.7151522*i+.072175*r)/1);return{l:116*c-16,a:500*(a-c),b:200*(c-ks((.0193339*e+.119192*i+.9503041*r)/1.08883)),alpha:t.a}}function zl(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,r=isNaN(t.b)?e:e-t.b/200;return e=1*zs(e),i=.95047*zs(i),r=1.08883*zs(r),new ai(Ps(3.2404542*i-1.5371385*e-.4985314*r),Ps(-.969266*i+1.8760108*e+.041556*r),Ps(.0556434*i-.2040259*e+1.0572252*r),t.alpha)}function Oc(t,e,i){const r=e-t;return t+i*(r>180||r<-180?r-360*Math.round(r/360):r)}const ta={forward:kl,reverse:zl,interpolate:function(t,e,i){return{l:Ct(t.l,e.l,i),a:Ct(t.a,e.a,i),b:Ct(t.b,e.b,i),alpha:Ct(t.alpha,e.alpha,i)}}},Eo={forward:function(t){const{l:e,a:i,b:r}=kl(t),a=Math.atan2(r,i)*Rc;return{h:a<0?a+360:a,c:Math.sqrt(i*i+r*r),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Lc,i=t.c;return zl({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:Oc(t.h,e.h,i),c:Ct(t.c,e.c,i),l:Ct(t.l,e.l,
vendor: 12,811 bytes, line 1
1i),alpha:Ct(t.alpha,e.alpha,i)}}};var Ls=Object.freeze({__proto__:null,hcl:Eo,lab:ta});class ia{constructor(e,i,r,a,c){this.type=e,this.operator=i,this.interpolation=r,this.input=a,this.labels=[],this.outputs=[];for(const[u,p]of c)this.labels.push(u),this.outputs.push(p)}static interpolationFactor(e,i,r,a){let c=0;if("exponential"===e.name)c=Rs(i,e.base,r,a);else if("linear"===e.name)c=Rs(i,1,r,a);else if("cubic-bezier"===e.name){const u=e.controlPoints;c=new hr(u[0],u[1],u[2],u[3]).solve(Rs(i,1,r,a))}return c}static parse(e,i){let[r,a,c,...u]=e;if(!Array.isArray(a)||0===a.length)return i.error("Expected an interpolation type expression.",1);if("linear"===a[0])a={name:"linear"};else if("exponential"===a[0]){const _=a[1];if("number"!=typeof _)return i.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:_}}else{if("cubic-bezier"!==a[0])return i.error(`Unknown interpolation type ${String(a[0])}`,1,0);{const _=a.slice(1);if(4!==_.length||_.some(x=>"number"!=typeof x||x<0||x>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:_}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(c=i.parse(c,2,je),!c)return null;const p=[];let f=null;"interpolate-hcl"===r||"interpolate-lab"===r?f=Wi:i.expectedType&&"value"!==i.expectedType.kind&&(f=i.expectedType);for(let _=0;_<u.length;_+=2){const x=u[_],w=u[_+1],M=_+3,T=_+4;if("number"!=typeof x)return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',M);if(p.length&&p[p.length-1][0]>=x)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',M);const S=i.parse(w,T,f);if(!S)return null;f=f||S.type,p.push([x,S])}return"number"===f.kind||"color"===f.kind||"array"===f.kind&&"number"===f.itemType.kind&&"number"==typeof f.N?new ia(f,r,a,c,p):i.error(`Type ${Xt(f)} is not interpolatable.`)}evaluate(e){const i=this.labels,r=this.outputs;if(1===i.length)return r[0].evaluate(e);const a=this.input.evaluate(e);if(a<=i[0])return r[0].evaluate(e);const c=i.length;if(a>=i[c-1])return r[c-1].evaluate(e);const u=za(i,a),p=ia.interpolationFactor(this.interpolation,a,i[u],i[u+1]),f=r[u].evaluate(e),_=r[u+1].evaluate(e);return"interpolate"===this.operator?ea[this.type.kind.toLowerCase()](f,_,p):"interpolate-hcl"===this.operator?Eo.reverse(Eo.interpolate(Eo.forward(f),Eo.forward(_),p)):ta.reverse(ta.interpolate(ta.forward(f),ta.forward(_),p))}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const i=[this.operator,e,this.input.serialize()];for(let r=0;r<this.labels.length;r++)i.push(this.labels[r],this.outputs[r].serialize());return i}}function Rs(t,e,i,r){const a=r-i,c=t-i;return 0===a?0:1===e?c/a:(Math.pow(e,c)-1)/(Math.pow(e,a)-1)}var Fn=ia;class La{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expectected at least one argument.");let r=null;const a=i.expectedType;a&&"value"!==a.kind&&(r=a);const c=[];for(const p of e.slice(1)){const f=i.parse(p,1+c.length,r,void 0,{typeAnnotation:"omit"});if(!f)return null;r=r||f.type,c.push(f)}const u=a&&c.some(p=>Jn(a,p.type));return new La(u?_t:r,c)}evaluate(e){let i,r=null,a=0;for(const c of this.args){if(a++,r=c.evaluate(e),r&&r instanceof pn&&!r.available&&(i||(i=r),r=null,a===this.args.length))return i;if(null!==r)break}return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var Os=La;class Ra{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let c=1;c<e.length-1;c+=2){const u=e[c];if("string"!=typeof u)return i.error(`Expected string, but found ${typeof u} instead.`,c);if(/[^a-zA-Z0-9_]/.test(u))return i.error("Variable names must contain only alphanumeric characters or '_'.",c);const p=i.parse(e[c+1],c+1);if(!p)return null;r.push([u,p])}const a=i.parse(e[e.length-1],e.length-1,i.expectedType,r);return a?new Ra(r,a):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[i,r]of this.bindings)e.push(i,r.serialize());return e.push(this.result.serialize()),e}}var Fs=Ra;class Oa{constructor(e,i,r){this.type=e,this.index=i,this.input=r}static parse(e,i){if(3!==e.length)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=i.parse(e[1],1,je),a=i.parse(e[2],2,nn(i.expectedType||_t));return r&&a?new Oa(a.type.itemType,r,a):null}evaluate(e){const i=this.index.evaluate(e),r=this.input.evaluate(e);if(i<0)throw new Ai(`Array index out of bounds: ${i} < 0.`);if(i>=r.length)throw new Ai(`Array index out of bounds: ${i} > ${r.length-1}.`);if(i!==Math.floor(i))throw new Ai(`Array index must be an integer, but found ${i} instead.`);return r[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Pl=Oa;class Fa{constructor(e,i){this.type=gt,this.needle=e,this.haystack=i}static parse(e,i){if(3!==e.length)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=i.parse(e[1],1,_t),a=i.parse(e[2],2,_t);return r&&a?Wo(r.type,[gt,xt,je,uo,_t])?new Fa(r,a):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Xt(r.type)} instead`):null}evaluate(e){const i=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(null==r)return!1;if(!Xo(i,["boolean","string","number","null"]))throw new Ai(`Expected first argument to be of type boolean, string, number or null, but found ${Xt(ti(i))} instead.`);if(!Xo(r,["string","array"]))throw new Ai(`Expected second argument to be of type array or string, but found ${Xt(ti(r))} instead.`);return r.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var na=Fa;class O{constructor(e,i,r){this.type=je,this.needle=e,this.haystack=i,this.fromIndex=r}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=i.parse(e[1],1,_t),a=i.parse(e[2],2,_t);if(!r||!a)return null;if(!Wo(r.type,[gt,xt,je,uo,_t]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Xt(r.type)} instead`);if(4===e.length){const c=i.parse(e[3],3,je);return c?new O(r,a,c):null}return new O(r,a)}evaluate(e){const i=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Xo(i,["boolean","string","number","null"]))throw new Ai(`Expected first argument to be of type boolean, string, number or null, but found ${Xt(ti(i))} instead.`);if(!Xo(r,["string","array"]))throw new Ai(`Expected second argument to be of type array or string, but found ${Xt(ti(r))} instead.`);if(this.fromIndex){const a=this.fromIndex.evaluate(e);return r.indexOf(i,a)}return r.indexOf(i)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var Z=O;class g{constructor(e,i,r,a,c,u){this.inputType=e,this.type=i,this.input=r,this.cases=a,this.outputs=c,this.otherwise=u}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let r,a;i.expectedType&&"value"!==i.expectedType.kind&&(a=i.expectedType);const c={},u=[];for(let _=2;_<e.length-1;_+=2){let x=e[_];const w=e[_+1];Array.isArray(x)||(x=[x]);const M=i.concat(_);if(0===x.length)return M.error("Expected at least one branch label.");for(const S of x){if("number"!=typeof S&&"string"!=typeof S)return M.error("Branch labels must be numbers or strings.");if("number"==typeof S&&Math.abs(S)>Number.MAX_SAFE_INTEGER)return M.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof S&&Math.floor(S)!==S)return M.error("Numeric branch labels must be integer values.");if(r){if(M.checkSubtype(r,ti(S)))return null}else r=ti(S);if(void 0!==c[String(S)])return M.error("Branch labels must be unique.");c[String(S)]=u.length}const T=i.parse(w,_,a);if(!T)return null;a=a||T.type,u.push(T)}const p=i.parse(e[1],1,_t);if(!p)return null;const f=i.parse(e[e.length-1],e.length-1,a);return f?"value"!==p.type.kind&&i.concat(1).checkSubtype(r,p.type)?null:new g(r,a,p,c,u,f):null}evaluate(e){const i=this.input.evaluate(e);return(ti(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],i=Object.keys(this.cases).sort(),r=[],a={};for(const u of i){const p=a[this.cases[u]];void 0===p?(a[this.cases[u]]=r.length,r.push([this.cases[u],[u]])):r[p][1].push(u)}const c=u=>"number"===this.inputType.kind?Number(u):u;for(const[u,p]of r)e.push(1===p.length?c(p[0]):p.map(c)),e.push(this.outputs[u].serialize());return e.push(this.otherwise.serialize()),e}}var A=g;class q{constructor(e,i,r){this.type=e,this.branches=i,this.otherwise=r}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let r;i.expectedType&&"value"!==i.expectedType.kind&&(r=i.expectedType);const a=[];for(let u=1;u<e.length-1;u+=2){const p=i.parse(e[u],u,gt);if(!p)return null;const f=i.parse(e[u+1],u+1,r);if(!f)return null;a.push([p,f]),r=r||f.type}const c=i.parse(e[e.length-1],e.length-1,r);return c?new q(r,a,c):null}evaluate(e){for(const[i,r]of this.branches)if(i.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[i,r]of this.branches)e(i),e(r);e(this.otherwise)}outputDefined(){return this.branches.every(([e,i])=>i.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var de=q;class He{constructor(e,i,r,a){this.type=e,this.input=i,this.beginIndex=r,this.endIndex=a}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=i.parse(e[1],1,_t),a=i.parse(e[2],2,je);if(!r||!a)return null;if(!Wo(r.type,[nn(_t),xt,_t]))return i.error(`Expected first argument to be of type array or string, but found ${Xt(r.type)} instead`);if(4===e.length){const c=i.parse(e[3],3,je);return c?new He(r.type,r,a,c):null}return new He(r.type,r,a)}evaluate(e){const i=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Xo(i,["string","array"]))throw new Ai(`Expected first argument to be of type array or string, but found ${Xt(ti(i))} instead.`);if(this.endIndex){const a=this.endIndex.evaluate(e);return i.slice(r,a)}return i.slice(r)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var nt=He;function hi(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Ii(t,e,i,r){return 0===r.compare(e,i)}function Ni(t,e,i){const r="=="!==t&&"!="!==t;return class Om{constructor(c,u,p){this.type=gt,this.lhs=c,this.rhs=u,this.collator=p,this.hasUntypedArgument="value"===c.type.kind||"value"===u.type.kind}static parse(c,u){if(3!==c.length&&4!==c.length)return u.error("Expected two or three arguments.");const p=c[0];let f=u.parse(c[1],1,_t);
vendor: 8,199 bytes, line 1
1if(!f)return null;if(!hi(p,f.type))return u.concat(1).error(`"${p}" comparisons are not supported for type '${Xt(f.type)}'.`);let _=u.parse(c[2],2,_t);if(!_)return null;if(!hi(p,_.type))return u.concat(2).error(`"${p}" comparisons are not supported for type '${Xt(_.type)}'.`);if(f.type.kind!==_.type.kind&&"value"!==f.type.kind&&"value"!==_.type.kind)return u.error(`Cannot compare types '${Xt(f.type)}' and '${Xt(_.type)}'.`);r&&("value"===f.type.kind&&"value"!==_.type.kind?f=new xn(_.type,[f]):"value"!==f.type.kind&&"value"===_.type.kind&&(_=new xn(f.type,[_])));let x=null;if(4===c.length){if("string"!==f.type.kind&&"string"!==_.type.kind&&"value"!==f.type.kind&&"value"!==_.type.kind)return u.error("Cannot use collator to compare non-string types.");if(x=u.parse(c[3],3,Xi),!x)return null}return new Om(f,_,x)}evaluate(c){const u=this.lhs.evaluate(c),p=this.rhs.evaluate(c);if(r&&this.hasUntypedArgument){const f=ti(u),_=ti(p);if(f.kind!==_.kind||"string"!==f.kind&&"number"!==f.kind)throw new Ai(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${f.kind}, ${_.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){const f=ti(u),_=ti(p);if("string"!==f.kind||"string"!==_.kind)return e(c,u,p)}return this.collator?i(c,u,p,this.collator.evaluate(c)):e(c,u,p)}eachChild(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)}outputDefined(){return!0}serialize(){const c=[t];return this.eachChild(u=>{c.push(u.serialize())}),c}}}const rn=Ni("==",function(t,e,i){return e===i},Ii),ir=Ni("!=",function(t,e,i){return e!==i},function(t,e,i,r){return!Ii(0,e,i,r)}),mn=Ni("<",function(t,e,i){return e<i},function(t,e,i,r){return r.compare(e,i)<0}),nr=Ni(">",function(t,e,i){return e>i},function(t,e,i,r){return r.compare(e,i)>0}),Xr=Ni("<=",function(t,e,i){return e<=i},function(t,e,i,r){return r.compare(e,i)<=0}),yr=Ni(">=",function(t,e,i){return e>=i},function(t,e,i,r){return r.compare(e,i)>=0});class Bn{constructor(e,i,r,a,c,u){this.type=xt,this.number=e,this.locale=i,this.currency=r,this.unit=a,this.minFractionDigits=c,this.maxFractionDigits=u}static parse(e,i){if(3!==e.length)return i.error("Expected two arguments.");const r=i.parse(e[1],1,je);if(!r)return null;const a=e[2];if("object"!=typeof a||Array.isArray(a))return i.error("NumberFormat options argument must be an object.");let c=null;if(a.locale&&(c=i.parse(a.locale,1,xt),!c))return null;let u=null;if(a.currency&&(u=i.parse(a.currency,1,xt),!u))return null;let p=null;if(a.unit&&(p=i.parse(a.unit,1,xt),!p))return null;let f=null;if(a["min-fraction-digits"]&&(f=i.parse(a["min-fraction-digits"],1,je),!f))return null;let _=null;return a["max-fraction-digits"]&&(_=i.parse(a["max-fraction-digits"],1,je),!_)?null:new Bn(r,c,u,p,f,_)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class fn{constructor(e){this.type=je,this.input=e}static parse(e,i){if(2!==e.length)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=i.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?i.error(`Expected argument of type string or array, but found ${Xt(r.type)} instead.`):new fn(r):null}evaluate(e){const i=this.input.evaluate(e);if("string"==typeof i||Array.isArray(i))return i.length;throw new Ai(`Expected value to be of type string or array, but found ${Xt(ti(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(i=>{e.push(i.serialize())}),e}}const vr={"==":rn,"!=":ir,">":nr,"<":mn,">=":yr,"<=":Xr,array:xn,at:Pl,boolean:xn,case:de,coalesce:Os,collator:go,format:Qn,image:Aa,in:na,"index-of":Z,interpolate:Fn,"interpolate-hcl":Fn,"interpolate-lab":Fn,length:fn,let:Fs,literal:$r,match:A,number:xn,"number-format":Bn,object:xn,slice:nt,step:As,string:xn,"to-boolean":fo,"to-color":fo,"to-number":fo,"to-string":fo,var:Ts,within:Da};function Qt(t,[e,i,r,a]){e=e.evaluate(t),i=i.evaluate(t),r=r.evaluate(t);const c=a?a.evaluate(t):1,u=Sa(e,i,r,c);if(u)throw new Ai(u);return new ai(e/255*c,i/255*c,r/255*c,c)}function xr(t,e){return t in e}function Bs(t,e){const i=e[t];return void 0===i?null:i}function bn(t){return{type:t}}er.register(vr,{error:[{kind:"error"},[xt],(t,[e])=>{throw new Ai(e.evaluate(t))}],typeof:[xt,[_t],(t,[e])=>Xt(ti(e.evaluate(t)))],"to-rgba":[nn(je,4),[Wi],(t,[e])=>e.evaluate(t).toArray()],rgb:[Wi,[je,je,je],Qt],rgba:[Wi,[je,je,je,je],Qt],has:{type:gt,overloads:[[[xt],(t,[e])=>xr(e.evaluate(t),t.properties())],[[xt,vn],(t,[e,i])=>xr(e.evaluate(t),i.evaluate(t))]]},get:{type:_t,overloads:[[[xt],(t,[e])=>Bs(e.evaluate(t),t.properties())],[[xt,vn],(t,[e,i])=>Bs(e.evaluate(t),i.evaluate(t))]]},"feature-state":[_t,[xt],(t,[e])=>Bs(e.evaluate(t),t.featureState||{})],properties:[vn,[],t=>t.properties()],"geometry-type":[xt,[],t=>t.geometryType()],id:[_t,[],t=>t.id()],zoom:[je,[],t=>t.globals.zoom],pitch:[je,[],t=>t.globals.pitch||0],"distance-from-center":[je,[],t=>t.distanceFromCenter()],"heatmap-density":[je,[],t=>t.globals.heatmapDensity||0],"line-progress":[je,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[je,[],t=>t.globals.skyRadialProgress||0],accumulated:[_t,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[je,bn(je),(t,e)=>{let i=0;for(const r of e)i+=r.evaluate(t);return i}],"*":[je,bn(je),(t,e)=>{let i=1;for(const r of e)i*=r.evaluate(t);return i}],"-":{type:je,overloads:[[[je,je],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[je],(t,[e])=>-e.evaluate(t)]]},"/":[je,[je,je],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[je,[je,je],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[je,[],()=>Math.LN2],pi:[je,[],()=>Math.PI],e:[je,[],()=>Math.E],"^":[je,[je,je],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[je,[je],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[je,[je],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[je,[je],(t,[e])=>Math.log(e.evaluate(t))],log2:[je,[je],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[je,[je],(t,[e])=>Math.sin(e.evaluate(t))],cos:[je,[je],(t,[e])=>Math.cos(e.evaluate(t))],tan:[je,[je],(t,[e])=>Math.tan(e.evaluate(t))],asin:[je,[je],(t,[e])=>Math.asin(e.evaluate(t))],acos:[je,[je],(t,[e])=>Math.acos(e.evaluate(t))],atan:[je,[je],(t,[e])=>Math.atan(e.evaluate(t))],min:[je,bn(je),(t,e)=>Math.min(...e.map(i=>i.evaluate(t)))],max:[je,bn(je),(t,e)=>Math.max(...e.map(i=>i.evaluate(t)))],abs:[je,[je],(t,[e])=>Math.abs(e.evaluate(t))],round:[je,[je],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[je,[je],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[je,[je],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[gt,[xt,_t],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[gt,[_t],(t,[e])=>t.id()===e.value],"filter-type-==":[gt,[xt],(t,[e])=>t.geometryType()===e.value],"filter-<":[gt,[xt,_t],(t,[e,i])=>{const r=t.properties()[e.value],a=i.value;return typeof r==typeof a&&r<a}],"filter-id-<":[gt,[_t],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i<r}],"filter->":[gt,[xt,_t],(t,[e,i])=>{const r=t.properties()[e.value],a=i.value;return typeof r==typeof a&&r>a}],"filter-id->":[gt,[_t],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i>r}
vendor: 12,918 bytes, line 1
1],"filter-<=":[gt,[xt,_t],(t,[e,i])=>{const r=t.properties()[e.value],a=i.value;return typeof r==typeof a&&r<=a}],"filter-id-<=":[gt,[_t],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i<=r}],"filter->=":[gt,[xt,_t],(t,[e,i])=>{const r=t.properties()[e.value],a=i.value;return typeof r==typeof a&&r>=a}],"filter-id->=":[gt,[_t],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i>=r}],"filter-has":[gt,[_t],(t,[e])=>e.value in t.properties()],"filter-has-id":[gt,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[gt,[nn(xt)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[gt,[nn(_t)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[gt,[xt,nn(_t)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[gt,[xt,nn(_t)],(t,[e,i])=>function(r,a,c,u){for(;c<=u;){const p=c+u>>1;if(a[p]===r)return!0;a[p]>r?u=p-1:c=p+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:gt,overloads:[[[gt,gt],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[bn(gt),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:gt,overloads:[[[gt,gt],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[bn(gt),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[gt,[gt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[gt,[xt],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[xt,[xt],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[xt,[xt],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[xt,bn(_t),(t,e)=>e.map(i=>Jo(i.evaluate(t))).join("")],"resolved-locale":[xt,[Xi],(t,[e])=>e.evaluate(t).resolvedLocale()]});var Ba=vr;function Fc(t){return{result:"success",value:t}}function Co(t){return{result:"error",value:t}}function ra(t){return"data-driven"===t["property-type"]}function Ns(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Vs(t){return!!t.expression&&t.expression.interpolated}function Tt(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Na(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Bc(t){return t}function Us(t,e){const i="color"===e.type,r=t.stops&&"object"==typeof t.stops[0][0],a=r||!(r||void 0!==t.property),c=t.type||(Vs(e)?"exponential":"interval");if(i&&((t=Pn({},t)).stops&&(t.stops=t.stops.map(_=>[_[0],ai.parse(_[1])])),t.default=ai.parse(t.default?t.default:e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!Ls[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let u,p,f;if("exponential"===c)u=br;else if("interval"===c)u=js;else if("categorical"===c){u=Nc,p=Object.create(null);for(const _ of t.stops)p[_[0]]=_[1];f=typeof t.stops[0][0]}else{if("identity"!==c)throw new Error(`Unknown function type "${c}"`);u=Vc}if(r){const _={},x=[];for(let T=0;T<t.stops.length;T++){const S=t.stops[T],k=S[0].zoom;void 0===_[k]&&(_[k]={zoom:k,type:t.type,property:t.property,default:t.default,stops:[]},x.push(k)),_[k].stops.push([S[0].value,S[1]])}const w=[];for(const T of x)w.push([_[T].zoom,Us(_[T],e)]);const M={name:"linear"};return{kind:"composite",interpolationType:M,interpolationFactor:Fn.interpolationFactor.bind(void 0,M),zoomStops:w.map(T=>T[0]),evaluate:({zoom:T},S)=>br({stops:w,base:t.base},e,T).evaluate(T,S)}}if(a){const _="exponential"===c?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:_,interpolationFactor:Fn.interpolationFactor.bind(void 0,_),zoomStops:t.stops.map(x=>x[0]),evaluate:({zoom:x})=>u(t,e,x,p,f)}}return{kind:"source",evaluate(_,x){const w=x&&x.properties?x.properties[t.property]:void 0;return void 0===w?oa(t.default,e.default):u(t,e,w,p,f)}}}function oa(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function Nc(t,e,i,r,a){return oa(typeof i===a?r[i]:void 0,t.default,e.default)}function js(t,e,i){if("number"!==Tt(i))return oa(t.default,e.default);const r=t.stops.length;if(1===r||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];const a=za(t.stops.map(c=>c[0]),i);return t.stops[a][1]}function br(t,e,i){const r=void 0!==t.base?t.base:1;if("number"!==Tt(i))return oa(t.default,e.default);const a=t.stops.length;if(1===a||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[a-1][0])return t.stops[a-1][1];const c=za(t.stops.map(x=>x[0]),i),u=function(x,w,M,T){const S=T-M,k=x-M;return 0===S?0:1===w?k/S:(Math.pow(w,k)-1)/(Math.pow(w,S)-1)}(i,r,t.stops[c][0],t.stops[c+1][0]),p=t.stops[c][1],f=t.stops[c+1][1];let _=ea[e.type]||Bc;if(t.colorSpace&&"rgb"!==t.colorSpace){const x=Ls[t.colorSpace];_=(w,M)=>x.reverse(x.interpolate(x.forward(w),x.forward(M),u))}return"function"==typeof p.evaluate?{evaluate(...x){const w=p.evaluate.apply(void 0,x),M=f.evaluate.apply(void 0,x);if(void 0!==w&&void 0!==M)return _(w,M,u)}}:_(p,f,u)}function Vc(t,e,i){return"color"===e.type?i=ai.parse(i):"formatted"===e.type?i=Hi.fromString(i.toString()):"resolvedImage"===e.type?i=pn.fromString(i.toString()):Tt(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),oa(i,t.default,e.default)}class Gs{constructor(e,i){var r;this.expression=e,this._warningHistory={},this._evaluator=new xs,this._defaultValue=i?"color"===(r=i).type&&(Na(r.default)||Array.isArray(r.default))?new ai(0,0,0,0):"color"===r.type?ai.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=i&&"enum"===i.type?i.values:null}evaluateWithoutErrorHandling(e,i,r,a,c,u,p,f){return this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=r,this._evaluator.canonical=a||null,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=u,this._evaluator.featureTileCoord=p||null,this._evaluator.featureDistanceData=f||null,this.expression.evaluate(this._evaluator)}evaluate(e,i,r,a,c,u,p,f){this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=r||null,this._evaluator.canonical=a||null,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=u||null,this._evaluator.featureTileCoord=p||null,this._evaluator.featureDistanceData=f||null;try{const _=this.expression.evaluate(this._evaluator);if(null==_||"number"==typeof _&&_!=_)return this._defaultValue;if(this._enumValues&&!(_ in this._enumValues))throw new Ai(`Expected value to be one of ${Object.keys(this._enumValues).map(x=>JSON.stringify(x)).join(", ")}, but found ${JSON.stringify(_)} instead.`);return _}catch(_){return this._warningHistory[_.message]||(this._warningHistory[_.message]=!0,"undefined"!=typeof console&&console.warn(_.message)),this._defaultValue}}}function aa(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Ba}function sa(t,e){const i=new ka(Ba,[],e?function(a){const c={color:Wi,string:xt,number:je,enum:xt,boolean:gt,formatted:po,resolvedImage:Gr};return"array"===a.type?nn(c[a.value]||_t,a.length):c[a.type]}(e):void 0),r=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?Fc(new Gs(r,e)):Co(i.errors)}class Ll{constructor(e,i){this.kind=e,this._styleExpression=i,this.isStateDependent="constant"!==e&&!tr(i.expression)}evaluateWithoutErrorHandling(e,i,r,a,c,u){return this._styleExpression.evaluateWithoutErrorHandling(e,i,r,a,c,u)}evaluate(e,i,r,a,c,u){return this._styleExpression.evaluate(e,i,r,a,c,u)}}class Va{constructor(e,i,r,a){this.kind=e,this.zoomStops=r,this._styleExpression=i,this.isStateDependent="camera"!==e&&!tr(i.expression),this.interpolationType=a}evaluateWithoutErrorHandling(e,i,r,a,c,u){return this._styleExpression.evaluateWithoutErrorHandling(e,i,r,a,c,u)}evaluate(e,i,r,a,c,u){return this._styleExpression.evaluate(e,i,r,a,c,u)}interpolationFactor(e,i,r){return this.interpolationType?Fn.interpolationFactor(this.interpolationType,e,i,r):0}}function Ua(t,e){if("error"===(t=sa(t,e)).result)return t;const i=t.value.expression,r=bo(i);if(!r&&!ra(e))return Co([new Ln("","data expressions not supported")]);const a=_r(i,["zoom","pitch","distance-from-center"]);if(!a&&!Ns(e))return Co([new Ln("","zoom expressions not supported")]);const c=$s(i);return c||a?c instanceof Ln?Co([c]):c instanceof Fn&&!Vs(e)?Co([new Ln("",'"interpolate" expressions cannot be used with this property')]):Fc(c?new Va(r?"camera":"composite",t.value,c.labels,c instanceof Fn?c.interpolation:void 0):new Ll(r?"constant":"source",t.value)):Co([new Ln("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Zs{constructor(e,i){this._parameters=e,this._specification=i,Pn(this,Us(this._parameters,this._specification))}static deserialize(e){return new Zs(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function $s(t){let e=null;if(t instanceof Fs)e=$s(t.result);else if(t instanceof Os){for(const i of t.args)if(e=$s(i),e)break}else(t instanceof As||t instanceof Fn)&&t.input instanceof er&&"zoom"===t.input.name&&(e=t);return e instanceof Ln||t.eachChild(i=>{const r=$s(i);r instanceof Ln?e=r:!e&&r?e=new Ln("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new Ln("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}class $e{constructor(e,i,r,a){this.message=(e?`${e}: `:"")+r,a&&(this.identifier=a),null!=i&&i.__line__&&(this.line=i.__line__)}}function Nn(t){const e=t.key,i=t.value,r=t.valueSpec||{},a=t.objectElementValidators||{},c=t.style,u=t.styleSpec;let p=[];const f=Tt(i);if("object"!==f)return[new $e(e,i,`object expected, ${f} found`)];for(const _ in i){const x=_.split(".")[0];let w;a[x]?w=a[x]:r[x]?w=Vi:a["*"]?w=a["*"]:r["*"]&&(w=Vi),w?p=p.concat(w({key:(e&&`${e}.`)+_,value:i[_],valueSpec:r[x]||r["*"],style:c,styleSpec:u,object:i,objectKey:_},i)):p.push(new $e(e,i[_],`unknown property "${_}"`))}for(const _ in r)a[_]||r[_].required&&void 0===r[_].default&&void 0===i[_]&&p.push(new $e(e,i,`missing required property "${_}"`));return p}function Uc(t){const e=t.value,i=t.valueSpec,r=t.style,a=t.styleSpec,c=t.key,u=t.arrayElementValidator||Vi;if("array"!==Tt(e))return[new $e(c,e,`array expected, ${Tt(e)} found`)];if(i.length&&e.length!==i.length)return[new $e(c,e,`array length ${i.length} expected, length ${e.length} found`)];if(i["min-length"]&&e.length<i["min-length"])return[new $e(c,e,`array length at least ${i["min-length"]} expected, length ${e.length} found`)];let p={type:i.value,values:i.values,minimum:i.minimum,maximum:i.maximum,function:void 0};a.$version<7&&(p.function=i.function),"object"===Tt(i.value)&&(p=i.value);let f=[];for(let _=0;_<e.length;_++)f=f.concat(u({array:e,arrayIndex:_,value:e[_],valueSpec:p,style:r,styleSpec:a,key:`${c}[${_}]`}));return f}function ja(t){const e=t.key,i=t.value,r=t.valueSpec;let a=Tt(i);if("number"===a&&i!=i&&(a="NaN"),"number"!==a)return[new $e(e,i,`number expected, ${a} found`)];if("minimum"in r){let c=r.minimum;if("array"===Tt(r.minimum)&&(c=r.minimum[t.arrayIndex]),i<c)return[new $e(e,i,`${i} is less than the minimum value ${c}`)]}if("maximum"in r){let c=r.maximum;if("array"===Tt(r.maximum)&&(c=r.maximum[t.arrayIndex]),i>c)return[new $e(e,i,`${i} is greater than the maximum value ${c}`)]}return[]}function Ga(t){const e=t.valueSpec,i=oi(t.value.type);let r,a,c,u={};const p="categorical"!==i&&void 0===t.value.property,f=!p,_="array"===Tt(t.value.stops)&&"array"===Tt(t.value.stops[0])&&"object"===Tt(t.value.stops[0][0]),x=Nn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(T){if("identity"===i)return[new $e(T.key,T.value,'identity function may not have a "stops" property')];let S=[];const k=T.value;return S=S.concat(Uc({key:T.key,value:k,valueSpec:T.valueSpec,style:T.style,styleSpec:T.styleSpec,arrayElementValidator:w})),"array"===Tt(k)&&0===k.length&&S.push(new $e(T.key,k,"array must have at least one stop")),S},default:function(T){return Vi({key:T.key,value:T.value,valueSpec:e,style:T.style,styleSpec:T.styleSpec})}}});return"identity"===i&&p&&x.push(new $e(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||x.push(new $e(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!Vs(t.valueSpec)&&x.push(new $e(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(f&&!ra(t.valueSpec)?x.push(new $e(t.key,t.value,"property functions not supported")):p&&!Ns(t.valueSpec)&&x.push(new $e(t.key,t.value,"zoom functions not supported"))),"categorical"!==i&&!_||void 0!==t.value.property||x.push(new $e(t.key,t.value,'"property" property is required')),x;function w(T){let S=[];const k=T.value,R=T.key;if("array"!==Tt(k))return[new $e(R,k,`array expected, ${Tt(k)} found`)];if(2!==k.length)return[new $e(R,k,`array length 2 expected, length ${
1k.length} found`)];if(_){if("object"!==Tt(k[0]))return[new $e(R,k,`object expected, ${Tt(k[0])} found`)];if(void 0===k[0].zoom)return[new $e(R,k,"object stop key must have zoom")];if(void 0===k[0].value)return[new $e(R,k,"object stop key must have value")];const j=oi(k[0].zoom);if("number"!=typeof j)return[new $e(R,k[0].zoom,"stop zoom values must be numbers")];if(c&&c>j)return[new $e(R,k[0].zoom,"stop zoom values must appear in ascending order")];j!==c&&(c=j,a=void 0,u={}),S=S.concat(Nn({key:`${R}[0]`,value:k[0],valueSpec:{zoom:{}},style:T.style,styleSpec:T.styleSpec,objectElementValidators:{zoom:ja,value:M}}))}else S=S.concat(M({key:`${R}[0]`,value:k[0],valueSpec:{},style:T.style,styleSpec:T.styleSpec},k));return aa(Mi(k[1]))?S.concat([new $e(`${R}[1]`,k[1],"expressions are not allowed in function stops.")]):S.concat(Vi({key:`${R}[1]`,value:k[1],valueSpec:e,style:T.style,styleSpec:T.styleSpec}))}function M(T,S){const k=Tt(T.value),R=oi(T.value),j=null!==T.value?T.value:S;if(r){if(k!==r)return[new $e(T.key,j,`${k} stop domain type must match previous stop domain type ${r}`)]}else r=k;if("number"!==k&&"string"!==k&&"boolean"!==k&&"number"!=typeof R&&"string"!=typeof R&&"boolean"!=typeof R)return[new $e(T.key,j,"stop domain value must be a number, string, or boolean")];if("number"!==k&&"categorical"!==i){let K=`number expected, ${k} found`;return ra(e)&&void 0===i&&(K+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new $e(T.key,j,K)]}return"categorical"!==i||"number"!==k||"number"==typeof R&&isFinite(R)&&Math.floor(R)===R?"categorical"!==i&&"number"===k&&"number"==typeof R&&"number"==typeof a&&void 0!==a&&R<a?[new $e(T.key,j,"stop domain values must appear in ascending order")]:(a=R,"categorical"===i&&R in u?[new $e(T.key,j,"stop domain values must be unique")]:(u[R]=!0,[])):[new $e(T.key,j,`integer expected, found ${String(R)}`)]}}function Di(t){const e=("property"===t.expressionContext?Ua:sa)(Mi(t.value),t.valueSpec);if("error"===e.result)return e.value.map(r=>new $e(`${t.key}${r.key}`,t.value,r.message));const i=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new $e(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!tr(i))return[new $e(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext)return Za(i,t);if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!_r(i,["zoom","feature-state"]))return[new $e(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!bo(i))return[new $e(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Za(t,e){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(e.valueSpec&&e.valueSpec.expression)for(const a of e.valueSpec.expression.parameters)i.delete(a);if(0===i.size)return[];const r=[];return t instanceof er&&i.has(t.name)?[new $e(e.key,e.value,`["${t.name}"] expression is not supported in a filter for a ${e.object.type} layer with id: ${e.object.id}`)]:(t.eachChild(a=>{r.push(...Za(a,e))}),r)}function qs(t){const e=t.key,i=t.value,r=t.valueSpec,a=[];return Array.isArray(r.values)?-1===r.values.indexOf(oi(i))&&a.push(new $e(e,i,`expected one of [${r.values.join(", ")}], ${JSON.stringify(i)} found`)):-1===Object.keys(r.values).indexOf(oi(i))&&a.push(new $e(e,i,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(i)} found`)),a}function Rl(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!Rl(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function Ws(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Rl(t)||(t=ca(t));const i=t;let r=!0;try{r=function(_){if(!la(_))return _;let x=Mi(_);return Xs(x),x=jc(x),x}(i)}catch(_){console.warn(`Failed to extract static filter. Filter will c
1ontinue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(i,null,2)}\n        `)}const a=be[`filter_${e}`],c=sa(r,a);let u=null;if("error"===c.result)throw new Error(c.value.map(_=>`${_.key}: ${_.message}`).join(", "));u=(_,x,w)=>c.value.evaluate(_,x,{},w);let p=null,f=null;if(r!==i){const _=sa(i,a);if("error"===_.result)throw new Error(_.value.map(x=>`${x.key}: ${x.message}`).join(", "));p=(x,w,M,T,S)=>_.value.evaluate(x,w,{},M,void 0,void 0,T,S),f=!bo(_.value.expression)}return{filter:u,dynamicFilter:p||void 0,needGeometry:Gc(r),needFeature:!!f}}function jc(t){if(!Array.isArray(t))return t;const e=function(i){if(Ol.has(i[0]))for(let r=1;r<i.length;r++)if(la(i[r]))return!0;return i}(t);return!0===e?e:e.map(i=>jc(i))}function Xs(t){let e=!1;const i=[];if("case"===t[0]){for(let r=1;r<t.length-1;r+=2)e=e||la(t[r]),i.push(t[r+1]);i.push(t[t.length-1])}else if("match"===t[0]){e=e||la(t[1]);for(let r=2;r<t.length-1;r+=2)i.push(t[r+1]);i.push(t[t.length-1])}else if("step"===t[0]){e=e||la(t[1]);for(let r=1;r<t.length-1;r+=2)i.push(t[r+1])}e&&(t.length=0,t.push("any",...i));for(let r=1;r<t.length;r++)Xs(t[r])}function la(t){if(!Array.isArray(t))return!1;if("pitch"===(e=t[0])||"distance-from-center"===e)return!0;var e;for(let i=1;i<t.length;i++)if(la(t[i]))return!0;return!1}const Ol=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function Vh(t,e){return t<e?-1:t>e?1:0}function Gc(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e<t.length;e++)if(Gc(t[e]))return!0;return!1}function ca(t){if(!t)return!0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?Fl(t[1],t[2],"=="):"!="===e?Ys(Fl(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?Fl(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(ca))):"all"===e?["all"].concat(t.slice(1).map(ca)):"none"===e?["all"].concat(t.slice(1).map(ca).map(Ys)):"in"===e?Bl(t[1],t.slice(2)):"!in"===e?Ys(Bl(t[1],t.slice(2))):"has"===e?Nl(t[1]):"!has"===e?Ys(Nl(t[1])):"within"!==e||t;var i}function Fl(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function Bl(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(i=>typeof i!=typeof e[0])?["filter-in-large",t,["literal",e.sort(Vh)]]:["filter-in-small",t,["literal",e]]}}function Nl(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ys(t){return["!",t]}function $a(t){return Rl(Mi(t.value))?Di(Pn({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${t.layerType||"fill"}`]})):qa(t)}function qa(t){const e=t.value,i=t.key;if("array"!==Tt(e))return[new $e(i,e,`array expected, ${Tt(e)} found`)];const r=t.styleSpec;let a,c=[];if(e.length<1)return[new $e(i,e,"filter array must have at least 1 element")];switch(c=c.concat(qs({key:`${i}[0]`,value:e[0],valueSpec:r.filter_operator,style:t.style,styleSpec:t.styleSpec})),oi(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===oi(e[1])&&c.push(new $e(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&c.push(new $e(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(a=Tt(e[1]),"string"!==a&&c.push(new $e(`${i}[1]`,e[1],`string expected, ${a} found`)));for(let u=2;u<e.length;u++)a=Tt(e[u]),"$type"===oi(e[1])?c=c.concat(qs({key:`${i}[${u}]`,value:e[u],valueSpec:r.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==a&&"number"!==a&&"boolean"!==a&&c.push(new $e(`${i}[${u}]`,e[u],`string, number, or boolean expected, ${a} found`));break;case"any":case"all":case"none":for(let u=1;u<e.length;u++)c=c.concat(qa({key:`${i}[${u}]`,value:e[u],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":a=Tt(e[1]),2!==e.length?c.push(new $e(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):"string"!==a&&c.push(new $e(`${i}[1]`,e[1],`string expected, ${a} found`));break;case"within":a=Tt(e[1]),2!==e.length?c.push(new $e(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):"object"!==a&&c.push(new $e(`${i}[1]`,e[1],`object expected, ${a} found`))}return c}function Vl(t,e){const i=t.key,r=t.style,a=t.styleSpec,c=t.value,u=t.objectKey,p=a[`${e}_${t.layerType}`];if(!p)return[];const f=u.match(/^(.*)-transition$/);if("paint"===e&&f&&p[f[1]]&&p[f[1]].transition)return Vi({key:i,value:c,valueSpec:a.transition,style:r,styleSpec:a});const _=t.valueSpec||p[u];if(!_)return[new $e(i,c,`unknown property "${u}"`)];let x;if("string"===Tt(c)&&ra(_)&&!_.tokens&&(x=/^{([^}]+)}$/.exec(c))){const M=`\`{ "type": "identity", "property": ${x?JSON.stringify(x[1]):'"_"'} }\``;return[new $e(i,c,`"${u}" does not support interpolation syntax\nUse an identity property function instead: ${M}.`)]}const w=[];return"symbol"===t.layerType&&("text-field"===u&&r&&!r.glyphs&&w.push(new $e(i,c,'use of "text-field" requires a style "glyphs" property')),"text-font"===u&&Na(Mi(c))&&"identity"===oi(c.type)&&w.push(new $e(i,c,'"text-font" does not support identity functions'))),w.concat(Vi({key:t.key,value:c,valueSpec:_,style:r,styleSpec:a,expressionContext:"property",propertyType:e,propertyKey:u}))}function Zc(t){return Vl(t,"paint")}function Ul(t){return Vl(t,"layout")}function $c(t){let e=[];const i=t.value,r=t.key,a=t.style,c=t.styleSpec;i.type||i.ref||e.push(new $e(r,i,'either "type" or "ref" is required'));let u=oi(i.type);const p=oi(i.ref);
vendor: 4,553 bytes, line 1
1if(i.id){const f=oi(i.id);for(let _=0;_<t.arrayIndex;_++){const x=a.layers[_];oi(x.id)===f&&e.push(new $e(r,i.id,`duplicate layer id "${i.id}", previously used at line ${x.id.__line__}`))}}if("ref"in i){let f;["type","source","source-layer","filter","layout"].forEach(_=>{_ in i&&e.push(new $e(r,i[_],`"${_}" is prohibited for ref layers`))}),a.layers.forEach(_=>{oi(_.id)===p&&(f=_)}),f?f.ref?e.push(new $e(r,i.ref,"ref cannot reference another ref layer")):u=oi(f.type):"string"==typeof p&&e.push(new $e(r,i.ref,`ref layer "${p}" not found`))}else if("background"!==u&&"sky"!==u)if(i.source){const f=a.sources&&a.sources[i.source],_=f&&oi(f.type);f?"vector"===_&&"raster"===u?e.push(new $e(r,i.source,`layer "${i.id}" requires a raster source`)):"raster"===_&&"raster"!==u?e.push(new $e(r,i.source,`layer "${i.id}" requires a vector source`)):"vector"!==_||i["source-layer"]?"raster-dem"===_&&"hillshade"!==u?e.push(new $e(r,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==u||!i.paint||!i.paint["line-gradient"]&&!i.paint["line-trim-offset"]||"geojson"===_&&f.lineMetrics||e.push(new $e(r,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new $e(r,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new $e(r,i.source,`source "${i.source}" not found`))}else e.push(new $e(r,i,'missing required property "source"'));return e=e.concat(Nn({key:r,value:i,valueSpec:c.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Vi({key:`${r}.type`,value:i.type,valueSpec:c.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"}),filter:f=>$a(Pn({layerType:u},f)),layout:f=>Nn({layer:i,key:f.key,value:f.value,valueSpec:{},style:f.style,styleSpec:f.styleSpec,objectElementValidators:{"*":_=>Ul(Pn({layerType:u},_))}}),paint:f=>Nn({layer:i,key:f.key,value:f.value,valueSpec:{},style:f.style,styleSpec:f.styleSpec,objectElementValidators:{"*":_=>Zc(Pn({layerType:u},_))}})}})),e}function Yr(t){const e=t.value,i=t.key,r=Tt(e);return"string"!==r?[new $e(i,e,`string expected, ${r} found`)]:[]}const qc={promoteId:function({key:t,value:e}){if("string"===Tt(e))return Yr({key:t,value:e});{const i=[];for(const r in e)i.push(...Yr({key:`${t}.${r}`,value:e[r]}));return i}}};function Wc(t){const e=t.value,i=t.key,r=t.styleSpec,a=t.style;if(!e.type)return[new $e(i,e,'"type" is required')];const c=oi(e.type);let u;switch(c){case"vector":case"raster":case"raster-dem":return u=Nn({key:i,value:e,valueSpec:r[`source_${c.replace("-","_")}`],style:t.style,styleSpec:r,objectElementValidators:qc}),u;case"geojson":if(u=Nn({key:i,value:e,valueSpec:r.source_geojson,style:a,styleSpec:r,objectElementValidators:qc}),e.cluster)for(const p in e.clusterProperties){const[f,_]=e.clusterProperties[p],x="string"==typeof f?[f,["accumulated"],["get",p]]:f;u.push(...Di({key:`${i}.${p}.map`,value:_,expressionContext:"cluster-map"})),u.push(...Di({key:`${i}.${p}.reduce`,value:x,expressionContext:"cluster-reduce"}))}return u;case"video":return Nn({key:i,value:e,valueSpec:r.source_video,style:a,styleSpec:r});case"image":return Nn({key:i,value:e,valueSpec:r.source_image,style:a,styleSpec:r});case"canvas":return[new $e(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return qs({key:`${i}.type`,value:e.type,valueSpec:{values:Uh(r)},style:a,styleSpec:r})}}function Uh(t){return t.source.reduce((e,i)=>{const r=t[i];return"enum"===r.type.type&&(e=e.concat(Object.keys(r.type.values))),e},[])}function Xc(t){const e=t.value,i=t.styleSpec,r=i.light,a=t.style;let c=[];const u=Tt(e);if(void 0===e)return c;if("object"!==u)return c=c.concat([new $e("light",e,`object expected, ${u} found`)]),c;for(const p in e){const f=p.match(/^(.*)-transition$/);c=c.concat(f&&r[f[1]]&&r[f[1]].transition?Vi({key:p,value:e[p],valueSpec:i.transition,style:a,styleSpec:i}):r[p]?Vi({key:p,value:e[p],valueSpec:r[p],style:a,styleSpec:i}):[new $e(p,e[p],`unknown property "${p}"`)])}return c}function jl(t){const e=t.value,i=t.key,r=t.style,a=t.styleSpec,c=a.terrain;let u=[];const p=Tt(e);if(void 0===e)return u;if("object"!==p)return u=u.concat([new $e("terrain",e,`object expected, ${p} found`)]),u;for(const f in e){const _=f.match(/^(.*)-transition$/);u=u.concat(_&&c[_[1]]&&c[_[1]].transition?Vi({key:f,value:e[f],valueSpec:a.transition,style:r,styleSpec:a}):c[f]?Vi({key:f,value:e[f],valueSpec:c[f],style:r,styleSpec:a}):[new $e(f,e[f],`unknown property "${f}
1"`)])}if(e.source){const f=r.sources&&r.sources[e.source],_=f&&oi(f.type);f?"raster-dem"!==_&&u.push(new $e(i,e.source,`terrain cannot be used with a source of type ${String(_)}, it only be used with a "raster-dem" source type`)):u.push(new $e(i,e.source,`source "${e.source}" not found`))}else u.push(new $e(i,e,'terrain is missing required property "source"'));return u}function Yc(t){const e=t.value,i=t.style,r=t.styleSpec,a=r.fog;let c=[];const u=Tt(e);if(void 0===e)return c;if("object"!==u)return c=c.concat([new $e("fog",e,`object expected, ${u} found`)]),c;for(const p in e){const f=p.match(/^(.*)-transition$/);c=c.concat(f&&a[f[1]]&&a[f[1]].transition?Vi({key:p,value:e[p],valueSpec:r.transition,style:i,styleSpec:r}):a[p]?Vi({key:p,value:e[p],valueSpec:a[p],style:i,styleSpec:r}):[new $e(p,e[p],`unknown property "${p}"`)])}return c}const Hc={"*":()=>[],array:Uc,boolean:function(t){const e=t.value,i=t.key,r=Tt(e);return"boolean"!==r?[new $e(i,e,`boolean expected, ${r} found`)]:[]},number:ja,color:function(t){const e=t.key,i=t.value,r=Tt(i);return"string"!==r?[new $e(e,i,`color expected, ${r} found`)]:null===ps(i)?[new $e(e,i,`color expected, "${i}" found`)]:[]},enum:qs,filter:$a,function:Ga,layer:$c,object:Nn,source:Wc,light:Xc,terrain:jl,fog:Yc,string:Yr,formatted:function(t){return 0===Yr(t).length?[]:Di(t)},resolvedImage:function(t){return 0===Yr(t).length?[]:Di(t)},projection:function(t){const e=t.value,i=t.styleSpec,r=i.projection,a=t.style;let c=[];const u=Tt(e);if("object"===u)for(const p in e)c=c.concat(Vi({key:p,value:e[p],valueSpec:r[p],style:a,styleSpec:i}));else"string"!==u&&(c=c.concat([new $e("projection",e,`object or string expected, ${u} found`)]));return c}};function Vi(t){const e=t.value,i=t.valueSpec,r=t.styleSpec;return i.expression&&Na(oi(e))?Ga(t):i.expression&&aa(Mi(e))?Di(t):i.type&&Hc[i.type]?Hc[i.type](t):Nn(Pn({},t,{valueSpec:i.type?r[i.type]:i}))}function jh(t){const e=t.value,i=t.key,r=Yr(t);return r.length||(-1===e.indexOf("{fontstack}")&&r.push(new $e(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&r.push(new $e(i,e,'"glyphs" url must include a "{range}" token'))),r}function Kc(t,e=be){return wn(Vi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:jh,"*":()=>[]}}))}const Gh=t=>wn(Zc(t)),Zh=t=>wn(Ul(t));function wn(t){return t.slice().sort((e,i)=>e.line&&i.line?e.line-i.line:0)}function Jc(t,e){let i=!1;if(e&&e.length)for(const r of e)t.fire(new Kn(new Error(r.message))),i=!0;return i}var $h=rr;function rr(t,e,i){var r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],this.d=(e=a[1])+2*(i=a[2]);for(var c=0;c<this.d*this.d;c++){var u=a[3+c],p=a[3+c+1];r.push(u===p?null:a.subarray(u,p))}var f=a[3+r.length+1];this.keys=a.subarray(a[3+r.length],f),this.bboxes=a.subarray(f),this.insert=this._insertReadonly}else{this.d=e+2*i;for(var _=0;_<this.d*this.d;_++)r.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;var x=i/e*t;this.min=-x,this.max=t+x}rr.prototype.insert=function(t,e,i,r,a){this._forEachCell(e,i,r,a,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(a)},rr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},rr.prototype._insertCell=function(t,e,i,r,a,c){this.cells[a].push(c)},rr.prototype.query=function(t,e,i,r,a){var c=this.min,u=this.max;if(t<=c&&e<=c&&u<=i&&u<=r&&!a)return Array.prototype.slice.call(this.keys);var p=[];return this._forEachCell(t,e,i,r,this._queryCell,p,{},a),p},rr.prototype._queryCell=function(t,e,i,r,a,c,u,p){var f=this.cells[a];if(null!==f)for(var _=this.keys,x=this.bboxes,w=0;w<f.length;w++){var M=f[w];if(void 0===u[M]){var T=4*M;(p?p(x[T+0],x[T+1],x[T+2],x[T+3]):t<=x[T+2]&&e<=x[T+3]&&i>=x[T+0]&&r>=x[T+1])?(u[M]=!0,c.push(_[M])):u[M]=!1}}},rr.prototype._forEachCell=function(t,e,i,r,a,c,u,p){for(var f=this._convertToCellCoord(t),_=this._convertToCellCoord(e),x=this._convertToCellCoord(i),w=this._convertToCellCoord(r),M=f;M<=x;M++)for(var T=_;T<=w;T++){var S=this.d*T+M;if((!p||p(this._convertFromCellCoord(M),this._convertFromCellCoord(T),this._convertFromCellCoord(M+1),this._convertFromCellCoord(T+1)))&&a.call(this,t,e,i,r,S,c,u,p))return}},rr.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},rr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},rr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,i=0,r=0;r<this.cells.length;r++)i+=this.cells[r].length;var a=new Int32Array(e+i+this.keys.length+this.bboxes.length);a[0]=this.extent,a[1]=this.n,a[2]=this.padding;
vendor: 35,281 bytes, line 1
1for(var c=e,u=0;u<t.length;u++){var p=t[u];a[3+u]=c,a.set(p,c),c+=p.length}return a[3+t.length]=c,a.set(this.keys,c),a[3+t.length+1]=c+=this.keys.length,a.set(this.bboxes,c),c+=this.bboxes.length,a.buffer};var To=li($h);const Hs={};function qe(t,e,i={}){Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),Hs[e]={klass:t,omit:i.omit||[]}}qe(Object,"Object"),To.serialize=function(t,e){const i=t.toArrayBuffer();return e&&e.push(i),{buffer:i}},To.deserialize=function(t){return new To(t.buffer)},Object.defineProperty(To,"name",{value:"Grid"}),qe(To,"Grid"),qe(ai,"Color"),qe(Error,"Error"),qe(qt,"AJAXError"),qe(pn,"ResolvedImage"),qe(Zs,"StylePropertyFunction"),qe(Gs,"StyleExpression",{omit:["_evaluator"]}),qe(Va,"ZoomDependentExpression"),qe(Ll,"ZoomConstantExpression"),qe(er,"CompoundExpression",{omit:["_evaluate"]});for(const t in Ba)Hs[Ba[t]._classRegistryKey]||qe(Ba[t],`Expression${t}`);function Gl(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Zl(t){return Ie.ImageBitmap&&t instanceof Ie.ImageBitmap}function ha(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(Gl(t)||Zl(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){const i=t;return e&&e.push(i.buffer),i}if(t instanceof Ie.ImageData)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){const i=[];for(const r of t)i.push(ha(r,e));return i}if("object"==typeof t){const i=t.constructor,r=i._classRegistryKey;if(!r)throw new Error(`can't serialize object of unregistered class ${r}`);const a=i.serialize?i.serialize(t,e):{};if(!i.serialize){for(const c in t)t.hasOwnProperty(c)&&(Hs[r].omit.indexOf(c)>=0||(a[c]=ha(t[c],e)));t instanceof Error&&(a.message=t.message)}if(a.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(a.$name=r),a}throw new Error("can't serialize object of type "+typeof t)}function So(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Gl(t)||Zl(t)||ArrayBuffer.isView(t)||t instanceof Ie.ImageData)return t;if(Array.isArray(t))return t.map(So);if("object"==typeof t){const e=t.$name||"Object",{klass:i}=Hs[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(t);const r=Object.create(i.prototype);for(const a of Object.keys(t))"$name"!==a&&(r[a]=So(t[a]));return r}throw new Error("can't deserialize object of type "+typeof t)}const Ze_Latin_1_Supplement=t=>t>=128&&t<=255,Ze_Arabic=t=>t>=1536&&t<=1791,Ze_Arabic_Supplement=t=>t>=1872&&t<=1919,Ze_Arabic_Extended_A=t=>t>=2208&&t<=2303,Ze_Hangul_Jamo=t=>t>=4352&&t<=4607,Ze_Unified_Canadian_Aboriginal_Syllabics=t=>t>=5120&&t<=5759,Ze_Khmer=t=>t>=6016&&t<=6143,Ze_Unified_Canadian_Aboriginal_Syllabics_Extended=t=>t>=6320&&t<=6399,Ze_General_Punctuation=t=>t>=8192&&t<=8303,Ze_Letterlike_Symbols=t=>t>=8448&&t<=8527,Ze_Number_Forms=t=>t>=8528&&t<=8591,Ze_Miscellaneous_Technical=t=>t>=8960&&t<=9215,Ze_Control_Pictures=t=>t>=9216&&t<=9279,Ze_Optical_Character_Recognition=t=>t>=9280&&t<=9311,Ze_Enclosed_Alphanumerics=t=>t>=9312&&t<=9471,Ze_Geometric_Shapes=t=>t>=9632&&t<=9727,Ze_Miscellaneous_Symbols=t=>t>=9728&&t<=9983,Ze_Miscellaneous_Symbols_and_Arrows=t=>t>=11008&&t<=11263,Ze_CJK_Radicals_Supplement=t=>t>=11904&&t<=12031,Ze_Kangxi_Radicals=t=>t>=12032&&t<=12255,Ze_Ideographic_Description_Characters=t=>t>=12272&&t<=12287,Ze_CJK_Symbols_and_Punctuation=t=>t>=12288&&t<=12351,Ze_Hiragana=t=>t>=12352&&t<=12447,Ze_Katakana=t=>t>=12448&&t<=12543,Ze_Bopomofo=t=>t>=12544&&t<=12591,Ze_Hangul_Compatibility_Jamo=t=>t>=12592&&t<=12687,Ze_Kanbun=t=>t>=12688&&t<=12703,Ze_Bopomofo_Extended=t=>t>=12704&&t<=12735,Ze_CJK_Strokes=t=>t>=12736&&t<=12783,Ze_Katakana_Phonetic_Extensions=t=>t>=12784&&t<=12799,Ze_Enclosed_CJK_Letters_and_Months=t=>t>=12800&&t<=13055,Ze_CJK_Compatibility=t=>t>=13056&&t<=13311,Ze_CJK_Unified_Ideographs_Extension_A=t=>t>=13312&&t<=19903,Ze_Yijing_Hexagram_Symbols=t=>t>=19904&&t<=19967,Ze_CJK_Unified_Ideographs=t=>t>=19968&&t<=40959,Ze_Yi_Syllables=t=>t>=40960&&t<=42127,Ze_Yi_Radicals=t=>t>=42128&&t<=42191,Ze_Hangul_Jamo_Extended_A=t=>t>=43360&&t<=43391,Ze_Hangul_Syllables=t=>t>=44032&&t<=55215,Ze_Hangul_Jamo_Extended_B=t=>t>=55216&&t<=55295,Ze_Private_Use_Area=t=>t>=57344&&t<=63743,Ze_CJK_Compatibility_Ideographs=t=>t>=63744&&t<=64255,Ze_Arabic_Presentation_Forms_A=t=>t>=64336&&t<=65023,Ze_Vertical_Forms=t=>t>=65040&&t<=65055,Ze_CJK_Compatibility_Forms=t=>t>=65072&&t<=65103,Ze_Small_Form_Variants=t=>t>=65104&&t<=65135,Ze_Arabic_Presentation_Forms_B=t=>t>=65136&&t<=65279,Ze_Halfwidth_and_Fullwidth_Forms=t=>t>=65280&&t<=65519;function $l(t){for(const e of t)if(ql(e.charCodeAt(0)))return!0;return!1}function qh(t){for(const e of t)if(!Qc(e.charCodeAt(0)))return!1;return!0}function Qc(t){return!(Ze_Arabic(t)||Ze_Arabic_Supplement(t)||Ze_Arabic_Extended_A(t)||Ze_Arabic_Presentation_Forms_A(t)||Ze_Arabic_Presentation_Forms_B(t))}function ql(t){return!(746!==t&&747!==t&&(t<4352||!(Ze_Bopomofo_Extended(t)||Ze_Bopomofo(t)||Ze_CJK_Compatibility_Forms(t)&&!(t>=65097&&t<=65103)||Ze_CJK_Compatibility_Ideographs(t)||Ze_CJK_Compatibility(t)||Ze_CJK_Radicals_Supplement(t)||Ze_CJK_Strokes(t)||!(!Ze_CJK_Symbols_and_Punctuation(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Ze_CJK_Unified_Ideographs_Extension_A(t)||Ze_CJK_Unified_Ideographs(t)||Ze_Enclosed_CJK_Letters_and_Months(t)||Ze_Hangul_Compatibility_Jamo(t)||Ze_Hangul_Jamo_Extended_A(t)||Ze_Hangul_Jamo_Extended_B(t)||Ze_Hangul_Jamo(t)||Ze_Hangul_Syllables(t)||Ze_Hiragana(t)||Ze_Ideographic_Description_Characters(t)||Ze_Kanbun(t)||Ze_Kangxi_Radicals(t)||Ze_Katakana_Phonetic_Extensions(t)||Ze_Katakana(t)&&12540!==t||!(!Ze_Halfwidth_and_Fullwidth_Forms(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Ze_Small_Form_Variants(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Ze_Unified_Canadian_Aboriginal_Syllabics(t)||Ze_Unified_Canadian_Aboriginal_Syllabics_Extended(t)||Ze_Vertical_Forms(t)||Ze_Yijing_Hexagram_Symbols(t)||Ze_Yi_Syllables(t)||Ze_Yi_Radicals(t))))}function eh(t){return!(ql(t)||(e=t,Ze_Latin_1_Supplement(e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||Ze_General_Punctuation(e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||Ze_Letterlike_Symbols(e)||Ze_Number_Forms(e)||Ze_Miscellaneous_Technical(e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||Ze_Control_Pictures(e)&&9251!==e||Ze_Optical_Character_Recognition(e)||Ze_Enclosed_Alphanumerics(e)||Ze_Geometric_Shapes(e)||Ze_Miscellaneous_Symbols(e)&&!(e>=9754&&e<=9759)||Ze_Miscellaneous_Symbols_and_Arrows(e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Ze_CJK_Symbols_and_Punctuation(e)||Ze_Katakana(e)||Ze_Private_Use_Area(e)||Ze_CJK_Compatibility_Forms(e)||Ze_Small_Form_Variants(e)||Ze_Halfwidth_and_Fullwidth_Forms(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e));var e}function th(t){return t>=1424&&t<=2303||Ze_Arabic_Presentation_Forms_A(t)||Ze_Arabic_Presentation_Forms_B(t)}function Wh(t,e){return!(!e&&th(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Ze_Khmer(t))}function Xh(t){for(const e of t)if(th(e.charCodeAt(0)))return!0;return!1}const Wl="deferred",Xl="loading",Yl="loaded";let ua=null,l="unavailable",n=null;const o=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(l="error"),ua&&ua(t)};function h(){d.fire(new jr("pluginStateChange",{pluginStatus:l,pluginURL:n}))}const d=new qo,m=function(){return l},y=function(){if(l!==Wl||!n)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");l=Xl,h(),n&&Jt({url:n},t=>{t?o(t):(l=Yl,h())})},v={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>l===Yl||null!=v.applyArabicShaping,isLoading:()=>l===Xl,setState(t){l=t.pluginStatus,n=t.pluginURL},isParsed:()=>null!=v.applyArabicShaping&&null!=v.processBidirectionalText&&null!=v.processStyledBidirectionalText,getPluginURL:()=>n};class b{constructor(e,i){this.zoom=e,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.transition=i.transition,this.pitch=i.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(e){return function(i,r){for(const a of i)if(!Wh(a.charCodeAt(0),r))return!1;return!0}(e,v.isLoaded())}}class C{constructor(e,i){this.property=e,this.value=i,this.expression=function(r,a){if(Na(r))return new Zs(r,a);if(aa(r)){const c=Ua(r,a);if("error"===c.result)throw new Error(c.value.map(u=>`${u.key}: ${u.message}`).join(", "));return c.value}{let c=r;return"string"==typeof r&&"color"===a.type&&(c=ai.parse(r)),{kind:"constant",evaluate:()=>c}}}(void 0===i?e.specification.default:i,e.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,i,r){return this.property.possiblyEvaluate(this,e,i,r)}}class E{constructor(e){this.property=e,this.value=new C(e,void 0)}transitioned(e,i){return new L(this.property,this.value,i,ni({},e.transition,this.transition),e.now)}untransitioned(){return new L(this.property,this.value,null,{},0)}}class I{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return Qi(this._values[e].value.value)}setValue(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new E(this._values[e].property)),this._values[e].value=new C(this._values[e].property,null===i?void 0:Qi(i))}getTransition(e){return Qi(this._values[e].transition)}setTransition(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new E(this._values[e].property)),this._values[e].transition=Qi(i)||void 0}serialize(){const e={};for(const i of Object.keys(this._values)){const r=this.getValue(i);void 0!==r&&(e[i]=r);const a=this.getTransition(i);void 0!==a&&(e[`${i}-transition`]=a)}return e}transitioned(e,i){const r=new B(this._properties);for(const a of Object.keys(this._values))r._values[a]=this._values[a].transitioned(e,i._values[a]);return r}untransitioned(){const e=new B(this._properties);for(const i of Object.keys(this._values))e._values[i]=this._values[i].untransitioned();return e}}class L{constructor(e,i,r,a,c){const u=a.delay||0,p=a.duration||0;c=c||0,this.property=e,this.value=i,this.begin=c+u,this.end=this.begin+p,e.specification.transition&&(a.delay||a.duration)&&(this.prior=r)}possiblyEvaluate(e,i,r){const a=e.now||0,c=this.value.possiblyEvaluate(e,i,r),u=this.prior;if(u){if(a>this.end)return this.prior=null,c;if(this.value.isDataDriven())return this.prior=null,c;if(a<this.begin)return u.possiblyEvaluate(e,i,r);{const p=(a-this.begin)/(this.end-this.begin);return this.property.interpolate(u.possiblyEvaluate(e,i,r),c,ur(p))}}return c}}class B{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,i,r){const a=new U(this._properties);for(const c of Object.keys(this._values))a._values[c]=this._values[c].possiblyEvaluate(e,i,r);return a}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class V{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return Qi(this._values[e].value)}setValue(e,i){this._values[e]=new C(this._values[e].property,null===i?void 0:Qi(i))}serialize(){const e={};for(const i of Object.keys(this._values)){const r=this.getValue(i);void 0!==r&&(e[i]=r)}return e}possiblyEvaluate(e,i,r){const a=new U(this._properties);for(const c of Object.keys(this._values))a._values[c]=this._values[c].possiblyEvaluate(e,i,r);return a}}class N{constructor(e,i,r){this.property=e,this.value=i,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,i,r,a){return this.property.evaluate(this.value,this.parameters,e,i,r,a)}}class U{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class D{constructor(e){this.specification=e}possiblyEvaluate(e,i){return e.expression.evaluate(i)}interpolate(e,i,r){const a=ea[this.specification.type];return a?a(e,i,r):e}}class F{constructor(e,i){this.specification=e,this.overrides=i}possiblyEvaluate(e,i,r,a){return new N(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(i,null,{},r,a)}:e.expression,i)}interpolate(e,i,r){if("constant"!==e.value.kind||"constant"!==i.value.kind)return e;if(void 0===e.value.value||void 0===i.value.value)return new N(this,{kind:"constant",value:void 0},e.parameters);const a=ea[this.specification.type];return a?new N(this,{kind:"constant",value:a(e.value.value,i.value.value,r)},e.parameters):e}evaluate(e,i,r,a,c,u){return"constant"===e.kind?e.value:e.evaluate(i,r,a,c,u)}}class ${constructor(e){this.specification=e}possiblyEvaluate(e,i,r,a){return!!e.expression.evaluate(i,null,{},r,a)}interpolate(){return!1}}class W{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const i=new b(0,{});for(const r in e){const a=e[r];a.specification.overridable&&this.overridableProperties.push(r);const c=this.defaultPropertyValues[r]=new C(a,void 0),u=this.defaultTransitionablePropertyValues[r]=new E(a);this.defaultTransitioningPropertyValues[r]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=c.possiblyEvaluate(i)}}}function te(t,e){return 256*(t=rt(Math.floor(t),0,255))+rt(Math.floor(e),0,255)}qe(F,"DataDrivenProperty"),qe(D,"DataConstantProperty"),qe($,"ColorRampProperty");const ne={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ie{constructor(e,i){this._structArray=e,this._pos1=i*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class se{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,i){return e._trim(),i&&(e.isTransferred=!0,i.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const i=Object.create(this.prototype);return i.arrayBuffer=e.arrayBuffer,i.length=e.length,i.capacity=e.arrayBuffer.byteLength/i.bytesPerElement,i._refreshViews(),i}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function ae(t,e=1){let i=0,r=0;return{members:t.map(a=>{const c=ne[a.type].BYTES_PER_ELEMENT,u=i=me(i,Math.max(e,c)),p=a.components||1;return r=Math.max(r,c),i+=c*p,{name:a.name,type:a.type,components:p,offset:u}}),size:me(i,Math.max(r,e)),alignment:e}}function me(t,e){return Math.ceil(t/e)*e}class ke extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i){const r=this.length;return this.resize(r+1),this.emplace(r,e,i)}emplace(e,i,r){const a=2*e;return this.int16[a+0]=i,this.int16[a+1]=r,e}}ke.prototype.bytesPerElement=4,qe(ke,"StructArrayLayout2i4");class he extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,i,r)}emplace(e,i,r,a){const c=3*e;return this.int16[c+0]=i,this.int16[c+1]=r,this.int16[c+2]=a,e}}he.prototype.bytesPerElement=6,qe(he,"StructArrayLayout3i6");class Ee extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,r,a)}emplace(e,i,r,a,c){const u=4*e;return this.int16[u+0]=i,this.int16[u+1]=r,this.int16[u+2]=a,this.int16[u+3]=c,e}}Ee.prototype.bytesPerElement=8,qe(Ee,"StructArrayLayout4i8");class _e extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,u,p){const f=this.length;return this.resize(f+1),this.emplace(f,e,i,r,a,c,u,p)}emplace(e,i,r,a,c,u,p,f){const _=6*e,x=12*e,w=3*e;return this.int16[_+0]=i,this.int16[_+1]=r,this.uint8[x+4]=a,this.uint8[x+5]=c,this.uint8[x+6]=u,this.uint8[x+7]=p,this.float32[w+2]=f,e}}_e.prototype.bytesPerElement=12,qe(_e,"StructArrayLayout2i4ub1f12");class De extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,r,a)}emplace(e,i,r,a,c){const u=4*e;return this.float32[u+0]=i,this.float32[u+1]=r,this.float32[u+2]=a,this.float32[u+3]=c,e}}De.prototype.bytesPerElement=16,qe(De,"StructArrayLayout4f16");class pe extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,r,a,c)}emplace(e,i,r,a,c,u){const p=6*e,f=3*e;return this.uint16[p+0]=i,this.uint16[p+1]=r,this.uint16[p+2]=a,this.uint16[p+3]=c,this.float32[f+2]=u,e}}pe.prototype.bytesPerElement=12,qe(pe,"StructArrayLayout4ui1f12");class Me extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,r,a)}emplace(e,i,r,a,c){const u=4*e;return this.uint16[u+0]=i,this.uint16[u+1]=r,this.uint16[u+2]=a,this.uint16[u+3]=c,e}}Me.prototype.bytesPerElement=8,qe(Me,"StructArrayLayout4ui8");class Pe extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,r,a,c,u)}emplace(e,i,r,a,c,u,p){const f=6*e;return this.int16[f+0]=i,this.int16[f+1]=r,this.int16[f+2]=a,this.int16[f+3]=c,this.int16[f+4]=u,this.int16[f+5]=p,e}}Pe.prototype.bytesPerElement=12,qe(Pe,"StructArrayLayout6i12");class Se extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,u,p,f,_,x,w,M){const T=this.length;return this.resize(T+1),this.emplace(T,e,i,r,a,c,u,p,f,_,x,w,M)}emplace(e,i,r,a,c,u,p,f,_,x,w,M,T){const S=12*e;return this.int16[S+0]=i,this.int16[S+1]=r,this.int16[S+2]=a,this.int16[S+3]=c,this.uint16[S+4]=u,this.uint16[S+5]=p,this.uint16[S+6]=f,this.uint16[S+7]=_,this.int16[S+8]=x,this.int16[S+9]=w,this.int16[S+10]=M,this.int16[S+11]=T,e}}Se.prototype.bytesPerElement=24,qe(Se,"StructArrayLayout4i4ui4i24");class Re extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,r,a,c,u)}emplace(e,i,r,a,c,u,p){const f=10*e,_=5*e;return this.int16[f+0]=i,this.int16[f+1]=r,this.int16[f+2]=a,this.float32[_+2]=c,this.float32[_+3]=u,this.float32[_+4]=p,e}}Re.prototype.bytesPerElement=20,qe(Re,"StructArrayLayout3i3f20");class Ke extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint32[1*e+0]=i,e}}Ke.prototype.bytesPerElement=4,qe(Ke,"StructArrayLayout1ul4");class ot extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,u,p,f,_,x,w,M,T){const S=this.length;return this.resize(S+1),this.emplace(S,e,i,r,a,c,u,p,f,_,x,w,M,T)}emplace(e,i,r,a,c,u,p,f,_,x,w,M,T,S){const k=20*e,R=10*e;return this.int16[k+0]=i,this.int16[k+1]=r,this.int16[k+2]=a,this.int16[k+3]=c,this.int16[k+4]=u,this.float32[R+3]=p,this.float32[R+4]=f,this.float32[R+5]=_,this.float32[R+6]=x,this.int16[k+14]=w,this.uint32[R+8]=M,this.uint16[k+18]=T,this.uint16[k+19]=S,e}}ot.prototype.bytesPerElement=40,qe(ot,"StructArrayLayout5i4f1i1ul2ui40");class We extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,u,p){const f=this.length;return this.resize(f+1),this.emplace(f,e,i,r,a,c,u,p)}emplace(e,i,r,a,c,u,p,f){const _=8*e;return this.int16[_+0]=i,this.int16[_+1]=r,this.int16[_+2]=a,this.int16[_+4]=c,this.int16[_+5]=u,this.int16[_+6]=p,this.int16[_+7]=f,e}}We.prototype.bytesPerElement=16,qe(We,"StructArrayLayout3i2i2i16");class et extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,r,a,c)}emplace(e,i,r,a,c,u){const p=4*e,f=8*e;return this.float32[p+0]=i,this.float32[p+1]=r,this.float32[p+2]=a,this.int16[f+6]=c,this.int16[f+7]=u,e}}et.prototype.bytesPerElement=16,qe(et,"StructArrayLayout2f1f2i16");class bt extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,r,a)}emplace(e,i,r,a,c){const u=12*e,p=3*e;return this.uint8[u+0]=i,this.uint8[u+1]=r,this.float32[p+1]=a,this.float32[p+2]=c,e}}bt.prototype.bytesPerElement=12,qe(bt,"StructArrayLayout2ub2f12");class yt extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,i,r)}emplace(e,i,r,a){const c=3*e;return this.float32[c+0]=i,this.float32[c+1]=r,this.float32[c+2]=a,e}}yt.prototype.bytesPerElement=12,qe(yt,"StructArrayLayout3f12");class Ye extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,i,r)}emplace(e,i,r,a){const c=3*e;return this.uint16[c+0]=i,this.uint16[c+1]=r,this.uint16[c+2]=a,e}}Ye.prototype.bytesPerElement=6,qe(Ye,"StructArrayLayout3ui6");class zt extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,u,p,f,_,x,w,M,T,S,k,R,j,K,G,H,ee){const Q=this.length;return this.resize(Q+1),this.emplace(Q,e,i,r,a,c,u,p,f,_,x,w,M,T,S,k,R,j,K,G,H,ee)}emplace(e,i,r,a,c,u,p,f,_,x,w,M,T,S,k,R,j,K,G,H,ee,Q){const fe=30*e,ue=15*e,we=60*e;return this.int16[fe+0]=i,this.int16[fe+1]=r,this.int16[fe+2]=a,this.float32[ue+2]=c,this.float32[ue+3]=u,this.uint16[fe+8]=p,this.uint16[fe+9]=f,this.uint32[ue+5]=_,this.uint32[ue+6]=x,this.uint32[ue+7]=w,this.uint16[fe+16]=M,this.uint16[fe+17]=T,this.uint16[fe+18]=S,this.float32[ue+10]=k,this.float32[ue+11]=R,this.uint8[we+48]=j,this.uint8[we+49]=K,this.uint8[we+50]=G,this.uint32[ue+13]=H,this.int16[fe+28]=ee,this.uint8[we+58]=Q,e}}zt.prototype.bytesPerElement=60,qe(zt,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Pt extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c,u,p,f,_,x,w,M,T,S,k,R,j,K,G,H,ee,Q,fe,ue,we,ze,ye,Ce,Te,Ae){const Oe=this.length;return this.resize(Oe+1),this.emplace(Oe,e,i,r,a,c,u,p,f,_,x,w,M,T,S,k,R,j,K,G,H,ee,Q,fe,ue,we,ze,ye,Ce,Te,Ae)}emplace(e,i,r,a,c,u,p,f,_,x,w,M,T,S,k,R,j,K,G,H,ee,Q,fe,ue,we,ze,ye,Ce,Te,Ae,Oe){const xe=38*e,Ue=19*e;return this.int16[xe+0]=i,this.int16[xe+1]=r,this.int16[xe+2]=a,this.float32[Ue+2]=c,this.float32[Ue+3]=u,this.int16[xe+8]=p,this.int16[xe+9]=f,this.int16[xe+10]=_,this.int16[xe+11]=x,this.int16[xe+12]=w,this.int16[xe+13]=M,this.uint16[xe+14]=T,this.uint16[xe+15]=S,this.uint16[xe+16]=k,this.uint16[xe+17]=R,this.uint16[xe+18]=j,this.uint16[xe+19]=K,this.uint16[xe+20]=G,this.uint16[xe+21]=H,this.uint16[xe+22]=ee,this.uint16[xe+23]=Q,this.uint16[xe+24]=fe,this.uint16[xe+25]=ue,this.uint16[xe+26]=we,this.uint16[xe+27]=ze,this.uint16[xe+28]=ye,this.uint32[Ue+15]=Ce,this.float32[Ue+16]=Te,this.float32[Ue+17]=Ae,this.float32[Ue+18]=Oe,e}}Pt.prototype.bytesPerElement=76,qe(Pt,"StructArrayLayout3i2f6i15ui1ul3f76");class Lt extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.float32[1*e+0]=i,e}}Lt.prototype.bytesPerElement=4,qe(Lt,"StructArrayLayout1f4");class Rt extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,r,a,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,r,a,c)}emplace(e,i,r,a,c,u){const p=5*e;return this.float32[p+0]=i,this.float32[p+1]=r,this.float32[p+2]=a,this.float32[p+3]=c,this.float32[p+4]=u,e}}Rt.prototype.bytesPerElement=20,qe(Rt,"StructArrayLayout5f20");class Ui extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,r,a)}emplace(e,i,r,a,c){const u=6*e;return this.uint32[3*e+0]=i,this.uint16[u+2]=r,this.uint16[u+3]=a,this.uint16[u+4]=c,e}}Ui.prototype.bytesPerElement=12,qe(Ui,"StructArrayLayout1ul3ui12");class ki extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i){const r=this.length;return this.resize(r+1),this.emplace(r,e,i)}emplace(e,i,r){const a=2*e;return this.uint16[a+0]=i,this.uint16[a+1]=r,e}}ki.prototype.bytesPerElement=4,qe(ki,"StructArrayLayout2ui4");class Mn extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint16[1*e+0]=i,e}}Mn.prototype.bytesPerElement=2,qe(Mn,"StructArrayLayout1ui2");class or extends se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i){const r=this.length;return this.resize(r+1),this.emplace(r,e,i)}emplace(e,i,r){const a=2*e;return this.float32[a+0]=i,this.float32[a+1]=r,e}}or.prototype.bytesPerElement=8,qe(or,"StructArrayLayout2f8");class Kt extends ie{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}Kt.prototype.size=40;class Ot extends ot{get(e){return new Kt(this,e)}}qe(Ot,"CollisionBoxArray");class Dt extends ie{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}Dt.prototype.size=60;class mi extends zt{get(e){return new Dt(this,e)}}qe(mi,"PlacedSymbolArray");class Ki extends ie{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(e){this._structArray.uint32[this._pos4+15]=e}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Ki.prototype.size=76;class Yt extends Pt{get(e){return new Ki(this,e)}}qe(Yt,"SymbolInstanceArray");class on extends Lt{getoffsetX(e){return this.float32[1*e+0]}}qe(on,"GlyphOffsetArray");class Ks extends ke{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}qe(Ks,"SymbolLineVertexArray");class Ao extends ie{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Ao.prototype.size=12;class Wa extends Ui{get(e){return new Ao(this,e)}}qe(Wa,"FeatureIndexArray");class wr extends ki{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}qe(wr,"FillExtrusionCentroidArray");const Hr=ae([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Io=ae([{name:"a_dash",components:4,type:"Uint16"}]);var Js={exports:{}},sd=function(t,e){var i,r,a,c,u,p,f,_;for(r=t.length-(i=3&t.length),a=e,u=3432918353,p=461845907,_=0;_<r;)f=255&t.charCodeAt(_)|(255&t.charCodeAt(++_))<<8|(255&t.charCodeAt(++_))<<16|(255&t.charCodeAt(++_))<<24,++_,a=27492+(65535&(c=5*(65535&(a=(a^=f=(65535&(f=(f=(65535&f)*u+(((f>>>16)*u&65535)<<16)&4294967295)<<15|f>>>17))*p+(((f>>>16)*p&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(c>>>16)&65535)<<16);switch(f=0,i){case 3:f^=(255&t.charCodeAt(_+2))<<16;case 2:f^=(255&t.charCodeAt(_+1))<<8;case 1:a^=f=(65535&(f=(f=(65535&(f^=255&t.charCodeAt(_)))*u+(((f>>>16)*u&65535)<<16)&4294967295)<<15|f>>>17))*p+(((f>>>16)*p&65535)<<16)&4294967295}return a^=t.length,a=2246822507*(65535&(a^=a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295,(a^=a>>>16)>>>0},Fm=function(t,e){for(var i,r=t.length,a=e^r,c=0;r>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24))+((1540483477*(i>>>16)&65535)<<16),a=1540483477*(65535&a)+((1540483477*(a>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),r-=4,++c;switch(r){case 3:a^=(255&t.charCodeAt(c+2))<<16;case 2:a^=(255&t.charCodeAt(c+1))<<8;
1case 1:a=1540483477*(65535&(a^=255&t.charCodeAt(c)))+((1540483477*(a>>>16)&65535)<<16)}return a=1540483477*(65535&(a^=a>>>13))+((1540483477*(a>>>16)&65535)<<16),(a^=a>>>15)>>>0};Js.exports=sd,Js.exports.murmur3=sd,Js.exports.murmur2=Fm;var Yh=li(Js.exports);class ih{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,i,r,a){this.ids.push(ld(e)),this.positions.push(i,r,a)}getPositions(e){const i=ld(e);let r=0,a=this.ids.length-1;for(;r<a;){const u=r+a>>1;this.ids[u]>=i?a=u:r=u+1}const c=[];for(;this.ids[r]===i;)c.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return c}static serialize(e,i){const r=new Float64Array(e.ids),a=new Uint32Array(e.positions);return Hh(r,a,0,r.length-1),i&&i.push(r.buffer,a.buffer),{ids:r,positions:a}}static deserialize(e){const i=new ih;return i.ids=e.ids,i.positions=e.positions,i.indexed=!0,i}}function ld(t){const e=+t;return!isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:Yh(String(t))}function Hh(t,e,i,r){for(;i<r;){const a=t[i+r>>1];let c=i-1,u=r+1;for(;;){do{c++}while(t[c]<a);do{u--}while(t[u]>a);if(c>=u)break;nh(t,c,u),nh(e,3*c,3*u),nh(e,3*c+1,3*u+1),nh(e,3*c+2,3*u+2)}u-i<r-u?(Hh(t,e,i,u),i=u+1):(Hh(t,e,u+1,r),r=u)}}function nh(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}qe(ih,"FeaturePositionMap");class Do{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,i){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,i),this.initialized=!0),!!this.location}}class rh extends Do{constructor(e){super(e),this.current=0}set(e,i,r){this.fetchUniformLocation(e,i)&&this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))}}class cd extends Do{constructor(e){super(e),this.current=[0,0,0,0]}set(e,i,r){this.fetchUniformLocation(e,i)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3])))}}class hd extends Do{constructor(e){super(e),this.current=ai.transparent}set(e,i,r){this.fetchUniformLocation(e,i)&&(r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a)))}}const Bm=new Float32Array(16),Nm=new Float32Array(9),Vm=new Float32Array(4);function Kh(t){return[te(255*t.r,255*t.g),te(255*t.b,255*t.a)]}class Kl{constructor(e,i,r){this.value=e,this.uniformNames=i.map(a=>`u_${a}`),this.type=r}setUniform(e,i,r,a,c){i.set(e,c,a.constantOr(this.value))}getBinding(e,i){return"color"===this.type?new hd(e):new rh(e)}}class Qs{constructor(e,i){this.uniformNames=i.map(r=>`u_${r}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,i,r,a,c){const u="u_pattern"===c||"u_dash"===c?this.pattern:"u_pixel_ratio"===c?this.pixelRatio:null;u&&i.set(e,c,u)}getBinding(e,i){return"u_pattern"===i||"u_dash"===i?new cd(e):new rh(e)}}class ko{constructor(e,i,r,a){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=i.map(c=>({name:`a_${c}`,type:"Float32",components:"color"===r?2:1,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,i,r,a,c,u){const p=this.paintVertexArray.length,f=this.expression.evaluate(new b(0),i,{},c,a,u);this.paintVertexArray.resize(e),this._setPaintValue(p,e,f)}updatePaintArray(e,i,r,a,c){const u=this.expression.evaluate({zoom:0},r,a,void 0,c);this._setPaintValue(e,i,u)}_setPaintValue(e,i,r){if("color"===this.type){const a=Kh(r);for(let c=e;c<i;c++)this.paintVertexArray.emplace(c,a[0],a[1])}else{for(let a=e;a<i;a++)this.paintVertexArray.emplace(a,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Mr{constructor(e,i,r,a,c,u){this.expression=e,this.uniformNames=i.map(p=>`u_${p}_t`),this.type=r,this.useIntegerZoom=a,this.zoom=c,this.maxValue=0,this.paintVertexAttributes=i.map(p=>({name:`a_${p}`,type:"Float32",components:"color"===r?4:2,offset:0})),this.paintVertexArray=new u}populatePaintArray(e,i,r,a,c,u){const p=this.expression.evaluate(new b(this.zoom),i,{},c,a,u),f=this.expression.evaluate(new b(this.zoom+1),i,{},c,a,u),_=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(_,e,p,f)}updatePaintArray(e,i,r,a,c){const u=this.expression.evaluate({zoom:this.zoom},r,a,void 0,c),p=this.expression.evaluate({zoom:this.zoom+1},r,a,void 0,c);this._setPaintValue(e,i,u,p)}_setPaintValue(e,i,r,a){if("color"===this.type){const c=Kh(r),u=Kh(a);for(let p=e;p<i;
1p++)this.paintVertexArray.emplace(p,c[0],c[1],u[0],u[1])}else{for(let c=e;c<i;c++)this.paintVertexArray.emplace(c,r,a);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(a))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,i,r,a,c){const u=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,p=rt(this.expression.interpolationFactor(u,this.zoom,this.zoom+1),0,1);i.set(e,c,p)}getBinding(e,i){return new rh(e)}}class da{constructor(e,i,r,a,c){this.expression=e,this.layerId=c,this.paintVertexAttributes=("array"===r?Io:Hr).members;for(let u=0;u<i.length;++u);this.paintVertexArray=new a}populatePaintArray(e,i,r){const a=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(a,e,i.patterns&&i.patterns[this.layerId],r)}updatePaintArray(e,i,r,a,c,u){this._setPaintValues(e,i,r.patterns&&r.patterns[this.layerId],u)}_setPaintValues(e,i,r,a){if(!a||!r)return;const c=a[r];if(!c)return;const{tl:u,br:p,pixelRatio:f}=c;for(let _=e;_<i;_++)this.paintVertexArray.emplace(_,u[0],u[1],p[0],p[1],f)}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class pa{constructor(e,i,r=(()=>!0)){this.binders={},this._buffers=[];const a=[];for(const c in e.paint._values){if(!r(c))continue;const u=e.paint.get(c);if(!(u instanceof N&&ra(u.property.specification)))continue;const p=jm(c,e.type),f=u.value,_=u.property.specification.type,x=!!u.property.useIntegerZoom,w="line-dasharray"===c||c.endsWith("pattern"),M="line-dasharray"===c&&"constant"!==e.layout.get("line-cap").value.kind;if("constant"!==f.kind||M)if("source"===f.kind||M||w){const T=ud(c,_,"source");this.binders[c]=w?new da(f,p,_,T,e.id):new ko(f,p,_,T),a.push(`/a_${c}`)}else{const T=ud(c,_,"composite");this.binders[c]=new Mr(f,p,_,x,i,T),a.push(`/z_${c}`)}else this.binders[c]=w?new Qs(f.value,p):new Kl(f.value,p,_),a.push(`/u_${c}`)}this.cacheKey=a.sort().join("")}getMaxValue(e){const i=this.binders[e];return i instanceof ko||i instanceof Mr?i.maxValue:0}populatePaintArrays(e,i,r,a,c,u){for(const p in this.binders){const f=this.binders[p];(f instanceof ko||f instanceof Mr||f instanceof da)&&f.populatePaintArray(e,i,r,a,c,u)}}setConstantPatternPositions(e){for(const i in this.binders){const r=this.binders[i];r instanceof Qs&&r.setConstantPatternPositions(e)}}updatePaintArrays(e,i,r,a,c,u){let p=!1;for(const f in e){const _=i.getPositions(f);for(const x of _){const w=r.feature(x.index);for(const M in this.binders){const T=this.binders[M];if((T instanceof ko||T instanceof Mr||T instanceof da)&&!0===T.expression.isStateDependent){const S=a.paint.get(M);T.expression=S.value,T.updatePaintArray(x.start,x.end,w,e[f],c,u),p=!0}}}}return p}defines(){const e=[];for(const i in this.binders){const r=this.binders[i];(r instanceof Kl||r instanceof Qs)&&e.push(...r.uniformNames.map(a=>`#define HAS_UNIFORM_${a}`))}return e}getBinderAttributes(){const e=[];for(const i in this.binders){const r=this.binders[i];if(r instanceof ko||r instanceof Mr||r instanceof da)for(let a=0;a<r.paintVertexAttributes.length;a++)e.push(r.paintVertexAttributes[a].name)}return e}getBinderUniforms(){const e=[];for(const i in this.binders){const r=this.binders[i];if(r instanceof Kl||r instanceof Qs||r instanceof Mr)for(const a of r.uniformNames)e.push(a)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const i=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof Kl||a instanceof Qs||a instanceof Mr)for(const c of a.uniformNames)i.push({name:c,property:r,binding:a.getBinding(e,c)})}return i}setUniforms(e,i,r,a,c){for(const{name:u,property:p,binding:f}of r)this.binders[p].setUniform(e,f,c,a.get(p),u)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const i=this.binders[e];(i instanceof ko||i instanceof Mr||i instanceof da)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}}upload(e){for(const i in this.binders){const r=this.binders[i];(r instanceof ko||r instanceof Mr||r instanceof da)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const i=this.binders[e];(i instanceof ko||i instanceof Mr||i instanceof da)&&i.destroy()}}}class Ya{constructor(e,i,r=(()=>!0)){this.programConfigurations={};for(const a of e)this.programConfigurations[a.id]=new pa(a,i,r);this.needsUpload=!1,this._featureMap=new ih,this._bufferOffset=0}populatePaintArrays(e,i,r,a,c,u,p){for(const f in this.programConfigurations)this.programConfigurations[f].populatePaintArrays(e,i,a,c,u,p);void 0!==i.id&&this._featureMap.add(i.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,i,r,a,c){for(const u of r)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(e,this._featureMap,i,u,a,c)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const Um={"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":["ga
1pwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function jm(t,e){return Um[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}const Gm={"line-pattern":{source:pe,composite:pe},"fill-pattern":{source:pe,composite:pe},"fill-extrusion-pattern":{source:pe,composite:pe},"line-dasharray":{source:Me,composite:Me}},Zm={color:{source:or,composite:De},number:{source:Lt,composite:or}};function ud(t,e,i){const r=Gm[t];return r&&r[i]||Zm[e][i]}qe(Kl,"ConstantBinder"),qe(Qs,"PatternConstantBinder"),qe(ko,"SourceExpressionBinder"),qe(da,"PatternCompositeBinder"),qe(Mr,"CompositeExpressionBinder"),qe(pa,"ProgramConfiguration",{omit:["_buffers"]}),qe(Ya,"ProgramConfigurationSet");const dd="-transition";class Er extends qo{constructor(e,i){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&"sky"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),i.layout&&(this._unevaluatedLayout=new V(i.layout)),i.paint)){this._transitionablePaint=new I(i.paint);for(const r in e.paint)this.setPaintProperty(r,e.paint[r],{validate:!1});for(const r in e.layout)this.setLayoutProperty(r,e.layout[r],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new U(i.paint)}}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,i,r={}){null!=i&&this._validate(Zh,`layers.${this.id}.layout.${e}`,e,i,r)||("visibility"!==e?this._unevaluatedLayout.setValue(e,i):this.visibility=i)}getPaintProperty(e){return Fr(e,dd)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,i,r={}){if(null!=i&&this._validate(Gh,`layers.${this.id}.paint.${e}`,e,i,r))return!1;if(Fr(e,dd))return this._transitionablePaint.setTransition(e.slice(0,-11),i||void 0),!1;{const a=this._transitionablePaint._values[e],c=a.value.isDataDriven(),u=a.value;this._transitionablePaint.setValue(e,i),this._handleSpecialPaintPropertyUpdate(e);const p=this._transitionablePaint._values[e].value,f=p.isDataDriven(),_=Fr(e,"pattern")||"line-dasharray"===e;return f||c||_||this._handleOverridablePaintPropertyUpdate(e,u,p)}}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getProgramConfiguration(e){return null}_handleOverridablePaintPropertyUpdate(e,i,r){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,i){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,i)}
vendor: 8,608 bytes, line 1
1serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),ao(e,(i,r)=>!(void 0===i||"layout"===r&&!Object.keys(i).length||"paint"===r&&!Object.keys(i).length))}_validate(e,i,r,a,c={}){return(!c||!1!==c.validate)&&Jc(this,e.call(Kc,{key:i,layerType:this.type,objectKey:r,value:a,styleSpec:be,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const i=this.paint.get(e);if(i instanceof N&&ra(i.property.specification)&&("source"===i.value.kind||"composite"===i.value.kind)&&i.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=Ws(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const $m=ae([{name:"a_pos",components:2,type:"Int16"}],4),qm=ae([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class fi{constructor(e=[]){this.segments=e}prepareSegment(e,i,r,a){let c=this.segments[this.segments.length-1];return e>fi.MAX_VERTEX_ARRAY_LENGTH&&Ht(`Max vertices per segment is ${fi.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!c||c.vertexLength+e>fi.MAX_VERTEX_ARRAY_LENGTH||c.sortKey!==a)&&(c={vertexOffset:i.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==a&&(c.sortKey=a),this.segments.push(c)),c}get(){return this.segments}destroy(){for(const e of this.segments)for(const i in e.vaos)e.vaos[i].destroy()}static simpleSegment(e,i,r,a){return new fi([{vertexOffset:e,primitiveOffset:i,vertexLength:r,primitiveLength:a,vaos:{},sortKey:0}])}}fi.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,qe(fi,"SegmentVector");var Qe=8192;class ma{constructor(e,i){e&&(i?this.setSouthWest(e).setNorthEast(i):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof Ft?new Ft(e.lng,e.lat):Ft.convert(e),this}setSouthWest(e){return this._sw=e instanceof Ft?new Ft(e.lng,e.lat):Ft.convert(e),this}extend(e){const i=this._sw,r=this._ne;let a,c;if(e instanceof Ft)a=e,c=e;else{if(!(e instanceof ma))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(ma.convert(e)):this.extend(Ft.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(Ft.convert(e)):this;if(a=e._sw,c=e._ne,!a||!c)return this}return i||r?(i.lng=Math.min(a.lng,i.lng),i.lat=Math.min(a.lat,i.lat),r.lng=Math.max(c.lng,r.lng),r.lat=Math.max(c.lat,r.lat)):(this._sw=new Ft(a.lng,a.lat),this._ne=new Ft(c.lng,c.lat)),this}getCenter(){return new Ft((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new Ft(this.getWest(),this.getNorth())}getSouthEast(){return new Ft(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:i,lat:r}=Ft.convert(e);let a=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&a}static convert(e){return!e||e instanceof ma?e:new ma(e)}}var oh=1e-6,En="undefined"!=typeof Float32Array?Float32Array:Array;function pd(){var t=new En(9);return En!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function md(t,e,i){var r=e[0],a=e[1],c=e[2],u=e[3],p=e[4],f=e[5],_=e[6],x=e[7],w=e[8],M=i[0],T=i[1],S=i[2],k=i[3],R=i[4],j=i[5],K=i[6],G=i[7],H=i[8];return t[0]=M*r+T*u+S*_,t[1]=M*a+T*p+S*x,t[2]=M*c+T*f+S*w,t[3]=k*r+R*u+j*_,t[4]=k*a+R*p+j*x,t[5]=k*c+R*f+j*w,t[6]=K*r+G*u+H*_,t[7]=K*a+G*p+H*x,t[8]=K*c+G*f+H*w,t}function Cr(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Jh(t,e){var i=e[0],r=e[1],a=e[2],c=e[3],u=e[4],p=e[5],f=e[6],_=e[7],x=e[8],w=e[9],M=e[10],T=e[11],S=e[12],k=e[13],R=e[14],j=e[15],K=i*p-r*u,G=i*f-a*u,H=i*_-c*u,ee=r*f-a*p,Q=r*_-c*p,fe=a*_-c*f,ue=x*k-w*S,we=x*R-M*S,ze=x*j-T*S,ye=w*R-M*k,Ce=w*j-T*k,Te=M*j-T*R,Ae=K*Te-G*Ce+H*ye+ee*ze-Q*we+fe*ue;return Ae?(t[0]=(p*Te-f*Ce+_*ye)*(Ae=1/Ae),t[1]=(a*Ce-r*Te-c*ye)*Ae,t[2]=(k*fe-R*Q+j*ee)*Ae,t[3]=(M*Q-w*fe-T*ee)*Ae,t[4]=(f*ze-u*Te-_*we)*Ae,t[5]=(i*Te-a*ze+c*we)*Ae,t[6]=(R*H-S*fe-j*G)*Ae,t[7]=(x*fe-M*H+T*G)*Ae,t[8]=(u*Ce-p*ze+_*ue)*Ae,t[9]=(r*ze-i*Ce-c*ue)*Ae,t[10]=(S*Q-k*H+j*K)*Ae,t[11]=(w*H-x*Q-T*K)*Ae,t[12]=(p*we-u*ye-f*ue)*Ae,t[13]=(i*ye-r*we+a*ue)*Ae,t[14]=(k*G-S*ee-R*K)*Ae,t[15]=(x*ee-w*G+M*K)*Ae,t):null}function Ha(t,e,i){var r=e[0],a=e[1],c=e[2],u=e[3],p=e[4],f=e[5],_=e[6],x=e[7],w=e[8],M=e[9],T=e[10],S=e[11],k=e[12],R=e[13],j=e[14],K=e[15],G=i[0],H=i[1],ee=i[2],Q=i[3];return t[0]=G*r+H*p+ee*w+Q*k,t[1]=G*a+H*f+ee*M+Q*R,t[2]=G*c+H*_+ee*T+Q*j,t[3]=G*u+H*x+ee*S+Q*K,t[4]=(G=i[4])*r+(H=i[5])*p+(ee=i[6])*w+(Q=i[7])*k,t[5]=G*a+H*f+ee*M+Q*R,t[6]=G*c+H*_+ee*T+Q*j,t[7]=G*u+H*x+ee*S+Q*K,t[8]=(G=i[8])*r+(H=i[9])*p+(ee=i[10])*w+(Q=i[11])*k,t[9]=G*a+H*f+ee*M+Q*R,t[10]=G*c+H*_+ee*T+Q*j,t[11]=G*u+H*x+ee*S+Q*K,t[12]=(G=i[12])*r+(H=i[13])*p+(ee=i[14])*w+(Q=i[15])*k,t[13]=G*a+H*f+ee*M+Q*R,t[14]=G*c+H*_+ee*T+Q*j,t[15]=G*u+H*x+ee*S+Q*K,t}function Jl(t,e,i){var r,a,c,u,p,f,_,x,w,M,T,S,k=i[0],R=i[1],j=i[2];return e===t?(t[12]=e[0]*k+e[4]*R+e[8]*j+e[12],t[13]=e[1]*k+e[5]*R+e[9]*j+e[13],t[14]=e[2]*k+e[6]*R+e[10]*j+e[14],t[15]=e[3]*k+e[7]*R+e[11]*j+e[15]):(a=e[1],c=e[2],u=e[3],p=e[4],f=e[5],_=e[6],x=e[7],w=e[8],M=e[9],T=e[10],S=e[11],t[0]=r=e[0],t[1]=a,t[2]=c,t[3]=u,t[4]=p,t[5]=f,t[6]=_,t[7]=x,t[8]=w,t[9]=M,t[10]=T,t[11]=S,t[12]=r*k+p*R+w*j+e[12],t[13]=a*k+f*R+M*j+e[13],t[14]=c*k+_*R+T*j+e[14],t[15]=u*k+x*R+S*j+e[15]),t}function Ka(t,e,i){var r=i[0],a=i[1],c=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*c,t[9]=e[9]*c,t[10]=e[10]*c,t[11]=e[11]*c,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Qh(t,e,i){var r=Math.sin(i),a=Math.cos(i),c=e[4],u=e[5],p=e[6],f=e[7],_=e[8],x=e[9],w=e[10],M=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=c*a+_*r,t[5]=u*a+x*r,t[6]=p*a+w*r,t[7]=f*a+M*r,t[8]=_*a-c*r,t[9]=x*a-u*r,t[10]=w*a-p*r,t[11]=M*a-f*r,t}function ah(t,e,i){var r=Math.sin(i),a=Math.cos(i),c=e[0],u=e[1],p=e[2],f=e[3],_=e[8],x=e[9],w=e[10],M=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=c*a-_*r,t[1]=u*a-x*r,t[2]=p*a-w*r,t[3]=f*a-M*r,t[8]=c*r+_*a,t[9]=u*r+x*a,t[10]=p*r+w*a,t[11]=f*r+M*a,t}function fd(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function gd(t,e,i){var r,a,c,u=i[0],p=i[1],f=i[2],_=Math.hypot(u,p,f);return _<oh?null:(u*=_=1/_,p*=_,f*=_,r=Math.sin(e),a=Math.cos(e),t[0]=u*u*(c=1-a)+a,t[1]=p*u*c+f*r,t[2]=f*u*c-p*r,t[3]=0,t[4]=u*p*c-f*r,t[5]=p*p*c+a,t[6]=f*p*c+u*r,t[7]=0,t[8]=u*f*c+p*r,t[9]=p*f*c-u*r,t[10]=f*f*c+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Wm=Ha;function eu(){var t=new En(3);return En!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function _d(t){var e=new En(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ql(t){return Math.hypot(t[0],t[1],t[2])}function el(t,e,i){var r=new En(3);return r[0]=t,r[1]=e,r[2]=i,r}function zo(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function tu(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function yd(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t}function ec(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t}function tc(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t}
1function Un(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function ic(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t}function an(t,e){var i=e[0],r=e[1],a=e[2],c=i*i+r*r+a*a;return c>0&&(c=1/Math.sqrt(c)),t[0]=e[0]*c,t[1]=e[1]*c,t[2]=e[2]*c,t}function ar(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function iu(t,e,i){var r=e[0],a=e[1],c=e[2],u=i[0],p=i[1],f=i[2];return t[0]=a*f-c*p,t[1]=c*u-r*f,t[2]=r*p-a*u,t}function ui(t,e,i){var r=e[0],a=e[1],c=e[2],u=i[3]*r+i[7]*a+i[11]*c+i[15];return t[0]=(i[0]*r+i[4]*a+i[8]*c+i[12])/(u=u||1),t[1]=(i[1]*r+i[5]*a+i[9]*c+i[13])/u,t[2]=(i[2]*r+i[6]*a+i[10]*c+i[14])/u,t}function vd(t,e,i){var r=i[0],a=i[1],c=i[2],u=e[0],p=e[1],f=e[2],_=a*f-c*p,x=c*u-r*f,w=r*p-a*u,M=a*w-c*x,T=c*_-r*w,S=r*x-a*_,k=2*i[3];return x*=k,w*=k,T*=2,S*=2,t[0]=u+(_*=k)+(M*=2),t[1]=p+x+T,t[2]=f+w+S,t}var nc,Tr=tu,Xm=yd,Ym=Ql;function xd(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function bd(t,e){var i=e[0],r=e[1],a=e[2],c=e[3],u=i*i+r*r+a*a+c*c;return u>0&&(u=1/Math.sqrt(u)),t[0]=i*u,t[1]=r*u,t[2]=a*u,t[3]=c*u,t}function Ja(t,e,i){var r=e[0],a=e[1],c=e[2],u=e[3];return t[0]=i[0]*r+i[4]*a+i[8]*c+i[12]*u,t[1]=i[1]*r+i[5]*a+i[9]*c+i[13]*u,t[2]=i[2]*r+i[6]*a+i[10]*c+i[14]*u,t[3]=i[3]*r+i[7]*a+i[11]*c+i[15]*u,t}function wd(){var t=new En(4);return En!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Md(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ed(t,e,i){i*=.5;var r=e[0],a=e[1],c=e[2],u=e[3],p=Math.sin(i),f=Math.cos(i);return t[0]=r*f+u*p,t[1]=a*f+c*p,t[2]=c*f-a*p,t[3]=u*f-r*p,t}function Cd(t,e,i){i*=.5;var r=e[0],a=e[1],c=e[2],u=e[3],p=Math.sin(i),f=Math.cos(i);return t[0]=r*f-c*p,t[1]=a*f+u*p,t[2]=c*f+r*p,t[3]=u*f-a*p,t}eu(),nc=new En(4),En!=Float32Array&&(nc[0]=0,nc[1]=0,nc[2]=0,nc[3]=0);var Hm=bd;eu(),el(1,0,0),el(0,1,0),wd(),wd(),pd();const Km=ae([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Td}=Km,Sd=ae([{name:"a_pos_3",components:3,type:"Int16"}]);var rc=ae([{name:"a_pos",type:"Int16",components:2}]);class nu{constructor(e,i){this.pos=e,this.dir=i}intersectsPlane(e,i,r){const a=ar(i,this.dir);if(Math.abs(a)<1e-6)return!1;const c=((e[0]-this.pos[0])*i[0]+(e[1]-this.pos[1])*i[1]+(e[2]-this.pos[2])*i[2])/a;return r[0]=this.pos[0]+this.dir[0]*c,r[1]=this.pos[1]+this.dir[1]*c,r[2]=this.pos[2]+this.dir[2]*c,!0}closestPointOnSphere(e,i,r){if(k=(T=this.pos)[0],R=T[1],j=T[2],K=(S=e)[0],G=S[1],H=S[2],Math.abs(k-K)<=oh*Math.max(1,Math.abs(k),Math.abs(K))&&Math.abs(R-G)<=oh*Math.max(1,Math.abs(R),Math.abs(G))&&Math.abs(j-H)<=oh*Math.max(1,Math.abs(j),Math.abs(H))||0===i)return r[0]=r[1]=r[2]=0,!1;var T,S,k,R,j,K,G,H;const[a,c,u]=this.dir,p=this.pos[0]-e[0],f=this.pos[1]-e[1],_=this.pos[2]-e[2],x=a*a+c*c+u*u,w=2*(p*a+f*c+_*u),M=w*w-4*x*(p*p+f*f+_*_-i*i);if(M<0){const T=Math.max(-w/2,0),S=p+a*T,k=f+c*T,R=_+u*T,j=Math.hypot(S,k,R);return r[0]=S*i/j,r[1]=k*i/j,r[2]=R*i/j,!1}{const T=(-w-Math.sqrt(M))/(2*x);if(T<0){const S=Math.hypot(p,f,_);return r[0]=p*i/S,r[1]=f*i/S,r[2]=_*i/S,!1}return r[0]=p+a*T,r[1]=f+c*T,r[2]=_+u*T,!0}}}class ru{constructor(e,i,r,a,c){this.TL=e,this.TR=i,this.BR=r,this.BL=a,this.horizon=c}static fromInvProjectionMatrix(e,i,r){const a=[-1,1,1],c=[1,1,1],u=[1,-1,1],p=[-1,-1,1],f=ui(a,a,e),_=ui(c,c,e),x=ui(u,u,e),w=ui(p,p,e);return new ru(f,_,x,w,i/r)}}class ou{constructor(e,i){this.points=e,this.planes=i}static fromInvProjectionMatrix(e,i,r,a){const c=Math.pow(2,r),u=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(f=>{const _=Ja([],f,e),x=1/_[3]/i*c;return(w=_)[0]=(M=_)[0]*(T=[x,x,a?1/_[3]:x,x])[0],w[1]=M[1]*T[1],w[2]=M[2]*T[2],w[3]=M[3]*T[3],w;var w,M,T}),p=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(f=>{const _=an([],iu([],Tr([],u[f[0]],u[f[1]]),Tr([],u[f[2]],u[f[1]]))),x=-ar(_,u[f[1]]);return _.concat(x)});return new ou(u,p)}}class sn{static fromPoints(e){const i=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0];for(const a of e)ec(i,i,a),tc(r,r,a);return new sn(i,r)}static applyTransform(e,i){const r=e.getCorners();for(let a=0;a<r.length;++a)ui(r[a],r[a],i);return sn.fromPoints(r)}constructor(e,i){this.min=e,this.max=i,this.center=Un([],zo([],this.min,this.max),.5)}quadrant(e){const i=[e%2==0,e<2],r=_d(this.min),a=_d(this.max);for(let c=0;c<i.length;c++)r[c]=i[c]?this.min[c]:this.center[c],a[c]=i[c]?this.center[c]:this.max[c];return a[2]=this.max[2],new sn(r,a)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,i=this.max;return[[e[0],e[1],e[2]],[i[0],e[1],e[2]],[i[0],i[1],e[2]],[e[0],i[1],e[2]],[e[0],e[1],i[2]],[i[0],e[1],i[2]],[i[0],i[1],i[2]],[e[0],i[1],i[2]]]}intersects(e){const i=this.getCorners();let r=!0;for(let a=0;
1a<e.planes.length;a++){const c=e.planes[a];let u=0;for(let p=0;p<i.length;p++)u+=ar(c,i[p])+c[3]>=0;if(0===u)return 0;u!==i.length&&(r=!1)}if(r)return 2;for(let a=0;a<3;a++){let c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let p=0;p<e.points.length;p++){const f=e.points[p][a]-this.min[a];c=Math.min(c,f),u=Math.max(u,f)}if(u<0||c>this.max[a]-this.min[a])return 0}return 1}}const Kr=Qe/Math.PI/2,oc=[64,32,16],sr=-Kr,lr=Kr,Qm=[new sn([sr,sr,sr],[lr,lr,lr]),new sn([sr,sr,sr],[0,0,lr]),new sn([0,sr,sr],[lr,0,lr]),new sn([sr,0,sr],[0,lr,lr]),new sn([0,0,sr],[lr,lr,lr])];function sh(t){return t*Kr/lc}function Id(t,e,i,r=!0){const a=Un([],t._camera.position,t.worldSize),c=[e,i,1,1];Ja(c,c,t.pixelMatrixInverse),xd(c,c,1/c[3]);const u=an([],Tr([],c,a)),p=t.globeMatrix,f=[p[12],p[13],p[14]],_=Tr([],f,a),x=Ql(_),w=an([],_),M=t.worldSize/(2*Math.PI),T=ar(w,u),S=Math.asin(M/x);if(S<Math.acos(T)){if(!r)return null;const ze=[],ye=[];Un(ze,u,x/T),an(ye,Tr(ye,ze,_)),an(u,zo(u,_,Un(u,ye,Math.tan(S)*x)))}const k=[];new nu(a,u).closestPointOnSphere(f,M,k);const R=an([],Xn(p,0)),j=an([],Xn(p,1)),K=an([],Xn(p,2)),G=ar(R,k),H=ar(j,k),ee=ar(K,k),Q=di(Math.asin(-H/M));let fe=di(Math.atan2(G,ee));fe=t.center.lng+function(ze,ye){const Ce=(ye-ze+180)%360-180;return Ce<-180?Ce+360:Ce}(t.center.lng,fe);const ue=Qr(fe),we=rt(eo(Q),0,1);return new rl(ue,we)}class ef{constructor(e,i,r){this.a=Tr([],e,r),this.b=Tr([],i,r),this.center=r;const a=an([],this.a),c=an([],this.b);this.angle=Math.acos(ar(a,c))}}function su(t,e){if(0===t.angle)return null;let i;return i=0===t.a[e]?1/t.angle*.5*Math.PI:1/t.angle*Math.atan(t.b[e]/t.a[e]/Math.sin(t.angle)-1/Math.tan(t.angle)),i<0||i>1?null:function(r,a,c,u){const p=Math.sin(c);return r*(Math.sin((1-u)*c)/p)+a*(Math.sin(u*c)/p)}(t.a[e],t.b[e],t.angle,rt(i,0,1))+t.center[e]}function Jr(t){if(t.z<=1)return Qm[t.z+2*t.y+t.x];const e=lu(lh(t));return sn.fromPoints(e)}function es(t,e,i){return Un(t,t,1-i),ic(t,t,e,i)}function Dd(t,e){const i=nl(e.zoom);if(0===i)return Jr(t);const r=lh(t),a=lu(r),c=Qr(r.getWest())*e.worldSize,u=Qr(r.getEast())*e.worldSize,p=eo(r.getNorth())*e.worldSize,f=eo(r.getSouth())*e.worldSize,_=[c,p,0],x=[u,p,0],w=[c,f,0],M=[u,f,0],T=Jh([],e.globeMatrix);return ui(_,_,T),ui(x,x,T),ui(w,w,T),ui(M,M,T),a[0]=es(a[0],w,i),a[1]=es(a[1],M,i),a[2]=es(a[2],x,i),a[3]=es(a[3],_,i),sn.fromPoints(a)}function kd(t,e,i){for(const r of t)ui(r,r,e),Un(r,r,i)}function lh({x:t,y:e,z:i}){const r=1/(1<<i),a=new Ft(jn(t*r),ji((e+1)*r)),c=new Ft(jn((t+1)*r),ji(e*r));return new ma(a,c)}function lu(t){const e=wt(t.getNorth()),i=wt(t.getSouth()),r=Math.cos(e),a=Math.cos(i),c=Math.sin(e),u=Math.sin(i),p=t.getWest(),f=t.getEast();return[tl(a,u,p),tl(a,u,f),tl(r,c,f),tl(r,c,p)]}function tl(t,e,i,r=Kr){return i=wt(i),[t*Math.sin(i)*r,-e*r,t*Math.cos(i)*r]}function il(t,e,i){return tl(Math.cos(wt(t)),Math.sin(wt(t)),e,i)}function ac(t,e,i,r){const a=1<<i.z,c=(t/Qe+i.x)/a;return il(ji((e/Qe+i.y)/a),jn(c),r)}function ch({min:t,max:e}){return 16383/Math.max(e[0]-t[0],e[1]-t[1],e[2]-t[2])}const zd=new Float64Array(16);function sc(t){const e=ch(t),i=fd(zd,[e,e,e]);return Jl(i,i,((r=[])[0]=-(a=t.min)[0],r[1]=-a[1],r[2]=-a[2],r));var r,a}function cu(t){const e=(r=t.min,(i=zd)[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=r[0],i[13]=r[1],i[14]=r[2],i[15]=1,i);var i,r;const a=1/ch(t);return Ka(e,e,[a,a,a])}function Pd(t,e,i,r,a){const c=function(f){const _=Qe/(2*Math.PI);return f/(2*Math.PI)/_}(i),u=[t,e,-i/(2*Math.PI)],p=Cr(new Float64Array(16));return Jl(p,p,u),Ka(p,p,[c,c,c]),Qh(p,p,wt(-a)),ah(p,p,wt(-r)),p}function nl(t){return Rr(5,6,t)}function Ld(t,e){const i=il(e.lat,e.lng);return u=(a=tu([],function(S){const k=il(S._center.lat,S._center.lng);let R=iu([],el(0,1,0),k);const j=gd([],-S.angle,k);R=ui(R,R,j),gd(j,-S._pitch,R);const K=an([],k);return Un(K,K,sh(S.cameraToCenterDistance/S.pixelsPerMeter)),ui(K,K,j),zo([],k,K)}(t),i))[0],p=a[1],f=a[2],_=(c=i)[0],x=c[1],w=c[2],T=(M=Math.sqrt(u*u+p*p+f*f)*Math.sqrt(_*_+x*x+w*w))&&ar(a,c)/M,Math.acos(Math.min(Math.max(T,-1),1));var a,c,u,p,f,_,x,w,M,T}function hu(t,e){return Ld(t,e)>Math.PI/2*1.01}const Rd=wt(85),nf=Math.cos(Rd),rf=Math.sin(Rd),lc=6371008.8,Od=2*Math.PI*lc;class fa{constructor(e,i){if(isNaN(e)||isNaN(i))throw new Error(`Invalid LngLat object: (${e}, ${i})`);
1if(this.lng=+e,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new fa(pi(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const i=Math.PI/180,r=this.lat*i,a=e.lat*i,c=Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos((e.lng-this.lng)*i);return lc*Math.acos(Math.min(c,1))}toBounds(e=0){const i=360*e/40075017,r=i/Math.cos(Math.PI/180*this.lat);return new ma(new fa(this.lng-r,this.lat-i),new fa(this.lng+r,this.lat+i))}toEcef(e){const i=sh(e);return il(this.lat,this.lng,Kr+i)}static convert(e){if(e instanceof fa)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new fa(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new fa(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}var Ft=fa;function uu(t){return Od*Math.cos(t*Math.PI/180)}function Qr(t){return(180+t)/360}function eo(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Sr(t,e){return t/uu(e)}function jn(t){return 360*t-180}function ji(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function Fd(t,e){return t*uu(ji(e))}const Gi=85.051129;function Bd(t){return 1/Math.cos(t*Math.PI/180)}class rl{constructor(e,i,r=0){this.x=+e,this.y=+i,this.z=+r}static fromLngLat(e,i=0){const r=Ft.convert(e);return new rl(Qr(r.lng),eo(r.lat),Sr(i,r.lat))}toLngLat(){return new Ft(jn(this.x),ji(this.y))}toAltitude(){return Fd(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Od*Bd(ji(this.y))}}function du(t,e,i,r,a,c,u,p,f){const _=(e+r)/2,x=(i+a)/2,w=new Ve(_,x);p(w),function(M,T,S,k,R,j){const K=S-R,G=k-j;return Math.abs((k-T)*K-(S-M)*G)/Math.hypot(K,G)}(w.x,w.y,c.x,c.y,u.x,u.y)>=f?(du(t,e,i,_,x,c,w,p,f),du(t,_,x,r,a,w,u,p,f)):t.push(u)}function Nd(t,e,i){let r=t[0],a=r.x,c=r.y;e(r);const u=[r];for(let p=1;p<t.length;p++){const f=t[p],{x:_,y:x}=f;e(f),du(u,a,c,_,x,r,f,e,i),a=_,c=x,r=f}return u}function pu(t,e,i,r){if(r(e,i)){const a=e.add(i)._mult(.5);pu(t,e,a,r),pu(t,a,i,r)}else t.push(i)}function of(t,e){let i=t[0];const r=[i];for(let a=1;a<t.length;a++){const c=t[a];pu(r,i,c,e),i=c}return r}const mu=Math.pow(2,14)-1,Vd=-mu-1;function af(t,e){const i=Math.round(t.x*e),r=Math.round(t.y*e);return t.x=rt(i,Vd,mu),t.y=rt(r,Vd,mu),(i<t.x||i>t.x+1||r<t.y||r>t.y+1)&&Ht("Geometry exceeds allowed extent, reduce your vector tile buffer size"),t}function Po(t,e,i){const r=t.loadGeometry(),a=t.extent,c=Qe/a;if(e&&i&&i.projection.isReprojectedInTileSpace){const u=1<<e.z,{scale:p,x:f,y:_,projection:x}=i,w=M=>{const T=jn((e.x+M.x/a)/u),S=ji((e.y+M.y/a)/u),k=x.project(T,S);M.x=(k.x*p-f)*a,M.y=(k.y*p-_)*a};for(let M=0;M<r.length;M++)if(1!==t.type)r[M]=Nd(r[M],w,1);else{const T=[];for(const S of r[M])S.x<0||S.x>=a||S.y<0||S.y>=a||(w(S),T.push(S));r[M]=T}}for(const u of r)for(const p of u)af(p,c);return r}function ts(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Po(t):[]}}function hh(t,e,i,r,a){t.emplaceBack(2*e+(r+1)/2,2*i+(a+1)/2)}function uh(t,e,i){t.emplaceBack(e.x,e.y,e.z,16384*i[0],16384*i[1],16384*i[2])}class fu{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new ke,this.indexArray=new Ye,this.segments=new fi,this.programConfigurations=new Ya(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,r,a){const c=this.layers[0],u=[];let p=null;"circle"===c.type&&(p=c.layout.get("circle-sort-key"));for(const{feature:_,id:x,index:w,sourceLayerIndex:M}of e){const T=this.layers[0]._featureFilter.needGeometry,S=ts(_,T);if(!this.layers[0]._featureFilter.filter(new b(this.zoom),S,r))continue;const k=p?p.evaluate(S,{},r):void 0,R={id:x,properties:_.properties,type:_.type,sourceLayerIndex:M,index:w,geometry:T?S.geometry:Po(_,r,a),patterns:{},sortKey:k};u.push(R)}p&&u.sort((_,x)=>
vendor: 9,207 bytes, line 1
1_.sortKey-x.sortKey);let f=null;"globe"===a.projection.name&&(this.globeExtVertexArray=new Pe,f=a.projection);for(const _ of u){const{geometry:x,index:w,sourceLayerIndex:M}=_,T=e[w].feature;this.addFeature(_,x,w,i.availableImages,r,f),i.featureIndex.insert(T,x,w,M,this.index)}}update(e,i,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,r,a)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,$m.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,qm.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,i,r,a,c,u){for(const p of i)for(const f of p){const _=f.x,x=f.y;if(_<0||_>=Qe||x<0||x>=Qe)continue;if(u){const T=u.projectTilePoint(_,x,c),S=u.upVector(c,_,x),k=this.globeExtVertexArray;uh(k,T,S),uh(k,T,S),uh(k,T,S),uh(k,T,S)}const w=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),M=w.vertexLength;hh(this.layoutVertexArray,_,x,-1,-1),hh(this.layoutVertexArray,_,x,1,-1),hh(this.layoutVertexArray,_,x,1,1),hh(this.layoutVertexArray,_,x,-1,1),this.indexArray.emplaceBack(M,M+1,M+2),this.indexArray.emplaceBack(M,M+2,M+3),w.vertexLength+=4,w.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},a,c)}}function Ud(t,e){for(let i=0;i<t.length;i++)if(is(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(is(t,e[i]))return!0;return!!gu(t,e)}function sf(t,e,i){return!!is(t,e)||!!_u(e,t,i)}function jd(t,e){if(1===t.length)return Zd(e,t[0]);for(let i=0;i<e.length;i++){const r=e[i];for(let a=0;a<r.length;a++)if(is(t,r[a]))return!0}for(let i=0;i<t.length;i++)if(Zd(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(gu(t,e[i]))return!0;return!1}function lf(t,e,i){if(t.length>1){if(gu(t,e))return!0;for(let r=0;r<e.length;r++)if(_u(e[r],t,i))return!0}for(let r=0;r<t.length;r++)if(_u(t[r],e,i))return!0;return!1}function gu(t,e){if(0===t.length||0===e.length)return!1;for(let i=0;i<t.length-1;i++){const r=t[i],a=t[i+1];for(let c=0;c<e.length-1;c++)if(cf(r,a,e[c],e[c+1]))return!0}return!1}function cf(t,e,i,r){return dn(t,i,r)!==dn(e,i,r)&&dn(t,e,i)!==dn(t,e,r)}function _u(t,e,i){const r=i*i;if(1===e.length)return t.distSqr(e[0])<r;for(let a=1;a<e.length;a++)if(Gd(t,e[a-1],e[a])<r)return!0;return!1}function Gd(t,e,i){const r=e.distSqr(i);if(0===r)return t.distSqr(e);const a=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/r;return t.distSqr(a<0?e:a>1?i:i.sub(e)._mult(a)._add(e))}function Zd(t,e){let i,r,a,c=!1;for(let u=0;u<t.length;u++){i=t[u];for(let p=0,f=i.length-1;p<i.length;f=p++)r=i[p],a=i[f],r.y>e.y!=a.y>e.y&&e.x<(a.x-r.x)*(e.y-r.y)/(a.y-r.y)+r.x&&(c=!c)}return c}function is(t,e){let i=!1;for(let r=0,a=t.length-1;r<t.length;a=r++){const c=t[r],u=t[a];c.y>e.y!=u.y>e.y&&e.x<(u.x-c.x)*(e.y-c.y)/(u.y-c.y)+c.x&&(i=!i)}return i}function $d(t,e,i,r,a){for(const u of t)if(e<=u.x&&i<=u.y&&r>=u.x&&a>=u.y)return!0;const c=[new Ve(e,i),new Ve(e,a),new Ve(r,a),new Ve(r,i)];if(t.length>2)for(const u of c)if(is(t,u))return!0;for(let u=0;u<t.length-1;u++)if(hf(t[u],t[u+1],c))return!0;return!1}function hf(t,e,i){const r=i[0],a=i[2];if(t.x<r.x&&e.x<r.x||t.x>a.x&&e.x>a.x||t.y<r.y&&e.y<r.y||t.y>a.y&&e.y>a.y)return!1;const c=dn(t,e,i[0]);return c!==dn(t,e,i[1])||c!==dn(t,e,i[2])||c!==dn(t,e,i[3])}function ol(t,e,i){const r=e.paint.get(t).value;return"constant"===r.kind?r.value:i.programConfigurations.get(e.id).getMaxValue(t)}function dh(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function qd(t,e,i,r,a){if(!e[0]&&!e[1])return t;const c=Ve.convert(e)._mult(a);"viewport"===i&&c._rotate(-r);const u=[];for(let p=0;p<t.length;p++)u.push(t[p].sub(c));return u}function Wd(t,e,i,r){const a=Ve.convert(t)._mult(r);return"viewport"===e&&a._rotate(-i),a}qe(fu,"CircleBucket",{omit:["layers"]});const uf=new W({"circle-sort-key":new F(be.layout_circle["circle-sort-key"])});var df={paint:new W({"circle-radius":new F(be.paint_circle["circle-radius"]),"circle-color":new F(be.paint_circle["circle-color"]),"circle-blur":new F(be.paint_circle["circle-blur"]),"circle-opacity":new F(be.paint_circle["circle-opacity"]),"circle-translate":new D(be.paint_circle["circle-translate"]),"circle-translate-anchor":new D(be.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new D(be.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new D(be.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new F(be.paint_circle["circle-stroke-width"]),"circle-stroke-color":new F(be.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new F(be.paint_circle["circle-stroke-opacity"])}),layout:uf};function Xd(t,e,i,r,a,c,u,p,f){if(c&&t.queryGeometry.isAboveHorizon)return!1;c&&(f*=t.pixelToTileUnitsFactor);const _=t.tileID.canonical,x=i.projection.upVectorScale(_,i.center.lat,i.worldSize).metersToTile;for(const w of e)for(const M of w){const T=M.add(p),S=a&&i.elevation?i.elevation.exaggeration()*a.getElevationAt(T.x,T.y,!0):0,k=i.projection.projectTilePoint(T.x,T.y,_);if(S>0){const G=i.projection.upVector(_,T.x,T.y);k.x+=G[0]*x*S,k.y+=G[1]*x*S,k.z+=G[2]*x*S}const R=c?T:pf(k.x,k.y,k.z,r),j=c?t.tilespaceRays.map(G=>ff(G,S)):t.queryGeometry.screenGeometry,K=Ja([],[k.x,k.y,k.z,1],r);if(!u&&c?f*=K[3]/i.cameraToCenterDistance:u&&!c&&(f*=i.cameraToCenterDistance/K[3]),c){const G=ji((M.y/Qe+_.y)/(1<<_.z));f/=i.projection.pixelsPerMeter(G,1)/Sr(1,G)}if(sf(j,R,f))return!0}return!1}function pf(t,e,i,r){const a=Ja([],[t,e,i,1],r);return new Ve(a[0]/a[3],a[1]/a[3])}const Yd=el(0,0,0),mf=el(0,0,1);function ff(t,e){const i=eu();return Yd[2]=e,t.intersectsPlane(Yd,mf,i),new Ve(i[0],i[1])}class Hd extends fu{}function Kd(t,{width:e,height:i},r,a){if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==e*i*r)throw new RangeError("mismatched image size")}else a=new Uint8Array(e*i*r);return t.width=e,t.height=i,t.data=a,t}function Jd(t,e,i){const{width:r,height:a}=e;r===t.width&&a===t.height||(yu(t,e,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,r),height:Math.min(t.height,a)},i),t.width=r,t.height=a,t.data=e.data)}function yu(t,e,i,r,a,c){if(0===a.width||0===a.height)return e;if(a.width>t.width||a.height>t.height||i.x>t.width-a.width||i.y>t.height-a.height)throw new RangeError("out of range source coordinates for image copy");if(a.width>e.width||a.height>e.height||r.x>e.width-a.width||r.y>e.height-a.height)throw new RangeError("out of range destination coordinates for image copy");const u=t.data,p=e.data;for(let f=0;f<a.height;f++){const _=((i.y+f)*t.width+i.x)*c,x=((r.y+f)*e.width+r.x)*c;for(let w=0;w<a.width*c;w++)p[x+w]=u[_+w]}return e}qe(Hd,"HeatmapBucket",{omit:["layers"]});class Lo{constructor(e,i){Kd(this,e,1,i)}resize(e){Jd(this,new Lo(e),1)}clone(){return new Lo({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,r,a,c){yu(e,i,r,a,c,1)}}class Cn{constructor(e,i){Kd(this,e,4,i)}resize(e){Jd(this,new Cn(e),4)}replace(e,i){i?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Cn({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,r,a,c){yu(e,i,r,a,c,4)}}qe(Lo,"AlphaImage"),qe(Cn,"RGBAImage");var gf={paint:new W({"heatmap-radius":new F(be.paint_heatmap["heatmap-radius"]),"heatmap-weight":new F(be.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new D(be.paint_heatmap["heatmap-intensity"]),"heatmap-color":new $(be.paint_heatmap["heatmap-color"]),"heatmap-opacity":new D(be.paint_heatmap["heatmap-opacity"])})};function vu(t){const e={},i=t.resolution||256,r=t.clips?t.clips.length:1,a=t.image||new Cn({width:i,height:r}),c=(u,p,f)=>{e[t.evaluationKey]=f;const _=t.expression.evaluate(e);a.data[u+p+0]=Math.floor(255*_.r/_.a),a.data[u+p+1]=Math.floor(255*_.g/_.a),a.data[u+p+2]=Math.floor(255*_.b/_.a),a.data[u+p+3]=Math.floor(255*_.a)};if(t.clips)for(let u=0,p=0;u<r;++u,p+=4*i)for(let f=0,_=0;f<i;f++,_+=4){const x=f/(i-1),{start:w,end:M}=t.clips[u];c(p,_,w*(1-x)+M*x)}else for(let u=0,p=0;u<i;u++,p+=4)c(0,p,u/(i-1));return a}var _f={paint:new W({"hillshade-illumination-direction":new D(be.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new D(be.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new D(be.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new D(be.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new D(be.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new D(be.paint_hillshade["hillshade-accent-color"])})};const yf=ae([{name:"a_pos",components:2,type:"Int16"}],4),{members:vf}=yf;var xu={exports:{}};function ph(t,e,i){i=i||2;var r,a,c,u,p,f,_,x=e&&e.length,w=x?e[0]*i:t.length,M=Qd(t,0,w,i,!0),T=[];
vendor: 3,369 bytes, line 1
1if(!M||M.next===M.prev)return T;if(x&&(M=function(k,R,j,K){var G,H,ee,Q=[];for(G=0,H=R.length;G<H;G++)(ee=Qd(k,R[G]*K,G<H-1?R[G+1]*K:k.length,K,!1))===ee.next&&(ee.steiner=!0),Q.push(Sf(ee));for(Q.sort(Ef),G=0;G<Q.length;G++)j=Cf(Q[G],j);return j}(t,e,M,i)),t.length>80*i){r=c=t[0],a=u=t[1];for(var S=i;S<w;S+=i)(p=t[S])<r&&(r=p),(f=t[S+1])<a&&(a=f),p>c&&(c=p),f>u&&(u=f);_=0!==(_=Math.max(c-r,u-a))?32767/_:0}return cc(M,T,i,r,a,_,0),T}function Qd(t,e,i,r,a){var c,u;if(a===Mu(t,e,i,r)>0)for(c=e;c<i;c+=r)u=ip(c,t[c],t[c+1],u);else for(c=i-r;c>=e;c-=r)u=ip(c,t[c],t[c+1],u);return u&&mh(u,u.next)&&(uc(u),u=u.next),u}function ns(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!mh(r,r.next)&&0!==gi(r.prev,r,r.next))r=r.next;else{if(uc(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function cc(t,e,i,r,a,c,u){if(t){!u&&c&&function(x,w,M,T){var S=x;do{0===S.z&&(S.z=bu(S.x,S.y,w,M,T)),S.prevZ=S.prev,S.nextZ=S.next,S=S.next}while(S!==x);S.prevZ.nextZ=null,S.prevZ=null,function(k){var R,j,K,G,H,ee,Q,fe,ue=1;do{for(j=k,k=null,H=null,ee=0;j;){for(ee++,K=j,Q=0,R=0;R<ue&&(Q++,K=K.nextZ);R++);for(fe=ue;Q>0||fe>0&&K;)0!==Q&&(0===fe||!K||j.z<=K.z)?(G=j,j=j.nextZ,Q--):(G=K,K=K.nextZ,fe--),H?H.nextZ=G:k=G,G.prevZ=H,H=G;j=K}H.nextZ=null,ue*=2}while(ee>1)}(S)}(t,r,a,c);for(var p,f,_=t;t.prev!==t.next;)if(p=t.prev,f=t.next,c?bf(t,r,a,c):xf(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(f.i/i|0),uc(t),t=f.next,_=f.next;else if((t=f)===_){u?1===u?cc(t=wf(ns(t),e,i),e,i,r,a,c,2):2===u&&Mf(t,e,i,r,a,c):cc(ns(t),e,i,r,a,c,1);break}}}function xf(t){var e=t.prev,i=t,r=t.next;if(gi(e,i,r)>=0)return!1;for(var a=e.x,c=i.x,u=r.x,p=e.y,f=i.y,_=r.y,x=a<c?a<u?a:u:c<u?c:u,w=p<f?p<_?p:_:f<_?f:_,M=a>c?a>u?a:u:c>u?c:u,T=p>f?p>_?p:_:f>_?f:_,S=r.next;S!==e;){if(S.x>=x&&S.x<=M&&S.y>=w&&S.y<=T&&al(a,p,c,f,u,_,S.x,S.y)&&gi(S.prev,S,S.next)>=0)return!1;S=S.next}return!0}function bf(t,e,i,r){var a=t.prev,c=t,u=t.next;if(gi(a,c,u)>=0)return!1;for(var p=a.x,f=c.x,_=u.x,x=a.y,w=c.y,M=u.y,T=p<f?p<_?p:_:f<_?f:_,S=x<w?x<M?x:M:w<M?w:M,k=p>f?p>_?p:_:f>_?f:_,R=x>w?x>M?x:M:w>M?w:M,j=bu(T,S,e,i,r),K=bu(k,R,e,i,r),G=t.prevZ,H=t.nextZ;G&&G.z>=j&&H&&H.z<=K;){if(G.x>=T&&G.x<=k&&G.y>=S&&G.y<=R&&G!==a&&G!==u&&al(p,x,f,w,_,M,G.x,G.y)&&gi(G.prev,G,G.next)>=0||(G=G.prevZ,H.x>=T&&H.x<=k&&H.y>=S&&H.y<=R&&H!==a&&H!==u&&al(p,x,f,w,_,M,H.x,H.y)&&gi(H.prev,H,H.next)>=0))return!1;H=H.nextZ}for(;G&&G.z>=j;){if(G.x>=T&&G.x<=k&&G.y>=S&&G.y<=R&&G!==a&&G!==u&&al(p,x,f,w,_,M,G.x,G.y)&&gi(G.prev,G,G.next)>=0)return!1;G=G.prevZ}for(;H&&H.z<=K;){if(H.x>=T&&H.x<=k&&H.y>=S&&H.y<=R&&H!==a&&H!==u&&al(p,x,f,w,_,M,H.x,H.y)&&gi(H.prev,H,H.next)>=0)return!1;H=H.nextZ}return!0}function wf(t,e,i){var r=t;do{var a=r.prev,c=r.next.next;!mh(a,c)&&ep(a,r,r.next,c)&&hc(a,c)&&hc(c,a)&&(e.push(a.i/i|0),e.push(r.i/i|0),e.push(c.i/i|0),uc(r),uc(r.next),r=t=c),r=r.next}while(r!==t);return ns(r)}function Mf(t,e,i,r,a,c){var u=t;do{for(var p=u.next.next;p!==u.prev;){if(u.i!==p.i&&Af(u,p)){var f=tp(u,p);return u=ns(u,u.next),f=ns(f,f.next),cc(u,e,i,r,a,c,0),void cc(f,e,i,r,a,c,0)}p=p.next}u=u.next}while(u!==t)}function Ef(t,e){return t.x-e.x}function Cf(t,e){var i=function(a,c){var u,p=c,f=a.x,_=a.y,x=-1/0;do{if(_<=p.y&&_>=p.next.y&&p.next.y!==p.y){var w=p.x+(_-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(w<=f&&w>x&&(x=w,u=p.x<p.next.x?p:p.next,w===f))return u}p=p.next}while(p!==c);if(!u)return null;
vendor: 1,601 bytes, line 1
1var M,T=u,S=u.x,k=u.y,R=1/0;p=u;do{f>=p.x&&p.x>=S&&f!==p.x&&al(_<k?f:x,_,S,k,_<k?x:f,_,p.x,p.y)&&(M=Math.abs(_-p.y)/(f-p.x),hc(p,a)&&(M<R||M===R&&(p.x>u.x||p.x===u.x&&Tf(u,p)))&&(u=p,R=M)),p=p.next}while(p!==T);return u}(t,e);if(!i)return e;var r=tp(i,t);return ns(r,r.next),ns(i,i.next)}function Tf(t,e){return gi(t.prev,t,e.prev)<0&&gi(e.next,t,t.next)<0}function bu(t,e,i,r,a){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*a|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*a|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Sf(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function al(t,e,i,r,a,c,u,p){return(a-u)*(e-p)>=(t-u)*(c-p)&&(t-u)*(r-p)>=(i-u)*(e-p)&&(i-u)*(c-p)>=(a-u)*(r-p)}function Af(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(i,r){var a=i;do{if(a.i!==i.i&&a.next.i!==i.i&&a.i!==r.i&&a.next.i!==r.i&&ep(a,a.next,i,r))return!0;a=a.next}while(a!==i);return!1}(t,e)&&(hc(t,e)&&hc(e,t)&&function(i,r){var a=i,c=!1,u=(i.x+r.x)/2,p=(i.y+r.y)/2;do{a.y>p!=a.next.y>p&&a.next.y!==a.y&&u<(a.next.x-a.x)*(p-a.y)/(a.next.y-a.y)+a.x&&(c=!c),a=a.next}while(a!==i);return c}(t,e)&&(gi(t.prev,t,e.prev)||gi(t,e.prev,e))||mh(t,e)&&gi(t.prev,t,t.next)>0&&gi(e.prev,e,e.next)>0)}function gi(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function mh(t,e){return t.x===e.x&&t.y===e.y}function ep(t,e,i,r){var a=gh(gi(t,e,i)),c=gh(gi(t,e,r)),u=gh(gi(i,r,t)),p=gh(gi(i,r,e));return a!==c&&u!==p||!(0!==a||!fh(t,i,e))||!(0!==c||!fh(t,r,e))||!(0!==u||!fh(i,t,r))||!(0!==p||!fh(i,e,r))}
vendor: 10,708 bytes, line 1
1function fh(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function gh(t){return t>0?1:t<0?-1:0}function hc(t,e){return gi(t.prev,t,t.next)<0?gi(t,e,t.next)>=0&&gi(t,t.prev,e)>=0:gi(t,e,t.prev)<0||gi(t,t.next,e)<0}function tp(t,e){var i=new wu(t.i,t.x,t.y),r=new wu(e.i,e.x,e.y),a=t.next,c=e.prev;return t.next=e,e.prev=t,i.next=a,a.prev=i,r.next=i,i.prev=r,c.next=r,r.prev=c,r}function ip(t,e,i,r){var a=new wu(t,e,i);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function uc(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function wu(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Mu(t,e,i,r){for(var a=0,c=e,u=i-r;c<i;c+=r)a+=(t[u]-t[c])*(t[c+1]+t[u+1]),u=c;return a}xu.exports=ph,xu.exports.default=ph,ph.deviation=function(t,e,i,r){var a=e&&e.length,c=Math.abs(Mu(t,0,a?e[0]*i:t.length,i));if(a)for(var u=0,p=e.length;u<p;u++)c-=Math.abs(Mu(t,e[u]*i,u<p-1?e[u+1]*i:t.length,i));var f=0;for(u=0;u<r.length;u+=3){var _=r[u]*i,x=r[u+1]*i,w=r[u+2]*i;f+=Math.abs((t[_]-t[w])*(t[x+1]-t[_+1])-(t[_]-t[x])*(t[w+1]-t[_+1]))}return 0===c&&0===f?0:Math.abs((f-c)/c)},ph.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},r=0,a=0;a<t.length;a++){for(var c=0;c<t[a].length;c++)for(var u=0;u<e;u++)i.vertices.push(t[a][c][u]);a>0&&i.holes.push(r+=t[a-1].length)}return i};var Eu=li(xu.exports);function If(t,e,i,r,a){np(t,e,i||0,r||t.length-1,a||Df)}function np(t,e,i,r,a){for(;r>i;){if(r-i>600){var c=r-i+1,u=e-i+1,p=Math.log(c),f=.5*Math.exp(2*p/3),_=.5*Math.sqrt(p*f*(c-f)/c)*(u-c/2<0?-1:1);np(t,e,Math.max(i,Math.floor(e-u*f/c+_)),Math.min(r,Math.floor(e+(c-u)*f/c+_)),a)}var x=t[e],w=i,M=r;for(dc(t,i,e),a(t[r],x)>0&&dc(t,i,r);w<M;){for(dc(t,w,M),w++,M--;a(t[w],x)<0;)w++;for(;a(t[M],x)>0;)M--}0===a(t[i],x)?dc(t,i,M):dc(t,++M,r),M<=e&&(i=M+1),e<=M&&(r=M-1)}}function dc(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function Df(t,e){return t<e?-1:t>e?1:0}function Cu(t,e){const i=t.length;if(i<=1)return[t];const r=[];let a,c;for(let u=0;u<i;u++){const p=Ea(t[u]);0!==p&&(t[u].area=Math.abs(p),void 0===c&&(c=p<0),c===p<0?(a&&r.push(a),a=[t[u]]):a.push(t[u]))}if(a&&r.push(a),e>1)for(let u=0;u<r.length;u++)r[u].length<=e||(If(r[u],e,1,r[u].length-1,kf),r[u]=r[u].slice(0,e));return r}function kf(t,e){return e.area-t.area}function Tu(t,e,i){const r=i.patternDependencies;let a=!1;for(const c of e){const u=c.paint.get(`${t}-pattern`);u.isConstant()||(a=!0);const p=u.constantOr(null);p&&(a=!0,r[p]=!0)}return a}function Su(t,e,i,r,a){const c=a.patternDependencies;for(const u of e){const p=u.paint.get(`${t}-pattern`).value;if("constant"!==p.kind){let f=p.evaluate({zoom:r},i,{},a.availableImages);f=f&&f.name?f.name:f,c[f]=!0,i.patterns[u.id]=f}}return i}class _h{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ke,this.indexArray=new Ye,this.indexArray2=new ki,this.programConfigurations=new Ya(e.layers,e.zoom),this.segments=new fi,this.segments2=new fi,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=e.projection}populate(e,i,r,a){this.hasPattern=Tu("fill",this.layers,i);const c=this.layers[0].layout.get("fill-sort-key"),u=[];for(const{feature:p,id:f,index:_,sourceLayerIndex:x}of e){const w=this.layers[0]._featureFilter.needGeometry,M=ts(p,w);if(!this.layers[0]._featureFilter.filter(new b(this.zoom),M,r))continue;const T=c?c.evaluate(M,{},r,i.availableImages):void 0,S={id:f,properties:p.properties,type:p.type,sourceLayerIndex:x,index:_,geometry:w?M.geometry:Po(p,r,a),patterns:{},sortKey:T};u.push(S)}c&&u.sort((p,f)=>p.sortKey-f.sortKey);for(const p of u){const{geometry:f,index:_,sourceLayerIndex:x}=p;if(this.hasPattern){const w=Su("fill",this.layers,p,this.zoom,i);this.patternFeatures.push(w)}else this.addFeature(p,f,_,r,{},i.availableImages);i.featureIndex.insert(e[_].feature,f,_,x,this.index)}}update(e,i,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,r,a)}addFeatures(e,i,r,a,c){for(const u of this.patternFeatures)this.addFeature(u,u.geometry,u.index,i,r,a)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,vf),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,i,r,a,c,u=[]){for(const p of Cu(i,500)){let f=0;for(const S of p)f+=S.length;const _=this.segments.prepareSegment(f,this.layoutVertexArray,this.indexArray),x=_.vertexLength,w=[],M=[];for(const S of p){if(0===S.length)continue;S!==p[0]&&M.push(w.length/2);const k=this.segments2.prepareSegment(S.length,this.layoutVertexArray,this.indexArray2),R=k.vertexLength;this.layoutVertexArray.emplaceBack(S[0].x,S[0].y),this.indexArray2.emplaceBack(R+S.length-1,R),w.push(S[0].x),w.push(S[0].y);for(let j=1;j<S.length;j++)this.layoutVertexArray.emplaceBack(S[j].x,S[j].y),this.indexArray2.emplaceBack(R+j-1,R+j),w.push(S[j].x),w.push(S[j].y);k.vertexLength+=S.length,k.primitiveLength+=S.length}const T=Eu(w,M);for(let S=0;S<T.length;S+=3)this.indexArray.emplaceBack(x+T[S],x+T[S+1],x+T[S+2]);_.vertexLength+=f,_.primitiveLength+=T.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,c,u,a)}}qe(_h,"FillBucket",{omit:["layers","patternFeatures"]});const zf=new W({"fill-sort-key":new F(be.layout_fill["fill-sort-key"])});var Pf={paint:new W({"fill-antialias":new D(be.paint_fill["fill-antialias"]),"fill-opacity":new F(be.paint_fill["fill-opacity"]),"fill-color":new F(be.paint_fill["fill-color"]),"fill-outline-color":new F(be.paint_fill["fill-outline-color"]),"fill-translate":new D(be.paint_fill["fill-translate"]),"fill-translate-anchor":new D(be.paint_fill["fill-translate-anchor"]),"fill-pattern":new F(be.paint_fill["fill-pattern"])}),layout:zf};const Lf=ae([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),Rf=ae([{name:"a_centroid_pos",components:2,type:"Uint16"}]),Of=ae([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:Ff}=Lf;var yh={},Bf=Dn,rp=sl;function sl(t,e,i,r,a){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=a,t.readFields(Nf,this,e)}function Nf(t,e,i){1==t?e.id=i.readVarint():2==t?function(r,a){for(var c=r.readVarint()+r.pos;r.pos<c;){var u=a._keys[r.readVarint()],p=a._values[r.readVarint()];a.properties[u]=p}}(i,e):3==t?e.type=i.readVarint():4==t&&(e._geometry=i.pos)}function Vf(t){for(var e,i,r=0,a=0,c=t.length,u=c-1;a<c;u=a++)r+=((i=t[u]).x-(e=t[a]).x)*(e.y+i.y);return r}sl.types=["Unknown","Point","LineString","Polygon"],sl.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,i=t.readVarint()+t.pos,r=1,a=0,c=0,u=0,p=[];t.pos<i;){if(a<=0){var f=t.readVarint();r=7&f,a=f>>3}if(a--,1===r||2===r)c+=t.readSVarint(),u+=t.readSVarint(),1===r&&(e&&p.push(e),e=[]),e.push(new Bf(c,u));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&p.push(e),p},sl.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,r=0,a=0,c=0,u=1/0,p=-1/0,f=1/0,_=-1/0;t.pos<e;){if(r<=0){var x=t.readVarint();i=7&x,r=x>>3}if(r--,1===i||2===i)(a+=t.readSVarint())<u&&(u=a),a>p&&(p=a),(c+=t.readSVarint())<f&&(f=c),c>_&&(_=c);else if(7!==i)throw new Error("unknown command "+i)}return[u,f,p,_]},sl.prototype.toGeoJSON=function(t,e,i){var r,a,c=this.extent*Math.pow(2,i),u=this.extent*t,p=this.extent*e,f=this.loadGeometry(),_=sl.types[this.type];function x(T){for(var S=0;S<T.length;S++){var k=T[S];T[S]=[360*(k.x+u)/c-180,360/Math.PI*Math.atan(Math.exp((180-360*(k.y+p)/c)*Math.PI/180))-90]}}switch(this.type){case 1:var w=[];for(r=0;r<f.length;r++)w[r]=f[r][0];x(f=w);break;case 2:for(r=0;r<f.length;r++)x(f[r]);break;case 3:for(f=function(T){var S=T.length;if(S<=1)return[T];for(var k,R,j=[],K=0;K<S;K++){var G=Vf(T[K]);0!==G&&(void 0===R&&(R=G<0),R===G<0?(k&&j.push(k),k=[T[K]]):k.push(T[K]))}return k&&j.push(k),j}(f),r=0;r<f.length;r++)for(a=0;a<f[r].length;a++)x(f[r][a])}1===f.length?f=f[0]:_="Multi"+_;var M={type:"Feature",geometry:{type:_,coordinates:f},properties:this.properties};return"id"in this&&(M.id=this.id),M};var Uf=rp,op=ap;function ap(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(jf,this,e),this.length=this._features.length}function jf(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(r){for(var a=null,c=r.readVarint()+r.pos;r.pos<c;){var u=r.readVarint()>>3;a=1===u?r.readString():2===u?r.readFloat():3===u?r.readDouble():4===u?r.readVarint64():5===u?r.readVarint():6===u?r.readSVarint():7===u?r.readBoolean():null}return a}(i))}ap.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Uf(this._pbf,e,this.extent,this._keys,this._values)};var Gf=op;function Zf(t,e,i){if(3===t){var r=new Gf(i,i.readVarint()+i.pos);r.length&&(e[r.name]=r)}}var Au=yh.VectorTile=function(t,e){this.layers=t.readFields(Zf,{},e)},vh=yh.VectorTileFeature=rp;function xh(t,e,i,r){const a=[],c=0===r?(u,p,f,_,x,w)=>{u.push(new Ve(w,f+(w-p)/(_-p)*(x-f)))}:(u,p,f,_,x,w)=>{u.push(new Ve(p+(w-f)/(x-f)*(_-p),w))};for(const u of t){const p=[];for(const f of u){if(f.length<=2)continue;const _=[];for(let M=0;M<f.length-1;M++){const T=f[M].x,S=f[M].y,k=f[M+1].x,R=f[M+1].y,j=0===r?T:S,K=0===r?k:R;j<e?K>e&&c(_,T,S,k,R,e):j>i?K<i&&c(_,T,S,k,R,i):_.push(f[M]),K<e&&j>=e&&c(_,T,S,k,R,e),K>i&&j<=i&&c(_,T,S,k,R,i)}let x=f[f.length-1];const w=0===r?x.x:x.y;w>=e&&w<=i&&_.push(x),_.length&&(x=_[_.length-1],_[0].x===x.x&&_[0].y===x.y||_.push(_[0]),p.push(_))}p.length&&a.push(p)}return a}yh.VectorTileLayer=op;const $f=vh.types,qf=Math.pow(2,13);
1function pc(t,e,i,r,a,c,u,p){t.emplaceBack((e<<1)+u,(i<<1)+c,(Math.floor(r*qf)<<1)+a,Math.round(p))}function mc(t,e,i){t.emplaceBack(e.x,e.y,e.z,16384*i[0],16384*i[1],16384*i[2])}class sp{constructor(){this.acc=new Ve(0,0),this.polyCount=[]}startRing(e){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new Ve(e.x,e.y),this.max=new Ve(e.x,e.y))}append(e,i){this.currentPolyCount.edges++,this.acc._add(e);const r=this.min,a=this.max;e.x<r.x?r.x=e.x:e.x>a.x&&(a.x=e.x),e.y<r.y?r.y=e.y:e.y>a.y&&(a.y=e.y),((0===e.x||e.x===Qe)&&e.x===i.x)!=((0===e.y||e.y===Qe)&&e.y===i.y)&&this.processBorderOverlap(e,i),i.x<0!=e.x<0&&this.addBorderIntersection(0,Ct(i.y,e.y,(0-i.x)/(e.x-i.x))),i.x>Qe!=e.x>Qe&&this.addBorderIntersection(1,Ct(i.y,e.y,(Qe-i.x)/(e.x-i.x))),i.y<0!=e.y<0&&this.addBorderIntersection(2,Ct(i.x,e.x,(0-i.y)/(e.y-i.y))),i.y>Qe!=e.y>Qe&&this.addBorderIntersection(3,Ct(i.x,e.x,(Qe-i.y)/(e.y-i.y)))}addBorderIntersection(e,i){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const r=this.borders[e];i<r[0]&&(r[0]=i),i>r[1]&&(r[1]=i)}processBorderOverlap(e,i){if(e.x===i.x){if(e.y===i.y)return;const r=0===e.x?0:1;this.addBorderIntersection(r,i.y),this.addBorderIntersection(r,e.y)}else{const r=0===e.y?2:3;this.addBorderIntersection(r,i.x),this.addBorderIntersection(r,e.x)}}centroid(){const e=this.polyCount.reduce((i,r)=>i+r.edges,0);return 0!==e?this.acc.div(e)._round():new Ve(0,0)}span(){return new Ve(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((e,i)=>e+ +(i[0]!==Number.MAX_VALUE),0)}}class fc{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.layoutVertexArray=new Ee,this.centroidVertexArray=new wr,this.indexArray=new Ye,this.programConfigurations=new Ya(e.layers,e.zoom),this.segments=new fi,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.enableTerrain=e.enableTerrain}populate(e,i,r,a){this.features=[],this.hasPattern=Tu("fill-extrusion",this.layers,i),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(c){const u=Math.exp(Math.PI*(1-c.y/(1<<c.z)*2));return 80150034*u/(u*u+1)/Qe/(1<<c.z)}(r),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter;for(const{feature:c,id:u,index:p,sourceLayerIndex:f}of e){const _=this.layers[0]._featureFilter.needGeometry,x=ts(c,_);if(!this.layers[0]._featureFilter.filter(new b(this.zoom),x,r))continue;const w={id:u,sourceLayerIndex:f,index:p,geometry:_?x.geometry:Po(c,r,a),properties:c.properties,type:c.type,patterns:{}},M=this.layoutVertexArray.length;this.hasPattern?this.features.push(Su("fill-extrusion",this.layers,w,this.zoom,i)):this.addFeature(w,w.geometry,p,r,{},i.availableImages,a),i.featureIndex.insert(c,w.geometry,p,f,this.index,M)}this.sortBorders()}addFeatures(e,i,r,a,c){for(const u of this.features){const{geometry:p}=u;this.addFeature(u,p,u.index,i,r,a,c)}this.sortBorders()}update(e,i,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,r,a)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ff),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,Of.members,!0))),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){0!==this.centroidVertexArray.length&&(this.centroidVertexBuffer?this.needsCentroidUpdate&&this.centroidVertexBuffer.updateData(this.centroidVertexArray):this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Rf.members,!0),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,i,r,a,c,u,p){const f=[new Ve(0,0),new Ve(Qe,Qe)],_=p.projection,x="globe"===_.name,w=this.enableTerrain&&!x?new sp:null,M="Polygon"===$f[e.type];x&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Pe);const T=Cu(i,500);for(let j=T.length-1;j>=0;j--){const K=T[j];(0===K.length||(S=K[0]).every(G=>G.x<=0)||S.every(G=>G.x>=Qe)||S.every(G=>G.y<=0)||S.every(G=>G.y>=Qe))&&T.splice(j,1)}var S;let k;if(x)k=mp(T,f,a);else{k=[];for(const j of T)k.push({polygon:j,bounds:f})}const R=M?this.edgeRadius:0;for(const{polygon:j,bounds:K}of k){let G=0,H=0;for(const Q of j)M&&!Q[0].equals(Q[Q.length-1])&&Q.push(Q[0]),H+=M?Q.length-1:Q.length;const ee=this.segments.prepareSegment((M?5:4)*H,this.layoutVertexArray,this.indexArray);if(M){const Q=[],fe=[];G=ee.vertexLength;for(const we of j){let ze,ye;we.length&&we!==j[0]&&fe.push(Q.length/2),ze=we[1].sub(we[0])._perp()._unit();for(let Ce=1;Ce<we.length;Ce++){const Te=we[Ce],Ae=we[Ce===we.length-1?1:Ce+1];let{x:Oe,y:xe}=Te;if(R){ye=Ae.sub(Te)._perp()._unit();const Ue=ze.add(ye)._unit(),Xe=R*Math.min(4,1/(ze.x*Ue.x+ze.y*Ue.y));Oe+=Xe*Ue.x,xe+=Xe*Ue.y,ze=ye}pc(this.layoutVertexArray,Oe,xe,0,0,1,1,0),ee.vertexLength++,Q.push(Te.x,Te.y),x&&mc(this.layoutVertexExtArray,_.projectTilePoint(Oe,xe,a),_.upVector(a,Oe,xe))}}const ue=Eu(Q,fe);for(let we=0;we<ue.length;we+=3)this.indexArray.emplaceBack(G+ue[we],G+ue[we+2],G+ue[we+1]),ee.primitiveLength++}for(const Q of j){w&&Q.length&&w.startRing(Q[0]);let fe,ue,we,ze=Q.length>4&&up(Q[Q.length-2],Q[0],Q[1]),ye=R?Wf(Q[Q.length-2],Q[0],Q[1],R):0;ue=Q[1].sub(Q[0])._perp()._unit();let Ce=!0;for(let Te=1,Ae=0;Te<Q.length;Te++){let Oe=Q[Te-1],xe=Q[Te];const Ue=Q[Te===Q.length-1?1:Te+1];
1if(w&&M&&w.currentPolyCount.top++,hp(xe,Oe,K)){R&&(ue=Ue.sub(xe)._perp()._unit(),Ce=!Ce);continue}w&&w.append(xe,Oe);const Xe=xe.sub(Oe)._perp(),Ge=Xe.x/(Math.abs(Xe.x)+Math.abs(Xe.y)),lt=Xe.y>0?1:0,Be=Oe.dist(xe);if(Ae+Be>32768&&(Ae=0),R){we=Ue.sub(xe)._perp()._unit();let ht=cp(Oe,xe,Ue,lp(ue,we),R);isNaN(ht)&&(ht=0);const tt=xe.sub(Oe)._unit();Oe=Oe.add(tt.mult(ye))._round(),xe=xe.add(tt.mult(-ht))._round(),ye=ht,ue=we}const Je=ee.vertexLength,ct=Q.length>4&&up(Oe,xe,Ue);let St=dp(Ae,ze,Ce);if(pc(this.layoutVertexArray,Oe.x,Oe.y,Ge,lt,0,0,St),pc(this.layoutVertexArray,Oe.x,Oe.y,Ge,lt,0,1,St),Ae+=Be,St=dp(Ae,ct,!Ce),ze=ct,pc(this.layoutVertexArray,xe.x,xe.y,Ge,lt,0,0,St),pc(this.layoutVertexArray,xe.x,xe.y,Ge,lt,0,1,St),ee.vertexLength+=4,this.indexArray.emplaceBack(Je+0,Je+1,Je+2),this.indexArray.emplaceBack(Je+1,Je+3,Je+2),ee.primitiveLength+=2,R){const ht=G+(1===Te?Q.length-2:Te-2),tt=1===Te?G:ht+1;if(this.indexArray.emplaceBack(Je+1,ht,Je+3),this.indexArray.emplaceBack(ht,tt,Je+3),ee.primitiveLength+=2,void 0===fe&&(fe=Je),!hp(Ue,Q[Te],K)){const $t=Te===Q.length-1?fe:ee.vertexLength;this.indexArray.emplaceBack(Je+2,Je+3,$t),this.indexArray.emplaceBack(Je+3,$t+1,$t),this.indexArray.emplaceBack(Je+3,tt,$t+1),ee.primitiveLength+=3}Ce=!Ce}if(x){const ht=this.layoutVertexExtArray,tt=_.projectTilePoint(Oe.x,Oe.y,a),$t=_.projectTilePoint(xe.x,xe.y,a),dt=_.upVector(a,Oe.x,Oe.y),pt=_.upVector(a,xe.x,xe.y);mc(ht,tt,dt),mc(ht,tt,dt),mc(ht,$t,pt),mc(ht,$t,pt)}}M&&(G+=Q.length-1)}}if(w&&w.polyCount.length>0){if(w.borders){w.vertexArrayOffset=this.centroidVertexArray.length;const j=w.borders,K=this.featuresOnBorder.push(w)-1;for(let G=0;G<4;G++)j[G][0]!==Number.MAX_VALUE&&this.borders[G].push(K)}this.encodeCentroid(w.borders?void 0:w.centroid(),w)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,c,u,a)}sortBorders(){for(let e=0;e<4;e++)this.borders[e].sort((i,r)=>this.featuresOnBorder[i].borders[e][0]-this.featuresOnBorder[r].borders[e][0])}encodeCentroid(e,i,r=!0){let a,c;if(e)if(0!==e.y){const p=i.span()._mult(this.tileToMeter);a=(Math.max(e.x,1)<<3)+Math.min(7,Math.round(p.x/10)),c=(Math.max(e.y,1)<<3)+Math.min(7,Math.round(p.y/10))}else a=Math.ceil(7*(e.x+450)),c=0;else a=0,c=+r;let u=r?this.centroidVertexArray.length:i.vertexArrayOffset;for(const p of i.polyCount){r&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*p.edges+p.top);for(let f=0;f<p.top;f++)this.centroidVertexArray.emplace(u++,a,c);for(let f=0;f<2*p.edges;f++)this.centroidVertexArray.emplace(u++,0,c),this.centroidVertexArray.emplace(u++,a,c)}}}function lp(t,e){const i=t.add(e)._unit();return t.x*i.x+t.y*i.y}function Wf(t,e,i,r){const a=e.sub(t)._perp()._unit(),c=i.sub(e)._perp()._unit();return cp(t,e,i,lp(a,c),r)}function cp(t,e,i,r,a){const c=Math.sqrt(1-r*r);return Math.min(t.dist(e)/3,e.dist(i)/3,a*c/r)}function hp(t,e,i){return t.x<i[0].x&&e.x<i[0].x||t.x>i[1].x&&e.x>i[1].x||t.y<i[0].y&&e.y<i[0].y||t.y>i[1].y&&e.y>i[1].y}function up(t,e,i){if(t.x<0||t.x>=Qe||e.x<0||e.x>=Qe||i.x<0||i.x>=Qe)return!1;const r=i.sub(e),a=r.perp(),c=t.sub(e);return(r.x*c.x+r.y*c.y)/Math.sqrt((r.x*r.x+r.y*r.y)*(c.x*c.x+c.y*c.y))>-.866&&a.x*c.x+a.y*c.y<0}function dp(t,e,i){const r=e?2|t:-3&t;return i?1|r:-2&r}function pp(){const t=Math.PI/32,e=Math.tan(t),i=lc;return i*Math.sqrt(1+2*e*e)-i}function mp(t,e,i){const r=1<<i.z,a=jn(i.x/r),c=jn((i.x+1)/r),u=ji(i.y/r),p=ji((i.y+1)/r);return function(f,_,x,w,M=0,T){const S=[];if(!f.length||!x||!w)return S;const k=(Q,fe)=>{for(const ue of Q)S.push({polygon:ue,bounds:fe})},R=Math.ceil(Math.log2(x)),j=Math.ceil(Math.log2(w)),K=R-j,G=[];for(let Q=0;Q<Math.abs(K);Q++)G.push(K>0?0:1);for(let Q=0;Q<Math.min(R,j);Q++)G.push(0),G.push(1);let H=f;if(H=xh(H,_[0].y-M,_[1].y+M,1),H=xh(H,_[0].x-M,_[1].x+M,0),!H.length)return S;const ee=[];for(G.length?ee.push({polygons:H,bounds:_,depth:0}):k(H,_);ee.length;){const Q=ee.pop(),fe=Q.depth,ue=G[fe],we=Q.bounds[0],ze=Q.bounds[1],ye=0===ue?we.x:we.y,Ce=0===ue?ze.x:ze.y,Te=T?T(ue,ye,Ce):.5*(ye+Ce),Ae=xh(Q.polygons,ye-M,Te+M,ue),Oe=xh(Q.polygons,Te-M,Ce+M,ue);if(Ae.length){const xe=[we,new Ve(0===ue?Te:ze.x,1===ue?Te:ze.y)];G.length>fe+1?ee.push({polygons:Ae,bounds:xe,depth:fe+1}):k(Ae,xe)}if(Oe.length){const xe=[new Ve(0===ue?Te:we.x,1===ue?Te:we.y),ze];G.length>fe+1?ee.push({polygons:Oe,bounds:xe,depth:fe+1}):k(Oe,xe)}}return S}(t,e,Math.ceil((c-a)/11.25),Math.ceil((u-p)/11.25),1,(f,_,x)=>{if(0===f)return.5*(_+x);{const w=ji((i.y+_/Qe)/r);return(eo(.5*(ji((i.y+x/Qe)/r)+w))*r-i.y)*Qe}})}qe(fc,"FillExtrusionBucket",{omit:["layers","features"]}),qe(sp,"PartMetadata");
1const Xf=new W({"fill-extrusion-edge-radius":new D(be["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var Yf={paint:new W({"fill-extrusion-opacity":new D(be["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new F(be["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new D(be["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new D(be["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new F(be["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new F(be["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new F(be["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new D(be["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new D(be["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new D(be["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new D(be["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:Xf};function fp(t,e,i){var r=2*Math.PI*6378137/256/Math.pow(2,i);return[t*r-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}class bh{constructor(e,i,r){this.z=e,this.x=i,this.y=r,this.key=gc(0,e,e,i,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,i){const r=(u=this.y,p=this.z,f=fp(256*(c=this.x),256*(u=Math.pow(2,p)-u-1),p),_=fp(256*(c+1),256*(u+1),p),f[0]+","+f[1]+","+_[0]+","+_[1]),a=function(c,u,p){let f,_="";for(let x=c;x>0;x--)f=1<<x-1,_+=(u&f?1:0)+(p&f?2:0);return _}(this.z,this.x,this.y);var c,u,p,f,_;return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===i?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",a).replace("{bbox-epsg-3857}",r)}toString(){return`${this.z}/${this.x}/${this.y}`}}class gp{constructor(e,i){this.wrap=e,this.canonical=i,this.key=gc(e,i.z,i.z,i.x,i.y)}}class ln{constructor(e,i,r,a,c){this.overscaledZ=e,this.wrap=i,this.canonical=new bh(r,+a,+c),this.key=0===i&&e===r?this.canonical.key:gc(i,e,r,a,c)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const i=this.canonical.z-e;return e>this.canonical.z?new ln(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ln(e,this.wrap,e,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(e,i=!0){if(this.overscaledZ===e&&i)return this.key;if(e>this.canonical.z)return gc(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y);{const r=this.canonical.z-e;return gc(this.wrap*+i,e,e,this.canonical.x>>r,this.canonical.y>>r)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const i=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>i&&e.canonical.y===this.canonical.y>>i}children(e){if(this.overscaledZ>=e)return[new ln(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,r=2*this.canonical.x,a=2*this.canonical.y;return[new ln(i,this.wrap,i,r,a),new ln(i,this.wrap,i,r+1,a),new ln(i,this.wrap,i,r,a+1),new ln(i,this.wrap,i,r+1,a+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new ln(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new ln(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new gp(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function gc(t,e,i,r,a){const c=1<<Math.min(i,22);let u=c*(a%c)+r%c;return t&&i<22&&(u+=c*c*((t<0?-2*t-1:2*t)%(1<<2*(22-i)))),16*(32*u+i)+(e-i)}qe(bh,"CanonicalTileID"),qe(ln,"OverscaledTileID",{omit:["projMatrix"]});class ll extends Ve{constructor(e,i,r){super(e,i),this.z=r}}function _c(t,e){return t.x*e.x+t.y*e.y}function _p(t,e){if(1===t.length){let i=0;const r=e[i++];let a;for(;!a||r.equals(a);)if(a=e[i++],!a)return 1/0;for(;i<e.length;i++){const c=e[i],u=t[0],p=a.sub(r),f=c.sub(r),_=u.sub(r),x=_c(p,p),w=_c(p,f),M=_c(f,f),T=_c(_,p),S=_c(_,f),k=x*M-w*w,R=(M*T-w*S)/k,j=(x*S-w*T)/k,K=r.z*(1-R-j)+a.z*R+c.z*j;if(isFinite(K))return K}return 1/0}{let i=1/0;for(const r of e)i=Math.min(i,r.z);return i}}function yp(t,e,i,r,a,c,u,p){const f=u*a.getElevationAt(t,e,!0,!0),_=0!==c[0],x=_?0===c[1]?u*(c[0]/7-450):u*function(w,M,T){const S=Math.floor(M[0]/8),k=Math.floor(M[1]/8),R=10*(M[0]-8*S),j=10*(M[1]-8*k),K=w.getElevationAt(S,k,!0,!0),G=w.getMeterToDEM(T),H=Math.floor(.5*(R*G-1)),ee=Math.floor(.5*(j*G-1)),Q=w.tileCoordToPixel(S,k),fe=2*H+1,ue=2*ee+1,we=(Xe=fe,Ge=ue,[(Oe=w).getElevationAtPixel(xe=Q.x-H,Ue=Q.y-ee,!0),Oe.getElevationAtPixel(xe+Ge,Ue,!0),Oe.getElevationAtPixel(xe,Ue+Ge,!0),Oe.getElevationAtPixel(xe+Xe,Ue+Ge,!0)]),ze=Math.abs(we[0]-we[1]),ye=Math.abs(we[2]-we[3]),Ce=Math.abs(we[0]-we[2])+Math.abs(we[1]-we[3]),Te=Math.min(.25,.5*G*(ze+ye)/fe),Ae=Math.min(.25,.5*G*Ce/ue);var Oe,xe,Ue,Xe,Ge;return K+Math.max(Te*R,Ae*j)}(a,c,p):f;return{base:f+(0===i)?-1:i,top:_?Math.max(x+r,f+i+2):f+r}}const Hf=ae([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:Kf}=Hf,Jf=ae([{name:"a_packed",components:4,type:"Float32"}]),{members:Qf}=Jf,eg=vh.types,tg=Math.cos(Math.PI/180*37.5);class wh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={}
1,this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new _e,this.layoutVertexArray2=new De,this.indexArray=new Ye,this.programConfigurations=new Ya(e.layers,e.zoom),this.segments=new fi,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,r,a){this.hasPattern=Tu("line",this.layers,i);const c=this.layers[0].layout.get("line-sort-key"),u=[];for(const{feature:x,id:w,index:M,sourceLayerIndex:T}of e){const S=this.layers[0]._featureFilter.needGeometry,k=ts(x,S);if(!this.layers[0]._featureFilter.filter(new b(this.zoom),k,r))continue;const R=c?c.evaluate(k,{},r):void 0,j={id:w,properties:x.properties,type:x.type,sourceLayerIndex:T,index:M,geometry:S?k.geometry:Po(x,r,a),patterns:{},sortKey:R};u.push(j)}c&&u.sort((x,w)=>x.sortKey-w.sortKey);const{lineAtlas:p,featureIndex:f}=i,_=this.addConstantDashes(p);for(const x of u){const{geometry:w,index:M,sourceLayerIndex:T}=x;if(_&&this.addFeatureDashes(x,p),this.hasPattern){const S=Su("line",this.layers,x,this.zoom,i);this.patternFeatures.push(S)}else this.addFeature(x,w,M,r,p.positions,i.availableImages);f.insert(e[M].feature,w,M,T,this.index)}}addConstantDashes(e){let i=!1;for(const r of this.layers){const a=r.paint.get("line-dasharray").value,c=r.layout.get("line-cap").value;if("constant"!==a.kind||"constant"!==c.kind)i=!0;else{const u=c.value,p=a.value;if(!p)continue;e.addDash(p,u)}}return i}addFeatureDashes(e,i){const r=this.zoom;for(const a of this.layers){const c=a.paint.get("line-dasharray").value,u=a.layout.get("line-cap").value;if("constant"===c.kind&&"constant"===u.kind)continue;let p,f;if("constant"===c.kind){if(p=c.value,!p)continue}else p=c.evaluate({zoom:r},e);f="constant"===u.kind?u.value:u.evaluate({zoom:r},e),i.addDash(p,f),e.patterns[a.id]=i.getKey(p,f)}}update(e,i,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,r,a)}addFeatures(e,i,r,a,c){for(const u of this.patternFeatures)this.addFeature(u,u.geometry,u.index,i,r,a)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Qf)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Kf),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,i,r,a,c,u){const p=this.layers[0].layout,f=p.get("line-join").evaluate(e,{}),_=p.get("line-cap").evaluate(e,{}),x=p.get("line-miter-limit"),w=p.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const M of i)this.addLine(M,e,f,_,x,w);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,c,u,a)}addLine(e,i,r,a,c,u){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let j=0;j<e.length-1;j++)this.totalDistance+=e[j].dist(e[j+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const p="Polygon"===eg[i.type];let f=e.length;for(;f>=2&&e[f-1].equals(e[f-2]);)f--;let _=0;for(;_<f-1&&e[_].equals(e[_+1]);)_++;if(f<(p?3:2))return;"bevel"===r&&(c=1.05);const x=this.overscaling<=16?15*Qe/(512*this.overscaling):0,w=this.segments.prepareSegment(10*f,this.layoutVertexArray,this.indexArray);let M,T,S,k,R;this.e1=this.e2=-1,p&&(M=e[f-2],R=e[_].sub(M)._unit()._perp());for(let j=_;j<f;j++){if(S=j===f-1?p?e[_+1]:void 0:e[j+1],S&&e[j].equals(S))continue;R&&(k=R),M&&(T=M),M=e[j],R=S?S.sub(M)._unit()._perp():k,k=k||R;let K=k.add(R);0===K.x&&0===K.y||K._unit();
vendor: 10,783 bytes, line 1
1const G=k.x*R.x+k.y*R.y,H=K.x*R.x+K.y*R.y,ee=0!==H?1/H:1/0,Q=2*Math.sqrt(2-2*H),fe=H<tg&&T&&S,ue=k.x*R.y-k.y*R.x>0;if(fe&&j>_){const ye=M.dist(T);if(ye>2*x){const Ce=M.sub(M.sub(T)._mult(x/ye)._round());this.updateDistance(T,Ce),this.addCurrentVertex(Ce,k,0,0,w),T=Ce}}const we=T&&S;let ze=we?r:p?"butt":a;if(we&&"round"===ze&&(ee<u?ze="miter":ee<=2&&(ze="fakeround")),"miter"===ze&&ee>c&&(ze="bevel"),"bevel"===ze&&(ee>2&&(ze="flipbevel"),ee<c&&(ze="miter")),T&&this.updateDistance(T,M),"miter"===ze)K._mult(ee),this.addCurrentVertex(M,K,0,0,w);else if("flipbevel"===ze){if(ee>100)K=R.mult(-1);else{const ye=ee*k.add(R).mag()/k.sub(R).mag();K._perp()._mult(ye*(ue?-1:1))}this.addCurrentVertex(M,K,0,0,w),this.addCurrentVertex(M,K.mult(-1),0,0,w)}else if("bevel"===ze||"fakeround"===ze){const ye=-Math.sqrt(ee*ee-1),Ce=ue?ye:0,Te=ue?0:ye;if(T&&this.addCurrentVertex(M,k,Ce,Te,w),"fakeround"===ze){const Ae=Math.round(180*Q/Math.PI/20);for(let Oe=1;Oe<Ae;Oe++){let xe=Oe/Ae;if(.5!==xe){const Xe=xe-.5;xe+=xe*Xe*(xe-1)*((1.0904+G*(G*(3.55645-1.43519*G)-3.2452))*Xe*Xe+(.848013+G*(.215638*G-1.06021)))}const Ue=R.sub(k)._mult(xe)._add(k)._unit()._mult(ue?-1:1);this.addHalfVertex(M,Ue.x,Ue.y,!1,ue,0,w)}}S&&this.addCurrentVertex(M,R,-Ce,-Te,w)}else if("butt"===ze)this.addCurrentVertex(M,K,0,0,w);else if("square"===ze){const ye=T?1:-1;T||this.addCurrentVertex(M,K,ye,ye,w),this.addCurrentVertex(M,K,0,0,w),T&&this.addCurrentVertex(M,K,ye,ye,w)}else"round"===ze&&(T&&(this.addCurrentVertex(M,k,0,0,w),this.addCurrentVertex(M,k,1,1,w,!0)),S&&(this.addCurrentVertex(M,R,-1,-1,w,!0),this.addCurrentVertex(M,R,0,0,w)));if(fe&&j<f-1){const ye=M.dist(S);if(ye>2*x){const Ce=M.add(S.sub(M)._mult(x/ye)._round());this.updateDistance(M,Ce),this.addCurrentVertex(Ce,R,0,0,w),M=Ce}}}}addCurrentVertex(e,i,r,a,c,u=!1){const p=i.y*a-i.x,f=-i.y-i.x*a;this.addHalfVertex(e,i.x+i.y*r,i.y-i.x*r,u,!1,r,c),this.addHalfVertex(e,p,f,u,!0,-a,c)}addHalfVertex({x:e,y:i},r,a,c,u,p,f){this.layoutVertexArray.emplaceBack((e<<1)+(c?1:0),(i<<1)+(u?1:0),Math.round(63*r)+128,Math.round(63*a)+128,1+(0===p?0:p<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const _=f.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,_),f.primitiveLength++),u?this.e2=_:this.e1=_}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,i){this.distance+=e.dist(i),this.updateScaledDistance()}}qe(wh,"LineBucket",{omit:["layers","patternFeatures"]});const ig=new W({"line-cap":new F(be.layout_line["line-cap"]),"line-join":new F(be.layout_line["line-join"]),"line-miter-limit":new D(be.layout_line["line-miter-limit"]),"line-round-limit":new D(be.layout_line["line-round-limit"]),"line-sort-key":new F(be.layout_line["line-sort-key"])});var vp={paint:new W({"line-opacity":new F(be.paint_line["line-opacity"]),"line-color":new F(be.paint_line["line-color"]),"line-translate":new D(be.paint_line["line-translate"]),"line-translate-anchor":new D(be.paint_line["line-translate-anchor"]),"line-width":new F(be.paint_line["line-width"]),"line-gap-width":new F(be.paint_line["line-gap-width"]),"line-offset":new F(be.paint_line["line-offset"]),"line-blur":new F(be.paint_line["line-blur"]),"line-dasharray":new F(be.paint_line["line-dasharray"]),"line-pattern":new F(be.paint_line["line-pattern"]),"line-gradient":new $(be.paint_line["line-gradient"]),"line-trim-offset":new D(be.paint_line["line-trim-offset"])}),layout:ig};const xp=new class extends F{possiblyEvaluate(t,e){return e=new b(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,r){return e=ni({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,r)}}(vp.paint.properties["line-width"].specification);function bp(t,e){return e>0?e+2*t:t}xp.useIntegerZoom=!0;const ng=ae([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),rg=ae([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),og=ae([{name:"a_projected_pos",components:4,type:"Float32"}],4);ae([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const ag=ae([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),sg=ae([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);ae([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const wp=ae([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),lg=ae([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);ae([{name:"triangle",components:3,type:"Uint16"}]),ae([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),ae([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ae([{type:"Float32",name:"offsetX"}]),ae([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);const Ar=128;function Iu(t,e){const{expression:i}=e;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new b(t+1))};if("source"===i.kind)return{kind:"source"};{const{zoomStops:r,interpolationType:a}=i;let c=0;for(;c<r.length&&r[c]<=t;)c++;c=Math.max(0,c-1);let u=c;for(;u<r.length&&r[u]<t+1;)u++;u=Math.min(r.length-1,u);const p=r[c],f=r[u];return"composite"===i.kind?{kind:"composite",minZoom:p,maxZoom:f,interpolationType:a}:{kind:"camera",minZoom:p,maxZoom:f,minSize:i.evaluate(new b(p)),maxSize:i.evaluate(new b(f)),interpolationType:a}}}function Mh(t,{uSize:e,uSizeT:i},{lowerSize:r,upperSize:a}){return"source"===t.kind?r/Ar:"composite"===t.kind?Ct(r/Ar,a/Ar,i):e}function cl(t,e){let i=0,r=0;if("constant"===t.kind)r=t.layoutSize;else if("source"!==t.kind){const{interpolationType:a,minZoom:c,maxZoom:u}=t,p=a?rt(Fn.interpolationFactor(a,e,c,u),0,1):0;"camera"===t.kind?r=Ct(t.minSize,t.maxSize,p):i=p}return{uSizeT:i,uSize:r}}var cg=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:Ar,evaluateSizeForFeature:Mh,evaluateSizeForZoom:cl,getSizeData:Iu});function hg(t,e,i){return t.sections.forEach(r=>{r.text=function(a,c,u){const p=c.layout.get("text-transform").evaluate(u,{});return"uppercase"===p?a=a.toLocaleUpperCase():"lowercase"===p&&(a=a.toLocaleLowerCase()),v.applyArabicShaping&&(a=v.applyArabicShaping(a)),a}(r.text,e,i)}),t}const yc={"!":"\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","\u2190":"\u2191","\u2192":"\u2193"};function ug(t){return"\ufe36"===t||"\ufe48"===t||"\ufe38"===t||"\ufe44"===t||"\ufe42"===t||"\ufe3e"===t||"\ufe3c"===t||"\ufe3a"===t||"\ufe18"===t||"\ufe40"===t||"\ufe10"===t||"\ufe13"===t||"\ufe14"===t||"\uff40"===t||"\uffe3"===t||"\ufe11"===t||"\ufe12"===t}function dg(t){return"\ufe35"===t||"\ufe47"===t||"\ufe37"===t||"\ufe43"===t||"\ufe41"===t||"\ufe3d"===t||"\ufe3b"===t||"\ufe39"===t||"\ufe17"===t||"\ufe3f"===t}
vendor: 4,444 bytes, line 1
1var Mp=Ut,Ep=function(t,e,i,r,a){var c,u,p=8*a-r-1,f=(1<<p)-1,_=f>>1,x=-7,w=i?a-1:0,M=i?-1:1,T=t[e+w];for(w+=M,c=T&(1<<-x)-1,T>>=-x,x+=p;x>0;c=256*c+t[e+w],w+=M,x-=8);for(u=c&(1<<-x)-1,c>>=-x,x+=r;x>0;u=256*u+t[e+w],w+=M,x-=8);if(0===c)c=1-_;else{if(c===f)return u?NaN:1/0*(T?-1:1);u+=Math.pow(2,r),c-=_}return(T?-1:1)*u*Math.pow(2,c-r)},Cp=function(t,e,i,r,a,c){var u,p,f,_=8*c-a-1,x=(1<<_)-1,w=x>>1,M=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,T=r?0:c-1,S=r?1:-1,k=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(p=isNaN(e)?1:0,u=x):(u=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-u))<1&&(u--,f*=2),(e+=u+w>=1?M/f:M*Math.pow(2,1-w))*f>=2&&(u++,f/=2),u+w>=x?(p=0,u=x):u+w>=1?(p=(e*f-1)*Math.pow(2,a),u+=w):(p=e*Math.pow(2,w-1)*Math.pow(2,a),u=0));a>=8;t[i+T]=255&p,T+=S,p/=256,a-=8);for(u=u<<a|p,_+=a;_>0;t[i+T]=255&u,T+=S,u/=256,_-=8);t[i+T-S]|=128*k};function Ut(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ut.Varint=0,Ut.Fixed64=1,Ut.Bytes=2,Ut.Fixed32=5;var Du=4294967296,Tp=1/Du,Sp="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Ro(t){return t.type===Ut.Bytes?t.readVarint()+t.pos:t.pos+1}function Ap(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var a=i.pos-1;a>=t;a--)i.buf[a+r]=i.buf[a]}function pg(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function mg(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function fg(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function gg(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function _g(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function yg(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function vg(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function xg(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function bg(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Eh(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function ul(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Ip(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Ut.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),a=r>>3,c=this.pos;this.type=7&r,t(a,e,this),this.pos===c&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Eh(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ip(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Eh(this.buf,this.pos)+Eh(this.buf,this.pos+4)*Du;return this.pos+=8,t},readSFixed64:function(){var t=Eh(this.buf,this.pos)+Ip(this.buf,this.pos+4)*Du;return this.pos+=8,t},readFloat:function(){var t=Ep(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ep(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,r=this.buf;return e=127&(i=r[this.pos++]),i<128?e:(e|=(127&(i=r[this.pos++]))<<7,i<128?e:(e|=(127&(i=r[this.pos++]))<<14,i<128?e:(e|=(127&(i=r[this.pos++]))<<21,i<128?e:function(a,c,u){var p,f,_=u.buf;if(p=(112&(f=_[u.pos++]))>>4,f<128||(p|=(127&(f=_[u.pos++]))<<3,f<128)||(p|=(127&(f=_[u.pos++]))<<10,f<128)||(p|=(127&(f=_[u.pos++]))<<17,f<128)||(p|=(127&(f=_[u.pos++]))<<24,f<128)||(p|=(1&(f=_[u.pos++]))<<31,f<128))return function hl(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}(a,p,c);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Sp?Sp.decode(this.buf.subarray(e,t)):function(i,r,a){for(var c="",u=r;u<a;){var p,f,_,x=i[u],w=null,M=x>239?4:x>223?3:x>191?2:1;if(u+M>a)break;1===M?x<128&&(w=x):2===M?128==(192&(p=i[u+1]))&&(w=(31&x)<<6|63&p)<=127&&(w=null):3===M?(f=i[u+2],128==(192&(p=i[u+1]))&&128==(192&f)&&((w=(15&x)<<12|(63&p)<<6|63&f)<=2047||w>=55296&&w<=57343)&&(w=null)):4===M&&(f=i[u+2],_=i[u+3],128==(192&(p=i[u+1]))&&128==(192&f)&&128==(192&_)&&((w=(15&x)<<18|(63&p)<<12|(63&f)<<6|63&_)<=65535||w>=1114112)&&(w=null)),null===w?(w=65533,M=1):w>65535&&(w-=65536,c+=String.fromCharCode(w>>>
vendor: 9,529 bytes, line 1
110&1023|55296),w=56320|1023&w),c+=String.fromCharCode(w),u+=M}return c}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Ut.Bytes)return t.push(this.readVarint(e));var i=Ro(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Ut.Bytes)return t.push(this.readSVarint());var e=Ro(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Ut.Bytes)return t.push(this.readBoolean());var e=Ro(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Ut.Bytes)return t.push(this.readFloat());var e=Ro(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Ut.Bytes)return t.push(this.readDouble());var e=Ro(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Ut.Bytes)return t.push(this.readFixed32());var e=Ro(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Ut.Bytes)return t.push(this.readSFixed32());var e=Ro(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Ut.Bytes)return t.push(this.readFixed64());var e=Ro(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Ut.Bytes)return t.push(this.readSFixed64());var e=Ro(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Ut.Varint)for(;this.buf[this.pos++]>127;);else if(e===Ut.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ut.Fixed32)this.pos+=4;else{if(e!==Ut.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),ul(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ul(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ul(this.buf,-1&t,this.pos),ul(this.buf,Math.floor(t*Tp),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ul(this.buf,-1&t,this.pos),ul(this.buf,Math.floor(t*Tp),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(e,i){var r,a,c,p;if(e>=0?(r=e%4294967296|0,a=e/4294967296|0):(a=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,a=a+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),c=r,(p=i).buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,p.buf[p.pos]=127&(c>>>=7),function(c,u){var p=(7&c)<<4;u.buf[u.pos++]|=p|((c>>>=3)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c)))))}(a,i)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(r,a,c){for(var u,p,f=0;f<a.length;f++){if((u=a.charCodeAt(f))>55295&&u<57344){if(!p){u>56319||f+1===a.length?(r[c++]=239,r[c++]=191,r[c++]=189):p=u;continue}if(u<56320){r[c++]=239,r[c++]=191,r[c++]=189,p=u;continue}u=p-55296<<10|u-56320|65536,p=null}else p&&(r[c++]=239,r[c++]=191,r[c++]=189,p=null);u<128?r[c++]=u:(u<2048?r[c++]=u>>6|192:(u<65536?r[c++]=u>>12|224:(r[c++]=u>>18|240,r[c++]=u>>12&63|128),r[c++]=u>>6&63|128),r[c++]=63&u|128)}return c}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Ap(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Cp(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Cp(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var r=this.pos-i;r>=128&&Ap(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,i){this.writeTag(t,Ut.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,pg,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,mg,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,_g,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,fg,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,gg,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,yg,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,vg,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,xg,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,bg,e)},writeBytesField:function(t,e){this.writeTag(t,Ut.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Ut.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Ut.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Ut.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Ut.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Ut.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Ut.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Ut.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Ut.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Ut.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ch=li(Mp);function wg(t,e,i){e.glyphs=[],1===t&&i.readMessage(Mg,e)}function Mg(t,e,i){if(3===t){const{id:r,bitmap:a,width:c,height:u,left:p,top:f,advance:_}=i.readMessage(Eg,{});e.glyphs.push({id:r,bitmap:new Lo({width:c+6,height:u+6},a),metrics:{width:c,height:u,left:p,top:f,advance:_}})}else 4===t?e.ascender=i.readSVarint():5===t&&(e.descender=i.readSVarint())}function Eg(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}function zu(t){let e=0,i=0;for(const u of t)e+=u.w*u.h,i=Math.max(i,u.w);t.sort((u,p)=>p.h-u.h);const r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let a=0,c=0;for(const u of t)for(let p=r.length-1;p>=0;p--){const f=r[p];if(!(u.w>f.w||u.h>f.h)){if(u.x=f.x,u.y=f.y,c=Math.max(c,u.y+u.h),a=Math.max(a,u.x+u.w),u.w===f.w&&u.h===f.h){const _=r.pop();p<r.length&&(r[p]=_)}else u.h===f.h?(f.x+=u.w,f.w-=u.w):u.w===f.w?(f.y+=u.h,f.h-=u.h):(r.push({x:f.x+u.w,y:f.y,w:f.w-u.w,h:u.h}),f.y+=u.h,f.h-=u.h);break}}return{w:a,h:c,fill:e/(a*c)||0}}class Pu{constructor(e,{pixelRatio:i,version:r,stretchX:a,stretchY:c,content:u}){this.paddedRect=e,this.pixelRatio=i,this.stretchX=a,this.stretchY=c,this.content=u,this.version=r}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class kp{constructor(e,i){const r={},a={};this.haveRenderCallbacks=[];const c=[];this.addImages(e,r,c),this.addImages(i,a,c);const{w:u,h:p}=zu(c),f=new Cn({width:u||1,height:p||1});for(const _ in e){const x=e[_],w=r[_].paddedRect;Cn.copy(x.data,f,{x:0,y:0},{x:w.x+1,y:w.y+1},x.data)}for(const _ in i){const x=i[_],w=a[_].paddedRect,M=w.x+1,T=w.y+1,S=x.data.width,k=x.data.height;Cn.copy(x.data,f,{x:0,y:0},{x:M,y:T},x.data),Cn.copy(x.data,f,{x:0,y:k-1},{x:M,y:T-1},{width:S,height:1}),Cn.copy(x.data,f,{x:0,y:0},{x:M,y:T+k},{width:S,height:1}),Cn.copy(x.data,f,{x:S-1,y:0},{x:M-1,y:T},{width:1,height:k}),Cn.copy(x.data,f,{x:0,y:0},{x:M+S,y:T},{width:1,height:k})}this.image=f,this.iconPositions=r,this.patternPositions=a}addImages(e,i,r){for(const a in e){const c=e[a],u={x:0,y:0,w:c.data.width+2,h:c.data.height+2};r.push(u),i[a]=new Pu(u,c),c.hasRenderCallback&&this.haveRenderCallbacks.push(a)}}patchUpdatedImages(e,i){this.haveRenderCallbacks=this.haveRenderCallbacks.filter(r=>e.hasImage(r)),e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const r in e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),i),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),i)}patchUpdatedImage(e,i,r){if(!e||!i||e.version===i.version)return;e.version=i.version;const[a,c]=e.tl;r.update(i.data,void 0,{x:a,y:c})}}qe(Pu,"ImagePosition"),qe(kp,"ImageAtlas");const Gn={horizontal:1,vertical:2,horizontalOnly:3};class vc{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,i){const r=new vc;return r.scale=e||1,r.fontStack=i,r}
1static forImage(e){const i=new vc;return i.imageName=e,i}}class dl{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,i){const r=new dl;for(let a=0;a<e.sections.length;a++){const c=e.sections[a];c.image?r.addImageSection(c):r.addTextSection(c,i)}return r}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSections(){return this.sections}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(e){this.text=function(i,r){let a="";for(let c=0;c<i.length;c++){const u=i.charCodeAt(c+1)||null,p=i.charCodeAt(c-1)||null;a+=!r&&(u&&eh(u)&&!yc[i[c+1]]||p&&eh(p)&&!yc[i[c-1]])||!yc[i[c]]?i[c]:yc[i[c]]}return a}(this.text,e)}trim(){let e=0;for(let r=0;r<this.text.length&&Th[this.text.charCodeAt(r)];r++)e++;let i=this.text.length;for(let r=this.text.length-1;r>=0&&r>=e&&Th[this.text.charCodeAt(r)];r--)i--;this.text=this.text.substring(e,i),this.sectionIndex=this.sectionIndex.slice(e,i)}substring(e,i){const r=new dl;return r.text=this.text.substring(e,i),r.sectionIndex=this.sectionIndex.slice(e,i),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,i)=>Math.max(e,this.sections[i].scale),0)}addTextSection(e,i){this.text+=e.text,this.sections.push(vc.forText(e.scale,e.fontStack||i));const r=this.sections.length-1;for(let a=0;a<e.text.length;++a)this.sectionIndex.push(r)}addImageSection(e){const i=e.image?e.image.name:"";if(0===i.length)return void Ht("Can't add FormattedSection with an empty image.");const r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(vc.forImage(i)),this.sectionIndex.push(this.sections.length-1)):Ht("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Lu(t,e,i,r,a,c,u,p,f,_,x,w,M,T,S){const k=dl.fromFeature(t,a);w===Gn.vertical&&k.verticalizePunctuation(M);let R=[];const j=function(Q,fe,ue,we,ze,ye){if(!Q)return[];const Ce=[],Te=function(Ue,Xe,Ge,lt,Be,Je){let ct=0;for(let St=0;St<Ue.length();St++){const ht=Ue.getSection(St);ct+=Pp(Ue.getCharCode(St),ht,lt,Be,Xe,Je)}return ct/Math.max(1,Math.ceil(ct/Ge))}(Q,fe,ue,we,ze,ye),Ae=Q.text.indexOf("\u200b")>=0;let Oe=0;for(let Ue=0;Ue<Q.length();Ue++){const Xe=Q.getSection(Ue),Ge=Q.getCharCode(Ue);if(Th[Ge]||(Oe+=Pp(Ge,Xe,we,ze,fe,ye)),Ue<Q.length()-1){const lt=!((xe=Ge)<11904||!(Ze_Bopomofo_Extended(xe)||Ze_Bopomofo(xe)||Ze_CJK_Compatibility_Forms(xe)||Ze_CJK_Compatibility_Ideographs(xe)||Ze_CJK_Compatibility(xe)||Ze_CJK_Radicals_Supplement(xe)||Ze_CJK_Strokes(xe)||Ze_CJK_Symbols_and_Punctuation(xe)||Ze_CJK_Unified_Ideographs_Extension_A(xe)||Ze_CJK_Unified_Ideographs(xe)||Ze_Enclosed_CJK_Letters_and_Months(xe)||Ze_Halfwidth_and_Fullwidth_Forms(xe)||Ze_Hiragana(xe)||Ze_Ideographic_Description_Characters(xe)||Ze_Kangxi_Radicals(xe)||Ze_Katakana_Phonetic_Extensions(xe)||Ze_Katakana(xe)||Ze_Vertical_Forms(xe)||Ze_Yi_Radicals(xe)||Ze_Yi_Syllables(xe)));(Cg[Ge]||lt||Xe.imageName)&&Ce.push(Rp(Ue+1,Oe,Te,Ce,Tg(Ge,Q.getCharCode(Ue+1),lt&&Ae),!1))}}var xe;return Op(Rp(Q.length(),Oe,Te,Ce,0,!0))}(k,_,c,e,r,T),{processBidirectionalText:K,processStyledBidirectionalText:G}=v;if(K&&1===k.sections.length){const Q=K(k.toString(),j);for(const fe of Q){const ue=new dl;ue.text=fe,ue.sections=k.sections;for(let we=0;we<fe.length;we++)ue.sectionIndex.push(0);R.push(ue)}}else if(G){const Q=G(k.text,k.sectionIndex,j);for(const fe of Q){const ue=new dl;ue.text=fe[0],ue.sectionIndex=fe[1],ue.sections=k.sections,R.push(ue)}}else R=function(Q,fe){const ue=[],we=Q.text;let ze=0;for(const ye of fe)ue.push(Q.substring(ze,ye)),ze=ye;return ze<we.length&&ue.push(Q.substring(ze,we.length)),ue}(k,j);const H=[],ee={positionedLines:H,text:k.toString(),top:x[1],bottom:x[1],left:x[0],right:x[0],writingMode:w,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(Q,fe,ue,we,ze,ye,Ce,Te,Ae,Oe,xe,Ue){let Xe=0,Ge=0,lt=0;const Be="right"===Te?1:"left"===Te?0:.5;let Je=!1;for(const dt of ze){const pt=dt.getSections();for(const Bt of pt){if(Bt.imageName)continue;const jt=fe[Bt.fontStack];if(jt&&(Je=void 0!==jt.ascender&&void 0!==jt.descender,!Je))break}if(!Je)break}let ct=0;for(const dt of ze){dt.trim();const pt=dt.getMaxScale(),Bt=24*(pt-1),jt={positionedGlyphs:[],lineOffset:0};Q.positionedLines[ct]=jt;const Gt=jt.positionedGlyphs;let Nt=0;if(!dt.length()){Ge+=ye,++ct;continue}let ei=0,si=0;for(let Vt=0;Vt<dt.length();Vt++){const Ei=dt.getSection(Vt),yi=dt.getSectionIndex(Vt),ii=dt.getCharCode(Vt);let kt=Ei.scale,vi=null,Zt=null,cn=null,xi=24,Oi=0;const zi=!(Ae===Gn.horizontal||!xe&&!ql(ii)||xe&&(Th[ii]||(St=ii,Ze_Arabic(St)||Ze_Arabic_Supplement(St)||Ze_Arabic_Extended_A(St)||Ze_Arabic_Presentation_Forms_A(St)||Ze_Arabic_Presentation_Forms_B(St))));if(Ei.imageName){const hn=we[Ei.imageName];if(!hn)continue;cn=Ei.imageName,Q.iconsInText=Q.iconsInText||!0,Zt=hn.paddedRect;const Pi=hn.displaySize;kt=24*kt/Ue,vi={width:Pi[0],height:Pi[1],left:1,top:-3,advance:zi?Pi[1]:Pi[0],localGlyph:!1},Oi=Je?-vi.height*kt:24*pt-17-Pi[1]*kt,xi=vi.advance;const kr=(zi?Pi[0]:Pi[1])*kt-24*pt;kr>0&&kr>Nt&&(Nt=kr)}else{const hn=ue[Ei.fontStack];if(!hn)continue;hn[ii]&&(Zt=hn[ii]);const Pi=fe[Ei.fontStack];if(!Pi)continue;
vendor: 26,303 bytes, line 1
1const kr=Pi.glyphs[ii];if(!kr)continue;if(vi=kr.metrics,xi=8203!==ii?24:0,Je){const vl=void 0!==Pi.ascender?Math.abs(Pi.ascender):0,Ic=void 0!==Pi.descender?Math.abs(Pi.descender):0,Dc=(vl+Ic)*kt;ei<Dc&&(ei=Dc,si=(vl-Ic)/2*kt),Oi=-vl*kt}else Oi=24*(pt-kt)-17}zi?(Q.verticalizable=!0,Gt.push({glyph:ii,imageName:cn,x:Xe,y:Ge+Oi,vertical:zi,scale:kt,localGlyph:vi.localGlyph,fontStack:Ei.fontStack,sectionIndex:yi,metrics:vi,rect:Zt}),Xe+=xi*kt+Oe):(Gt.push({glyph:ii,imageName:cn,x:Xe,y:Ge+Oi,vertical:zi,scale:kt,localGlyph:vi.localGlyph,fontStack:Ei.fontStack,sectionIndex:yi,metrics:vi,rect:Zt}),Xe+=vi.advance*kt+Oe)}0!==Gt.length&&(lt=Math.max(Xe-Oe,lt),Je?Fp(Gt,Be,Nt,si,ye*pt/2):Fp(Gt,Be,Nt,0,ye/2)),Xe=0;const _i=ye*pt+Nt;jt.lineOffset=Math.max(Nt,Bt),Ge+=_i,++ct}var St;const ht=Ge,{horizontalAlign:tt,verticalAlign:$t}=Ru(Ce);(function(dt,pt,Bt,jt,Gt,Nt){const ei=(pt-Bt)*Gt,si=-Nt*jt;for(const _i of dt)for(const Vt of _i.positionedGlyphs)Vt.x+=ei,Vt.y+=si})(Q.positionedLines,Be,tt,$t,lt,ht),Q.top+=-$t*ht,Q.bottom=Q.top+ht,Q.left+=-tt*lt,Q.right=Q.left+lt,Q.hasBaseline=Je}(ee,e,i,r,R,u,p,f,w,_,M,S),!function(Q){for(const fe of Q)if(0!==fe.positionedGlyphs.length)return!1;return!0}(H)&&ee}const Th={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Cg={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Pp(t,e,i,r,a,c){if(e.imageName){const u=r[e.imageName];return u?u.displaySize[0]*e.scale*24/c+a:0}{const u=i[e.fontStack],p=u&&u.glyphs[t];return p?p.metrics.advance*e.scale+a:0}}function Lp(t,e,i,r){const a=Math.pow(t-e,2);return r?t<e?a/2:2*a:a+Math.abs(i)*i}function Tg(t,e,i){let r=0;return 10===t&&(r-=1e4),i&&(r+=150),40!==t&&65288!==t||(r+=50),41!==e&&65289!==e||(r+=50),r}function Rp(t,e,i,r,a,c){let u=null,p=Lp(e,i,a,c);for(const f of r){const _=Lp(e-f.x,i,a,c)+f.badness;_<=p&&(u=f,p=_)}return{index:t,x:e,priorBreak:u,badness:p}}function Op(t){return t?Op(t.priorBreak).concat(t.index):[]}function Ru(t){let e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function Fp(t,e,i,r,a){if(!(e||i||r||a))return;const c=t.length-1,u=t[c],p=(u.x+u.metrics.advance*u.scale)*e;for(let f=0;f<=c;f++)t[f].x-=p,t[f].y+=i+r+a}function Sg(t,e,i){const{horizontalAlign:r,verticalAlign:a}=Ru(i),c=e[0]-t.displaySize[0]*r,u=e[1]-t.displaySize[1]*a;return{image:t,top:u,bottom:u+t.displaySize[1],left:c,right:c+t.displaySize[0]}}function Bp(t,e,i,r,a,c){const u=t.image;let p;if(u.content){const R=u.content,j=u.pixelRatio||1;p=[R[0]/j,R[1]/j,u.displaySize[0]-R[2]/j,u.displaySize[1]-R[3]/j]}const f=e.left*c,_=e.right*c;let x,w,M,T;"width"===i||"both"===i?(T=a[0]+f-r[3],w=a[0]+_+r[1]):(T=a[0]+(f+_-u.displaySize[0])/2,w=T+u.displaySize[0]);const S=e.top*c,k=e.bottom*c;return"height"===i||"both"===i?(x=a[1]+S-r[0],M=a[1]+k+r[2]):(x=a[1]+(S+k-u.displaySize[1])/2,M=x+u.displaySize[1]),{image:u,top:x,right:w,bottom:M,left:T,collisionPadding:p}}class Oo extends Ve{constructor(e,i,r,a,c){super(e,i),this.angle=a,this.z=r,void 0!==c&&(this.segment=c)}clone(){return new Oo(this.x,this.y,this.z,this.angle,this.segment)}}function Np(t,e,i,r,a){if(void 0===e.segment)return!0;let c=e,u=e.segment+1,p=0;for(;p>-i/2;){if(u--,u<0)return!1;p-=t[u].dist(c),c=t[u]}p+=t[u].dist(t[u+1]),u++;const f=[];let _=0;for(;p<i/2;){const x=t[u],w=t[u+1];if(!w)return!1;let M=t[u-1].angleTo(x)-x.angleTo(w);for(M=Math.abs((M+3*Math.PI)%(2*Math.PI)-Math.PI),f.push({distance:p,angleDelta:M}),_+=M;p-f[0].distance>r;)_-=f.shift().angleDelta;if(_>a)return!1;u++,p+=x.dist(w)}return!0}function Vp(t){let e=0;for(let i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function Up(t,e,i){return t?.6*e*i:0}function jp(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Ag(t,e,i,r,a,c){const u=Up(i,a,c),p=jp(i,r)*c;let f=0;const _=Vp(t)/2;for(let x=0;x<t.length-1;x++){const w=t[x],M=t[x+1],T=w.dist(M);if(f+T>_){const S=(_-f)/T,k=Ct(w.x,M.x,S),R=Ct(w.y,M.y,S),j=new Oo(k,R,0,M.angleTo(w),x);return!u||Np(t,j,p,u,e)?j:void 0}f+=T}}function Ig(t,e,i,r,a,c,u,p,f){const _=Up(r,c,u),x=jp(r,a),w=x*u,M=0===t[0].x||t[0].x===f||0===t[0].y||t[0].y===f;return e-w<e/4&&(e=w+e/4),Gp(t,M?e/2*p%e:(x/2+2*c)*u*p%e,e,_,i,w,M,!1,f)}function Gp(t,e,i,r,a,c,u,p,f){const _=c/2,x=Vp(t);let w=0,M=e-i,T=[];for(let S=0;S<t.length-1;S++){const k=t[S],R=t[S+1],j=k.dist(R),K=R.angleTo(k);for(;M+i<w+j;){M+=i;const G=(M-w)/j,H=Ct(k.x,R.x,G),ee=Ct(k.y,R.y,G);if(H>=0&&H<f&&ee>=0&&ee<f&&M-_>=0&&M+_<=x){const Q=new Oo(H,ee,0,K,S);Q._round(),r&&!Np(t,Q,c,r,a)||T.push(Q)}}w+=j}return p||T.length||u||(T=Gp(t,w/2,i,r,a,c,u,!0,f)),T}function Zp(t,e,i,r,a){const c=[];for(let u=0;u<t.length;u++){const p=t[u];let f;for(let _=0;_<p.length-1;_++){let x=p[_],w=p[_+1];x.x<e&&w.x<e||(x.x<e?x=new Ve(e,x.y+(e-x.x)/(w.x-x.x)*(w.y-x.y))._round():w.x<e&&(w=new Ve(e,x.y+(e-x.x)/(w.x-x.x)*(w.y-x.y))._round()),x.y<i&&w.y<i||(x.y<i?x=new Ve(x.x+(i-x.y)/(w.y-x.y)*(w.x-x.x),i)._round():w.y<i&&(w=new Ve(x.x+(i-x.y)/(w.y-x.y)*(w.x-x.x),i)._round()),x.x>=r&&w.x>=r||(x.x>=r?x=new Ve(r,x.y+(r-x.x)/(w.x-x.x)*(w.y-x.y))._round():w.x>=r&&(w=new Ve(r,x.y+(r-x.x)/(w.x-x.x)*(w.y-x.y))._round()),x.y>=a&&w.y>=a||(x.y>=a?x=new Ve(x.x+(a-x.y)/(w.y-x.y)*(w.x-x.x),a)._round():w.y>=a&&(w=new Ve(x.x+(a-x.y)/(w.y-x.y)*(w.x-x.x),a)._round()),f&&x.equals(f[f.length-1])||(f=[x],c.push(f)),f.push(w)))))}}return c}qe(Oo,"Anchor");const xc=1e20;function $p(t,e,i,r,a,c,u,p,f){for(let _=e;_<e+r;_++)qp(t,i*c+_,c,a,u,p,f);for(let _=i;_<i+a;_++)qp(t,_*c+e,1,r,u,p,f)}function qp(t,e,i,r,a,c,u){c[0]=0,u[0]=-xc,u[1]=xc,a[0]=t[e];for(let p=1,f=0,_=0;p<r;p++){a[p]=t[e+p*i];const x=p*p;do{const w=c[f];_=(a[p]-a[w]+x-w*w)/(p-w)/2}while(_<=u[f]&&--f>-1);f++,c[f]=p,u[f]=_,u[f+1]=xc}for(let p=0,f=0;p<r;p++){for(;u[f+1]<p;)f++;const _=c[f],x=p-_;t[e+p*i]=a[_]+x*x}}const Ou={none:0,ideographs:1,all:2};class pl{constructor(e,i,r){this.requestManager=e,this.localGlyphMode=i,this.localFontFamily=r,this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(e){this.url=e}getGlyphs(e,i){const r=[];for(const a in e)for(const c of e[a])r.push({stack:a,id:c});bi(r,({stack:a,id:c},u)=>{let p=this.entries[a];p||(p=this.entries[a]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let f=p.glyphs[c];if(void 0!==f)return void u(null,{stack:a,id:c,glyph:f});if(f=this._tinySDF(p,a,c),f)return p.glyphs[c]=f,void u(null,{stack:a,id:c,glyph:f});const _=Math.floor(c/256);if(256*_>65535)return void u(new Error("glyphs > 65535 not supported"));if(p.ranges[_])return void u(null,{stack:a,id:c,glyph:f});let x=p.requests[_];x||(x=p.requests[_]=[],pl.loadGlyphRange(a,_,this.url,this.requestManager,(w,M)=>{if(M){p.ascender=M.ascender,p.descender=M.descender;for(const T in M.glyphs)this._doesCharSupportLocalGlyph(+T)||(p.glyphs[+T]=M.glyphs[+T]);p.ranges[_]=!0}for(const T of x)T(w,M);delete p.requests[_]})),x.push((w,M)=>{w?u(w):M&&u(null,{stack:a,id:c,glyph:M.glyphs[c]||null})})},(a,c)=>{if(a)i(a);else if(c){const u={};for(const{stack:p,id:f,glyph:_}of c)void 0===u[p]&&(u[p]={}),void 0===u[p].glyphs&&(u[p].glyphs={}),u[p].glyphs[f]=_&&{id:_.id,bitmap:_.bitmap.clone(),metrics:_.metrics},u[p].ascender=this.entries[p].ascender,u[p].descender=this.entries[p].descender;i(null,u)}})}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==Ou.none&&(this.localGlyphMode===Ou.all?!!this.localFontFamily:!!this.localFontFamily&&(Ze_CJK_Unified_Ideographs(e)||Ze_Hangul_Syllables(e)||Ze_Hiragana(e)||Ze_Katakana(e)||Ze_CJK_Symbols_and_Punctuation(e)))}_tinySDF(e,i,r){const a=this.localFontFamily;if(!a||!this._doesCharSupportLocalGlyph(r))return;let c=e.tinySDF;if(!c){let k="400";/bold/i.test(i)?k="900":/medium/i.test(i)?k="500":/light/i.test(i)&&(k="200"),c=e.tinySDF=new pl.TinySDF({fontFamily:a,fontWeight:k,fontSize:48,buffer:6,radius:16}),c.fontWeight=k}if(this.localGlyphs[c.fontWeight][r])return this.localGlyphs[c.fontWeight][r];const u=String.fromCharCode(r),{data:p,width:f,height:_,glyphWidth:x,glyphHeight:w,glyphLeft:M,glyphTop:T,glyphAdvance:S}=c.draw(u);return this.localGlyphs[c.fontWeight][r]={id:r,bitmap:new Lo({width:f,height:_},p),metrics:{width:x/2,height:w/2,left:M/2,top:T/2-27,advance:S/2,localGlyph:!0}}}}pl.loadGlyphRange=function(t,e,i,r,a){const c=256*e,u=c+255,p=r.transformRequest(r.normalizeGlyphsURL(i).replace("{fontstack}",t).replace("{range}",`${c}-${u}`),pr.Glyphs);Jt(p,(f,_)=>{if(f)a(f);else if(_){const x={},w=new Ch(_).readFields(wg,{});for(const M of w.glyphs)x[M.id]=M;a(null,{glyphs:x,ascender:w.ascender,descender:w.descender})}})},pl.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:i=8,cutoff:r=.25,fontFamily:a="sans-serif",fontWeight:c="normal",fontStyle:u="normal"}={}){this.buffer=e,this.cutoff=r,this.radius=i;const p=this.size=t+4*e,f=this._createCanvas(p),_=this.ctx=f.getContext("2d",{willReadFrequently:!0});_.font=`${u} ${c} ${t}px ${a}`,_.textBaseline="alphabetic",_.textAlign="left",_.fillStyle="black",this.gridOuter=new Float64Array(p*p),this.gridInner=new Float64Array(p*p),this.f=new Float64Array(p),this.z=new Float64Array(p+1),this.v=new Uint16Array(p)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:r,actualBoundingBoxLeft:a,actualBoundingBoxRight:c}=this.ctx.measureText(t),u=Math.ceil(i),p=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(c-a))),f=Math.min(this.size-this.buffer,u+Math.ceil(r)),_=p+2*this.buffer,x=f+2*this.buffer,w=Math.max(_*x,0),M=new Uint8ClampedArray(w),T={data:M,width:_,height:x,glyphWidth:p,glyphHeight:f,glyphTop:u,glyphLeft:0,glyphAdvance:e};if(0===p||0===f)return T;const{ctx:S,buffer:k,gridInner:R,gridOuter:j}=this;S.clearRect(k,k,p,f),S.fillText(t,k,k+u);const K=S.getImageData(k,k,p,f);j.fill(xc,0,w),R.fill(0,0,w);for(let G=0;G<f;G++)for(let H=0;H<p;H++){const ee=K.data[4*(G*p+H)+3]/255;if(0===ee)continue;const Q=(G+k)*_+H+k;if(1===ee)j[Q]=0,R[Q]=xc;else{const fe=.5-ee;j[Q]=fe>0?fe*fe:0,R[Q]=fe<0?fe*fe:0}}$p(j,0,0,_,x,_,this.f,this.v,this.z),$p(R,k,k,p,f,_,this.f,this.v,this.z);for(let G=0;G<w;G++){const H=Math.sqrt(j[G])-Math.sqrt(R[G]);M[G]=Math.round(255-255*(H/this.radius+this.cutoff))}return T}};function Wp(t,e,i,r){const a=[],c=t.image,u=c.pixelRatio,p=c.paddedRect.w-2,f=c.paddedRect.h-2,_=t.right-t.left,x=t.bottom-t.top,w=c.stretchX||[[0,p]],M=c.stretchY||[[0,f]],T=(ye,Ce)=>ye+Ce[1]-Ce[0],S=w.reduce(T,0),k=M.reduce(T,0),R=p-S,j=f-k;let K=0,G=S,H=0,ee=k,Q=0,fe=R,ue=0,we=j;if(c.content&&r){const ye=c.content;K=Sh(w,0,ye[0]),H=Sh(M,0,ye[1]),G=Sh(w,ye[0],ye[2]),ee=Sh(M,ye[1],ye[3]),Q=ye[0]-K,ue=ye[1]-H,fe=ye[2]-ye[0]-G,we=ye[3]-ye[1]-ee}const ze=(ye,Ce,Te,Ae)=>{const Oe=Ah(ye.stretch-K,G,_,t.left),xe=Ih(ye.fixed-Q,fe,ye.stretch,S),Ue=Ah(Ce.stretch-H,ee,x,t.top),Xe=Ih(Ce.fixed-ue,we,Ce.stretch,k),Ge=Ah(Te.stretch-K,G,_,t.left),lt=Ih(Te.fixed-Q,fe,Te.stretch,S),Be=Ah(Ae.stretch-H,ee,x,t.top),Je=Ih(Ae.fixed-ue,we,Ae.stretch,k),ct=new Ve(Oe,Ue),St=new Ve(Ge,Ue),ht=new Ve(Ge,Be),tt=new Ve(Oe,Be),$t=new Ve(xe/u,Xe/u),dt=new Ve(lt/u,Je/u),pt=e*Math.PI/180;if(pt){const Gt=Math.sin(pt),Nt=Math.cos(pt),ei=[Nt,-Gt,Gt,Nt];ct._matMult(ei),St._matMult(ei),tt._matMult(ei),ht._matMult(ei)}const Bt=ye.stretch+ye.fixed,jt=Ce.stretch+Ce.fixed;return{tl:ct,tr:St,bl:tt,br:ht,tex:{x:c.paddedRect.x+1+Bt,y:c.paddedRect.y+1+jt,w:Te.stretch+Te.fixed-Bt,h:Ae.stretch+Ae.fixed-jt},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:$t,pixelOffsetBR:dt,minFontScaleX:fe/u/_,minFontScaleY:we/u/x,isSDF:i}};if(r&&(c.stretchX||c.stretchY)){const ye=Xp(w,R,S),Ce=Xp(M,j,k);for(let Te=0;Te<ye.length-1;Te++){const Ae=ye[Te],Oe=ye[Te+1];for(let xe=0;xe<Ce.length-1;xe++)a.push(ze(Ae,Ce[xe],Oe,Ce[xe+1]))}}else a.push(ze({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:p+1},{fixed:0,stretch:f+1}));return a}function Sh(t,e,i){let r=0;for(const a of t)r+=Math.max(e,Math.min(i,a[1]))-Math.max(e,Math.min(i,a[0]));return r}function Xp(t,e,i){const r=[{fixed:-1,stretch:0}];for(const[a,c]of t){const u=r[r.length-1];r.push({fixed:a-u.stretch,stretch:u.stretch}),r.push({fixed:a-u.stretch,stretch:u.stretch+(c-a)})}return r.push({fixed:e+1,stretch:i}),r}function Ah(t,e,i,r){return t/e*i+r}function Ih(t,e,i,r){return t-e*i/r}function Dg(t,e,i,r){const a=e+t.positionedLines[r].lineOffset;return 0===r?i+a/2:i+(a+(e+t.positionedLines[r-1].lineOffset))/2}class kg{constructor(e=[],i=zg){if(this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const e=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:i,compare:r}=this,a=i[e];for(;e>0;){const c=e-1>>1,u=i[c];if(r(a,u)>=0)break;i[e]=u,e=c}i[e]=a}_down(e){const{data:i,compare:r}=this,a=this.length>>1,c=i[e];for(;e<a;){let u=1+(e<<1),p=i[u];const f=u+1;if(f<this.length&&r(i[f],p)<0&&(u=f,p=i[f]),r(p,c)>=0)break;i[e]=p,e=u}i[e]=c}}function zg(t,e){return t<e?-1:t>e?1:0}function Pg(t,e=1,i=!1){let r=1/0,a=1/0,c=-1/0,u=-1/0;const p=t[0];for(let T=0;T<p.length;T++){const S=p[T];(!T||S.x<r)&&(r=S.x),(!T||S.y<a)&&(a=S.y),(!T||S.x>c)&&(c=S.x),(!T||S.y>u)&&(u=S.y)}const f=Math.min(c-r,u-a);let _=f/2;const x=new kg([],Lg);if(0===f)return new Ve(r,a);for(let T=r;T<c;T+=f)for(let S=a;S<u;S+=f)x.push(new fl(T+_,S+_,_,t));let w=function(T){let S=0,k=0,R=0;const j=T[0];for(let K=0,G=j.length,H=G-1;K<G;H=K++){const ee=j[K],Q=j[H],fe=ee.x*Q.y-Q.x*ee.y;k+=(ee.x+Q.x)*fe,R+=(ee.y+Q.y)*fe,S+=3*fe}return new fl(k/S,R/S,0,T)}(t),M=x.length;for(;x.length;){const T=x.pop();(T.d>w.d||!w.d)&&(w=T,i&&console.log("found best %d after %d probes",Math.round(1e4*T.d)/1e4,M)),T.max-w.d<=e||(_=T.h/2,x.push(new fl(T.p.x-_,T.p.y-_,_,t)),x.push(new fl(T.p.x+_,T.p.y-_,_,t)),x.push(new fl(T.p.x-_,T.p.y+_,_,t)),x.push(new fl(T.p.x+_,T.p.y+_,_,t)),M+=4)}return i&&(console.log(`num probes: ${M}`),console.log(`best distance: ${w.d}`)),w.p}function Lg(t,e){return e.max-t.max}class fl{constructor(e,i,r,a){this.p=new Ve(e,i),this.h=r,this.d=function(c,u){let p=!1,f=1/0;for(let _=0;_<u.length;_++){const x=u[_];for(let w=0,M=x.length,T=M-1;w<M;T=w++){const S=x[w],k=x[T];S.y>c.y!=k.y>c.y&&c.x<(k.x-S.x)*(c.y-S.y)/(k.y-S.y)+S.x&&(p=!p),f=Math.min(f,Gd(c,S,k))}}return(p?1:-1)*Math.sqrt(f)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}}const Fu=Number.POSITIVE_INFINITY,Rg=Math.sqrt(2);function Yp(t,[e,i]){let r=0,a=0;if(i===Fu){e<0&&(e=0);const c=e/Rg;switch(t){case"top-right":case"top-left":a=c-7;break;case"bottom-right":case"bottom-left":a=7-c;break;case"bottom":a=7-e;break;case"top":a=e-7}switch(t){case"top-right":case"bottom-right":r=-c;break;case"top-left":case"bottom-left":r=c;break;case"left":r=e;break;case"right":r=-e}}else{switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":a=i-7;break;case"bottom-right":case"bottom-left":case"bottom":a=7-i}switch(t){case"top-right":case"bottom-right":case"right":r=-e;break;case"top-left":case"bottom-left":case"left":r=e}}return[r,a]}function Og(t,e,i,r,a,c,u,p,f,_){t.createArrays(),t.tilePixelRatio=Qe/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;const x=t.layers[0].layout,w=t.layers[0]._unevaluatedLayout._values,M={};if("composite"===t.textSizeData.kind){const{minZoom:k,maxZoom:R}=t.textSizeData;M.compositeTextSizes=[w["text-size"].possiblyEvaluate(new b(k),p),w["text-size"].possiblyEvaluate(new b(R),p)]}if("composite"===t.iconSizeData.kind){const{minZoom:k,maxZoom:R}=t.iconSizeData;M.compositeIconSizes=[w["icon-size"].possiblyEvaluate(new b(k),p),w["icon-size"].possiblyEvaluate(new b(R),p)]}M.layoutTextSize=w["text-size"].possiblyEvaluate(new b(f+1),p),M.layoutIconSize=w["icon-size"].possiblyEvaluate(new b(f+1),p),M.textMaxSize=w["text-size"].possiblyEvaluate(new b(18),p);const T="map"===x.get("text-rotation-alignment")&&"point"!==x.get("symbol-placement"),S=x.get("text-size");for(const k of t.features){const R=x.get("text-font").evaluate(k,{},p).join(","),j=S.evaluate(k,{},p),K=M.layoutTextSize.evaluate(k,{},p),G=(M.layoutIconSize.evaluate(k,{},p),{horizontal:{},vertical:void 0}),H=k.text;let ee,Q=[0,0];if(H){const we=H.toString(),ze=24*x.get("text-letter-spacing").evaluate(k,{},p),ye=24*x.get("text-line-height").evaluate(k,{},p),Ce=qh(we)?ze:0,Te=x.get("text-anchor").evaluate(k,{},p),Ae=x.get("text-variable-anchor");if(!Ae){const Ge=x.get("text-radial-offset").evaluate(k,{},p);Q=Ge?Yp(Te,[24*Ge,Fu]):x.get("text-offset").evaluate(k,{},p).map(lt=>24*lt)}let Oe=T?"center":x.get("text-justify").evaluate(k,{},p);const xe="point"===x.get("symbol-placement"),Ue=xe?24*x.get("text-max-width").evaluate(k,{},p):1/0,Xe=Ge=>{t.allowVerticalPlacement&&$l(we)&&(G.vertical=Lu(H,e,i,a,R,Ue,ye,Te,Ge,Ce,Q,Gn.vertical,!0,K,j))};if(!T&&Ae){const Ge="auto"===Oe?Ae.map(Be=>Bu(Be)):[Oe];let lt=!1;for(let Be=0;Be<Ge.length;Be++){const Je=Ge[Be];if(!G.horizontal[Je])if(lt)G.horizontal[Je]=G.horizontal[0];else{const ct=Lu(H,e,i,a,R,Ue,ye,"center",Je,Ce,Q,Gn.horizontal,!1,K,j);ct&&(G.horizontal[Je]=ct,lt=1===ct.positionedLines.length)}}Xe("left")}else{if("auto"===Oe&&(Oe=Bu(Te)),xe||x.get("text-writing-mode").indexOf("horizontal")>=0||!$l(we)){const Ge=Lu(H,e,i,a,R,Ue,ye,Te,Oe,Ce,Q,Gn.horizontal,!1,K,j);Ge&&(G.horizontal[Oe]=Ge)}Xe(xe?"left":Oe)}}let fe=!1;if(k.icon&&k.icon.name){const we=r[k.icon.name];we&&(ee=Sg(a[k.icon.name],x.get("icon-offset").evaluate(k,{},p),x.get("icon-anchor").evaluate(k,{},p)),fe=we.sdf,void 0===t.sdfIcons?t.sdfIcons=we.sdf:t.sdfIcons!==we.sdf&&Ht("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(we.pixelRatio!==t.pixelRatio||0!==x.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}const ue=Kp(G.horizontal)||G.vertical;t.iconsInText||(t.iconsInText=!!ue&&ue.iconsInText),(ue||ee)&&Fg(t,k,G,ee,r,M,K,0,Q,fe,u,p,_)}c&&t.generateCollisionDebugBuffers(f,t.collisionBoxArray)}function Bu(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Fg(t,e,i,r,a,c,u,p,f,_,x,w,M){let T=c.textMaxSize.evaluate(e,{},w);void 0===T&&(T=u);const S=t.layers[0].layout,k=S.get("icon-offset").evaluate(e,{},w),R=Kp(i.horizontal)||i.vertical,j="globe"===M.name,G=u/24,H=t.tilePixelRatio*T/24,ee=(Te=t.overscaling,t.zoom>18&&Te>2&&(Te>>=1),Math.max(Qe/(512*Te),1)*S.get("symbol-spacing")),Q=S.get("text-padding")*t.tilePixelRatio,fe=S.get("icon-padding")*t.tilePixelRatio,ue=wt(S.get("text-max-angle")),we="map"===S.get("text-rotation-alignment")&&"point"!==S.get("symbol-placement"),ze="map"===S.get("icon-rotation-alignment")&&"point"!==S.get("symbol-placement"),ye=S.get("symbol-placement"),Ce=ee/2;var Te;const Ae=S.get("icon-text-fit");let Oe;r&&"none"!==Ae&&(t.allowVerticalPlacement&&i.vertical&&(Oe=Bp(r,i.vertical,Ae,S.get("icon-text-fit-padding"),k,G)),R&&(r=Bp(r,R,Ae,S.get("icon-text-fit-padding"),k,G)));const xe=(Ue,Xe,Ge)=>{if(Xe.x<0||Xe.x>=Qe||Xe.y<0||Xe.y>=Qe)return;let lt=null;if(j){const{x:Be,y:Je,z:ct}=M.projectTilePoint(Xe.x,Xe.y,Ge);lt={anchor:new Oo(Be,Je,ct,0,void 0),up:M.upVector(Ge,Xe.x,Xe.y)}}!function(Be,Je,ct,St,ht,tt,$t,dt,pt,Bt,jt,Gt,Nt,ei,si,_i,Vt,Ei,yi,ii,kt,vi,Zt,cn,xi){const Oi=Be.addToLineVertexArray(Je,St);let zi,hn,Pi,kr,vl,Ic,Dc,Dm=0,km=0,zm=0,Pm=0,Qu=-1,ed=-1;const ro={};let Lm=Yh("");const as=ct?ct.anchor:Je;let td=0,id=0;if(void 0===pt._unevaluatedLayout.getValue("text-radial-offset")?[td,id]=pt.layout.get("text-offset").evaluate(kt,{},xi).map(Tn=>24*Tn):(td=24*pt.layout.get("text-radial-offset").evaluate(kt,{},xi),id=Fu),Be.allowVerticalPlacement&&ht.vertical){const Tn=ht.vertical;if(si)Ic=Nu(Tn),dt&&(Dc=Nu(dt));else{const Sn=pt.layout.get("text-rotate").evaluate(kt,{},xi)+90;Pi=Dh(Bt,as,Je,jt,Gt,Nt,Tn,ei,Sn,_i),dt&&(kr=Dh(Bt,as,Je,jt,Gt,Nt,dt,Ei,Sn))}}if(tt){const Tn=pt.layout.get("icon-rotate").evaluate(kt,{},xi),Sn="none"!==pt.layout.get("icon-text-fit"),kc=Wp(tt,Tn,Zt,Sn),rd=dt?Wp(dt,Tn,Zt,Sn):void 0;hn=Dh(Bt,as,Je,jt,Gt,Nt,tt,Ei,Tn),Dm=4*kc.length;const Rm=Be.iconSizeData;let ss=null;"source"===Rm.kind?(ss=[Ar*pt.layout.get("icon-size").evaluate(kt,{},xi)],ss[0]>ga&&Ht(`${Be.layerIds[0]}: Value for "icon-size" is >= ${bc}. Reduce your "icon-size".`)):"composite"===Rm.kind&&(ss=[Ar*vi.compositeIconSizes[0].evaluate(kt,{},xi),Ar*vi.compositeIconSizes[1].evaluate(kt,{},xi)],(ss[0]>ga||ss[1]>ga)&&Ht(`${Be.layerIds[0]}: Value for "icon-size" is >= ${bc}. Reduce your "icon-size".`)),Be.addSymbols(Be.icon,kc,ss,ii,yi,kt,!1,ct,Je,Oi.lineStartIndex,Oi.lineLength,-1,cn,xi),Qu=Be.icon.placedSymbolArray.length-1,rd&&(km=4*rd.length,Be.addSymbols(Be.icon,rd,ss,ii,yi,kt,Gn.vertical,ct,Je,Oi.lineStartIndex,Oi.lineLength,-1,cn,xi),ed=Be.icon.placedSymbolArray.length-1)}for(const Tn in ht.horizontal){const Sn=ht.horizontal[Tn];zi||(Lm=Yh(Sn.text),si?vl=Nu(Sn):zi=Dh(Bt,as,Je,jt,Gt,Nt,Sn,ei,pt.layout.get("text-rotate").evaluate(kt,{},xi),_i));const kc=1===Sn.positionedLines.length;if(zm+=Hp(Be,ct,Je,Sn,$t,pt,si,kt,_i,Oi,ht.vertical?Gn.horizontal:Gn.horizontalOnly,kc?Object.keys(ht.horizontal):[Tn],ro,Qu,vi,cn,xi),kc)break}ht.vertical&&(Pm+=Hp(Be,ct,Je,ht.vertical,$t,pt,si,kt,_i,Oi,Gn.vertical,["vertical"],ro,ed,vi,cn,xi));let wa=-1;const nd=(Tn,Sn)=>Tn?Math.max(Tn,Sn):Sn;wa=nd(vl,wa),wa=nd(Ic,wa),wa=nd(Dc,wa);const u_=wa>-1?1:0;Be.glyphOffsetArray.length>=ya.MAX_GLYPHS&&Ht("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==kt.sortKey&&Be.addToSortKeyRanges(Be.symbolInstances.length,kt.sortKey),Be.symbolInstances.emplaceBack(as.x,as.y,as.z,Je.x,Je.y,ro.right>=0?ro.right:-1,ro.center>=0?ro.center:-1,ro.left>=0?ro.left:-1,ro.vertical>=0?ro.vertical:-1,Qu,ed,Lm,void 0!==zi?zi:Be.collisionBoxArray.length,void 0!==zi?zi+1:Be.collisionBoxArray.length,void 0!==Pi?Pi:Be.collisionBoxArray.length,void 0!==Pi?Pi+1:Be.collisionBoxArray.length,void 0!==hn?hn:Be.collisionBoxArray.length,void 0!==hn?hn+1:Be.collisionBoxArray.length,kr||Be.collisionBoxArray.length,kr?kr+1:Be.collisionBoxArray.length,jt,zm,Pm,Dm,km,u_,0,td,id,wa)}(t,Xe,lt,Ue,i,r,a,Oe,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,Q,we,f,0,fe,ze,k,e,c,_,x,w)};if("line"===ye)for(const Ue of Zp(e.geometry,0,0,Qe,Qe)){const Xe=Ig(Ue,ee,ue,i.vertical||R,r,24,H,t.overscaling,Qe);for(const Ge of Xe)R&&Bg(t,R.text,Ce,Ge)||xe(Ue,Ge,w)}else if("line-center"===ye){for(const Ue of e.geometry)if(Ue.length>1){const Xe=Ag(Ue,ue,i.vertical||R,r,24,H);Xe&&xe(Ue,Xe,w)}}else if("Polygon"===e.type)for(const Ue of Cu(e.geometry,0)){const Xe=Pg(Ue,16);xe(Ue[0],new Oo(Xe.x,Xe.y,0,0,void 0),w)}else if("LineString"===e.type)for(const Ue of e.geometry)xe(Ue,new Oo(Ue[0].x,Ue[0].y,0,0,void 0),w);else if("Point"===e.type)for(const Ue of e.geometry)for(const Xe of Ue)xe([Xe],new Oo(Xe.x,Xe.y,0,0,void 0),w)}const bc=255,ga=bc*Ar;function Hp(t,e,i,r,a,c,u,p,f,_,x,w,M,T,S,k,R){const j=function(H,ee,Q,fe,ue,we,ze,ye){const Ce=[];if(0===ee.positionedLines.length)return Ce;const Te=fe.layout.get("text-rotate").evaluate(we,{})*Math.PI/180,Ae=function(Ge){const lt=Ge[0],Be=Ge[1],Je=lt*Be;return Je>0?[lt,-Be]:Je<0?[-lt,Be]:0===lt?[Be,lt]:[Be,-lt]}(Q);let Oe=Math.abs(ee.top-ee.bottom);for(const Ge of ee.positionedLines)Oe-=Ge.lineOffset;const xe=ee.positionedLines.length,Ue=Oe/xe;let Xe=ee.top-Q[1];for(let Ge=0;Ge<xe;++Ge){const lt=ee.positionedLines[Ge];Xe=Dg(ee,Ue,Xe,Ge);for(const Be of lt.positionedGlyphs){if(!Be.rect)continue;const Je=Be.rect||{};let ct=4,St=!0,ht=1,tt=0;if(Be.imageName){const Zt=ze[Be.imageName];if(!Zt)continue;if(Zt.sdf){Ht("SDF images are not supported in formatted text and will be ignored.");continue}St=!1,ht=Zt.pixelRatio,ct=1/ht}const $t=(ue||ye)&&Be.vertical,dt=Be.metrics.advance*Be.scale/2,pt=Be.metrics,Bt=Be.rect;if(null===Bt)continue;ye&&ee.verticalizable&&(tt=Be.imageName?dt-Be.metrics.width*Be.scale/2:0);const jt=ue?[Be.x+dt,Be.y]:[0,0];let Gt=[0,0],Nt=[0,0],ei=!1;ue||($t?(Nt=[Be.x+dt+Ae[0],Be.y+Ae[1]-tt],ei=!0):Gt=[Be.x+dt+Q[0],Be.y+Q[1]-tt]);const si=Bt.w*Be.scale/(ht*(Be.localGlyph?2:1)),_i=Bt.h*Be.scale/(ht*(Be.localGlyph?2:1));let Vt,Ei,yi,ii;if($t){const Zt=Be.y-Xe,cn=new Ve(-dt,dt-Zt),xi=-Math.PI/2,Oi=new Ve(...Nt);Vt=new Ve(-dt+Gt[0],Gt[1]),Vt._rotateAround(xi,cn)._add(Oi),Vt.x+=-Zt+dt,Vt.y-=(pt.left-ct)*Be.scale;const zi=Be.imageName?pt.advance*Be.scale:24*Be.scale,hn=String.fromCharCode(Be.glyph);ug(hn)?Vt.x+=(1-ct)*Be.scale:dg(hn)?Vt.x+=zi-pt.height*Be.scale+(-ct-1)*Be.scale:Vt.x+=Be.imageName||pt.width+2*ct===Bt.w&&pt.height+2*ct===Bt.h?(zi-_i)/2:(zi-(pt.height+2*ct)*Be.scale)/2,Ei=new Ve(Vt.x,Vt.y-si),yi=new Ve(Vt.x+_i,Vt.y),ii=new Ve(Vt.x+_i,Vt.y-si)}else{const Zt=(pt.left-ct)*Be.scale-dt+Gt[0],cn=(-pt.top-ct)*Be.scale+Gt[1],xi=Zt+si,Oi=cn+_i;Vt=new Ve(Zt,cn),Ei=new Ve(xi,cn),yi=new Ve(Zt,Oi),ii=new Ve(xi,Oi)}if(Te){let Zt;Zt=ue?new Ve(0,0):ei?new Ve(Ae[0],Ae[1]):new Ve(Q[0],Q[1]),Vt._rotateAround(Te,Zt),Ei._rotateAround(Te,Zt),yi._rotateAround(Te,Zt),ii._rotateAround(Te,Zt)}const kt=new Ve(0,0),vi=new Ve(0,0);Ce.push({tl:Vt,tr:Ei,bl:yi,br:ii,tex:Je,writingMode:ee.writingMode,glyphOffset:jt,sectionIndex:Be.sectionIndex,isSDF:St,pixelOffsetTL:kt,pixelOffsetBR:vi,minFontScaleX:0,minFontScaleY:0})}}return Ce}(0,r,f,c,u,p,a,t.allowVerticalPlacement),K=t.textSizeData;let G=null;"source"===K.kind?(G=[Ar*c.layout.get("text-size").evaluate(p,{},R)],G[0]>ga&&Ht(`${t.layerIds[0]}: Value for "text-size" is >= ${bc}. Reduce your "text-size".`)):"composite"===K.kind&&(G=[Ar*S.compositeTextSizes[0].evaluate(p,{},R),Ar*S.compositeTextSizes[1].evaluate(p,{},R)],(G[0]>ga||G[1]>ga)&&Ht(`${t.layerIds[0]}: Value for "text-size" is >= ${bc}. Reduce your "text-size".`)),t.addSymbols(t.text,j,G,f,u,p,x,e,i,_.lineStartIndex,_.lineLength,T,k,R);for(const H of w)M[H]=t.text.placedSymbolArray.length-1;return 4*j.length}function Kp(t){for(const e in t)return t[e];return null}function Dh(t,e,i,r,a,c,u,p,f,_){let x=u.top,w=u.bottom,M=u.left,T=u.right;const S=u.collisionPadding;if(S&&(M-=S[0],x-=S[1],T+=S[2],w+=S[3]),f){const k=new Ve(M,x),R=new Ve(T,x),j=new Ve(M,w),K=new Ve(T,w),G=wt(f);let H=new Ve(0,0);
vendor: 6,976 bytes, line 1
1_&&(H=new Ve(_[0],_[1])),k._rotateAround(G,H),R._rotateAround(G,H),j._rotateAround(G,H),K._rotateAround(G,H),M=Math.min(k.x,R.x,j.x,K.x),T=Math.max(k.x,R.x,j.x,K.x),x=Math.min(k.y,R.y,j.y,K.y),w=Math.max(k.y,R.y,j.y,K.y)}return t.emplaceBack(e.x,e.y,e.z,i.x,i.y,M,x,T,w,p,r,a,c),t.length-1}function Nu(t){t.collisionPadding&&(t.top-=t.collisionPadding[1],t.bottom+=t.collisionPadding[3]);const e=t.bottom-t.top;return e>0?Math.max(10,e):null}function Bg(t,e,i,r){const a=t.compareText;if(e in a){const c=a[e];for(let u=c.length-1;u>=0;u--)if(r.dist(c[u])<i)return!0}else a[e]=[];return a[e].push(r),!1}function Jp(t,e){const i=t.fovAboveCenter,r=t.elevation?t.elevation.getMinElevationBelowMSL()*e:0,a=(t._camera.position[2]*t.worldSize-r)/Math.cos(t._pitch),c=Math.sin(i)*a/Math.sin(Math.max(Math.PI/2-t._pitch-i,.01)),u=Math.sin(t._pitch)*c+a;return Math.min(1.01*u,a*(1/t._horizonShift))}function rs(t,e){if(!e.isReprojectedInTileSpace)return{scale:1<<t.z,x:t.x,y:t.y,x2:t.x+1,y2:t.y+1,projection:e};const i=Math.pow(2,-t.z),r=t.x*i,a=(t.x+1)*i,c=t.y*i,u=(t.y+1)*i,p=jn(r),f=jn(a),_=ji(c),x=ji(u),w=e.project(p,_),M=e.project(f,_),T=e.project(f,x),S=e.project(p,x);let k=Math.min(w.x,M.x,T.x,S.x),R=Math.min(w.y,M.y,T.y,S.y),j=Math.max(w.x,M.x,T.x,S.x),K=Math.max(w.y,M.y,T.y,S.y);const G=i/16;function H(Q,fe,ue,we,ze,ye){const Ce=(ue+ze)/2,Te=(we+ye)/2,Ae=e.project(jn(Ce),ji(Te)),Oe=Math.max(0,k-Ae.x,R-Ae.y,Ae.x-j,Ae.y-K);k=Math.min(k,Ae.x),j=Math.max(j,Ae.x),R=Math.min(R,Ae.y),K=Math.max(K,Ae.y),Oe>G&&(H(Q,Ae,ue,we,Ce,Te),H(Ae,fe,Ce,Te,ze,ye))}H(w,M,r,c,a,c),H(M,T,a,c,a,u),H(T,S,a,u,r,u),H(S,w,r,u,r,c),k-=G,R-=G,j+=G,K+=G;const ee=1/Math.max(j-k,K-R);return{scale:ee,x:k*ee,y:R*ee,x2:j*ee,y2:K*ee,projection:e}}const Ng=Cr(new Float32Array(16));class _a{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,i){return{x:0,y:0,z:0}}unproject(e,i){return new Ft(0,0)}projectTilePoint(e,i,r){return{x:e,y:i,z:0}}locationPoint(e,i,r=!0){return e._coordinatePoint(e.locationCoordinate(i),r)}pixelsPerMeter(e,i){return Sr(1,e)*i}pixelSpaceConversion(e,i,r){return 1}farthestPixelDistance(e){return Jp(e,e.pixelsPerMeter)}pointCoordinate(e,i,r,a){const c=e.horizonLineFromTop(!1),u=new Ve(i,Math.max(c,r));return e.rayIntersectionCoordinate(e.pointRayIntersection(u,a))}pointCoordinate3D(e,i,r){const a=new Ve(i,r);if(e.elevation)return e.elevation.pointCoordinate(a);{const c=this.pointCoordinate(e,a.x,a.y,0);return[c.x,c.y,c.z]}}isPointAboveHorizon(e,i){if(e.elevation)return!this.pointCoordinate3D(e,i.x,i.y);const r=e.horizonLineFromTop();return i.y<r}createInversionMatrix(e,i){return Ng}createTileMatrix(e,i,r){let a,c,u;const p=r.canonical,f=Cr(new Float64Array(16));if(this.isReprojectedInTileSpace){const _=rs(p,this);a=1,c=_.x+r.wrap*_.scale,u=_.y,Ka(f,f,[a/_.scale,a/_.scale,e.pixelsPerMeter/i])}else a=i/e.zoomScale(p.z),c=(p.x+Math.pow(2,p.z)*r.wrap)*a,u=p.y*a;return Jl(f,f,[c,u,0]),Ka(f,f,[a/Qe,a/Qe,1]),f}upVector(e,i,r){return[0,0,1]}upVectorScale(e,i,r){return{metersToTile:1}}}class Vg extends _a{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[i,r]=this.parallels=e.parallels||[29.5,45.5],a=Math.sin(wt(i));this.n=(a+Math.sin(wt(r)))/2,this.c=1+a*(2*this.n-a),this.r0=Math.sqrt(this.c)/this.n}project(e,i){const{n:r,c:a,r0:c}=this,u=wt(e-this.center[0]),p=wt(i),f=Math.sqrt(a-2*r*Math.sin(p))/r;return{x:f*Math.sin(u*r),y:f*Math.cos(u*r)-c,z:0}}unproject(e,i){const{n:r,c:a,r0:c}=this,u=c+i;let p=Math.atan2(e,Math.abs(u))*Math.sign(u);u*r<0&&(p-=Math.PI*Math.sign(e)*Math.sign(u));const f=wt(this.center[0])*r;p=pi(p,-Math.PI-f,Math.PI-f);const _=rt(di(p/r)+this.center[0],-180,180),x=Math.asin(rt((a-(e*e+u*u)*r*r)/(2*r),-1,1)),w=rt(di(x),-Gi,Gi);return new Ft(_,w)}}const wc=1.340264,Mc=-.081106,Ec=893e-6,Cc=.003796,kh=Math.sqrt(3)/2;class Ug extends _a{project(e,i){i=i/180*Math.PI,e=e/180*Math.PI;const r=Math.asin(kh*Math.sin(i)),a=r*r,c=a*a*a;return{x:.5*(e*Math.cos(r)/(kh*(wc+3*Mc*a+c*(7*Ec+9*Cc*a)))/Math.PI+.5),y:1-.5*(r*(wc+Mc*a+c*(Ec+Cc*a))/Math.PI+1),z:0}}unproject(e,i){e=(2*e-.5)*Math.PI;let r=i=(2*(1-i)-1)*Math.PI,a=r*r,c=a*a*a;for(let x,w,M,T=0;T<12&&(w=r*(wc+Mc*a+c*(Ec+Cc*a))-i,M=wc+3*Mc*a+c*(7*Ec+9*Cc*a),x=w/M,r=rt(r-x,-Math.PI/3,Math.PI/3),a=r*r,c=a*a*a,!(Math.abs(x)<1e-12));++T);const u=kh*e*(wc+3*Mc*a+c*(7*Ec+9*Cc*a))/Math.cos(r),p=Math.asin(Math.sin(r)/kh),f=rt(180*u/Math.PI,-180,180),_=rt(180*p/Math.PI,-Gi,Gi);return new Ft(f,_)}}class jg extends _a{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,i){return{x:.5+e/360,y:.5-i/360,z:0}}unproject(e,i){const r=360*(e-.5),a=rt(360*(.5-i),-Gi,Gi);return new Ft(r,a)}}const _l=Math.PI/2;function zh(t){return Math.tan((_l+t)/2)}class Gg extends _a{constructor(e){super(e),this.center=e.center||[0,30];const[i,r]=this.parallels=e.parallels||[30,30];let a=wt(i),c=wt(r);this.southernCenter=a+c<0,this.southernCenter&&(a=-a,c=-c);const u=Math.cos(a),p=zh(a);this.n=a===c?Math.sin(a):Math.log(u/Math.cos(c))/Math.log(zh(c)/p),this.f=u*Math.pow(zh(a),this.n)/this.n}project(e,i){i=wt(i),this.southernCenter&&(i=-i),e=wt(e-this.center[0]);const r=1e-6,{n:a,f:c}=this;c>0?i<-_l+r&&(i=-_l+r):i>_l-r&&(i=_l-r);const u=c/Math.pow(zh(i),a);let p=u*Math.sin(a*e),f=c-u*Math.cos(a*e);return p=.5*(p/Math.PI+.5),f=.5*(f/Math.PI+.5),{x:p,y:this.southernCenter?f:1-f,z:0}}unproject(e,i){e=(2*e-.5)*Math.PI,this.southernCenter&&(i=1-i),i=(2*(1-i)-.5)*Math.PI;const{n:r,f:a}=this,c=a-i,u=Math.sign(c),p=Math.sign(r)*Math.sqrt(e*e+c*c);let f=Math.atan2(e,Math.abs(c))*u;c*r<0&&(f-=Math.PI*Math.sign(e)*u);const _=rt(di(f/r)+this.center[0],-180,180),x=rt(di(2*Math.atan(Math.pow(a/p,1/r))-_l),-Gi,Gi);return new Ft(_,this.southernCenter?-x:x)}}class Qp extends _a{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,i){return{x:Qr(e),y:eo(i),z:0}}unproject(e,i){const r=jn(e),a=ji(i);return new Ft(r,a)}}const em=wt(Gi);class Zg extends _a{project(e,i){const r=(i=wt(i))*i,a=r*r;return{x:.5*((e=wt(e))*(.8707-.131979*r+a*(a*(.003971*r-.001529*a)-.013791))/Math.PI+.5),y:1-.5*(i*(1.007226+r*(.015085+a*(.028874*r-.044475-.005916*a)))/Math.PI+1),z:0}}unproject(e,i){e=(2*e-.5)*Math.PI;let r=i=(2*(1-i)-1)*Math.PI,a=25,c=0,u=r*r;do{u=r*r;const _=u*u;c=(r*(1.007226+u*(.015085+_*(.028874*u-.044475-.005916*_)))-i)/(1.007226+u*(.045255+_*(.259866*u-.311325-.005916*11*_))),r=rt(r-c,-em,em)}while(Math.abs(c)>1e-6&&--a>0);u=r*r;const p=rt(di(e/(.8707+u*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979))),-180,180),f=di(r);return new Ft(p,f)}}const tm=wt(Gi);class $g extends _a{project(e,i){i=wt(i),e=wt(e);
vendor: 6,376 bytes, line 1
1const r=Math.cos(i),a=2/Math.PI,c=Math.acos(r*Math.cos(e/2)),u=Math.sin(c)/c,p=.5*(e*a+2*r*Math.sin(e/2)/u)||0,f=.5*(i+Math.sin(i)/u)||0;return{x:.5*(p/Math.PI+.5),y:1-.5*(f/Math.PI+1),z:0}}unproject(e,i){let r=e=(2*e-.5)*Math.PI,a=i=(2*(1-i)-1)*Math.PI,c=25;const u=1e-6;let p=0,f=0;do{const _=Math.cos(a),x=Math.sin(a),w=2*x*_,M=x*x,T=_*_,S=Math.cos(r/2),k=Math.sin(r/2),R=2*S*k,j=k*k,K=1-T*S*S,G=K?1/K:0,H=K?Math.acos(_*S)*Math.sqrt(1/K):0,ee=.5*(2*H*_*k+2*r/Math.PI)-e,Q=.5*(H*x+a)-i,fe=.5*G*(T*j+H*_*S*M)+1/Math.PI,ue=G*(R*w/4-H*x*k),we=.125*G*(w*k-H*x*T*R),ze=.5*G*(M*S+H*j*_)+.5,ye=ue*we-ze*fe;p=(Q*ue-ee*ze)/ye,f=(ee*we-Q*fe)/ye,r=rt(r-p,-Math.PI,Math.PI),a=rt(a-f,-tm,tm)}while((Math.abs(p)>u||Math.abs(f)>u)&&--c>0);return new Ft(di(r),di(a))}}class im extends _a{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(wt(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,i){const{scale:r,cosPhi:a}=this;return{x:wt(e)*a*r+.5,y:-Math.sin(wt(i))/a*r+.5,z:0}}unproject(e,i){const{scale:r,cosPhi:a}=this,c=-(i-.5)/r,u=rt(di((e-.5)/r)/a,-180,180),p=Math.asin(rt(c*a,-1,1)),f=rt(di(p),-Gi,Gi);return new Ft(u,f)}}class qg extends Qp{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,i,r){const a=ac(e,i,r);return ui(a,a,sc(Jr(r))),{x:a[0],y:a[1],z:a[2]}}locationPoint(e,i){const r=il(i.lat,i.lng),a=an([],r),c=e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(i),e._centerAltitude):e._centerAltitude;ic(r,r,a,Sr(1,0)*Qe*c);const u=Cr(new Float64Array(16));return Ha(u,e.pixelMatrix,e.globeMatrix),ui(r,r,u),new Ve(r[0],r[1])}pixelsPerMeter(e,i){return Sr(1,0)*i}pixelSpaceConversion(e,i,r){const a=Sr(1,e)*i,c=Ct(Sr(1,45)*i,a,r);return this.pixelsPerMeter(e,i)/c}createTileMatrix(e,i,r){const a=cu(Jr(r.canonical));return Ha(new Float64Array(16),e.globeMatrix,a)}createInversionMatrix(e,i){const{center:r}=e,a=sc(Jr(i));return ah(a,a,wt(r.lng)),Qh(a,a,wt(r.lat)),Ka(a,a,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(a)}pointCoordinate(e,i,r,a){return Id(e,i,r,!0)||new rl(0,0)}pointCoordinate3D(e,i,r){const a=this.pointCoordinate(e,i,r,0);return[a.x,a.y,a.z]}isPointAboveHorizon(e,i){return!Id(e,i.x,i.y,!1)}farthestPixelDistance(e){const i=function(a,c){const u=a.cameraToCenterDistance,p=a._centerAltitude*c,f=a._camera,_=a._camera.forward(),x=zo([],Un([],_,-u),[0,0,p]),w=a.worldSize/(2*Math.PI),M=[0,0,-w],T=a.width/a.height,S=Math.tan(a.fovAboveCenter),k=Un([],f.up(),S),R=Un([],f.right(),S*T),j=an([],zo([],zo([],_,k),R)),K=[];let G;if(new nu(x,j).closestPointOnSphere(M,w,K)){const H=zo([],K,M),ee=Tr([],H,x);G=Math.cos(a.fovAboveCenter)*Ql(ee)}else{const H=Tr([],x,M),ee=Tr([],M,x);an(ee,ee);const Q=Ql(H)-w;G=Math.sqrt(Q*(Q+2*w));const fe=Math.acos(G/(w+Q))-Math.acos(ar(_,ee));G*=Math.cos(fe)}return 1.01*G}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),r=nl(e.zoom);if(r>0){const a=Jp(e,Sr(1,e.center.lat)*e.worldSize),c=e.worldSize/(2*Math.PI),u=Math.max(e.width,e.height)/e.worldSize*Math.PI;return Ct(i,a+c*(1-Math.cos(u)),Math.pow(r,10))}return i}upVector(e,i,r){return ac(i,r,e,1)}upVectorScale(e){return{metersToTile:sh(ch(Jr(e)))}}}function nm(t){const e=t.parallels,i=!!e&&Math.abs(e[0]+e[1])<.01;switch(t.name){case"mercator":return new Qp(t);case"equirectangular":return new jg(t);case"naturalEarth":return new Zg(t);case"equalEarth":return new Ug(t);case"winkelTripel":return new $g(t);case"albers":return i?new im(t):new Vg(t);case"lambertConformalConic":return i?new im(t):new Gg(t);case"globe":return new qg(t)}throw new Error(`Invalid projection name: ${t.name}`)}const Wg=vh.types,Xg=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Ph(t,e,i,r,a,c,u,p,f,_,x,w,M){const T=p?Math.min(ga,Math.round(p[0])):0,S=p?Math.min(ga,Math.round(p[1])):0;t.emplaceBack(e,i,Math.round(32*r),Math.round(32*a),c,u,(T<<1)+(f?1:0),S,16*_,16*x,256*w,256*M)}function Lh(t,e,i,r,a,c,u){t.emplaceBack(e,i,r,a,c,u)}function Rh(t,e,i,r,a){t.emplaceBack(e,i,r,a),t.emplaceBack(e,i,r,a),t.emplaceBack(e,i,r,a),t.emplaceBack(e,i,r,a)}function Yg(t){for(const e of t.sections)if(Xh(e.text))return!0;return!1}class Vu{constructor(e){this.layoutVertexArray=new Se,this.indexArray=new Ye,this.programConfigurations=e,this.segments=new fi,this.dynamicLayoutVertexArray=new De,this.opacityVertexArray=new Ke,this.placedSymbolArray=new mi,this.globeExtVertexArray=new Re}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,i,r,a){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ng.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,og.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Xg,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,rg.members,!0)),this.opacityVertexBuffer.itemSize=1),(r||a)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}qe(Vu,"SymbolBuffers");class Uu{constructor(e,i,r){this.layoutVertexArray=new e,this.layoutAttributes=i,this.indexArray=new r,this.segments=new fi,this.collisionVertexArray=new bt,this.collisionVertexArrayExt=new yt}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,ag.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,sg.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.de
1stroy())}}qe(Uu,"CollisionBuffers");class ya{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(u=>u.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Cr([]),this.placementViewportMatrix=Cr([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Iu(this.zoom,i["text-size"]),this.iconSizeData=Iu(this.zoom,i["icon-size"]);const r=this.layers[0].layout,a=r.get("symbol-sort-key"),c=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==c&&void 0!==a.constantOr(1),this.sortFeaturesByY=("viewport-y"===c||"auto"===c&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=r.get("text-writing-mode").map(u=>Gn[u]),this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id),this.sourceID=e.sourceID,this.projection=e.projection}createArrays(){this.text=new Vu(new Ya(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Vu(new Ya(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new on,this.lineVertexArray=new Ks,this.symbolInstances=new Yt}calculateGlyphDependencies(e,i,r,a,c){for(let u=0;u<e.length;u++)if(i[e.charCodeAt(u)]=!0,a&&c){const p=yc[e.charAt(u)];p&&(i[p.charCodeAt(0)]=!0)}}populate(e,i,r,a){const c=this.layers[0],u=c.layout,p="globe"===this.projection.name,f=u.get("text-font"),_=u.get("text-field"),x=u.get("icon-image"),w=("constant"!==_.value.kind||_.value.value instanceof Hi&&!_.value.value.isEmpty()||_.value.value.toString().length>0)&&("constant"!==f.value.kind||f.value.value.length>0),M="constant"!==x.value.kind||!!x.value.value||Object.keys(x.parameters).length>0,T=u.get("symbol-sort-key");if(this.features=[],!w&&!M)return;const S=i.iconDependencies,k=i.glyphDependencies,R=i.availableImages,j=new b(this.zoom);for(const{feature:K,id:G,index:H,sourceLayerIndex:ee}of e){const Q=c._featureFilter.needGeometry,fe=ts(K,Q);if(!c._featureFilter.filter(j,fe,r))continue;if(Q||(fe.geometry=Po(K,r,a)),p&&1!==K.type&&r.z<=5){const ye=fe.geometry,Ce=.98078528056,Te=(Ae,Oe)=>ar(ac(Ae.x,Ae.y,r,1),ac(Oe.x,Oe.y,r,1))<Ce;for(let Ae=0;Ae<ye.length;Ae++)ye[Ae]=of(ye[Ae],Te)}let ue,we;if(w){const ye=c.getValueAndResolveTokens("text-field",fe,r,R),Ce=Hi.factory(ye);Yg(Ce)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===m()||this.hasRTLText&&v.
vendor: 11,267 bytes, line 1
1isParsed())&&(ue=hg(Ce,c,fe))}if(M){const ye=c.getValueAndResolveTokens("icon-image",fe,r,R);we=ye instanceof pn?ye:pn.fromString(ye)}if(!ue&&!we)continue;const ze=this.sortFeaturesByKey?T.evaluate(fe,{},r):void 0;if(this.features.push({id:G,text:ue,icon:we,index:H,sourceLayerIndex:ee,geometry:fe.geometry,properties:K.properties,type:Wg[K.type],sortKey:ze}),we&&(S[we.name]=!0),ue){const ye=f.evaluate(fe,{},r).join(","),Ce="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Gn.vertical)>=0;for(const Te of ue.sections)if(Te.image)S[Te.image.name]=!0;else{const Ae=$l(ue.toString()),Oe=Te.fontStack||ye,xe=k[Oe]=k[Oe]||{};this.calculateGlyphDependencies(Te.text,xe,Ce,this.allowVerticalPlacement,Ae)}}}"line"===u.get("symbol-placement")&&(this.features=function(K){const G={},H={},ee=[];let Q=0;function fe(ye){ee.push(K[ye]),Q++}function ue(ye,Ce,Te){const Ae=H[ye];return delete H[ye],H[Ce]=Ae,ee[Ae].geometry[0].pop(),ee[Ae].geometry[0]=ee[Ae].geometry[0].concat(Te[0]),Ae}function we(ye,Ce,Te){const Ae=G[Ce];return delete G[Ce],G[ye]=Ae,ee[Ae].geometry[0].shift(),ee[Ae].geometry[0]=Te[0].concat(ee[Ae].geometry[0]),Ae}function ze(ye,Ce,Te){const Ae=Te?Ce[0][Ce[0].length-1]:Ce[0][0];return`${ye}:${Ae.x}:${Ae.y}`}for(let ye=0;ye<K.length;ye++){const Ce=K[ye],Te=Ce.geometry,Ae=Ce.text?Ce.text.toString():null;if(!Ae){fe(ye);continue}const Oe=ze(Ae,Te),xe=ze(Ae,Te,!0);if(Oe in H&&xe in G&&H[Oe]!==G[xe]){const Ue=we(Oe,xe,Te),Xe=ue(Oe,xe,ee[Ue].geometry);delete G[Oe],delete H[xe],H[ze(Ae,ee[Xe].geometry,!0)]=Xe,ee[Ue].geometry=null}else Oe in H?ue(Oe,xe,Te):xe in G?we(Oe,xe,Te):(fe(ye),G[Oe]=Q-1,H[xe]=Q-1)}return ee.filter(ye=>ye.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((K,G)=>K.sortKey-G.sortKey)}update(e,i,r,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,i,this.layers,r,a),this.icon.programConfigurations.updatePaintArrays(e,i,this.layers,r,a))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=nm(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,i){const r=this.lineVertexArray.length;if(void 0!==e.segment)for(const{x:a,y:c}of i)this.lineVertexArray.emplaceBack(a,c);return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(e,i,r,a,c,u,p,f,_,x,w,M,T,S){const k=e.indexArray,R=e.layoutVertexArray,j=e.globeExtVertexArray,K=e.segments.prepareSegment(4*i.length,R,k,this.canOverlap?u.sortKey:void 0),G=this.glyphOffsetArray.length,H=K.vertexLength,ee=this.allowVerticalPlacement&&p===Gn.vertical?Math.PI/2:0,Q=u.text&&u.text.sections;for(let ue=0;ue<i.length;ue++){const{tl:we,tr:ze,bl:ye,br:Ce,tex:Te,pixelOffsetTL:Ae,pixelOffsetBR:Oe,minFontScaleX:xe,minFontScaleY:Ue,glyphOffset:Xe,isSDF:Ge,sectionIndex:lt}=i[ue],Be=K.vertexLength,Je=Xe[1];if(Ph(R,_.x,_.y,we.x,Je+we.y,Te.x,Te.y,r,Ge,Ae.x,Ae.y,xe,Ue),Ph(R,_.x,_.y,ze.x,Je+ze.y,Te.x+Te.w,Te.y,r,Ge,Oe.x,Ae.y,xe,Ue),Ph(R,_.x,_.y,ye.x,Je+ye.y,Te.x,Te.y+Te.h,r,Ge,Ae.x,Oe.y,xe,Ue),Ph(R,_.x,_.y,Ce.x,Je+Ce.y,Te.x+Te.w,Te.y+Te.h,r,Ge,Oe.x,Oe.y,xe,Ue),f){const{x:ct,y:St,z:ht}=f.anchor,[tt,$t,dt]=f.up;Lh(j,ct,St,ht,tt,$t,dt),Lh(j,ct,St,ht,tt,$t,dt),Lh(j,ct,St,ht,tt,$t,dt),Lh(j,ct,St,ht,tt,$t,dt),Rh(e.dynamicLayoutVertexArray,ct,St,ht,ee)}else Rh(e.dynamicLayoutVertexArray,_.x,_.y,_.z,ee);k.emplaceBack(Be,Be+1,Be+2),k.emplaceBack(Be+1,Be+2,Be+3),K.vertexLength+=4,K.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Xe[0]),ue!==i.length-1&&lt===i[ue+1].sectionIndex||e.programConfigurations.populatePaintArrays(R.length,u,u.index,{},T,S,Q&&Q[lt])}const fe=f?f.anchor:_;e.placedSymbolArray.emplaceBack(fe.x,fe.y,fe.z,_.x,_.y,G,this.glyphOffsetArray.length-G,H,x,w,_.segment,r?r[0]:0,r?r[1]:0,a[0],a[1],p,0,!1,0,M,0)}_commitLayoutVertex(e,i,r,a,c,u,p){e.emplaceBack(i,r,a,c,u,Math.round(p.x),Math.round(p.y))}_addCollisionDebugVertices(e,i,r,a,c,u,p){const f=r.segments.prepareSegment(4,r.layoutVertexArray,r.indexArray),_=f.vertexLength,x=p.tileAnchorX,w=p.tileAnchorY;for(let T=0;T<4;T++)r.collisionVertexArray.emplaceBack(0,0,0,0);r.collisionVertexArrayExt.emplaceBack(i,-e.padding,-e.padding),r.collisionVertexArrayExt.emplaceBack(i,e.padding,-e.padding),r.collisionVertexArrayExt.emplaceBack(i,e.padding,e.padding),r.collisionVertexArrayExt.emplaceBack(i,-e.padding,e.padding),this._commitLayoutVertex(r.layoutVertexArray,a,c,u,x,w,new Ve(e.x1,e.y1)),this._commitLayoutVertex(r.layoutVertexArray,a,c,u,x,w,new Ve(e.x2,e.y1)),this._commitLayoutVertex(r.layoutVertexArray,a,c,u,x,w,new Ve(e.x2,e.y2)),this._commitLayoutVertex(r.layoutVertexArray,a,c,u,x,w,new Ve(e.x1,e.y2)),f.vertexLength+=4;const M=r.indexArray;M.emplaceBack(_,_+1),M.emplaceBack(_+1,_+2),M.emplaceBack(_+2,_+3),M.emplaceBack(_+3,_),f.primitiveLength+=4}_addTextDebugCollisionBoxes(e,i,r,a,c,u){for(let p=a;p<c;p++){const f=r.get(p),_=this.getSymbolInstanceTextSize(e,u,i,p);this._addCollisionDebugVertices(f,_,this.textCollisionBox,f.projectedAnchorX,f.projectedAnchorY,f.projectedAnchorZ,u)}}_addIconDebugCollisionBoxes(e,i,r,a,c,u){for(let p=a;p<c;p++){const f=r.get(p),_=this.getSymbolInstanceIconSize(e,i,u.placedIconSymbolIndex);this._addCollisionDebugVertices(f,_,this.iconCollisionBox,f.projectedAnchorX,f.projectedAnchorY,f.projectedAnchorZ,u)}}generateCollisionDebugBuffers(e,i){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Uu(We,wp.members,ki),this.iconCollisionBox=new Uu(We,wp.members,ki);const r=cl(this.iconSizeData,e),a=cl(this.textSizeData,e);for(let c=0;c<this.symbolInstances.length;c++){const u=this.symbolInstances.get(c);this._addTextDebugCollisionBoxes(a,e,i,u.textBoxStartIndex,u.textBoxEndIndex,u),this._addTextDebugCollisionBoxes(a,e,i,u.verticalTextBoxStartIndex,u.verticalTextBoxEndIndex,u),this._addIconDebugCollisionBoxes(r,e,i,u.iconBoxStartIndex,u.iconBoxEndIndex,u),this._addIconDebugCollisionBoxes(r,e,i,u.verticalIconBoxStartIndex,u.verticalIconBoxEndIndex,u)}}getSymbolInstanceTextSize(e,i,r,a){const c=this.text.placedSymbolArray.get(i.rightJustifiedTextSymbolIndex>=0?i.rightJustifiedTextSymbolIndex:i.centerJustifiedTextSymbolIndex>=0?i.centerJustifiedTextSymbolIndex:i.leftJustifiedTextSymbolIndex>=0?i.leftJustifiedTextSymbolIndex:i.verticalPlacedTextSymbolIndex>=0?i.verticalPlacedTextSymbolIndex:a),u=Mh(this.textSizeData,e,c)/24;return this.tilePixelRatio*u}getSymbolInstanceIconSize(e,i,r){const a=this.icon.placedSymbolArray.get(r),c=Mh(this.iconSizeData,e,a);return this.tilePixelRatio*c}_commitDebugCollisionVertexUpdate(e,i,r){e.emplaceBack(i,-r,-r),e.emplaceBack(i,r,-r),e.emplaceBack(i,r,r),e.emplaceBack(i,-r,r)}_updateTextDebugCollisionBoxes(e,i,r,a,c,u){for(let p=a;p<c;p++){const f=r.get(p),_=this.getSymbolInstanceTextSize(e,u,i,p);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,_,f.padding)}}_updateIconDebugCollisionBoxes(e,i,r,a,c,u){for(let p=a;p<c;p++){const f=r.get(p),_=this.getSymbolInstanceIconSize(e,i,u);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,_,f.padding)}}updateCollisionDebugBuffers(e,i){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const r=cl(this.iconSizeData,e),a=cl(this.textSizeData,e);for(let c=0;c<this.symbolInstances.length;c++){const u=this.symbolInstances.get(c);this._updateTextDebugCollisionBoxes(a,e,i,u.textBoxStartIndex,u.textBoxEndIndex,u),this._updateTextDebugCollisionBoxes(a,e,i,u.verticalTextBoxStartIndex,u.verticalTextBoxEndIndex,u),this._updateIconDebugCollisionBoxes(r,e,i,u.iconBoxStartIndex,u.iconBoxEndIndex,u.placedIconSymbolIndex),this._updateIconDebugCollisionBoxes(r,e,i,u.verticalIconBoxStartIndex,u.verticalIconBoxEndIndex,u.placedIconSymbolIndex)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(e,i,r,a,c,u,p,f,_){const x={};if(i<r){const{x1:w,y1:M,x2:T,y2:S,padding:k,projectedAnchorX:R,projectedAnchorY:j,projectedAnchorZ:K,tileAnchorX:G,tileAnchorY:H,featureIndex:ee}=e.get(i);x.textBox={x1:w,y1:M,x2:T,y2:S,padding:k,projectedAnchorX:R,projectedAnchorY:j,projectedAnchorZ:K,tileAnchorX:G,tileAnchorY:H},x.textFeatureIndex=ee}if(a<c){const{x1:w,y1:M,x2:T,y2:S,padding:k,projectedAnchorX:R,projectedAnchorY:j,projectedAnchorZ:K,tileAnchorX:G,tileAnchorY:H,featureIndex:ee}=e.get(a);x.verticalTextBox={x1:w,y1:M,x2:T,y2:S,padding:k,projectedAnchorX:R,projectedAnchorY:j,projectedAnchorZ:K,tileAnchorX:G,tileAnchorY:H},x.verticalTextFeatureIndex=ee}if(u<p){const{x1:w,y1:M,x2:T,y2:S,padding:k,projectedAnchorX:R,projectedAnchorY:j,projectedAnchorZ:K,tileAnchorX:G,tileAnchorY:H,featureIndex:ee}=e.get(u);x.iconBox={x1:w,y1:M,x2:T,y2:S,padding:k,projectedAnchorX:R,projectedAnchorY:j,projectedAnchorZ:K,tileAnchorX:G,tileAnchorY:H},x.iconFeatureIndex=ee}if(f<_){const{x1:w,y1:M,x2:T,y2:S,padding:k,projectedAnchorX:R,projectedAnchorY:j,projectedAnchorZ:K,tileAnchorX:G,tileAnchorY:H,featureIndex:ee}=e.get(f);x.verticalIconBox={x1:w,y1:M,x2:T,y2:S,padding:k,projectedAnchorX:R,projectedAnchorY:j,projectedAnchorZ:K,tileAnchorX:G,tileAnchorY:H},x.verticalIconFeatureIndex=ee}return x}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let i=0;i<this.symbolInstances.length;i++){const r=this.symbolInstances.get(i);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,i){const r=e.placedSymbolArray.get(i),a=r.vertexStartIndex+4*r.numGlyphs;for(let c=r.vertexStartIndex;c<a;c+=4)e.indexArray.emplaceBack(c,c+1,c+2),e.indexArray.emplaceBack(c+1,c+2,c+3)}
1getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const i=Math.sin(e),r=Math.cos(e),a=[],c=[],u=[];for(let p=0;p<this.symbolInstances.length;++p){u.push(p);const f=this.symbolInstances.get(p);a.push(0|Math.round(i*f.tileAnchorX+r*f.tileAnchorY)),c.push(f.featureIndex)}return u.sort((p,f)=>a[p]-a[f]||c[f]-c[p]),u}addToSortKeyRanges(e,i){const r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===i?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const r=this.symbolInstances.get(i);this.featureSortOrder.push(r.featureIndex);const{rightJustifiedTextSymbolIndex:a,centerJustifiedTextSymbolIndex:c,leftJustifiedTextSymbolIndex:u,verticalPlacedTextSymbolIndex:p,placedIconSymbolIndex:f,verticalPlacedIconSymbolIndex:_}=r;a>=0&&this.addIndicesForPlacedSymbol(this.text,a),c>=0&&c!==a&&this.addIndicesForPlacedSymbol(this.text,c),u>=0&&u!==c&&u!==a&&this.addIndicesForPlacedSymbol(this.text,u),p>=0&&this.addIndicesForPlacedSymbol(this.text,p),f>=0&&this.addIndicesForPlacedSymbol(this.icon,f),_>=0&&this.addIndicesForPlacedSymbol(this.icon,_)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}qe(ya,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),ya.MAX_GLYPHS=65535,ya.addDynamicAttributes=Rh;const Hg=new W({"symbol-placement":new D(be.layout_symbol["symbol-placement"]),"symbol-spacing":new D(be.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new D(be.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new F(be.layout_symbol["symbol-sort-key"]),"symbol-z-order":new D(be.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new D(be.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new D(be.layout_symbol["icon-ignore-placement"]),"icon-optional":new D(be.layout_symbol["icon-optional"]),"icon-rotation-alignment":new D(be.layout_symbol["icon-rotation-alignment"]),"icon-size":new F(be.layout_symbol["icon-size"]),"icon-text-fit":new D(be.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new D(be.layout_symbol["icon-text-fit-padding"]),"icon-image":new F(be.layout_symbol["icon-image"]),"icon-rotate":new F(be.layout_symbol["icon-rotate"]),"icon-padding":new D(be.layout_symbol["icon-padding"]),"icon-keep-upright":new D(be.layout_symbol["icon-keep-upright"]),"icon-offset":new F(be.layout_symbol["icon-offset"]),"icon-anchor":new F(be.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new D(be.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new D(be.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new D(be.layout_symbol["text-rotation-alignment"]),"text-field":new F(be.layout_symbol["text-field"]),"text-font":new F(be.layout_symbol["text-font"]),"text-size":new F(be.layout_symbol["text-size"]),"text-max-width":new F(be.layout_symbol["text-max-width"]),"text-line-height":new F(be.layout_symbol["text-line-height"]),"text-letter-spacing":new F(be.layout_symbol["text-letter-spacing"]),"text-justify":new F(be.layout_symbol["text-justify"]),"text-radial-offset":new F(be.layout_symbol["text-radial-offset"]),"text-variable-anchor":new D(be.layout_symbol["text-variable-anchor"]),"text-anchor":new F(be.layout_symbol["text-anchor"]),"text-max-angle":new D(be.layout_symbol["text-max-angle"]),"text-writing-mode":new D(be.layout_symbol["text-writing-mode"]),"text-rotate":new F(be.layout_symbol["text-rotate"]),"text-padding":new D(be.layout_symbol["text-padding"]),"text-keep-upright":new D(be.layout_symbol["text-keep-upright"]),"text-transform":new F(be.layout_symbol["text-transform"]),"text-offset":new F(be.layout_symbol["text-offset"]),"text-allow-overlap":new D(be.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new D(be.layout_symbol["text-ignore-placement"]),"text-optional":new D(be.layout_symbol["text-optional"])});var ju={paint:new W({"icon-opacity":new F(be.paint_symbol["icon-opacity"]),"icon-color":new F(be.paint_symbol["icon-color"]),"icon-halo-color":new F(be.paint_symbol["icon-halo-color"]),"icon-halo-width":new F(be.paint_symbol["icon-halo-width"]),"icon-halo-blur":new F(be.paint_symbol["icon-halo-blur"]),"icon-translate":new D(be.paint_symbol["icon-translate"]),"icon-translate-anchor":new D(be.paint_symbol["icon-translate-anchor"]),"text-opacity":new F(be.paint_symbol["text-opacity"]),"text-color":new F(be.paint_symbol["text-color"],{runtimeType:Wi,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new F(be.paint_symbol["text-halo-color"]),"text-halo-width":new F(be.paint_symbol["text-halo-width"]),"text-halo-blur":new F(be.paint_symbol["text-halo-blur"]),"text-translate":new D(be.paint_symbol["text-translate"]),"text-translate-anchor":new D(be.paint_symbol["text-translate-anchor"])}),layout:Hg};class rm{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:uo,this.defaultValue=e}evaluate(e){if(e.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(e.formattedSection))return i.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}qe(rm,"FormatSectionOverride",{omit:["defaultValue"]});
vendor: 4,496 bytes, line 1
1class Oh extends Er{constructor(e){super(e,ju)}recalculate(e,i){super.recalculate(e,i),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const r=this.layout.get("text-writing-mode");if(r){const a=[];for(const c of r)a.indexOf(c)<0&&a.push(c);this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(e,i,r,a){const c=this.layout.get(e).evaluate(i,{},r,a),u=this._unevaluatedLayout._values[e];return u.isDataDriven()||aa(u.value)||!c?c:(p=i.properties,c.replace(/{([^{}]+)}/g,(_,x)=>x in p?String(p[x]):""));var p}createBucket(e){return new ya(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of ju.paint.overridableProperties){if(!Oh.hasPaintOverride(this.layout,e))continue;const i=this.paint.get(e),r=new rm(i),a=new Gs(r,i.property.specification);let c=null;c="constant"===i.value.kind||"source"===i.value.kind?new Ll("source",a):new Va("composite",a,i.value.zoomStops,i.value._interpolationType),this.paint._values[e]=new N(i.property,c,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,r){return!(!this.layout||i.isDataDriven()||r.isDataDriven())&&Oh.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){const r=e.get("text-field"),a=ju.paint.properties[i];let c=!1;const u=p=>{for(const f of p)if(a.overrides&&a.overrides.hasOverride(f))return void(c=!0)};if("constant"===r.value.kind&&r.value.value instanceof Hi)u(r.value.value.sections);else if("source"===r.value.kind){const p=_=>{c||(_ instanceof $r&&ti(_.value)===po?u(_.value.sections):_ instanceof Qn?u(_.sections):_.eachChild(p))},f=r.value;f._styleExpression&&p(f._styleExpression.expression)}return c}getProgramConfiguration(e){return new pa(this,e)}}var Kg={paint:new W({"background-color":new D(be.paint_background["background-color"]),"background-pattern":new D(be.paint_background["background-pattern"]),"background-opacity":new D(be.paint_background["background-opacity"])})},Jg={paint:new W({"raster-opacity":new D(be.paint_raster["raster-opacity"]),"raster-hue-rotate":new D(be.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new D(be.paint_raster["raster-brightness-min"]),"raster-brightness-max":new D(be.paint_raster["raster-brightness-max"]),"raster-saturation":new D(be.paint_raster["raster-saturation"]),"raster-contrast":new D(be.paint_raster["raster-contrast"]),"raster-resampling":new D(be.paint_raster["raster-resampling"]),"raster-fade-duration":new D(be.paint_raster["raster-fade-duration"])})};class Qg extends Er{constructor(e){super(e,{}),this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isLayerDraped(){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}var e_={paint:new W({"sky-type":new D(be.paint_sky["sky-type"]),"sky-atmosphere-sun":new D(be.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new D(be.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new D(be.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new D(be.paint_sky["sky-gradient-radius"]),"sky-gradient":new $(be.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new D(be.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new D(be.paint_sky["sky-atmosphere-color"]),"sky-opacity":new D(be.paint_sky["sky-opacity"])})};function Gu(t,e,i){const r=[0,0,1],a=Md([]);return Cd(a,a,i?-wt(t)+Math.PI:wt(t)),Ed(a,a,-wt(e)),vd(r,r,a),an(r,r)}
1const t_={circle:class extends Er{constructor(t){super(t,df)}createBucket(t){return new fu(t)}queryRadius(t){const e=t;return ol("circle-radius",this,e)+ol("circle-stroke-width",this,e)+dh(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,i,r,a,c,u,p){const f=Wd(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),_=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i);return Xd(t,r,c,u,p,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),f,_)}getProgramIds(){return["circle"]}getProgramConfiguration(t){return new pa(this,t)}},heatmap:class extends Er{createBucket(t){return new Hd(t)}constructor(t){super(t,gf),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=vu({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(t){return ol("heatmap-radius",this,t)}queryIntersectsFeature(t,e,i,r,a,c,u,p){const f=this.paint.get("heatmap-radius").evaluate(e,i);return Xd(t,r,c,u,p,!0,!0,new Ve(0,0),f)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(t){return new pa(this,t)}},hillshade:class extends Er{constructor(t){super(t,_f)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends Er{constructor(t){super(t,Pf)}getProgramIds(){const t=this.paint.get("fill-pattern"),e=t&&t.constantOr(1),i=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(t){return new pa(this,t)}recalculate(t,e){super.recalculate(t,e);const i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new _h(t)}queryRadius(){return dh(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,i,r,a,c){return!t.queryGeometry.isAboveHorizon&&jd(qd(t.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),r)}isTileClipped(){return!0}},"fill-extrusion":class extends Er{constructor(t){super(t,Yf)}createBucket(t){return new fc(t)}queryRadius(){return dh(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(t){return new pa(this,t)}queryIntersectsFeature(t,e,i,r,a,c,u,p,f){const _=Wd(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),x=this.paint.get("fill-extrusion-height").evaluate(e,i),w=this.paint.get("fill-extrusion-base").evaluate(e,i),M=[0,0],T=p&&c.elevation,S=c.elevation?c.elevation.exaggeration():1,k=t.tile.getBucket(this);if(T&&k instanceof fc){const H=k.centroidVertexArray,ee=f+1;ee<H.length&&(M[0]=H.geta_centroid_pos0(ee),M[1]=H.geta_centroid_pos1(ee))}if(0===M[0]&&1===M[1])return!1;"globe"===c.projection.name&&(r=mp([r],[new Ve(0,0),new Ve(Qe,Qe)],t.tileID.canonical).map(H=>H.polygon).flat());const R=T?p:null,[j,K]=(ee=r,Q=w,fe=x,ue=_,we=u,ze=R,ye=M,Ce=S,Te=c.center.lat,"globe"===(H=c).projection.name?function(Oe,xe,Ue,Xe,Ge,lt,Be,Je,ct,St,ht){const tt=[],$t=[],dt=Oe.projection.upVectorScale(ht,Oe.center.lat,Oe.worldSize).metersToTile,pt=[0,0,0,1],Bt=[0,0,0,1],jt=(Nt,ei,si,_i)=>{Nt[0]=ei,Nt[1]=si,Nt[2]=_i,Nt[3]=1},Gt=pp();Ue>0&&(Ue+=Gt),Xe+=Gt;for(const Nt of xe){const ei=[],si=[];for(const _i of Nt){const Vt=_i.x+Ge.x,Ei=_i.y+Ge.y,yi=Oe.projection.projectTilePoint(Vt,Ei,ht),ii=Oe.projection.upVector(ht,_i.x,_i.y);let kt=Ue,vi=Xe;if(Be){const Zt=yp(Vt,Ei,Ue,Xe,Be,Je,ct,St);kt+=Zt.base,vi+=Zt.top}0!==Ue?jt(pt,yi.x+ii[0]*dt*kt,yi.y+ii[1]*dt*kt,yi.z+ii[2]*dt*kt):jt(pt,yi.x,yi.y,yi.z),jt(Bt,yi.x+ii[0]*dt*vi,yi.y+ii[1]*dt*vi,yi.z+ii[2]*dt*vi),ui(pt,pt,lt),ui(Bt,Bt,lt),ei.push(new ll(pt[0],pt[1],pt[2])),si.push(new ll(Bt[0],Bt[1],Bt[2]))}
vendor: 14,436 bytes, line 1
1tt.push(ei),$t.push(si)}return[tt,$t]}(H,ee,Q,fe,ue,we,ze,ye,Ce,Te,t.tileID.canonical):ze?function(Oe,xe,Ue,Xe,Ge,lt,Be,Je,ct){const St=[],ht=[],tt=[0,0,0,1];for(const $t of Oe){const dt=[],pt=[];for(const Bt of $t){const jt=Bt.x+Xe.x,Gt=Bt.y+Xe.y,Nt=yp(jt,Gt,xe,Ue,lt,Be,Je,ct);tt[0]=jt,tt[1]=Gt,tt[2]=Nt.base,tt[3]=1,Ja(tt,tt,Ge),tt[3]=Math.max(tt[3],1e-5);const ei=new ll(tt[0]/tt[3],tt[1]/tt[3],tt[2]/tt[3]);tt[0]=jt,tt[1]=Gt,tt[2]=Nt.top,tt[3]=1,Ja(tt,tt,Ge),tt[3]=Math.max(tt[3],1e-5);const si=new ll(tt[0]/tt[3],tt[1]/tt[3],tt[2]/tt[3]);dt.push(ei),pt.push(si)}St.push(dt),ht.push(pt)}return[St,ht]}(ee,Q,fe,ue,we,ze,ye,Ce,Te):function(Oe,xe,Ue,Xe,Ge){const lt=[],Be=[],Je=Ge[8]*xe,ct=Ge[9]*xe,St=Ge[10]*xe,ht=Ge[11]*xe,tt=Ge[8]*Ue,$t=Ge[9]*Ue,dt=Ge[10]*Ue,pt=Ge[11]*Ue;for(const Bt of Oe){const jt=[],Gt=[];for(const Nt of Bt){const ei=Nt.x+Xe.x,si=Nt.y+Xe.y,_i=Ge[0]*ei+Ge[4]*si+Ge[12],Vt=Ge[1]*ei+Ge[5]*si+Ge[13],Ei=Ge[2]*ei+Ge[6]*si+Ge[14],yi=Ge[3]*ei+Ge[7]*si+Ge[15],ii=_i+Je,kt=Vt+ct,vi=Ei+St,Zt=Math.max(yi+ht,1e-5),cn=_i+tt,xi=Vt+$t,Oi=Ei+dt,zi=Math.max(yi+pt,1e-5);jt.push(new ll(ii/Zt,kt/Zt,vi/Zt)),Gt.push(new ll(cn/zi,xi/zi,Oi/zi))}lt.push(jt),Be.push(Gt)}return[lt,Be]}(ee,Q,fe,ue,we)),G=t.queryGeometry;var H,ee,Q,fe,ue,we,ze,ye,Ce,Te;return function(H,ee,Q){let fe=1/0;jd(Q,ee)&&(fe=_p(Q,ee[0]));for(let ue=0;ue<ee.length;ue++){const we=ee[ue],ze=H[ue];for(let ye=0;ye<we.length-1;ye++){const Ce=we[ye],Te=[Ce,we[ye+1],ze[ye+1],ze[ye],Ce];Ud(Q,Te)&&(fe=Math.min(fe,_p(Q,Te)))}}return fe!==1/0&&fe}(j,K,G.isPointQuery()?G.screenBounds:G.screenGeometry)}},line:class extends Er{constructor(t){super(t,vp),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){const e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof As,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=xp.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new wh(t)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getProgramConfiguration(t){return new pa(this,t)}queryRadius(t){const e=t,i=bp(ol("line-width",this,e),ol("line-gap-width",this,e)),r=ol("line-offset",this,e);return i/2+Math.abs(r)+dh(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,i,r,a,c){if(t.queryGeometry.isAboveHorizon)return!1;const u=qd(t.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),p=t.pixelToTileUnitsFactor/2*bp(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),f=this.paint.get("line-offset").evaluate(e,i);return f&&(r=function(_,x){const w=[],M=new Ve(0,0);for(let T=0;T<_.length;T++){const S=_[T],k=[];for(let R=0;R<S.length;R++){const j=S[R],K=S[R+1],G=0===R?M:j.sub(S[R-1])._unit()._perp(),H=R===S.length-1?M:K.sub(j)._unit()._perp(),ee=G._add(H)._unit();ee._mult(1/(ee.x*H.x+ee.y*H.y)),k.push(ee._mult(x)._add(j))}w.push(k)}return w}(r,f*t.pixelToTileUnitsFactor)),function(_,x,w){for(let M=0;M<x.length;M++){const T=x[M];if(_.length>=3)for(let S=0;S<T.length;S++)if(is(_,T[S]))return!0;if(lf(_,T,w))return!0}return!1}(u,r,p)}isTileClipped(){return!0}},symbol:Oh,background:class extends Er{constructor(t){super(t,Kg)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}},raster:class extends Er{constructor(t){super(t,Jg)}getProgramIds(){return["raster"]}},sky:class extends Er{constructor(t){super(t,e_),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"sky-gradient"===t?this._updateColorRamp():"sky-atmosphere-sun"!==t&&"sky-atmosphere-halo-color"!==t&&"sky-atmosphere-color"!==t&&"sky-atmosphere-sun-intensity"!==t||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=vu({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(t){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const e=t.style.light.properties.get("position");return this._lightPosition.azimuthal!==e.azimuthal||this._lightPosition.polar!==e.polar}return!1}getCenter(t,e){if("atmosphere"===this.paint.get("sky-type")){const r=this.paint.get("sky-atmosphere-sun"),a=!r,c=t.style.light,u=c.properties.get("position");return a&&"viewport"===c.properties.get("anchor")&&Ht("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),a?Gu(u.azimuthal,90-u.polar,e):Gu(r[0],90-r[1],e)}const i=this.paint.get("sky-gradient-center");return Gu(i[0],90-i[1],e)}is3D(){return!1}isSky(){return!0}markSkyboxValid(t){this._skyboxInvalidated=!1,this._lightPosition=t.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const t=this.paint.get("sky-type");return"atmosphere"===t?["skyboxCapture","skybox"]:"gradient"===t?["skyboxGradient"]:null}}};class Tc{constructor(e,i,r,a){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(i,a)}update(e,i,r){const{width:a,height:c}=e,{context:u}=this,{gl:p}=u,{HTMLImageElement:f,HTMLCanvasElement:_,HTMLVideoElement:x,ImageData:w,ImageBitmap:M}=Ie;if(p.bindTexture(p.TEXTURE_2D,this.texture),u.pixelStoreUnpackFlipY.set(!1),u.pixelStoreUnpack.set(1),u.pixelStoreUnpackPremultiplyAlpha.set(this.format===p.RGBA&&(!i||!1!==i.premultiply)),r||this.size&&this.size[0]===a&&this.size[1]===c){const{x:T,y:S}=r||{x:0,y:0};e instanceof f||e instanceof _||e instanceof x||e instanceof w||M&&e instanceof M?p.texSubImage2D(p.TEXTURE_2D,0,T,S,p.RGBA,p.UNSIGNED_BYTE,e):p.texSubImage2D(p.TEXTURE_2D,0,T,S,a,c,p.RGBA,p.UNSIGNED_BYTE,e.data)}else this.size=[a,c],e instanceof f||e instanceof _||e instanceof x||e instanceof w||M&&e instanceof M?p.texImage2D(p.TEXTURE_2D,0,this.format,this.format,p.UNSIGNED_BYTE,e):p.texImage2D(p.TEXTURE_2D,0,this.format,a,c,0,this.format,p.UNSIGNED_BYTE,e.data);this.useMipmap=Boolean(i&&i.useMipmap&&this.isSizePowerOfTwo()),this.useMipmap&&p.generateMipmap(p.TEXTURE_2D)}bind(e,i){const{context:r}=this,{gl:a}=r;a.bindTexture(a.TEXTURE_2D,this.texture),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,this.useMipmap?e===a.NEAREST?a.NEAREST_MIPMAP_NEAREST:a.LINEAR_MIPMAP_NEAREST:e),this.filter=e),i!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,i),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,i),this.wrap=i)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class i_{constructor(e){this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class n_{constructor(){this.tasks={},this.taskQueue=[],dr(["process"],this),this.invoker=new i_(this.process),this.nextId=0}add(e,i){const r=this.nextId++,a=function({type:c,isSymbolTile:u,zoom:p}){return p=p||0,"message"===c?0:"maybePrepare"!==c||u?"parseTile"!==c||u?"parseTile"===c&&u?300-p:"maybePrepare"===c&&u?400-p:500:200-p:100-p}(i);if(0===a){zn();try{e()}finally{}return{cancel:()=>{}}}return this.tasks[r]={fn:e,metadata:i,priority:a,id:r},this.taskQueue.push(r),this.invoker.trigger(),{cancel:()=>{delete this.tasks[r]}}}process(){zn();try{if(this.taskQueue=this.taskQueue.filter(r=>!!this.tasks[r]),!this.taskQueue.length)return;const e=this.pick();if(null===e)return;const i=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!i)return;i.fn()}finally{}}pick(){let e=null,i=1/0;for(let a=0;a<this.taskQueue.length;a++){const c=this.tasks[this.taskQueue[a]];c.priority<i&&(i=c.priority,e=a)}if(null===e)return null;const r=this.taskQueue[e];return this.taskQueue.splice(e,1),r}remove(){this.invoker.remove()}}class om{constructor(e){this._stringToNumber={},this._numberToString=[];for(let i=0;i<e.length;i++){const r=e[i];this._stringToNumber[r]=i,this._numberToString[i]=r}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}const r_=["tile","layer","source","sourceLayer","state"];class am{constructor(e,i,r,a,c){this.type="Feature",this._vectorTileFeature=e,this._z=i,this._x=r,this._y=a,this.properties=e.properties,this.id=c}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};void 0!==this.id&&(e.id=this.id);for(const i of r_)void 0!==this[i]&&(e[i]=this[i]);return e}}const va=new Uint16Array(8184);for(let t=0;t<2046;t++){let e=t+2,i=0,r=0,a=0,c=0,u=0,p=0;for(1&e?a=c=u=32:i=r=p=32;(e>>=1)>1;){const _=i+a>>1,x=r+c>>1;1&e?(a=i,c=r,i=u,r=p):(i=a,r=c,a=u,c=p),u=_,p=x}const f=4*t;va[f+0]=i,va[f+1]=r,va[f+2]=a,va[f+3]=c}const io=new Uint16Array(2178),xa=new Uint8Array(1089),Fh=new Uint16Array(1089);function sm(t){return 0===t?-.03125:32===t?.03125:0}var lm=ae([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const cm={type:2,extent:Qe,loadGeometry:()=>[[new Ve(0,0),new Ve(8193,0),new Ve(8193,8193),new Ve(0,8193),new Ve(0,0)]]};class Zu{constructor(e,i,r,a,c){this.tileID=e,this.uid=Or(),this.uses=0,this.tileSize=i,this.tileZoom=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=c,this.expiredRequestCount=0,this.state="loading",a&&a.transform&&(this.projection=a.transform.projection)}registerFadeDuration(e){const i=e+this.timeAdded;i<Hn.now()||this.fadeEndTime&&i<this.fadeEndTime||(this.fadeEndTime=i)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}get tileTransform(){return this._tileTransform||(this._tileTransform=rs(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(e,i,r){if(this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(a,c){const u={};if(!c)return u;for(const p of a){const f=p.layerIds.map(_=>c.getLayer(_)).filter(Boolean);if(0!==f.length){p.layers=f,p.stateDependentLayerIds&&(p.stateDependentLayers=p.stateDependentLayerIds.map(_=>f.filter(x=>x.id===_)[0]));for(const _ of f)u[_.id]=p}}return u}(e.buckets,i.style),this.hasSymbolBuckets=!1;for(const a in this.buckets){const c=this.buckets[a];if(c instanceof ya){if(this.hasSymbolBuckets=!0,!r)break;c.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const a in this.buckets){const c=this.buckets[a];if(c instanceof ya&&c.hasRTLText){this.hasRTLText=!0,v.isLoading()||v.isLoaded()||"deferred"!==m()||y();break}}this.queryPadding=0;for(const a in this.buckets){const c=this.buckets[a];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(a).queryRadius(c))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),e.lineAtlas&&(this.lineAtlas=e.lineAtlas)}else this.collisionBoxArray=new Ot}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(e){return this.buckets[e.id]}upload(e){for(const r in this.buckets){const a=this.buckets[r];a.uploadPending()&&a.upload(e)}const i=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Tc(e,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Tc(e,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new Tc(e,this.lineAtlas.image,i.ALPHA),this.lineAtlas.uploaded=!0)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,i,r,a,c,u,p,f){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:a,pixelPosMatrix:p,transform:u,params:c,tileTransform:this.tileTransform},e,i,r):{}}querySourceFeatures(e,i){const r=this.latestFeatureIndex;if(!r||!r.rawTileData)return;const a=r.loadVTLayers(),c=i?i.sourceLayer:"",u=a._geojsonTileLayer||a[c];if(!u)return;const p=Ws(i&&i.filter),{z:f,x:_,y:x}=this.tileID.canonical,w={z:f,x:_,y:x};for(let M=0;M<u.length;M++){const T=u.feature(M);if(p.needGeometry){const R=ts(T,!0);
1if(!p.filter(new b(this.tileID.overscaledZ),R,this.tileID.canonical))continue}else if(!p.filter(new b(this.tileID.overscaledZ),T))continue;const S=r.getId(T,c),k=new am(T,f,_,x,S);k.tile=w,e.push(k)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return!!this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const i=this.expirationTime;if(e.cacheControl){const r=qi(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const r=Date.now();let a=!1;if(this.expirationTime>r)a=!1;else if(i)if(this.expirationTime<i)a=!0;else{const c=this.expirationTime-i;c?this.expirationTime=r+Math.max(c,3e4):a=!0}else a=!0;a?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}setFeatureState(e,i){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(e).length||!i)return;const r=this.latestFeatureIndex.loadVTLayers(),a=i.style.listImages();for(const c in this.buckets){if(!i.style.hasLayer(c))continue;const u=this.buckets[c],p=u.layers[0].sourceLayer||"_geojsonTileLayer",f=r[p],_=e[p];if(!f||!_||0===Object.keys(_).length)continue;if(u.update(_,f,a,this.imageAtlas&&this.imageAtlas.patternPositions||{}),u instanceof wh||u instanceof _h){const w=i.style._getSourceCache(u.layers[0].source);i._terrain&&i._terrain.enabled&&w&&u.programConfigurations.needsUpload&&i._terrain._clearRenderCacheForTile(w.id,this.tileID)}const x=i&&i.style&&i.style.getLayer(c);x&&(this.queryPadding=Math.max(this.queryPadding,x.queryRadius(u)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Hn.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=Hn.now()+e}setTexture(e,i){const r=i.context,a=r.gl;this.texture=this.texture||i.getTileTexture(e.width),this.texture?this.texture.update(e,{useMipmap:!0}):(this.texture=new Tc(r,e,a.RGBA,{useMipmap:!0}),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE))}setDependencies(e,i){const r={};for(const a of i)r[a]=!0;this.dependencies[e]=r}hasDependency(e,i){for(const r of e){const a=this.dependencies[r];if(a)for(const c of i)if(a[c])return!0}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(e,i){if(!i||"mercator"===i.name||this._tileDebugBuffer)return;const r=Po(cm,this.tileID.canonical,this.tileTransform)[0],a=new ke,c=new Mn;for(let u=0;u<r.length;u++){const{x:p,y:f}=r[u];a.emplaceBack(p,f),c.emplaceBack(u)}c.emplaceBack(0),this._tileDebugIndexBuffer=e.createIndexBuffer(c),this._tileDebugBuffer=e.createVertexBuffer(a,rc.members),this._tileDebugSegments=fi.simpleSegment(0,0,a.length,c.length)}_makeTileBoundsBuffers(e,i){if(this._tileBoundsBuffer||!i||"mercator"===i.name)return;const r=Po(cm,this.tileID.canonical,this.tileTransform)[0];let a,c;if(this.isRaster){const u=function(p,f){const _=rs(p,f),x=Math.pow(2,p.z);for(let R=0;R<33;R++)for(let j=0;j<33;j++){const K=jn((p.x+(j+sm(j))/32)/x),G=ji((p.y+(R+sm(R))/32)/x),H=f.project(K,G),ee=33*R+j;io[2*ee+0]=Math.round((H.x*_.scale-_.x)*Qe),io[2*ee+1]=Math.round((H.y*_.scale-_.y)*Qe)}xa.fill(0),Fh.fill(0);for(let R=2045;R>=0;R--){const j=4*R,K=va[j+0],G=va[j+1],H=va[j+2],ee=va[j+3],Q=K+H>>1,fe=G+ee>>1,ue=Q+fe-G,we=fe+K-Q,ze=33*G+K,ye=33*ee+H,Ce=33*fe+Q,Te=Math.hypot((io[2*ze+0]+io[2*ye+0])/2-io[2*Ce+0],(io[2*ze+1]+io[2*ye+1])/2-io[2*Ce+1])>=16;xa[Ce]=xa[Ce]||(Te?1:0),R<1022&&(xa[Ce]=xa[Ce]||xa[33*(G+we>>1)+(K+ue>>1)]||xa[33*(ee+we>>1)+(H+ue>>1)])}const w=new Ee,M=new Ye;let T=0;function S(R,j){const K=33*j+R;return 0===Fh[K]&&(w.emplaceBack(io[2*K+0],io[2*K+1],R*Qe/32,j*Qe/32),Fh[K]=++T),Fh[K]-1}function k(R,j,K,G,H,ee){const Q=R+K>>1,fe=j+G>>1;if(Math.abs(R-H)+Math.abs(j-ee)>1&&xa[33*fe+Q])k(H,ee,R,j,Q,fe),k(K,G,H,ee,Q,fe);else{const ue=S(R,j),we=S(K,G),ze=S(H,ee);M.emplaceBack(ue,we,ze)}}return k(0,0,32,32,32,0),k(32,32,0,0,0,32),{vertices:w,indices:M}}(this.tileID.canonical,i);a=u.vertices,c=u.indices}else{a=new Ee,c=new Ye;for(const{x:p,y:f}of r)a.emplaceBack(p,f,0,0);const u=Eu(a.int16,void 0,4);for(let p=0;p<u.length;p+=3)c.emplaceBack(u[p],u[p+1],u[p+2])}this._tileBoundsBuffer=e.createVertexBuffer(a,lm.members),this._tileBoundsIndexBuffer=e.createIndexBuffer(c),this._tileBoundsSegments=fi.simpleSegment(0,0,a.length,c.length)}_makeGlobeTileDebugBuffers(e,i){const r=i.projection;if(!r||"globe"!==r.name||i.freezeTileCoverage)return;const a=this.tileID.canonical,c=sc(Dd(a,i)),u=nl(i.zoom);let p;u>0&&(p=Jh(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(e,a,i,c,p,u),this._makeGlobeTileDebugTextBuffer(e,a,i,c,p,u)}_globePoint(e,i,r,a,c,u,p){let f=ac(e,i,r);if(u){const _=1<<r.z,x=Qr(a.center.lng),w=eo(a.center.lat),M=(r.x+.5)/_-x;let T=0;M>.5?T=-1:M<-.5&&(T=1);let S=(e/Qe+r.x)/_+T,k=(i/Qe+r.y)/_;S=(S-x)*a._pixelsPerMercatorPixel+x,k=(k-w)*a._pixelsPerMercatorPixel+w;const R=[S*a.worldSize,k*a.worldSize,0];ui(R,R,u),f=es(f,R,p)}return ui(f,f,c)}_makeGlobeTileDebugBorderBuffer(e,i,r,a,c,u){const p=new ke,f=new Mn,_=new he,x=(M,T,S,k,R)=>{const j=(S-M)/(R-1),K=(k-T)/(R-1),G=p.length;for(let H=0;H<R;H++){const ee=M+H*j,Q=T+H*K;p.emplaceBack(ee,Q);const fe=this._globePoint(ee,Q,i,r,a,c,u);_.emplaceBack(fe[0],fe[1],fe[2]),f.emplaceBack(G+H)}},w=Qe;
vendor: 11,044 bytes, line 1
1x(0,0,w,0,16),x(w,0,w,w,16),x(w,w,0,w,16),x(0,w,0,0,16),this._tileDebugIndexBuffer=e.createIndexBuffer(f),this._tileDebugBuffer=e.createVertexBuffer(p,rc.members),this._globeTileDebugBorderBuffer=e.createVertexBuffer(_,Sd.members),this._tileDebugSegments=fi.simpleSegment(0,0,p.length,f.length)}_makeGlobeTileDebugTextBuffer(e,i,r,a,c,u){const f=new ke,_=new Ye,x=new he,w=25;_.reserve(32),f.reserve(w),x.reserve(w);const M=(T,S)=>w*T+S;for(let T=0;T<w;T++){const S=2048*T;for(let k=0;k<w;k++){const R=2048*k;f.emplaceBack(R,S);const j=this._globePoint(R,S,i,r,a,c,u);x.emplaceBack(j[0],j[1],j[2])}}for(let T=0;T<4;T++)for(let S=0;S<4;S++){const k=M(T,S),R=M(T,S+1),j=M(T+1,S),K=M(T+1,S+1);_.emplaceBack(k,R,j),_.emplaceBack(j,R,K)}this._tileDebugTextIndexBuffer=e.createIndexBuffer(_),this._tileDebugTextBuffer=e.createVertexBuffer(f,rc.members),this._globeTileDebugTextBuffer=e.createVertexBuffer(x,Sd.members),this._tileDebugTextSegments=fi.simpleSegment(0,0,w,32)}}class o_{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,i,r){const a=String(i);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][a]=this.stateChanges[e][a]||{},ni(this.stateChanges[e][a],r),null===this.deletedStates[e]){this.deletedStates[e]={};for(const c in this.state[e])c!==a&&(this.deletedStates[e][c]=null)}else if(this.deletedStates[e]&&null===this.deletedStates[e][a]){this.deletedStates[e][a]={};for(const c in this.state[e][a])r[c]||(this.deletedStates[e][a][c]=null)}else for(const c in r)this.deletedStates[e]&&this.deletedStates[e][a]&&null===this.deletedStates[e][a][c]&&delete this.deletedStates[e][a][c]}removeFeatureState(e,i,r){if(null===this.deletedStates[e])return;const a=String(i);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&void 0!==i)null!==this.deletedStates[e][a]&&(this.deletedStates[e][a]=this.deletedStates[e][a]||{},this.deletedStates[e][a][r]=null);else if(void 0!==i)if(this.stateChanges[e]&&this.stateChanges[e][a])for(r in this.deletedStates[e][a]={},this.stateChanges[e][a])this.deletedStates[e][a][r]=null;else this.deletedStates[e][a]=null;else this.deletedStates[e]=null}getState(e,i){const r=String(i),a=ni({},(this.state[e]||{})[r],(this.stateChanges[e]||{})[r]);if(null===this.deletedStates[e])return{};if(this.deletedStates[e]){const c=this.deletedStates[e][i];if(null===c)return{};for(const u in c)delete a[u]}return a}initializeTileState(e,i){e.setFeatureState(this.state,i)}coalesceChanges(e,i){const r={};for(const a in this.stateChanges){this.state[a]=this.state[a]||{};const c={};for(const u in this.stateChanges[a])this.state[a][u]||(this.state[a][u]={}),ni(this.state[a][u],this.stateChanges[a][u]),c[u]=this.state[a][u];r[a]=c}for(const a in this.deletedStates){this.state[a]=this.state[a]||{};const c={};if(null===this.deletedStates[a])for(const u in this.state[a])c[u]={},this.state[a][u]={};else for(const u in this.deletedStates[a]){if(null===this.deletedStates[a][u])this.state[a][u]={};else if(this.state[a][u])for(const p of Object.keys(this.deletedStates[a][u]))delete this.state[a][u][p];c[u]=this.state[a][u]}r[a]=r[a]||{},ni(r[a],c)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(const a in e)e[a].setFeatureState(r,i)}}class hm{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,i){const r=this.toIdx(e,i);return{min:this.minimums[r],max:this.maximums[r]}}isLeaf(e,i){return this.leaves[this.toIdx(e,i)]}toIdx(e,i){return i*this.size+e}}function um(t,e,i,r){let a=0,c=Number.MAX_VALUE;for(let u=0;u<3;u++)if(Math.abs(r[u])<1e-15){if(i[u]<t[u]||i[u]>e[u])return null}else{const p=1/r[u];let f=(t[u]-i[u])*p,_=(e[u]-i[u])*p;if(f>_){const x=f;f=_,_=x}if(f>a&&(a=f),_<c&&(c=_),a>c)return null}return a}function dm(t,e,i,r,a,c,u,p,f,_,x){const w=r-t,M=a-e,T=c-i,S=u-t,k=p-e,R=f-i,j=x[1]*R-x[2]*k,K=x[2]*S-x[0]*R,G=x[0]*k-x[1]*S,H=w*j+M*K+T*G;if(Math.abs(H)<1e-15)return null;const ee=1/H,Q=_[0]-t,fe=_[1]-e,ue=_[2]-i,we=(Q*j+fe*K+ue*G)*ee;if(we<0||we>1)return null;const ze=fe*T-ue*M,ye=ue*w-Q*T,Ce=Q*M-fe*w,Te=(x[0]*ze+x[1]*ye+x[2]*Ce)*ee;return Te<0||we+Te>1?null:(S*ze+k*ye+R*Ce)*ee}function pm(t,e,i){return(t-e)/(i-e)}function mm(t,e,i,r,a,c,u,p,f){const _=1<<i,x=c-r,w=u-a,M=(t+1)/_*x+r,T=(e+0)/_*w+a,S=(e+1)/_*w+a;p[0]=(t+0)/_*x+r,p[1]=T,f[0]=M,f[1]=S}class fm{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const i=function(c){const u=Math.ceil(Math.log2(c.dim/8)),p=[];let f=Math.ceil(Math.pow(2,u));const _=1/f,x=(T,S,k,R,j)=>{const K=R?1:0,G=(T+1)*k-K,H=S*k,ee=(S+1)*k-K;j[0]=T*k,j[1]=H,j[2]=G,j[3]=ee};let w=new hm(f);const M=[];for(let T=0;T<f*f;T++){x(T%f,Math.floor(T/f),_,!1,M);const S=ba(M[0],M[1],c),k=ba(M[2],M[1],c),R=ba(M[2],M[3],c),j=ba(M[0],M[3],c);w.minimums.push(Math.min(S,k,R,j)),w.maximums.push(Math.max(S,k,R,j)),w.leaves.push(1)}for(p.push(w),f/=2;f>=1;f/=2){const T=p[p.length-1];w=new hm(f);for(let S=0;S<f*f;S++){x(S%f,Math.floor(S/f),2,!0,M);const k=T.getElevation(M[0],M[1]),R=T.getElevation(M[2],M[1]),j=T.getElevation(M[2],M[3]),K=T.getElevation(M[0],M[3]),G=T.isLeaf(M[0],M[1]),H=T.isLeaf(M[2],M[1]),ee=T.isLeaf(M[2],M[3]),Q=T.isLeaf(M[0],M[3]),fe=Math.min(k.min,R.min,j.min,K.min),ue=Math.max(k.max,R.max,j.max,K.max),we=G&&H&&ee&&Q;w.maximums.push(ue),w.minimums.push(fe),w.leaves.push(ue-fe<=5&&we?1:0)}p.push(w)}return p}(this.dem),r=i.length-1,a=i[r];this._addNode(a.minimums[0],a.maximums[0],a.leaves[0]),this._construct(i,0,0,r,0)}raycastRoot(e,i,r,a,c,u,p=1){return um([e,i,-100],[r,a,this.maximums[0]*p],c,u)}raycast(e,i,r,a,c,u,p=1){if(!this.nodeCount)return null;const f=this.raycastRoot(e,i,r,a,c,u,p);if(null==f)return null;const _=[],x=[],w=[],M=[],T=[{idx:0,t:f,nodex:0,nodey:0,depth:0}];for(;T.length>0;){const{idx:S,t:k,nodex:R,nodey:j,depth:K}=T.pop();if(this.leaves[S]){mm(R,j,K,e,i,r,a,w,M);const H=1<<K,ee=(R+0)/H,Q=(R+1)/H,fe=(j+0)/H,ue=(j+1)/H,we=ba(ee,fe,this.dem)*p,ze=ba(Q,fe,this.dem)*p,ye=ba(Q,ue,this.dem)*p,Ce=ba(ee,ue,this.dem)*p,Te=dm(w[0],w[1],we,M[0],w[1],ze,M[0],M[1],ye,c,u),Ae=dm(M[0],M[1],ye,w[0],M[1],Ce,w[0],w[1],we,c,u),Oe=Math.min(null!==Te?Te:Number.MAX_VALUE,null!==Ae?Ae:Number.MAX_VALUE);if(Oe!==Number.MAX_VALUE)return Oe;{const xe=ic([],c,u,k);if(gm(we,ze,Ce,ye,pm(xe[0],w[0],M[0]),pm(xe[1],w[1],M[1]))>=xe[2])return k}continue}let G=0;for(let H=0;H<this._siblingOffset.length;H++){mm((R<<1)+this._siblingOffset[H][0],(j<<1)+this._siblingOffset[H][1],K+1,e,i,r,a,w,M),w[2]=-100,M[2]=this.maximums[this.childOffsets[S]+H]*p;const ee=um(w,M,c,u);if(null!=ee){const Q=ee;_[H]=Q;let fe=!1;for(let ue=0;ue<G&&!fe;ue++)Q>=_[x[ue]]&&(x.splice(ue,0,H),fe=!0);fe||(x[G]=H),G++}}for(let H=0;H<G;H++){const ee=x[H];T.push({idx:this.childOffsets[S]+ee,t:_[ee],nodex:(R<<1)+this._siblingOffset[ee][0],nodey:(j<<1)+this._siblingOffset[ee][1],depth:K+1})}}return null}_addNode(e,i,r){return this.minimums.push(e),this.maximums.push(i),this.leaves.push(r),this.childOffsets.push(0),this.nodeCount++}_construct(e,i,r,a,c){if(1===e[a].isLeaf(i,r))return;this.childOffsets[c]||(this.childOffsets[c]=this.nodeCount);const u=a-1,p=e[u];let f=0,_=0;for(let x=0;x<this._siblingOffset.length;x++){const w=2*i+this._siblingOffset[x][0],M=2*r+this._siblingOffset[x][1],T=p.getElevation(w,M),S=p.isLeaf(w,M),k=this._addNode(T.min,T.max,S);S&&(f|=1<<x),_||(_=k)}for(let x=0;x<this._siblingOffset.length;x++)f&1<<x||this._construct(e,2*i+this._siblingOffset[x][0],2*r+this._siblingOffset[x][1],u,_+x)}}function gm(t,e,i,r,a,c){return Ct(Ct(t,i,c),Ct(e,r,c),a)}function ba(t,e,i){const r=i.dim,a=rt(t*r-.5,0,r-1),c=rt(e*r-.5,0,r-1),u=Math.floor(a),p=Math.floor(c),f=Math.min(u+1,r-1),_=Math.min(p+1,r-1);return gm(i.get(u,p),i.get(f,p),i.get(u,_),i.get(f,_),a-u,c-p)}const _m={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function a_(t,e,i){return(256*t*256+256*e+i)/10-1e4}function s_(t,e,i){return 256*t+e+i/256-32768}class Bh{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,i,r,a=!1,c=!1){if(this.uid=e,i.height!==i.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return Ht(`"${r}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=i.height;const u=this.dim=i.height-2,p=new Uint32Array(i.data.buffer);if(this.pixels=new Uint8Array(i.data.buffer),this.encoding=r||"mapbox",this.borderReady=a,!a){for(let f=0;f<u;f++)p[this._idx(-1,f)]=p[this._idx(0,f)],p[this._idx(u,f)]=p[this._idx(u-1,f)],p[this._idx(f,-1)]=p[this._idx(f,0)],p[this._idx(f,u)]=p[this._idx(f,u-1)];p[this._idx(-1,-1)]=p[this._idx(0,0)],p[this._idx(u,-1)]=p[this._idx(u-1,0)],p[this._idx(-1,u)]=p[this._idx(0,u-1)],p[this._idx(u,u)]=p[this._idx(u-1,u-1)],c&&this._buildQuadTree()}}_buildQuadTree(){this._tree=new fm(this)}get(e,i,r=!1){r&&(e=rt(e,-1,this.dim),i=rt(i,-1,this.dim));const a=4*this._idx(e,i);return("terrarium"===this.encoding?s_:a_)(this.pixels[a],this.pixels[a+1],this.pixels[a+2])}static getUnpackVector(e){return _m[e]}get unpackVector(){return _m[this.encoding]}_idx(e,i){if(e<-1||e>=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(e+1)}static pack(e,i){const r=[0,0,0,0],a=Bh.getUnpackVector(i);let c=Math.floor((e+a[3])/a[2]);return r[2]=c%256,c=Math.floor(c/256),r[1]=c%256,c=Math.floor(c/256),r[0]=c,r}getPixels(){return new Cn({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,i,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let a=i*this.dim,c=i*this.dim+this.dim,u=r*this.dim,p=r*this.dim+this.dim;switch(i){case-1:a=c-1;break;case 1:c=a+1}switch(r){case-1:u=p-1;break;case 1:p=u+1}const f=-i*this.dim,_=-r*this.dim;for(let x=u;x<p;x++)for(let w=a;w<c;w++){const M=4*this._idx(w,x),T=4*this._idx(w+f,x+_);this.pixels[M+0]=e.pixels[T+0],this.pixels[M+1]=e.pixels[T+1],this.pixels[M+2]=e.pixels[T+2],this.pixels[M+3]=e.pixels[T+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}qe(Bh,"DEMData"),qe(fm,"DemMinMaxQuadTree",{omit:["dem"]});class l_{constructor(e,i){this.max=e,this.onRemove=i,this.reset()}reset(){for(const e in this.data)for(const i of this.data[e])i.timeout&&clearTimeout(i.timeout),this.onRemove(i.value);return this.data={},this.order=[],this}add(e,i,r){const a=e.wrapped().key;void 0===this.data[a]&&(this.data[a]=[]);const c={value:i,timeout:void 0};if(void 0!==r&&(c.timeout=setTimeout(()=>{this.remove(e,c)},r)),this.data[a].push(c),this.order.push(a),this.order.length>this.max){const u=this._getAndRemoveByKey(this.order[0]);u&&this.onRemove(u)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const i=this.data[e].shift();return i.timeout&&clearTimeout(i.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),i.value}getByKey(e){const i=this.data[e];return i?i[0].value:null}
1get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,i){if(!this.has(e))return this;const r=e.wrapped().key,a=void 0===i?0:this.data[r].indexOf(i),c=this.data[r][a];return this.data[r].splice(a,1),c.timeout&&clearTimeout(c.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(c.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const i=this._getAndRemoveByKey(this.order[0]);i&&this.onRemove(i)}return this}filter(e){const i=[];for(const r in this.data)for(const a of this.data[r])e(a.value)||i.push(a);for(const r of i)this.remove(r.value.tileID,r)}}class yl{constructor(e,i,r){this.func=e,this.mask=i,this.range=r}}yl.ReadOnly=!1,yl.ReadWrite=!0,yl.disabled=new yl(519,yl.ReadOnly,[0,1]);class qu{constructor(e,i,r,a,c,u){this.test=e,this.ref=i,this.mask=r,this.fail=a,this.depthFail=c,this.pass=u}}qu.disabled=new qu({func:519,mask:0},0,0,7680,7680,7680);class no{constructor(e,i,r){this.blendFunction=e,this.blendColor=i,this.mask=r}}no.Replace=[1,0],no.disabled=new no(no.Replace,ai.transparent,[!1,!1,!1,!1]),no.unblended=new no(no.Replace,ai.transparent,[!0,!0,!0,!0]),no.alphaBlended=new no([1,771],ai.transparent,[!0,!0,!0,!0]);class Dr{constructor(e,i,r){this.enable=e,this.mode=i,this.frontFace=r}}Dr.disabled=new Dr(!1,1029,2305),Dr.backCCW=new Dr(!0,1029,2305),Dr.backCW=new Dr(!0,1029,2304),Dr.frontCW=new Dr(!0,1028,2304),Dr.frontCCW=new Dr(!0,1028,2305);class os extends qo{constructor(e,i,r){super(),this.id=e,this._onlySymbols=r,i.on("data",a=>{"source"===a.dataType&&"metadata"===a.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===a.dataType&&"content"===a.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))}),i.on("error",()=>{this._sourceErrored=!0}),this._source=i,this._tiles={},this._cache=new l_(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=i.minTileCacheSize,this._maxTileCacheSize=i.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new o_,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"custom"===this._source.type&&"raster"===this._source._dataType}onAdd(e){this.map=e,this._minTileCacheSize=void 0===this._minTileCacheSize&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const e in this._tiles){const i=this._tiles[e];if("loaded"!==i.state&&"errored"!==i.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,i){return e.isSymbolTile=this._onlySymbols,this._source.loadTile(e,i)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,()=>{})}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e,()=>{})}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const i in this._tiles){const r=this._tiles[i];r.upload(e),r.prepare(this.map.style.imageManager)}}getIds(){return $n(this._tiles).map(e=>e.tileID).sort(ym).map(e=>e.key)}getRenderableIds(e){const i=[];for(const r in this._tiles)this._isIdRenderable(+r,e)&&i.push(this._tiles[r]);return e?i.sort((r,a)=>{const c=r.tileID,u=a.tileID,p=new Ve(c.canonical.x,c.canonical.y)._rotate(this.transform.angle),f=new Ve(u.canonical.x,u.canonical.y)._rotate(this.transform.angle);return c.overscaledZ-u.overscaledZ||f.y-p.y||f.x-p.x}).map(r=>r.tileID.key):i.map(r=>r.tileID).sort(ym).map(r=>r.key)}hasRenderableParent(e){const i=this.findLoadedParent(e,0);return!!i&&this._isIdRenderable(i.tileID.key)}_isIdRenderable(e,i){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(i||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(+e,"reloading")}}_reloadTile(e,i){const r=this._tiles[e];r&&("loading"!==r.state&&(r.state=i),this._loadTile(r,this._tileLoaded.bind(this,r,e,i)))}_tileLoaded(e,i,r,a){if(a)if(e.state="errored",404!==a.status)this._source.fire(new Kn(a,{tile:e}));else if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const c=this.map.painter.terrain;this.update(this.transform,c.getScaledDemTileSize(),!0),c.resetTileLookupCache(this.id
vendor: 4,687 bytes, line 1
1)}else this.update(this.transform);else e.timeAdded=Hn.now(),"expired"===r&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),"raster-dem"===this._source.type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new jr("data",{dataType:"source",tile:e,coord:e.tileID,sourceCacheId:this.id}))}_backfillDEM(e){const i=this.getRenderableIds();for(let a=0;a<i.length;a++){const c=i[a];if(e.neighboringTiles&&e.neighboringTiles[c]){const u=this.getTileByID(c);r(e,u),r(u,e)}}function r(a,c){if(!a.dem||a.dem.borderReady)return;a.needsHillshadePrepare=!0,a.needsDEMTextureUpload=!0;let u=c.tileID.canonical.x-a.tileID.canonical.x;const p=c.tileID.canonical.y-a.tileID.canonical.y,f=Math.pow(2,a.tileID.canonical.z),_=c.tileID.key;0===u&&0===p||Math.abs(p)>1||(Math.abs(u)>1&&(1===Math.abs(u+f)?u+=f:1===Math.abs(u-f)&&(u-=f)),c.dem&&a.dem&&(a.dem.backfillBorder(c.dem,u,p),a.neighboringTiles&&a.neighboringTiles[_]&&(a.neighboringTiles[_].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,i,r,a){for(const c in this._tiles){let u=this._tiles[c];if(a[c]||!u.hasData()||u.tileID.overscaledZ<=i||u.tileID.overscaledZ>r)continue;let p=u.tileID;for(;u&&u.tileID.overscaledZ>i+1;){const _=u.tileID.scaledTo(u.tileID.overscaledZ-1);u=this._tiles[_.key],u&&u.hasData()&&(p=_)}let f=p;for(;f.overscaledZ>i;)if(f=f.scaledTo(f.overscaledZ-1),e[f.key]){a[p.key]=p;break}}}findLoadedParent(e,i){if(e.key in this._loadedParentTiles){const r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=i?r:null}for(let r=e.overscaledZ-1;r>=i;r--){const a=e.scaledTo(r),c=this._getLoadedTile(a);if(c)return c}}_getLoadedTile(e){const i=this._tiles[e.key];return i&&i.hasData()?i:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,i){i=i||this._source.tileSize;const r=Math.ceil(e.width/i)+1,a=Math.ceil(e.height/i)+1,c=Math.floor(r*a*5),u="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,c):c,p="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,u):u;this._cache.setMaxSize(p)}handleWrapJump(e){const i=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,i){const r={};for(const a in this._tiles){const c=this._tiles[a];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+i),r[c.tileID.key]=c}this._tiles=r;for(const a in this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(const a in this._tiles)this._setTileReloadTimer(+a,this._tiles[a])}}update(e,i,r){if(this.transform=e,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!r)return;let a;this.updateCacheSize(e,i),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?a=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(p=>new ln(p.canonical.z,p.wrap,p.canonical.z,p.canonical.x,p.canonical.y)):(a=e.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!r,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(a=a.filter(p=>this._source.hasTile(p)))):a=[];const c=this._updateRetainedTiles(a);if(vm(this._source.type)&&0!==a.length){const p={},f={},_=Object.keys(c);for(const w of _){const M=c[w],T=this._tiles[w];if(!T||T.fadeEndTime&&T.fadeEndTime<=Hn.now())continue;const S=this.findLoadedParent(M,Math.max(M.overscaledZ-os.maxOverzooming,this._source.minzoom));S&&(this._addTile(S.tileID),p[S.tileID.key]=S.tileID),f[w]=M}const x=a[a.length-1].overscaledZ;for(const w in this._tiles){const M=this._tiles[w];if(c[w]||!M.hasData())continue;let T=M.tileID;for(;T.overscaledZ>x;){T=T.scaledTo(T.overscaledZ-1);const S=this._tiles[T.key];if(S&&S.hasData()&&f[T.key]){c[w]=M.tileID;break}}}for(const w in p)c[w]||(this._coveredTiles[w]=!0,c[w]=p[w])}for(const p in c)this._tiles[p].clearFadeHold();const u=function(p,f){const _=[];for(const x in p)x in f||_.push(x);return _}(this._tiles,c);for(const p of u){const f=this._tiles[p];f.hasSymbolBuckets&&!f.holdingForFade()?f.setHoldDuration(this.map._fadeDuration):f.hasSymbolBuckets&&!f.symbolFadeFinished()||this._removeTile(+p)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const i={};if(0===e.length)return i;const r={},a=e.reduce((_,x)=>
1Math.min(_,x.overscaledZ),1/0),c=e[0].overscaledZ,u=Math.max(c-os.maxOverzooming,this._source.minzoom),p=Math.max(c+os.maxUnderzooming,this._source.minzoom),f={};for(const _ of e){const x=this._addTile(_);i[_.key]=_,x.hasData()||a<this._source.maxzoom&&(f[_.key]=_)}this._retainLoadedChildren(f,a,p,i);for(const _ of e){let x=this._tiles[_.key];if(x.hasData())continue;if(_.canonical.z>=this._source.maxzoom){const M=_.children(this._source.maxzoom)[0],T=this.getTile(M);if(T&&T.hasData()){i[M.key]=M;continue}}else{const M=_.children(this._source.maxzoom);if(i[M[0].key]&&i[M[1].key]&&i[M[2].key]&&i[M[3].key])continue}let w=x.wasRequested();for(let M=_.overscaledZ-1;M>=u;--M){const T=_.scaledTo(M);if(r[T.key]||(r[T.key]=!0,x=this.getTile(T),!x&&w&&(x=this._addTile(T)),x&&(i[T.key]=T,w=x.wasRequested(),x.hasData())))break}}return i}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const i=[];let r,a=this._tiles[e].tileID;for(;a.overscaledZ>0;){if(a.key in this._loadedParentTiles){r=this._loadedParentTiles[a.key];break}i.push(a.key);const c=a.scaledTo(a.overscaledZ-1);if(r=this._getLoadedTile(c),r)break;a=c}for(const c of i)this._loadedParentTiles[c]=r}}_addTile(e){let i=this._tiles[e.key];if(i)return i;i=this._cache.getAndRemove(e),i&&(this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,i)));const r=Boolean(i);if(!r){const a=this.map?this.map.painter:null;i=new Zu(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,a,this._isRaster),this._loadTile(i,this._tileLoaded.bind(this,i,e.key,i.state))}return i?(i.uses++,this._tiles[e.key]=i,r||this._source.fire(new jr("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null}_setTileReloadTimer(e,i){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const r=i.getExpiryTimeout();r&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},r))}_removeTile(e){const i=this._tiles[e];i&&(i.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),i.uses>0||(i.hasData()&&"reloading"!==i.state?this._cache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(e,i,r){const a=[],c=this.transform;if(!c)return a;const u="globe"===c.projection.name,p=Qr(c.center.lng);for(const f in this._tiles){const _=this._tiles[f];if(r&&_.clearQueryDebugViz(),_.holdingForFade())continue;let x;if(u){const w=_.tileID.canonical;if(0===w.z){const M=[Math.abs(rt(p,...Sc(w,-1))-p),Math.abs(rt(p,...Sc(w,1))-p)];x=[0,2*M.indexOf(Math.min(...M))-1]}else{const M=[Math.abs(rt(p,...Sc(w,-1))-p),Math.abs(rt(p,...Sc(w,0))-p),Math.abs(rt(p,...Sc(w,1))-p)];x=[M.indexOf(Math.min(...M))-1]}}else x=[0];for(const w of x){const M=e.containsTile(_,c,i,w);M&&a.push(M)}}return a}getVisibleCoordinates(e){const i=this.getRenderableIds(e).map(r=>this._tiles[r].tileID);for(const r of i)r.projMatrix=this.transform.calculateProjMatrix(r.toUnwrapped());return i}hasTransition(){if(this._source.hasTransition())return!0;if(vm(this._source.type))for(const e in this._tiles){const i=this._tiles[e];if(void 0!==i.fadeEndTime&&i.fadeEndTime>=Hn.now())return!0}return!1}setFeatureState(e,i,r){this._state.updateState(e=e||"_geojsonTileLayer",i,r)}removeFeatureState(e,i,r){this._state.removeFeatureState(e=e||"_geojsonTileLayer",i,r)}getFeatureState(e,i){return this._state.getState(e=e||"_geojsonTileLayer",i)}setDependencies(e,i,r){const a=this._tiles[e];a&&a.setDependencies(i,r)}reloadTilesForDependencies(e,i){for(const r in this._tiles)this._tiles[r].hasDependency(e,i)&&this._reloadTile(+r,"reloading");this._cache.filter(r=>!r.hasDependency(e,i))}_preloadTiles(e,i){if(!this._sourceLoaded){const p=()=>{this._sourceLoaded&&(this._source.off("data",p),this._preloadTiles(e,i))};return void this._source.on("data",p)}const r=new Map,a=Array.isArray(e)?e:[e],c=this.map.painter.terrain,u=this.usedForTerrain&&c?c.getScaledDemTileSize():this._source.tileSize;
vendor: 8,701 bytes, line 1
1for(const p of a){const f=p.coveringTiles({tileSize:u,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const _ of f)r.set(_.key,_);this.usedForTerrain&&p.updateElevation(!1)}bi(Array.from(r.values()),(p,f)=>{const _=new Zu(p,this._source.tileSize*p.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(_,x=>{"raster-dem"===this._source.type&&_.dem&&this._backfillDEM(_),f(x,_)})},i)}}function ym(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function vm(t){return"raster"===t||"image"===t||"video"===t||"custom"===t}function Sc(t,e){const i=1<<t.z;return[t.x/i+e,(t.x+1)/i+e]}os.maxOverzooming=10,os.maxUnderzooming=3;class Nh{constructor(e,i,r){this._demTile=e,this._dem=this._demTile.dem,this._scale=i,this._offset=r}static create(e,i,r){const a=r||e.findDEMTileFor(i);if(!a||!a.dem)return;const c=a.dem,u=a.tileID,p=1<<i.canonical.z-u.canonical.z;return new Nh(a,a.tileSize/Qe/p,[(i.canonical.x/p-u.canonical.x)*c.dim,(i.canonical.y/p-u.canonical.y)*c.dim])}tileCoordToPixel(e,i){const r=i*this._scale+this._offset[1],a=Math.floor(e*this._scale+this._offset[0]),c=Math.floor(r);return new Ve(a,c)}getElevationAt(e,i,r,a){const c=e*this._scale+this._offset[0],u=i*this._scale+this._offset[1],p=Math.floor(c),f=Math.floor(u),_=this._dem;return a=!!a,r?Ct(Ct(_.get(p,f,a),_.get(p,f+1,a),u-f),Ct(_.get(p+1,f,a),_.get(p+1,f+1,a),u-f),c-p):_.get(p,f,a)}getElevationAtPixel(e,i,r){return this._dem.get(e,i,!!r)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*Sr(1,e)*this._dem.stride}}class xm{constructor(e,i){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new To(Qe,16,0),this.featureIndexArray=new Wa,this.promoteId=i}insert(e,i,r,a,c,u=0){const p=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,a,c,u);const f=this.grid;for(let _=0;_<i.length;_++){const x=i[_],w=[1/0,1/0,-1/0,-1/0];for(let M=0;M<x.length;M++){const T=x[M];w[0]=Math.min(w[0],T.x),w[1]=Math.min(w[1],T.y),w[2]=Math.max(w[2],T.x),w[3]=Math.max(w[3],T.y)}w[0]<Qe&&w[1]<Qe&&w[2]>=0&&w[3]>=0&&f.insert(p,w[0],w[1],w[2],w[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Au(new Ch(this.rawTileData)).layers,this.sourceLayerCoder=new om(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,i,r,a){this.loadVTLayers();const c=e.params||{},u=Ws(c.filter),p=e.tileResult,f=e.transform,_=p.bufferedTilespaceBounds,x=this.grid.query(_.min.x,_.min.y,_.max.x,_.max.y,(S,k,R,j)=>$d(p.bufferedTilespaceGeometry,S,k,R,j));x.sort(c_);let w=null;f.elevation&&x.length>0&&(w=Nh.create(f.elevation,this.tileID));const M={};let T;for(let S=0;S<x.length;S++){const k=x[S];if(k===T)continue;T=k;const R=this.featureIndexArray.get(k);let j=null;this.loadMatchingFeature(M,R,u,c.layers,c.availableImages,i,r,a,(K,G,H,ee=0)=>(j||(j=Po(K,this.tileID.canonical,e.tileTransform)),G.queryIntersectsFeature(p,K,H,j,this.z,e.transform,e.pixelPosMatrix,w,ee)))}return M}loadMatchingFeature(e,i,r,a,c,u,p,f,_){const{featureIndex:x,bucketIndex:w,sourceLayerIndex:M,layoutVertexArrayOffset:T}=i,S=this.bucketLayerIDs[w];if(a&&!function(K,G){for(let H=0;H<K.length;H++)if(G.indexOf(K[H])>=0)return!0;return!1}(a,S))return;const k=this.sourceLayerCoder.decode(M),R=this.vtLayers[k].feature(x);if(r.needGeometry){const K=ts(R,!0);if(!r.filter(new b(this.tileID.overscaledZ),K,this.tileID.canonical))return}else if(!r.filter(new b(this.tileID.overscaledZ),R))return;const j=this.getId(R,k);for(let K=0;K<S.length;K++){const G=S[K];if(a&&a.indexOf(G)<0)continue;const H=u[G];if(!H)continue;let ee={};void 0!==j&&f&&(ee=f.getState(H.sourceLayer||"_geojsonTileLayer",j));const Q=ni({},p[G]);Q.paint=bm(Q.paint,H.paint,R,ee,c),Q.layout=bm(Q.layout,H.layout,R,ee,c);const fe=!_||_(R,H,ee,T);if(!fe)continue;const ue=new am(R,this.z,this.x,this.y,j);ue.layer=Q;let we=e[G];void 0===we&&(we=e[G]=[]),we.push({featureIndex:x,feature:ue,intersectionZ:fe})}}lookupSymbolFeatures(e,i,r,a,c,u,p,f){const _={};this.loadVTLayers();const x=Ws(c);for(const w of e)this.loadMatchingFeature(_,{bucketIndex:r,sourceLayerIndex:a,featureIndex:w,layoutVertexArrayOffset:0},x,u,p,f,i);return _}loadFeature(e){const{featureIndex:i,sourceLayerIndex:r}=e;this.loadVTLayers();const a=this.sourceLayerCoder.decode(r),c=this.vtFeatures[a];if(c[i])return c[i];const u=this.vtLayers[a].feature(i);return c[i]=u,u}hasLayer(e){for(const i of this.bucketLayerIDs)for(const r of i)if(e===r)return!0;return!1}getId(e,i){let r=e.id;if(this.promoteId){const a="string"==typeof this.promoteId?this.promoteId:this.promoteId[i];null!=a&&(r=e.properties[a]),"boolean"==typeof r&&(r=Number(r))}return r}}function bm(t,e,i,r,a){return Mt(t,(c,u)=>{const p=e instanceof U?e.get(u):null;return p&&p.evaluate?p.evaluate(i,r,a):p})}function c_(t,e){return e-t}qe(xm,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class wm{constructor(e,i){this.width=e,this.height=i,this.nextRow=0,this.image=new Lo({width:e,height:i}),this.positions={},this.uploaded=!1}getDash(e,i){const r=this.getKey(e,i);return this.positions[r]}trim(){const e=this.width,i=this.height=kn(this.nextRow);this.image.resize({width:e,height:i})}getKey(e,i){return e.join(",")+i}getDashRanges(e,i,r){const a=[];let c=e.length%2==1?-e[e.length-1]*r:0,u=e[0]*r,p=!0;a.push({left:c,right:u,isDash:p,zeroLength:0===e[0]});let f=e[0];for(let _=1;_<e.length;_++){p=!p;const x=e[_];c=f*r,f+=x,u=f*r,a.push({left:c,right:u,isDash:p,zeroLength:0===x})}return a}addRoundDash(e,i,r){const a=i/2;for(let c=-r;c<=r;c++){const u=this.width*(this.nextRow+r+c);let p=0,f=e[p];for(let _=0;_<this.width;_++){_/f.right>1&&(f=e[++p]);const x=Math.abs(_-f.left),w=Math.abs(_-f.right),M=Math.min(x,w);let T;const S=c/r*(a+1);if(f.isDash){const k=a-Math.abs(S);T=Math.sqrt(M*M+k*k)}else T=a-Math.sqrt(M*M+S*S);this.image.data[u+_]=Math.max(0,Math.min(255,T+128))}}}addRegularDash(e,i){for(let f=e.length-1;f>=0;--f){const _=e[f],x=e[f+1];_.zeroLength?e.splice(f,1):x&&x.isDash===_.isDash&&(x.left=_.left,e.splice(f,1))}const r=e[0],a=e[e.length-1];r.isDash===a.isDash&&(r.left=a.left-this.width,a.right=r.right+this.width);const c=this.width*this.nextRow;let u=0,p=e[u];for(let f=0;f<this.width;f++){f/p.right>1&&(p=e[++u]);const _=Math.abs(f-p.left),x=Math.abs(f-p.right),w=Math.min(_,x);this.image.data[c+f]=Math.max(0,Math.min(255,(p.isDash?w:-w)+i+128))}}addDash(e,i){const r=this.getKey(e,i);if(this.positions[r])return this.positions[r];const a="round"===i,c=a?7:0,u=2*c+1;if(this.nextRow+u>this.height)return Ht("LineAtlas out of space"),null;0===e.length&&e.push(1);let p=0;for(let x=0;x<e.length;x++)e[x]<0&&(Ht("Negative value is found in line dasharray, replacing values with 0"),e[x]=0),p+=e[x];if(0!==p){const x=this.width/p,w=this.getDashRanges(e,this.width,x);a?this.addRoundDash(w,x,c):this.addRegularDash(w,"square"===i?.5*x:0)}const f=this.nextRow+c;this.nextRow+=u;const _={tl:[f,c],br:[p,0]};return this.positions[r]=_,_}}qe(wm,"LineAtlas");class Em{constructor(e){const i={},r=[];for(const p in e){const f=e[p],_=i[p]={};for(const x in f.glyphs){const w=f.glyphs[+x];if(!w||0===w.bitmap.width||0===w.bitmap.height)continue;const M=w.metrics.localGlyph?2:1,T={x:0,y:0,w:w.bitmap.width+2*M,h:w.bitmap.height+2*M};r.push(T),_[x]=T}}const{w:a,h:c}=zu(r),u=new Lo({width:a||1,height:c||1});for(const p in e){const f=e[p];for(const _ in f.glyphs){const x=f.glyphs[+_];if(!x||0===x.bitmap.width||0===x.bitmap.height)continue;const w=i[p][_],M=x.metrics.localGlyph?2:1;Lo.copy(x.bitmap,u,{x:0,y:0},{x:w.x+M,y:w.y+M},x.bitmap)}}this.image=u,this.positions=i}}qe(Em,"GlyphAtlas");class h_{constructor(e){this.tileID=new ln(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.tileZoom=e.tileZoom,this.uid=e.uid,this.zoom=e.zoom,this.canonical=e.tileID.canonical,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.enableTerrain=!!e.enableTerrain,this.isSymbolTile=e.isSymbolTile,this.tileTransform=rs(e.tileID.canonical,e.projection),this.projection=e.projection}parse(e,i,r,a,c){this.status="parsing",this.data=e,this.collisionBoxArray=new Ot;
1const u=new om(Object.keys(e.layers).sort()),p=new xm(this.tileID,this.promoteId);p.bucketLayerIDs=[];const f={},_=new wm(256,256),x={featureIndex:p,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:_,availableImages:r},w=i.familiesBySource[this.source];for(const ee in w){const Q=e.layers[ee];if(!Q)continue;let fe=!1,ue=!1;for(const ye of w[ee])"symbol"===ye[0].type?fe=!0:ue=!0;if(!0===this.isSymbolTile&&!fe||!1===this.isSymbolTile&&!ue)continue;1===Q.version&&Ht(`Vector tile source "${this.source}" layer "${ee}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const we=u.encode(ee),ze=[];for(let ye=0;ye<Q.length;ye++){const Ce=Q.feature(ye),Te=p.getId(Ce,ee);ze.push({feature:Ce,id:Te,index:ye,sourceLayerIndex:we})}for(const ye of w[ee]){const Ce=ye[0];void 0!==this.isSymbolTile&&"symbol"===Ce.type!==this.isSymbolTile||Ce.minzoom&&this.zoom<Math.floor(Ce.minzoom)||Ce.maxzoom&&this.zoom>=Ce.maxzoom||"none"!==Ce.visibility&&(Yu(ye,this.zoom,r),(f[Ce.id]=Ce.createBucket({index:p.bucketLayerIDs.length,layers:ye,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:we,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:r})).populate(ze,x,this.tileID.canonical,this.tileTransform),p.bucketLayerIDs.push(ye.map(Te=>Te.id)))}}let M,T,S,k;_.trim();const R={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},j=()=>{if(M)return c(M);if(T&&S&&k){const ee=new Em(T),Q=new kp(S,k);for(const fe in f){const ue=f[fe];ue instanceof ya?(Yu(ue.layers,this.zoom,r),Og(ue,T,ee.positions,S,Q.iconPositions,this.showCollisionBoxes,r,this.tileID.canonical,this.tileZoom,this.projection)):ue.hasPattern&&(ue instanceof wh||ue instanceof _h||ue instanceof fc)&&(Yu(ue.layers,this.zoom,r),ue.addFeatures(x,this.tileID.canonical,Q.patternPositions,r,this.tileTransform))}this.status="done",c(null,{buckets:$n(f).filter(fe=>!fe.isEmpty()),featureIndex:p,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ee.image,lineAtlas:_,imageAtlas:Q,glyphMap:this.returnDependencies?T:null,iconMap:this.returnDependencies?S:null,glyphPositions:this.returnDependencies?ee.positions:null})}},K=Mt(x.glyphDependencies,ee=>Object.keys(ee).map(Number));Object.keys(K).length?a.send("getGlyphs",{uid:this.uid,stacks:K},(ee,Q)=>{M||(M=ee,T=Q,j())},void 0,!1,R):T={};const G=Object.keys(x.iconDependencies);G.length?a.send("getImages",{icons:G,source:this.source,tileID:this.tileID,type:"icons"},(ee,Q)=>{M||(M=ee,S=Q,j())},void 0,!1,R):S={};const H=Object.keys(x.patternDependencies);H.length?a.send("getImages",{icons:H,source:this.source,tileID:this.tileID,type:"patterns"},(ee,Q)=>{M||(M=ee,k=Q,j())},void 0,!1,R):k={},j()}}function Yu(t,e,i){const r=new b(e);for(const a of t)a.recalculate(r,i)}class Cm{constructor(e){this.entries={},this.scheduler=e}request(e,i,r,a){const c=this.entries[e]=this.entries[e]||{callbacks:[]};if(c.result){const[u,p]=c.result;return this.scheduler?this.scheduler.add(()=>{a(u,p)},i):a(u,p),()=>{}}return c.callbacks.push(a),c.cancel||(c.cancel=r((u,p)=>{c.result=[u,p];for(const f of c.callbacks)this.scheduler?this.scheduler.add(()=>{f(u,p)},i):f(u,p);setTimeout(()=>delete this.entries[e],3e3)})),()=>{c.result||(c.callbacks=c.callbacks.filter(u=>u!==a),c.callbacks.length||(c.cancel(),delete this.entries[e]))}}}function Tm(t,e,i){const r=JSON.stringify(t.request);return t.data&&(this.deduped.entries[r]={result:[null,t.data]}),this.deduped.request(r,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom},a=>{const c=Jt(t.request,(u,p,f,_)=>{u?a(u):p&&a(null,{vectorTile:i?void 0:new Au(new Ch(p)),rawData:p,cacheControl:f,expires:_})});return()=>{c.cancel(),a()}},e)}const Sm=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Hu{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,r]=new Uint8Array(e,0,2);if(219!==i)throw new Error("Data does not appear to be in a KDBush format.");const a=r>>4;if(1!==a)throw new Error(`Got v${a} data when expected v1.`);const c=Sm[15&r];
1if(!c)throw new Error("Unrecognized array type.");const[u]=new Uint16Array(e,2,1),[p]=new Uint32Array(e,4,1);return new Hu(p,u,c,e)}constructor(e,i=64,r=Float64Array,a){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const c=Sm.indexOf(this.ArrayType),u=2*e*this.ArrayType.BYTES_PER_ELEMENT,p=e*this.IndexArrayType.BYTES_PER_ELEMENT,f=(8-p%8)%8;if(c<0)throw new Error(`Unexpected typed array class: ${r}.`);a&&a instanceof ArrayBuffer?(this.data=a,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+f,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+u+p+f),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+f,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+c]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=i,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Ku(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,r,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:c,coords:u,nodeSize:p}=this,f=[0,c.length-1,0],_=[];for(;f.length;){const x=f.pop()||0,w=f.pop()||0,M=f.pop()||0;if(w-M<=p){for(let R=M;R<=w;R++){const j=u[2*R],K=u[2*R+1];j>=e&&j<=r&&K>=i&&K<=a&&_.push(c[R])}continue}const T=M+w>>1,S=u[2*T],k=u[2*T+1];S>=e&&S<=r&&k>=i&&k<=a&&_.push(c[T]),(0===x?e<=S:i<=k)&&(f.push(M),f.push(T-1),f.push(1-x)),(0===x?r>=S:a>=k)&&(f.push(T+1),f.push(w),f.push(1-x))}return _}within(e,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:c,nodeSize:u}=this,p=[0,a.length-1,0],f=[],_=r*r;for(;p.length;){const x=p.pop()||0,w=p.pop()||0,M=p.pop()||0;if(w-M<=u){for(let R=M;R<=w;R++)Im(c[2*R],c[2*R+1],e,i)<=_&&f.push(a[R]);continue}const T=M+w>>1,S=c[2*T],k=c[2*T+1];Im(S,k,e,i)<=_&&f.push(a[T]),(0===x?e-r<=S:i-r<=k)&&(p.push(M),p.push(T-1),p.push(1-x)),(0===x?e+r>=S:i+r>=k)&&(p.push(T+1),p.push(w),p.push(1-x))}return f}}function Ku(t,e,i,r,a,c){if(a-r<=i)return;const u=r+a>>1;Am(t,e,u,r,a,c),Ku(t,e,i,r,u-1,1-c),Ku(t,e,i,u+1,a,1-c)}function Am(t,e,i,r,a,c){for(;a>r;){if(a-r>600){const _=a-r+1,x=i-r+1,w=Math.log(_),M=.5*Math.exp(2*w/3),T=.5*Math.sqrt(w*M*(_-M)/_)*(x-_/2<0?-1:1);Am(t,e,i,Math.max(r,Math.floor(i-x*M/_+T)),Math.min(a,Math.floor(i+(_-x)*M/_+T)),c)}const u=e[2*i+c];let p=r,f=a;for(Ac(t,e,r,i),e[2*a+c]>u&&Ac(t,e,r,a);p<f;){for(Ac(t,e,p,f),p++,f--;e[2*p+c]<u;)p++;for(;e[2*f+c]>u;)f--}e[2*r+c]===u?Ac(t,e,r,f):(f++,Ac(t,e,f,a)),f<=i&&(r=f+1),i<=f&&(a=f-1)}}function Ac(t,e,i,r){Ju(t,i,r),Ju(e,2*i,2*r),Ju(e,2*i+1,2*r+1)}function Ju(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}function Im(t,e,i,r){const a=t-i,c=e-r;return a*a+c*c}s.ARRAY_TYPE=En,s.AUTH_ERR_MSG=J,s.Aabb=sn,s.Actor=class{constructor(t,e,i){this.target=t,this.parent=e,this.mapId=i,this.callbacks={},this.cancelCallbacks={},dr(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=zn()?t:Ie,this.scheduler=new n_}send(t,e,i,r,a=!1,c){const u=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=c,this.callbacks[u]=i);const p=so(this.globalScope)?void 0:[];return this.target.postMessage({id:u,type:t,hasCallback:!!i,targetMapId:r,mustQueue:a,sourceMapId:this.mapId,data:ha(e,p)},p),{cancel:()=>{i&&delete this.callbacks[u],this.target.postMessage({id:u,type:"<cancel>",targetMapId:r,sourceMapId:this.mapId})}}}receive(t){const e=t.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){const r=this.cancelCallbacks[i];delete this.cancelCallbacks[i],r&&r.cancel()}else if(e.mustQueue||zn()){const r=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add(()=>this.processTask(i,e),r&&r.metadata||{type:"message"})}else this.processTask(i,e)}processTask(t,e){if("<response>"===e.type){const i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(So(e.error)):i(null,So(e.data)))}else{const i=so(this.globalScope)?void 0:[],r=e.hasCallback?(c,u)=>{delete this.cancelCallbacks[t],this.target.postMessage({id:t,type:"<response>",sourceMapId:this.mapId,error:c?ha(c):null,data:ha(u,i)},i)}:c=>{},a=So(e.data);if(this.parent[e.type])this.parent[e.type](e.sourceMapId,a,r);else if(this.parent.getWorkerSource){const c=e.type.split(".");this.parent.getWorkerSource(e.sourceMapId,c[0],a.source)[c[1]](a,r)}else r(new Error(`Could not find function ${e.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}}
1,s.CanonicalTileID=bh,s.Color=ai,s.ColorMode=no,s.CullFaceMode=Dr,s.DEMData=Bh,s.DataConstantProperty=D,s.DedupedRequest=Cm,s.DepthMode=yl,s.EXTENT=Qe,s.Elevation=class{isDataAvailableAtPoint(t){const e=this._source();if(this.isUsingMockSource()||!e||t.y<0||t.y>1)return!1;const i=e.getSource().maxzoom,r=1<<i,a=Math.floor(t.x),c=Math.floor((t.x-a)*r),u=Math.floor(t.y*r),p=this.findDEMTileFor(new ln(i,a,i,c,u));return!(!p||!p.dem)}getAtPointOrZero(t,e=0){return this.getAtPoint(t,e)||0}getAtPoint(t,e,i=!0){if(this.isUsingMockSource())return null;null==e&&(e=null);const r=this._source();if(!r||t.y<0||t.y>1)return e;const a=r.getSource().maxzoom,c=1<<a,u=Math.floor(t.x),p=t.x-u,f=new ln(a,u,a,Math.floor(p*c),Math.floor(t.y*c)),_=this.findDEMTileFor(f);if(!_||!_.dem)return e;const x=_.dem,w=1<<_.tileID.canonical.z,M=(p*w-_.tileID.canonical.x)*x.dim,T=(t.y*w-_.tileID.canonical.y)*x.dim,S=Math.floor(M),k=Math.floor(T);return(i?this.exaggeration():1)*Ct(Ct(x.get(S,k),x.get(S,k+1),T-k),Ct(x.get(S+1,k),x.get(S+1,k+1),T-k),M-S)}getAtTileOffset(t,e,i){const r=1<<t.canonical.z;return this.getAtPointOrZero(new rl(t.wrap+(t.canonical.x+e/Qe)/r,(t.canonical.y+i/Qe)/r))}getAtTileOffsetFunc(t,e,i,r){return a=>{const c=this.getAtTileOffset(t,a.x,a.y),u=r.upVector(t.canonical,a.x,a.y);return Un(u,u,c*r.upVectorScale(t.canonical,e,i).metersToTile),u}}getForTilePoints(t,e,i,r){if(this.isUsingMockSource())return!1;const a=Nh.create(this,t,r);return!!a&&(e.forEach(c=>{c[2]=this.exaggeration()*a.getElevationAt(c[0],c[1],i)}),!0)}getMinMaxForTile(t){if(this.isUsingMockSource())return null;const e=this.findDEMTileFor(t);if(!e||!e.dem)return null;const i=e.dem.tree,r=e.tileID,a=1<<t.canonical.z-r.canonical.z;let c=t.canonical.x/a-r.canonical.x,u=t.canonical.y/a-r.canonical.y,p=0;for(let f=0;f<t.canonical.z-r.canonical.z&&!i.leaves[p];f++){c*=2,u*=2;const _=2*Math.floor(u)+Math.floor(c);p=i.childOffsets[p]+_,c%=1,u%=1}return{min:this.exaggeration()*i.minimums[p],max:this.exaggeration()*i.maximums[p]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(t,e,i){throw new Error("Pure virtual method called.")}pointCoordinate(t){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}isUsingMockSource(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(t){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}},s.ErrorEvent=Kn,s.EvaluationParameters=b,s.Event=jr,s.Evented=qo,s.FillExtrusionBucket=fc,s.Frustum=ou,s.FrustumCorners=ru,s.GLOBE_RADIUS=Kr,s.GLOBE_SCALE_MATCH_LATITUDE=45,s.GLOBE_ZOOM_THRESHOLD_MAX=6,s.GLOBE_ZOOM_THRESHOLD_MIN=5,s.GlobeSharedBuffers=class{constructor(t){this._createGrid(t),this._createPoles(t)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const t of this._poleSegments)t.destroy();for(const t of this._gridSegments)t.withSkirts.destroy(),t.withoutSkirts.destroy();if(this._wireframeIndexBuffer){this._wireframeIndexBuffer.destroy();for(const t of this._wireframeSegments)t.destroy()}}_fillGridMeshWithLods(t,e){const i=new ke,r=new Ye,a=[],c=t+1+2,u=e[0]+1,p=e[0]+1+(1+e.length),f=(_,x,w)=>{let M=_===c-1?_-2:0===_?_:_-1;return M+=w?24575:0,[M,x]};for(let _=0;_<c;++_)i.emplaceBack(...f(_,0,!0));for(let _=0;_<u;++_)for(let x=0;x<c;++x)i.emplaceBack(...f(x,_,(0===x||x===c-1)&&!0));for(let _=0;_<e.length;++_){const x=e[_];for(let w=0;w<c;++w)i.emplaceBack(...f(w,x,!0))}for(let _=0;_<e.length;++_){const x=r.length,w=e[_]+1+2,M=new Ye;for(let k=0;k<w-1;k++){const R=k===w-2,j=R?c*(p-e.length+_-k):c;for(let K=0;K<c-1;K++){const G=k*c+K;0===k||R||0===K||K===c-2?(M.emplaceBack(G+1,G,G+j),M.emplaceBack(G+j,G+j+1,G+1)):(r.emplaceBack(G+1,G,G+j),r.emplaceBack(G+j,G+j+1,G+1))}}const T=fi.simpleSegment(0,x,i.length,r.length-x);for(let k=0;k<M.uint16.length;k+=3)r.emplaceBack(M.uint16[k],M.uint16[k+1],M.uint16[k+2]);const S=fi.simpleSegment(0,x,i.length,r.length-x);a.push({withoutSkirts:T,withSkirts:S})}return{vertices:i,indices:r,segments:a}}_createGrid(t){const e=this._fillGridMeshWithLods(64,oc);this._gridSegments=e.segments,this._gridBuffer=t.createVertexBuffer(e.vertices,rc.members),this._gridIndexBuffer=t.createIndexBuffer(e.indices,!0)}_createPoles(t){const e=new Ye;for(let a=0;a<=64;a++)e.emplaceBack(0,a+1,a+2);this._poleIndexBuffer=t.createIndexBuffer(e,!0);const i=new Rt,r=new Rt;this._poleSegments=[];for(let a=0,c=0;a<5;a++){const u=360/(1<<a);i.emplaceBack(0,-Kr,0,.5,0),r.emplaceBack(0,-Kr,0,.5,1);for(let p=0;p<=64;p++){const f=p/64,_=Ct(0,u,f),[x,w,M]=tl(nf,rf,_,Kr);i.emplaceBack(x,w,M,f,0),r.emplaceBack(x,w,M,f,1)}this._poleSegments.push(fi.simpleSegment(c,0,66,64)),c+=66}this._poleNorthVertexBuffer=t.createVertexBuffer(i,Td,!1),this._poleSouthVertexBuffer=t.createVertexBuffer(r,Td,!1)}getGridBuffers(t,e){return[this._gridBuffer,this._gridIndexBuffer,e?this._gridSegments[t].withSkirts:this._gridSegments[t].withoutSkirts]}getPoleBuffers(t){return[this._poleNorthVertexBuffer,this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[t]]}getWirefameBuffers(t,e){if(!this._wireframeSegments){const i=new ki,r=64,a=r+1+2,c=1;this._wireframeSegments=[];for(let u=0,p=0;u<oc.length;u++){const f=oc[u];for(let x=c;x<f+c;x++)for(let w=c;w<r+c;w++){const M=x*a+w;i.emplaceBack(M,M+1),i.emplaceBack(M,M+a),i.emplaceBack(M,M+a+1)}const _=f*r*3;this._wireframeSegments.push(fi.simpleSegment(0,p,(f+1)*a,_)),p+=_}this._wireframeIndexBuffer=t.createIndexBuffer(i)}return[this._gridBuffer,this._wireframeIndexBuffer,this._wireframeSegments[e]]}},s.GlyphManager=pl,s.ImagePosition=Pu,s.KDBush=Hu,s.LivePerformanceUtils=bl,s.LngLat=Ft,s.LngLatBounds=ma,s.LocalGlyphMode=Ou,s.MAX_MERCATOR_LATITUDE=Gi,s.MercatorCoordinate=rl,s.ONE_
1EM=24,s.OverscaledTileID=ln,s.PerformanceMarkers=ho,s.Point=Ve,s.Properties=W,s.RGBAImage=Cn,s.Ray=nu,s.RequestManager=class{constructor(t,e,i){this._transformRequestFn=t,this._customAccessToken=e,this._silenceAuthErrors=!!i,this._createSkuToken()}_createSkuToken(){const t=function(){let e="";for(let i=0;i<10;i++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",Zn,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}normalizeStyleURL(t,e){if(!oe(t))return t;const i=Ne(t);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeGlyphsURL(t,e){if(!oe(t))return t;const i=Ne(t);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeSourceURL(t,e,i,r){if(!oe(t))return t;const a=Ne(t);return a.path=`/v4/${a.authority}.json`,a.params.push("secure"),i&&a.params.push(`language=${i}`),r&&a.params.push(`worldview=${r}`),this._makeAPIURL(a,this._customAccessToken||e)}normalizeSpriteURL(t,e,i,r){const a=Ne(t);return oe(t)?(a.path=`/styles/v1${a.path}/sprite${e}${i}`,this._makeAPIURL(a,this._customAccessToken||r)):(a.path+=`${e}${i}`,Le(a))}normalizeTileURL(t,e,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!oe(t))return t;const r=Ne(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${e||i&&"raster"!==r.authority&&512===i?"@2x":""}${vt.supported?".webp":"$1"}`),"raster"===r.authority?r.path=`/${ut.RASTER_URL_PREFIX}${r.path}`:(r.path=r.path.replace(/^.+\/v4\//,"/"),r.path=`/${ut.TILE_URL_VERSION}${r.path}`);const a=this._customAccessToken||function(c){for(const u of c){const p=u.match(/^access_token=(.*)$/);if(p)return p[1]}return null}(r.params)||ut.ACCESS_TOKEN;return ut.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push(`sku=${this._skuToken}`),this._makeAPIURL(r,a)}canonicalizeTileURL(t,e){const i=Ne(t);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return t;let r="mapbox://";i.path.match(/^\/raster\/v1\//)?r+=`raster/${i.path.replace(`/${ut.RASTER_URL_PREFIX}/`,"")}`:r+=`tiles/${i.path.replace(`/${ut.TILE_URL_VERSION}/`,"")}`;let a=i.params;return e&&(a=a.filter(c=>!c.match(/^access_token=/))),a.length&&(r+=`?${a.join("&")}`),r}canonicalizeTileset(t,e){const i=!!e&&oe(e),r=[];for(const a of t.tiles||[])ce(a)?r.push(this.canonicalizeTileURL(a,i)):r.push(a);return r}_makeAPIURL(t,e){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",r=Ne(ut.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"http"===t.protocol){const a=t.params.indexOf("secure");a>=0&&t.params.splice(a,1)}if("/"!==r.path&&(t.path=`${r.path}${t.path}`),!ut.REQUIRE_ACCESS_TOKEN)return Le(t);if(e=e||ut.ACCESS_TOKEN,!this._silenceAuthErrors){if(!e)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if("s"===e[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return t.params=t.params.filter(a=>-1===a.indexOf("access_token")),t.params.push(`access_token=${e||""}`),Le(t)}},s.ResourceType=pr,s.SegmentVector=fi,s.SourceCache=os,s.StencilMode=qu,s.StructArrayLayout1ui2=Mn,s.StructArrayLayout2f1f2i16=et,s.StructArrayLayout2i4=ke,s.StructArrayLayout2ui4=ki,s.StructArrayLayout3f12=yt,s.StructArrayLayout3ui6=Ye,s.StructArrayLayout4i8=Ee,s.StructArrayLayout5f20=Rt,s.Texture=Tc,s.Tile=Zu,s.Transitionable=I,s.Uniform1f=rh,s.Uniform1i=class extends Do{constructor(t){super(t),this.current=0}set(t,e,i){this.fetchUniformLocation(t,e)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},s.Uniform2f=class extends Do{constructor(t){super(t),this.current=[0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}},s.Uniform3f=class extends Do{constructor(t){super(t),this.current=[0,0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}},s.Uniform4f=cd,s.UniformColor=hd,s.UniformMatrix2f=class extends Do{constructor(t){super(t),this.current=Vm}set(t,e,i){if(this.fetchUniformLocation(t,e))for(let r=0;r<4;r++)if(i[r]!==this.current[r]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}},s.UniformMatrix3f=class extends Do{constructor(t){super(t),this.current=Nm}set(t,e,i){if(this.fetchUniformLocation(t,e))for(let r=0;r<9;r++)if(i[r]!==this.current[r]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}},s.UniformMatrix4f=class extends Do{constructor(t){super(t),this.current=Bm}set(t,e,i){if(this.fetchUniformLocation(t,e)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let r=1;r<16;r++)if(i[r]!==this.current[r]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}},s.UnwrappedTileID=gp,s.ValidationError=$e,s.VectorTileFeature=vh,s.VectorTileWorkerSource=class extends qo{constructor(t,e,i,r,a){super(),this.actor=t,this.layerIndex=e,this.availableImages=i,this.loadVectorData=a||Tm,this.loading={},this.loaded={},this.deduped=new Cm(t.scheduler),this.isSpriteLoaded=r,this.scheduler
1=t.scheduler}loadTile(t,e){const i=t.uid,r=t&&t.request,a=r&&r.collectResourceTiming,c=this.loading[i]=new h_(t);c.abort=this.loadVectorData(t,(u,p)=>{const f=!this.loading[i];if(delete this.loading[i],f||u||!p)return c.status="done",f||(this.loaded[i]=c),e(u);const _=p.rawData,x={};p.expires&&(x.expires=p.expires),p.cacheControl&&(x.cacheControl=p.cacheControl),c.vectorTile=p.vectorTile||new Au(new Ch(_));const w=()=>{c.parse(c.vectorTile,this.layerIndex,this.availableImages,this.actor,(M,T)=>{if(M||!T)return e(M);const S={};if(a){const k=Go(r);k.length>0&&(S.resourceTiming=JSON.parse(JSON.stringify(k)))}e(null,ni({rawTileData:_.slice(0)},T,x,S))})};this.isSpriteLoaded?w():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(w,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom}):w()}),this.loaded=this.loaded||{},this.loaded[i]=c})}reloadTile(t,e){const i=this.loaded,r=t.uid,a=this;if(i&&i[r]){const c=i[r];c.showCollisionBoxes=t.showCollisionBoxes,c.enableTerrain=!!t.enableTerrain,c.projection=t.projection,c.tileTransform=rs(t.tileID.canonical,t.projection);const u=(p,f)=>{const _=c.reloadCallback;_&&(delete c.reloadCallback,c.parse(c.vectorTile,a.layerIndex,this.availableImages,a.actor,_)),e(p,f)};"parsing"===c.status?c.reloadCallback=u:"done"===c.status&&(c.vectorTile?c.parse(c.vectorTile,this.layerIndex,this.availableImages,this.actor,u):u())}}abortTile(t,e){const i=t.uid,r=this.loading[i];r&&(r.abort&&r.abort(),delete this.loading[i]),e()}removeTile(t,e){const i=this.loaded,r=t.uid;i&&i[r]&&delete i[r],e()}},s.WritingMode=Gn,s.ZoomDependentExpression=Va,s.add=zo,s.addDynamicAttributes=Rh,s.adjoint=function(t,e){var i=e[0],r=e[1],a=e[2],c=e[3],u=e[4],p=e[5],f=e[6],_=e[7],x=e[8];return t[0]=u*x-p*_,t[1]=a*_-r*x,t[2]=r*p-a*u,t[3]=p*f-c*x,t[4]=i*x-a*f,t[5]=a*c-i*p,t[6]=c*_-u*f,t[7]=r*f-i*_,t[8]=i*u-r*c,t},s.asyncAll=bi,s.bezier=Ti,s.bindAll=dr,s.boundsAttributes=lm,s.bufferConvexPolygon=function(t,e){const i=[];for(let r=0;r<t.length;r++){const a=pi(r-1,-1,t.length-1),c=pi(r+1,-1,t.length-1),u=t[r],p=t[c],f=t[a].sub(u).unit(),_=p.sub(u).unit(),x=_.angleWithSep(f.x,f.y),w=f.add(_).unit().mult(-1*e/Math.sin(x/2));i.push(u.add(w))}return i},s.cacheEntryPossiblyAdded=function(t){lo++,lo>Ca&&(t.getActor().send("enforceCacheSizeLimit",Uo),lo=0)},s.calculateGlobeLabelMatrix=function(t,e){const{x:i,y:r}=t.point,a=Pd(i,r,t.worldSize/t._pixelsPerMercatorPixel,0,0);return Ha(a,a,cu(Jr(e)))},s.calculateGlobeMatrix=function(t){const{x:e,y:i}=t.point,{lng:r,lat:a}=t._center;return Pd(e,i,t.worldSize,r,a)},s.calculateGlobeMercatorMatrix=function(t){const e=t.pixelsPerMeter,i=e/Sr(1,t.center.lat),r=Cr(new Float64Array(16));return Jl(r,r,[t.point.x,t.point.y,0]),Ka(r,r,[i,i,e]),Float32Array.from(r)},s.circumferenceAtLatitude=uu,s.clamp=rt,s.clearTileCache=function(t){if(!jo())return;const e=Ie.caches.delete(Nr);t&&e.catch(t).then(()=>t())},s.clipLine=Zp,s.clone=function(t){var e=new En(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},s.clone$1=Qi,s.collisionCircleLayout=lg,s.config=ut,s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.create=function(){var t=new En(16);return En!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},s.create$1=pd,s.createExpression=sa,s.createLayout=ae,s.createStyleLayer=function(t){return"custom"===t.type?new Qg(t):new t_[t.type](t)},s.cross=iu,s.degToRad=wt,s.distance=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},s.div=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t},s.dot=ar,s.earthRadius=lc,s.ease=Lr,s.easeCubicInOut=ur,s.ecefToLatLng=function([t,e,i]){const r=Math.hypot(t,e,i),a=Math.atan2(t,i),c=.5*Math.PI-Math.acos(-e/r);return new Ft(di(a),di(c))},s.emitValidationErrors=Jc,s.endsWith=Fr,s.enforceCacheSizeLimit=function(t){Vr(),en&&en.then(e=>{e.keys().then(i=>{for(let r=0;r<i.length-t;r++)e.delete(i[r])})})},s.evaluateSizeForFeature=Mh,s.evaluateSizeForZoom=cl,s.evaluateVariableOffset=Yp,s.evented=d,s.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},s.exactEquals$1=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},s.exported=Hn,s.exported$1=vt,s.extend=ni,s.extend$1=Pn,s.fillExtrusionHeightLift=pp,s.filterObject=ao,s.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},s.fromQuat=function(t,e){var i=e[0],r=e[1],a=e[2],c=e[3],u=i+i,p=r+r,f=a+a,_=i*u,x=r*u,w=r*p,M=a*u,T=a*p,S=a*f,k=c*u,R=c*p,j=c*f;return t[0]=1-w-S,t[1]=x+j,t[2]=M-R,t[3]=0,t[4]=x-j,t[5]=1-_-S,t[6]=T+k,t[7]=0,t[8]=M+R,t[9]=T-k,t[10]=1-_-w,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},s.fromRotation=function(t,e){var i=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},s.fromScaling=fd,s.furthestTileCorner=function(t){const e=Math.round((t+45+360)%360/90)%4;return Ma[e]}
1,s.getAABBPointSquareDist=function(t,e,i){let r=0;for(let a=0;a<2;++a){const c=i?i[a]:0;t[a]>c&&(r+=(t[a]-c)*(t[a]-c)),e[a]<c&&(r+=(c-e[a])*(c-e[a]))}return r},s.getAnchorAlignment=Ru,s.getAnchorJustification=Bu,s.getBounds=function(t){let e=1/0,i=1/0,r=-1/0,a=-1/0;for(const c of t)e=Math.min(e,c.x),i=Math.min(i,c.y),r=Math.max(r,c.x),a=Math.max(a,c.y);return{min:new Ve(e,i),max:new Ve(r,a)}},s.getColumn=Xn,s.getDefaultExportFromCjs=li,s.getGridMatrix=function(t,e,i,r){const a=e.getNorth(),c=e.getSouth(),u=e.getWest(),p=e.getEast(),f=1<<t.z,_=p-u,x=a-c,w=_/64,M=-x/oc[i],T=[0,w,0,M,0,0,a,u,0];if(t.z>0){const S=180/r;md(T,T,[S/_+1,0,0,0,S/x+1,0,-.5*S/w,.5*S/M,1])}return T[2]=f,T[5]=t.x,T[8]=t.y,T},s.getImage=X,s.getJSON=function(t,e){return tn(ni(t,{type:"json"}),e)},s.getLatitudinalLod=function(t){const e=Gi-5;t=rt(t,-e,e)/e*90;const i=Math.pow(Math.abs(Math.sin(wt(t))),3);return Math.round(i*(oc.length-1))},s.getMapSessionAPI=wi,s.getPerformanceMeasurement=Go,s.getProjection=nm,s.getRTLTextPluginStatus=m,s.getReferrer=mr,s.getTilePoint=function(t,{x:e,y:i},r=0){return new Ve(((e-r)*t.scale-t.x)*Qe,(i*t.scale-t.y)*Qe)},s.getTileVec3=function(t,e,i=0){return el(((e.x-i)*t.scale-t.x)*Qe,(e.y*t.scale-t.y)*Qe,Fd(e.z,e.y))},s.getVideo=function(t,e){const i=Ie.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(let r=0;r<t.length;r++){const a=Ie.document.createElement("source");co(t[r])||(i.crossOrigin="Anonymous"),a.src=t[r],i.appendChild(a)}return{cancel:()=>{}}},s.globeCenterToScreenPoint=function(t){const e=[0,0,0],i=Cr(new Float64Array(16));return Ha(i,t.pixelMatrix,t.globeMatrix),ui(e,e,i),new Ve(e[0],e[1])},s.globeDenormalizeECEF=cu,s.globeECEFOrigin=function(t,e){const i=[0,0,0];return ui(i,i,sc(Jr(e.canonical))),ui(i,i,t),i},s.globeMetersToEcef=sh,s.globeNormalizeECEF=sc,s.globePixelsToTileUnits=function(t,e){return Qe/(512*Math.pow(2,t))*ch(Jr(e))},s.globePoleMatrixForTile=function(t,e,i){const r=Cr(new Float64Array(16)),a=(e/(1<<t)-.5)*Math.PI*2;return ah(r,i.globeMatrix,a),Float32Array.from(r)},s.globeTileBounds=Jr,s.globeTiltAtLngLat=Ld,s.globeToMercatorTransition=nl,s.globeUseCustomAntiAliasing=function(t,e,i){const r=nl(i.zoom),a=t.style.map._antialias,c=!!e.extStandardDerivatives,u=e.extStandardDerivativesForceOff||t.terrain&&t.terrain.exaggeration()>0;return 0===r&&!a&&!u&&c},s.identity=Cr,s.identity$1=Md,s.invert=Jh,s.isFullscreen=function(){return!!Ie.document.fullscreenElement||!!Ie.document.webkitFullscreenElement},s.isLngLatBehindGlobe=hu,s.isMapAuthenticated=function(t){return Li.has(t)},s.isMapboxURL=oe,s.isSafariWithAntialiasingBug=function(t){const e=t.navigator?t.navigator.userAgent:null;return!!so(t)&&e&&(e.match("Version/15.4")||e.match("Version/15.5")||e.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},s.latFromMercatorY=ji,s.latLngToECEF=il,s.len=Ym,s.length=Ql,s.length$1=function(t){return Math.hypot(t[0],t[1],t[2],t[3])},s.lngFromMercatorX=jn,s.loadVectorTile=Tm,s.makeRequest=tn,s.mapValue=function(t,e,i,r,a){return rt((t-e)/(i-e)*(a-r)+r,r,a)},s.mercatorScale=Bd,s.mercatorXfromLng=Qr,s.mercatorYfromLat=eo,s.mercatorZfromAltitude=Sr,s.mul=Wm,s.mul$1=Xm,s.multiply=Ha,s.multiply$1=md,s.multiply$2=yd,s.nextPowerOfTwo=kn,s.normalize=an,s.normalize$1=Hm,s.normalize$2=bd,s.number=Ct,s.ortho=function(t,e,i,r,a,c,u){var p=1/(e-i),f=1/(r-a),_=1/(c-u);return t[0]=-2*p,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*_,t[11]=0,t[12]=(e+i)*p,t[13]=(a+r)*f,t[14]=(u+c)*_,t[15]=1,t},s.pbf=Mp,s.perspective=function(t,e,i,r,a){var c,u=1/Math.tan(e/2);return t[0]=u/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=a&&a!==1/0?(t[10]=(a+r)*(c=1/(r-a)),t[14]=2*a*r*c):(t[10]=-1,t[14]=-2*r),t},s.pick=function(t,e){const i={};for(let r=0;r<e.length;r++){const a=e[r];a in t&&(i[a]=t[a])}return i},s.plugin=v,s.pointGeometry=Dn,s.polesInViewport=function(t){const e=Cr(new Float64Array(16));Ha(e,t.pixelMatrix,t.globeMatrix);const i=[0,sr,0],r=[0,lr,0];return ui(i,i,e),ui(r,r,e),[i[0]>0&&i[0]<=t.width&&i[1]>0&&i[1]<=t.height&&!hu(t,new Ft(t.center.lat,90)),r[0]>0&&r[0]<=t.width&&r[1]>0&&r[1]<=t.height&&!hu(t,new Ft(t.center.lat,-90))]},s.polygonContainsPoint=is,s.polygonIntersectsBox=$d,s.polygonIntersectsPolygon=Ud,s.polygonizeBounds=function(t,e,
1i=0,r=!0){const a=new Ve(i,i),c=t.sub(a),u=e.add(a),p=[c,new Ve(u.x,c.y),u,new Ve(c.x,u.y)];return r&&p.push(c.clone()),p},s.posAttributes=rc,s.postMapLoadEvent=ri,s.postPerformanceEvent=ci,s.postTurnstileEvent=Et,s.potpack=zu,s.prevPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},s.radToDeg=di,s.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],s.registerForPluginStateChange=function(t){return t({pluginStatus:l,pluginURL:n}),d.on("pluginStateChange",t),t},s.removeAuthState=function(t){Li.delete(t)},s.renderColorRamp=vu,s.resample=Nd,s.rotateX=Qh,s.rotateX$1=Ed,s.rotateY=ah,s.rotateY$1=Cd,s.rotateZ=function(t,e,i){var r=Math.sin(i),a=Math.cos(i),c=e[0],u=e[1],p=e[2],f=e[3],_=e[4],x=e[5],w=e[6],M=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=c*a+_*r,t[1]=u*a+x*r,t[2]=p*a+w*r,t[3]=f*a+M*r,t[4]=_*a-c*r,t[5]=x*a-u*r,t[6]=w*a-p*r,t[7]=M*a-f*r,t},s.rotateZ$1=function(t,e,i){i*=.5;var r=e[0],a=e[1],c=e[2],u=e[3],p=Math.sin(i),f=Math.cos(i);return t[0]=r*f+a*p,t[1]=a*f-r*p,t[2]=c*f+u*p,t[3]=u*f-c*p,t},s.scale=Ka,s.scale$1=xd,s.scale$2=Un,s.scaleAndAdd=ic,s.set=function(t,e,i,r){return t[0]=e,t[1]=i,t[2]=r,t},s.setCacheLimits=function(t,e){Uo=t,Ca=e},s.setColumn=function(t,e,i){t[4*e+0]=i[0],t[4*e+1]=i[1],t[4*e+2]=i[2],t[4*e+3]=i[3]},s.setRTLTextPlugin=function(t,e,i=!1){if(l===Wl||l===Xl||l===Yl)throw new Error("setRTLTextPlugin cannot be called multiple times.");n=Hn.resolveURL(t),l=Wl,ua=e,h(),i||y()},s.smoothstep=Rr,s.spec=be,s.squaredLength=function(t){var e=t[0],i=t[1],r=t[2];return e*e+i*i+r*r},s.storeAuthState=function(t,e){e?Li.add(t):Li.delete(t)},s.sub=Tr,s.subtract=tu,s.symbolSize=cg,s.tileAABB=function(t,e,i,r,a,c,u,p,f){if("globe"===f.name)return function tf(t,e,i){const r=e/t.worldSize,a=t.globeMatrix;if(i.z<=1){const ue=Jr(i).getCorners();return kd(ue,a,r),sn.fromPoints(ue)}const c=lh(i),u=lu(c);kd(u,a,r);const p=Number.MAX_VALUE,f=[-p,-p,-p],_=[p,p,p];if(c.contains(t.center)){for(const ze of u)ec(_,_,ze),tc(f,f,ze);f[2]=0;const ue=t.point,we=[ue.x*r,ue.y*r,0];return ec(_,_,we),tc(f,f,we),new sn(_,f)}const x=[a[12]*r,a[13]*r,a[14]*r],w=c.getCenter(),M=rt(t.center.lat,-Gi,Gi),T=rt(w.lat,-Gi,Gi),S=Qr(t.center.lng),k=eo(M);let R=S-Qr(w.lng);const j=k-eo(T);R>.5?R-=1:R<-.5&&(R+=1);let K=0;Math.abs(R)>Math.abs(j)?K=R>=0?1:3:(K=j>=0?0:2,ic(x,x,[a[4]*r,a[5]*r,a[6]*r],-Math.sin(wt(j>=0?c.getSouth():c.getNorth()))*Kr));const G=u[K],H=u[(K+1)%4],ee=new ef(G,H,x),Q=[su(ee,0)||G[0],su(ee,1)||G[1],su(ee,2)||G[2]],fe=nl(t.zoom);if(fe>0){const ue=function({x:ze,y:ye,z:Ce},Te,Ae,Oe,xe){const Ue=1/(1<<Ce);let Xe=ze*Ue,Ge=Xe+Ue,lt=ye*Ue,Be=lt+Ue,Je=0;const ct=(Xe+Ge)/2-Oe;return ct>.5?Je=-1:ct<-.5&&(Je=1),Xe=((Xe+Je)*Te-(Oe*=Te))*Ae+Oe,Ge=((Ge+Je)*Te-Oe)*Ae+Oe,lt=(lt*Te-(xe*=Te))*Ae+xe,Be=(Be*Te-xe)*Ae+xe,[[Xe,Be,0],[Ge,Be,0],[Ge,lt,0],[Xe,lt,0]]}(i,e,t._pixelsPerMercatorPixel,S,k);for(let ze=0;ze<u.length;ze++)es(u[ze],ue[ze],fe);const we=zo([],ue[K],ue[(K+1)%4]);Un(we,we,.5),es(Q,we,fe)}for(const ue of u)ec(_,_,ue),tc(f,f,ue);return _[2]=Math.min(G[2],H[2]),ec(_,_,Q),tc(f,f,Q),new sn(_,f)}(t,e,new bh(i,r,a));const _=rs({z:i,x:r,y:a},f);return new sn([(c+_.x/_.scale)*e,e*(_.y/_.scale),u],[(c+_.x2/_.scale)*e,e*(_.y2/_.scale),p])},s.tileCornersToBounds=lh,s.tileTransform=rs,s.transformMat3=function(t,e,i){var r=e[0],a=e[1],c=e[2];return t[0]=r*i[0]+a*i[3]+c*i[6],t[1]=r*i[1]+a*i[4]+c*i[7],t[2]=r*i[2]+a*i[5]+c*i[8],t},s.transformMat4=ui,s.transformMat4$1=Ja,s.transformQuat=vd,s.transitionTileAABBinECEF=Dd,s.translate=Jl,s.transpose=function(t,e){if(t===e){var i=e[1],r=e[2],a=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=r,t[7]=a}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},s.triggerPluginCompletionEvent=o,s.uniqueId=Or,s.updateGlobeVertexNormal=function(t,e,i,r,a){const c=5*e+2;t.float32[c+0]=i,t.float32[c+1]=r,t.float32[c+2]=a},s.validateCustomStyleLayer=function(t){const e=[],i=t.id;return void 0===i&&e.push({message:`layers.${i}: missing required property "id"`}),void 0===t.render&&e.push({message:`layers.${i}: missing required method "render"`}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},s.validateFilter=t=>wn($a(t)),s.validateFog=t=>wn(Yc(t)),s.validateLayer=t=>wn($c(t)),s.validateLight=t=>wn(Xc(t)),s.validateSource=t=>wn(Wc(t)),s.validateStyle=Kc,s.validateTerrain=t=>wn(jl(t)),s.values=$n,s.vectorTile=yh,s.version=An,s.warnOnce=Ht,s.window=Ie,s.wrap=pi}),xl(0,function(s){function Ie(Y){if("number"==typeof Y||"boolean"==typeof Y||"string"==typeof Y||null==Y)return JSON.stringify(Y);
vendor: 4,684 bytes, line 1
1if(Array.isArray(Y)){let P="[";for(const X of Y)P+=`${Ie(X)},`;return`${P}]`}let z="{";for(const P of Object.keys(Y).sort())z+=`${P}:${Ie(Y[P])},`;return`${z}}`}function An(Y){let z="";for(const P of s.refProperties)z+=`/${Ie(Y[P])}`;return z}class Ji{constructor(z){this.keyCache={},z&&this.replace(z)}replace(z){this._layerConfigs={},this._layers={},this.update(z,[])}update(z,P){for(const J of z)this._layerConfigs[J.id]=J,(this._layers[J.id]=s.createStyleLayer(J)).compileFilter(),this.keyCache[J.id]&&delete this.keyCache[J.id];for(const J of P)delete this.keyCache[J],delete this._layerConfigs[J],delete this._layers[J];this.familiesBySource={};const X=function(J,oe){const ce={};for(let re=0;re<J.length;re++){const ge=oe&&oe[J[re].id]||An(J[re]);oe&&(oe[J[re].id]=ge);let Fe=ce[ge];Fe||(Fe=ce[ge]=[]),Fe.push(J[re])}const le=[];for(const re in ce)le.push(ce[re]);return le}(s.values(this._layerConfigs),this.keyCache);for(const J of X){const oe=J.map(Ne=>this._layers[Ne.id]),ce=oe[0];if("none"===ce.visibility)continue;const le=ce.source||"";let re=this.familiesBySource[le];re||(re=this.familiesBySource[le]={});const ge=ce.sourceLayer||"_geojsonTileLayer";let Fe=re[ge];Fe||(Fe=re[ge]=[]),Fe.push(oe)}}}class ut{loadTile(z,P){const{uid:X,encoding:J,rawImageData:oe,padding:ce,buildQuadTree:le}=z,re=s.window.ImageBitmap&&oe instanceof s.window.ImageBitmap?this.getImageData(oe,ce):oe;P(null,new s.DEMData(X,re,J,ce<1,le))}getImageData(z,P){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(z.width,z.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=z.width,this.offscreenCanvas.height=z.height,this.offscreenCanvasContext.drawImage(z,0,0,z.width,z.height);const X=this.offscreenCanvasContext.getImageData(-P,-P,z.width+2*P,z.height+2*P);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),X}}function vt(Y,z){if(0!==Y.length){Ci(Y[0],z);for(var P=1;P<Y.length;P++)Ci(Y[P],!z)}}function Ci(Y,z){for(var P=0,X=0,J=0,oe=Y.length,ce=oe-1;J<oe;ce=J++){var le=(Y[J][0]-Y[ce][0])*(Y[ce][1]+Y[J][1]),re=P+le;X+=Math.abs(P)>=Math.abs(le)?P-re+le:le-re+P,P=re}P+X>=0!=!!z&&Y.reverse()}var Fi=s.getDefaultExportFromCjs(function Y(z,P){var X,J=z&&z.type;if("FeatureCollection"===J)for(X=0;X<z.features.length;X++)Y(z.features[X],P);else if("GeometryCollection"===J)for(X=0;X<z.geometries.length;X++)Y(z.geometries[X],P);else if("Feature"===J)Y(z.geometry,P);else if("Polygon"===J)vt(z.coordinates,P);else if("MultiPolygon"===J)for(X=0;X<z.coordinates.length;X++)vt(z.coordinates[X],P);return z});const In=s.VectorTileFeature.prototype.toGeoJSON;var ve={exports:{}},Zi=s.pointGeometry,Zn=s.vectorTile.VectorTileFeature,li=Pr;function Pr(Y,z){this.options=z||{},this.features=Y,this.length=Y.length}function Bi(Y,z){this.id="number"==typeof Y.id?Y.id:void 0,this.type=Y.type,this.rawGeometry=1===Y.type?[Y.geometry]:Y.geometry,this.properties=Y.tags,this.extent=z||4096}Pr.prototype.feature=function(Y){return new Bi(this.features[Y],this.options.extent)},Bi.prototype.loadGeometry=function(){var Y=this.rawGeometry;this.geometry=[];for(var z=0;z<Y.length;z++){for(var P=Y[z],X=[],J=0;J<P.length;J++)X.push(new Zi(P[J][0],P[J][1]));this.geometry.push(X)}return this.geometry},Bi.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Y=this.geometry,z=1/0,P=-1/0,X=1/0,J=-1/0,oe=0;oe<Y.length;oe++)for(var ce=Y[oe],le=0;le<ce.length;le++){var re=ce[le];z=Math.min(z,re.x),P=Math.max(P,re.x),X=Math.min(X,re.y),J=Math.max(J,re.y)}return[z,X,P,J]},Bi.prototype.toGeoJSON=Zn.prototype.toGeoJSON;var hr=s.pbf,Dn=li;function un(Y){var z=new hr;return function(P,X){for(var J in P.layers)X.writeMessage(3,Ve,P.layers[J])}(Y,z),z.finish()}function Ve(Y,z){var P;z.writeVarintField(15,Y.version||1),z.writeStringField(1,Y.name||""),z.writeVarintField(5,Y.extent||4096);var X={keys:[],values:[],keycache:{},valuecache:{}};for(P=0;P<Y.length;P++)X.feature=Y.feature(P),z.writeMessage(2,Bo,X);var J=X.keys;for(P=0;P<J.length;P++)z.writeStringField(3,J[P]);var oe=X.values;for(P=0;P<oe.length;P++)z.writeMessage(4,ur,oe[P])}function Bo(Y,z){var P=Y.feature;void 0!==P.id&&z.writeVarintField(1,P.id),z.writeMessage(2,$i,Y),z.writeVarintField(3,P.type),z.writeMessage(4,Ma,P)}function $i(Y,z){var P=Y.feature,X=Y.keys,J=Y.values,oe=Y.keycache,ce=Y.valuecache;for(var le in P.properties){var re=P.properties[le],ge=oe[le];if(null!==re){void 0===ge&&(X.push(le),oe[le]=ge=X.length-1),z.writeVarint(ge);var Fe=typeof re;"string"!==Fe&&"boolean"!==Fe&&"number"!==Fe&&(re=JSON.stringify(re));var Ne=Fe+":"+re,Le=ce[Ne];
vendor: 5,829 bytes, line 1
1void 0===Le&&(J.push(re),ce[Ne]=Le=J.length-1),z.writeVarint(Le)}}}function wt(Y,z){return(z<<3)+(7&Y)}function di(Y){return Y<<1^Y>>31}function Ma(Y,z){for(var P=Y.loadGeometry(),X=Y.type,J=0,oe=0,ce=P.length,le=0;le<ce;le++){var re=P[le],ge=1;1===X&&(ge=re.length),z.writeVarint(wt(1,ge));for(var Fe=3===X?re.length-1:re.length,Ne=0;Ne<Fe;Ne++){1===Ne&&1!==X&&z.writeVarint(wt(2,Fe-1));var Le=re[Ne].x-J,st=re[Ne].y-oe;z.writeVarint(di(Le)),z.writeVarint(di(st)),J+=Le,oe+=st}3===X&&z.writeVarint(wt(7,1))}}function ur(Y,z){var P=typeof Y;"string"===P?z.writeStringField(1,Y):"boolean"===P?z.writeBooleanField(7,Y):"number"===P&&(Y%1!=0?z.writeDoubleField(3,Y):Y<0?z.writeSVarintField(6,Y):z.writeVarintField(5,Y))}ve.exports=un,ve.exports.fromVectorTileJs=un,ve.exports.fromGeojsonVt=function(Y,z){z=z||{};var P={};for(var X in Y)P[X]=new Dn(Y[X].features,z),P[X].name=X,P[X].version=z.version,P[X].extent=z.extent;return un({layers:P})},ve.exports.GeoJSONWrapper=Dn;var Ti=s.getDefaultExportFromCjs(ve.exports);const Lr={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:Y=>Y},rt=Math.fround||(Rr=new Float32Array(1),Y=>(Rr[0]=+Y,Rr[0]));var Rr;class ni{constructor(z){this.options=Object.assign(Object.create(Lr),z),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(z){const{log:P,minZoom:X,maxZoom:J}=this.options;P&&console.time("total time");const oe=`prepare ${z.length} points`;P&&console.time(oe),this.points=z;const ce=[];for(let re=0;re<z.length;re++){const ge=z[re];if(!ge.geometry)continue;const[Fe,Ne]=ge.geometry.coordinates,Le=rt(Wn(Fe)),st=rt(kn(Ne));ce.push(Le,st,1/0,re,-1,1),this.options.reduce&&ce.push(0)}let le=this.trees[J+1]=this._createTree(ce);P&&console.timeEnd(oe);for(let re=J;re>=X;re--){const ge=+Date.now();le=this.trees[re]=this._createTree(this._cluster(le,re)),P&&console.log("z%d: %d clusters in %dms",re,le.numItems,+Date.now()-ge)}return P&&console.timeEnd("total time"),this}getClusters(z,P){let X=((z[0]+180)%360+360)%360-180;const J=Math.max(-90,Math.min(90,z[1]));let oe=180===z[2]?180:((z[2]+180)%360+360)%360-180;const ce=Math.max(-90,Math.min(90,z[3]));if(z[2]-z[0]>=360)X=-180,oe=180;else if(X>oe){const Ne=this.getClusters([X,J,180,ce],P),Le=this.getClusters([-180,J,oe,ce],P);return Ne.concat(Le)}const le=this.trees[this._limitZoom(P)],re=le.range(Wn(X),kn(ce),Wn(oe),kn(J)),ge=le.data,Fe=[];for(const Ne of re){const Le=this.stride*Ne;Fe.push(ge[Le+5]>1?qn(ge,Le,this.clusterProps):this.points[ge[Le+3]])}return Fe}getChildren(z){const P=this._getOriginId(z),X=this._getOriginZoom(z),J="No cluster with the specified id.",oe=this.trees[X];if(!oe)throw new Error(J);const ce=oe.data;if(P*this.stride>=ce.length)throw new Error(J);const le=this.options.radius/(this.options.extent*Math.pow(2,X-1)),re=oe.within(ce[P*this.stride],ce[P*this.stride+1],le),ge=[];for(const Fe of re){const Ne=Fe*this.stride;ce[Ne+4]===z&&ge.push(ce[Ne+5]>1?qn(ce,Ne,this.clusterProps):this.points[ce[Ne+3]])}if(0===ge.length)throw new Error(J);return ge}getLeaves(z,P,X){const J=[];return this._appendLeaves(J,z,P=P||10,X=X||0,0),J}getTile(z,P,X){const J=this.trees[this._limitZoom(z)],oe=Math.pow(2,z),{extent:ce,radius:le}=this.options,re=le/ce,ge=(X-re)/oe,Fe=(X+1+re)/oe,Ne={features:[]};return this._addTileFeatures(J.range((P-re)/oe,ge,(P+1+re)/oe,Fe),J.data,P,X,oe,Ne),0===P&&this._addTileFeatures(J.range(1-re/oe,ge,1,Fe),J.data,oe,X,oe,Ne),P===oe-1&&this._addTileFeatures(J.range(0,ge,re/oe,Fe),J.data,-1,X,oe,Ne),Ne.features.length?Ne:null}getClusterExpansionZoom(z){let P=this._getOriginZoom(z)-1;for(;P<=this.options.maxZoom;){const X=this.getChildren(z);if(P++,1!==X.length)break;z=X[0].properties.cluster_id}return P}_appendLeaves(z,P,X,J,oe){const ce=this.getChildren(P);for(const le of ce){const re=le.properties;if(re&&re.cluster?oe+re.point_count<=J?oe+=re.point_count:oe=this._appendLeaves(z,re.cluster_id,X,J,oe):oe<J?oe++:z.push(le),z.length===X)break}return oe}_createTree(z){const P=new s.KDBush(z.length/this.stride|0,this.options.nodeSize,Float32Array);for(let X=0;X<z.length;X+=this.stride)P.add(z[X],z[X+1]);return P.finish(),P.data=z,P}_addTileFeatures(z,P,X,J,oe,ce){for(const le of z){const re=le*this.stride,ge=P[re+5]>1;let Fe,Ne,Le;if(ge)Fe=Or(P,re,this.clusterProps),Ne=P[re],Le=P[re+1];else{const at=this.points[P[re+3]];Fe=at.properties;const[ft,Et]=at.geometry.coordinates;Ne=Wn(ft),Le=kn(Et)}const st={type:1,geometry:[[Math.round(this.options.extent*(Ne*oe-X)),Math.round(this.options.extent*(Le*oe-J))]],tags:Fe};let mt;mt=ge||this.options.generateId?P[re+3]:this.points[P[re+3]].id,void 0!==mt&&(st.id=mt),ce.features.push(st)}}_limitZoom(z){return Math.max(this.options.minZoom,Math.min(Math.floor(+z),this.options.maxZoom+1))}_cluster(z,P){const{radius:X,extent:J,reduce:oe,minPoints:ce}=this.options,le=X/(J*Math.pow(2,P)),re=z.data,ge=[],Fe=this.stride;for(let Ne=0;Ne<re.length;Ne+=Fe){if(re[Ne+2]<=P)continue;re[Ne+2]=P;const Le=re[Ne],st=re[Ne+1],mt=z.within(re[Ne],re[Ne+1],le),at=re[Ne+5];let ft=at;for(const Et of mt){const Wt=Et*Fe;re[Wt+2]>P&&(ft+=re[Wt+5])}if(ft>at&&ft>=ce){let Et,Wt=Le*at,ri=st*at,Si=-1;const ci=((Ne/Fe|0)<<5)+(P+1)+this.points.length;for(const _n of mt){const wi=_n*Fe;if(re[wi+2]<=P)continue;re[wi+2]=P;const Li=re[wi+5];Wt+=re[wi]*Li,ri+=re[wi+1]*Li,re[wi+4]=ci,oe&&(Et||(Et=this._map(re,Ne,!0),Si=this.clusterProps.length,this.clusterProps.push(Et)),oe(Et,this._map(re,wi)))}re[Ne+4]=ci,ge.push(Wt/ft,ri/ft,1/0,ci,-1,ft),oe&&ge.push(Si)}else{for(let Et=0;Et<Fe;Et++)ge.push(re[Ne+Et]);if(ft>1)for(const Et of mt){const Wt=Et*Fe;if(!(re[Wt+2]<=P)){re[Wt+2]=P;for(let ri=0;ri<Fe;ri++)ge.push(re[Wt+ri])}}}}return ge}_getOriginId(z){return z-this.points.length>>5}_getOriginZoom(z){return(z-this.points.length)%32}
1_map(z,P,X){if(z[P+5]>1){const ce=this.clusterProps[z[P+6]];return X?Object.assign({},ce):ce}const J=this.points[z[P+3]].properties,oe=this.options.map(J);return X&&oe===J?Object.assign({},oe):oe}}function qn(Y,z,P){return{type:"Feature",id:Y[z+3],properties:Or(Y,z,P),geometry:{type:"Point",coordinates:[(X=Y[z],360*(X-.5)),oo(Y[z+1])]}};var X}function Or(Y,z,P){const X=Y[z+5],J=X>=1e4?`${Math.round(X/1e3)}k`:X>=1e3?Math.round(X/100)/10+"k":X,oe=Y[z+6],ce=-1===oe?{}:Object.assign({},P[oe]);return Object.assign(ce,{cluster:!0,cluster_id:Y[z+3],point_count:X,point_count_abbreviated:J})}function Wn(Y){return Y/360+.5}function kn(Y){const z=Math.sin(Y*Math.PI/180),P=.5-.25*Math.log((1+z)/(1-z))/Math.PI;return P<0?0:P>1?1:P}function oo(Y){const z=(180-360*Y)*Math.PI/180;return 360*Math.atan(Math.exp(z))/Math.PI-90}function dr(Y,z,P,X){for(var J,oe=X,ce=P-z>>1,le=P-z,re=Y[z],ge=Y[z+1],Fe=Y[P],Ne=Y[P+1],Le=z+3;Le<P;Le+=3){var st=Fr(Y[Le],Y[Le+1],re,ge,Fe,Ne);if(st>oe)J=Le,oe=st;else if(st===oe){var mt=Math.abs(Le-ce);mt<le&&(J=Le,le=mt)}}oe>X&&(J-z>3&&dr(Y,z,J,X),Y[J+2]=oe,P-J>3&&dr(Y,J,P,X))}function Fr(Y,z,P,X,J,oe){var ce=J-P,le=oe-X;if(0!==ce||0!==le){var re=((Y-P)*ce+(z-X)*le)/(ce*ce+le*le);re>1?(P=J,X=oe):re>0&&(P+=ce*re,X+=le*re)}return(ce=Y-P)*ce+(le=z-X)*le}function Mt(Y,z,P,X){var J={id:void 0===Y?null:Y,type:z,geometry:P,tags:X,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(oe){var ce=oe.geometry,le=oe.type;if("Point"===le||"MultiPoint"===le||"LineString"===le)ao(oe,ce);else if("Polygon"===le||"MultiLineString"===le)for(var re=0;re<ce.length;re++)ao(oe,ce[re]);else if("MultiPolygon"===le)for(re=0;re<ce.length;re++)for(var ge=0;ge<ce[re].length;ge++)ao(oe,ce[re][ge])}(J),J}function ao(Y,z){for(var P=0;P<z.length;P+=3)Y.minX=Math.min(Y.minX,z[P]),Y.minY=Math.min(Y.minY,z[P+1]),Y.maxX=Math.max(Y.maxX,z[P]),Y.maxY=Math.max(Y.maxY,z[P+1])}function Qi(Y,z,P,X){if(z.geometry){var J=z.geometry.coordinates,oe=z.geometry.type,ce=Math.pow(P.tolerance/((1<<P.maxZoom)*P.extent),2),le=[],re=z.id;if(P.promoteId?re=z.properties[P.promoteId]:P.generateId&&(re=X||0),"Point"===oe)No(J,le);else if("MultiPoint"===oe)for(var ge=0;ge<J.length;ge++)No(J[ge],le);else if("LineString"===oe)Ht(J,le,ce,!1);else if("MultiLineString"===oe){if(P.lineMetrics){for(ge=0;ge<J.length;ge++)Ht(J[ge],le=[],ce,!1),Y.push(Mt(re,"LineString",le,z.properties));return}dn(J,le,ce,!1)}else if("Polygon"===oe)dn(J,le,ce,!0);else{if("MultiPolygon"!==oe){if("GeometryCollection"===oe){for(ge=0;ge<z.geometry.geometries.length;ge++)Qi(Y,{id:re,geometry:z.geometry.geometries[ge],properties:z.properties},P,X);return}throw new Error("Input data is not a valid GeoJSON object.")}for(ge=0;ge<J.length;ge++){var Fe=[];dn(J[ge],Fe,ce,!0),le.push(Fe)}}Y.push(Mt(re,oe,le,z.properties))}}function No(Y,z){z.push(Ea(Y[0])),z.push(zn(Y[1])),z.push(0)}function Ht(Y,z,P,X){for(var J,oe,ce=0,le=0;le<Y.length;le++){var re=Ea(Y[le][0]),ge=zn(Y[le][1]);z.push(re),z.push(ge),z.push(0),le>0&&(ce+=X?(J*ge-re*oe)/2:Math.sqrt(Math.pow(re-J,2)+Math.pow(ge-oe,2))),J=re,oe=ge}var Fe=z.length-3;z[2]=1,dr(z,0,Fe,P),z[Fe+2]=1,z.size=Math.abs(ce),z.start=0,z.end=z.size}function dn(Y,z,P,X){for(var J=0;J<Y.length;J++){var oe=[];Ht(Y[J],oe,P,X),z.push(oe)}}function Ea(Y){return Y/360+.5}function zn(Y){var z=Math.sin(Y*Math.PI/180),P=.5-.25*Math.log((1+z)/(1-z))/Math.PI;return P<0?0:P>1?1:P}function qi(Y,z,P,X,J,oe,ce,le){if(X/=z,oe>=(P/=z)&&ce<X)return Y;if(ce<P||oe>=X)return null;for(var re=[],ge=0;ge<Y.length;ge++){var Fe=Y[ge],Ne=Fe.geometry,Le=Fe.type,st=0===J?Fe.minX:Fe.minY,mt=0===J?Fe.maxX:Fe.maxY;if(st>=P&&mt<X)re.push(Fe);else if(!(mt<P||st>=X)){var at=[];if("Point"===Le||"MultiPoint"===Le)Vo(Ne,at,P,X,J);else if("LineString"===Le)so(Ne,at,P,X,J,!1,le.lineMetrics);else if("MultiLineString"===Le)Xn(Ne,at,P,X,J,!1);else if("Polygon"===Le)Xn(Ne,at,P,X,J,!0);else if("MultiPolygon"===Le)for(var ft=0;ft<Ne.length;ft++){var Et=[];Xn(Ne[ft],Et,P,X,J,!0),Et.length&&at.push(Et)}if(at.length){if(le.lineMetrics&&"LineString"===Le){for(ft=0;ft<at.length;ft++)re.push(Mt(Fe.id,Le,at[ft],Fe.tags));continue}"LineString"!==Le&&"MultiLineString"!==Le||(1===at.length?(Le="LineString",at=at[0]):Le="MultiLineString"),"Point"!==Le&&"MultiPoint"!==Le||(Le=3===at.length?"Point":"MultiPoint"),re.push(Mt(Fe.id,Le,at,Fe.tags))}}}return re.length?re:null}function Vo(Y,z,P,X,J){for(var oe=0;oe<Y.length;oe+=3){var ce=Y[oe+J];ce>
vendor: 15,372 bytes, line 1
1=P&&ce<=X&&(z.push(Y[oe]),z.push(Y[oe+1]),z.push(Y[oe+2]))}}function so(Y,z,P,X,J,oe,ce){for(var le,re,ge=Br(Y),Fe=0===J?Uo:Ca,Ne=Y.start,Le=0;Le<Y.length-3;Le+=3){var st=Y[Le],mt=Y[Le+1],at=Y[Le+2],ft=Y[Le+3],Et=Y[Le+4],Wt=0===J?st:mt,ri=0===J?ft:Et,Si=!1;ce&&(le=Math.sqrt(Math.pow(st-ft,2)+Math.pow(mt-Et,2))),Wt<P?ri>P&&(re=Fe(ge,st,mt,ft,Et,P),ce&&(ge.start=Ne+le*re)):Wt>X?ri<X&&(re=Fe(ge,st,mt,ft,Et,X),ce&&(ge.start=Ne+le*re)):Nr(ge,st,mt,at),ri<P&&Wt>=P&&(re=Fe(ge,st,mt,ft,Et,P),Si=!0),ri>X&&Wt<=X&&(re=Fe(ge,st,mt,ft,Et,X),Si=!0),!oe&&Si&&(ce&&(ge.end=Ne+le*re),z.push(ge),ge=Br(Y)),ce&&(Ne+=le)}var ci=Y.length-3;st=Y[ci],mt=Y[ci+1],at=Y[ci+2],(Wt=0===J?st:mt)>=P&&Wt<=X&&Nr(ge,st,mt,at),ci=ge.length-3,oe&&ci>=3&&(ge[ci]!==ge[0]||ge[ci+1]!==ge[1])&&Nr(ge,ge[0],ge[1],ge[2]),ge.length&&z.push(ge)}function Br(Y){var z=[];return z.size=Y.size,z.start=Y.start,z.end=Y.end,z}function Xn(Y,z,P,X,J,oe){for(var ce=0;ce<Y.length;ce++)so(Y[ce],z,P,X,J,oe,!1)}function Nr(Y,z,P,X){Y.push(z),Y.push(P),Y.push(X)}function Uo(Y,z,P,X,J,oe){var ce=(oe-z)/(X-z);return Y.push(oe),Y.push(P+(J-P)*ce),Y.push(1),ce}function Ca(Y,z,P,X,J,oe){var ce=(oe-P)/(J-P);return Y.push(z+(X-z)*ce),Y.push(oe),Y.push(1),ce}function en(Y,z){for(var P=[],X=0;X<Y.length;X++){var J,oe=Y[X],ce=oe.type;if("Point"===ce||"MultiPoint"===ce||"LineString"===ce)J=Yn(oe.geometry,z);else if("MultiLineString"===ce||"Polygon"===ce){J=[];for(var le=0;le<oe.geometry.length;le++)J.push(Yn(oe.geometry[le],z))}else if("MultiPolygon"===ce)for(J=[],le=0;le<oe.geometry.length;le++){for(var re=[],ge=0;ge<oe.geometry[le].length;ge++)re.push(Yn(oe.geometry[le][ge],z));J.push(re)}P.push(Mt(oe.id,ce,J,oe.tags))}return P}function Yn(Y,z){var P=[];P.size=Y.size,void 0!==Y.start&&(P.start=Y.start,P.end=Y.end);for(var X=0;X<Y.length;X+=3)P.push(Y[X]+z,Y[X+1],Y[X+2]);return P}function jo(Y,z){if(Y.transformed)return Y;var P,X,J,oe=1<<Y.z,ce=Y.x,le=Y.y;for(P=0;P<Y.features.length;P++){var re=Y.features[P],ge=re.geometry,Fe=re.type;if(re.geometry=[],1===Fe)for(X=0;X<ge.length;X+=2)re.geometry.push(Vr(ge[X],ge[X+1],z,oe,ce,le));else for(X=0;X<ge.length;X++){var Ne=[];for(J=0;J<ge[X].length;J+=2)Ne.push(Vr(ge[X][J],ge[X][J+1],z,oe,ce,le));re.geometry.push(Ne)}}return Y.transformed=!0,Y}function Vr(Y,z,P,X,J,oe){return[Math.round(P*(Y*X-J)),Math.round(P*(z*X-oe))]}function Ur(Y,z,P,X,J){for(var oe=z===J.maxZoom?0:J.tolerance/((1<<z)*J.extent),ce={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:P,y:X,z,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},le=0;le<Y.length;le++){ce.numFeatures++,lo(ce,Y[le],oe,J);var re=Y[le].minX,ge=Y[le].minY,Fe=Y[le].maxX,Ne=Y[le].maxY;re<ce.minX&&(ce.minX=re),ge<ce.minY&&(ce.minY=ge),Fe>ce.maxX&&(ce.maxX=Fe),Ne>ce.maxY&&(ce.maxY=Ne)}return ce}function lo(Y,z,P,X){var J=z.geometry,oe=z.type,ce=[];if("Point"===oe||"MultiPoint"===oe)for(var le=0;le<J.length;le+=3)ce.push(J[le]),ce.push(J[le+1]),Y.numPoints++,Y.numSimplified++;else if("LineString"===oe)pr(ce,J,Y,P,!1,!1);else if("MultiLineString"===oe||"Polygon"===oe)for(le=0;le<J.length;le++)pr(ce,J[le],Y,P,"Polygon"===oe,0===le);else if("MultiPolygon"===oe)for(var re=0;re<J.length;re++){var ge=J[re];for(le=0;le<ge.length;le++)pr(ce,ge[le],Y,P,!0,0===le)}if(ce.length){var Fe=z.tags||null;if("LineString"===oe&&X.lineMetrics){for(var Ne in Fe={},z.tags)Fe[Ne]=z.tags[Ne];Fe.mapbox_clip_start=J.start/J.size,Fe.mapbox_clip_end=J.end/J.size}var Le={geometry:ce,type:"Polygon"===oe||"MultiPolygon"===oe?3:"LineString"===oe||"MultiLineString"===oe?2:1,tags:Fe};null!==z.id&&(Le.id=z.id),Y.features.push(Le)}}function pr(Y,z,P,X,J,oe){var ce=X*X;if(X>0&&z.size<(J?ce:X))P.numPoints+=z.length/3;else{for(var le=[],re=0;re<z.length;re+=3)(0===X||z[re+2]>ce)&&(P.numSimplified++,le.push(z[re]),le.push(z[re+1])),P.numPoints++;J&&function(ge,Fe){for(var Ne=0,Le=0,st=ge.length,mt=st-2;Le<st;mt=Le,Le+=2)Ne+=(ge[Le]-ge[mt])*(ge[Le+1]+ge[mt+1]);if(Ne>0===Fe)for(Le=0,st=ge.length;Le<st/2;Le+=2){var at=ge[Le],ft=ge[Le+1];ge[Le]=ge[st-2-Le],ge[Le+1]=ge[st-1-Le],ge[st-2-Le]=at,ge[st-1-Le]=ft}}(le,oe),Y.push(le)}}function qt(Y,z){var P=(z=this.options=function(J,oe){for(var ce in oe)J[ce]=oe[ce];return J}(Object.create(this.options),z)).debug;if(P&&console.time("preprocess data"),z.maxZoom<0||z.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(z.promoteId&&z.generateId)throw new Error("promoteId and generateId cannot be used together.");var J,oe,ce,le,re,ge,X=function(J,oe){var ce=[];if("FeatureCollection"===J.type)for(var le=0;le<J.features.length;le++)Qi(ce,J.features[le],oe,le);else Qi(ce,"Feature"===J.type?J:{geometry:J},oe);return ce}(Y,z);this.tiles={},this.tileCoords=[],P&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",z.indexMaxZoom,z.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),le=J=X,re=qi(J,1,-1-(ce=(oe=z).buffer/oe.extent),ce,0,-1,2,oe),ge=qi(J,1,1-ce,2+ce,0,-1,2,oe),(re||ge)&&(le=qi(J,1,-ce,1+ce,0,-1,2,oe)||[],re&&(le=en(re,1).concat(le)),ge&&(le=le.concat(en(ge,-1)))),(X=le).length&&this.splitTile(X,0,0,0),P&&(X.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function mr(Y,z,P){return 32*((1<<Y)*P+z)+Y}function tn(Y,z){const P=Y.tileID.canonical;if(!this._geoJSONIndex)return z(null,null);const X=this._geoJSONIndex.getTile(P.z,P.x,P.y);if(!X)return z(null,null);const J=new class{constructor(ce){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=s.EXTENT,this.length=ce.length,this._features=ce}feature(ce){return new class{constructor(le){this._feature=le,this.extent=s.EXTENT,this.type=le.type,this.properties=le.tags,"id"in le&&!isNaN(le.id)&&(this.id=parseInt(le.id,10))}loadGeometry(){if(1===this._feature.type){const le=[];for(const re of this._feature.geometry)le.push([new s.Point(re[0],re[1])]);return le}{const le=[];for(const re of this._feature.geometry){const ge=[];for(const Fe of re)ge.push(new s.Point(Fe[0],Fe[1]));le.push(ge)}return le}}toGeoJSON(le,re,ge){return In.call(this,le,re,ge)}}(this._features[ce])}}(X.features);let oe=Ti(J);0===oe.byteOffset&&oe.byteLength===oe.buffer.byteLength||(oe=new Uint8Array(oe)),z(null,{vectorTile:J,rawData:oe.buffer})}qt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},qt.prototype.splitTile=function(Y,z,P,X,J,oe,ce){for(var le=[Y,z,P,X],re=this.options,ge=re.debug;le.length;){X=le.pop(),P=le.pop(),z=le.pop(),Y=le.pop();var Fe=1<<z,Ne=mr(z,P,X),Le=this.tiles[Ne];if(!Le&&(ge>1&&console.time("creation"),Le=this.tiles[Ne]=Ur(Y,z,P,X,re),this.tileCoords.push({z,x:P,y:X}),ge)){ge>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",z,P,X,Le.numFeatures,Le.numPoints,Le.numSimplified),console.timeEnd("creation"));var st="z"+z;this.stats[st]=(this.stats[st]||0)+1,this.total++}if(Le.source=Y,J){if(z===re.maxZoom||z===J)continue;var mt=1<<J-z;if(P!==Math.floor(oe/mt)||X!==Math.floor(ce/mt))continue}else if(z===re.indexMaxZoom||Le.numPoints<=re.indexMaxPoints)continue;if(Le.source=null,0!==Y.length){ge>1&&console.time("clipping");var at,ft,Et,Wt,ri,Si,ci=.5*re.buffer/re.extent,_n=.5-ci,wi=.5+ci,Li=1+ci;at=ft=Et=Wt=null,ri=qi(Y,Fe,P-ci,P+wi,0,Le.minX,Le.maxX,re),Si=qi(Y,Fe,P+_n,P+Li,0,Le.minX,Le.maxX,re),Y=null,ri&&(at=qi(ri,Fe,X-ci,X+wi,1,Le.minY,Le.maxY,re),ft=qi(ri,Fe,X+_n,X+Li,1,Le.minY,Le.maxY,re),ri=null),Si&&(Et=qi(Si,Fe,X-ci,X+wi,1,Le.minY,Le.maxY,re),Wt=qi(Si,Fe,X+_n,X+Li,1,Le.minY,Le.maxY,re),Si=null),ge>1&&console.timeEnd("clipping"),le.push(at||[],z+1,2*P,2*X),le.push(ft||[],z+1,2*P,2*X+1),le.push(Et||[],z+1,2*P+1,2*X),le.push(Wt||[],z+1,2*P+1,2*X+1)}}},qt.prototype.getTile=function(Y,z,P){var X=this.options,J=X.extent,oe=X.debug;if(Y<0||Y>24)return null;var ce=1<<Y,le=mr(Y,z=(z%ce+ce)%ce,P);if(this.tiles[le])return jo(this.tiles[le],J);oe>1&&console.log("drilling down to z%d-%d-%d",Y,z,P);for(var re,ge=Y,Fe=z,Ne=P;!re&&ge>0;)ge--,Fe=Math.floor(Fe/2),Ne=Math.floor(Ne/2),re=this.tiles[mr(ge,Fe,Ne)];return re&&re.source?(oe>1&&console.log("found parent tile z%d-%d-%d",ge,Fe,Ne),oe>1&&console.time("drilling down"),this.splitTile(re.source,ge,Fe,Ne,Y,z,P),oe>1&&console.timeEnd("drilling down"),this.tiles[le]?jo(this.tiles[le],J):null):null};class Jt extends s.VectorTileWorkerSource{constructor(z,P,X,J,oe){super(z,P,X,J,tn),oe&&(this.loadGeoJSON=oe)}loadData(z,P){const X=z&&z.request,J=X&&X.collectResourceTiming;this.loadGeoJSON(z,(oe,ce)=>{if(oe||!ce)return P(oe);if("object"!=typeof ce)return P(new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`));{Fi(ce,!0);try{if(z.filter){const re=s.createExpression(z.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===re.result)throw new Error(re.value.map(Fe=>`${Fe.key}: ${Fe.message}`).join(", "));const ge=ce.features.filter(Fe=>re.value.evaluate({zoom:0},Fe));ce={type:"FeatureCollection",features:ge}}this._geoJSONIndex=z.cluster?new ni(function({superclusterOptions:re,clusterProperties:ge}){if(!ge||!re)return re;const Fe={},Ne={},Le={accumulated:null,zoom:0},st={properties:null},mt=Object.keys(ge);for(const at of mt){const[ft,Et]=ge[at],Wt=s.createExpression(Et),ri=s.createExpression("string"==typeof ft?[ft,["accumulated"],["get",at]]:ft);Fe[at]=Wt.value,Ne[at]=ri.value}return re.map=at=>{st.properties=at;const ft={};for(const Et of mt)ft[Et]=Fe[Et].evaluate(Le,st);return ft},re.reduce=(at,ft)=>{st.properties=ft;for(const Et of mt)Le.accumulated=at[Et],at[Et]=Ne[Et].evaluate(Le,st)},re}(z)).load(ce.features):new qt(re=ce,z.geojsonVtOptions)}catch(re){return P(re)}this.loaded={};const le={};if(J){const re=s.getPerformanceMeasurement(X);re&&(le.resourceTiming={},le.resourceTiming[z.source]=JSON.parse(JSON.stringify(re)))}P(null,le)}var re})}reloadTile(z,P){const X=this.loaded;return X&&X[z.uid]?super.reloadTile(z,P):this.loadTile(z,P)}loadGeoJSON(z,P){if(z.request)s.getJSON(z.request,P);else{if("string"!=typeof z.data)return P(new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`));try{return P(null,JSON.parse(z.data))}catch(X){return P(new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(z,P){try{P(null,this._geoJSONIndex.getClusterExpansionZoom(z.clusterId))}catch(X){P(X)}}getClusterChildren(z,P){try{P(null,this._geoJSONIndex.getChildren(z.clusterId))}catch(X){P(X)}}getClusterLeaves(z,P){try{P(null,this._geoJSONIndex.getLeaves(z.clusterId,z.limit,z.offset))}catch(X){P(X)}}}class co{constructor(z){this.self=z,this.actor=new s.Actor(z,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=s.getProjection({name:"mercator"}),this.workerSourceTypes={vector:s.VectorTileWorkerSource,geojson:Jt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(P,X)=>{if(this.workerSourceTypes[P])throw new Error(`Worker source with name "${P}" already registered.`);this.workerSourceTypes[P]=X},this.self.registerRTLTextPlugin=P=>{if(s.plugin.isParsed())throw new Error("RTL text plugin already registered.");s.plugin.applyArabicShaping=P.applyArabicShaping,s.plugin.processBidirectionalText=P.processBidirectionalText,s.plugin.processStyledBidirectionalText=P.processStyledBidirectionalText}}clearCaches(z,P,X){delete this.layerIndexes[z],delete this.availableImages[z],delete this.workerSources[z],delete this.demWorkerSources[z],X()}checkIfReady(z,P,X){X()}setReferrer(z,P){this.referrer=P}spriteLoaded(z,P){this.isSpriteLoaded[z]=P;for(const X in this.workerSources[z]){const J=this.workerSources[z][X];for(const oe in J)J[oe]instanceof s.VectorTileWorkerSource&&(J[oe].isSpriteLoaded=P,J[oe].fire(new s.Event("isSpriteLoaded")))}}setImages(z,P,X){this.availableImages[z]=P;for(const J in this.workerSources[z]){const oe=this.workerSources[z][J];for(const ce in oe)oe[ce].availableImages=P}X()}enableTerrain(z,P,X){this.terrain=P,X()}setProjection(z,P){this.projections[z]=s.getProjection(P)}setLayers(z,P,X){this.getLayerIndex(z).replace(P),X()}updateLayers(z,P,X){this.getLayerIndex(z).update(P.layers,P.removedIds),X()}loadTile(z,P,X){const J=this.enableTerrain?s.extend({enableTerrain:this.terrain},P):P;J.projection=this.projections[z]||this.defaultProjection,this.getWorkerSource(z,P.type,P.source).loadTile(J,X)}loadDEMTile(z,P,X){const J=this.enableTerrain?s.extend({buildQuadTree:this.terrain},P):P;this.getDEMWorkerSource(z,P.source).loadTile(J,X)}reloadTile(z,P,X){const J=this.enableTerrain?s.extend({enableTerrain:this.terrain},P):P;J.projection=this.projections[z]||this.defaultProjection,this.getWorkerSource(z,P.type,P.source).reloadTile(J,X)}abortTile(z,P,X){this.getWorkerSource(z,P.type,P.source).abortTile(P,X)}removeTile(z,P,X){this.getWorkerSource(z,P.type,P.source).removeTile(P,X)}removeSource(z,P,X){if(!this.workerSources[z]||!this.workerSources[z][P.type]||!this.workerSources[z][P.type][P.source])return;const J=this.workerSources[z][P.type][P.source];delete this.workerSources[z][P.type][P.source],void 0!==J.removeSource?J.removeSource(P,X):X()}loadWorkerSource(z,P,X){try{this.self.importScripts(P.url),X()}catch(J){X(J.toString())}}syncRTLPluginState(z,P,X){try{s.plugin.setState(P);const J=s.plugin.getPluginURL();if(s.plugin.isLoaded()&&!s.plugin.isParsed()&&null!=J){this.self.importScripts(J);const oe=s.plugin.isParsed();X(oe?void 0:new Error(`RTL Text Plugin failed to import scripts from ${J}`),oe)}}catch(J){X(J.toString())}}getAvailableImages(z){let P=this.availableImages[z];return P||(P=[]),P}getLayerIndex(z){let P=this.layerIndexes[z];return P||(P=this.layerIndexes[z]=new Ji),P}getWorkerSource(z,P,X){return this.workerSources[z]||(this.workerSources[z]={}),this.workerSources[z][P]||(this.workerSources[z][P]={}),this.workerSources[z][P][X]||(this.workerSources[z][P][X]=new this.workerSourceTypes[P]({send:(oe,ce,le,re,ge,Fe)=>{this.actor.send(oe,ce,le,z,ge,Fe)},scheduler:this.actor.scheduler},this.getLayerIndex(z),this.getAvailableImages(z),this.isSpriteLoaded[z])),this.workerSources[z][P][X]}getDEMWorkerSource(z,P){return this.demWorkerSources[z]||(this.demWorkerSources[z]={}),this.demWorkerSources[z][P]||(this.demWorkerSources[z][P]=new ut),this.demWorkerSources[z][P]}enforceCacheSizeLimit(z,P){s.enforceCacheSizeLimit(P)}getWorkerPerformanceMetrics(z,P,X){X(void 0,void 0)}}return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new co(self)),co}),xl(0,function(s){function Ie(l,n){if(Array.isArray(l)){if(!Array.isArray(n)||l.length!==n.length)return!1;for(let o=0;o<l.length;o++)if(!Ie(l[o],n[o]))return!1;return!0}if("object"==typeof l&&null!==l&&null!==n){if("object"!=typeof n||Object.keys(l).length!==Object.keys(n).length)return!1;for(const o in l)if(!Ie(l[o],n[o]))return!1;return!0}return l===n}var An=Ji;function Ji(l){return n=l,!("undefined"==typeof window||"undefined"==typeof document||!(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)||
1!Function.prototype||!Function.prototype.bind||!(Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions)||!("JSON"in window&&"parse"in JSON&&"stringify"in JSON)||!function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var h,d,m=new Blob([""],{type:"text/javascript"}),y=URL.createObjectURL(m);try{d=new Worker(y),h=!0}catch(v){h=!1}return d&&d.terminate(),URL.revokeObjectURL(y),h}()||!("Uint8ClampedArray"in window)||!ArrayBuffer.isView||!function(){var h=document.createElement("canvas");h.width=h.height=1;var d=h.getContext("2d");if(!d)return!1;var m=d.getImageData(0,0,1,1);return m&&m.width===h.width}()||(void 0===ut[o=n&&n.failIfMajorPerformanceCaveat]&&(ut[o]=function(h){var d,y,v,b,m=(y=h,v=document.createElement("canvas"),(b=Object.create(Ji.webGLContextAttributes)).failIfMajorPerformanceCaveat=y,v.getContext("webgl",b)||v.getContext("experimental-webgl",b));if(!m)return!1;try{d=m.createShader(m.VERTEX_SHADER)}catch(y){return!1}return!(!d||m.isContextLost())&&(m.shaderSource(d,"void main() {}"),m.compileShader(d),!0===m.getShaderParameter(d,m.COMPILE_STATUS))}(o)),!ut[o]||document.documentMode));var n,o}var ut={};function vt(l,n,o){const h=s.window.document.createElement(l);return void 0!==n&&(h.className=n),o&&o.appendChild(h),h}function Ci(l,n,o){const h=s.window.document.createElementNS("http://www.w3.org/2000/svg",l);for(const d of Object.keys(n))h.setAttributeNS(null,d,n[d]);return o&&o.appendChild(h),h}Ji.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const Fi=s.window.document&&s.window.document.documentElement.style,In=Fi&&void 0!==Fi.userSelect?"userSelect":"WebkitUserSelect";let ve;function Zi(){Fi&&In&&(ve=Fi[In],Fi[In]="none")}function Zn(){Fi&&In&&(Fi[In]=ve)}function li(l){l.preventDefault(),l.stopPropagation(),s.window.removeEventListener("click",li,!0)}function Pr(){s.window.addEventListener("click",li,!0),s.window.setTimeout(()=>{s.window.removeEventListener("click",li,!0)},0)}function Bi(l,n){const o=l.getBoundingClientRect();return un(l,o,n)}function hr(l,n){const o=l.getBoundingClientRect(),h=[];for(let d=0;d<n.length;d++)h.push(un(l,o,n[d]));return h}function Dn(l){return void 0!==s.window.InstallTrigger&&2===l.button&&l.ctrlKey&&s.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:l.button}function un(l,n,o){const h=l.offsetWidth===n.width?1:l.offsetWidth/n.width;return new s.Point((o.clientX-n.left)*h,(o.clientY-n.top)*h)}function Ve(l,n){var o=n[0],h=n[1],d=n[2],m=n[3],y=o*m-d*h;return y?(l[0]=m*(y=1/y),l[1]=-h*y,l[2]=-d*y,l[3]=o*y,l):null}function Bo(l){const{userImage:n}=l;return!!(n&&n.render&&n.render())&&(l.data.replace(new Uint8Array(n.data.buffer)),!0)}class $i extends s.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new s.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(n){if(this.loaded!==n&&(this.loaded=n,n)){for(const{ids:o,callback:h}of this.requestors)this._notify(o,h);this.requestors=[]}}hasImage(n){return!!this.getImage(n)}getImage(n){return this.images[n]}addImage(n,o){this._validate(n,o)&&(this.images[n]=o)}_validate(n,o){let h=!0;return this._validateStretch(o.stretchX,o.data&&o.data.width)||(this.fire(new s.ErrorEvent(new Error(`Image "${n}" has invalid "stretchX" value`))),h=!1),this._validateStretch(o.stretchY,o.data&&o.data.height)||(this.fire(new s.ErrorEvent(new Error(`Image "${n}" has invalid "stretchY" value`))),h=!1),this._validateContent(o.content,o)||(this.fire(new s.ErrorEvent(new Error(`Image "${n}" has invalid "content" value`))),h=!1),h}_validateStretch(n,o){if(!n)return!0;let h=0;for(const d of n){if(d[0]<h||d[1]<d[0]||o<d[1])return!1;h=d[1]}return!0}_validateContent(n,o){return!(n&&(4!==n.length||n[0]<0||o.data.width<n[0]||n[1]<0||o.data.height<n[1]||n[2]<0||o.data.width<n[2]||n[3]<0||o.data.height<n[3]||n[2]<n[0]||n[3]<n[1]))}updateImage(n,o){o.version=this.images[n].version+1,this.images[n]=o,this.updatedImages[n]=!0}removeImage(n){const o=this.images[n];delete this.images[n],delete this.patterns[n],o.userImage&&o.userImage.onRemove&&o.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(n,o){let h=!0;
vendor: 10,244 bytes, line 1
1if(!this.isLoaded())for(const d of n)this.images[d]||(h=!1);this.isLoaded()||h?this._notify(n,o):this.requestors.push({ids:n,callback:o})}_notify(n,o){const h={};for(const d of n){this.images[d]||this.fire(new s.Event("styleimagemissing",{id:d}));const m=this.images[d];m?h[d]={data:m.data.clone(),pixelRatio:m.pixelRatio,sdf:m.sdf,version:m.version,stretchX:m.stretchX,stretchY:m.stretchY,content:m.content,hasRenderCallback:Boolean(m.userImage&&m.userImage.render)}:s.warnOnce(`Image "${d}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}o(null,h)}getPixelSize(){const{width:n,height:o}=this.atlasImage;return{width:n,height:o}}getPattern(n){const o=this.patterns[n],h=this.getImage(n);if(!h)return null;if(o&&o.position.version===h.version)return o.position;if(o)o.position.version=h.version;else{const d={w:h.data.width+2,h:h.data.height+2,x:0,y:0},m=new s.ImagePosition(d,h);this.patterns[n]={bin:d,position:m}}return this._updatePatternAtlas(),this.patterns[n].position}bind(n){const o=n.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new s.Texture(n,this.atlasImage,o.RGBA),this.atlasTexture&&this.atlasTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE)}_updatePatternAtlas(){const n=[];for(const m in this.patterns)n.push(this.patterns[m].bin);const{w:o,h}=s.potpack(n),d=this.atlasImage;d.resize({width:o||1,height:h||1});for(const m in this.patterns){const{bin:y}=this.patterns[m],v=y.x+1,b=y.y+1,C=this.images[m].data,E=C.width,I=C.height;s.RGBAImage.copy(C,d,{x:0,y:0},{x:v,y:b},{width:E,height:I}),s.RGBAImage.copy(C,d,{x:0,y:I-1},{x:v,y:b-1},{width:E,height:1}),s.RGBAImage.copy(C,d,{x:0,y:0},{x:v,y:b+I},{width:E,height:1}),s.RGBAImage.copy(C,d,{x:E-1,y:0},{x:v-1,y:b},{width:1,height:I}),s.RGBAImage.copy(C,d,{x:0,y:0},{x:v+E,y:b},{width:1,height:I})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(n){for(const o of n){if(this.callbackDispatchedThisFrame[o])continue;this.callbackDispatchedThisFrame[o]=!0;const h=this.images[o];Bo(h)&&this.updateImage(o,h)}}}const wt=new s.Properties({anchor:new s.DataConstantProperty(s.spec.light.anchor),position:new class{constructor(){this.specification=s.spec.light.position}possiblyEvaluate(l,n){return function([o,h,d]){const m=s.degToRad(h+90),y=s.degToRad(d);return{x:o*Math.cos(m)*Math.sin(y),y:o*Math.sin(m)*Math.sin(y),z:o*Math.cos(y),azimuthal:h,polar:d}}(l.expression.evaluate(n))}interpolate(l,n,o){return{x:s.number(l.x,n.x,o),y:s.number(l.y,n.y,o),z:s.number(l.z,n.z,o),azimuthal:s.number(l.azimuthal,n.azimuthal,o),polar:s.number(l.polar,n.polar,o)}}},color:new s.DataConstantProperty(s.spec.light.color),intensity:new s.DataConstantProperty(s.spec.light.intensity)});class di extends s.Evented{constructor(n){super(),this._transitionable=new s.Transitionable(wt),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(n,o={}){if(!this._validate(s.validateLight,n,o))for(const h in n){const d=n[h];s.endsWith(h,"-transition")?this._transitionable.setTransition(h.slice(0,-11),d):this._transitionable.setValue(h,d)}}updateTransitions(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(n){this.properties=this._transitioning.possiblyEvaluate(n)}_validate(n,o,h){return(!h||!1!==h.validate)&&s.emitValidationErrors(this,n.call(s.validateStyle,s.extend({value:o,style:{glyphs:!0,sprite:!0},styleSpec:s.spec})))}}const Ma=new s.Properties({source:new s.DataConstantProperty(s.spec.terrain.source),exaggeration:new s.DataConstantProperty(s.spec.terrain.exaggeration)});let ur=class extends s.Evented{constructor(l,n){super(),this._transitionable=new s.Transitionable(Ma),this.set(l),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=n}get(){return this._transitionable.serialize()}set(l){for(const n in l){const o=l[n];s.endsWith(n,"-transition")?this._transitionable.setTransition(n.slice(0,-11),o):this._transitionable.setValue(n,o)}}updateTransitions(l){this._transitioning=this._transitionable.transitioned(l,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(l){this.properties=this._transitioning.possiblyEvaluate(l)}};function Ti(l,n,o,h){const d=s.smoothstep(45,65,o),[m,y]=Lr(l,h),v=s.length(n);let b=1-Math.min(1,Math.exp((v-m)/(y-m)*-6));return b*=b*b,b=Math.min(1,1.00747*b),b*d*l.alpha}function Lr(l,n){const o=.5/Math.tan(.5*n);return[l.range[0]+o,l.range[1]+o]}const rt=new s.Properties({range:new s.DataConstantProperty(s.spec.fog.range),color:new s.DataConstantProperty(s.spec.fog.color),"high-color":new s.DataConstantProperty(s.spec.fog["high-color"]),"space-color":new s.DataConstantProperty(s.spec.fog["space-color"]),"horizon-blend":new s.DataConstantProperty(s.spec.fog["horizon-blend"]),"star-intensity":new s.DataConstantProperty(s.spec.fog["star-intensity"])});class Rr extends s.Evented{constructor(n,o){super(),this._transitionable=new s.Transitionable(rt),this.set(n),this._transitioning=this._transitionable.untransitioned(),this._transform=o}get state(){const n=this._transform,o="globe"===n.projection.name,h=s.globeToMercatorTransition(n.zoom),d=this.properties.get("range"),m=[.5,3];return{range:o?[s.number(m[0],d[0],h),s.number(m[1],d[1],h)]:d,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(n,o={}){if(!this._validate(s.validateFog,n,o)){for(const h of Object.keys(s.spec.fog))n&&void 0===n[h]&&(n[h]=s.spec.fog[h].default);for(const h in n){const d=n[h];s.endsWith(h,"-transition")?this._transitionable.setTransition(h.slice(0,-11),d):this._transitionable.setValue(h,d)}}}getOpacity(n){if(!this._transform.projection.supportsFog)return 0;const o=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:s.smoothstep(45,65,n))*o.a}getOpacityAtLatLng(n,o){return this._transform.projection.supportsFog?function(h,d,m){const y=s.MercatorCoordinate.fromLngLat(d),v=m.elevation?m.elevation.getAtPointOrZero(y):0,b=[y.x,y.y,v];return s.transformMat4(b,b,m.mercatorFogMatrix),Ti(h,b,m.pitch,m._fov)}(this.state,n,o):0}getFovAdjustedRange(n){return this._transform.projection.supportsFog?Lr(this.state,n):[0,1]}updateTransitions(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(n){this.properties=this._transitioning.possiblyEvaluate(n)}_validate(n,o,h){return(!h||!1!==h.validate)&&s.emitValidationErrors(this,n.call(s.validateStyle,s.extend({value:o,style:{glyphs:!0,sprite:!0},styleSpec:s.spec})))}}class pi{constructor(n,o){this.workerPool=n,this.actors=[],this.currentActor=0,this.id=s.uniqueId();const h=this.workerPool.acquire(this.id);for(let d=0;d<h.length;d++){const m=new pi.Actor(h[d],o,this.id);m.name=`Worker ${d}`,this.actors.push(m)}this.ready=!1,this.broadcast("checkIfReady",null,()=>{this.ready=!0})}broadcast(n,o,h){s.asyncAll(this.actors,(d,m)=>{d.send(n,o,m)},h=h||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(n=>{n.remove()}),this.actors=[],this.workerPool.release(this.id)}}function bi(l,n,o){return n*(s.EXTENT/(l.tileSize*Math.pow(2,o-l.tileID.overscaledZ)))}pi.Actor=s.Actor;class $n{constructor(n,o,h,d){this.screenBounds=n,this.cameraPoint=o,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=h,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,d)}static createFromScreenPoints(n,o){let h,d;if(n instanceof s.Point||"number"==typeof n[0]){const m=s.Point.convert(n);h=[m],d=o.isPointAboveHorizon(m)}else{const m=s.Point.convert(n[0]),y=s.Point.convert(n[1]);h=[m,y],d=s.polygonizeBounds(m,y).every(v=>o.isPointAboveHorizon(v))}return new $n(h,o.getCameraPoint(),d,o)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(n){return s.polygonizeBounds(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],n)}bufferedCameraGeometry(n){const o=this.screenBounds[0],h=1===this.screenBounds.length?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],d=s.polygonizeBounds(o,h,0,!1);return this.cameraPoint.y>h.y&&(this.cameraPoint.x>o.x&&this.cameraPoint.x<h.x?d.splice(3,0,this.cameraPoint):this.cameraPoint.x>=h.x?d[2]=this.cameraPoint:this.cameraPoint.x<=o.x&&(d[3]=this.cameraPoint)),s.bufferConvexPolygon(d,n)}bufferedCameraGeometryGlobe(n){const o=this.screenBounds[0],h=1===this.screenBounds.length?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],d=s.polygonizeBounds(o,h,n),m=this.cameraPoint.clone();switch(3*((m.y>o.y)+(m.y>h.y))+((m.x>o.x)+(m.x>h.x))){case 0:d[0]=m,d[4]=m.clone();break;case 1:d.splice(1,0,m);break;case 2:d[1]=m;break;case 3:d.splice(4,0,m);break;case 5:d.splice(2,0,m);break;case 6:d[3]=m;break;case 7:d.splice(3,0,m);break;case 8:d[2]=m}return d}containsTile(n,o,h,d=0){const m=n.queryPadding/o._pixelsPerMercatorPixel+1,y=h?this._bufferedCameraMercator(m,o):this._bufferedScreenMercator(m,o);let v=n.tileID.wrap+(y.unwrapped?d:0);const b=y.polygon.map(U=>s.getTilePoint(n.tileTransform,U,v));if(!s.polygonIntersectsBox(b,0,0,s.EXTENT,s.EXTENT))return;v=n.tileID.wrap+(this.screenGeometryMercator.unwrapped?d:0);const C=this.screenGeometryMercator.polygon.map(U=>s.getTileVec3(n.tileTransform,U,v)),E=C.map(U=>new s.Point(U[0],U[1])),I=o.getFreeCameraOptions().position||new s.MercatorCoordinate(0,0,0),L=s.getTileVec3(n.tileTransform,I,v),B=C.map(U=>{const D=s.sub(U,U,L);return s.normalize(D,D),new s.Ray(L,D)}),V=bi(n,1,o.zoom)*o._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:E,tilespaceRays:B,bufferedTilespaceGeometry:b,bufferedTilespaceBounds:(N=s.getBounds(b),N.min.x=s.clamp(N.min.x,0,s.EXTENT),N.min.y=s.clamp(N.min.y,0,s.EXTENT),N.max.x=s.clamp(N.max.x,
10,s.EXTENT),N.max.y=s.clamp(N.max.y,0,s.EXTENT),N),tile:n,tileID:n.tileID,pixelToTileUnitsFactor:V};var N}_bufferedScreenMercator(n,o){const h=Or(n);if(this._screenRaycastCache[h])return this._screenRaycastCache[h];{let d;return d="globe"===o.projection.name?this._projectAndResample(this.bufferedScreenGeometry(n),o):{polygon:this.bufferedScreenGeometry(n).map(m=>o.pointCoordinate3D(m)),unwrapped:!0},this._screenRaycastCache[h]=d,d}}_bufferedCameraMercator(n,o){const h=Or(n);if(this._cameraRaycastCache[h])return this._cameraRaycastCache[h];{let d;return d="globe"===o.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(n),o):{polygon:this.bufferedCameraGeometry(n).map(m=>o.pointCoordinate3D(m)),unwrapped:!0},this._cameraRaycastCache[h]=d,d}}_projectAndResample(n,o){const h=function(m,y){const v=s.multiply([],y.pixelMatrix,y.globeMatrix),b=[0,-s.GLOBE_RADIUS,0,1],C=[0,s.GLOBE_RADIUS,0,1],E=[0,0,0,1];s.transformMat4$1(b,b,v),s.transformMat4$1(C,C,v),s.transformMat4$1(E,E,v);const I=new s.Point(b[0]/b[3],b[1]/b[3]),L=new s.Point(C[0]/C[3],C[1]/C[3]),B=s.polygonContainsPoint(m,I)&&b[3]<E[3],V=s.polygonContainsPoint(m,L)&&C[3]<E[3];if(!B&&!V)return null;const N=function(ie,se,ae){for(let me=1;me<ie.length;me++){const ke=qn(se.pointCoordinate3D(ie[me-1]).x),he=qn(se.pointCoordinate3D(ie[me]).x);if(ae<0){if(ke<he)return{idx:me,t:-ke/(he-1-ke)}}else if(he<ke)return{idx:me,t:(1-ke)/(he+1-ke)}}return null}(m,y,B?-1:1);if(!N)return null;const{idx:U,t:D}=N;let F=U>1?ni(m.slice(0,U),y):[],$=U<m.length?ni(m.slice(U),y):[];F=F.map(ie=>new s.Point(qn(ie.x),ie.y)),$=$.map(ie=>new s.Point(qn(ie.x),ie.y));const W=[...F];0===W.length&&W.push($[$.length-1]);const te=s.number(W[W.length-1].y,(0===$.length?F[0]:$[0]).y,D);let ne;return ne=B?[new s.Point(0,te),new s.Point(0,0),new s.Point(1,0),new s.Point(1,te)]:[new s.Point(1,te),new s.Point(1,1),new s.Point(0,1),new s.Point(0,te)],W.push(...ne),0===$.length?W.push(F[0]):W.push(...$),{polygon:W.map(ie=>new s.MercatorCoordinate(ie.x,ie.y)),unwrapped:!1}}(n,o);if(h)return h;const d=function(m,y){let v=!1,b=-1/0,C=0;for(let I=0;I<m.length-1;I++)m[I].x>b&&(b=m[I].x,C=I);for(let I=0;I<m.length-1;I++){const L=(C+I)%(m.length-1),B=m[L],V=m[L+1];Math.abs(B.x-V.x)>.5&&(B.x<V.x?(B.x+=1,0===L&&(m[m.length-1].x+=1)):(V.x+=1,L+1===m.length-1&&(m[0].x+=1)),v=!0)}const E=s.mercatorXfromLng(y.center.lng);return v&&E<Math.abs(E-1)&&m.forEach(I=>{I.x-=1}),{polygon:m,unwrapped:v}}(ni(n,o).map(m=>new s.Point(qn(m.x),m.y)),o);return{polygon:d.polygon.map(m=>new s.MercatorCoordinate(m.x,m.y)),unwrapped:d.unwrapped}}}function ni(l,n){return s.resample(l,o=>{const h=n.pointCoordinate3D(o);o.x=h.x,o.y=h.y},1/256)}function qn(l){return l<0?1+l%1:l%1}function Or(l){return 100*l|0}function Wn(l,n,o,h,d){const m=function(y,v){if(y)return d(y);if(v){l.url&&v.tiles&&l.tiles&&delete l.tiles;const b=s.pick(s.extend(v,l),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);v.vector_layers&&(b.vectorLayers=v.vector_layers,b.vectorLayerIds=b.vectorLayers.map(C=>C.id)),b.tiles=n.canonicalizeTileset(b,l.url),d(null,b)}};return l.url?s.getJSON(n.transformRequest(n.normalizeSourceURL(l.url,null,o,h),s.ResourceType.Source),m):s.exported.frame(()=>m(null,l))}class kn{constructor(n,o,h){this.bounds=s.LngLatBounds.convert(this.validateBounds(n)),this.minzoom=o||0,this.maxzoom=h||24}validateBounds(n){return Array.isArray(n)&&4===n.length?[Math.max(-180,n[0]),Math.max(-90,n[1]),Math.min(180,n[2]),Math.min(90,n[3])]:[-180,-90,180,90]}contains(n){const o=Math.pow(2,n.z),h=Math.floor(s.mercatorXfromLng(this.bounds.getWest())*o),d=Math.floor(s.mercatorYfromLat(this.bounds.getNorth())*o),m=Math.ceil(s.mercatorXfromLng(this.bounds.getEast())*o),y=Math.ceil(s.mercatorYfromLat(this.bounds.getSouth())*o);return n.x>=h&&n.x<m&&n.y>=d&&n.y<y}}class oo{constructor(n,o,h){this.context=n;const d=n.gl;this.buffer=d.createBuffer(),this.dynamicDraw=Boolean(h),this.context.unbindVAO(),n.bindElementBuffer.set(this.buffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?d.DYNAMIC_DRAW:d.STATIC_DRAW),this.dynamicDraw||o.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(n){const o=this.context.gl;this.context.unbindVAO(),this.bind(),o.bufferSubData(o.ELEMENT_ARRAY_BUFFER,0,n.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const dr={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Fr{constructor(n,o,h,d){this.length=o.length,this.attributes=h,this.itemSize=o.bytesPerElement,this.dynamicDraw=d,this.context=n;const m=n.gl;this.buffer=m.createBuffer(),n.bindVertexBuffer.set(this.buffer),m.bufferData(m.ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?m.DYNAMIC_DRAW:m.STATIC_DRAW),this.dynamicDraw||o.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(n){const o=this.context.gl;this.bind(),o.bufferSubData(o.ARRAY_BUFFER,0,n.arrayBuffer)}
vendor: 6,992 bytes, line 1
1enableAttributes(n,o){for(let h=0;h<this.attributes.length;h++){const d=o.attributes[this.attributes[h].name];void 0!==d&&n.enableVertexAttribArray(d)}}setVertexAttribPointers(n,o,h){for(let d=0;d<this.attributes.length;d++){const m=this.attributes[d],y=o.attributes[m.name];void 0!==y&&n.vertexAttribPointer(y,m.components,n[dr[m.type]],!1,this.itemSize,m.offset+this.itemSize*(h||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Mt{constructor(n){this.gl=n.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(n){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class ao extends Mt{getDefault(){return s.Color.transparent}set(n){const o=this.current;(n.r!==o.r||n.g!==o.g||n.b!==o.b||n.a!==o.a||this.dirty)&&(this.gl.clearColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)}}class Qi extends Mt{getDefault(){return 1}set(n){(n!==this.current||this.dirty)&&(this.gl.clearDepth(n),this.current=n,this.dirty=!1)}}class No extends Mt{getDefault(){return 0}set(n){(n!==this.current||this.dirty)&&(this.gl.clearStencil(n),this.current=n,this.dirty=!1)}}class Ht extends Mt{getDefault(){return[!0,!0,!0,!0]}set(n){const o=this.current;(n[0]!==o[0]||n[1]!==o[1]||n[2]!==o[2]||n[3]!==o[3]||this.dirty)&&(this.gl.colorMask(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)}}class dn extends Mt{getDefault(){return!0}set(n){(n!==this.current||this.dirty)&&(this.gl.depthMask(n),this.current=n,this.dirty=!1)}}class Ea extends Mt{getDefault(){return 255}set(n){(n!==this.current||this.dirty)&&(this.gl.stencilMask(n),this.current=n,this.dirty=!1)}}class zn extends Mt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(n){const o=this.current;(n.func!==o.func||n.ref!==o.ref||n.mask!==o.mask||this.dirty)&&(this.gl.stencilFunc(n.func,n.ref,n.mask),this.current=n,this.dirty=!1)}}class qi extends Mt{getDefault(){const n=this.gl;return[n.KEEP,n.KEEP,n.KEEP]}set(n){const o=this.current;(n[0]!==o[0]||n[1]!==o[1]||n[2]!==o[2]||this.dirty)&&(this.gl.stencilOp(n[0],n[1],n[2]),this.current=n,this.dirty=!1)}}class Vo extends Mt{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;const o=this.gl;n?o.enable(o.STENCIL_TEST):o.disable(o.STENCIL_TEST),this.current=n,this.dirty=!1}}class so extends Mt{getDefault(){return[0,1]}set(n){const o=this.current;(n[0]!==o[0]||n[1]!==o[1]||this.dirty)&&(this.gl.depthRange(n[0],n[1]),this.current=n,this.dirty=!1)}}class Br extends Mt{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;const o=this.gl;n?o.enable(o.DEPTH_TEST):o.disable(o.DEPTH_TEST),this.current=n,this.dirty=!1}}class Xn extends Mt{getDefault(){return this.gl.LESS}set(n){(n!==this.current||this.dirty)&&(this.gl.depthFunc(n),this.current=n,this.dirty=!1)}}class Nr extends Mt{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;const o=this.gl;n?o.enable(o.BLEND):o.disable(o.BLEND),this.current=n,this.dirty=!1}}class Uo extends Mt{getDefault(){const n=this.gl;return[n.ONE,n.ZERO]}set(n){const o=this.current;(n[0]!==o[0]||n[1]!==o[1]||this.dirty)&&(this.gl.blendFunc(n[0],n[1]),this.current=n,this.dirty=!1)}}class Ca extends Mt{getDefault(){return s.Color.transparent}set(n){const o=this.current;(n.r!==o.r||n.g!==o.g||n.b!==o.b||n.a!==o.a||this.dirty)&&(this.gl.blendColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)}}class en extends Mt{getDefault(){return this.gl.FUNC_ADD}set(n){(n!==this.current||this.dirty)&&(this.gl.blendEquation(n),this.current=n,this.dirty=!1)}}class Yn extends Mt{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;const o=this.gl;n?o.enable(o.CULL_FACE):o.disable(o.CULL_FACE),this.current=n,this.dirty=!1}}class jo extends Mt{getDefault(){return this.gl.BACK}set(n){(n!==this.current||this.dirty)&&(this.gl.cullFace(n),this.current=n,this.dirty=!1)}}class Vr extends Mt{getDefault(){return this.gl.CCW}set(n){(n!==this.current||this.dirty)&&(this.gl.frontFace(n),this.current=n,this.dirty=!1)}}let Ur,lo=class extends Mt{getDefault(){return null}set(l){(l!==this.current||this.dirty)&&(this.gl.useProgram(l),this.current=l,this.dirty=!1)}};class pr extends Mt{getDefault(){return this.gl.TEXTURE0}set(n){(n!==this.current||this.dirty)&&(this.gl.activeTexture(n),this.current=n,this.dirty=!1)}}class qt extends Mt{getDefault(){const n=this.gl;return[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}set(n){const o=this.current;(n[0]!==o[0]||n[1]!==o[1]||n[2]!==o[2]||n[3]!==o[3]||this.dirty)&&(this.gl.viewport(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)}}class mr extends Mt{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;const o=this.gl;o.bindFramebuffer(o.FRAMEBUFFER,n),this.current=n,this.dirty=!1}}class tn extends Mt{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;const o=this.gl;o.bindRenderbuffer(o.RENDERBUFFER,n),this.current=n,this.dirty=!1}}class Jt extends Mt{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;const o=this.gl;o.bindTexture(o.TEXTURE_2D,n),this.current=n,this.dirty=!1}}class co extends Mt{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;const o=this.gl;o.bindBuffer(o.ARRAY_BUFFER,n),this.current=n,this.dirty=!1}}class Y extends Mt{getDefault(){return null}set(n){const o=this.gl;o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,n),this.current=n,this.dirty=!1}}class z extends Mt{constructor(n){super(n),this.vao=n.extVertexArrayObject}getDefault(){return null}set(n){this.vao&&(n!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(n),this.current=n,this.dirty=!1)}}class P extends Mt{getDefault(){return 4}set(n){if(n===this.current&&!this.dirty)return;const o=this.gl;o.pixelStorei(o.UNPACK_ALIGNMENT,n),this.current=n,this.dirty=!1}}class X extends Mt{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;const o=this.gl;o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),this.current=n,this.dirty=!1}}class J extends Mt{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;const o=this.gl;o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,n),this.current=n,this.dirty=!1}}class oe extends Mt{constructor(n,o){super(n),this.context=n,this.parent=o}getDefault(){return null}}class ce extends oe{setDirty(){this.dirty=!0}set(n){if(n===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const o=this.gl;o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,n,0),this.current=n,this.dirty=!1}}class le extends oe{attachment(){return this.gl.DEPTH_ATTACHMENT}set(n){if(n===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const o=this.gl;o.framebufferRenderbuffer(o.FRAMEBUFFER,this.attachment(),o.RENDERBUFFER,n),this.current=n,this.dirty=!1}}class re extends le{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}class ge{constructor(n,o,h,d){this.context=n,this.width=o,this.height=h;const m=this.framebuffer=n.gl.createFramebuffer();
1this.colorAttachment=new ce(n,m),d&&(this.depthAttachment=new le(n,m))}destroy(){const n=this.context.gl,o=this.colorAttachment.get();if(o&&n.deleteTexture(o),this.depthAttachment){const h=this.depthAttachment.get();h&&n.deleteRenderbuffer(h)}n.deleteFramebuffer(this.framebuffer)}}class Fe{constructor(n,o=!1){if(this.gl=n,this.isWebGL2=o,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),o){const h=n;this.extVertexArrayObject={createVertexArrayOES:h.createVertexArray.bind(n),deleteVertexArrayOES:h.deleteVertexArray.bind(n),bindVertexArrayOES:h.bindVertexArray.bind(n)}}this.clearColor=new ao(this),this.clearDepth=new Qi(this),this.clearStencil=new No(this),this.colorMask=new Ht(this),this.depthMask=new dn(this),this.stencilMask=new Ea(this),this.stencilFunc=new zn(this),this.stencilOp=new qi(this),this.stencilTest=new Vo(this),this.depthRange=new so(this),this.depthTest=new Br(this),this.depthFunc=new Xn(this),this.blend=new Nr(this),this.blendFunc=new Uo(this),this.blendColor=new Ca(this),this.blendEquation=new en(this),this.cullFace=new Yn(this),this.cullFaceSide=new jo(this),this.frontFace=new Vr(this),this.program=new lo(this),this.activeTexture=new pr(this),this.viewport=new qt(this),this.bindFramebuffer=new mr(this),this.bindRenderbuffer=new tn(this),this.bindTexture=new Jt(this),this.bindVertexBuffer=new co(this),this.bindElementBuffer=new Y(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new z(this),this.pixelStoreUnpack=new P(this),this.pixelStoreUnpackPremultiplyAlpha=new X(this),this.pixelStoreUnpackFlipY=new J(this),this.extTextureFilterAnisotropic=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=n.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureFilterAnisotropicForceOff=!1,this.extStandardDerivativesForceOff=!1,this.extDebugRendererInfo=n.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=n.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=n.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),o||(this.extTextureHalfFloat=n.getExtension("OES_texture_half_float")),(o||this.extTextureHalfFloat&&n.getExtension("OES_texture_half_float_linear"))&&(this.extRenderToTextureHalfFloat=n.getExtension("EXT_color_buffer_half_float")),this.extStandardDerivatives=o||n.getExtension("OES_standard_derivatives"),this.extTimerQuery=n.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(n,o){return new oo(this,n,o)}createVertexBuffer(n,o,h){return new Fr(this,n,o,h)}createRenderbuffer(n,o,h){const d=this.gl,m=d.createRenderbuffer();return this.bindRenderbuffer.set(m),d.renderbufferStorage(d.RENDERBUFFER,n,o,h),this.bindRenderbuffer.set(null),m}createFramebuffer(n,o,h){return new ge(this,n,o,h)}clear({color:n,depth:o,stencil:h}){const d=this.gl;let m=0;n&&(m|=d.COLOR_BUFFER_BIT,this.clearColor.set(n),this.colorMask.set([!0,!0,!0,!0])),void 0!==o&&(m|=d.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(o),this.depthMask.set(!0)),void 0!==h&&(m|=d.STENCIL_BUFFER_BIT,this.clearStencil.set(h),this.stencilMask.set(255)),d.clear(m)}setCullFace(n){!1===n.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(n.mode),this.frontFace.set(n.frontFace))}setDepthMode(n){n.func!==this.gl.ALWAYS||n.mask?(this.depthTest.set(!0),this.depthFunc.set(n.func),this.depthMask.set(n.mask),this.depthRange.set(n.range)):this.depthTest.set(!1)}setStencilMode(n){n.test.func!==this.gl.ALWAYS||n.mask?(this.stencilTest.set(!0),this.stencilMask.set(n.mask),this.stencilOp.set([n.fail,n.depthFail,n.pass
1]),this.stencilFunc.set({func:n.test.func,ref:n.ref,mask:n.test.mask})):this.stencilTest.set(!1)}setColorMode(n){Ie(n.blendFunction,s.ColorMode.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(n.blendFunction),this.blendColor.set(n.blendColor)),this.colorMask.set(n.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class Ne extends s.Evented{constructor(n,o,h,d){if(super(),this.id=n,this.dispatcher=h,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,s.extend(this,s.pick(o,["url","scheme","tileSize","promoteId"])),this._options=s.extend({type:"vector"},o),this._collectResourceTiming=o.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(d),this._tileWorkers={},this._deduped=new s.DedupedRequest}load(n){this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"}));const o=Array.isArray(this.map._language)?this.map._language.join():this.map._language,h=this.map._worldview;this._tileJSONRequest=Wn(this._options,this.map._requestManager,o,h,(d,m)=>{this._tileJSONRequest=null,this._loaded=!0,d?(o&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${o}`),h&&2!==h.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${h}`),this.fire(new s.ErrorEvent(d))):m&&(s.extend(this,m),m.bounds&&(this.tileBounds=new kn(m.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(m.tiles,this.map._requestManager._customAccessToken),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),n&&n(d)})}loaded(){return this._loaded}hasTile(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)}onAdd(n){this.map=n,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(n){return this._options.tiles=n,this.reload(),this}setUrl(n){return this.url=n,this._options.url=n,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}loadTile(n,o){const h=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme)),d={request:this.map._requestManager.transformRequest(h,s.ResourceType.Tile),data:void 0,uid:n.uid,tileID:n.tileID,tileZoom:n.tileZoom,zoom:n.tileID.overscaledZ,tileSize:this.tileSize*n.tileID.overscaleFactor(),type:this.t
vendor: 1,251 bytes, line 1
1ype,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:n.isSymbolTile};if(d.request.collectResourceTiming=this._collectResourceTiming,n.actor&&"expired"!==n.state)"loading"===n.state?n.reloadCallback=o:n.request=n.actor.send("reloadTile",d,m.bind(this));else if(n.actor=this._tileWorkers[h]=this._tileWorkers[h]||this.dispatcher.getActor(),this.dispatcher.ready)n.request=n.actor.send("loadTile",d,m.bind(this),void 0,!0);else{const y=s.loadVectorTile.call({deduped:this._deduped},d,(v,b)=>{v||!b?m.call(this,v):(d.data={cacheControl:b.cacheControl,expires:b.expires,rawData:b.rawData.slice(0)},n.actor&&n.actor.send("loadTile",d,m.bind(this),void 0,!0))},!0);n.request={cancel:y}}function m(y,v){return delete n.request,n.aborted?o(null):y&&404!==y.status?o(y):(v&&v.resourceTiming&&(n.resourceTiming=v.resourceTiming),this.map._refreshExpiredTiles&&v&&n.setExpiryData(v),n.loadVectorData(v,this.map.painter),s.cacheEntryPossiblyAdded(this.dispatcher),o(null),void(n.reloadCallback&&(this.loadTile(n,n.reloadCallback),n.reloadCallback=null)))}}abortTile(n){n.request&&(n.request.cancel(),delete n.request),n.actor&&n.actor.send("abortTile",{uid:n.uid,type:this.t
1ype,source:this.id})}unloadTile(n){n.unloadVectorData(),n.actor&&n.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Le extends s.Evented{constructor(n,o,h,d){super(),this.id=n,this.dispatcher=h,this.setEventedParent(d),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=s.extend({type:"raster"},o),s.extend(this,s.pick(o,["url","scheme","tileSize"]))}load(n){this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Wn(this._options,this.map._requestManager,null,null,(o,h)=>{this._tileJSONRequest=null,this._loaded=!0,o?this.fire(new s.ErrorEvent(o)):h&&(s.extend(this,h),h.bounds&&(this.tileBounds=new kn(h.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(h.tiles),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),n&&n(o)})}loaded(){return this._loaded}onAdd(n){this.map=n,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(n){return this._options.tiles=n,this.reload(),this}setUrl(n){return this.url=n,this._options.url=n,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}hasTile(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)}loadTile(n,o){const h=s.exported.devicePixelRatio>=2,d=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),h,this.tileSize);n.request=s.getImage(this.map._requestManager.transformRequest(d,s.ResourceType.Tile),(m,y,v,b)=>(delete n.request,n.aborted?(n.state="unloaded",o(null)):m?(n.state="errored",o(m)):y?(this.map._refreshExpiredTiles&&n.setExpiryData({cacheControl:v,expires:b}),n.setTexture(y,this.map.painter),n.state="loaded",s.cacheEntryPossiblyAdded(this.dispatcher),void o(null)):o(null)))}static loadTileData(n,o,h){n.setTexture(o,h)}static unloadTileData(n,o){n.texture&&o.saveTileTexture(n.texture)}abortTile(n,o){n.request&&(n.request.cancel(),delete n.request),o()}unloadTile(n,o){n.texture&&this.map.painter.saveTileTexture(n.texture),o()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function st(l,n,o,h,d,m,y,v){const b=[l,o,d,n,h,m,1,1,1],C=[y,v,1],E=s.adjoint([],b),[I,L,B]=s.transformMat3(C,C,s.transpose(E,E));return s.multiply$1(b,[I,0,0,0,L,0,0,0,B],b)}class mt extends s.Evented{constructor(n,o,h,d){super(),this.id=n,this.dispatcher=h,this.coordinates=o.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(d),this.options=o,this._dirty=!1}load(n,o){this._loaded=o||!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=s.getImage(this.map._requestManager.transformRequest(this.url,s.ResourceType.Image),(h,d)=>{if(this._imageRequest=null,this._loaded=!0,h)this.fire(new s.ErrorEvent(h));else if(d){const{HTMLImageElement:m}=s.window;this.image=d instanceof m?s.exported.getImageData(d):d,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,n&&(this.coordinates=n),this._finishLoading()}})}loaded(){return this._loaded}updateImage(n){return this.image&&n.url?(this._imageRequest&&n.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=n.url,this.load(n.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(n){this.map=n,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(n){this.coordinates=n,this._boundsArray=void 0;const o=n.map(s.MercatorCoordinate.fromLngLat);return this.tileID=function(h){let d=1/0,m=1/0,y=-1/0,v=-1/0;for(const I of h)d=Math.min(d,I.x),m=Math.min(m,I.y),y=Math.max(y,I.x),v=Math.max(v,I.y);const b=Math.max(y-d,v-m),C=Math.max(0,Math.floor(-Math.log(b)/Math.LN2)),E=Math.pow(2,C);return new s.CanonicalTileID(C,Math.floor((d+y)/2*E),Math.floor((m+v)/2*E))}(o),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(n){for(const b in this.tiles){const C=this.tiles[b];"loaded"!==C.state&&(C.state="loaded",C.texture=this.texture)}if(this._boundsArray)return;const o=s.tileTransform(this.tileID,this.map.transform.projection),[h,d,m,y]=this.coordinates.map(b=>{const C=o.projection.project(b[0],b[1]);return s.getTilePoint(o,C)._round()});this.perspectiveTransform=function(b,C,E,I,L,B,V,N,U,D){const F=st(0,0,b,0,0,C,b,C),$=st(E,I,L,B,V,N,U,D);return s.multiply$1($,s.adjoint(F,F),$),[$[6]/$[8]*b/s.EXTENT,$[7]/$[8]*C/s.EXTENT]}(this.width,this.height,h.x,h.y,d.x,d.y,y.x,y.y,m.x,m.y);const v=this._boundsArray=new s.StructArrayLayout4i8;v.emplaceBack(h.x,h.y,0,0),v.emplaceBack(d.x,d.y,s.EXTENT,0),v.emplaceBack(y.x,y.y,0,s.EXTENT),v.emplaceBack(m.x,m.y,s.EXTENT,s.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=n.createVertexBuffer(v,s.boundsAttributes.members),this.boundsSegments=s.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const n=this.map.painter.context,o=n.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new s.Texture(n,this.image,o.RGBA),this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(n)}loadTile(n,o){this.tileID&&this.tileID.equals(n.tileID.canonical)?(this.tiles[String(n.tileID.wrap)]=n,n.buckets={},o(null)):(n.state="errored",o(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const at={vector:Ne,raster:Le,"raster-dem":class extends Le{constructor(l,n,o,h){super(l,n,o,h),this.type="raster-dem",this.maxzoom=22,this._options=s.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}loadTile(l,n){const o=this.map._requestManager.normalizeTileURL(l.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function h(d,m){d&&(l.state="errored",n(d)),m&&(l.dem=m,l.dem.onDeserialize(),l.needsHillshadePrepare=!0,l.needsDEMTextureUpload=!0,l.state="loaded",n(null))}l.request=s.getImage(this.map._requestManager.transformRequest(o,s.ResourceType.Tile),function(d,m,y,v){if(delete l.request,l.aborted)l.state="unloaded",n(null);else if(d)l.state="errored",n(d);
vendor: 9,946 bytes, line 1
1else if(m){this.map._refreshExpiredTiles&&l.setExpiryData({cacheControl:y,expires:v});const b=s.window.ImageBitmap&&m instanceof s.window.ImageBitmap&&(null==Ur&&(Ur=s.window.OffscreenCanvas&&new s.window.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof s.window.createImageBitmap),Ur),C=1-(m.width-s.prevPowerOfTwo(m.width))/2;C<1||l.neighboringTiles||(l.neighboringTiles=this._getNeighboringTiles(l.tileID));const E=b?m:s.exported.getImageData(m,C),I={uid:l.uid,coord:l.tileID,source:this.id,rawImageData:E,encoding:this.encoding,padding:C};l.actor&&"expired"!==l.state||(l.actor=this.dispatcher.getActor(),l.actor.send("loadDEMTile",I,h.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(l){const n=l.canonical,o=Math.pow(2,n.z),h=(n.x-1+o)%o,d=0===n.x?l.wrap-1:l.wrap,m=(n.x+1+o)%o,y=n.x+1===o?l.wrap+1:l.wrap,v={};return v[new s.OverscaledTileID(l.overscaledZ,d,n.z,h,n.y).key]={backfilled:!1},v[new s.OverscaledTileID(l.overscaledZ,y,n.z,m,n.y).key]={backfilled:!1},n.y>0&&(v[new s.OverscaledTileID(l.overscaledZ,d,n.z,h,n.y-1).key]={backfilled:!1},v[new s.OverscaledTileID(l.overscaledZ,l.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},v[new s.OverscaledTileID(l.overscaledZ,y,n.z,m,n.y-1).key]={backfilled:!1}),n.y+1<o&&(v[new s.OverscaledTileID(l.overscaledZ,d,n.z,h,n.y+1).key]={backfilled:!1},v[new s.OverscaledTileID(l.overscaledZ,l.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},v[new s.OverscaledTileID(l.overscaledZ,y,n.z,m,n.y+1).key]={backfilled:!1}),v}unloadTile(l){l.demTexture&&this.map.painter.saveTileTexture(l.demTexture),l.fbo&&(l.fbo.destroy(),delete l.fbo),l.dem&&delete l.dem,delete l.neighboringTiles,l.state="unloaded"}},geojson:class extends s.Evented{constructor(l,n,o,h){super(),this.id=l,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=o.getActor(),this.setEventedParent(h),this._data=n.data,this._options=s.extend({},n),this._collectResourceTiming=n.collectResourceTiming,void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;const d=s.EXTENT/this.tileSize;this.workerOptions=s.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*d,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*d,extent:s.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?n.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:s.EXTENT,radius:(void 0!==n.clusterRadius?n.clusterRadius:50)*d,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions)}onAdd(l){this.map=l,this.setData(this._data)}setData(l){return this._data=l,this._updateWorkerData(),this}getClusterExpansionZoom(l,n){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:l,source:this.id},n),this}getClusterChildren(l,n){return this.actor.send("geojson.getClusterChildren",{clusterId:l,source:this.id},n),this}getClusterLeaves(l,n,o,h){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:l,limit:n,offset:o},h),this}_updateWorkerData(){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new s.Event("dataloading",{dataType:"source"})),this._loaded=!1;const l=s.extend({},this.workerOptions),n=this._data;"string"==typeof n?(l.request=this.map._requestManager.transformRequest(s.exported.resolveURL(n),s.ResourceType.Source),l.request.collectResourceTiming=this._collectResourceTiming):l.data=JSON.stringify(n),this._pendingLoad=this.actor.send(`${this.type}.loadData`,l,(o,h)=>{if(this._loaded=!0,this._pendingLoad=null,o)this.fire(new s.ErrorEvent(o));else{const d={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&h&&h.resourceTiming&&h.resourceTiming[this.id]&&(d.resourceTiming=h.resourceTiming[this.id]),this.fire(new s.Event("data",d)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(l,n){const o=l.actor?"reloadTile":"loadTile";l.actor=this.actor,l.request=this.actor.send(o,{type:this.type,uid:l.uid,tileID:l.tileID,tileZoom:l.tileZoom,zoom:l.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(h,d)=>(delete l.request,l.unloadVectorData(),l.aborted?n(null):h?n(h):(l.loadVectorData(d,this.map.painter,"reloadTile"===o),n(null))),void 0,"loadTile"===o)}abortTile(l){l.request&&(l.request.cancel(),delete l.request),l.aborted=!0}unloadTile(l){l.unloadVectorData(),this.actor.send("removeTile",{uid:l.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return s.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends mt{constructor(l,n,o,h){super(l,n,o,h),this.roundZoom=!0,this.type="video",this.options=n}load(){this._loaded=!1;const l=this.options;this.urls=[];for(const n of l.urls)this.urls.push(this.map._requestManager.transformRequest(n,s.ResourceType.Source).url);s.getVideo(this.urls,(n,o)=>{this._loaded=!0,n?this.fire(new s.ErrorEvent(n)):o&&(this.video=o,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(l){if(this.video){const n=this.video.seekable;l<n.start(0)||l>n.end(0)?this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=l}}getVideo(){return this.video}onAdd(l){this.map||(this.map=l,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const l=this.map.painter.context,n=l.gl;this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new s.Texture(l,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(l)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:mt,canvas:class extends mt{constructor(l,n,o,h){super(l,n,o,h),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some(d=>!Array.isArray(d)||2!==d.length||d.some(m=>"number"!=typeof m))||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${l}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${l}`,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${l}`,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof s.window.HTMLCanvasElement||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${l}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${l}`,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof s.window.HTMLCanvasElement?this.options.canvas:s.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new s.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(l){this.map=l,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let l=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,l=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,l=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;const n=this.map.painter.context;this.texture?(l||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new s.Texture(n,this.canvas,n.gl.RGBA,{premultiply:!0}),this._prepareData(n)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const l of[this.canvas.width,this.canvas.height])if(isNaN(l)||l<=0)return!0;return!1}},custom:class extends s.Evented{constructor(l,n,o,h){super(),this.id=l,this.type="custom",this._dataType="raster",this._dispatcher=o,this._implementation=n,this.setEventedParent(h),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new s.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new s.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new kn(this._implementation.bounds,this.minzoom,this.maxzoom)),n.update=this._update.bind(this),n.clearTiles=this._clearTiles.bind(this),n.coveringTiles=this._coveringTiles.bind(this),s.extend(this,s.pick(n,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileC
1acheSize"]))}serialize(){return s.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(l){this._map=l,this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(l),this.load()}onRemove(l){this._implementation.onRemove&&this._implementation.onRemove(l)}hasTile(l){if(this._implementation.hasTile){const{x:n,y:o,z:h}=l.canonical;return this._implementation.hasTile({x:n,y:o,z:h})}return!this.tileBounds||this.tileBounds.contains(l.canonical)}loadTile(l,n){const{x:o,y:h,z:d}=l.tileID.canonical,m=new s.window.AbortController;l.request=Promise.resolve(this._implementation.loadTile({x:o,y:h,z:d},{signal:m.signal})).then(function(y){return delete l.request,l.aborted?(l.state="unloaded",n(null)):void 0===y?(l.state="errored",n(null)):null===y?(this.loadTileData(l,{width:this.tileSize,height:this.tileSize,data:null}),l.state="loaded",n(null)):(v=y)instanceof s.window.ImageData||v instanceof s.window.HTMLCanvasElement||v instanceof s.window.ImageBitmap||v instanceof s.window.HTMLImageElement?(this.loadTileData(l,y),l.state="loaded",void n(null)):(l.state="errored",n(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)));var v}.bind(this)).catch(y=>{20!==y.code&&(l.state="errored",n(y))}),l.request.cancel=()=>m.abort()}loadTileData(l,n){Le.loadTileData(l,n,this._map.painter)}unloadTileData(l){Le.unloadTileData(l,this._map.painter)}unloadTile(l,n){if(this.unloadTileData(l),this._implementation.unloadTile){const{x:o,y:h,z:d}=l.tileID.canonical;this._implementation.unloadTile({x:o,y:h,z:d})}n()}abortTile(l,n){l.request&&l.request.cancel&&(l.request.cancel(),delete l.request),n()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(l=>({x:l.canonical.x,y:l.canonical.y,z:l.canonical.z}))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}}},ft=function(l,n,o,h){const d=new at[n.type](l,n,o,h);if(d.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${d.id}`);return s.bindAll(["load","abort","unload","serialize","prepare"],d),d};function Et(l,n){const o=s.identity([]);return s.scale(o,o,[.5*l.width,.5*-l.height,1]),s.translate(o,o,[1,-1,0]),s.multiply(o,o,l.calculateProjMatrix(n.toUnwrapped())),Float32Array.from(o)}function Wt(l,n,o,h,d,m,y,v=!1){const b=l.tilesIn(h,y,v);b.sort(Si);const C=[];for(const I of b)C.push({wrappedTileID:I.tile.tileID.wrapped().key,queryResults:I.tile.queryRenderedFeatures(n,o,l._state,I,d,m,Et(l.transform,I.tile.tileID),v)});const E=function(I){const L={},B={};for(const V of I){const N=V.queryResults,U=V.wrappedTileID,D=B[U]=B[U]||{};for(const F in N){const $=N[F],W=D[F]=D[F]||{},te=L[F]=L[F]||[];for(const ne of $)W[ne.featureIndex]||(W[ne.featureIndex]=!0,te.push(ne))}}return L}(C);for(const I in E)E[I].forEach(L=>{const B=L.feature,V=B.layer;V&&"background"!==V.type&&"sky"!==V.type&&(B.source=V.source,V["source-layer"]&&(B.sourceLayer=V["source-layer"]),B.state=void 0!==B.id?l.getFeatureState(V["source-layer"],B.id):{})});return E}function ri(l,n){const o=l.getRenderableIds().map(m=>l.getTileByID(m)),h=[],d={};for(let m=0;m<o.length;m++){const y=o[m],v=y.tileID.canonical.key;d[v]||(d[v]=!0,y.querySourceFeatures(h,n))}return h}function Si(l,n){const o=l.tileID,h=n.tileID;return o.overscaledZ-h.overscaledZ||o.canonical.y-h.canonical.y||o.wrap-h.wrap||o.canonical.x-h.canonical.x}function ci(){return null!=ua.workerClass?new ua.workerClass:new s.window.Worker(ua.workerUrl)}const _n="mapboxgl_preloaded_worker_pool";class wi{constructor(){this.active={}}acquire(n){if(!this.workers)for(this.workers=[];this.workers.length<wi.workerCount;)this.workers.push(new ci);return this.active[n]=!0,this.workers.slice()}release(n){delete this.active[n],0===this.numActive()&&(this.workers.forEac
vendor: 4,087 bytes, line 1
1h(o=>{o.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[_n]}numActive(){return Object.keys(this.active).length}}let Li;function ho(){return Li||(Li=new wi),Li}function bl(l,n){const o={};for(const h in l)"ref"!==h&&(o[h]=l[h]);return s.refProperties.forEach(h=>{h in n&&(o[h]=n[h])}),o}function wl(l){l=l.slice();const n=Object.create(null);for(let o=0;o<l.length;o++)n[l[o].id]=l[o];for(let o=0;o<l.length;o++)"ref"in l[o]&&(l[o]=bl(l[o],n[l[o].ref]));return l}wi.workerCount=2;const At={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setProjection:"setProjection"};function Go(l,n,o){o.push({command:At.addSource,args:[l,n[l]]})}function Zo(l,n,o){n.push({command:At.removeSource,args:[l]}),o[l]=!0}function cs(l,n,o,h){Zo(l,o,h),Go(l,n,o)}function $o(l,n,o){let h;for(h in l[o])if(l[o].hasOwnProperty(h)&&"data"!==h&&!Ie(l[o][h],n[o][h]))return!1;for(h in n[o])if(n[o].hasOwnProperty(h)&&"data"!==h&&!Ie(l[o][h],n[o][h]))return!1;return!0}function yn(l,n,o,h,d,m){let y;for(y in n=n||{},l=l||{})l.hasOwnProperty(y)&&(Ie(l[y],n[y])||o.push({command:m,args:[h,y,n[y],d]}));for(y in n)n.hasOwnProperty(y)&&!l.hasOwnProperty(y)&&(Ie(l[y],n[y])||o.push({command:m,args:[h,y,n[y],d]}))}function Hn(l){return l.id}function hs(l,n){return l[n.id]=n,l}class us{constructor(n,o){this.reset(n,o)}reset(n,o){this.points=n||[],this._distances=[0];for(let h=1;h<this.points.length;h++)this._distances[h]=this._distances[h-1]+this.points[h].dist(this.points[h-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(o||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(n){if(1===this.points.length)return this.points[0];n=s.clamp(n,0,1);let o=1,h=this._distances[o];const d=n*this.paddedLength+this.padding;for(;h<d&&o<this._distances.length;)h=this._distances[++o];const m=o-1,y=this._distances[m],v=h-y,b=v>0?(d-y)/v:0;return this.points[m].mult(1-b).add(this.points[o].mult(b))}}class jr{constructor(n,o,h){const d=this.boxCells=[],m=this.circleCells=[];this.xCellCount=Math.ceil(n/h),this.yCellCount=Math.ceil(o/h);for(let y=0;y<this.xCellCount*this.yCellCount;y++)d.push([]),m.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=n,this.height=o,this.xScale=this.xCellCount/n,this.yScale=this.yCellCount/o,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(n,o,h,d,m){this._forEachCell(o,h,d,m,this._insertBoxCell,this.boxUid++),this.boxKeys.push(n),this.bboxes.push(o),this.bboxes.push(h),this.bboxes.push(d),this.bboxes.push(m)}insertCircle(n,o,h,d){this._forEachCell(o-d,h-d,o+d,h+d,this._insertCircleCell,this.circleUid++),this.circleKeys.push(n),this.circles.push(o),this.circles.push(h),this.circles.push(d)}_insertBoxCell(n,o,h,d,m,y){this.boxCells[m].push(y)}_insertCircleCell(n,o,h,d,m,y){this.circleCells[m].push(y)}_query(n,o,h,d,m,y){if(h<0||n>this.width||d<0||o>this.height)return!m&&[];const v=[];if(n<=0&&o<=0&&this.width<=h&&this.height<=d){if(m)return!0;for(let b=0;b<this.boxKeys.length;b++)v.push({key:this.boxKeys[b],x1:this.bboxes[4*b],y1:this.bboxes[4*b+1],x2:this.bboxes[4*b+2],y2:this.bboxes[4*b+3]});for(let b=0;b<this.circleKeys.length;b++){const C=this.circles[3*b],E=this.circles[3*b+1],I=this.circles[3*b+2];v.push({key:this.circleKeys[b],x1:C-I,y1:E-I,x2:C+I,y2:E+I})}return y?v.filter(y):v}return this._forEachCell(n,o,h,d,this._queryCell,v,{hitTest:m,seenUids:{box:{},circle:{}}},y),m?v.length>0:v}_queryCircle(n,o,h,d,m){const y=n-h,v=n+h,b=o-h,C=o+h;if(v<0||y>this.width||C<0||b>this.height)return!d&&[];const E=[];
1return this._forEachCell(y,b,v,C,this._queryCellCircle,E,{hitTest:d,circle:{x:n,y:o,radius:h},seenUids:{box:{},circle:{}}},m),d?E.length>0:E}query(n,o,h,d,m){return this._query(n,o,h,d,!1,m)}hitTest(n,o,h,d,m){return this._query(n,o,h,d,!0,m)}hitTestCircle(n,o,h,d){return this._queryCircle(n,o,h,!0,d)}_queryCell(n,o,h,d,m,y,v,b){const C=v.seenUids,E=this.boxCells[m];if(null!==E){const L=this.bboxes;for(const B of E)if(!C.box[B]){C.box[B]=!0;const V=4*B;if(n<=L[V+2]&&o<=L[V+3]&&h>=L[V+0]&&d>=L[V+1]&&(!b||b(this.boxKeys[B]))){if(v.hitTest)return y.push(!0),!0;y.push({key:this.boxKeys[B],x1:L[V],y1:L[V+1],x2:L[V+2],y2:L[V+3]})}}}const I=this.circleCells[m];if(null!==I){const L=this.circles;for(const B of I)if(!C.circle[B]){C.circle[B]=!0;const V=3*B;if(this._circleAndRectCollide(L[V],L[V+1],L[V+2],n,o,h,d)&&(!b||b(this.circleKeys[B]))){if(v.hitTest)return y.push(!0),!0;{const N=L[V],U=L[V+1],D=L[V+2];y.push({key:this.circleKeys[B],x1:N-D,y1:U-D,x2:N+D,y2:U+D})}}}}}_queryCellCircle(n,o,h,d,m,y,v,b){const C=v.circle,E=v.seenUids,I=this.boxCells[m];if(null!==I){const B=this.bboxes;for(const V of I)if(!E.box[V]){E.box[V]=!0;const N=4*V;if(this._circleAndRectCollide(C.x,C.y,C.radius,B[N+0],B[N+1],B[N+2],B[N+3])&&(!b||b(this.boxKeys[V])))return y.push(!0),!0}}const L=this.circleCells[m];if(null!==L){const B=this.circles;for(const V of L)if(!E.circle[V]){E.circle[V]=!0;const N=3*V;if(this._circlesCollide(B[N],B[N+1],B[N+2],C.x,C.y,C.radius)&&(!b||b(this.circleKeys[V])))return y.push(!0),!0}}}_forEachCell(n,o,h,d,m,y,v,b){const C=this._convertToXCellCoord(n),E=this._convertToYCellCoord(o),I=this._convertToXCellCoord(h),L=this._convertToYCellCoord(d);for(let B=C;B<=I;B++)for(let V=E;V<=L;V++)if(m.call(this,n,o,h,d,this.xCellCount*V+B,y,v,b))return}_convertToXCellCoord(n){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(n*this.xScale)))}_convertToYCellCoord(n){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(n*this.yScale)))}_circlesCollide(n,o,h,d,m,y){const v=d-n,b=m-o,C=h+y;return C*C>v*v+b*b}_circleAndRectCollide(n,o,h,d,m,y,v){const b=(y-d)/2,C=Math.abs(n-(d+b));if(C>b+h)return!1;const E=(v-m)/2,I=Math.abs(o-(m+E));if(I>E+h)return!1;if(C<=b||I<=E)return!0;const L=C-b,B=I-E;return L*L+B*B<=h*h}}const Kn_unknown=0,Kn_flipRequired=1,Kn_flipNotRequired=2,qo=Math.tan(85*Math.PI/180);function be(l,n,o,h,d,m,y){const v=s.create();if(o)if("globe"===m.name){const b=s.calculateGlobeLabelMatrix(d,n);s.multiply(v,v,b)}else{const b=Ve([],y);v[0]=b[0],v[1]=b[1],v[4]=b[2],v[5]=b[3],h||s.rotateZ(v,v,d.angle)}else s.multiply(v,d.labelPlaneMatrix,l);return v}function Pn(l,n,o,h,d,m,y){const v=be(l,n,o,h,d,m,y);return"globe"===m.name&&o||(v[2]=v[6]=v[10]=v[14]=0),v}function oi(l,n,o,h,d,m,y){if(o){if("globe"===m.name){const v=be(l,n,o,h,d,m,y);return s.invert(v,v),s.multiply(v,l,v),v}{const v=s.clone(l),b=s.identity([]);return b[0]=y[0],b[1]=y[1],b[4]=y[2],b[5]=y[3],s.multiply(v,v,b),h||s.rotateZ(v,v,-d.angle),v}}return d.glCoordMatrix}function Mi(l,n,o,h){const d=[l,n,o,1];o?s.transformMat4$1(d,d,h):_t(d,d,h);const m=d[3];return d[0]/=m,d[1]/=m,d[2]/=m,d}function Ml(l,n){return Math.min(.5+l/n*.5,1.5)}function Ln(l,n){const o=l[0]/l[3],h=l[1]/l[3];return o>=-n[0]&&o<=n[0]&&h>=-n[1]&&h<=n[1]}function ds(l,n,o,h,d,m,y,v,b,C){const E=o.transform,I=h?l.textSizeData:l.iconSizeData,L=s.evaluateSizeForZoom(I,o.transform.zoom),B="globe"===E.projection.name,V=[256/o.width*2+1,256/o.height*2+1],N=h?l.text.dynamicLayoutVertexArray:l.icon.dynamicLayoutVertexArray;N.clear();let U=null;B&&(U=h?l.text.globeExtVertexArray:l.icon.globeExtVertexArray);const D=l.lineVertexArray,F=h?l.text.placedSymbolArray:l.icon.placedSymbolArray,$=o.transform.width/o.transform.height;let W,te=!1;for(let ne=0;ne<F.length;ne++){const ie=F.get(ne),{numGlyphs:se,writingMode:ae}=ie;if(ae!==s.WritingMode.vertical||te||W===s.WritingMode.horizontal||(te=!0),W=ae,(ie.hidden||ae===s.WritingMode.vertical)&&!te){vn(se,N);continue}te=!1;const me=new s.Point(ie.tileAnchorX,ie.tileAnchorY);let{x:ke,y:he,z:Ee}=E.projection.projectTilePoint(me.x,me.y,C.canonical);if(b){const[ot,We,et]=b(me);ke+=ot,he+=We,Ee+=et}const _e=[ke,he,Ee,1];if(s.transformMat4$1(_e,_e,n),!Ln(_e,V)){vn(se,N);continue}const De=Ml(o.transform.cameraToCenterDistance,_e[3]),pe=s.evaluateSizeForFeature
1(I,L,ie),Me=y?pe/De:pe*De,Pe=Mi(ke,he,Ee,d);if(Pe[3]<=0){vn(se,N);continue}let Se={};const Re=y?null:b,Ke=je(ie,Me,!1,v,n,d,m,l.glyphOffsetArray,D,N,U,Pe,me,Se,$,Re,E.projection,C,y);te=Ke.useVertical,Re&&Ke.needsFlipping&&(Se={}),(Ke.notEnoughRoom||te||Ke.needsFlipping&&je(ie,Me,!0,v,n,d,m,l.glyphOffsetArray,D,N,U,Pe,me,Se,$,Re,E.projection,C,y).notEnoughRoom)&&vn(se,N)}h?(l.text.dynamicLayoutVertexBuffer.updateData(N),U&&l.text.globeExtVertexBuffer.updateData(U)):(l.icon.dynamicLayoutVertexBuffer.updateData(N),U&&l.icon.globeExtVertexBuffer.updateData(U))}function El(l,n,o,h,d,m,y,v,b,C,E,I,L,B,V,N){const{lineStartIndex:U,glyphStartIndex:D,segment:F}=v,$=D+v.numGlyphs,W=U+v.lineLength,te=n.getoffsetX(D),ne=n.getoffsetX($-1),ie=Wi(l*te,o,h,d,m,y,F,U,W,b,C,E,I,L,!0,B,V,N);if(!ie)return null;const se=Wi(l*ne,o,h,d,m,y,F,U,W,b,C,E,I,L,!0,B,V,N);return se?{first:ie,last:se}:null}function uo(l,n,o,h){return l===s.WritingMode.horizontal&&Math.abs(h)>Math.abs(o)?{useVertical:!0}:l===s.WritingMode.vertical?h>0?{needsFlipping:!0}:null:n!==Kn_unknown&&(0===(d=o)||Math.abs(h/d)>qo)?n===Kn_flipRequired?{needsFlipping:!0}:null:o<0?{needsFlipping:!0}:null;var d}function je(l,n,o,h,d,m,y,v,b,C,E,I,L,B,V,N,U,D,F){const $=n/24,W=l.lineOffsetX*$,te=l.lineOffsetY*$,{lineStartIndex:ne,glyphStartIndex:ie,numGlyphs:se,segment:ae,writingMode:me,flipState:ke}=l,he=ne+l.lineLength,Ee=_e=>{if(E){const[Pe,Se,Re]=_e.up,Ke=C.length;s.updateGlobeVertexNormal(E,Ke+0,Pe,Se,Re),s.updateGlobeVertexNormal(E,Ke+1,Pe,Se,Re),s.updateGlobeVertexNormal(E,Ke+2,Pe,Se,Re),s.updateGlobeVertexNormal(E,Ke+3,Pe,Se,Re)}const[De,pe,Me]=_e.point;s.addDynamicAttributes(C,De,pe,Me,_e.angle)};if(se>1){const _e=El($,v,W,te,o,I,L,l,b,m,B,N,!1,U,D,F);if(!_e)return{notEnoughRoom:!0};if(h&&!o){let[De,pe,Me]=_e.first.point,[Pe,Se,Re]=_e.last.point;[De,pe]=Mi(De,pe,Me,y),[Pe,Se]=Mi(Pe,Se,Re,y);const Ke=uo(me,ke,(Pe-De)*V,Se-pe);if(l.flipState=Ke&&Ke.needsFlipping?Kn_flipRequired:Kn_flipNotRequired,Ke)return Ke}Ee(_e.first);for(let De=ie+1;De<ie+se-1;De++){const pe=Wi($*v.getoffsetX(De),W,te,o,I,L,ae,ne,he,b,m,B,N,!1,!1,U,D,F);if(!pe)return C.length-=4*(De-ie),{notEnoughRoom:!0};Ee(pe)}Ee(_e.last)}else{if(h&&!o){const De=Mi(L.x,L.y,0,d),pe=ne+ae+1,Me=new s.Point(b.getx(pe),b.gety(pe)),Pe=Mi(Me.x,Me.y,0,d),Se=Pe[3]>0?Pe:gt(L,Me,De,1,d,void 0,U,D.canonical),Re=uo(me,ke,(Se[0]-De[0])*V,Se[1]-De[1]);if(l.flipState=Re&&Re.needsFlipping?Kn_flipRequired:Kn_flipNotRequired,Re)return Re}const _e=Wi($*v.getoffsetX(ie),W,te,o,I,L,ae,ne,he,b,m,B,N,!1,!1,U,D,F);if(!_e)return{notEnoughRoom:!0};Ee(_e)}return{}}function xt(l,n,o,h,d){const{x:m,y,z:v}=h.projectTilePoint(l.x,l.y,n);if(!d)return Mi(m,y,v,o);const[b,C,E]=d(l);return Mi(m+b,y+C,v+E,o)}function gt(l,n,o,h,d,m,y,v){const b=xt(l.sub(n)._unit()._add(l),v,d,y,m);return s.sub(b,o,b),s.normalize(b,b),s.scaleAndAdd(b,o,b,h)}function Wi(l,n,o,h,d,m,y,v,b,C,E,I,L,B,V,N,U,D){const F=h?l-n:l+n;let $=F>0?1:-1,W=0;h&&($*=-1,W=Math.PI),$<0&&(W+=Math.PI);let te=v+y+($>0?0:1)|0,ne=d,ie=d,se=0,ae=0;const me=Math.abs(F),ke=[],he=[];let Ee=m,_e=Ee;const De=()=>gt(_e,Ee,ie,me-se+1,E,L,N,U.canonical);for(;se+ae<=me;){if(te+=$,te<v||te>=b)return null;if(ie=ne,_e=Ee,ke.push(ie),B&&he.push(_e),Ee=new s.Point(C.getx(te),C.gety(te)),ne=I[te],!ne){const et=xt(Ee,U.canonical,E,N,L);ne=et[3]>0?I[te]=et:De()}se+=ae,ae=s.distance(ie,ne)}V&&L&&(I[te]&&(ne=De(),ae=s.distance(ie,ne)),I[te]=ne);const pe=(me-se)/ae,Me=Ee.sub(_e)._mult(pe)._add(_e),Pe=s.sub([],ne,ie),Se=s.scaleAndAdd([],ie,Pe,pe);let Re=[0,0,1],Ke=Pe[0],ot=Pe[1];if(D&&(Re=N.upVector(U.canonical,Me.x,Me.y),0!==Re[0]||0!==Re[1]||1!==Re[2])){const et=[Re[2],0,-Re[0]],bt=s.cross([],Re,et);s.normalize(et,et),s.normalize(bt,bt),Ke=s.dot(Pe,et),ot=s.dot(Pe,bt)}if(o){const et=s.cross([],Re,Pe);s.normalize(et,et),s.scaleAndAdd(Se,Se,et,o*$)}const We=W+Math.atan2(ot,Ke);return ke.push(Se),B&&he.push(Me),{point:Se,angle:We,path:ke,tilePath:he,up:Re}}function vn(l,n){const o=n.length,h=o+4*l;n.resize(h),n.float32.fill(-1/0,4*o,4*h)}function _t(l,n,o){const h=n[0],d=n[1];return l[0]=o[0]*h+o[4]*d+o[12],l[1]=o[1]*h+o[5]*d+o[13],l[3]=o[3]*h+o[7]*d+o[15],l}const Xi=100;class po{constructor(n,o,h=new jr(n.width+200,n.height+200,25),d=new jr(n.width+200,n.height+200,25)){this.transform=n,this.grid=h,this.ignoredGrid=d,this.pitchfactor=Math.cos(n._pitch)*n.cameraToCenterDistance,this.screenRightBoundary=n.width+Xi,this.screenBottomBoundary=n.height+Xi,this.gridRightBoundary=n.width+200,this.gridBottomBoundary=n.height+200,this.fogState=o}placeCollisionBox(n,o,h,d,m,y,v,b){let C=h.projectedAnchorX,E=h.projectedAnchorY,I=h.projectedAnchorZ;const L=h.elevation,B=h.tileID,V=n.getProjection();if(L&&B){const[ne,ie,se]=V.upVector(B.canonical,h.tileAnchorX,h.tileAnchorY),ae=V.upVectorScale(B.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;C+=ne*L*ae,E+=ie*L*ae,I+=se*L*ae}const N=this.projectAndGetPerspectiveRatio(v,C,E,I,h.tileID,"globe"===V.name||!!L||this.transform.pitch>0,V),U=y*N.perspectiveRatio,D=(h.x1*o+d.x-h.padding)*U+N.point.x,F=(h.y1*o+d.y-h.padding)*U+N.point.y,$=(h.x2*o+d.x+h.padding)*U+N.point.x,W=(h.y2*o+d.y+h.padding)*U+N.point.y,te=N.perspectiveRatio<=.55||N.occluded;return!this.isInsideGrid(D,F,$,W)||!m&&this.grid.hitTest(D,F,$,W,b)||te?{box:[],offscreen:!1,occluded:N.occluded}:{box:[D,F,$,W],offscreen:this.isOffscreen(D,F,$,W),occluded:!1}}placeCollisionCircles(n,o,h,d,m,y,v,b,C,E,I,L,B,V,N){const U=[],D=this.transform.elevation,F=n.getProjection(),$=D?D.getAtTileOffsetFunc(N,this.transform.center.lat,this.transform.worldSize,F):null,W=new s.Point(h.tileAnchorX,h.tileAnchorY);let{x:te,y:ne,z:ie}=F.projectTilePoint(W.x,W.y,N.canonical);if($){const[Me,Pe,Se]=$(W);te+=Me,ne+=Pe,ie+=Se}const se="globe"===F.name,ae=this.projectAndGetPerspectiveRatio(v,te,ne,ie,N,se||!!D||this.transform.pitch>0,F),{perspectiveRatio:me}=ae,ke=(I?y/me:y*me)/s.ONE_EM,he=Mi(te,ne,ie,b),Ee=ae.signedDistanceFromCamera>0?El(ke,m,h.lineOffsetX*ke,h.lineOffsetY*ke,!1,he,W,h,d,b,{},D&&!I?$:null,I&&!!D,F,N,I):null;let _e=!1,De=!1,pe=!0;if(Ee&&!ae.occluded){const Me=.5*B*me+V,Pe=new s.Point(-100,-100),Se=new s.Point(this.screenRightBoundary,this.screenBottomBoundary),Re=new us,{first:Ke,last:ot}=Ee,We=Ke.path.length;let et=[];for(let Ye=We-1;Ye>=1;Ye--)et.push(Ke.path[Ye]);for(let Ye=1;Ye<ot.path.length;Ye++)et.push(ot.path[Ye]);const bt=2.5*Me;C&&(et=et.map(([Ye,zt,Pt],Lt)=>($&&!se&&(Pt=$(Lt<We-1?Ke.tilePath[We-1-Lt]:ot.tilePath[Lt-We+2])[2]),Mi(Ye,zt,Pt,C)
vendor: 5,164 bytes, line 1
1)),et.some(Ye=>Ye[3]<=0)&&(et=[]));let yt=[];if(et.length>0){let Ye=1/0,zt=-1/0,Pt=1/0,Lt=-1/0;for(const Rt of et)Ye=Math.min(Ye,Rt[0]),Pt=Math.min(Pt,Rt[1]),zt=Math.max(zt,Rt[0]),Lt=Math.max(Lt,Rt[1]);zt>=Pe.x&&Ye<=Se.x&&Lt>=Pe.y&&Pt<=Se.y&&(yt=[et.map(Rt=>new s.Point(Rt[0],Rt[1]))],(Ye<Pe.x||zt>Se.x||Pt<Pe.y||Lt>Se.y)&&(yt=s.clipLine(yt,Pe.x,Pe.y,Se.x,Se.y)))}for(const Ye of yt){Re.reset(Ye,.25*Me);let zt=0;zt=Re.length<=.5*Me?1:Math.ceil(Re.paddedLength/bt)+1;for(let Pt=0;Pt<zt;Pt++){const Lt=Pt/Math.max(zt-1,1),Rt=Re.lerp(Lt),Ui=Rt.x+Xi,ki=Rt.y+Xi;U.push(Ui,ki,Me,0);const Mn=Ui-Me,or=ki-Me,Kt=Ui+Me,Ot=ki+Me;if(pe=pe&&this.isOffscreen(Mn,or,Kt,Ot),De=De||this.isInsideGrid(Mn,or,Kt,Ot),!o&&this.grid.hitTestCircle(Ui,ki,Me,L)&&(_e=!0,!E))return{circles:[],offscreen:!1,collisionDetected:_e,occluded:!1}}}}return{circles:!E&&_e||!De?[]:U,offscreen:pe,collisionDetected:_e,occluded:ae.occluded}}queryRenderedSymbols(n){if(0===n.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const o=[];let h=1/0,d=1/0,m=-1/0,y=-1/0;for(const E of n){const I=new s.Point(E.x+Xi,E.y+Xi);h=Math.min(h,I.x),d=Math.min(d,I.y),m=Math.max(m,I.x),y=Math.max(y,I.y),o.push(I)}const v=this.grid.query(h,d,m,y).concat(this.ignoredGrid.query(h,d,m,y)),b={},C={};for(const E of v){const I=E.key;if(void 0===b[I.bucketInstanceId]&&(b[I.bucketInstanceId]={}),b[I.bucketInstanceId][I.featureIndex])continue;const L=[new s.Point(E.x1,E.y1),new s.Point(E.x2,E.y1),new s.Point(E.x2,E.y2),new s.Point(E.x1,E.y2)];s.polygonIntersectsPolygon(o,L)&&(b[I.bucketInstanceId][I.featureIndex]=!0,void 0===C[I.bucketInstanceId]&&(C[I.bucketInstanceId]=[]),C[I.bucketInstanceId].push(I.featureIndex))}return C}insertCollisionBox(n,o,h,d,m){(o?this.ignoredGrid:this.grid).insert({bucketInstanceId:h,featureIndex:d,collisionGroupID:m},n[0],n[1],n[2],n[3])}insertCollisionCircles(n,o,h,d,m){const y=o?this.ignoredGrid:this.grid,v={bucketInstanceId:h,featureIndex:d,collisionGroupID:m};for(let b=0;b<n.length;b+=4)y.insertCircle(v,n[b],n[b+1],n[b+2])}projectAndGetPerspectiveRatio(n,o,h,d,m,y,v){const b=[o,h,d,1];let C=!1;d||this.transform.pitch>0?(s.transformMat4$1(b,b,n),this.fogState&&m&&"globe"!==v.name&&(C=function(L,B,V,N,U,D){const F=D.calculateFogTileMatrix(U),$=[B,V,N];return s.transformMat4($,$,F),Ti(L,$,D.pitch,D._fov)}(this.fogState,o,h,d,m.toUnwrapped(),this.transform)>.9)):_t(b,b,n);const E=b[3];return{point:new s.Point((b[0]/E+1)/2*this.transform.width+Xi,(-b[1]/E+1)/2*this.transform.height+Xi),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(v)/E*.5,1.5),signedDistanceFromCamera:E,occluded:y&&b[2]>E||C}}isOffscreen(n,o,h,d){return h<Xi||n>=this.screenRightBoundary||d<Xi||o>this.screenBottomBoundary}isInsideGrid(n,o,h,d){return h>=0&&n<this.gridRightBoundary&&d>=0&&o<this.gridBottomBoundary}getViewportMatrix(){const n=s.identity([]);return s.translate(n,n,[-100,-100,0]),n}}function Gr(l,n,o){const h=n.createTileMatrix(l,l.worldSize,o.toUnwrapped());return s.multiply(new Float32Array(16),l.projMatrix,h)}function nn(l,n,o){if(n.projection.name===o.projection.name)return l.projMatrix;const h=o.clone();return h.setProjection(n.projection),Gr(h,n.getProjection(),l)}function Xt(l,n,o){return n.name===o.projection.name?l.projMatrix:Gr(o,n,l)}class Cl{constructor(n,o,h,d){this.opacity=n?Math.max(0,Math.min(1,n.opacity+(n.placed?o:-o))):d&&h?1:0,this.placed=h}isHidden(){return 0===this.opacity&&!this.placed}}class Jn{constructor(n,o,h,d,m,y=!1){this.text=new Cl(n?n.text:null,o,h,m),this.icon=new Cl(n?n.icon:null,o,d,m),this.clipped=y}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Wo{constructor(n,o,h,d=!1){this.text=n,this.icon=o,this.skipFade=h,this.clipped=d}}class Xo{constructor(){this.invProjMatrix=s.create(),this.viewportMatrix=s.create(),this.circles=[]}}class ps{constructor(n,o,h,d,m){this.bucketInstanceId=n,this.featureIndex=o,this.sourceLayerIndex=h,this.bucketIndex=d,this.tileID=m}}class ms{constructor(n){this.crossSourceCollisions=n,this.maxGroupID=0,this.collisionGroups={}}get(n){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[n]){const o=++this.maxGroupID;this.collisionGroups[n]={ID:o,predicate:h=>h.collisionGroupID===o}}return this.collisionGroups[n]}}function Yo(l,n,o,h,d){const{horizontalAlign:m,verticalAlign:y}=s.getAnchorAlignment(l),v=-(m-.5)*n,b=-(y-.5)*o,C=s.evaluateVariableOffset(l,h);return new s.Point(v+C[0]*d,b+C[1]*d)}function Ho(l,n,o,h,d){const m=new s.Point(l,n);return o&&m._rotate(h?d:-d),m}class Ta{constructor(n,o,h,d,m){this.transform=n.clone(),this.projection=n.projection.name,this.collisionIndex=new po(this.transform,m),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new ms(h),this.collisionCircleArrays={},this.prevPlacement=d,d&&(d.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(n,o,h,d){const m=h.getBucket(o),y=h.latestFeatureIndex;if(!m||!y||o.id!==m.layerIds[0])return;const v=m.layers[0].layout,b=h.collisionBoxArray,C=Math.pow(2,this.transform.zoom-h.tileID.overscaledZ
1),E=h.tileSize/s.EXTENT,I=h.tileID.toUnwrapped();this.transform.setProjection(m.projection);const L=(B=h.tileID,V=m.getProjection(),N=this.transform,V.name===this.projection?N.calculateProjMatrix(B.toUnwrapped()):Gr(N,V,B));var B,V,N;const U="map"===v.get("text-pitch-alignment"),D="map"===v.get("text-rotation-alignment");o.compileFilter();const F=o.dynamicFilter(),$=o.dynamicFilterNeedsFeature(),W=this.transform.calculatePixelsToTileUnitsMatrix(h),te=Pn(L,h.tileID.canonical,U,D,this.transform,m.getProjection(),W);let ne=null;if(U){const ae=oi(L,h.tileID.canonical,U,D,this.transform,m.getProjection(),W);ne=s.multiply([],this.transform.labelPlaneMatrix,ae)}let ie=null;F&&h.latestFeatureIndex&&(ie={unwrappedTileID:I,dynamicFilter:F,dynamicFilterNeedsFeature:$,featureIndex:h.latestFeatureIndex}),this.retainedQueryData[m.bucketInstanceId]=new ps(m.bucketInstanceId,y,m.sourceLayerIndex,m.index,h.tileID);const se={bucket:m,layout:v,posMatrix:L,textLabelPlaneMatrix:te,labelToScreenMatrix:ne,clippingData:ie,scale:C,textPixelRatio:E,holdingForFade:h.holdingForFade(),collisionBoxArray:b,partiallyEvaluatedTextSize:s.evaluateSizeForZoom(m.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:s.evaluateSizeForZoom(m.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(m.sourceID)};if(d)for(const ae of m.sortKeyRanges){const{sortKey:me,symbolInstanceStart:ke,symbolInstanceEnd:he}=ae;n.push({sortKey:me,symbolInstanceStart:ke,symbolInstanceEnd:he,parameters:se})}else n.push({symbolInstanceStart:0,symbolInstanceEnd:m.symbolInstances.length,parameters:se})}attemptAnchorPlacement(n,o,h,d,m,y,v,b,C,E,I,L,B,V,N,U,D,F){const{textOffset0:$,textOffset1:W,crossTileID:te}=L,ne=[$,W],ie=Yo(n,h,d,ne,m),se=this.collisionIndex.placeCollisionBox(V,m,o,Ho(ie.x,ie.y,y,v,this.transform.angle),I,b,C,E.predicate);if(U){const ae=V.getSymbolInstanceIconSize(F,this.transform.zoom,L.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(V,ae,U,Ho(ie.x,ie.y,y,v,this.transform.angle),I,b,C,E.predicate).box.length)return}if(se.box.length>0){let ae;return this.prevPlacement&&this.prevPlacement.variableOffsets[te]&&this.prevPlacement.placements[te]&&this.prevPlacement.placements[te].text&&(ae=this.prevPlacement.variableOffsets[te].anchor),this.variableOffsets[te]={textOffset:ne,width:h,height:d,anchor:n,textScale:m,prevAnchor:ae},this.markUsedJustification(V,n,L,N),V.allowVerticalPlacement&&(this.markUsedOrientation(V,N,L),this.placedOrientations[te]=N),{shift:ie,placedGlyphBoxes:se}}}placeLayerBucketPart(n,o,h,d){const{bucket:m,layout:y,posMatrix:v,textLabelPlaneMatrix:b,labelToScreenMatrix:C,clippingData:E,textPixelRatio:I,holdingForFade:L,collisionBoxArray:B,partiallyEvaluatedTextSize:V,partiallyEvaluatedIconSize:N,collisionGroup:U}=n.parameters,D=y.get("text-optional"),F=y.get("icon-optional"),$=y.get("text-allow-overlap"),W=y.get("icon-allow-overlap"),te="map"===y.get("text-rotation-alignment"),ne="map"===y.get("text-pitch-alignment"),ie="none"!==y.get("icon-text-fit"),se="viewport-y"===y.get("symbol-z-order");this.transform.setProjection(m.projection);let ae=$&&(W||!m.hasIconData()||F),me=W&&($||!m.hasTextData()||D);!m.collisionArrays&&B&&m.deserializeCollisionBoxes(B),h&&d&&m.updateCollisionDebugBuffers(this.transform.zoom,B);const ke=(he,Ee,_e)=>{const{crossTileID:De,numVerticalGlyphVertices:pe}=he;if(E){const Kt={zoom:this.transform.zoom,pitch:this.transform.pitch};let Ot=null;if(E.dynamicFilterNeedsFeature){const Dt=this.retainedQueryData[m.bucketInstanceId];Ot=E.featureIndex.loadFeature({featureIndex:he.featureIndex,bucketIndex:Dt.bucketIndex,sourceLayerIndex:Dt.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,E.dynamicFilter)(Kt,Ot,this.retainedQueryData[m.bucketInstanceId].tileID.canonical,new s.Point(he.tileAnchorX,he.tileAnchorY),this.transform.calculateDistanceTileData(E.unwrappedTileID)))return this.placements[De]=new Wo(!1,!1,!1,!0),void o.add(De)}if(o.has(De))return;if(L)return void(this.placements[De]=new Wo(!1,!1,!1));let Me=!1,Pe=!1,Se=!0,Re=!1,Ke=!1,ot=null,We={box:null,offscreen:null,occluded:null},et={box:null,offscreen:null,occluded:null},bt=null,yt=null,Ye=null,zt=0,Pt=0,Lt=0;_e.textFeatureIndex?zt=_e.textFeatureIndex:he.useRuntimeCollisionCircles&&(zt=he.featureIndex),_e.verticalTextFeatureIndex&&(Pt=_e.verticalTextFeatureIndex);const Rt=Kt=>{Kt.tileID=this.retainedQueryData[m.bucketInstanceId].tileID;const Ot=this.transform.elevation;(Ot||Kt.elevation)&&(Kt.elevation=Ot?Ot.getAtTileOffset(Kt.tileID,Kt.tileAnchorX,Kt.tileAnchorY):0)},Ui=_e.textBox;if(Ui){Rt(Ui);const Kt=Dt=>{let mi=s.WritingMode.horizontal;if(m.allowVerticalPlacement&&!Dt&&this.prevPlacement){const Ki=this.prevPlacement.placedOrientations[De];Ki&&(this.placedOrientations[De]=Ki,mi=Ki,this.markUsedOrientation(m,mi,he))}return mi},Ot=(Dt,mi)=>{if(m.allowVerticalPlacement&&pe>0&&_e.verticalTextBox){for(const Ki of m.writingModes)if(Ki===s.WritingMode.vertical?(We=mi(),et=We):We=Dt(),We&&We.box&&We.box.length)break}else We=Dt()};if(y.get("text-variable-anchor")){let Dt=y.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[De]){const Yt=this.prevPlacement.variableOffsets[De];Dt.indexOf(Yt.anchor)>0&&(Dt=Dt.filter(on=>on!==Yt.anchor),Dt.unshift(Yt.anchor))}const mi=(Yt,on,Ks)=>{const Ao=m.getSymbolInstanceTextSize(V,he,this.transform.zoom,Ee),Wa=(Yt.x2-Yt.x1)*Ao+2*Yt.padding,wr=(Yt.y2-Yt.y1)*Ao+2*Yt.padding,Hr=ie&&!W?on:null;Hr&&Rt(Hr);let Io={box:[],offscreen:!1,occluded:!1};const Js=$?2*Dt.length:Dt.length;for(let Xa=0;Xa<Js;++Xa){const Hl=this.attemptAnchorPlacement(Dt[Xa%Dt.length],Yt,Wa,wr,Ao,te,ne,I,v,U,Xa>=Dt.length,he,Ee,m,Ks,Hr,V,N);if(Hl&&(Io=Hl.placedGlyphBoxes,Io&&Io.box&&Io.box.length)){Me=!0,ot=Hl.shift;break}}return Io};Ot(()=>mi(Ui,_e.iconBox,s.WritingMode.horizontal),()=>{const Yt=_e.verticalTextBox;return Yt&&Rt(Yt),m.allowVerticalPlacement&&!(We&&We.box&&We.box.length)&&pe>0&&Yt?mi(Yt,_e.verticalIconBox,s.WritingMode.vertical):{box:null,offscreen:null,occluded:null}}),We&&(Me=We.box,Se=We.offscreen,Re=We.occluded);const Ki=Kt(!(!We||!We.box));if(!Me&&this.prevPlacement){const Yt=this.prevPlacement.variableOffsets[De];Yt&&(this.variableOffsets[De]=Yt,this.markUsedJustification(m,Yt.anchor,he,Ki))}}else{const Dt=(mi,Ki)=>{const Yt=m.getSymbolInstanceTextSize(V,he,this.transform.zoom,Ee),on=this.collisionIndex.placeCollisionBox(m,Yt,mi,new s.Point(0,0),$,I,v,U.predicate);return on&&on.box&&on.box.length&&(this.markUsedOrientation(m,Ki,he),this.placedOrientations[De]=Ki),on};Ot(()=>Dt(Ui,s.WritingMode.horizontal),()=>{const mi=_e.verticalTextBox;return m.allowVerticalPlacement&&pe>0&&mi?(Rt(mi),Dt(mi,s.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}}),Kt(!!(We&&We.box&&We.box.length))}}if(bt=We,Me=bt&&bt.box&&bt.box.length>0,Se=bt&&bt.offscreen,Re=bt&&bt.occluded,he.useRuntimeCollisionCircles){const Kt=m.text.placedSymbolArray.get(he.centerJustifiedTextSymbolIndex>=0?he.centerJustifiedTextSymbolIndex:he.verticalPlacedTextSymbolIndex),Ot=s.evaluateSizeForFeature
1(m.textSizeData,V,Kt),Dt=y.get("text-padding");yt=this.collisionIndex.placeCollisionCircles(m,$,Kt,m.lineVertexArray,m.glyphOffsetArray,Ot,v,b,C,h,ne,U.predicate,he.collisionCircleDiameter*Ot/s.ONE_EM,Dt,this.retainedQueryData[m.bucketInstanceId].tileID),Me=$||yt.circles.length>0&&!yt.collisionDetected,Se=Se&&yt.offscreen,Re=yt.occluded}if(_e.iconFeatureIndex&&(Lt=_e.iconFeatureIndex),_e.iconBox){const Kt=Ot=>{Rt(Ot);const Dt=ie&&ot?Ho(ot.x,ot.y,te,ne,this.transform.angle):new s.Point(0,0),mi=m.getSymbolInstanceIconSize(N,this.transform.zoom,he.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(m,mi,Ot,Dt,W,I,v,U.predicate)};et&&et.box&&et.box.length&&_e.verticalIconBox?(Ye=Kt(_e.verticalIconBox),Pe=Ye.box.length>0):(Ye=Kt(_e.iconBox),Pe=Ye.box.length>0),Se=Se&&Ye.offscreen,Ke=Ye.occluded}const ki=D||0===he.numHorizontalGlyphVertices&&0===pe,Mn=F||0===he.numIconVertices;if(ki||Mn?Mn?ki||(Pe=Pe&&Me):Me=Pe&&Me:Pe=Me=Pe&&Me,Me&&bt&&bt.box&&this.collisionIndex.insertCollisionBox(bt.box,y.get("text-ignore-placement"),m.bucketInstanceId,et&&et.box&&Pt?Pt:zt,U.ID),Pe&&Ye&&this.collisionIndex.insertCollisionBox(Ye.box,y.get("icon-ignore-placement"),m.bucketInstanceId,Lt,U.ID),yt&&(Me&&this.collisionIndex.insertCollisionCircles(yt.circles,y.get("text-ignore-placement"),m.bucketInstanceId,zt,U.ID),h)){const Kt=m.bucketInstanceId;let Ot=this.collisionCircleArrays[Kt];void 0===Ot&&(Ot=this.collisionCircleArrays[Kt]=new Xo);for(let Dt=0;Dt<yt.circles.length;Dt+=4)Ot.circles.push(yt.circles[Dt+0]),Ot.circles.push(yt.circles[Dt+1]),Ot.circles.push(yt.circles[Dt+2]),Ot.circles.push(yt.collisionDetected?1:0)}const or="globe"!==m.projection.name;ae=ae&&(or||!Re),me=me&&(or||!Ke),this.placements[De]=new Wo(Me||ae,Pe||me,Se||m.justReloaded),o.add(De)};if(se){const he=m.getSortedSymbolIndexes(this.transform.angle);for(let Ee=he.length-1;Ee>=0;--Ee){const _e=he[Ee];ke(m.symbolInstances.get(_e),_e,m.collisionArrays[_e])}}else for(let he=n.symbolInstanceStart;he<n.symbolInstanceEnd;he++)ke(m.symbolInstances.get(he),he,m.collisionArrays[he]);if(h&&m.bucketInstanceId in this.collisionCircleArrays){const he=this.collisionCircleArrays[m.bucketInstanceId];s.invert(he.invProjMatrix,v),he.viewportMatrix=this.collisionIndex.getViewportMatrix()}m.justReloaded=!1}markUsedJustification(n,o,h,d){const{leftJustifiedTextSymbolIndex:m,centerJustifiedTextSymbolIndex:y,rightJustifiedTextSymbolIndex:v,verticalPlacedTextSymbolIndex:b,crossTileID:C}=h,E=s.getAnchorJustification(o),I=d===s.WritingMode.vertical?b:"left"===E?m:"center"===E?y:"right"===E?v:-1;m>=0&&(n.text.placedSymbolArray.get(m).crossTileID=I>=0&&m!==I?0:C),y>=0&&(n.text.placedSymbolArray.get(y).crossTileID=I>=0&&y!==I?0:C),v>=0&&(n.text.placedSymbolArray.get(v).crossTileID=I>=0&&v!==I?0:C),b>=0&&(n.text.placedSymbolArray.get(b).crossTileID=I>=0&&b!==I?0:C)}markUsedOrientation(n,o,h){const d=o===s.WritingMode.horizontal||o===s.WritingMode.horizontalOnly?o:0,m=o===s.WritingMode.vertical?o:0,{leftJustifiedTextSymbolIndex:y,centerJustifiedTextSymbolIndex:v,rightJustifiedTextSymbolIndex:b,verticalPlacedTextSymbolIndex:C}=h,E=n.text.placedSymbolArray;y>=0&&(E.get(y).placedOrientation=d),v>=0&&(E.get(v).placedOrientation=d),b>=0&&(E.get(b).placedOrientation=d),C>=0&&(E.get(C).placedOrientation=m)}commit(n){this.commitTime=n,this.zoomAtLastRecencyCheck=this.transform.zoom;const o=this.prevPlacement;let h=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;const d=o?o.symbolFadeChange(n):1,m=o?o.opacities:{},y=o?o.variableOffsets:{},v=o?o.placedOrientations:{};for(const b in this.placements){const C=this.placements[b],E=m[b];E?(this.opacities[b]=new Jn(E,d,C.text,C.icon,null,C.clipped),h=h||C.text!==E.text.placed||C.icon!==E.icon.placed):(this.opacities[b]=new Jn(null,d,C.text,C.icon,C.skipFade,C.clipped),h=h||C.text||C.icon)}for(const b in m){const C=m[b];if(!this.opacities[b]){const E=new Jn(C,d,!1,!1);E.isHidden()||(this.opacities[b]=E,h=h||C.text.placed||C.icon.placed)}}for(const b in y)this.variableOffsets[b]||!this.opacities[b]||this.opacities[b].isHidden()||(this.variableOffsets[b]=y[b]);for(const b in v)this.placedOrientations[b]||!this.opacities[b]||this.opacities[b].isHidden()||(this.placedOrientations[b]=v[b]);h?this.lastPlacementChangeTime=n:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:n)}updateLayerOpacities(n,o){const h=new Set;for(const d of o){const m=d.getBucket(n);m&&d.latestFeatureIndex&&n.id===m.layerIds[0]&&this.updateBucketOpacities(m,h,d.collisionBoxArray)}}updateBucketOpacities(n,o,h){n.hasTextData()&&n.text.opacityVertexArray.clear(),n.hasIconData()&&n.icon.opacityVertexArray.clear(),n.hasIconCollisionBoxData()&&n.iconCollisionBox.collisionVertexArray.clear(),n.hasTextCollisionBoxData()&&n.textCollisionBox.collisionVertexArray.clear();const d=n.layers[0].layout,m=!!n.layers[0].dynamicFilter(),y=new Jn(null,0,!1,!1,
1!0),v=d.get("text-allow-overlap"),b=d.get("icon-allow-overlap"),C=d.get("text-variable-anchor"),E="map"===d.get("text-rotation-alignment"),I="map"===d.get("text-pitch-alignment"),L="none"!==d.get("icon-text-fit"),B=new Jn(null,0,v&&(b||!n.hasIconData()||d.get("icon-optional")),b&&(v||!n.hasTextData()||d.get("text-optional")),!0);!n.collisionArrays&&h&&(n.hasIconCollisionBoxData()||n.hasTextCollisionBoxData())&&n.deserializeCollisionBoxes(h);const V=(U,D,F)=>{for(let $=0;$<D/4;$++)U.opacityVertexArray.emplaceBack(F)};let N=0;for(let U=0;U<n.symbolInstances.length;U++){const D=n.symbolInstances.get(U),{numHorizontalGlyphVertices:F,numVerticalGlyphVertices:$,crossTileID:W,numIconVertices:te}=D,ne=o.has(W);let ie=this.opacities[W];ne?ie=y:ie||(ie=B,this.opacities[W]=ie),o.add(W);const se=F>0||$>0,ae=te>0,me=this.placedOrientations[W],ke=me===s.WritingMode.vertical,he=me===s.WritingMode.horizontal||me===s.WritingMode.horizontalOnly;if(!se&&!ae||ie.isHidden()||N++,se){const Ee=Ko(ie.text);V(n.text,F,ke?ti:Ee),V(n.text,$,he?ti:Ee);const _e=ie.text.isHidden(),{leftJustifiedTextSymbolIndex:De,centerJustifiedTextSymbolIndex:pe,rightJustifiedTextSymbolIndex:Me,verticalPlacedTextSymbolIndex:Pe}=D,Se=n.text.placedSymbolArray,Re=_e||ke?1:0;De>=0&&(Se.get(De).hidden=Re),pe>=0&&(Se.get(pe).hidden=Re),Me>=0&&(Se.get(Me).hidden=Re),Pe>=0&&(Se.get(Pe).hidden=_e||he?1:0);const Ke=this.variableOffsets[W];Ke&&this.markUsedJustification(n,Ke.anchor,D,me);const ot=this.placedOrientations[W];ot&&(this.markUsedJustification(n,"left",D,ot),this.markUsedOrientation(n,ot,D))}if(ae){const Ee=Ko(ie.icon),{placedIconSymbolIndex:_e,verticalPlacedIconSymbolIndex:De}=D,pe=n.icon.placedSymbolArray,Me=ie.icon.isHidden()?1:0;_e>=0&&(V(n.icon,te,ke?ti:Ee),pe.get(_e).hidden=Me),De>=0&&(V(n.icon,D.numVerticalIconVertices,he?ti:Ee),pe.get(De).hidden=Me)}if(n.hasIconCollisionBoxData()||n.hasTextCollisionBoxData()){const Ee=n.collisionArrays[U];if(Ee){let _e=new s.Point(0,0),De=!0;if(Ee.textBox||Ee.verticalTextBox){if(C){const Me=this.variableOffsets[W];Me?(_e=Yo(Me.anchor,Me.width,Me.height,Me.textOffset,Me.textScale),E&&_e._rotate(I?this.transform.angle:-this.transform.angle)):De=!1}m&&(De=!ie.clipped),Ee.textBox&&mo(n.textCollisionBox.collisionVertexArray,ie.text.placed,!De||ke,_e.x,_e.y),Ee.verticalTextBox&&mo(n.textCollisionBox.collisionVertexArray,ie.text.placed,!De||he,_e.x,_e.y)}const pe=De&&Boolean(!he&&Ee.verticalIconBox);Ee.iconBox&&mo(n.iconCollisionBox.collisionVertexArray,ie.icon.placed,pe,L?_e.x:0,L?_e.y:0),Ee.verticalIconBox&&mo(n.iconCollisionBox.collisionVertexArray,ie.icon.placed,!pe,L?_e.x:0,L?_e.y:0)}}}if(n.fullyClipped=0===N,n.sortFeatures(this.transform.angle),this.retainedQueryData[n.bucketInstanceId]&&(this.retainedQueryData[n.bucketInstanceId].featureSortOrder=n.featureSortOrder),n.hasTextData()&&n.text.opacityVertexBuffer&&n.text.opacityVertexBuffer.updateData(n.text.opacityVertexArray),n.hasIconData()&&n.icon.opacityVertexBuffer&&n.icon.opacityVertexBuffer.updateData(n.icon.opacityVertexArray),n.hasIconCollisionBoxData()&&n.iconCollisionBox.collisionVertexBuffer&&n.iconCollisionBox.collisionVertexBuffer.updateData(n.iconCollisionBox.collisionVertexArray),n.hasTextCollisionBoxData()&&n.textCollisionBox.collisionVertexBuffer&&n.textCollisionBox.collisionVertexBuffer.updateData(n.textCollisionBox.collisionVertexArray),n.bucketInstanceId in this.collisionCircleArrays){const U=this.collisionCircleArrays[n.bucketInstanceId];n.placementInvProjMatrix=U.invProjMatrix,n.placementViewportMatrix=U.viewportMatrix,n.collisionCircleArray=U.circles,delete this.collisionCircleArrays[n.bucketInstanceId]}}symbolFadeChange(n){return 0===this.fadeDuration?1:(n-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(n){return Math.max(0,(this.transform.zoom-n)/1.5)}hasTransitions(n){return this.stale||n-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(n,o){const h=this.zoomAtLastRecencyCheck===o?1-this.zoomAdjustment(o):1;return this.zoomAtLastRecencyCheck=o,this.commitTime+this.fadeDuration*h>n}setStale(){this.stale=!0}}function mo(l,n,o,h,d){l.emplaceBack(n?1:0,o?1:0,h||0,d||0),l.emplaceBack(n?1:0,o?1:0,h||0,d||0),l.emplaceBack(n?1:0,o?1:0,h||0,d||0),l.emplaceBack(n?1:0,o?1:0,h||0,d||0)}const Yi=Math.pow(2,25),ai=Math.pow(2,24),fs=Math.pow(2,17),gs=Math.pow(2,16),Hi=Math.pow(2,9),pn=Math.pow(2,8),Sa=Math.pow(2,1);function Ko(l){if(0===l.opacity&&!l.placed)return 0;if(1===l.opacity&&l.placed)return 4294967295;const n=l.placed?1:0,o=Math.floor(127*l.opacity);return o*Yi+n*ai+o*fs+n*gs+o*Hi+n*pn+o*Sa+n}const ti=0;class Jo{constructor(n){this._sortAcrossTiles="viewport-y"!==n.layout.get("symbol-z-order")&&void 0!==n.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(n,o,h,d,m){const y=this._bucketParts;for(;this._currentTileIndex<n.length;)if(o.getBucketParts(y,d,n[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,m())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,y.sort((v,b)=>
1v.sortKey-b.sortKey));this._currentPartIndex<y.length;){const v=y[this._currentPartIndex];if(o.placeLayerBucketPart(v,this._seenCrossTileIDs,h,0===v.symbolInstanceStart),this._currentPartIndex++,m())return!0}return!1}}class Zr{constructor(n,o,h,d,m,y,v,b){this.placement=new Ta(n,m,y,v,b),this._currentPlacementIndex=o.length-1,this._forceFullPlacement=h,this._showCollisionBoxes=d,this._done=!1}isDone(){return this._done}continuePlacement(n,o,h){const d=s.exported.now(),m=()=>{const y=s.exported.now()-d;return!this._forceFullPlacement&&y>2};for(;this._currentPlacementIndex>=0;){const y=o[n[this._currentPlacementIndex]],v=this.placement.collisionIndex.transform.zoom;if("symbol"===y.type&&(!y.minzoom||y.minzoom<=v)&&(!y.maxzoom||y.maxzoom>v)){if(this._inProgressLayer||(this._inProgressLayer=new Jo(y)),this._inProgressLayer.continuePlacement(h[y.source],this.placement,this._showCollisionBoxes,y,m))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(n){return this.placement.commit(n),this.placement}}const $r=512/s.EXTENT/2;class Ai{constructor(n,o,h){this.tileID=n,this.bucketInstanceId=h,this.index=new s.KDBush(o.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const d=n.canonical.x*s.EXTENT,m=n.canonical.y*s.EXTENT;for(let y=0;y<o.length;y++){const{key:v,crossTileID:b,tileAnchorX:C,tileAnchorY:E}=o.get(y),I=Math.floor((d+C)*$r),L=Math.floor((m+E)*$r);this.index.add(I,L),this.keys.push(v),this.crossTileIDs.push(b)}this.index.finish()}findMatches(n,o,h){const d=this.tileID.canonical.z<o.canonical.z?1:Math.pow(2,this.tileID.canonical.z-o.canonical.z),m=$r/Math.pow(2,o.canonical.z-this.tileID.canonical.z),y=o.canonical.x*s.EXTENT,v=o.canonical.y*s.EXTENT;for(let b=0;b<n.length;b++){const C=n.get(b);if(C.crossTileID)continue;const{key:E,tileAnchorX:I,tileAnchorY:L}=C,B=Math.floor((y+I)*m),V=Math.floor((v+L)*m),N=this.index.range(B-d,V-d,B+d,V+d);for(const U of N){const D=this.crossTileIDs[U];if(this.keys[U]===E&&!h.has(D)){h.add(D),C.crossTileID=D;break}}}}}class _s{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class ys{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(n){const o=Math.round((n-this.lng)/360);if(0!==o)for(const h in this.indexes){const d=this.indexes[h],m={};for(const y in d){const v=d[y];v.tileID=v.tileID.unwrapTo(v.tileID.wrap+o),m[v.tileID.key]=v}this.indexes[h]=m}this.lng=n}addBucket(n,o,h){if(this.indexes[n.overscaledZ]&&this.indexes[n.overscaledZ][n.key]){if(this.indexes[n.overscaledZ][n.key].bucketInstanceId===o.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(n.overscaledZ,this.indexes[n.overscaledZ][n.key])}for(let m=0;m<o.symbolInstances.length;m++)o.symbolInstances.get(m).crossTileID=0;this.usedCrossTileIDs[n.overscaledZ]||(this.usedCrossTileIDs[n.overscaledZ]=new Set);const d=this.usedCrossTileIDs[n.overscaledZ];for(const m in this.indexes){const y=this.indexes[m];if(Number(m)>n.overscaledZ)for(const v in y){const b=y[v];b.tileID.isChildOf(n)&&b.findMatches(o.symbolInstances,n,d)}else{const v=y[n.scaledTo(Number(m)).key];v&&v.findMatches(o.symbolInstances,n,d)}}for(let m=0;m<o.symbolInstances.length;m++){const y=o.symbolInstances.get(m);y.crossTileID||(y.crossTileID=h.generate(),d.add(y.crossTileID))}return void 0===this.indexes[n.overscaledZ]&&(this.indexes[n.overscaledZ]={}),this.indexes[n.overscaledZ][n.key]=new Ai(n,o.symbolInstances,o.bucketInstanceId),!0}removeBucketCrossTileIDs(n,o){for(const h of o.crossTileIDs)this.usedCrossTileIDs[n].delete(h)}removeStaleBuckets(n){let o=!1;for(const h in this.indexes){const d=this.indexes[h];for(const m in d)n[d[m].bucketInstanceId]||(this.removeBucketCrossTileIDs(h,d[m]),delete d[m],o=!0)}return o}}class xn{constructor(){this.layerIndexes={},this.crossTileIDs=new _s,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(n,o,h,d){let m=this.layerIndexes[n.id];void 0===m&&(m=this.layerIndexes[n.id]=new ys);let y=!1;const v={};"globe"!==d.name&&m.handleWrapJump(h);for(const b of o){const C=b.getBucket(n);C&&n.id===C.layerIds[0]&&(C.bucketInstanceId||(C.bucketInstanceId=++this.maxBucketInstanceId),m.addBucket(b.tileID,C,this.crossTileIDs)&&(y=!0),v[C.bucketInstanceId]=!0)}return m.removeStaleBuckets(v)&&(y=!0),y}pruneUnusedLayers(n){const o={};
1n.forEach(h=>{o[h]=!0});for(const h in this.layerIndexes)o[h]||delete this.layerIndexes[h]}}const Qn=(l,n)=>s.emitValidationErrors(l,n&&n.filter(o=>"source.canvas"!==o.identifier)),Aa=s.pick(At,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),zc=s.pick(At,["setCenter","setZoom","setBearing","setPitch"]),vs={version:8,layers:[],sources:{}},fo={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class Rn extends s.Evented{constructor(n,o={}){super(),this.map=n,this.dispatcher=new pi(ho(),this),this.imageManager=new $i,this.imageManager.setEventedParent(this),this.glyphManager=new s.GlyphManager(n._requestManager,o.localFontFamily?s.LocalGlyphMode.all:o.localIdeographFontFamily?s.LocalGlyphMode.ideographs:s.LocalGlyphMode.none,o.localFontFamily||o.localIdeographFontFamily),this.crossTileSymbolIndex=new xn,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",s.getReferrer());const h=this;this._rtlTextPluginCallback=Rn.registerForPluginStateChange(d=>{h.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:d.pluginStatus,pluginURL:d.pluginURL},(m,y)=>{if(s.triggerPluginCompletionEvent(m),y&&y.every(v=>v))for(const v in h._sourceCaches){const b=h._sourceCaches[v],C=b.getSource().type;"vector"!==C&&"geojson"!==C||b.reload()}})}),this.on("data",d=>{if("source"!==d.dataType||"metadata"!==d.sourceDataType)return;const m=this.getSource(d.sourceId);if(m&&m.vectorLayerIds)for(const y in this._layers){const v=this._layers[y];v.source===m.id&&this._validateLayer(v)}})}loadURL(n,o={}){this.fire(new s.Event("dataloading",{dataType:"style"}));const h="boolean"==typeof o.validate?o.validate:!s.isMapboxURL(n);n=this.map._requestManager.normalizeStyleURL(n,o.accessToken);const d=this.map._requestManager.transformRequest(n,s.ResourceType.Style);this._request=s.getJSON(d,(m,y)=>{this._request=null,m?this.fire(new s.ErrorEvent(m)):y&&this._load(y,h)})}loadJSON(n,o={}){this.fire(new s.Event("dataloading",{dataType:"style"})),this._request=s.exported.frame(()=>{this._request=null,this._load(n,!1!==o.validate)})}loadEmpty(){this.fire(new s.Event("dataloading",{dataType:"style"})),this._load(vs,!1)}_updateLayerCount(n,o){const h=o?1:-1;n.is3D()&&(this._num3DLayers+=h),"circle"===n.type&&(this._numCircleLayers+=h),"symbol"===n.type&&(this._numSymbolLayers+=h)}_load(n,o){if(o&&Qn(this,s.validateStyle(n)))return;this._loaded=!0,this.stylesheet=s.clone$1(n),this._updateMapProjection();for(const d in n.sources)this.addSource(d,n.sources[d],{validate:!1});this._changed=!1,n.sprite?this._loadSprite(n.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(n.glyphs);const h=wl(this.stylesheet.layers);this._order=h.map(d=>d.id),this._layers={},this._serializedLayers={};for(const d of h){const m=s.createStyleLayer(d);m.setEventedParent(this,{layer:{id:m.id}}),this._layers[m.id]=m,this._serializedLayers[m.id]=m.serialize(),this._updateLayerCount(m,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new di(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new s.Event("data",{dataType:"style"})),this.fire(new s.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}setProjection(n){n?this.stylesheet.projection=n:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(n){this._spriteRequest=function(o,h,d){let m,y,v;const b=s.exported.devicePixelRatio>1?"@2x":"";let C=s.getJSON(h.transformRequest(h.normalizeSpriteURL(o,b,".json"),s.ResourceType.SpriteJSON),(L,B)=>{C=null,v||(v=L,m=B,I())}),E=s.getImage(h.transformRequest(h.normalizeSpriteURL(o,b,".png"),s.ResourceType.SpriteImage),(L,B)=>{E=null,v||(v=L,y=B,I())});function I(){if(v)d(v);else if(m&&y){const L=s.exported.getImageData(y),B={};for(const V in m){const{width:N,height:U,x:D,y:F,sdf:$,pixelRatio:W,stretchX:te,stretchY:ne,content:ie}=m[V],se=new s.RGBAImage({width:N,height:U});s.RGBAImage.copy(L,se,{x:D,y:F},{x:0,y:0},{width:N,height:U}),B[V]={data:se,pixelRatio:W,sdf:$,stretchX:te,stretchY:ne,content:ie}}d(null,B)}}return{cancel(){C&&(C.cancel(),C=null),E&&(E.cancel(),E=null)}}}(n,this.map._requestManager,(o,h)=>{if(this._spriteRequest=null,o)this.fire(new s.ErrorEvent(o));else if(h)for(const d in h)this.imageManager.addImage(d,h[d]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new s.Event("data",{dataType:"style"}))})}_validateLayer(n){const o=this.getSource(n.source);if(!o)return;const h=n.sourceLayer;h&&("geojson"===o.type||o.vectorLayerIds&&-1===o.vectorLayerIds.indexOf(h))&&this.fire(new s.ErrorEvent(new Error(`Source layer "${h}" does not exist on source "${o.id}" as specified by style layer "${n.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const n in this._sourceCaches)if(!this._sourceCaches[n].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(n){const o=[];for(const h of n){const d=this._layers[h];"custom"!==d.type&&o.push(d.serialize())}return o}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(const n in this._sourceCaches)if(this._sourceCaches[n].hasTransition())return!0;for(const n in this._layers)if(this._layers[n].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(n){return!!this.terrain&&("function"==typeof n.isLayerDraped?n.isLayerDraped():fo[n.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(n){if(!this._loaded)return;const o=this._changed;if(this._changed){const d=Object.keys(this._updatedLayers),m=Object.keys(this._removedLayers);(d.length||m.length)&&this._updateWorkerLayers(d,m);for(const y in this._updatedSources){const v=this._updatedSources[y];"reload"===v?this._reloadSource(y):"clear"===v&&this._clearSource(y)}this._updateTilesForChangedImages();for(const y in this._updatedPaintProps)this._layers[y].updateTransitions(n);this.light.updateTransitions(n),this.fog&&this.fog.updateTransitions(n),this._resetUpdates()}const h={};for(const d in this._sourceCaches){const m=this._sourceCaches[d];h[d]=m.used,m.used=!1}for(const d of this._order){const m=this._layers[d];if(m.recalculate(n,this._availableImages),!m.isHidden(n.zoom)){const v=this._getLayerSourceCache(m);v&&(v.used=!0)}const y=this.map.painter;if(y){const v=m.getProgramIds();if(!v)continue;const b=m.getProgramConfiguration(n.zoom);for(const C of v)y.useProgram(C,b)}}for(const d in h){const m=this._sourceCaches[d];h[d]!==m.used&&m.getSource().fire(new s.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:m.getSource().id}))}this.light.recalculate(n),this.terrain&&this.terrain.recalculate(n),this.fog&&this.fog.recalculate(n),this.z=n.zoom,this._markersNeedU
1pdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),o&&this.fire(new s.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const n=Object.keys(this._changedImages);if(n.length){for(const o in this._sourceCaches)this._sourceCaches[o].reloadTilesForDependencies(["icons","patterns"],n);this._changedImages={}}}_updateWorkerLayers(n,o){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:o})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(n){if(this._checkLoaded(),Qn(this,s.validateStyle(n)))return!1;(n=s.clone$1(n)).layers=wl(n.layers);const o=function(d,m){if(!d)return[{command:At.setStyle,args:[m]}];let y=[];try{if(!Ie(d.version,m.version))return[{command:At.setStyle,args:[m]}];Ie(d.center,m.center)||y.push({command:At.setCenter,args:[m.center]}),Ie(d.zoom,m.zoom)||y.push({command:At.setZoom,args:[m.zoom]}),Ie(d.bearing,m.bearing)||y.push({command:At.setBearing,args:[m.bearing]}),Ie(d.pitch,m.pitch)||y.push({command:At.setPitch,args:[m.pitch]}),Ie(d.sprite,m.sprite)||y.push({command:At.setSprite,args:[m.sprite]}),Ie(d.glyphs,m.glyphs)||y.push({command:At.setGlyphs,args:[m.glyphs]}),Ie(d.transition,m.transition)||y.push({command:At.setTransition,args:[m.transition]}),Ie(d.light,m.light)||y.push({command:At.setLight,args:[m.light]}),Ie(d.fog,m.fog)||y.push({command:At.setFog,args:[m.fog]}),Ie(d.projection,m.projection)||y.push({command:At.setProjection,args:[m.projection]});const v={},b=[];!function(I,L,B,V){let N;for(N in L=L||{},I=I||{})I.hasOwnProperty(N)&&(L.hasOwnProperty(N)||Zo(N,B,V));for(N in L){if(!L.hasOwnProperty(N))continue;const U=L[N];I.hasOwnProperty(N)?Ie(I[N],U)||("geojson"===I[N].type&&"geojson"===U.type&&$o(I,L,N)?B.push({command:At.setGeoJSONSourceData,args:[N,U.data]}):cs(N,L,B,V)):Go(N,L,B)}}(d.sources,m.sources,b,v);const C=[];d.layers&&d.layers.forEach(I=>{I.source&&v[I.source]?y.push({command:At.removeLayer,args:[I.id]}):C.push(I)});let E=d.terrain;E&&v[E.source]&&(y.push({command:At.setTerrain,args:[void 0]}),E=void 0),y=y.concat(b),Ie(E,m.terrain)||y.push({command:At.setTerrain,args:[m.terrain]}),function(I,L,B){L=L||[];const V=(I=I||[]).map(Hn),N=L.map(Hn),U=I.reduce(hs,{}),D=L.reduce(hs,{}),F=V.slice(),$=Object.create(null);let W,te,ne,ie,se,ae,me;for(W=0,te=0;W<V.length;W++)ne=V[W],D.hasOwnProperty(ne)?te++:(B.push({command:At.removeLayer,args:[ne]}),F.splice(F.indexOf(ne,te),1));for(W=0,te=0;W<N.length;W++)ne=N[N.length-1-W],F[F.length-1-W]!==ne&&(U.hasOwnProperty(ne)?(B.push({command:At.removeLayer,args:[ne]}),F.splice(F.lastIndexOf(ne,F.length-te),1)):te++,ae=F[F.length-W],B.push({command:At.addLayer,args:[D[ne],ae]}),F.splice(F.length-W,0,ne),$[ne]=!0);for(W=0;W<N.length;W++)if(ne=N[W],ie=U[ne],se=D[ne],!$[ne]&&!Ie(ie,se))if(Ie(ie.source,se.source)&&Ie(ie["source-layer"],se["source-layer"])&&Ie(ie.type,se.type)){for(me in yn(ie.layout,se.layout,B,ne,null,At.setLayoutProperty),yn(ie.paint,se.paint,B,ne,null,At.setPaintProperty),Ie(ie.filter,se.filter)||B.push({command:At.setFilter,args:[ne,se.filter]}),Ie(ie.minzoom,se.minzoom)&&Ie(ie.maxzoom,se.maxzoom)||B.push({command:At.setLayerZoomRange,args:[ne,se.minzoom,se.maxzoom]}),ie)ie.hasOwnProperty(me)&&"layout"!==me&&"paint"!==me&&"filter"!==me&&"metadata"!==me&&"minzoom"!==me&&"maxzoom"!==me&&(0===me.indexOf("paint.")?yn(ie[me],se[me],B,ne,me.slice(6),At.setPaintProperty):Ie(ie[me],se[me])||B.push({command:At.setLayerProperty,args:[ne,me,se[me]]}));for(me in se)se.hasOwnProperty(me)&&!ie.hasOwnProperty(me)&&"layout"!==me&&"paint"!==me&&"filter"!==me&&"metadata"!==me&&"minzoom"!==me&&"maxzoom"!==me&&(0===me.indexOf("paint.")?yn(ie[me],se[me],B,ne,me.slice(6),At.setPaintProperty):Ie(ie[me],se[me])||B.push({command:At.setLayerProperty,args:[ne,me,se[me]]}))}else B.push({command:At.removeLayer,args:[ne]}),ae=F[F.lastIndexOf(ne)+1],B.push({command:At.addLayer,args:[se,ae]})}(C,m.layers,y)}catch(v){console.warn("Unable to compute style diff:",v),y=[{command:At.setStyle,args:[m]}]}return y}(this.serialize(),n).filter(d=>!(d.command in zc));if(0===o.length)return!1;const h=o.filter(d=>!(d.command in Aa));if(h.length>0)throw new Error(`Unimplemented: ${h.map(d=>d.command).join(", ")}.`);return o.forEach(d=>{"setTransition"!==d.command&&"setProjection"!==d.command&&this[d.command].apply(this,d.args
vendor: 10,254 bytes, line 1
1)}),this.stylesheet=n,this._updateMapProjection(),!0}addImage(n,o){return this.getImage(n)?this.fire(new s.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(n,o),this._afterImageUpdated(n),this)}updateImage(n,o){this.imageManager.updateImage(n,o)}getImage(n){return this.imageManager.getImage(n)}removeImage(n){return this.getImage(n)?(this.imageManager.removeImage(n),this._afterImageUpdated(n),this):this.fire(new s.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(n){this._availableImages=this.imageManager.listImages(),this._changedImages[n]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new s.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(n,o,h={}){if(this._checkLoaded(),void 0!==this.getSource(n))throw new Error("There is already a source with this ID");if(!o.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(o).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(o.type)>=0&&this._validate(s.validateSource,`sources.${n}`,o,null,h))return;this.map&&this.map._collectResourceTiming&&(o.collectResourceTiming=!0);const d=ft(n,o,this.dispatcher,this);d.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(n),source:d.serialize(),sourceId:n}));const m=y=>{const v=(y?"symbol:":"other:")+n,b=this._sourceCaches[v]=new s.SourceCache(v,d,y);(y?this._symbolSourceCaches:this._otherSourceCaches)[n]=b,b.style=this,b.onAdd(this.map)};m(!1),"vector"!==o.type&&"geojson"!==o.type||m(!0),d.onAdd&&d.onAdd(this.map),this._changed=!0}removeSource(n){this._checkLoaded();const o=this.getSource(n);if(!o)throw new Error("There is no source with this ID");for(const d in this._layers)if(this._layers[d].source===n)return this.fire(new s.ErrorEvent(new Error(`Source "${n}" cannot be removed while layer "${d}" is using it.`)));if(this.terrain&&this.terrain.get().source===n)return this.fire(new s.ErrorEvent(new Error(`Source "${n}" cannot be removed while terrain is using it.`)));const h=this._getSourceCaches(n);for(const d of h)delete this._sourceCaches[d.id],delete this._updatedSources[d.id],d.fire(new s.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:d.getSource().id})),d.setEventedParent(null),d.clearTiles();return delete this._otherSourceCaches[n],delete this._symbolSourceCaches[n],o.setEventedParent(null),o.onRemove&&o.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(n,o){this._checkLoaded(),this.getSource(n).setData(o),this._changed=!0}getSource(n){const o=this._getSourceCache(n);return o&&o.getSource()}_getSources(){const n=[];for(const o in this._otherSourceCaches){const h=this._getSourceCache(o);h&&n.push(h.getSource())}return n}addLayer(n,o,h={}){this._checkLoaded();const d=n.id;if(this.getLayer(d))return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${d}" already exists on this map`)));let m;if("custom"===n.type){if(Qn(this,s.validateCustomStyleLayer(n)))return;m=s.createStyleLayer(n)}else{if("object"==typeof n.source&&(this.addSource(d,n.source),n=s.clone$1(n),n=s.extend(n,{source:d})),this._validate(s.validateLayer,`layers.${d}`,n,{arrayIndex:-1},h))return;m=s.createStyleLayer(n),this._validateLayer(m),m.setEventedParent(this,{layer:{id:d}}),this._serializedLayers[m.id]=m.serialize(),this._updateLayerCount(m,!0)}const y=o?this._order.indexOf(o):this._order.length;if(o&&-1===y)return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${o}" does not exist on this map.`)));this._order.splice(y,0,d),this._layerOrderChanged=!0,this._layers[d]=m;const v=this._getLayerSourceCache(m);if(this._removedLayers[d]&&m.source&&v&&"custom"!==m.type){const b=this._removedLayers[d];delete this._removedLayers[d],b.type!==m.type?this._updatedSources[m.source]="clear":(this._updatedSources[m.source]="reload",v.pause())}this._updateLayer(m),m.onAdd&&m.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(n,o){if(this._checkLoaded(),this._changed=!0,!this._layers[n])return void this.fire(new s.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be moved.`)));if(n===o)return;const h=this._order.indexOf(n);this._order.splice(h,1);const d=o?this._order.indexOf(o):this._order.length;o&&-1===d?this.fire(new s.ErrorEvent(new Error(`Layer with id "${o}" does not exist on this map.`))):(this._order.splice(d,0,n),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(n){this._checkLoaded();const o=this._layers[n];if(!o)return void this.fire(new s.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be removed.`)));o.setEventedParent(null),this._updateLayerCount(o,!1);const h=this._order.indexOf(n);this._order.splice(h,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[n]=o,delete this._layers[n],delete this._serializedLayers[n],delete this._updatedLayers[n],delete this._updatedPaintProps[n],o.onRemove&&o.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(n){return this._layers[n]}hasLayer(n){return n in this._layers}hasLayerType(n){for(const o in this._layers)if(this._layers[o].type===n)return!0;return!1}setLayerZoomRange(n,o,h){this._checkLoaded();const d=this.getLayer(n);d?d.minzoom===o&&d.maxzoom===h||(null!=o&&(d.minzoom=o),null!=h&&(d.maxzoom=h),this._updateLayer(d)):this.fire(new s.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(n,o,h={}){this._checkLoaded();const d=this.getLayer(n);if(d){if(!Ie(d.filter,o))return null==o?(d.filter=void 0,void this._updateLayer(d)):void(this._validate(s.validateFilter,`layers.${d.id}.filter`,o,{layerType:d.type},h)||(d.filter=s.clone$1(o),this._updateLayer(d)))}else this.fire(new s.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be filtered.`)))}getFilter(n){const o=this.getLayer(n);return o&&s.clone$1(o.filter)}setLayoutProperty(n,o,h,d={}){this._checkLoaded();const m=this.getLayer(n);m?Ie(m.getLayoutProperty(o),h)||(m.setLayoutProperty(o,h,d),this._updateLayer(m)):this.fire(new s.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(n,o){const h=this.getLayer(n);if(h)return h.getLayoutProperty(o);this.fire(new s.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style.`)))}setPaintProperty(n,o,h,d={}){this._checkLoaded();const m=this.getLayer(n);m?Ie(m.getPaintProperty(o),h)||(m.setPaintProperty(o,h,d)&&this._updateLayer(m),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new s.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(n,o){const h=this.getLayer(n);return h&&h.getPaintProperty(o)}setFeatureState(n,o){this._checkLoaded();const h=n.source,d=n.sourceLayer,m=this.getSource(h);if(!m)return void this.fire(new s.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)));const y=m.type;if("geojson"===y&&d)return void this.fire(new s.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===y&&!d)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===n.id&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided.")));const v=this._getSourceCaches(h);for(const b of v)b.setFeatureState(d,n.id,o)}removeFeatureState(n,o){this._checkLoaded();const h=n.source,d=this.getSource(h);if(!d)return void this.fire(new s.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)));const m=d.type,y="vector"===m?n.sourceLayer:void 0;if("vector"===m&&!y)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(o&&"string"!=typeof n.id&&"number"!=typeof n.id)return void this.fire(new s.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const v=this._getSourceCaches(h);for(const b of v)b.removeFeatureState(y,n.id,o)}getFeatureState(n){this._checkLoaded();const o=n.source,h=n.sourceLayer,d=this.getSource(o);if(d){if("vector"!==d.type||h)return void 0===n.id&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(o)[0].getFeatureState(h,n.id);this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new s.ErrorEvent(new Error(`The source '${o}' does not exist in the map's style.`)))}getTransition(){return s.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const n={};for(const o in this._sourceCaches){const h=this._sourceCaches[o].getSource();n[h.id]||(n[h.id]=h.serialize())}return s.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:n,layers:this._serializeLayers(this._order)},o=>void 0!==o)}_updateLayer(n){this._updatedLayers[n.id]=!0;const o=this._getLayerSourceCache(n);n.source&&!this._updatedSources[n.source]&&o&&"raster"!==o.getSource().type&&(this._updatedSources[n.source]="reload",o.pause()),this._changed=!0,n.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(n){const o=y=>"fill-extrusion"===this._layers[y].type,h={},d=[];for(let y=this._order.length-1;y>=0;y--){const v=this._order[y];if(o(v)){h[v]=y;for(const b of n){const C=b[v];if(C)for(const E of C)d.push(E)}}}d.sort((y,v)=>v.intersectionZ-y.intersectionZ);const m=[];for(let y=this._order.length-1;y>=0;y--){const v=this._order[y];if(o(v))for(let b=d.length-1;b>=0;b--){const C=d[b].feature;if(h[C.layer.id]<y)break;m.push(C),d.pop()}else for(const b of n){const C=b[v];if(C)for(const E of C)m.push(E.feature)}}return m}
1queryRenderedFeatures(n,o,h){o&&o.filter&&this._validate(s.validateFilter,"queryRenderedFeatures.filter",o.filter,null,o);const d={};if(o&&o.layers){if(!Array.isArray(o.layers))return this.fire(new s.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(const b of o.layers){const C=this._layers[b];if(!C)return this.fire(new s.ErrorEvent(new Error(`The layer '${b}' does not exist in the map's style and cannot be queried for features.`))),[];d[C.source]=!0}}const m=[];o.availableImages=this._availableImages;const y=o&&o.layers?o.layers.some(b=>{const C=this.getLayer(b);return C&&C.is3D()}):this.has3DLayers(),v=$n.createFromScreenPoints(n,h);for(const b in this._sourceCaches){const C=this._sourceCaches[b].getSource().id;o.layers&&!d[C]||m.push(Wt(this._sourceCaches[b],this._layers,this._serializedLayers,v,o,h,y,!!this.map._showQueryGeometry))}return this.placement&&m.push(function(b,C,E,I,L,B,V){const N={},U=B.queryRenderedSymbols(I),D=[];for(const F of Object.keys(U).map(Number))D.push(V[F]);D.sort(Si);for(const F of D){const $=F.featureIndex.lookupSymbolFeatures(U[F.bucketInstanceId],C,F.bucketIndex,F.sourceLayerIndex,L.filter,L.layers,L.availableImages,b);for(const W in $){const te=N[W]=N[W]||[],ne=$[W];ne.sort((ie,se)=>{const ae=F.featureSortOrder;if(ae){const me=ae.indexOf(ie.featureIndex);return ae.indexOf(se.featureIndex)-me}return se.featureIndex-ie.featureIndex});for(const ie of ne)te.push(ie)}}for(const F in N)N[F].forEach($=>{const W=$.feature,te=E(b[F]);if(!te)return;const ne=te.getFeatureState(W.layer["source-layer"],W.id);W.source=W.layer.source,W.layer["source-layer"]&&(W.sourceLayer=W.layer["source-layer"]),W.state=ne});return N}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),v.screenGeometry,o,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(m)}querySourceFeatures(n,o){o&&o.filter&&this._validate(s.validateFilter,"querySourceFeatures.filter",o.filter,null,o);const h=this._getSourceCaches(n);let d=[];for(const m of h)d=d.concat(ri(m,o));return d}addSourceType(n,o,h){return Rn.getSourceType(n)?h(new Error(`A source type called "${n}" already exists.`)):(Rn.setSourceType(n,o),o.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:o.workerSourceURL},h):h(null,null))}getLight(){return this.light.getLight()}setLight(n,o={}){this._checkLoaded();const h=this.light.getLight();let d=!1;for(const y in n)if(!Ie(n[y],h[y])){d=!0;break}if(!d)return;const m=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(n,o),this.light.updateTransitions(m)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(n,o=1){if(this._checkLoaded(),!n)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let h=n;if(1===o){if("object"==typeof h.source){const d="terrain-dem-src";this.addSource(d,h.source),h=s.clone$1(h),h=s.extend(h,{source:d})}if(this._validate(s.validateTerrain,"terrain",h))return}if(!this.terrain||this.terrain&&o!==this.terrain.drapeRenderMode){if(!h)return;this._createTerrain(h,o)}else{const d=this.terrain,m=d.get();for(const y of Object.keys(s.spec.terrain))!h.hasOwnProperty(y)&&s.spec.terrain[y].default&&(h[y]=s.spec.terrain[y].default);for(const y in h)if(!Ie(h[y],m[y])){d.set(h),this.stylesheet.terrain=h;const v=this._setTransitionParameters({duration:0});d.updateTransitions(v);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(n){const o=this.fog=new Rr(n,this.map.transform);this.stylesheet.fog=n;const h=this._setTransitionParameters({duration:0});o.updateTransitions(h)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask(()=>{for(const n of this.map._markers)n._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(n){if(this._checkLoaded(),!n)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedU
vendor: 5,403 bytes, line 1
1pdate=!0);if(this.fog){const o=this.fog,h=o.get();0===Object.keys(n).length&&o.set(n);for(const d in n)if(!Ie(n[d],h[d])){o.set(n),this.stylesheet.fog=n;const m=this._setTransitionParameters({duration:0});o.updateTransitions(m);break}}else this._createFog(n);this._markersNeedUpdate=!0}_setTransitionParameters(n){return{now:s.exported.now(),transition:s.extend(n,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const n=this._order.filter(h=>this.isLayerDraped(this._layers[h])),o=this._order.filter(h=>!this.isLayerDraped(this._layers[h]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...n),this._drapedFirstOrder.push(...o)}_createTerrain(n,o){const h=this.terrain=new ur(n,o);this.stylesheet.terrain=n,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const d=this._setTransitionParameters({duration:0});h.updateTransitions(d)}_force3DLayerUpdate(){for(const n in this._layers){const o=this._layers[n];"fill-extrusion"===o.type&&this._updateLayer(o)}}_forceSymbolLayerUpdate(){for(const n in this._layers){const o=this._layers[n];"symbol"===o.type&&this._updateLayer(o)}}_validate(n,o,h,d,m={}){return(!m||!1!==m.validate)&&Qn(this,n.call(s.validateStyle,s.extend({key:o,style:this.serialize(),value:h,styleSpec:s.spec},d)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),s.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const n in this._layers)this._layers[n].setEventedParent(null);for(const n in this._sourceCaches)this._sourceCaches[n].clearTiles(),this._sourceCaches[n].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(n){const o=this._getSourceCaches(n);for(const h of o)h.clearTiles()}_reloadSource(n){const o=this._getSourceCaches(n);for(const h of o)h.resume(),h.reload()}_reloadSources(){for(const n of this._getSources())n.reload&&n.reload()}_updateSources(n){for(const o in this._sourceCaches)this._sourceCaches[o].update(n)}_generateCollisionBoxes(){for(const n in this._sourceCaches){const o=this._sourceCaches[n];o.resume(),o.reload()}}_updatePlacement(n,o,h,d,m=!1){let y=!1,v=!1;const b={};for(const C of this._order){const E=this._layers[C];if("symbol"!==E.type)continue;if(!b[E.source]){const L=this._getLayerSourceCache(E);if(!L)continue;b[E.source]=L.getRenderableIds(!0).map(B=>L.getTileByID(B)).sort((B,V)=>V.tileID.overscaledZ-B.tileID.overscaledZ||(B.tileID.isLessThan(V.tileID)?-1:1))}const I=this.crossTileSymbolIndex.addLayer(E,b[E.source],n.center.lng,n.projection);y=y||I}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),m=m||this._layerOrderChanged||0===h,this._layerOrderChanged&&this.fire(new s.Event("neworder")),(m||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(s.exported.now(),n.zoom))&&(this.pauseablePlacement=new Zr(n,this._order,m,o,h,d,this.placement,this.fog&&n.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,b),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(s.exported.now()),v=!0),y&&this.pauseablePlacement.placement.setStale()),v||y)for(const C of this._order){const E=this._layers[C];"symbol"===E.type&&this.placement.updateLayerOpacities(E,b[E.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(s.exported.now())}_releaseSymbolFadeTiles(){for(const n in this._sourceCaches)this._sourceCaches[n].releaseSymbolFadeTiles()}getImages(n,o,h){this.imageManager.getImages(o.icons,h),this._updateTilesForChangedImages();const d=m=>{m&&m.setDependencies(o.tileID.key,o.type,o.icons)};d(this._otherSourceCaches[o.source]),d(this._symbolSourceCaches[o.source])}getGlyphs(n,o,h){this.glyphManager.getGlyphs(o.stacks,h)}getResource(n,o,h){return s.makeRequest(o,h)}_getSourceCache(n){return this._otherSourceCaches[n]}_getLayerSourceCache(n){return"symbol"===n.type?this._symbolSourceCaches[n.source]:this._otherSourceCaches[n.source]}_getSourceCaches(n){const o=[];return this._otherSourceCaches[n]&&o.push(this._otherSourceCaches[n]),this._symbolSourceCaches[n]&&o.push(this._symbolSourceCaches[n]),o}_isSourceCacheLoaded(n){const o=this._getSourceCaches(n);return 0===o.length?(this.fire(new s.ErrorEvent(new Error(`There is no source with ID '${n}'`))),!1):o.every(h=>h.loaded())}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}Rn.getSourceType=function(l){return at[l]},Rn.setSourceType=function(l,n){at[l]=n},Rn.registerForPluginStateChange=s.registerForPluginStateChange;var xs="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#define EXTENT 8192.0\n#define HALF_PI PI/2.0\n#define QUARTER_PI PI/4.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0",qr="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;
1void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",er="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\nconst float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)\n{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}\n#ifdef TERRAIN\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;\n#else\nuniform sampler2D u_dem;uniform sampler2D u_dem_prev;\n#endif\nuniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos));\n#ifdef TERRAIN_DEM_NEAREST_FILTER\nreturn u_exaggeration*tl;\n#endif\nfloat tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nhighp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(\nunpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy))\n);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nfloat tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a;\n#else\nvec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);
1vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack);\n#endif\nreturn vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }\n#endif",go="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",On="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif";let fr={},gr={};const _o=[];vo(xs,_o),vo(er,_o),vo(go,_o),vo(On,_o),fr=It("",er),gr=It(On,go);const Tl=It("\n#if __VERSION__ >=300\n#define varying in\n#define gl_FragColor glFragColor\n#define texture2D texture\n#define textureCube texture\nout vec4 glFragColor;\n#endif\nhighp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}
1vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}","\n#if __VERSION__ >=300\n#define attribute in\n#define varying out\n#define texture2D texture\n#endif\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered."),yo=xs,bs="\n#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif";var ws={background:It("uniform vec4 u_color;uniform float u_opacity;\n#ifdef LIGHTING_3D_MODE\nvarying vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#ifdef LIGHTING_3D_MODE\nuniform vec4 u_color;varying vec4 v_color;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting(u_color);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),backgroundPattern:It("uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),circle:It("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius
1/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\ngl_FragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radiu
1s,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}"),clippingMask:It("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:It("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),heatmapTexture:It("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:It("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}","attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:It("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos_2f;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:It("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;\n#endif\nvarying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1
1);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}"),fill:It("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutline:It("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutlinePattern:It("uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillPattern:It("uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillExtrusion:It("varying vec4 v_color;\n#ifdef RENDER_SHADOWS\nvarying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef ZERO_ROOF_RADIUS\nvarying vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvarying highp vec3 v_normal;\n#endif\nvoid main() {\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvec3 normal=v_normal;\n#endif\nfloat z;vec4 color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z);\n#else\ncolor=v_color;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0
1),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef ZERO_ROOF_RADIUS\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#endif\ncolor.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec4 v_color;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;\n#endif\n#ifdef ZERO_ROOF_RADIUS\nvarying vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvarying highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nv_normal=normal;\n#endif\nbase=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=0.0;float c_ele;vec3 pos;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h);\n#else\nh=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);\n#ifdef RENDER_SHADOWS\nv_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w;\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);
1\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0);\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting(color,NdotL);\n#else\nv_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\n#endif\nv_color*=u_opacity;\n#ifdef ZERO_ROOF_RADIUS\nv_roof_color=vec4(0.0,0.0,0.0,1.0);\n#ifdef LIGHTING_3D_MODE\nv_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0)));\n#else\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\n#endif\nv_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),fillExtrusionPattern:It("uniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nvarying float v_NdotL;\n#endif\nvarying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,v_NdotL)*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec2 v_pos;varying vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nvarying float v_NdotL;\n#endif\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;
1base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(ce
1ntroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_NdotL=NdotL;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif \n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}"),hillshadePrepare:It("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nreturn texture2D(u_image,coord).a/4.0;\n#else\nvec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;\n#endif\n}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:It("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\ngl_FragColor=apply_lighting(gl_FragColor);\n#endif\n#ifdef FOG\ngl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),line:It("uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;varying vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\nuniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nfloat linearstep(float edge0,float edge1,float x) {return  
1clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture2D(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trimmed=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}}\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef RENDER_LINE_ALPHA_DISCARD\nif (alpha < u_alpha_discard_threshold) {discard;}\n#endif\n#ifdef RENDER_LINE_BORDER\nfloat edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);\n#ifdef RENDER_LINE_BORDER_AUTO\nfloat Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}\n#else\nout_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha);\n#endif\n}\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define EXTRUDE_SCALE 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nattribute highp vec4 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nattribute float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nfloat a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end);\n#else\nv_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),linePattern:It("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting(color);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),raster:It("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply(out_color,v_fog_pos));\n#endif\ngl_FragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),symbolIcon:It("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}"),symbolSDF:It("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;u
1niform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat gamma_scale=gl_Position.w;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}"),symbolTextAndIcon:It("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
1gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_s
1df);}"),terrainRaster:It("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nvarying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;\n#endif\nvoid main() {vec4 color=texture2D(u_image0,v_pos0);\n#ifdef RENDER_SHADOWS\ncolor.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;\n#endif\nconst float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;\n#ifdef TERRAIN_WIREFRAME\nelevation+=wireframeOffset;\n#endif\nv_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w;\n#endif\n}"),terrainDepth:It("#ifdef GL_ES\nprecision highp float;\n#endif\nvarying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}","uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:It("\nvarying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(e
1nd-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",qr),skyboxGradient:It("varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",qr),skyboxCapture:It
vendor: 3,851 bytes, line 1
1("\nvarying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;\n#ifdef GL_ES\nprecision highp float;\n#endif\n#define BETA_R                  vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M                  vec3(21e-6,21e-6,21e-6)\n#define MIE_G                   0.76\n#define DENSITY_HEIGHT_SCALE_R  8000.0\n#define DENSITY_HEIGHT_SCALE_M  1200.0\n#define PLANET_RADIUS           6360e3\n#define ATMOSPHERE_RADIUS       6420e3\n#define SAMPLE_STEPS            10\n#define DENSITY_STEPS           4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}","attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:
1It("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nvec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#else\ncolor=texture2D(u_image0,v_pos0);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;\n#ifdef GLOBE_POLES\nattribute vec3 a_globe_pos;attribute vec2 a_uv;\n#else\nattribute vec2 a_pos;\n#endif\nvarying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);\n#ifdef TERRAIN_WIREFRAME\nheight+=wireframeOffset;\n#endif\nglobe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}"),globeAtmosphere:It("uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;
1highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x:\n(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y:\nuv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}","attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}")};function vo(l,n){const o=l.replace(/\s*\/\/[^\n]*\n/g,"\n").split("\n");for(let h of o)if(h=h.trim(),"#"===h[0]&&h.includes("if")&&!h.includes("endif")){h=h.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const d=h.split(" ");for(const m of d)n.includes(m)||n.push(m)}}function It(l,n){const o=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,h=n.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),d={},m=[..._o];return vo(l,m),vo(n,m),{fragmentSource:l=l.replace(o,(y,v,b,C,E)=>(d[E]=!0,"define"===v?`\n#ifndef HAS_UNIFORM_u_${E}\nvarying ${b} ${C} ${E};\n#else\nuniform ${b} ${C} u_${E};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${E}\n    ${b} ${C} ${E} = u_${E};\n#endif\n`)),vertexSource:n=n.replace(o,(y,v,b,C,E)=>{const I="float"===C?"vec2":"vec4",L=E.match(/color/)?"color":I;return d[E]?"define"===v?`\n#ifndef HAS_UNIFORM_u_${E}\nuniform lowp float u_${E}_t;\nattribute ${b} ${I} a_${E};\nvarying ${b} ${C} ${E};\n#else\nuniform ${b} ${C} u_${E};\n#endif\n`:"vec4"===L?`\n#ifndef HAS_UNIFORM_u_${E}\n    ${E} = a_${E};\n#else\n    ${b} ${C} ${E} = u_${E};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${E}\n    ${E} = unpack_mix_${L}(a_${E}, u_${E}_t);\n#else\n    ${b} ${C} ${E} = u_${E};\n#endif\n`:"define"===v?`\n#ifndef HAS_UNIFORM_u_${E}\nuniform lowp float u_${E}_t;\nattribute ${b} ${I} a_${E};\n#else\nuniform ${b} ${C} u_${E};\n#endif\n`:"vec4"===L?`\n#ifndef HAS_UNIFORM_u_${E}\n    ${b} ${C} ${E} = a_${E};\n#else\n    ${b} ${C} ${E} = u_${E};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${E}\n    ${b} ${C} ${E} = unpack_mix_${L}(a_${E}, u_${E}_t);\n#else\n    ${b} ${C} ${E} = u_${E};\n#endif\n`}),staticAttributes:h,usedDefines:m}}class Sl{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(n,o,h,d,m,y,v){this.context=n;let b=this.boundPaintVertexBuffers.length!==d.length;for(let E=0;!b&&E<d.length;E++)this.boundPaintVertexBuffers[E]!==d[E]&&(b=!0);let C=this.boundDynamicVertexBuffers.length!==v.length;for(let E=0;!C&&E<v.length;E++)this.boundDynamicVertexBuffers[E]!==v[E]&&(C=!0);if(!n.extVertexArrayObject||!this.vao||this.boundProgram!==o||this.boundLayoutVertexBuffer!==h||b||C||this.boundIndexBuffer!==m||this.boundVertexOffset!==y)this.freshBind(o,h,d,m,y,v);else{n.bindVertexArrayOES.set(this.vao);for(const E of v)E&&E.bind();m&&m.dynamicDraw&&m.bind()}}freshBind(n,o,h,d,m,y){let v;const b=n.numAttributes,C=this.context,E=C.gl;if(C.extVertexArrayObject)this.vao&&this.destroy(),this.vao=C.extVertexArrayObject.createVertexArrayOES(),C.bindVertexArrayOES.set(this.vao),v=0,this.boundProgram=n,this.boundLayoutVertexBuffer=o,this.boundPaintVertexBuffers=h,this.boundIndexBuffer=d,this.boundVertexOffset=m,this.boundDynamicVertexBuffers=y;else{v=C.currentNumAttributes||0;for(let I=b;I<v;I++)E.disableVertexAttribArray(I)}o.enableAttributes(E,n),o.bind(),o.setVertexAttribPointers(E,n,m);for(const I of h)I.enableAttributes(E,n),I.bind(),I.setVertexAttribPointers(E,n,m);for(const I of y)I&&(I.enableAttributes(E,n),I.bind(),I.setVertexAttribPointers(E,n,m));d&&d.bind(),C.currentNumAttributes=b}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function Ms(l,n){const o=Math.pow(2,n.canonical.z),h=n.canonical.y;return[new s.MercatorCoordinate(0,h/o).toLngLat().lat,new s.MercatorCoordinate(0,(h+1)/o).toLngLat().lat]}function Ia(l,n,o,h,d,m,y){const v=l.context,b=v.gl,C=o.fbo;if(!C)return;l.prepareDrawTile();const E=l.useProgram("hillshade");v.activeTexture.set(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,C.colorAttachment.get());const I=((N,U,D,F)=>{const $=D.paint.get("hillshade-shadow-color"),W=D.paint.get("hillshade-highlight-color"),te=D.paint.get("hillshade-accent-color");let ne=D.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===D.paint.get("hillshade-illumination-anchor")&&(ne-=N.transform.angle);const ie=!N.options.moving;return{u_matrix:F||N.transform.calculateProjMatrix(U.tileID.toUnwrapped(),ie),u_image:0,u_latrange:Ms(0,U.tileID),u_light:[D.paint.get("hillshade-exaggeration"),ne],u_shadow:$,u_highlight:W,u_accent:te}})(l,o,h,l.terrain?n.projMatrix:null);l.prepareDrawProgram(v,E,n.toUnwrapped());const{tileBoundsBuffer:L,tileBoundsIndexBuffer:B,tileBoundsSegments:V}=l.getTileBoundsBuffers(o);E.draw(v,b.TRIANGLES,d,m,y,s.CullFaceMode.disabled,I,h.id,L,B,V)}function Es(l,n,o){if(!n.needsDEMTextureUpload)return;const h=l.context,d=h.gl;h.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||l.getTileTexture(o.stride);const m=o.getPixels();n.demTexture?n.demTexture.update(m,{premultiply:!1}):n.demTexture=new s.Texture(h,m,d.RGBA,{premultiply:!1}),n.needsDEMTextureUpload=!1}function Al(l,n,o,h,d,m){const y=l.context,v=y.gl;if(!n.dem)return;const b=n.dem;if(y.activeTexture.set(v.TEXTURE1),Es(l,n,b),!n.demTexture)return;n.demTexture.bind(v.NEAREST,v.CLAMP_TO_EDGE);const C=b.dim;y.activeTexture.set(v.TEXTURE0);let E=n.fbo;if(!E){const V=new s.Texture(y,{width:C,height:C,data:null},v.RGBA);
vendor: 4,470 bytes, line 1
1V.bind(v.LINEAR,v.CLAMP_TO_EDGE),E=n.fbo=y.createFramebuffer(C,C,!0),E.colorAttachment.set(V.texture)}y.bindFramebuffer.set(E.framebuffer),y.viewport.set([0,0,C,C]);const{tileBoundsBuffer:I,tileBoundsIndexBuffer:L,tileBoundsSegments:B}=l.getMercatorTileBoundsBuffers();l.useProgram("hillshadePrepare").draw(y,v.TRIANGLES,h,d,m,s.CullFaceMode.disabled,((V,N)=>{const U=N.stride,D=s.create();return s.ortho(D,0,s.EXTENT,-s.EXTENT,0,0,1),s.translate(D,D,[0,-s.EXTENT,0]),{u_matrix:D,u_image:1,u_dimension:[U,U],u_zoom:V.overscaledZ,u_unpack:N.unpackVector}})(n.tileID,b),o.id,I,L,B),n.needsHillshadePrepare=!1}const Cs=l=>({u_matrix:new s.UniformMatrix4f(l),u_image0:new s.Uniform1i(l),u_skirt_height:new s.Uniform1f(l)}),xo=(l,n)=>({u_matrix:l,u_image0:0,u_skirt_height:n}),Da=(l,n,o,h,d,m,y,v,b,C,E,I,L,B,V)=>({u_proj_matrix:Float32Array.from(l),u_globe_matrix:n,u_normalize_matrix:Float32Array.from(h),u_merc_matrix:o,u_zoom_transition:d,u_merc_center:m,u_image0:0,u_frustum_tl:y,u_frustum_tr:v,u_frustum_br:b,u_frustum_bl:C,u_globe_pos:E,u_globe_radius:I,u_viewport:L,u_grid_matrix:V?Float32Array.from(V):new Float32Array(9),u_skirt_height:B});function bo(l,n){return null!=l&&null!=n&&!(!l.hasData()||!n.hasData())&&null!=l.demTexture&&null!=n.demTexture&&l.tileID.key!==n.tileID.key}const tr=new class{constructor(){this.operations={}}newMorphing(l,n,o,h,d){if(l in this.operations){const m=this.operations[l];m.to.tileID.key!==o.tileID.key&&(m.queued=o)}else this.operations[l]={startTime:h,phase:0,duration:d,from:n,to:o,queued:null}}getMorphValuesForProxy(l){if(!(l in this.operations))return null;const n=this.operations[l];return{from:n.from,to:n.to,phase:n.phase}}update(l){for(const n in this.operations){const o=this.operations[n];for(o.phase=(l-o.startTime)/o.duration;o.phase>=1||!this._validOp(o);)if(!this._nextOp(o,l)){delete this.operations[n];break}}}_nextOp(l,n){return!!l.queued&&(l.from=l.to,l.to=l.queued,l.queued=null,l.phase=0,l.startTime=n,!0)}_validOp(l){return l.from.hasData()&&l.to.hasData()}},_r={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function wo(l){return 6*Math.pow(1.5,22-l)}function Ts(l,n){const o=1<<l.z;return!n&&(0===l.x||l.x===o-1)||0===l.y||l.y===o-1}const Mo=l=>({u_matrix:l});function ka(l,n,o,h,d){if(d>0){const m=s.exported.now(),y=(m-l.timeAdded)/d,v=n?(m-n.timeAdded)/d:-1,b=o.getSource(),C=h.coveringZoomLevel({tileSize:b.tileSize,roundZoom:b.roundZoom}),E=!n||Math.abs(n.tileID.overscaledZ-C)>Math.abs(l.tileID.overscaledZ-C),I=E&&l.refreshedUponExpiration?1:s.clamp(E?y:1-v,0,1);return l.refreshedUponExpiration&&y>=1&&(l.refreshedUponExpiration=!1),n?{opacity:1,mix:1-I}:{opacity:I,mix:0}}return{opacity:1,mix:0}}class Ss extends s.SourceCache{constructor(n){const o={type:"raster-dem",maxzoom:n.transform.maxZoom},h=new pi(ho(),null),d=ft("mock-dem",o,h,n.style);super("mock-dem",d,!1),d.setEventedParent(this),this._sourceLoaded=!0}_loadTile(n,o){n.state="loaded",o(null)}}class za extends s.SourceCache{constructor(n){const o=ft("proxy",{type:"geojson",maxzoom:n.transform.maxZoom},new pi(ho(),null),n.style);super("proxy",o,!1),o.setEventedParent(this),this.map=this.getSource().map=n,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(n,o,h){if(n.freezeTileCoverage)return;this.transform=n;const d=n.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((m,y)=>{if(m[y.key]="",!this._tiles[y.key]){const v=new s.Tile(y,this._source.tileSize*y.overscaleFactor(),n.tileZoom);v.state="loaded",this._tiles[y.key]=v}return m},{});for(const m in this._tiles)m in d||(this.freeFBO(m),this._tiles[m].unloadVectorData(),delete this._tiles[m])}freeFBO(n){const o=this.proxyCachedFBO[n];if(void 0!==o){const h=Object.values(o);this.renderCachePool.push(...h),delete this.proxyCachedFBO[n]}}deallocRenderCache(){this.renderCache.forEach(n=>n.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Qo extends s.OverscaledTileID{constructor(n,o,h){super(n.overscaledZ,n.wrap,n.canonical.z,n.canonical.x,n.canonical.y),this.proxyTileKey=o,this.projMatrix=h}}class As extends s.Elevation{constructor(n,o){super(),this.painter=n,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[h,d,m]=function(b){const C=new s.StructArrayLayout2i4,E=new s.StructArrayLayout3ui6,I=131;
1C.reserve(17161),E.reserve(33800);const L=s.EXTENT/128,B=s.EXTENT+L/2,V=B+L;for(let U=-L;U<V;U+=L)for(let D=-L;D<V;D+=L){const F=D<0||D>B||U<0||U>B?24575:0,$=s.clamp(Math.round(D),0,s.EXTENT),W=s.clamp(Math.round(U),0,s.EXTENT);C.emplaceBack($+F,W)}const N=(U,D)=>{const F=D*I+U;E.emplaceBack(F+1,F,F+I),E.emplaceBack(F+I,F+I+1,F+1)};for(let U=1;U<129;U++)for(let D=1;D<129;D++)N(D,U);return[0,129].forEach(U=>{for(let D=0;D<130;D++)N(D,U),N(U,D)}),[C,E,32768]}(),y=n.context;this.gridBuffer=y.createVertexBuffer(h,s.posAttributes.members),this.gridIndexBuffer=y.createIndexBuffer(d),this.gridSegments=s.SegmentVector.simpleSegment(0,0,h.length,d.length),this.gridNoSkirtSegments=s.SegmentVector.simpleSegment(0,0,h.length,m),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new za(o.map),this.orthoMatrix=s.create(),s.ortho(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,s.EXTENT,0,s.EXTENT,0,1);const v=y.gl;this._overlapStencilMode=new s.StencilMode({func:v.GEQUAL,mask:255},0,255,v.KEEP,v.KEEP,v.REPLACE),this._previousZoom=n.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=o,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Ss(o.map)}set style(n){n.on("data",this._onStyleDataEvent.bind(this)),n.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=n,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(n,o,h){if(n&&n.terrain){this._style!==n&&(this.style=n),this.enabled=!0;const d=n.terrain.properties;this.sourceCache=0===n.terrain.drapeRenderMode?this._mockSourceCache:n._getSourceCache(d.get("source")),this._exaggeration=d.get("exaggeration");const m=()=>{this.sourceCache.used&&s.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const y=this.getScaledDemTileSize();this.sourceCache.update(o,y,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,m(),this._initializing=!0),m(),o.updateElevation(!0,h),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(o),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(n){this._findCoveringTileCache[n]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const n=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||100!==n.efficiency&&s.warnOnce(`Terrain render cache efficiency is not optimal (${n.efficiency}%) and performance\n                may be affected negatively, consider placing all background, fill and line layers before layer\n                with id '${n.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(n){n.coord&&"source"===n.dataType?this._clearRenderCacheForTile(n.sourceCacheId,n.coord):"style"===n.dataType&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const n in this._style._sourceCaches)this._style._sourceCaches[n].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(n=>n.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const n=2*this.proxySourceCache.getSource().tileSize;return[n,n]}set useVertexMorphing(n){this._useVertexMorphing=n}updateTileBinding(n){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const o=this.proxySourceCache,h=this.painter.transform;this._initializing&&(this._initializing=0===h._centerAltitude&&-1===this.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(h.center),-1),this._emptyDEMTextureDirty=!this._initializing);const d=this.proxyCoords=o.getIds().map(b=>{const C=o.getTileByID(b).tileID;return C.projMatrix=h.calculateProjMatrix(C.toUnwrapped()),C});(function(b,C){const E=C.transform.pointCoordinate(C.transform.getCameraPoint()),I=new s.Point(E.x,E.y);b.sort((L,B)=>
1{if(B.overscaledZ-L.overscaledZ)return B.overscaledZ-L.overscaledZ;const V=new s.Point(L.canonical.x+(1<<L.canonical.z)*L.wrap,L.canonical.y),N=new s.Point(B.canonical.x+(1<<B.canonical.z)*B.wrap,B.canonical.y),U=I.mult(1<<L.canonical.z);return U.x-=.5,U.y-=.5,U.distSqr(V)-U.distSqr(N)})})(d,this.painter),this._previousZoom=h.zoom;const m=this.proxyToSource||{};this.proxyToSource={},d.forEach(b=>{this.proxyToSource[b.key]={}}),this.terrainTileForTile={};const y=this._style._sourceCaches;for(const b in y){const C=y[b];if(!C.used||(C!==this.sourceCache&&this.resetTileLookupCache(C.id),this._setupProxiedCoordsForOrtho(C,n[b],m),C.usedForTerrain))continue;const E=n[b];C.getSource().reparseOverscaled&&this._assignTerrainTiles(E)}this.proxiedCoords[o.id]=d.map(b=>new Qo(b,b.key,this.orthoMatrix)),this._assignTerrainTiles(d),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(m),this.renderingToTexture=!1,this._updateTimestamp=s.exported.now();const v={};this._visibleDemTiles=[];for(const b of this.proxyCoords){const C=this.terrainTileForTile[b.key];if(!C)continue;const E=C.tileID.key;E in v||(this._visibleDemTiles.push(C),v[E]=E)}}_assignTerrainTiles(n){this._initializing||n.forEach(o=>{if(this.terrainTileForTile[o.key])return;const h=this._findTileCoveringTileID(o,this.sourceCache);h&&(this.terrainTileForTile[o.key]=h)})}_prepareDEMTextures(){const n=this.painter.context,o=n.gl;for(const h in this.terrainTileForTile){const d=this.terrainTileForTile[h],m=d.dem;!m||d.demTexture&&!d.needsDEMTextureUpload||(n.activeTexture.set(o.TEXTURE1),Es(this.painter,d,m))}}_prepareDemTileUniforms(n,o,h,d){if(!o||null==o.demTexture)return!1;const m=n.tileID.canonical,y=Math.pow(2,o.tileID.canonical.z-m.z),v=d||"";return h[`u_dem_tl${v}`]=[m.x*y%1,m.y*y%1],h[`u_dem_scale${v}`]=y,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const n=this.painter.context,o=n.gl;if(!this._emptyDepthBufferTexture){const h=new s.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new s.Texture(n,h,o.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let n=0;const o=this._visibleDemTiles.reduce((h,d)=>{if(!d.dem)return h;const m=d.dem.tree.minimums[0];return m>0&&n++,h+m},0);return n?o/n:0}_updateEmptyDEMTexture(){const n=this.painter.context,o=n.gl;n.activeTexture.set(o.TEXTURE2);const h=this._getLoadedAreaMinimum(),d=new s.RGBAImage({width:1,height:1},new Uint8Array(s.DEMData.pack(h,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let m=this._emptyDEMTexture;return m?m.update(d,{premultiply:!1}):m=this._emptyDEMTexture=new s.Texture(n,d,o.RGBA,{premultiply:!1}),m}setupElevationDraw(n,o,h){const d=this.painter.context,m=d.gl,y=(v=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:s.DEMData.getUnpackVector(v),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var v;y.u_dem_size=this.sourceCache.getSource().tileSize,y.u_exaggeration=this.exaggeration();let b=null,C=null,E=1;if(h&&h.morphing&&this._useVertexMorphing){const I=h.morphing.srcDemTile,L=h.morphing.dstDemTile;E=h.morphing.phase,I&&L&&(this._prepareDemTileUniforms(n,I,y,"_prev")&&(C=I),this._prepareDemTileUniforms(n,L,y)&&(b=L))}if(C&&b?(d.activeTexture.set(m.TEXTURE2),b.demTexture.bind(m.NEAREST,m.CLAMP_TO_EDGE,m.NEAREST),d.activeTexture.set(m.TEXTURE4),C.demTexture.bind(m.NEAREST,m.CLAMP_TO_EDGE,m.NEAREST),y.u_dem_lerp=E):(b=this.terrainTileForTile[n.tileID.key],d.activeTexture.set(m.TEXTURE2),(this._prepareDemTileUniforms(n,b,y)?b.demTexture:this.emptyDEMTexture).bind(m.NEAREST,m.CLAMP_TO_EDGE)),d.activeTexture.set(m.TEXTURE3),h&&h.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(m.NEAREST,m.CLAMP_TO_EDGE),this._depthFBO&&(y.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(m.NEAREST,m.CLAMP_TO_EDGE),y.u_depth_size_inv=[1,1]),h&&h.useMeterToDem&&b){const I=(1<<b.tileID.canonical.z)*s.mercatorZfromAltitude(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;y.u_meter_to_dem=I}
1if(h&&h.labelPlaneMatrixInv&&(y.u_label_plane_matrix_inv=h.labelPlaneMatrixInv),o.setTerrainUniformValues(d,y),"globe"===this.painter.transform.projection.name){const I=this.globeUniformValues(this.painter.transform,n.tileID.canonical,h&&h.useDenormalizedUpVectorScale);o.setGlobeUniformValues(d,I)}}globeUniformValues(n,o,h){const d=n.projection;return{u_tile_tl_up:d.upVector(o,0,0),u_tile_tr_up:d.upVector(o,s.EXTENT,0),u_tile_br_up:d.upVector(o,s.EXTENT,s.EXTENT),u_tile_bl_up:d.upVector(o,0,s.EXTENT),u_tile_up_scale:h?s.globeMetersToEcef(1):d.upVectorScale(o,n.center.lat,n.worldSize).metersToTile}}renderToBackBuffer(n){const o=this.painter,h=this.painter.context;0!==n.length&&(h.bindFramebuffer.set(null),h.viewport.set([0,0,o.width,o.height]),o.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(d,m,y,v,b){if("globe"===d.transform.projection.name)!function(C,E,I,L,B){const V=C.context,N=V.gl;let U,D;const F=C.options.showTerrainWireframe?2:0,$=C.transform,W=s.globeUseCustomAntiAliasing(C,V,$),te=(De,pe)=>{if(D===De)return;const Me=[_r[De],"PROJECTION_GLOBE_VIEW"];W&&Me.push("CUSTOM_ANTIALIASING"),pe&&Me.push(_r[F]),U=C.useProgram("globeRaster",null,Me),D=De},ne=C.colorModeForRenderPass(),ie=new s.DepthMode(N.LEQUAL,s.DepthMode.ReadWrite,C.depthRangeFor3D);tr.update(B);const se=s.calculateGlobeMercatorMatrix($),ae=[s.mercatorXfromLng($.center.lng),s.mercatorYfromLat($.center.lat)],me=F?[!1,!0]:[!1],ke=C.globeSharedBuffers,he=[$.width*s.exported.devicePixelRatio,$.height*s.exported.devicePixelRatio],Ee=Float32Array.from($.globeMatrix),_e={useDenormalizedUpVectorScale:!0};if(me.forEach(De=>{const pe=C.transform,Me=wo(pe.zoom)*E.exaggeration();D=-1;const Pe=De?N.LINES:N.TRIANGLES;for(const Se of L){const Re=I.getTile(Se),Ke=s.StencilMode.disabled,ot=E.prevTerrainTileForTile[Se.key],We=E.terrainTileForTile[Se.key];bo(ot,We)&&tr.newMorphing(Se.key,ot,We,B,250),V.activeTexture.set(N.TEXTURE0),Re.texture.bind(N.LINEAR,N.CLAMP_TO_EDGE);const et=tr.getMorphValuesForProxy(Se.key),bt=et?1:0;et&&s.extend$1(_e,{morphing:{srcDemTile:et.from,dstDemTile:et.to,phase:s.easeCubicInOut(et.phase)}});const yt=s.tileCornersToBounds(Se.canonical),Ye=s.getLatitudinalLod(yt.getCenter().lat),zt=s.getGridMatrix(Se.canonical,yt,Ye,pe.worldSize/pe._pixelsPerMercatorPixel),Pt=s.globeNormalizeECEF(s.globeTileBounds(Se.canonical)),Lt=Da(pe.projMatrix,Ee,se,Pt,s.globeToMercatorTransition(pe.zoom),ae,pe.frustumCorners.TL,pe.frustumCorners.TR,pe.frustumCorners.BR,pe.frustumCorners.BL,pe.globeCenterInViewSpace,pe.globeRadius,he,Me,zt);if(te(bt,De),E.setupElevationDraw(Re,U,_e),C.prepareDrawProgram(V,U,Se.toUnwrapped()),ke){const[Rt,Ui,ki]=De?ke.getWirefameBuffers(C.context,Ye):ke.getGridBuffers(Ye,0!==Me);U.draw(V,Pe,ie,Ke,ne,s.CullFaceMode.backCCW,Lt,"globe_raster",Rt,Ui,ki)}}}),ke){const De=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];W&&De.push("CUSTOM_ANTIALIASING"),U=C.useProgram("globeRaster",null,De);for(const pe of L){const{x:Me,y:Pe,z:Se}=pe.canonical,Re=0===Pe,Ke=Pe===(1<<Se)-1,[ot,We,et,bt]=ke.getPoleBuffers(Se);if(bt&&(Re||Ke)){const yt=I.getTile(pe);V.activeTexture.set(N.TEXTURE0),yt.texture.bind(N.LINEAR,N.CLAMP_TO_EDGE);let Ye=s.globePoleMatrixForTile(Se,Me,$);const zt=s.globeNormalizeECEF(s.globeTileBounds(pe.canonical)),Pt=(Lt,Rt)=>Lt.draw(V,N.TRIANGLES,ie,s.StencilMode.disabled,ne,s.CullFaceMode.disabled,Da($.projMatrix,Ye,Ye,zt,0,ae,$.frustumCorners.TL,$.frustumCorners.TR,$.frustumCorners.BR,$.frustumCorners.BL,$.globeCenterInViewSpace,$.globeRadius,he,0),"globe_pole_raster",Rt,et,bt);E.setupElevationDraw(yt,U,_e),C.prepareDrawProgram(V,U,pe.toUnwrapped()),Re&&Pt(U,ot),Ke&&(Ye=s.scale(s.create(),Ye,[1,-1,1]),Pt(U,We))}}}}(d,m,y,v,b);else{const C=d.context,E=C.gl;let I,L;const B=d.options.showTerrainWireframe?2:0,V=($,W)=>{if(L===$)return;const te=[_r[$]];W&&te.push(_r[B]),I=d.useProgram("terrainRaster",null,te),L=$},N=d.colorModeForRenderPass(),U=new s.DepthMode(E.LEQUAL,s.DepthMode.ReadWrite,d.depthRangeFor3D);tr.update(b);const D=d.transform,F=wo(D.zoom)*m.exaggeration();(B?[!1,!0]:[!1]).forEach($=>{L=-1;const W=$?E.LINES:E.TRIANGLES,[te,ne]=$?m.getWirefameBuffer():[m.gridIndexBuffer,m.gridSegments];for(const ie of v){const se=y.getTile(ie),ae=s.StencilMode.disabled,me=m.prevTerrainTileForTile[ie.key],ke=m.terrainTileForTile[ie.key];bo(me,ke)&&tr.newMorphing(ie.key,me,ke,b,250),C.activeTexture.set(E.TEXTURE0),se.texture.bind(E.LINEAR,E.CLAMP_TO_EDGE,E.LINEAR_MIPMAP_NEAREST);const he=tr.getMorphValuesForProxy(ie.key),Ee=he?1:0;let _e;he&&(_e={morphing:{srcDemTile:he.from,dstDemTile:he.to,phase:s.easeCubicInOut(he.phase)}});const De=xo(ie.projMatrix,Ts(ie.canonical,D.renderWorldCopies)?F/10:F);V(Ee,$),m.setupElevationDraw(se,I,_e),d.prepareDrawProgram(C,I,ie.toUnwrapped()),I.draw(C,W,U,ae,N,s.CullFaceMode.backCCW,De,"terrain_raster",m.gridBuffer,te,ne)}})}}(o,this,this.proxySourceCache,n,this._updateTimestamp),this.renderingToTexture=!0,o.gpuTimingDeferredRenderEnd(),n.splice(0,n.length))}renderBatch(n){if(0===this._drapedRenderBatches.length)return n+1;this.renderingToTexture=!0;const o=this.painter,h=this.painter.context,d=this.proxySourceCache,m=this.proxiedCoords[d.id],y=this._drapedRenderBatches.shift(),v=[],b=o.style.order;let C=0;for(const E of m){const I=d.getTileByID(E.proxyTileKey),L=d.proxyCachedFBO[E.key]?d.proxyCachedFBO[E.key][n]:void 0,B=void 0!==L?d.renderCache[L]:this.pool[C++],V=void 0!==L;if(I.texture=B.tex,V&&!B.dirty){v.push(I.tileID);continue}let N;h.bindFramebuffer.set(B.fb.framebuffer),this.renderedToTile=!1,B.dirty&&(h.clear({color:s.Color.transparent,stencil:0}),B.dirty=!1);for(let U=y.start;U<=y.end;++U){const D=o.style._layers[b[U]];if(D.isHidden(o.transform.zoom))continue;const F=o.style._getLayerSourceCache(D),$=F?this.proxyToSource[E.key][F.id]:[E];if(!$)continue;const W=$;h.viewport.set([0,0,B.fb.width,B.fb.height]),N!==(F?F.id:null)&&(this._setupStencil(B,$,D,F),N=F?F.id:null),o.renderLayer(o,F,D,W)}this.renderedToTile?(B.dirty=!0,v.push(I.tileID)):V||--C,5===C&&(C=0,this.renderToBackBuffer(v))}return this.renderToBackBuffer(v),this.renderingToTexture=!1,h.bindFramebuffer.set(null),h.viewport.set([0,0,o.width,o.height]),y.end+1}postRender(){}renderCacheEfficiency(n){const o=n.order.length;
1if(0===o)return{efficiency:100};let h,d=0,m=0,y=!1;for(let v=0;v<o;++v){const b=n._layers[n.order[v]];this._style.isLayerDraped(b)?(y&&++d,++m):y||(y=!0,h=b.id)}return 0===m?{efficiency:100}:{efficiency:100*(1-d/m),firstUndrapedLayer:h}}getMinElevationBelowMSL(){let n=0;return this._visibleDemTiles.filter(o=>o.dem).forEach(o=>{n=Math.min(n,o.dem.tree.minimums[0])}),0===n?n:(n-30)*this._exaggeration}raycast(n,o,h){if(!this._visibleDemTiles)return null;const d=this._visibleDemTiles.filter(m=>m.dem).map(m=>{const y=m.tileID,v=1<<y.overscaledZ,{x:b,y:C}=y.canonical,E=b/v,I=(b+1)/v,L=C/v,B=(C+1)/v;return{minx:E,miny:L,maxx:I,maxy:B,t:m.dem.tree.raycastRoot(E,L,I,B,n,o,h),tile:m}});d.sort((m,y)=>(null!==m.t?m.t:Number.MAX_VALUE)-(null!==y.t?y.t:Number.MAX_VALUE));for(const m of d){if(null==m.t)return null;const y=m.tile.dem.tree.raycast(m.minx,m.miny,m.maxx,m.maxy,n,o,h);if(null!=y)return y}return null}_createFBO(){const n=this.painter.context,o=n.gl,h=this.drapeBufferSize;n.activeTexture.set(o.TEXTURE0);const d=new s.Texture(n,{width:h[0],height:h[1],data:null},o.RGBA);d.bind(o.LINEAR,o.CLAMP_TO_EDGE);const m=n.createFramebuffer(h[0],h[1],!1);return m.colorAttachment.set(d.texture),m.depthAttachment=new re(n,m.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=n.createRenderbuffer(n.gl.DEPTH_STENCIL,h[0],h[1]),this._stencilRef=0,m.depthAttachment.set(this._sharedDepthStencil),n.clear({stencil:0})):m.depthAttachment.set(this._sharedDepthStencil),n.extTextureFilterAnisotropic&&!n.extTextureFilterAnisotropicForceOff&&o.texParameterf(o.TEXTURE_2D,n.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,n.extTextureFilterAnisotropicMax),{fb:m,tex:d,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._style.light&&this._style.light.hasTransition())return!0;for(const n in this._style._sourceCaches)if(this._style._sourceCaches[n].hasTransition())return!0;return this._style.order.some(n=>{const o=this._style._layers[n],h=o.isHidden(this.painter.transform.zoom);return"custom"===o.type?!h&&o.shouldRedrape():!h&&o.hasTransition()})}_clearLineLayersFromRenderCache(){let n=!1;for(const h of this._style._getSources())if(h instanceof Ne){n=!0;break}if(!n)return;const o={};for(let h=0;h<this._style.order.length;++h){const d=this._style._layers[this._style.order[h]],m=this._style._getLayerSourceCache(d);if(m&&!o[m.id]&&!d.isHidden(this.painter.transform.zoom)&&"line"===d.type&&d.widthExpression()instanceof s.ZoomDependentExpression){o[m.id]=!0;for(const y of this.proxyCoords){const v=this.proxyToSource[y.key][m.id];if(v)for(const b of v)this._clearRenderCacheForTile(m.id,b)}}}}_clearRasterLayersFromRenderCache(){let n=!1;for(const h in this._style._sourceCaches)if(this._style._sourceCaches[h]._source instanceof Le){n=!0;break}if(!n)return;const o={};for(let h=0;h<this._style.order.length;++h){const d=this._style._layers[this._style.order[h]],m=this._style._getLayerSourceCache(d);if(!m||o[m.id]||d.isHidden(this.painter.transform.zoom)||"raster"!==d.type)continue;const y=d.paint.get("raster-fade-duration");for(const v of this.proxyCoords){const b=this.proxyToSource[v.key][m.id];if(b)for(const C of b){const E=ka(m.getTile(C),m.findLoadedParent(C,0),m,this.painter.transform,y);(1!==E.opacity||0!==E.mix)&&this._clearRenderCacheForTile(m.id,C)}}}}_setupDrapedRenderBatches(){const n=this._style.order,o=n.length;if(0===o)return;const h=[];let d,m=0,y=this._style._layers[n[m]];for(;!this._style.isLayerDraped(y)&&y.isHidden(this.painter.transform.zoom)&&++m<o;)y=this._style._layers[n[m]];for(;m<o;++m){const v=this._style._layers[n[m]];v.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(v)?void 0===d&&(d=m):void 0!==d&&(h.push({start:d,end:m-1}),d=void 0))}void 0!==d&&h.push({start:d,end:m-1}),this._drapedRenderBatches=h}_setupRenderCache(n){const o=this.proxySourceCache;if(this._shouldDisableRenderCache()||this._invalidateRenderCache){if(this._invalidateRenderCache=!1,o.renderCache.length>o.renderCachePool.length){const y=Object.values(o.proxyCachedFBO);o.proxyCachedFBO={};for(let v=0;v<y.length;++v){const b=Object.values(y[v]);o.renderCachePool.push(...b)}}return}this._clearRasterLayersFromRenderCache();const h=this.proxyCoords,d=this._tilesDirty;for(let y=h.length-1;y>=0;y--){const v=h[y];if(o.getTileByID(v.key),void 0!==o.proxyCachedFBO[v.key]){const b=n[v.key],C=this.proxyToSource[v.key];let E=0;for(const I in C){const L=C[I],B=b[I];if(!B||B.length!==L.length||L.some((V,N)=>V!==B[N]||d[I]&&d[I].hasOwnProperty(V.key))){E=-1;break}++E}for(const I in o.proxyCachedFBO[v.key])o.renderCache[o.proxyCachedFBO[v.key][I]].dirty=E<0||E!==Object.values(b).length}}const m=[...this._drapedRenderBatches];m.sort((y,v)=>v.end-v.start-(y.end-y.start));for(const y of m)for(const v of h){if(o.proxyCachedFBO[v.key])continue;let b=o.renderCachePool.pop();void 0===b&&o.renderCache.length<50&&(b=o.renderCache.length,o.renderCache.push(this._createFBO())),void 0!==b&&(o.proxyCachedFBO[v.key]={},o.proxyCachedFBO[v.key][y.start]=b,o.renderCache[b].dirty=!0)}this._tilesDirty={}}_setupStencil(n,o,h,d){if(!d||!this._sourceTilesOverlap[d.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const m=this.painter.context,y=m.gl;if(o.length<=1)return void(this._overlapStencilType=!1);let v;if(h.isTileClipped())v=o.length,this._overlapStencilMode.test={func:y.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(o[0].overscaledZ>
vendor: 6,064 bytes, line 1
1o[o.length-1].overscaledZ))return void(this._overlapStencilType=!1);v=1,this._overlapStencilMode.test={func:y.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+v>255&&(m.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=v,this._overlapStencilMode.ref=this._stencilRef,h.isTileClipped()&&this._renderTileClippingMasks(o,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(n){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[n.key]),this._overlapStencilMode):s.StencilMode.disabled}_renderTileClippingMasks(n,o){const h=this.painter,d=this.painter.context,m=d.gl;h._tileClippingMaskIDs={},d.setColorMode(s.ColorMode.disabled),d.setDepthMode(s.DepthMode.disabled);const y=h.useProgram("clippingMask");for(const v of n){const b=h._tileClippingMaskIDs[v.key]=--o;y.draw(d,m.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:m.ALWAYS,mask:0},b,255,m.KEEP,m.KEEP,m.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,Mo(v.projMatrix),"$clipping",h.tileExtentBuffer,h.quadTriangleIndexBuffer,h.tileExtentSegments)}}pointCoordinate(n){const o=this.painter.transform;if(n.x<0||n.x>o.width||n.y<0||n.y>o.height)return null;const h=[n.x,n.y,1,1];s.transformMat4$1(h,h,o.pixelMatrixInverse),s.scale$1(h,h,1/h[3]),h[0]/=o.worldSize,h[1]/=o.worldSize;const d=o._camera.position,m=s.mercatorZfromAltitude(1,o.center.lat),y=[d[0],d[1],d[2]/m,0],v=s.subtract([],h.slice(0,3),y);s.normalize(v,v);const b=this.raycast(y,v,this._exaggeration);return null!==b&&b?(s.scaleAndAdd(y,y,v,b),y[3]=y[2],y[2]*=m,y):null}drawDepth(){const n=this.painter,o=n.context,h=this.proxySourceCache,d=Math.ceil(n.width),m=Math.ceil(n.height);if(!this._depthFBO||this._depthFBO.width===d&&this._depthFBO.height===m||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const y=o.gl,v=o.createFramebuffer(d,m,!0);o.activeTexture.set(y.TEXTURE0);const b=new s.Texture(o,{width:d,height:m,data:null},y.RGBA);b.bind(y.NEAREST,y.CLAMP_TO_EDGE),v.colorAttachment.set(b.texture);const C=o.createRenderbuffer(o.gl.DEPTH_COMPONENT16,d,m);v.depthAttachment.set(C),this._depthFBO=v,this._depthTexture=b}o.bindFramebuffer.set(this._depthFBO.framebuffer),o.viewport.set([0,0,d,m]),function(y,v,b,C){if("globe"===y.transform.projection.name)return;const E=y.context,I=E.gl;E.clear({depth:1});const L=y.useProgram("terrainDepth"),B=new s.DepthMode(I.LESS,s.DepthMode.ReadWrite,y.depthRangeFor3D);for(const V of C){const N=b.getTile(V),U=xo(V.projMatrix,0);v.setupElevationDraw(N,L),L.draw(E,I.TRIANGLES,B,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.backCCW,U,"terrain_depth",v.gridBuffer,v.gridIndexBuffer,v.gridNoSkirtSegments)}}(n,this,h,this.proxyCoords)}_setupProxiedCoordsForOrtho(n,o,h){if(n.getSource()instanceof mt)return this._setupProxiedCoordsForImageSource(n,o,h);this._findCoveringTileCache[n.id]=this._findCoveringTileCache[n.id]||{};const d=this.proxiedCoords[n.id]=[],m=this.proxyCoords;for(let v=0;v<m.length;v++){const b=m[v],C=this._findTileCoveringTileID(b,n);if(C){const E=this._createProxiedId(b,C,h[b.key]&&h[b.key][n.id]);d.push(E),this.proxyToSource[b.key][n.id]=[E]}}let y=!1;for(let v=0;v<o.length;v++){const b=n.getTile(o[v]);if(!b||!b.hasData())continue;const C=this._findTileCoveringTileID(b.tileID,this.proxySourceCache);if(C&&C.tileID.canonical.z!==b.tileID.canonical.z){const E=this.proxyToSource[C.tileID.key][n.id],I=this._createProxiedId(C.tileID,b,h[C.tileID.key]&&h[C.tileID.key][n.id]);E?E.splice(E.length-1,0,I):this.proxyToSource[C.tileID.key][n.id]=[I],d.push(I),y=!0}}this._sourceTilesOverlap[n.id]=y}_setupProxiedCoordsForImageSource(n,o,h){if(!n.getSource().loaded())return;const d=this.proxiedCoords[n.id]=[],m=this.proxyCoords,y=n.getSource(),v=new s.Point(y.tileID.x,y.tileID.y)._div(1<<y.tileID.z),b=y.coordinates.map(s.MercatorCoordinate.fromLngLat).reduce((E,I)=>(E.min.x=Math.min(E.min.x,I.x-v.x),E.min.y=Math.min(E.min.y,I.y-v.y),E.max.x=Math.max(E.max.x,I.x-v.x),E.max.y=Math.max(E.max.y,I.y-v.y),E),{min:new s.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new s.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),C=(E,I)=>{const L=E.wrap+E.canonical.x/(1<<E.canonical.z),B=E.canonical.y/(1<<E.canonical.z),V=s.EXTENT/(1<<E.canonical.z),N=I.wrap+I.canonical.x/(1<<I.canonical.z),U=I.canonical.y/(1<<I.canonical.z);return L+V<N+b.min.x||L>N+b.max.x||B+V<U+b.min.y||B>U+b.max.y};for(let E=0;E<m.length;E++){const I=m[E];for(let L=0;L<o.length;L++){const B=n.getTile(o[L]);if(!B||!B.hasData()||C(I,B.tileID))continue;const V=this._createProxiedId(I,B,h[I.key]&&h[I.key][n.id]),N=this.proxyToSource[I.key][n.id];N?N.push(V):this.proxyToSource[I.key][n.id]=[V],d.push(V)}}}_createProxiedId(n,o,h){let d=this.orthoMatrix;if(h){const m=h.find(y=>y.key===o.tileID.key);if(m)return m}if(o.tileID.key!==n.key){const m=n.canonical.z-o.tileID.canonical.z;let y,v,b;d=s.create();const C=o.tileID.wrap-n.wrap<<n.overscaledZ;m>0?(y=s.EXTENT>>m,v=y*((o.tileID.canonical.x<<m)-n.canonical.x+C),b=y*((o.tileID.canonical.y<<m)-n.canonical.y)):(y=s.EXTENT<<-m,v=s.EXTENT*(o.tileID.canonical.x-(n.canonical.x+C<<-m)),b=s.EXTENT*(o.tileID.canonical.y-(n.canonical.y<<-m))),s.ortho(d,0,y,0,y,0,1),s.translate(d,d,[v,b,0])}return new Qo(o.tileID,n.key,d)}_findTileCoveringTileID(n,o){let h=o.getTile(n);if(h&&h.hasData())return h;const d=this._findCoveringTileCache[o.id],m=d[n.key];if(h=m?o.getTileByID(m):null,h&&h.hasData()||null===m)return h;let y=h?h.tileID:n,v=y.overscaledZ;const b=o.getSource().minzoom,C=[];if(!m){const I=o.getSource().maxzoom;if(n.canonical.z>=I){const L=n.canonical.z-I;o.getSource().reparseOverscaled?(v=Math.max(n.canonical.z+2,o.transform.tileZoom),y=new s.OverscaledTileID(v,n.wrap,I,n.canonical.x>>L,n.canonical.y>>L)):0!==L&&(v=I,y=new s.OverscaledTileID(v,n.wrap,I,n.canonical.x>>L,n.canonical.y>>L))}y.key!==n.key&&(C.push(y.key),h=o.getTile(y))}const E=I=>
1{C.forEach(L=>{d[L]=I}),C.length=0};for(v-=1;v>=b&&(!h||!h.hasData());v--){h&&E(h.tileID.key);const I=y.calculateScaledKey(v);if(h=o.getTileByID(I),h&&h.hasData())break;const L=d[I];if(null===L)break;void 0===L?C.push(I):h=o.getTileByID(L)}return E(h?h.tileID.key:null),h&&h.hasData()?h:null}findDEMTileFor(n){return this.enabled?this._findTileCoveringTileID(n,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(n,o){let h=this._tilesDirty[n];h||(h=this._tilesDirty[n]={}),h[o.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const n=function(o){let h=0;const d=new s.StructArrayLayout2ui4,m=131;for(let y=1;y<129;y++){for(let v=1;v<129;v++)h=y*m+v,d.emplaceBack(h,h+1),d.emplaceBack(h,h+m),d.emplaceBack(h+1,h+m),128===y&&d.emplaceBack(h+m,h+m+1);d.emplaceBack(h+1,h+1+m)}return d}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(n),this.wireframeSegments=s.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,n.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class Ct{static cacheKey(n,o,h,d){let m=`${o}${d?d.cacheKey:""}`;for(const y of h)n.usedDefines.includes(y)&&(m+=`/${y}`);return m}constructor(n,o,h,d,m,y){const v=n.gl;this.program=v.createProgram();const b=function(D){const F=[];for(let $=0;$<D.length;$++){if(null===D[$])continue;const W=D[$].split(" ");F.push(W.pop())}return F}(h.staticAttributes),C=d?d.getBinderAttributes():[],E=b.concat(C);let I=d?d.defines():[];I=I.concat(y.map(D=>`#define ${D}`));const L=n.isWebGL2?"#version 300 es\n":"",B=L+I.concat(n.extStandardDerivatives&&0===L.length?"#extension GL_OES_standard_derivatives : enable\n".concat(bs):bs,bs,yo,Tl.fragmentSource,gr.fragmentSource,h.fragmentSource).join("\n"),V=L+I.concat("\n#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif",yo,Tl.vertexSource,gr.vertexSource,fr.vertexSource,h.vertexSource).join("\n"),N=v.createShader(v.FRAGMENT_SHADER);if(v.isContextLost())return void(this.failedToCreate=!0);v.shaderSource(N,B),v.compileShader(N),v.attachShader(this.program,N);const U=v.createShader(v.VERTEX_SHADER);if(v.isContextLost())this.failedToCreate=!0;else{v.shaderSource(U,V),v.compileShader(U),v.attachShader(this.program,U),this.attributes={},this.numAttributes=E.length;for(let D=0;D<this.numAttributes;D++)E[D]&&(v.bindAttribLocation(this.program,D,E[D]),this.attributes[E[D]]=D);v.linkProgram(this.program),v.deleteShader(U),v.deleteShader(N),this.fixedUniforms=m(n),this.binderUniforms=d?d.getUniforms(n):[],y.includes("TERRAIN")&&(this.terrainUniforms={u_dem:new s.Uniform1i(D=n),u_dem_prev:new s.Uniform1i(D),u_dem_unpack:new s.Uniform4f(D),u_dem_tl:new s.Uniform2f(D),u_dem_scale:new s.Uniform1f(D),u_dem_tl_prev:new s.Uniform2f(D),u_dem_scale_prev:new s.Uniform1f(D),u_dem_size:new s.Uniform1f(D),u_dem_lerp:new s.Uniform1f(D),u_exaggeration:new s.Uniform1f(D),u_depth:new s.Uniform1i(D),u_depth_size_inv:new s.Uniform2f(D),u_meter_to_dem:new s.Uniform1f(D),u_label_plane_matrix_inv:new s.UniformMatrix4f(D)}),y.includes("GLOBE")&&(this.globeUniforms=(D=>({u_tile_tl_up:new s.Uniform3f(D),u_tile_tr_up:new s.Uniform3f(D),u_tile_br_up:new s.Uniform3f(D),u_tile_bl_up:new s.Uniform3f(D),u_tile_up_scale:new s.Uniform1f(D)}))(n)),y.includes("FOG")&&(this.fogUniforms=(D=>({u_fog_matrix:new s.UniformMatrix4f(D),u_fog_range:new s.Uniform2f(D),u_fog_color:new s.Uniform4f(D),u_fog_horizon_blend:new s.Uniform1f(D),u_fog_temporal_offset:new s.Uniform1f(D),u_frustum_tl:new s.Uniform3f(D),u_frustum_tr:new s.Uniform3f(D),u_frustum_br:new s.Uniform3f(D),u_frustum_bl:new s.Uniform3f(D),u_globe_pos:new s.Uniform3f(D),u_globe_radius:new s.Uniform1f(D),u_globe_transition:new s.Uniform1f(D),u_is_globe:new s.Uniform1i(D),u_viewport:new s.Uniform2f(D)}))(n))}var D}setTerrainUniformValues(n,o){if(!this.terrainUniforms)return;const h=this.terrainUniforms;if(!this.failedToCreate){n.program.set(this.program);for(const d in o)h[d]&&h[d].set(this.program,d,o[d])}}setGlobeUniformValues(n,o){if(!this.globeUniforms)return;const h=this.globeUniforms;if(!this.failedToCreate){n.program.set(this.program);for(const d in o)h[d]&&h[d].set(this.program,d,o[d])}}setFogUniformValues(n,o){if(!this.fogUniforms)return;const h=this.fogUniforms;if(!this.failedToCreate){n.program.set(this.program);for(const d in o)h[d].set(this.program,d,o[d])}}draw(n,o,h,d,m,y,v,b,C,E,I,L,B,V,N){const U=n.gl;if(this.failedToCreate)return;n.program.set(this.program),n.setDepthMode(h),n.setStencilMode(d),n.setColorMode(m),n.setCullFace(y);for(const F of Object.keys(this.fixedUniforms))this.fixedUniforms[F].set(this.program,F,v[F]);V&&V.setUniforms(this.program,n,this.binderUniforms,L,{zoom:B});const D={[U.LINES]:2,[U.TRIANGLES]:3,[U.LINE_STRIP]:1}[o];for(const F of I.get()){const $=F.vaos||(F.vaos={});($[b]||($[b]=new Sl)).bind(n,this,C,V?V.getPaintVertexBuffers():[],E,F.vertexOffset,
1N||[]),U.drawElements(o,F.primitiveLength*D,U.UNSIGNED_SHORT,F.primitiveOffset*D*2)}}}function ea(l,n){const o=Math.pow(2,n.tileID.overscaledZ),h=n.tileSize*Math.pow(2,l.transform.tileZoom)/o,d=h*(n.tileID.canonical.x+n.tileID.wrap*o),m=h*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_tile_units_to_pixels:1/bi(n,1,l.transform.tileZoom),u_pixel_coord_upper:[d>>16,m>>16],u_pixel_coord_lower:[65535&d,65535&m]}}const Il=s.create(),Is=(l,n,o,h,d,m,y,v,b,C,E)=>{const I=n.style.light,L=I.properties.get("position"),B=[L.x,L.y,L.z],V=s.create$1();"viewport"===I.properties.get("anchor")&&(s.fromRotation(V,-n.transform.angle),s.transformMat3(B,B,V));const N=I.properties.get("color"),U=n.transform,D={u_matrix:l,u_lightpos:B,u_lightintensity:I.properties.get("intensity"),u_lightcolor:[N.r,N.g,N.b],u_vertical_gradient:+o,u_opacity:h,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Il,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:d,u_edge_radius:m};return"globe"===U.projection.name&&(D.u_tile_id=[y.canonical.x,y.canonical.y,1<<y.canonical.z],D.u_zoom_transition=b,D.u_inv_rot_matrix=E,D.u_merc_center=C,D.u_up_dir=U.projection.upVector(new s.CanonicalTileID(0,0,0),C[0]*s.EXTENT,C[1]*s.EXTENT),D.u_height_lift=v),D},Dl=(l,n,o,h,d,m,y,v,b,C,E,I)=>{const L=Is(l,n,o,h,d,m,y,b,C,E,I),B={u_height_factor:-Math.pow(2,y.overscaledZ)/v.tileSize/8};return s.extend(L,ea(n,v),B)},Wr=l=>({u_matrix:l}),Ds=(l,n,o)=>s.extend(Wr(l),ea(n,o)),Pc=(l,n)=>({u_matrix:l,u_world:n}),Lc=(l,n,o,h)=>s.extend(Ds(l,n,o),{u_world:h}),Rc=s.create(),ks=(l,n,o,h,d,m)=>{const y=l.transform,v="globe"===y.projection.name;let b;if("map"===m.paint.get("circle-pitch-alignment"))if(v){const E=s.globePixelsToTileUnits(y.zoom,n.canonical)*y._pixelsPerMercatorPixel;b=Float32Array.from([E,0,0,E])}else b=y.calculatePixelsToTileUnitsMatrix(o);else b=new Float32Array([y.pixelsToGLUnits[0],0,0,y.pixelsToGLUnits[1]]);const C={u_camera_to_center_distance:y.cameraToCenterDistance,u_matrix:l.translatePosMatrix(n.projMatrix,o,m.paint.get("circle-translate"),m.paint.get("circle-translate-anchor")),u_device_pixel_ratio:s.exported.devicePixelRatio,u_extrude_scale:b,u_inv_rot_matrix:Rc,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(v){C.u_inv_rot_matrix=h,C.u_merc_center=d,C.u_tile_id=[n.canonical.x,n.canonical.y,1<<n.canonical.z],C.u_zoom_transition=s.globeToMercatorTransition(y.zoom);const E=d[0]*s.EXTENT,I=d[1]*s.EXTENT;C.u_up_dir=y.projection.upVector(new s.CanonicalTileID(0,0,0),E,I)}return C},zs=l=>{const n=[];return"map"===l.paint.get("circle-pitch-alignment")&&n.push("PITCH_WITH_MAP"),"map"===l.paint.get("circle-pitch-scale")&&n.push("SCALE_WITH_MAP"),n},Ps=(l,n,o,h)=>{const d=s.EXTENT/o.tileSize;return{u_matrix:l,u_camera_to_center_distance:n.getCameraToCenterDistance(h),u_extrude_scale:[n.pixelsToGLUnits[0]/d,n.pixelsToGLUnits[1]/d]}},Pa=(l,n,o=1)=>({u_matrix:l,u_color:n,u_overlay:0,u_overlay_scale:o}),kl=s.create(),zl=(l,n,o,h,d,m,y)=>{const v=l.transform,b="globe"===v.projection.name,C=b?s.globePixelsToTileUnits(v.zoom,n.canonical)*v._pixelsPerMercatorPixel:bi(o,1,m),E={u_matrix:n.projMatrix,u_extrude_scale:C,u_intensity:y,u_inv_rot_matrix:kl,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(b){E.u_inv_rot_matrix=h,E.u_merc_center=d,E.u_tile_id=[n.canonical.x,n.canonical.y,1<<n.canonical.z],E.u_zoom_transition=s.globeToMercatorTransition(v.zoom);const I=d[0]*s.EXTENT,L=d[1]*s.EXTENT;E.u_up_dir=v.projection.upVector(new s.CanonicalTileID(0,0,0),I,L)}return E},Oc=(l,n,o,h,d,m,y)=>{const v=l.transform,b=v.calculatePixelsToTileUnitsMatrix(n);return{u_matrix:Ls(l,n,o,h),u_pixels_to_tile_units:b,u_device_pixel_ratio:m,u_units_to_pixels:[1/v.pixelsToGLUnits[0],1/v.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:d,u_texsize:ia(o)?n.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Eo(n,l.transform),u_alpha_discard_threshold:0,u_trim_offset:y}},ta=(l,n,o,h,d)=>{const m=l.transform;return{u_matrix:Ls(l,n,o,h),u_texsize:n.imageAtlasTexture.size,u_pixels_to_tile_units:m.calculatePixelsToTileUnitsMatrix(n),u_device_pixel_ratio:d,u_image:0,u_tile_units_to_pixels:Eo(n,m),u_units_to_pixels:[1/m.pixelsToGLUnits[0],1/m.pixelsToGLUnits[1]],u_alph
vendor: 12,677 bytes, line 1
1a_discard_threshold:0}};function Eo(l,n){return 1/bi(l,1,n.tileZoom)}function Ls(l,n,o,h){return l.translatePosMatrix(h||n.tileID.projMatrix,n,o.paint.get("line-translate"),o.paint.get("line-translate-anchor"))}function ia(l){const n=l.paint.get("line-dasharray").value;return n.value||"constant"!==n.kind}const Rs=(l,n,o,h,d,m)=>{return{u_matrix:l,u_tl_parent:n,u_scale_parent:o,u_fade_t:h.mix,u_opacity:h.opacity*d.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:d.paint.get("raster-brightness-min"),u_brightness_high:d.paint.get("raster-brightness-max"),u_saturation_factor:(v=d.paint.get("raster-saturation"),v>0?1-1/(1.001-v):-v),u_contrast_factor:(y=d.paint.get("raster-contrast"),y>0?1/(1-y):1+y),u_spin_weights:Fn(d.paint.get("raster-hue-rotate")),u_perspective_transform:m};var y,v};function Fn(l){l*=Math.PI/180;const n=Math.sin(l),o=Math.cos(l);return[(2*o+1)/3,(-Math.sqrt(3)*n-o+1)/3,(Math.sqrt(3)*n-o+1)/3]}const La=s.create(),Os=(l,n,o,h,d,m,y,v,b,C,E,I,L,B,V,N)=>{const U=d.transform,D={u_is_size_zoom_constant:+("constant"===l||"source"===l),u_is_size_feature_constant:+("constant"===l||"camera"===l),u_size_t:n?n.uSizeT:0,u_size:n?n.uSize:0,u_camera_to_center_distance:U.cameraToCenterDistance,u_rotate_symbol:+o,u_aspect_ratio:U.width/U.height,u_fade_change:d.options.fadeDuration?d.symbolFadeChange:1,u_matrix:m,u_label_plane_matrix:y,u_coord_matrix:v,u_is_text:+b,u_pitch_with_map:+h,u_texsize:C,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:La,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:La,u_up_vector:[0,-1,0]};return"globe"===N.name&&(D.u_tile_id=[E.canonical.x,E.canonical.y,1<<E.canonical.z],D.u_zoom_transition=I,D.u_inv_rot_matrix=B,D.u_merc_center=L,D.u_camera_forward=U._camera.forward(),D.u_ecef_origin=s.globeECEFOrigin(U.globeMatrix,E.toUnwrapped()),D.u_tile_matrix=Float32Array.from(U.globeMatrix),D.u_up_vector=V),D},Ra=(l,n,o,h,d,m,y,v,b,C,E,I,L,B,V,N,U)=>s.extend(Os(l,n,o,h,d,m,y,v,b,C,I,L,B,V,N,U),{u_gamma_scale:h?d.transform.cameraToCenterDistance*Math.cos(d.terrain?0:d.transform._pitch):1,u_device_pixel_ratio:s.exported.devicePixelRatio,u_is_halo:+E}),Fs=(l,n,o,h,d,m,y,v,b,C,E,I,L,B,V,N)=>s.extend(Ra(l,n,o,h,d,m,y,v,!0,b,!0,E,I,L,B,V,N),{u_texsize_icon:C,u_texture_icon:1}),Oa=(l,n,o)=>({u_matrix:l,u_opacity:n,u_color:o}),Pl=(l,n,o,h,d)=>s.extend(function(m,y,v){const b=y.imageManager.getPattern(m.toString()),{width:C,height:E}=y.imageManager.getPixelSize(),I=Math.pow(2,v.tileID.overscaledZ),L=v.tileSize*Math.pow(2,y.transform.tileZoom)/I,B=L*(v.tileID.canonical.x+v.tileID.wrap*I),V=L*v.tileID.canonical.y;return{u_image:0,u_pattern_tl:b.tl,u_pattern_br:b.br,u_texsize:[C,E],u_pattern_size:b.displaySize,u_tile_units_to_pixels:1/bi(v,1,y.transform.tileZoom),u_pixel_coord_upper:[B>>16,V>>16],u_pixel_coord_lower:[65535&B,65535&V]}}(h,o,d),{u_matrix:l,u_opacity:n}),Fa={fillExtrusion:l=>({u_matrix:new s.UniformMatrix4f(l),u_lightpos:new s.Uniform3f(l),u_lightintensity:new s.Uniform1f(l),u_lightcolor:new s.Uniform3f(l),u_vertical_gradient:new s.Uniform1f(l),u_opacity:new s.Uniform1f(l),u_edge_radius:new s.Uniform1f(l),u_ao:new s.Uniform2f(l),u_tile_id:new s.Uniform3f(l),u_zoom_transition:new s.Uniform1f(l),u_inv_rot_matrix:new s.UniformMatrix4f(l),u_merc_center:new s.Uniform2f(l),u_up_dir:new s.Uniform3f(l),u_height_lift:new s.Uniform1f(l)}),fillExtrusionPattern:l=>({u_matrix:new s.UniformMatrix4f(l),u_lightpos:new s.Uniform3f(l),u_lightintensity:new s.Uniform1f(l),u_lightcolor:new s.Uniform3f(l),u_vertical_gradient:new s.Uniform1f(l),u_height_factor:new s.Uniform1f(l),u_edge_radius:new s.Uniform1f(l),u_ao:new s.Uniform2f(l),u_tile_id:new s.Uniform3f(l),u_zoom_transition:new s.Uniform1f(l),u_inv_rot_matrix:new s.UniformMatrix4f(l),u_merc_center:new s.Uniform2f(l),u_up_dir:new s.Uniform3f(l),u_height_lift:new s.Uniform1f(l),u_image:new s.Uniform1i(l),u_texsize:new s.Uniform2f(l),u_pixel_coord_upper:new s.Uniform2f(l),u_pixel_coord_lower:new s.Uniform2f(l),u_tile_units_to_pixels:new s.Uniform1f(l),u_opacity:new s.Uniform1f(l)}),fill:l=>({u_matrix:new s.UniformMatrix4f(l)}),fillPattern:l=>({u_matrix:new s.UniformMatrix4f(l),u_image:new s.Uniform1i(l),u_texsize:new s.Uniform2f(l),u_pixel_coord_upper:new s.Uniform2f(l),u_pixel_coord_lower:new s.Uniform2f(l),u_tile_units_to_pixels:new s.Uniform1f(l)}),fillOutline:l=>({u_matrix:new s.UniformMatrix4f(l),u_world:new s.Uniform2f(l)}),fillOutlinePattern:l=>({u_matrix:new s.UniformMatrix4f(l),u_world:new s.Uniform2f(l),u_image:new s.Uniform1i(l),u_texsize:new s.Uniform2f(l),u_pixel_coord_upper:new s.Uniform2f(l),u_pixel_coord_lower:new s.Uniform2f(l),u_tile_units_to_pixels:new s.Uniform1f(l)}),circle:l=>({u_camera_to_center_distance:new s.Uniform1f(l),u_extrude_scale:new s.UniformMatrix2f(l),u_device_pixel_ratio:new s.Uniform1f(l),u_matrix:new s.UniformMatrix4f(l),u_inv_rot_matrix:new s.UniformMatrix4f(l),u_merc_center:new s.Uniform2f(l),u_tile_id:new s.Uniform3f(l),u_zoom_transition:new s.Uniform1f(l),u_up_dir:new s.Uniform3f(l)}),collisionBox:l=>({u_matrix:new s.UniformMatrix4f(l),u_camera_to_center_distance:new s.Uniform1f(l),u_extrude_scale:new s.Uniform2f(l)}),collisionCircle:l=>({u_matrix:new s.UniformMatrix4f(l),u_inv_matrix:new s.UniformMatrix4f(l),u_camera_to_center_distance:new s.Uniform1f(l),u_viewport_size:new s.Uniform2f(l)}),debug:l=>({u_color:new s.UniformColor(l),u_matrix:new s.UniformMatrix4f(l),u_overlay:new s.Uniform1i(l),u_overlay_scale:new s.Uniform1f(l)}),clippingMask:l=>({u_matrix:new s.UniformMatrix4f(l)}),heatmap:l=>({u_extrude_scale:new s.Uniform1f(l),u_intensity:new s.Uniform1f(l),u_matrix:new s.UniformMatrix4f(l),u_inv_rot_matrix:new s.UniformMatrix4f(l),u_merc_center:new s.Uniform2f(l),u_tile_id:new s.Uniform3f(l),u_zoom_transition:new s.Uniform1f(l),u_up_dir:new s.Uniform3f(l)}),heatmapTexture:l=>({u_image:new s.Uniform1i(l),u_color_ramp:new s.Uniform1i(l),u_opacity:new s.Uniform1f(l)}),hillshade:l=>({u_matrix:new s.UniformMatrix4f(l),u_image:new s.Uniform1i(l),u_latrange:new s.Uniform2f(l),u_light:new s.Uniform2f(l),u_shadow:new s.UniformColor(l),u_highlight:new s.UniformColor(l),u_accent:new s.UniformColor(l)}),hillshadePrepare:l=>({u_matrix:new s.UniformMatrix4f(l),u_image:new s.Uniform1i(l),u_dimension:new s.Uniform2f(l),u_zoom:new s.Uniform1f(l),u_unpack:new s.Uniform4f(l)}),line:l=>({u_matrix:new s.UniformMatrix4f(l),u_pixels_to_tile_units:new s.UniformMatrix2f(l),u_device_pixel_ratio:new s.Uniform1f(l),u_units_to_pixels:new s.Uniform2f(l),u_dash_image:new s.Uniform1i(l),u_gradient_image:new s.Uniform1i(l),u_image_height:new s.Uniform1f(l),u_texsize:new s.Uniform2f(l),u_tile_units_to_pixels:new s.Uniform1f(l),u_alpha_discard_threshold:new s.Uniform1f(l),u_trim_offset:new s.Uniform2f(l)}),linePattern:l=>({u_matrix:new s.UniformMatrix4f(l),u_texsize:new s.Uniform2f(l),u_pixels_to_tile_units:new s.UniformMatrix2f(l),u_device_pixel_ratio:new s.Uniform1f(l),u_image:new s.Uniform1i(l),u_units_to_pixels:new s.Uniform2f(l),u_tile_units_to_pixels:new s.Uniform1f(l),u_alpha_discard_threshold:new s.Uniform1f(l)}),raster:l=>({u_matrix:new s.UniformMatrix4f(l),u_tl_parent:new s.Uniform2f(l),u_scale_parent:new s.Uniform1f(l),u_fade_t:new s.Uniform1f(l),u_opacity:new s.Uniform1f(l),u_image0:new s.Uniform1i(l),u_image1:new s.Uniform1i(l),u_brightness_low:new s.Uniform1f(l),u_brightness_high:new s.Uniform1f(l),u_saturation_factor:new s.Uniform1f(l),u_contrast_factor:new s.Uniform1f(l),u_spin_weights:new s.Uniform3f(l),u_perspective_transform:new s.Uniform2f(l)}),symbolIcon:l=>({u_is_size_zoom_constant:new s.Uniform1i(l),u_is_size_feature_constant:new s.Uniform1i(l),u_size_t:new s.Uniform1f(l),u_size:new s.Uniform1f(l),u_camera_to_center_distance:new s.Uniform1f(l),u_rotate_symbol:new s.Uniform1i(l),u_aspect_ratio:new s.Uniform1f(l),u_fade_change:new s.Uniform1f(l),u_matrix:new s.UniformMatrix4f(l),u_label_plane_matrix:new s.UniformMatrix4f(l),u_coord_matrix:new s.UniformMatrix4f(l),u_is_text:new s.Uniform1i(l),u_pitch_with_map:new s.Uniform1i(l),u_texsize:new s.Uniform2f(l),u_tile_id:new s.Uniform3f(l),u_zoom_transition:new s.Uniform1f(l),u_inv_rot_matrix:new s.UniformMatrix4f(l),u_merc_center:new s.Uniform2f(l),u_camera_forward:new s.Uniform3f(l),u_tile_matrix:new s.UniformMatrix4f(l),u_up_vector:new s.Uniform3f(l),u_ecef_origin:new s.Uniform3f(l),u_texture:new s.Uniform1i(l)}),symbolSDF:l=>({u_is_size_zoom_constant:new s.Uniform1i(l),u_is_size_feature_constant:new s.Uniform1i(l),u_size_t:new s.Uniform1f(l),u_size:new s.Uniform1f(l),u_camera_to_center_distance:new s.Uniform1f(l),u_rotate_symbol:new s.Uniform1i(l),u_aspect_ratio:new s.Uniform1f(l),u_fade_change:new s.Uniform1f(l),u_matrix:new s.UniformMatrix4f(l),u_label_plane_matrix:new s.UniformMatrix4f(l),u_coord_matrix:new s.UniformMatrix4f(l),u_is_text:new s.Uniform1i(l),u_pitch_with_map:new s.Uniform1i(l),u_texsize:new s.Uniform2f(l),u_texture:new s.Uniform1i(l),u_gamma_scale:new s.Uniform1f(l),u_device_pixel_ratio:new s.Uniform1f(l),u_tile_id:new s.Uniform3f(l),u_zoom_transition:new s.Uniform1f(l),u_inv_rot_matrix:new s.UniformMatrix4f(l),u_merc_center:new s.Uniform2f(l),u_camera_forward:new s.Uniform3f(l),u_tile_matrix:new s.UniformMatrix4f(l),u_up_vector:new s.Uniform3f(l),u_ecef_origin:new s.Uniform3f(l),u_is_halo:new s.Uniform1i(l)}),symbolTextAndIcon:l=>({u_is_size_zoom_constant:new s.Uniform1i(l),u_is_size_feature_constant:new s.Uniform1i(l),u_size_t:new s.Uniform1f(l),u_size:new s.Uniform1f(l),u_camera_to_center_distance:new s.Uniform1f(l),u_rotate_symbol:new s.Uniform1i(l),u_aspect_ratio:new s.Uniform1f(l),u_fade_change:new s.Uniform1f(l),u_matrix:new s.UniformMatrix4f(l),u_label_plane_matrix:new s.UniformMatrix4f(l),u_coord_matrix:new s.UniformMatrix4f(l),u_is_text:new s.Uniform1i(l),u_pitch_with_map:new s.Uniform1i(l),u_texsize:new s.Uniform2f(l),u_texsize_icon:new s.Uniform2f(l),u_texture:new s.Uniform1i(l),u_texture_icon:new s.Uniform1i(l),u_gamma_scale:new s.Uniform1f(l),u_device_pixel_ratio:new s.Uniform1f(l),u_is_halo:new s.Uniform1i(l)}),background:l=>({u_matrix:new s.UniformMatrix4f(l),u_opacity:new s.Uniform1f(l),u_color:new s.UniformColor(l)}),backgroundPattern:l=>({u_matrix:new s.UniformMatrix4f(l),u_opacity:new s.Uniform1f(l),u_image:new s.Uniform1i(l),u_pattern_tl:new s.Uniform2f(l),u_pattern_br:new s.Uniform2f(l),u_texsize:new s.Uniform2f(l),u_pattern_size:new s.Uniform2f(l),u_pixel_coord_upper:new s.Uniform2f(l),u_pixel_coord_lower:new s.Uniform2f(l),u_tile_units_to_pixels:new s.Uniform1f(l)}),terrainRaster:Cs,terrainDepth:Cs,skybox:l=>({u_matrix:new s.UniformMatrix4f(l),u_sun_direction:new s.Uniform3f(l),u_cubemap:new s.Uniform1i(l),u_opacity:new s.Uniform1f(l),u_temporal_offset:new s.Uniform1f(l)}),skyboxGradient:l=>({u_matrix:new s.UniformMatrix4f(l),u_color_ramp:new s.Uniform1i(l),u_center_direction:new s.Uniform3f(l),u_radius:new s.Uniform1f(l),u_opacity:new s.Uniform1f(l),u_temporal_offset:new s.Uniform1f(l)}),skyboxCapture:l=>({u_matrix_3f:new s.UniformMatrix3f(l),u_sun_direction:new s.Uniform3f(l),u_sun_intensity:new s.Uniform1f(l),u_color_tint_r:new s.Uniform4f(l),u_color_tint_m:new s.Uniform4f(l),u_luminance:new s.Uniform1f(l)}),globeRaster:l=>({u_proj_matrix:new s.UniformMatrix4f(l),u_globe_matrix:new s.UniformMatrix4f(l),u_normalize_matrix:new s.UniformMatrix4f(l),u_merc_matrix:new s.UniformMatrix4f(l),u_zoom_transition:new s.Uniform1f(l),u_merc_center:new s.Uniform2f(l),u_image0:new s.Uniform1i(l),u_grid_matrix:new s.UniformMatrix3f(l),u_skirt_height:new s.Uniform1f(l),u_frustum_tl:new s.Uniform3f(l),u_frustum_tr:new s.Uniform3f(l),u_frustum_br:new s.Uniform3f(l),u_frustum_bl:new s.Uniform3f(l),u_globe_pos:new s.Uniform3f(l),u_globe_radius:new s.Uniform1f(l),u_viewport:new s.Uniform2f(l)}),globeAtmosphere:l=>({u_frustum_tl:new s.Uniform3f(l),u_frustum_tr:new s.Uniform3f(l),u_frustum_br:new s.Uniform3f(l),u_frustum_bl:new s.Uniform3f(l),u_horizon:new s.Uniform1f(l),u_transition:new s.Uniform1f(l),u_fadeout_range:new s.Uniform1f(l),u_color:new s.Uniform4f(l),u_high_color:new s.Uniform4f(l),u_space_color:new s.Uniform4f(l),u_star_intensity:new s.Uniform1f(l),u_star_density:new s.Uniform1f(l),u_star_size:new s.Uniform1f(l),u_temporal_offset:new s.Uniform1f(l),u_horizon_angle:new s.Uniform1f(l),u_rotation_matrix:new s.UniformMatrix4f(l)})};let na;function O(l,n,o,h,d,m,y){const v=l.context,b=v.gl,C=l.transform,E=l.useProgram("collisionBox"),I=[];let L=0,B=0;for(let W=0;W<h.length;W++){const te=h[W],ne=n.getTile(te),ie=ne.getBucket(o);if(!ie)continue;const se=nn(te,ie,C);let ae=se;0===d[0]&&0===d[1]||(ae=l.translatePosMatrix(se,ne,d,m));const me=y?ie.textCollisionBox:ie.iconCollisionBox,ke=ie.collisionCircleArray;
1if(ke.length>0){const he=s.create(),Ee=ae;s.mul(he,ie.placementInvProjMatrix,C.glCoordMatrix),s.mul(he,he,ie.placementViewportMatrix),I.push({circleArray:ke,circleOffset:B,transform:Ee,invTransform:he,projection:ie.getProjection()}),L+=ke.length/4,B=L}me&&(l.terrain&&l.terrain.setupElevationDraw(ne,E),E.draw(v,b.LINES,s.DepthMode.disabled,s.StencilMode.disabled,l.colorModeForRenderPass(),s.CullFaceMode.disabled,Ps(ae,C,ne,ie.getProjection()),o.id,me.layoutVertexBuffer,me.indexBuffer,me.segments,null,C.zoom,null,[me.collisionVertexBuffer,me.collisionVertexBufferExt]))}if(!y||!I.length)return;const V=l.useProgram("collisionCircle"),N=new s.StructArrayLayout2f1f2i16;N.resize(4*L),N._trim();let U=0;for(const W of I)for(let te=0;te<W.circleArray.length/4;te++){const ne=4*te,ie=W.circleArray[ne+0],se=W.circleArray[ne+1],ae=W.circleArray[ne+2],me=W.circleArray[ne+3];N.emplace(U++,ie,se,ae,me,0),N.emplace(U++,ie,se,ae,me,1),N.emplace(U++,ie,se,ae,me,2),N.emplace(U++,ie,se,ae,me,3)}(!na||na.length<2*L)&&(na=function(W){const te=2*W,ne=new s.StructArrayLayout3ui6;ne.resize(te),ne._trim();for(let ie=0;ie<te;ie++){const se=6*ie;ne.uint16[se+0]=4*ie+0,ne.uint16[se+1]=4*ie+1,ne.uint16[se+2]=4*ie+2,ne.uint16[se+3]=4*ie+2,ne.uint16[se+4]=4*ie+3,ne.uint16[se+5]=4*ie+0}return ne}(L));const D=v.createIndexBuffer(na,!0),F=v.createVertexBuffer(N,s.collisionCircleLayout.members,!0);for(const W of I){const te={u_matrix:W.transform,u_inv_matrix:W.invTransform,u_camera_to_center_distance:($=C).getCameraToCenterDistance(W.projection),u_viewport_size:[$.width,$.height]};V.draw(v,b.TRIANGLES,s.DepthMode.disabled,s.StencilMode.disabled,l.colorModeForRenderPass(),s.CullFaceMode.disabled,te,o.id,F,D,s.SegmentVector.simpleSegment(0,2*W.circleOffset,W.circleArray.length,W.circleArray.length/2),null,C.zoom)}var $;F.destroy(),D.destroy()}const Z=s.create();function g({width:l,height:n,anchor:o,textOffset:h,textScale:d},m){const{horizontalAlign:y,verticalAlign:v}=s.getAnchorAlignment(o),b=-(y-.5)*l,C=-(v-.5)*n,E=s.evaluateVariableOffset(o,h);return new s.Point((b/d+E[0])*m,(C/d+E[1])*m)}function A(l,n,o,h,d,m,y,v,b,C,E){const I=l.text.placedSymbolArray,L=l.text.dynamicLayoutVertexArray,B=l.icon.dynamicLayoutVertexArray,V={},N=l.getProjection(),U=Xt(v,N,m),D=m.elevation,F=N.upVectorScale(v.canonical,m.center.lat,m.worldSize).metersToTile;L.clear();for(let $=0;$<I.length;$++){const W=I.get($),{tileAnchorX:te,tileAnchorY:ne,numGlyphs:ie}=W,se=W.hidden||!W.crossTileID||l.allowVerticalPlacement&&!W.placedOrientation?null:h[W.crossTileID];if(se){let ae=0,me=0,ke=0;if(D){const Re=D?D.getAtTileOffset(v,te,ne):0,[Ke,ot,We]=N.upVector(v.canonical,te,ne);ae=Re*Ke*F,me=Re*ot*F,ke=Re*We*F}let[he,Ee,_e,De]=Mi(W.projectedAnchorX+ae,W.projectedAnchorY+me,W.projectedAnchorZ+ke,o?U:y);const pe=Ml(m.getCameraToCenterDistance(N),De);let Me=d.evaluateSizeForFeature(l.textSizeData,C,W)*pe/s.ONE_EM;o&&(Me*=l.tilePixelRatio/b);const Pe=g(se,Me);o?(({x:he,y:Ee,z:_e}=N.projectTilePoint(te+Pe.x,ne+Pe.y,v.canonical)),[he,Ee,_e]=Mi(he+ae,Ee+me,_e+ke,y)):(n&&Pe._rotate(-m.angle),he+=Pe.x,Ee+=Pe.y,_e=0);const Se=l.allowVerticalPlacement&&W.placedOrientation===s.WritingMode.vertical?Math.PI/2:0;for(let Re=0;Re<ie;Re++)s.addDynamicAttributes(L,he,Ee,_e,Se);E&&W.associatedIconIndex>=0&&(V[W.associatedIconIndex]={x:he,y:Ee,z:_e,angle:Se})}else vn(ie,L)}if(E){B.clear();const $=l.icon.placedSymbolArray;for(let W=0;W<$.length;W++){const te=$.get(W),{numGlyphs:ne}=te,ie=V[W];if(te.hidden||!ie)vn(ne,B);else{const{x:se,y:ae,z:me,angle:ke}=ie;for(let he=0;he<ne;he++)s.addDynamicAttributes(B,se,ae,me,ke)}}l.icon.dynamicLayoutVertexBuffer.updateData(B)}l.text.dynamicLayoutVertexBuffer.updateData(L)}function q(l,n,o){return o.iconsInText&&n?"symbolTextAndIcon":l?"symbolSDF":"symbolIcon"}function de(l,n,o,h,d,m,y,v,b,C,E,I){const L=l.context,B=L.gl,V=l.transform,N="map"===v,U="map"===b,D=N&&"point"!==o.layout.get("symbol-placement"),F=N&&!U&&!D,$=void 0!==o.layout.get("symbol-sort-key").constantOr(1);let W=!1;const te=l.depthModeForSublayer(0,s.DepthMode.ReadOnly),ne=[s.mercatorXfromLng(V.center.lng),s.mercatorYfromLat(V.center.lat)],ie=o.layout.get("text-variable-anchor"),se="globe"===V.projection.name,ae=[],me=[0,-1,0];let ke=me;!se&&!V.mercatorFromTransition||N||(ke=function(he){const Ee=he._camera.getWorldToCamera(he.worldSize,1),_e=s.multiply([],Ee,he.globeMatrix);s.invert(_e,_e);
1const De=[0,0,0],pe=[0,1,0,0];return s.transformMat4$1(pe,pe,_e),De[0]=pe[0],De[1]=pe[1],De[2]=pe[2],s.normalize(De,De),De}(V));for(const he of h){const Ee=n.getTile(he),_e=Ee.getBucket(o);if(!_e||"mercator"===_e.projection.name&&se)continue;const De=d?_e.text:_e.icon;if(!De||_e.fullyClipped||!De.segments.get().length)continue;const pe=De.programConfigurations.get(o.id),Me=d||_e.sdfIcons,Pe=d?_e.textSizeData:_e.iconSizeData,Se=U||0!==V.pitch,Re=s.evaluateSizeForZoom(Pe,V.zoom);let Ke,ot,We,et,bt=[0,0],yt=null;if(d)ot=Ee.glyphAtlasTexture,We=B.LINEAR,Ke=Ee.glyphAtlasTexture.size,_e.iconsInText&&(bt=Ee.imageAtlasTexture.size,yt=Ee.imageAtlasTexture,et=Se||l.options.rotating||l.options.zooming||"composite"===Pe.kind||"camera"===Pe.kind?B.LINEAR:B.NEAREST);else{const wr=1!==o.layout.get("icon-size").constantOr(0)||_e.iconsNeedLinear;ot=Ee.imageAtlasTexture,We=Me||l.options.rotating||l.options.zooming||wr||Se?B.LINEAR:B.NEAREST,Ke=Ee.imageAtlasTexture.size}const Ye="globe"===_e.projection.name,zt=Ye?ke:me,Pt=Ye?s.globeToMercatorTransition(V.zoom):0,Lt=Xt(he,_e.getProjection(),V),Rt=V.calculatePixelsToTileUnitsMatrix(Ee),Ui=be(Lt,Ee.tileID.canonical,U,N,V,_e.getProjection(),Rt),ki=l.terrain&&U&&D?s.invert(s.create(),Ui):Z,Mn=oi(Lt,Ee.tileID.canonical,U,N,V,_e.getProjection(),Rt),or=ie&&_e.hasTextData(),Kt="none"!==o.layout.get("icon-text-fit")&&or&&_e.hasIconData();if(D){const wr=V.elevation,Hr=wr?wr.getAtTileOffsetFunc(he,V.center.lat,V.worldSize,_e.getProjection()):null,Io=Pn(Lt,Ee.tileID.canonical,U,N,V,_e.getProjection(),Rt);ds(_e,Lt,l,d,Io,Mn,U,C,Hr,he)}const Ot=D||d&&ie||Kt,Dt=l.translatePosMatrix(Lt,Ee,m,y),mi=Ot?Z:Ui,Ki=l.translatePosMatrix(Mn,Ee,m,y,!0),Yt=_e.getProjection().createInversionMatrix(V,he.canonical),on=[];l.terrainRenderModeElevated()&&U&&on.push("PITCH_WITH_MAP_TERRAIN"),Ye&&on.push("PROJECTION_GLOBE_VIEW"),Ot&&on.push("PROJECTED_POS_ON_VIEWPORT");const Ks=Me&&0!==o.paint.get(d?"text-halo-width":"icon-halo-width").constantOr(1);let Ao;Ao=Me?_e.iconsInText?Fs(Pe.kind,Re,F,U,l,Dt,mi,Ki,Ke,bt,he,Pt,ne,Yt,zt,_e.getProjection()):Ra(Pe.kind,Re,F,U,l,Dt,mi,Ki,d,Ke,!0,he,Pt,ne,Yt,zt,_e.getProjection()):Os(Pe.kind,Re,F,U,l,Dt,mi,Ki,d,Ke,he,Pt,ne,Yt,zt,_e.getProjection());const Wa={program:l.useProgram(q(Me,d,_e),pe,on),buffers:De,uniformValues:Ao,atlasTexture:ot,atlasTextureIcon:yt,atlasInterpolation:We,atlasInterpolationIcon:et,isSDF:Me,hasHalo:Ks,tile:Ee,labelPlaneMatrixInv:ki};if($&&_e.canOverlap){W=!0;const wr=De.segments.get();
1for(const Hr of wr)ae.push({segments:new s.SegmentVector([Hr]),sortKey:Hr.sortKey,state:Wa})}else ae.push({segments:De.segments,sortKey:0,state:Wa})}W&&ae.sort((he,Ee)=>he.sortKey-Ee.sortKey);for(const he of ae){const Ee=he.state;if(l.terrain&&l.terrain.setupElevationDraw(Ee.tile,Ee.program,{useDepthForOcclusion:!se,labelPlaneMatrixInv:Ee.labelPlaneMatrixInv}),L.activeTexture.set(B.TEXTURE0),Ee.atlasTexture.bind(Ee.atlasInterpolation,B.CLAMP_TO_EDGE),Ee.atlasTextureIcon&&(L.activeTexture.set(B.TEXTURE1),Ee.atlasTextureIcon&&Ee.atlasTextureIcon.bind(Ee.atlasInterpolationIcon,B.CLAMP_TO_EDGE)),Ee.isSDF){const _e=Ee.uniformValues;Ee.hasHalo&&(_e.u_is_halo=1,He(Ee.buffers,he.segments,o,l,Ee.program,te,E,I,_e)),_e.u_is_halo=0}He(Ee.buffers,he.segments,o,l,Ee.program,te,E,I,Ee.uniformValues)}}function He(l,n,o,h,d,m,y,v,b){const C=h.context,E=[l.dynamicLayoutVertexBuffer,l.opacityVertexBuffer,l.globeExtVertexBuffer];d.draw(C,C.gl.TRIANGLES,m,y,v,s.CullFaceMode.disabled,b,o.id,l.layoutVertexBuffer,l.indexBuffer,n,o.paint,h.transform.zoom,l.programConfigurations.get(o.id),E)}function nt(l,n,o,h,d,m,y){const v=l.context.gl,b=o.paint.get("fill-pattern"),C=b&&b.constantOr(1);let E,I,L,B,V;y?(I=C&&!o.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",E=v.LINES):(I=C?"fillPattern":"fill",E=v.TRIANGLES);for(const N of h){const U=n.getTile(N);if(C&&!U.patternsLoaded())continue;const D=U.getBucket(o);if(!D)continue;l.prepareDrawTile();const F=D.programConfigurations.get(o.id),$=l.useProgram(I,F);C&&(l.context.activeTexture.set(v.TEXTURE0),U.imageAtlasTexture.bind(v.LINEAR,v.CLAMP_TO_EDGE),F.updatePaintBuffers());const W=b.constantOr(null);if(W&&U.imageAtlas){const ne=U.imageAtlas.patternPositions[W.toString()];ne&&F.setConstantPatternPositions(ne)}const te=l.translatePosMatrix(N.projMatrix,U,o.paint.get("fill-translate"),o.paint.get("fill-translate-anchor"));if(y){B=D.indexBuffer2,V=D.segments2;const ne=l.terrain&&l.terrain.renderingToTexture?l.terrain.drapeBufferSize:[v.drawingBufferWidth,v.drawingBufferHeight];L="fillOutlinePattern"===I&&C?Lc(te,l,U,ne):Pc(te,ne)}else B=D.indexBuffer,V=D.segments,L=C?Ds(te,l,U):Wr(te);l.prepareDrawProgram(l.context,$,N.toUnwrapped()),$.draw(l.context,E,d,l.stencilModeForClipping(N),m,s.CullFaceMode.disabled,L,o.id,D.layoutVertexBuffer,B,V,o.paint,l.transform.zoom,F)}}function hi(l,n,o,h,d,m,y){const v=l.context,b=v.gl,C=l.transform,E=o.paint.get("fill-extrusion-pattern"),I=E.constantOr(1),L=o.paint.get("fill-extrusion-opacity"),B=[o.paint.get("fill-extrusion-ambient-occlusion-intensity"),o.paint.get("fill-extrusion-ambient-occlusion-radius")],V=o.layout.get("fill-extrusion-edge-radius"),N=V>0&&!o.paint.get("fill-extrusion-rounded-roof"),U=N?0:V,D="globe"===C.projection.name?s.fillExtrusionHeightLift():0,F="globe"===C.projection.name,$=F?s.globeToMercatorTransition(C.zoom):0,W=[s.mercatorXfromLng(C.center.lng),s.mercatorYfromLat(C.center.lat)],te=[];F&&te.push("PROJECTION_GLOBE_VIEW"),B[0]>0&&te.push("FAUX_AO"),N&&te.push("ZERO_ROOF_RADIUS");for(const ne of h){const ie=n.getTile(ne),se=ie.getBucket(o);if(!se||se.projection.name!==C.projection.name)continue;const ae=se.programConfigurations.get(o.id),me=l.useProgram(I?"fillExtrusionPattern":"fillExtrusion",ae,te);if(l.terrain){const Me=l.terrain;if(l.style.terrainSetForDrapingOnly())Me.setupElevationDraw(ie,me,{useMeterToDem:!0});else{if(!se.enableTerrain)continue;if(Me.setupElevationDraw(ie,me,{useMeterToDem:!0}),Ii(v,n,ne,se,o,Me),!se.centroidVertexBuffer){const Pe=me.attributes.a_centroid_pos;void 0!==Pe&&b.vertexAttrib2f(Pe,0,0)}}}I&&(l.context.activeTexture.set(b.TEXTURE0),ie.imageAtlasTexture.bind(b.LINEAR,b.CLAMP_TO_EDGE),ae.updatePaintBuffers());const ke=E.constantOr(null);if(ke&&ie.imageAtlas){const Me=ie.imageAtlas.patternPositions[ke.toString()];Me&&ae.setConstantPatternPositions(Me)}const he=l.translatePosMatrix(ne.projMatrix,ie,o.paint.get("fill-extrusion-translate"),o.paint.get("fill-extrusion-translate-anchor")),Ee=C.projection.createInversionMatrix(C,ne.canonical),_e=o.paint.get("fill-extrusion-vertical-gradient"),De=I?Dl(he,l,_e,L,B,U,ne,ie,D,$,W,Ee):Is(he,l,_e,L,B,U,ne,D,$,W,Ee);l.prepareDrawProgram(v,me,ne.toUnwrapped());const pe=[];l.terrain&&pe.push(se.centroidVertexBuffer),F&&pe.push(se.layoutVertexExtBuffer),me.draw(v,v.gl.TRIANGLES,d,m,y,s.CullFaceMode.backCCW,De,o.id,se.layoutVertexBuffer,se.indexBuffer,se.segments,o.paint,l.transform.zoom,ae,pe)}}function Ii(l,n,o,h,d,m){const y=[D=>{let F=D.canonical.x-1,$=D.wrap;return F<0&&(F=(1<<D.canonical.z)-1,$--),new s.OverscaledTileID(D.overscaledZ,$,D.canonical.z,F,D.canonical.y)},D=>{let F=D.canonical.x+1,$=D.wrap;return F===1<<D.canonical.z&&(F=0,$++),new s.OverscaledTileID(D.overscaledZ,$,D.canonical.z,F,D.canonical.y)},D=>new s.OverscaledTileID(D.overscaledZ,D.wrap,D.canonical.z,D.canonical.x,(0===D.canonical.y?1<<D.canonical.z:D.canonical.y)-1),D=>new s.OverscaledTileID(D.overscaledZ,D.wrap,D.canonical.z,D.canonical.x,D.canonical.y===(1<<D.canonical.z)-1?0:D.canonical.y+1)],v=D=>{const F=n.getSource().minzoom,$=te=>{const ne=n.getTileByID(te);if(ne&&ne.hasData())return ne.getBucket(d)},W=[0,-1,1];for(const te of W){if(D.overscaledZ+te<F)continue;const ne=$(D.calculateScaledKey(D.overscaledZ+te));if(ne)return ne}},b=[0,0,0],C=(D,F)=>(b[0]=Math.min(D.min.y,F.min.y),b[1]=Math.max(D.max.y,F.max.y),b[2]=s.EXTENT-F.min.x>D.max.x?F.min.x-s.EXTENT:D.max.x,b),E=(D,F)=>(b[0]=Math.min(D.min.x,F.min.x),b[1]=Math.max(D.max.x,F.max.x),b[2]=s.EXTENT-F.min.y>D.max.y?F.min.y-s.EXTENT:D.max.y,b),I=[(D,F)=>C(D,F),(D,F)=>C(F,D),(D,F)=>E(D,F),(D,F)=>E(F,D)],L=new s.Point(0,0);let B,V,N;const U=(D,F,$,W,te)=>{const ne=[[W?$:D,W?D:$,0],[W?$:F,W?F:$,0]],ie=te<0?s.EXTENT+te:te,
1se=[W?ie:(D+F)/2,W?(D+F)/2:ie,0];return 0===$&&te<0||0!==$&&te>0?m.getForTilePoints(N,[se],!0,V):ne.push(se),m.getForTilePoints(o,ne,!0,B),Math.max(ne[0][2],ne[1][2],se[2])/m.exaggeration()};for(let D=0;D<4;D++){const F=(D<2?1:5)-D,$=h.borders[D];if(0===$.length)continue;const W=N=y[D](o),te=v(W);if(!(te&&te instanceof s.FillExtrusionBucket&&te.enableTerrain)||h.borderDoneWithNeighborZ[D]===te.canonical.z&&te.borderDoneWithNeighborZ[F]===h.canonical.z||(V=m.findDEMTileFor(W),!V||!V.dem))continue;if(!B){const ae=m.findDEMTileFor(o);if(!ae||!ae.dem)return;B=ae}const ne=te.borders[F];let ie=0;const se=te.borderDoneWithNeighborZ[F]!==h.canonical.z;if(h.canonical.z===te.canonical.z){for(let ae=0;ae<$.length;ae++){const me=h.featuresOnBorder[$[ae]],ke=me.borders[D];let he;for(;ie<ne.length&&(he=te.featuresOnBorder[ne[ie]],!(he.borders[F][1]>ke[0]+3));)se&&te.encodeCentroid(void 0,he,!1),ie++;if(he&&ie<ne.length){const Ee=ie;let _e=0;for(;!(he.borders[F][0]>ke[1]-3)&&(_e++,++ie!==ne.length);)he=te.featuresOnBorder[ne[ie]];if(he=te.featuresOnBorder[ne[Ee]],me.intersectsCount()>1||he.intersectsCount()>1||1!==_e){1!==_e&&(ie=Ee),h.encodeCentroid(void 0,me,!1),se&&te.encodeCentroid(void 0,he,!1);continue}const De=I[D](me,he),pe=D%2?s.EXTENT-1:0;L.x=U(De[0],Math.min(s.EXTENT-1,De[1]),pe,D<2,De[2]),L.y=0,h.encodeCentroid(L,me,!1),se&&te.encodeCentroid(L,he,!1)}else h.encodeCentroid(void 0,me,!1)}h.borderDoneWithNeighborZ[D]=te.canonical.z,h.needsCentroidUpdate=!0,se&&(te.borderDoneWithNeighborZ[F]=h.canonical.z,te.needsCentroidUpdate=!0)}else{for(const ae of $)h.encodeCentroid(void 0,h.featuresOnBorder[ae],!1);if(se){for(const ae of ne)te.encodeCentroid(void 0,te.featuresOnBorder[ae],!1);te.borderDoneWithNeighborZ[F]=h.canonical.z,te.needsCentroidUpdate=!0}h.borderDoneWithNeighborZ[D]=te.canonical.z,h.needsCentroidUpdate=!0}}(h.needsCentroidUpdate||!h.centroidVertexBuffer&&0!==h.centroidVertexArray.length)&&h.uploadCentroid(l)}const Ni=new s.Color(1,0,0,1),rn=new s.Color(0,1,0,1),ir=new s.Color(0,0,1,1),mn=new s.Color(1,0,1,1),nr=new s.Color(0,1,1,1);function Xr(l,n,o){const h=l.context,d=l.transform,m=h.gl,y="globe"===d.projection.name,v=y?["PROJECTION_GLOBE_VIEW"]:null;let b=o.projMatrix;if(y&&s.globeToMercatorTransition(d.zoom)>0){const me=s.transitionTileAABBinECEF(o.canonical,d),ke=s.globeDenormalizeECEF(me);b=s.multiply(new Float32Array(16),d.globeMatrix,ke),s.multiply(b,d.projMatrix,b)}const C=l.useProgram("debug",null,v),E=n.getTileByID(o.key);l.terrain&&l.terrain.setupElevationDraw(E,C);const I=s.DepthMode.disabled,L=s.StencilMode.disabled,B=l.colorModeForRenderPass(),V="$debug";h.activeTexture.set(m.TEXTURE0),l.emptyTexture.bind(m.LINEAR,m.CLAMP_TO_EDGE),y?E._makeGlobeTileDebugBuffers(l.context,d):E._makeDebugTileBoundsBuffers(l.context,d.projection);const N=E._tileDebugBuffer||l.debugBuffer,U=E._tileDebugIndexBuffer||l.debugIndexBuffer,D=E._tileDebugSegments||l.debugSegments;C.draw(h,m.LINE_STRIP,I,L,B,s.CullFaceMode.disabled,Pa(b,s.Color.red),V,N,U,D,null,null,null,[E._globeTileDebugBorderBuffer]);const F=E.latestRawTileData,$=Math.floor((F&&F.byteLength||0)/1024),W=n.getTile(o).tileSize,te=512/Math.min(W,512)*(o.overscaledZ/d.zoom)*.5;let ne=o.canonical.toString();o.overscaledZ!==o.canonical.z&&(ne+=` => ${o.overscaledZ}`),ne+=` ${$}kb`,function(me,ke){me.initDebugOverlayCanvas();const he=me.debugOverlayCanvas,Ee=me.context.gl,_e=me.debugOverlayCanvas.getContext("2d");_e.clearRect(0,0,he.width,he.height),_e.shadowColor="white",_e.shadowBlur=2,_e.lineWidth=1.5,_e.strokeStyle="white",_e.textBaseline="top",_e.font="bold 36px Open Sans, sans-serif",_e.fillText(ke,5,5),_e.strokeText(ke,5,5),me.debugOverlayTexture.update(he),me.debugOverlayTexture.bind(Ee.LINEAR,Ee.CLAMP_TO_EDGE)}(l,ne);const ie=E._tileDebugTextBuffer||l.debugBuffer,se=E._tileDebugTextIndexBuffer||l.quadTriangleIndexBuffer,ae=E._tileDebugTextSegments||l.debugSegments;C.draw(h,m.TRIANGLES,I,L,s.ColorMode.alphaBlended,s.CullFaceMode.disabled,Pa(b,s.Color.transparent,te),V,ie,se,ae,null,null,null,[E._globeTileDebugTextBuffer])}function yr(l,n,o,h){fn(l,0,n+o/2,l.transform.width,o,h)}function Bn(l,n,o,h){fn(l,n-o/2,0,o,l.transform.height,h)}function fn(l,n,o,h,d,m){const y=l.context,v=y.gl;v.enable(v.SCISSOR_TEST),v.scissor(n*s.exported.devicePixelRatio,o*s.exported.devicePixelRatio,h*s.exported.devicePixelRatio,d*s.exported.devicePixelRatio),y.clear({color:m}),v.disable(v.SCISSOR_TEST)}const vr=s.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:Qt}=vr;function xr(l,n,o,h){l.emplaceBack(n,o,h)}class Bs{constructor(n){this.vertexArray=new s.StructArrayLayout3f12,this.indices=new s.StructArrayLayout3ui6,xr(this.vertexArray,-1,-1,1),xr(this.vertexArray,1,-1,1),xr(this.vertexArray,-1,1,1),xr(this.vertexArray,1,1,1),xr(this.vertexArray,-1,-1,-1),xr(this.vertexArray,1,-1,-1),xr(this.vertexArray,-1,1,-1),xr(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=n.createVertexBuffer(this.vertexArray,Qt),this.indexBuffer=n.createIndexBuffer(this.indices),this.segment=s.SegmentVector.simpleSegment(0,0,36,12)}}function bn(l,n,o,h,d,m){const y=l.gl,v=n.paint.get("sky-atmosphere-color"),b=n.paint.get("sky-atmosphere-halo-color"),C=n.paint.get("sky-atmosphere-sun-intensity"),E={u_matrix_3f:s.fromMat4(s.create$1(),h),u_sun_direction:d,u_sun_intensity:C,u_color_tint_r:[(V=v).r,V.g,V.b,V.a],u_color_tint_m:[(N=b).r,N.g,N.b,N.a],u_luminance:5e-5};var V,N;y.framebufferTexture2D(y.FRAMEBUFFER,y.COLOR_ATTACHMENT0,y.TEXTURE_CUBE_MAP_POSITIVE_X+m,n.skyboxTexture,0),o.draw(l,y.TRIANGLES,s.DepthMode.disabled,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.frontCW,E,"skyboxCapture",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment)}const Ba=s.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Fc{constructor(n){const o=new s.StructArrayLayout5f20;o.emplaceBack(-1,1,1,0,0),o.emplaceBack(1,1,1,1,0),o.emplaceBack(1,-1,1,1,1),o.emplaceBack(-1,-1,1,0,1);const h=new s.StructArrayLayout3ui6;h.emplaceBack(0,1,2),h.emplaceBack(2,3,0),this.vertexBuffer=n.createVertexBuffer(o,Ba.members),this.indexBuffer=n.createIndexBuffer(h),this.segments=s.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}
vendor: 15,986 bytes, line 1
1const Co={symbol:function(l,n,o,h,d){if("translucent"!==l.renderPass)return;const m=s.StencilMode.disabled,y=l.colorModeForRenderPass();o.layout.get("text-variable-anchor")&&function(v,b,C,E,I,L,B){const V=b.transform,N="map"===I,U="map"===L;for(const D of v){const F=E.getTile(D),$=F.getBucket(C);if(!$||!$.text||!$.text.segments.get().length)continue;const W=s.evaluateSizeForZoom($.textSizeData,V.zoom),te=Xt(D,$.getProjection(),V),ne=V.calculatePixelsToTileUnitsMatrix(F),ie=be(te,F.tileID.canonical,U,N,V,$.getProjection(),ne),se="none"!==C.layout.get("icon-text-fit")&&$.hasIconData();if(W){const ae=Math.pow(2,V.zoom-F.tileID.overscaledZ);A($,N,U,B,s.symbolSize,V,ie,D,ae,W,se)}}}(h,l,o,n,o.layout.get("text-rotation-alignment"),o.layout.get("text-pitch-alignment"),d),0!==o.paint.get("icon-opacity").constantOr(1)&&de(l,n,o,h,!1,o.paint.get("icon-translate"),o.paint.get("icon-translate-anchor"),o.layout.get("icon-rotation-alignment"),o.layout.get("icon-pitch-alignment"),o.layout.get("icon-keep-upright"),m,y),0!==o.paint.get("text-opacity").constantOr(1)&&de(l,n,o,h,!0,o.paint.get("text-translate"),o.paint.get("text-translate-anchor"),o.layout.get("text-rotation-alignment"),o.layout.get("text-pitch-alignment"),o.layout.get("text-keep-upright"),m,y),n.map.showCollisionBoxes&&(O(l,n,o,h,o.paint.get("text-translate"),o.paint.get("text-translate-anchor"),!0),O(l,n,o,h,o.paint.get("icon-translate"),o.paint.get("icon-translate-anchor"),!1))},circle:function(l,n,o,h){if("translucent"!==l.renderPass)return;const d=o.paint.get("circle-opacity"),m=o.paint.get("circle-stroke-width"),y=o.paint.get("circle-stroke-opacity"),v=void 0!==o.layout.get("circle-sort-key").constantOr(1);if(0===d.constantOr(1)&&(0===m.constantOr(1)||0===y.constantOr(1)))return;const b=l.context,C=b.gl,E=l.transform,I=l.depthModeForSublayer(0,s.DepthMode.ReadOnly),L=s.StencilMode.disabled,B=l.colorModeForRenderPass(),V="globe"===E.projection.name,N=[s.mercatorXfromLng(E.center.lng),s.mercatorYfromLat(E.center.lat)],U=[];for(let F=0;F<h.length;F++){const $=h[F],W=n.getTile($),te=W.getBucket(o);if(!te||te.projection.name!==E.projection.name)continue;const ne=te.programConfigurations.get(o.id),ie=zs(o);V&&ie.push("PROJECTION_GLOBE_VIEW");const se=l.useProgram("circle",ne,ie),ae=te.layoutVertexBuffer,me=te.globeExtVertexBuffer,ke=te.indexBuffer,he=E.projection.createInversionMatrix(E,$.canonical),Ee={programConfiguration:ne,program:se,layoutVertexBuffer:ae,globeExtVertexBuffer:me,indexBuffer:ke,uniformValues:ks(l,$,W,he,N,o),tile:W};if(v){const _e=te.segments.get();for(const De of _e)U.push({segments:new s.SegmentVector([De]),sortKey:De.sortKey,state:Ee})}else U.push({segments:te.segments,sortKey:0,state:Ee})}v&&U.sort((F,$)=>F.sortKey-$.sortKey);const D={useDepthForOcclusion:!V};for(const F of U){const{programConfiguration:$,program:W,layoutVertexBuffer:te,globeExtVertexBuffer:ne,indexBuffer:ie,uniformValues:se,tile:ae}=F.state,me=F.segments;l.terrain&&l.terrain.setupElevationDraw(ae,W,D),l.prepareDrawProgram(b,W,ae.tileID.toUnwrapped()),W.draw(b,C.TRIANGLES,I,L,B,s.CullFaceMode.disabled,se,o.id,te,ie,me,o.paint,E.zoom,$,[ne])}},heatmap:function(l,n,o,h){if(0!==o.paint.get("heatmap-opacity"))if("offscreen"===l.renderPass){const d=l.context,m=d.gl,y=s.StencilMode.disabled,v=new s.ColorMode([m.ONE,m.ONE],s.Color.transparent,[!0,!0,!0,!0]);(function(B,V,N,U){const D=B.gl,F=V.width*U,$=V.height*U;B.activeTexture.set(D.TEXTURE1),B.viewport.set([0,0,F,$]);let W=N.heatmapFbo;if(!W||W&&(W.width!==F||W.height!==$)){W&&W.destroy();const te=D.createTexture();D.bindTexture(D.TEXTURE_2D,te),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_S,D.CLAMP_TO_EDGE),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_T,D.CLAMP_TO_EDGE),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MIN_FILTER,D.LINEAR),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MAG_FILTER,D.LINEAR),W=N.heatmapFbo=B.createFramebuffer(F,$,!1),function(ne,ie,se,ae,me,ke){const he=ne.gl;he.texImage2D(he.TEXTURE_2D,0,ne.isWebGL2&&ne.extRenderToTextureHalfFloat?he.RGBA16F:he.RGBA,me,ke,0,he.RGBA,ne.extRenderToTextureHalfFloat?ne.isWebGL2?he.HALF_FLOAT:ne.extTextureHalfFloat.HALF_FLOAT_OES:he.UNSIGNED_BYTE,null),ae.colorAttachment.set(se)}(B,0,te,W,F,$)}else D.bindTexture(D.TEXTURE_2D,W.colorAttachment.get()),B.bindFramebuffer.set(W.framebuffer)})(d,l,o,"globe"===l.transform.projection.name?.5:.25),d.clear({color:s.Color.transparent});const b=l.transform,C="globe"===b.projection.name,E=C?["PROJECTION_GLOBE_VIEW"]:null,I=C?s.CullFaceMode.frontCCW:s.CullFaceMode.disabled,L=[s.mercatorXfromLng(b.center.lng),s.mercatorYfromLat(b.center.lat)];for(let B=0;B<h.length;B++){const V=h[B];if(n.hasRenderableParent(V))continue;const N=n.getTile(V),U=N.getBucket(o);if(!U||U.projection.name!==b.projection.name)continue;const D=U.programConfigurations.get(o.id),F=l.useProgram("heatmap",D,E),{zoom:$}=l.transform;l.terrain&&l.terrain.setupElevationDraw(N,F),l.prepareDrawProgram(d,F,V.toUnwrapped());const W=b.projection.createInversionMatrix(b,V.canonical);F.draw(d,m.TRIANGLES,s.DepthMode.disabled,y,v,I,zl(l,V,N,W,L,$,o.paint.get("heatmap-intensity")),o.id,U.layoutVertexBuffer,U.indexBuffer,U.segments,o.paint,l.transform.zoom,D,C?[U.globeExtVertexBuffer]:null)}d.viewport.set([0,0,l.width,l.height])}else"translucent"===l.renderPass&&(l.context.setColorMode(l.colorModeForRenderPass()),function(d,m){const y=d.context,v=y.gl,b=m.heatmapFbo;if(!b)return;y.activeTexture.set(v.TEXTURE0),v.bindTexture(v.TEXTURE_2D,b.colorAttachment.get()),y.activeTexture.set(v.TEXTURE1);let C=m.colorRampTexture;C||(C=m.colorRampTexture=new s.Texture(y,m.colorRamp,v.RGBA)),C.bind(v.LINEAR,v.CLAMP_TO_EDGE),d.useProgram("heatmapTexture").draw(y,v.TRIANGLES,s.DepthMode.disabled,s.StencilMode.disabled,d.colorModeForRenderPass(),s.CullFaceMode.disabled,{u_image:0,u_color_ramp:1,u_opacity:m.paint.get("heatmap-opacity")},m.id,d.viewportBuffer,d.quadTriangleIndexBuffer,d.viewportSegments,m.paint,d.transform.zoom)}(l,o))},line:function(l,n,o,h){if("translucent"!==l.renderPass)return;const d=o.paint.get("line-opacity"),m=o.paint.get("line-width");if(0===d.constantOr(1)||0===m.constantOr(1))return;const y=l.depthModeForSublayer(0,s.DepthMode.ReadOnly),v=l.colorModeForRenderPass(),b=l.terrain&&l.terrain.renderingToTexture?1:s.exported.devicePixelRatio,C=o.paint.get("line-dasharray"),E=C.constantOr(1),I=o.layout.get("line-cap"),L=o.paint.get("line-pattern"),B=L.constantOr(1),V=o.paint.get("line-gradient"),N=B?"linePattern":"line",U=l.context,D=U.gl,F=(W=>{const te=[];ia(W)&&te.push("RENDER_LINE_DASH"),W.paint.get("line-gradient")&&te.push("RENDER_LINE_GRADIENT");const ne=W.paint.get("line-trim-offset");0===ne[0]&&0===ne[1]||te.push("RENDER_LINE_TRIM_OFFSET");const ie=W.paint.get("line-pattern").constantOr(1),se=1!==W.paint.get("line-opacity").constantOr(1);return!ie&&se&&te.push("RENDER_LINE_ALPHA_DISCARD"),te})(o);let $=F.includes("RENDER_LINE_ALPHA_DISCARD");l.terrain&&l.terrain.clipOrMaskOverlapStencilType()&&($=!1);for(const W of h){const te=n.getTile(W);if(B&&!te.patternsLoaded())continue;const ne=te.getBucket(o);if(!ne)continue;l.prepareDrawTile();const ie=ne.programConfigurations.get(o.id),se=l.useProgram(N,ie,F),ae=L.constantOr(null);if(ae&&te.imageAtlas){const Me=te.imageAtlas.patternPositions[ae.toString()];Me&&ie.setConstantPatternPositions(Me)}const me=C.constantOr(null),ke=I.constantOr(null);if(!B&&me&&ke&&te.lineAtlas){const Me=te.lineAtlas.getDash(me,ke);Me&&ie.setConstantPatternPositions(Me)}let[he,Ee]=o.paint.get("line-trim-offset");("round"===ke||"square"===ke)&&he!==Ee&&(0===he&&(he-=1),1===Ee&&(Ee+=1));const _e=l.terrain?W.projMatrix:null,De=B?ta(l,te,o,_e,b):Oc(l,te,o,_e,ne.lineClipsArray.length,b,[he,Ee]);if(V){const Me=ne.gradients[o.id];let Pe=Me.texture;if(o.gradientVersion!==Me.version){let Se=256;if(o.stepInterpolant){const Re=n.getSource().maxzoom,Ke=W.canonical.z===Re?Math.ceil(1<<l.transform.maxZoom-W.canonical.z):1;Se=s.clamp(s.nextPowerOfTwo(ne.maxLineLength/s.EXTENT*1024*Ke),256,U.maxTextureSize)}Me.gradient=s.renderColorRamp({expression:o.gradientExpression(),evaluationKey:"lineProgress",resolution:Se,image:Me.gradient||void 0,clips:ne.lineClipsArray}),Me.texture?Me.texture.update(Me.gradient):Me.texture=new s.Texture(U,Me.gradient,D.RGBA),Me.version=o.gradientVersion,Pe=Me.texture}U.activeTexture.set(D.TEXTURE1),Pe.bind(o.stepInterpolant?D.NEAREST:D.LINEAR,D.CLAMP_TO_EDGE)}E&&(U.activeTexture.set(D.TEXTURE0),te.lineAtlasTexture.bind(D.LINEAR,D.REPEAT),ie.updatePaintBuffers()),B&&(U.activeTexture.set(D.TEXTURE0),te.imageAtlasTexture.bind(D.LINEAR,D.CLAMP_TO_EDGE),ie.updatePaintBuffers()),l.prepareDrawProgram(U,se,W.toUnwrapped());const pe=Me=>{se.draw(U,D.TRIANGLES,y,Me,v,s.CullFaceMode.disabled,De,o.id,ne.layoutVertexBuffer,ne.indexBuffer,ne.segments,o.paint,l.transform.zoom,ie,[ne.layoutVertexBuffer2])};if($){const Me=l.stencilModeForClipping(W).ref;0===Me&&l.terrain&&U.clear({stencil:0});const Pe={func:D.EQUAL,mask:255};De.u_alpha_discard_threshold=.8,pe(new s.StencilMode(Pe,Me,255,D.KEEP,D.KEEP,D.INVERT)),De.u_alpha_discard_threshold=0,pe(new s.StencilMode(Pe,Me,255,D.KEEP,D.KEEP,D.KEEP))}else pe(l.stencilModeForClipping(W))}$&&(l.resetStencilClippingMasks(),l.terrain&&U.clear({stencil:0}))},fill:function(l,n,o,h){const d=o.paint.get("fill-color"),m=o.paint.get("fill-opacity");if(0===m.constantOr(1))return;const y=l.colorModeForRenderPass(),v=o.paint.get("fill-pattern"),b=l.opaquePassEnabledForLayer()&&!v.constantOr(1)&&1===d.constantOr(s.Color.transparent).a&&1===m.constantOr(0)?"opaque":"translucent";if(l.renderPass===b){const C=l.depthModeForSublayer(1,"opaque"===l.renderPass?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly);nt(l,n,o,h,C,y,!1)}if("translucent"===l.renderPass&&o.paint.get("fill-antialias")){const C=l.depthModeForSublayer(o.getPaintProperty("fill-outline-color")?2:0,s.DepthMode.ReadOnly);nt(l,n,o,h,C,y,!0)}},"fill-extrusion":function(l,n,o,h){const d=o.paint.get("fill-extrusion-opacity");if(0!==d&&"translucent"===l.renderPass){const m=new s.DepthMode(l.context.gl.LEQUAL,s.DepthMode.ReadWrite,l.depthRangeFor3D);if(1!==d||o.paint.get("fill-extrusion-pattern").constantOr(1))hi(l,n,o,h,m,s.StencilMode.disabled,s.ColorMode.disabled),hi(l,n,o,h,m,l.stencilModeFor3D(),l.colorModeForRenderPass()),l.resetStencilClippingMasks();else{const y=l.colorModeForRenderPass();hi(l,n,o,h,m,s.StencilMode.disabled,y)}}},hillshade:function(l,n,o,h){if("offscreen"!==l.renderPass&&"translucent"!==l.renderPass)return;const d=l.context,m=l.depthModeForSublayer(0,s.DepthMode.ReadOnly),y=l.colorModeForRenderPass(),v=l.terrain&&l.terrain.renderingToTexture,[b,C]="translucent"!==l.renderPass||v?[{},h]:l.stencilConfigForOverlap(h);for(const E of C){const I=n.getTile(E);if(I.needsHillshadePrepare&&"offscreen"===l.renderPass)Al(l,I,o,m,s.StencilMode.disabled,y);else if("translucent"===l.renderPass){const L=v&&l.terrain?l.terrain.stencilModeForRTTOverlap(E):b[E.overscaledZ];Ia(l,E,I,o,m,L,y)}}d.viewport.set([0,0,l.width,l.height]),l.resetStencilClippingMasks()},raster:function(l,n,o,h,d,m){if("translucent"!==l.renderPass||0===o.paint.get("raster-opacity")||!h.length)return;const y=l.context,v=y.gl,b=n.getSource(),C=l.useProgram("raster"),E=l.colorModeForRenderPass(),I=l.terrain&&l.terrain.renderingToTexture,[L,B]=b instanceof mt||I?[{},h]:l.stencilConfigForOverlap(h),V=B[B.length-1].overscaledZ,N=!l.options.moving;for(const U of B){const D=I?s.DepthMode.disabled:l.depthModeForSublayer(U.overscaledZ-V,1===o.paint.get("raster-opacity")?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly,v.LESS),F=U.toUnwrapped(),$=n.getTile(U);if(I&&(!$||!$.hasData()))continue;const W=I?U.projMatrix:l.transform.calculateProjMatrix(F,N),te=l.terrain&&I?l.terrain.stencilModeForRTTOverlap(U):L[U.overscaledZ],ne=m?0:o.paint.get("raster-fade-duration");$.registerFadeDuration(ne);const ie=n.findLoadedParent(U,0),se=ka($,ie,n,l.transform,ne);let ae,me;l.terrain&&l.terrain.prepareDrawTile();const ke="nearest"===o.paint.get("raster-resampling")?v.NEAREST:v.LINEAR;y.activeTexture.set(v.TEXTURE0),$.texture.bind(ke,v.CLAMP_TO_EDGE),y.activeTexture.set(v.TEXTURE1),ie?(ie.texture.bind(ke,v.CLAMP_TO_EDGE),ae=Math.pow(2,ie.tileID.overscaledZ-$.tileID.overscaledZ),me=[$.tileID.canonical.x*ae%1,$.tileID.canonical.y*ae%1]):$.texture.bind(ke,v.CLAMP_TO_EDGE),$.texture.useMipmap&&y.extTextureFilterAnisotropic&&l.transform.pitch>20&&v.texParameterf(v.TEXTURE_2D,y.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,y.extTextureFilterAnisotropicMax);const he=Rs(W,me||[0,0],ae||1,se,o,b instanceof mt?b.perspectiveTransform:[0,0]);if(l.prepareDrawProgram(y,C,F),b instanceof mt)b.boundsBuffer&&b.boundsSegments&&C.draw(y,v.TRIANGLES,D,s.StencilMode.disabled,E,s.CullFaceMode.disabled,he,o.id,b.boundsBuffer,l.quadTriangleIndexBuffer,b.boundsSegments);else{const{tileBoundsBuffer:Ee,tileBoundsIndexBuffer:_e,tileBoundsSegments:De}=l.getTileBoundsBuffers($);C.draw(y,v.TRIANGLES,D,te,E,s.CullFaceMode.disabled,he,o.id,Ee,_e,De)}}l.resetStencilClippingMasks()},background:function(l,n,o,h){const d=o.paint.get("background-color"),m=o.paint.get("background-opacity");if(0===m)return;const y=l.context,v=y.gl,b=l.transform,C=b.tileSize,E=o.paint.get("background-pattern");if(l.isPatternMissing(E))return;const I=!E&&1===d.a&&1===m&&l.opaquePassEnabledForLayer()?"opaque":"translucent";if(l.renderPass!==I)return;const L=s.StencilMode.disabled,B=l.depthModeForSublayer(0,"opaque"===I?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly),V=l.colorModeForRenderPass(),N=l.useProgram(E?"backgroundPattern":"background");let U,D=h;D||(U=l.getBackgroundTiles(),D=Object.values(U).map(F=>F.tileID)),E&&(y.activeTexture.set(v.TEXTURE0),l.imageManager.bind(l.context));for(const F of D){const $=F.toUnwrapped(),W=h?F.projMatrix:l.transform.calculateProjMatrix($);l.prepareDrawTile();const te=n?n.getTile(F):U?U[F.key]:new s.Tile(F,C,b.zoom,l),ne=E?Pl(W,m,l,E,{tileID:F,tileSize:C}):Oa(W,m,d);l.prepareDrawProgram(y,N,$);const{tileBoundsBuffer:ie,tileBoundsIndexBuffer:se,tileBoundsSegments:ae}=l.getTileBoundsBuffers(te);N.draw(y,v.TRIANGLES,B,L,V,s.CullFaceMode.disabled,ne,o.id,ie,se,ae)}},sky:function(l,n,o){const h=l.transform,d="mercator"===h.projection.name||"globe"===h.projection.name?1:s.smoothstep(7,8,h.zoom),m=o.paint.get("sky-opacity")*d;if(0===m)return;const y=l.context,v=o.paint.get("sky-type"),b=new s.DepthMode(y.gl.LEQUAL,s.DepthMode.ReadOnly,[0,1]),C=l.frameCounter/1e3%1;"atmosphere"===v?"offscreen"===l.renderPass?o.needsSkyboxCapture(l)&&(function(E,I,L,B){const V=E.context,N=V.gl;let U=I.skyboxFbo;if(!U){U=I.skyboxFbo=V.createFramebuffer(32,32,!1),I.skyboxGeometry=new Bs(V),I.skyboxTexture=V.gl.createTexture(),N.bindTexture(N.TEXTURE_CUBE_MAP,I.skyboxTexture),N.texParameteri(N.TEXTURE_CUBE_MAP,N.TEXTURE_WRAP_S,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_CUBE_MAP,N.TEXTURE_WRAP_T,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_CUBE_MAP,N.TEXTURE_MIN_FILTER,N.LINEAR),N.texParameteri(N.TEXTURE_CUBE_MAP,N.TEXTURE_MAG_FILTER,N.LINEAR);for(let W=0;W<6;++W)N.texImage2D(N.TEXTURE_CUBE_MAP_POSITIVE_X+W,0,N.RGBA,32,32,0,N.RGBA,N.UNSIGNED_BYTE,null)}V.bindFramebuffer.set(U.framebuffer),V.viewport.set([0,0,32,32]);const D=I.getCenter(E,!0),F=E.useProgram("skyboxCapture"),$=new Float64Array(16);s.identity($),s.rotateY($,$,.5*-Math.PI),bn(V,I,F,$,D,0),s.identity($),s.rotateY($,$,.5*Math.PI),bn(V,I,F,$,D,1),s.identity($),s.rotateX($,$,.5*-Math.PI),bn(V,I,F,$,D,2),s.identity($),s.rotateX($,$,.5*Math.PI),bn(V,I,F,$,D,3),s.identity($),bn(V,I,F,$,D,4),s.identity($),s.rotateY($,$,Math.PI),bn(V,I,F,$,D,5),V.viewport.set([0,0,E.width,E.height])}(l,o),o.markSkyboxValid(l)):"sky"===l.renderPass&&function(E,I,L,B,V){const N=E.context,U=N.gl,D=E.transform,F=E.useProgram("skybox");N.activeTexture.set(U.TEXTURE0),U.bindTexture(U.TEXTURE_CUBE_MAP,I.skyboxTexture);const $={u_matrix:D.skyboxMatrix,u_sun_direction:I.getCenter(E,!1),u_cubemap:0,u_opacity:B,u_temporal_offset:V};E.prepareDrawProgram(N,F),F.draw(N,U.TRIANGLES,L,s.StencilMode.disabled,E.colorModeForRenderPass(),s.
1CullFaceMode.backCW,$,"skybox",I.skyboxGeometry.vertexBuffer,I.skyboxGeometry.indexBuffer,I.skyboxGeometry.segment)}(l,o,b,m,C):"gradient"===v&&"sky"===l.renderPass&&function(E,I,L,B,V){const N=E.context,U=N.gl,D=E.transform,F=E.useProgram("skyboxGradient");I.skyboxGeometry||(I.skyboxGeometry=new Bs(N)),N.activeTexture.set(U.TEXTURE0);let $=I.colorRampTexture;$||($=I.colorRampTexture=new s.Texture(N,I.colorRamp,U.RGBA)),$.bind(U.LINEAR,U.CLAMP_TO_EDGE);const W=(te=D.skyboxMatrix,ne=I.getCenter(E,!1),ie=I.paint.get("sky-gradient-radius"),se=B,ae=V,{u_matrix:te,u_color_ramp:0,u_center_direction:ne,u_radius:s.degToRad(ie),u_opacity:se,u_temporal_offset:ae});var te,ne,ie,se,ae;E.prepareDrawProgram(N,F),F.draw(N,U.TRIANGLES,L,s.StencilMode.disabled,E.colorModeForRenderPass(),s.CullFaceMode.backCW,W,"skyboxGradient",I.skyboxGeometry.vertexBuffer,I.skyboxGeometry.indexBuffer,I.skyboxGeometry.segment)}(l,o,b,m,C)},debug:function(l,n,o){for(let h=0;h<o.length;h++)Xr(l,n,o[h])},custom:function(l,n,o,h){const d=l.context,m=o.implementation;if(!l.transform.projection.unsupportedLayers||!l.transform.projection.unsupportedLayers.includes("custom")||l.terrain&&(l.terrain.renderingToTexture||"offscreen"===l.renderPass)&&o.isLayerDraped()){if("offscreen"===l.renderPass){const y=m.prerender;if(y){if(l.setCustomLayerDefaults(),d.setColorMode(l.colorModeForRenderPass()),"globe"===l.transform.projection.name){const v=l.transform.pointMerc;y.call(m,d.gl,l.transform.customLayerMatrix(),l.transform.getProjection(),l.transform.globeToMercatorMatrix(),s.globeToMercatorTransition(l.transform.zoom),[v.x,v.y],l.transform.pixelsPerMeterRatio)}else y.call(m,d.gl,l.transform.customLayerMatrix());d.setDirty(),l.setBaseState()}}else if("translucent"===l.renderPass){if(l.terrain&&l.terrain.renderingToTexture){const v=m.renderToTile;if(v){const b=h[0].canonical,C=new s.MercatorCoordinate(b.x+h[0].wrap*(1<<b.z),b.y,b.z);d.setDepthMode(s.DepthMode.disabled),d.setStencilMode(s.StencilMode.disabled),d.setColorMode(l.colorModeForRenderPass()),l.setCustomLayerDefaults(),v.call(m,d.gl,C),d.setDirty(),l.setBaseState()}return}l.setCustomLayerDefaults(),d.setColorMode(l.colorModeForRenderPass()),d.setStencilMode(s.StencilMode.disabled);const y="3d"===m.renderingMode?new s.DepthMode(l.context.gl.LEQUAL,s.DepthMode.ReadWrite,l.depthRangeFor3D):l.depthModeForSublayer(0,s.DepthMode.ReadOnly);if(d.setDepthMode(y),"globe"===l.transform.projection.name){const v=l.transform.pointMerc;m.render(d.gl,l.transform.customLayerMatrix(),l.transform.getProjection(),l.transform.globeToMercatorMatrix(),s.globeToMercatorTransition(l.transform.zoom),[v.x,v.y],l.transform.pixelsPerMeterRatio)}else m.render(d.gl,l.transform.customLayerMatrix());d.setDirty(),l.setBaseState(),d.bindFramebuffer.set(null)}}else s.warnOnce("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")}};class ra{constructor(n,o,h=!1){this.context=new Fe(n,h),this.transform=o,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.setup(),this.numSublayers=s.SourceCache.maxUnderzooming+s.SourceCache.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={}}updateTerrain(n,o){const h=!!n&&!!n.terrain&&this.transform.projection.supportsTerrain;if(!(h||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new As(this,n));const d=this._terrain;this.transform.elevation=h?d:null,d.update(n,this.transform,o)}_updateFog(n){const o=n.fog;if(!o||"globe"===this.transform.projection.name||o.getOpacity(this.transform.pitch)<1||o.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[h,d]=o.getFovAdjustedRange(this.transform._fov);if(h>d)return void(this.transform.fogCullDistSq=null);const m=h+.78*(d-h);this.transform.fogCullDistSq=m*m}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(n,o){if(this.width=n*s.exported.devicePixelRatio,this.height=o*s.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const h of this.style.order)this.style._layers[h].resize()}setup(){const n=this.context,o=new s.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(s.EXTENT,0),o.emplaceBack(0,s.EXTENT),o.emplaceBack(s.EXTENT,s.EXTENT),this.tileExtentBuffer=n.createVertexBuffer(o,s.posAttributes.members),this.tileExtentSegments=s.SegmentVector.simpleSegment(0,0,4,2);const h=new s.StructArrayLayout2i4;h.emplaceBack(0,0),h.emplaceBack(s.EXTENT,0),h.emplaceBack(0,s.EXTENT),h.emplaceBack(s.EXTENT,s.EXTENT),this.debugBuffer=n.createVertexBuffer(h,s.posAttributes.members),this.debugSegments=s.SegmentVector.simpleSegment(0,0,4,5);const d=new s.StructArrayLayout2i4;d.emplaceBack(-1,-1),d.emplaceBack(1,-1),d.emplaceBack(-1,1),d.emplaceBack(1,1),this.viewportBuffer=n.createVertexBuffer(d,s.posAttributes.members),this.viewportSegments=s.SegmentVector.simpleSegment(0,0,4,2);const m=new s.StructArrayLayout4i8;m.emplaceBack(0,0,0,0),m.emplaceBack(s.EXTENT,0,s.EXTENT,0),m.emplaceBack(0,s.EXTENT,0,s.EXTENT),m.emplaceBack(s.EXTENT,s.EXTENT,s.EXTENT,s.EXTENT),this.mercatorBoundsBuffer=n.createVertexBuffer(m,s.boundsAttributes.members),this.mercatorBoundsSegments=s.SegmentVector.simpleSegment(0,0,4,2);const y=new s.StructArrayLayout3ui6;y.emplaceBack(0,1,2),y.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=n.createIndexBuffer(y);const v=new s.StructArrayLayout1ui2;for(const C of[0,1,3,2,0])v.emplaceBack(C);this.debugIndexBuffer=n.createIndexBuffer(v),this.emptyTexture=new s.Texture(n,new s.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),n.gl.RGBA),this.identityMat=s.create();const b=this.context.gl;this.stencilClearMode=new s.StencilMode({func:b.ALWAYS,mask:0},0,255,b.ZERO,b.ZERO,b.ZERO),this.loadTimeStamps.push(s.window.performance.now()),this.atmosphereBuffer=new Fc(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(n){return n._makeTileBoundsBuffers(this.context,this.transform.projection),n._tileBoundsBuffer?{tileBoundsBuffer:n._tileBoundsBuffer,tileBoundsIndexBuffer:n._tileBoundsIndexBuffer,tileBoundsSegments:n._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const n=this.context,o=n.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(n,o.TRIANGLES,s.DepthMode.disabled,this.stencilClearMode,s.ColorMode.disabled,s.CullFaceMode.disabled,Mo(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(n,o,h){if(!o||this.currentStencilSource===o.id||!n.isTileClipped()||!h||0===h.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let v=!1;for(const b of h)if(void 0===this._tileClippingMaskIDs[b.key]){v=!0;break}if(!v)return}this.currentStencilSource=o.id;const d=this.context,m=d.gl;this.nextStencilID+h.length>
1256&&this.clearStencil(),d.setColorMode(s.ColorMode.disabled),d.setDepthMode(s.DepthMode.disabled);const y=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const v of h){const b=o.getTile(v),C=this._tileClippingMaskIDs[v.key]=this.nextStencilID++,{tileBoundsBuffer:E,tileBoundsIndexBuffer:I,tileBoundsSegments:L}=this.getTileBoundsBuffers(b);y.draw(d,m.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:m.ALWAYS,mask:0},C,255,m.KEEP,m.KEEP,m.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,Mo(v.projMatrix),"$clipping",E,I,L)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const n=this.nextStencilID++,o=this.context.gl;return new s.StencilMode({func:o.NOTEQUAL,mask:255},n,255,o.KEEP,o.KEEP,o.REPLACE)}stencilModeForClipping(n){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(n);const o=this.context.gl;return new s.StencilMode({func:o.EQUAL,mask:255},this._tileClippingMaskIDs[n.key],0,o.KEEP,o.KEEP,o.REPLACE)}stencilConfigForOverlap(n){const o=this.context.gl,h=n.sort((y,v)=>v.overscaledZ-y.overscaledZ),d=h[h.length-1].overscaledZ,m=h[0].overscaledZ-d+1;if(m>1){this.currentStencilSource=void 0,this.nextStencilID+m>256&&this.clearStencil();const y={};for(let v=0;v<m;v++)y[v+d]=new s.StencilMode({func:o.GEQUAL,mask:255},v+this.nextStencilID,255,o.KEEP,o.KEEP,o.REPLACE);return this.nextStencilID+=m,[y,h]}return[{[d]:s.StencilMode.disabled},h]}colorModeForRenderPass(){const n=this.context.gl;return this._showOverdrawInspector?new s.ColorMode([n.CONSTANT_COLOR,n.ONE],new s.Color(.125,.125,.125,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?s.ColorMode.unblended:s.ColorMode.alphaBlended}depthModeForSublayer(n,o,h){if(!this.opaquePassEnabledForLayer())return s.DepthMode.disabled;const d=1-((1+this.currentLayer)*this.numSublayers+n)*this.depthEpsilon;return new s.DepthMode(h||this.context.gl.LEQUAL,o,[d,d])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(n,o){this.style=n,this.options=o,this.imageManager=n.imageManager,this.glyphManager=n.glyphManager,this.symbolFadeChange=n.placement.symbolFadeChange(s.exported.now()),this.imageManager.beginFrame();const h=this.style.order,d=this.style._sourceCaches;for(const C in d){const E=d[C];E.used&&E.prepare(this.context)}const m={},y={},v={};for(const C in d){const E=d[C];m[C]=E.getVisibleCoordinates(),y[C]=m[C].slice().reverse(),v[C]=E.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let C=0;C<h.length;C++)if(this.style._layers[h[C]].is3D()){this.opaquePassCutoff=C;break}if(this.terrain&&(this.terrain.updateTileBinding(v),this.opaquePassCutoff=0),"globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new s.GlobeSharedBuffers(this.context)),!s.isMapAuthenticated(this.context.gl))return;this.renderPass="offscreen";for(const C of h){const E=this.style._layers[C],I=n._getLayerSourceCache(E);if(!E.hasOffscreenPass()||E.isHidden(this.transform.zoom))continue;const L=I?y[I.id]:void 0;
1("custom"===E.type||E.isSky()||L&&L.length)&&this.renderLayer(this,I,E,L)}this.depthRangeFor3D=[0,1-(n.order.length+2)*this.numSublayers*this.depthEpsilon];const b=this.terrain;if(b&&(this.style.hasSymbolLayers()||this.style.hasCircleLayers())&&b.drawDepth(),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]),this.context.clear({color:o.showOverdrawInspector?s.Color.black:s.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=o.showOverdrawInspector,this.renderPass="opaque",!this.terrain)for(this.currentLayer=h.length-1;this.currentLayer>=0;this.currentLayer--){const C=this.style._layers[h[this.currentLayer]],E=n._getLayerSourceCache(C);if(C.isSky())continue;const I=E?y[E.id]:void 0;this._renderTileClippingMasks(C,E,I),this.renderLayer(this,E,C,I)}if(this.style.fog&&this.transform.projection.supportsFog&&function(C,E){const I=C.context,L=I.gl,B=C.transform,V=new s.DepthMode(L.LEQUAL,s.DepthMode.ReadOnly,[0,1]),N=C.useProgram("globeAtmosphere",null,"globe"===B.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),U=s.globeToMercatorTransition(B.zoom),D=E.properties.get("color").toArray01(),F=E.properties.get("high-color").toArray01(),$=E.properties.get("space-color").toArray01PremultipliedAlpha(),W=s.identity$1([]);s.rotateY$1(W,W,-s.degToRad(B._center.lng)),s.rotateX$1(W,W,s.degToRad(B._center.lat)),s.rotateZ$1(W,W,B.angle),s.rotateX$1(W,W,-B._pitch);const te=s.fromQuat(new Float32Array(16),W),ne=s.mapValue(E.properties.get("star-intensity"),0,1,0,.25),se=s.mapValue(E.properties.get("horizon-blend"),0,1,5e-4,.25),ae=s.globeUseCustomAntiAliasing(C,I,B)&&5e-4===se?B.worldSize/(2*Math.PI*1.025)-1:B.globeRadius,me=C.frameCounter/1e3%1,ke=s.length(B.globeCenterInViewSpace),he=Math.sqrt(Math.pow(ke,2)-Math.pow(ae,2)),Ee=Math.acos(he/ke),_e={u_frustum_tl:B.frustumCorners.TL,u_frustum_tr:B.frustumCorners.TR,u_frustum_br:B.frustumCorners.BR,u_frustum_bl:B.frustumCorners.BL,u_horizon:B.frustumCorners.horizon,u_transition:U,u_fadeout_range:se,u_color:D,u_high_color:F,u_space_color:$,u_star_intensity:ne,u_star_size:5*s.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:me,u_horizon_angle:Ee,u_rotation_matrix:te};C.prepareDrawProgram(I,N);const De=C.atmosphereBuffer;De&&N.draw(I,L.TRIANGLES,V,s.StencilMode.disabled,s.ColorMode.alphaBlended,s.CullFaceMode.backCW,_e,"skybox",De.vertexBuffer,De.indexBuffer,De.segments)}(this,this.style.fog),this.renderPass="sky",(s.globeToMercatorTransition(this.transform.zoom)>0||"globe"!==this.transform.projection.name)&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer<h.length;this.currentLayer++){const C=this.style._layers[h[this.currentLayer]],E=n._getLayerSourceCache(C);C.isSky()&&this.renderLayer(this,E,C,E?y[E.id]:void 0)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<h.length;){const C=this.style._layers[h[this.currentLayer]],E=n._getLayerSourceCache(C);if(C.isSky()){++this.currentLayer;continue}if(this.terrain&&this.style.isLayerDraped(C)){if(C.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer);continue}const I=E?("symbol"===C.type?v:y)[E.id]:void 0;this._renderTileClippingMasks(C,E,E?m[E.id]:void 0),this.renderLayer(this,E,C,I),++this.currentLayer}if(this.terrain&&this.terrain.postRender(),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let C=null;s.values(this.style._layers).forEach(E=>{const I=n._getLayerSourceCache(E);I&&!E.isHidden(this.transform.zoom)&&(!C||C.getSource().maxzoom<I.getSource().maxzoom)&&(C=I)}),C&&this.options.showTileBoundaries&&Co.debug(this,C,C.getVisibleCoordinates())}this.options.showPadding&&function(C){const E=C.transform.padding;yr(C,C.transform.height-(E.top||0),3,Ni),yr(C,E.bottom||0,3,rn),Bn(C,E.left||0,3,ir),Bn(C,C.transform.width-(E.right||0),3,mn);const I=C.transform.centerPoint;var L,B,V,N;fn(L=C,(B=I.x)-1,(V=C.transform.height-I.y)-10,2,20,N=nr),fn(L,B-10,V-1,20,2,N)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(s.window.performance.now()),this.saveC
1anvasCopy())}renderLayer(n,o,h,d){h.isHidden(this.transform.zoom)||("background"===h.type||"sky"===h.type||"custom"===h.type||d&&d.length)&&(this.id=h.id,this.gpuTimingStart(h),(!n.transform.projection.unsupportedLayers||!n.transform.projection.unsupportedLayers.includes(h.type)||n.terrain&&"custom"===h.type)&&Co[h.type](n,o,h,d,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(n){if(!this.options.gpuTiming)return;const o=this.context.extTimerQuery;let h=this.gpuTimers[n.id];h||(h=this.gpuTimers[n.id]={calls:0,cpuTime:0,query:o.createQueryEXT()}),h.calls++,o.beginQueryEXT(o.TIME_ELAPSED_EXT,h.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const n=this.context.extTimerQuery,o=n.createQueryEXT();this.deferredRenderGpuTimeQueries.push(o),n.beginQueryEXT(n.TIME_ELAPSED_EXT,o)}}gpuTimingDeferredRenderEnd(){if(!this.options.gpuTimingDeferredRender)return;const n=this.context.extTimerQuery;n.endQueryEXT(n.TIME_ELAPSED_EXT)}gpuTimingEnd(){if(!this.options.gpuTiming)return;const n=this.context.extTimerQuery;n.endQueryEXT(n.TIME_ELAPSED_EXT)}collectGpuTimers(){const n=this.gpuTimers;return this.gpuTimers={},n}collectDeferredRenderGpuQueries(){const n=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],n}queryGpuTimers(n){const o={};for(const h in n){const d=n[h],m=this.context.extTimerQuery,y=m.getQueryObjectEXT(d.query,m.QUERY_RESULT_EXT)/1e6;
1m.deleteQueryEXT(d.query),o[h]=y}return o}queryGpuTimeDeferredRender(n){if(!this.options.gpuTimingDeferredRender)return 0;const o=this.context.extTimerQuery;let h=0;for(const d of n)h+=o.getQueryObjectEXT(d,o.QUERY_RESULT_EXT)/1e6,o.deleteQueryEXT(d);return h}translatePosMatrix(n,o,h,d,m){if(!h[0]&&!h[1])return n;const y=m?"map"===d?this.transform.angle:0:"viewport"===d?-this.transform.angle:0;if(y){const C=Math.sin(y),E=Math.cos(y);h=[h[0]*E-h[1]*C,h[0]*C+h[1]*E]}const v=[m?h[0]:bi(o,h[0],this.transform.zoom),m?h[1]:bi(o,h[1],this.transform.zoom),0],b=new Float32Array(16);return s.translate(b,n,v),b}saveTileTexture(n){const o=this._tileTextures[n.size[0]];o?o.push(n):this._tileTextures[n.size[0]]=[n]}getTileTexture(n){const o=this._tileTextures[n];return o&&o.length>0?o.pop():null}isPatternMissing(n){return null===n||void 0!==n&&!this.imageManager.getPattern(n.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const n=this.terrain&&this.terrain.renderingToTexture,o=this.terrain&&0===this.terrain.exaggeration(),h=this.style&&this.style.fog,d=[];return this.terrainRenderModeElevated()&&d.push("TERRAIN"),"globe"===this.transform.projection.name&&d.push("GLOBE"),o&&d.push("ZERO_EXAGGERATION"),h&&!n&&0!==h.getOpacity(this.transform.pitch)&&d.push("FOG"),n&&d.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&d.push("OVERDRAW_INSPECTOR"),d}useProgram(n,o,h){this.cache=this.cache||{};const d=h||[],m=this.currentGlobalDefines().concat(d),y=Ct.cacheKey(ws[n],n,m,o);return this.cache[y]||(this.cache[y]=new Ct(this.context,n,ws[n],o,Fa[n],m)),this.cache[y]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const n=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(n.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=s.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new s.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(n,o,h){if(this.terrain&&this.terrain.renderingToTexture)return;const d=this.style.fog;if(d){const m=d.getOpacity(this.transform.pitch),y=((v,b,C,E,I,L,B,V,N,U,D)=>{const F=v.transform,$=b.properties.get("color").toArray01();$[3]=E;const W=v.frameCounter/1e3%1;return{u_fog_matrix:C?F.calculateFogTileMatrix(C):v.identityMat,u_fog_range:b.getFovAdjustedRange(F._fov),u_fog_color:$,u_fog_horizon_blend:b.properties.get("horizon-blend"),u_fog_temporal_offset:W,u_frustum_tl:I,u_frustum_tr:L,u_frustum_br:B,u_frustum_bl:V,u_globe_pos:N,u_globe_radius:U,u_viewport:D,u_globe_transition:s.globeToMercatorTransition(F.zoom),u_is_globe:+("globe"===F.projection.name)}})(this,d,h,m,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*s.exported.devicePixelRatio,this.transform.height*s.exported.devicePixelRatio]);o.setFogUniformValues(n,y)}}setTileLoadedFlag(n){this.tileLoaded=n}saveCanvasCopy(){const n=this.canvasCopy();n&&(this.frameCopies.push(n),this.tileLoaded=!1)}canvasCopy(){const n=this.context.gl,o=n.createTexture();return n.bindTexture(n.TEXTURE_2D,o),n.copyTexImage2D(n.TEXTURE_2D,0,n.RGBA,0,0,n.drawingBufferWidth,n.drawingBufferHeight,0),o}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const n=this.style&&this.style.fog;return!!n&&0!==n.getOpacity(this.transform.pitch)}
vendor: 6,759 bytes, line 1
1getBackgroundTiles(){const n=this._backgroundTiles,o=this._backgroundTiles={},h=this.transform.coveringTiles({tileSize:512});for(const d of h)o[d.key]=n[d.key]||new s.Tile(d,512,this.transform.tileZoom,this);return o}clearBackgroundTiles(){this._backgroundTiles={}}}class Ns{constructor(n=0,o=0,h=0,d=0){if(isNaN(n)||n<0||isNaN(o)||o<0||isNaN(h)||h<0||isNaN(d)||d<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=n,this.bottom=o,this.left=h,this.right=d}interpolate(n,o,h){return null!=o.top&&null!=n.top&&(this.top=s.number(n.top,o.top,h)),null!=o.bottom&&null!=n.bottom&&(this.bottom=s.number(n.bottom,o.bottom,h)),null!=o.left&&null!=n.left&&(this.left=s.number(n.left,o.left,h)),null!=o.right&&null!=n.right&&(this.right=s.number(n.right,o.right,h)),this}getCenter(n,o){const h=s.clamp((this.left+n-this.right)/2,0,n),d=s.clamp((this.top+o-this.bottom)/2,0,o);return new s.Point(h,d)}equals(n){return this.top===n.top&&this.bottom===n.bottom&&this.left===n.left&&this.right===n.right}clone(){return new Ns(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Vs(l,n){const o=s.getColumn(l,3);s.fromQuat(l,n),s.setColumn(l,3,o)}function Tt(l,n){const o=s.identity$1([]);return s.rotateZ$1(o,o,-n),s.rotateX$1(o,o,-l),o}function Na(l,n){const o=[l[0],l[1],0],h=[n[0],n[1],0];if(s.length(o)>=1e-15){const y=s.normalize([],o);s.scale$2(h,y,s.dot(h,y)),n[0]=h[0],n[1]=h[1]}const d=s.cross([],n,l);if(s.len(d)<1e-15)return null;const m=Math.atan2(-d[1],d[0]);return Tt(Math.atan2(Math.sqrt(l[0]*l[0]+l[1]*l[1]),-l[2]),m)}class Bc{constructor(n,o){this.position=n,this.orientation=o}get position(){return this._position}set position(n){if(n){const o=n instanceof s.MercatorCoordinate?n:new s.MercatorCoordinate(n[0],n[1],n[2]);this._renderWorldCopies&&(o.x=s.wrap(o.x,0,1)),this._position=o}else this._position=null}lookAtPoint(n,o){if(this.orientation=null,!this.position)return;const h=this.position,d=this._elevation?this._elevation.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(n)):0,m=s.MercatorCoordinate.fromLngLat(n,d),y=[m.x-h.x,m.y-h.y,m.z-h.z];o||(o=[0,0,1]),o[2]=Math.abs(o[2]),this.orientation=Na(y,o)}setPitchBearing(n,o){this.orientation=Tt(s.degToRad(n),s.degToRad(-o))}}class Us{constructor(n,o){this._transform=s.identity([]),this.orientation=o,this.position=n}get mercatorPosition(){const n=this.position;return new s.MercatorCoordinate(n[0],n[1],n[2])}get position(){const n=s.getColumn(this._transform,3);return[n[0],n[1],n[2]]}set position(n){var o;n&&s.setColumn(this._transform,3,[(o=n)[0],o[1],o[2],1])}get orientation(){return this._orientation}set orientation(n){this._orientation=n||s.identity$1([]),n&&Vs(this._transform,this._orientation)}getPitchBearing(){const n=this.forward(),o=this.right();return{bearing:Math.atan2(-o[1],o[0]),pitch:Math.atan2(Math.sqrt(n[0]*n[0]+n[1]*n[1]),-n[2])}}setPitchBearing(n,o){this._orientation=Tt(n,o),Vs(this._transform,this._orientation)}forward(){const n=s.getColumn(this._transform,2);return[-n[0],-n[1],-n[2]]}up(){const n=s.getColumn(this._transform,1);return[-n[0],-n[1],-n[2]]}right(){const n=s.getColumn(this._transform,0);return[n[0],n[1],n[2]]}getCameraToWorld(n,o){const h=new Float64Array(16);return s.invert(h,this.getWorldToCamera(n,o)),h}getWorldToCameraPosition(n,o,h){const d=this.position;s.scale$2(d,d,-n);const m=new Float64Array(16);return s.fromScaling(m,[h,h,h]),s.translate(m,m,d),m[10]*=o,m}getWorldToCamera(n,o){const h=new Float64Array(16),d=new Float64Array(4),m=this.position;return s.conjugate(d,this._orientation),s.scale$2(m,m,-n),s.fromQuat(h,d),s.translate(h,h,m),h[1]*=-1,h[5]*=-1,h[9]*=-1,h[13]*=-1,h[8]*=o,h[9]*=o,h[10]*=o,h[11]*=o,h}getCameraToClipPerspective(n,o,h,d){const m=new Float64Array(16);return s.perspective(m,n,o,h,d),m}getDistanceToElevation(n,o=!1){const h=0===n?0:s.mercatorZfromAltitude(n,o?s.latFromMercatorY(this.position[1]):this.position[1]),d=this.forward();return(h-this.position[2])/d[2]}clone(){return new Us([...this.position],[...this.orientation])}}function oa(l,n){const o=js(l.projection,l.zoom,l.width,l.height),h=function(m,y,v,b,C){const E=new s.LngLat(v.lng-180*br,v.lat),I=new s.LngLat(v.lng+180*br,v.lat),L=m.project(E.lng,E.lat),B=m.project(I.lng,I.lat),V=-Math.atan2(B.y-L.y,B.x-L.x),N=s.MercatorCoordinate.fromLngLat(v);N.y=s.clamp(N.y,-1+br,1-br);const U=N.toLngLat(),D=m.project(U.lng,U.lat),F=s.MercatorCoordinate.fromLngLat(U);F.x+=br;const $=F.toLngLat(),W=m.project($.lng,$.lat),te=Gs(W.x-D.x,W.y-D.y,V),ne=s.MercatorCoordinate.fromLngLat(U);ne.y+=br;const ie=ne.toLngLat(),se=m.project(ie.lng,ie.lat),ae=Gs(se.x-D.x,se.y-D.y,V),me=Math.abs(te.x)/Math.abs(ae.y),ke=s.identity([]);s.rotateZ(ke,ke,-V*(1-(C?0:b)));const he=s.identity([]);return s.scale(he,he,[1,1-(1-me)*b,1]),he[4]=-ae.x/ae.y*b,s.rotateZ(he,he,V),s.multiply(he,ke,he),he}(l.projection,0,l.center,o,n),d=Nc(l);return s.scale(h,h,[d,d,1]),h}function Nc(l){const n=l.projection,o=js(l.projection,l.zoom,l.width,l.height),h=Vc(n,l.center),d=Vc(n,s.LngLat.convert(n.center));return Math.pow(2,h*o+(1-o)*d)}function js(l,n,o,h,d=1/0){const m=l.range;if(!m)return 0;const y=Math.min(d,Math.max(o,h)),v=Math.log(y/1024)/Math.LN2;return s.smoothstep(m[0]+v,m[1]+v,n)}const br=1/4e4;function Vc(l,n){const o=s.clamp(n.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),h=new s.LngLat(n.lng-180*br,o),d=new s.LngLat(n.lng+180*br,o),m=l.project(h.lng,o),y=l.project(d.lng,o),v=s.MercatorCoordinate.fromLngLat(h),b=s.MercatorCoordinate.fromLngLat(d),C=y.x-m.x,E=y.y-m.y,I=b.x-v.x,L=b.y-v.y,B=Math.sqrt((I*I+L*L)/(C*C+E*E));return Math.log(B)/Math.LN2}function Gs(l,n,o){const h=Math.cos(o),d=Math.sin(o);return{x:l*h-n*d,y:l*d+n*h}}class aa{constructor(n,o,h,d,m,y,v){this.tileSize=512,this._renderWorldCopies=void 0===m||m,this._minZoom=n||0,this._maxZoom=o||22,this._minPitch=null==h?0:h,this._maxPitch=null==d?60:d,this.setProjection(y),this.setMaxBounds(v),this.width=0,this.height=0,this._center=new s.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Ns,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new Us,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const n=new aa(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return n._elevation=this._elevation,n._centerAltitude=this._centerAltitude,n._centerAltitudeValidForE
1xaggeration=this._centerAltitudeValidForExaggeration,n.tileSize=this.tileSize,n.mercatorFromTransition=this.mercatorFromTransition,n.width=this.width,n.height=this.height,n.cameraElevationReference=this.cameraElevationReference,n._center=this._center,n._setZoom(this.zoom),n._seaLevelZoom=this._seaLevelZoom,n.angle=this.angle,n._fov=this._fov,n._pitch=this._pitch,n._nearZ=this._nearZ,n._farZ=this._farZ,n._averageElevation=this._averageElevation,n._unmodified=this._unmodified,n._edgeInsets=this._edgeInsets.clone(),n._camera=this._camera.clone(),n._calcMatrices(),n.freezeTileCoverage=this.freezeTileCoverage,n.frustumCorners=this.frustumCorners,n}get elevation(){return this._elevation}set elevation(n){this._elevation!==n&&(this._elevation=n,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(n,o=!1){const h=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(null==this._seaLevelZoom||h)&&this._updateCameraOnTerrain(),(n||h)&&this._constrainCamera(o),this._calcMatrices()}getProjection(){return s.pick(this.projection,["name","center","parallels"])}setProjection(n){this.projectionOptions=n||{name:"mercator"};const o=this.projection?this.getProjection():void 0;this.projection=s.getProjection(this.projectionOptions);const h=!Ie(o,this.getProjection());return h&&this._calcMatrices(),this.mercatorFromTransition=!1,h}setMercatorFromTransition(){const n=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=s.getProjection({name:"mercator"});const o=n!==this.projection.name;return o&&this._calcMatrices(),o}get minZoom(){return this._minZoom}set minZoom(n){this._minZoom!==n&&(this._minZoom=n,this.zoom=Math.max(this.zoom,n))}get maxZoom(){return this._maxZoom}set maxZoom(n){this._maxZoom!==n&&(this._maxZoom=n,this.zoom=Math.min(this.zoom,n))}get minPitch(){return this._minPitch}set minPitch(n){this._minPitch!==n&&(this._minPitch=n,this.pitch=Math.max(this.pitch,n))}get maxPitch(){return this._maxPitch}set maxPitch(n){this._maxPitch!==n&&(this._maxPitch=n,this.pitch=Math.min(this.pitch,n))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(n){void 0===n?n=!0:null===n&&(n=!1),this._renderWorldCopies=n}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const n=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(n))}get cameraWorldSize(){const n=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(n))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return s.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new s.Point(this.width,this.height)}get bearing(){return s.wrap(this.rotation,-180,180)}set bearing(n){this.rotation=n}get rotation(){return-this.angle/Math.PI*180}set rotation(n){const o=-n*Math.PI/180;var h,d,m,y,v,b,C,E,I,L;this.angle!==o&&(this._unmodified=!1,this.angle=o,this._calcMatrices(),this.rotationMatrix=(h=new s.ARRAY_TYPE(4),s.ARRAY_TYPE!=Float32Array&&(h[1]=0,h[2]=0),h[0]=1,h[3]=1,h),d=this.rotationMatrix,y=this.angle,v=(m=this.rotationMatrix)[0],b=m[1],C=m[2],E=m[3],I=Math.sin(y),L=Math.cos(y),d[0]=v*L+C*I,d[1]=b*L+E*I,d[2]=v*-I+C*L,d[3]=b*-I+E*L)}get pitch(){return this._pitch/Math.PI*180}set pitch(n){const o=s.clamp(n,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==o&&(this._unmodified=!1,this._pitch=o,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const n=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/n)}set fov(n){n=Math.max(.01,Math.min(60,n)),this._fov!==n&&(this._unmodified=!1,this._fov=s.degToRad(n),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(n){this._averageElevation=n,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(n){const o=Math.min(Math.max(n,this.minZoom),this.maxZoom);this._zoom!==o&&(this._unmodified=!1,this._setZoom(o),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(n){this._zoom=n,this.scale=this.zoomScale(n),this.tileZoom=Math.floor(n),this.zoomFraction=n-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForE
vendor: 5,074 bytes, line 1
1xaggeration=void 0);const n=this._elevation;this._centerAltitude=n.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=n.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){void 0!==this._centerAltitudeValidForExaggeration&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const n=this._elevation,o=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],h=this.horizonLineFromTop();let d=0,m=0;for(let y=0;y<o.length;y++){const v=new s.Point(o[y][0]*this.width,h+o[y][1]*(this.height-h)),b=n.pointCoordinate(v);if(!b)continue;const C=1/Math.hypot(b[0]-this._camera.position[0],b[1]-this._camera.position[1]);d+=b[3]*C,m+=C}return 0===m?NaN:d/m}get center(){return this._center}set center(n){n.lat===this._center.lat&&n.lng===this._center.lng||(this._unmodified=!1,this._center=n,this._terrainEnabled()&&("ground"===this.cameraElevationReference?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(null==this._seaLevelZoom||!this._elevation)return;const n=this._seaLevelZoom,o=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),h=this.pixelsPerMeter/this.worldSize*o,d=this._mercatorZfromZoom(n),m=this._mercatorZfromZoom(this._maxZoom),y=Math.max(d-h,m);this._setZoom(this._zoomFromMercatorZ(y))}get padding(){return this._edgeInsets.toJSON()}set padding(n){this._edgeInsets.equals(n)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,n,1),this._calcMatrices())}computeZoomRelativeTo(n){const o=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,n.toAltitude()));let h;h=n.z<this._camera.position[2]?[o.x,o.y,o.z]:[n.x,n.y,n.z];const d=s.length(s.sub([],this._camera.position,h));return s.clamp(this._zoomFromMercatorZ(d),this._minZoom,this._maxZoom)}setFreeCameraOptions(n){if(!this.height||!n.position&&!n.orientation)return;this._updateCameraState();let o=!1;if(n.orientation&&!s.exactEquals(n.orientation,this._camera.orientation)&&(o=this._setCameraOrientation(n.orientation)),n.position){const h=[n.position.x,n.position.y,n.position.z];s.exactEquals$1(h,this._camera.position)||(this._setCameraPosition(h),o=!0)}o&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const n=this._camera.position,o=new Bc;return o.position=new s.MercatorCoordinate(n[0],n[1],n[2]),o.orientation=this._camera.orientation,o._elevation=this.elevation,o._renderWorldCopies=this.renderWorldCopies,o}_setCameraOrientation(n){if(!s.length$1(n))return!1;s.normalize$1(n,n);const o=s.transformQuat([],[0,0,-1],n),h=s.transformQuat([],[0,-1,0],n);if(h[2]<0)return!1;const d=Na(o,h);return!!d&&(this._camera.orientation=d,!0)}_setCameraPosition(n){const o=this.zoomScale(this.minZoom)*this.tileSize,h=this.zoomScale(this.maxZoom)*this.tileSize,d=this.cameraToCenterDistance;n[2]=s.clamp(n[2],d/h,d/o),this._camera.position=n}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(n){return this._edgeInsets.equals(n)}interpolatePadding(n,o,h){this._unmodified=!1,this._edgeInsets.interpolate(n,o,h),this._constrain(),this._calcMatrices()}coveringZoomLevel(n){const o=(n.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/n.tileSize));return Math.max(0,o)}getVisibleUnwrappedCoordinates(n){const o=[new s.UnwrappedTileID(0,n)];if(this.renderWorldCopies){const h=this.pointCoordinate(new s.Point(0,0)),d=this.pointCoordinate(new s.Point(this.width,0)),m=this.pointCoordinate(new s.Point(this.width,this.height)),y=this.pointCoordinate(new s.Point(0,this.height)),v=Math.floor(Math.min(h.x,d.x,m.x,y.x)),b=Math.floor(Math.max(h.x,d.x,m.x,y.x)),C=1;for(let E=v-C;E<=b+C;E++)0!==E&&o.push(new s.UnwrappedTileID(E,n))}return o}coveringTiles(n){let o=this.coveringZoomLevel(n);const h=o,d=this.elevation&&!n.isTerrainDEM,m="mercator"===this.projection.name;if(void 0!==n.minzoom&&o<n.minzoom)return[];void 0!==n.maxzoom&&o>n.maxzoom&&(o=n.maxzoom);const y=this.locationCoordinate(this.center),v=this.center.lat,b=1<<o,C=[b*y.x,b*y.y,0],E="globe"===this.projection.name,I=!E,L=s.Frustum.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,o,I),B=E?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),V=b*s.mercatorZfromAltitude(1,this.center.lat),N=this._camera.position[2]/s.mercatorZfromAltitude(1,this.center.lat),U=[b*B.x,b*B.y,N*(I?1:V)],D=this.cameraToCenterDistance/n.tileSize*(n.roundZoom?1:.502),F=this.pitch<=60&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace?o:0,$=n.isTerrainDEM&&this._elevation?1e4*this._elevation.exaggeration():this._centerAltitude,W=n.isTerrainDEM?-$:this._elevation?this._elevation.getMinElevationBelowMSL():0,te=this.projection.isReprojectedInTileSpace?Nc(this):1,ne=pe=>
1{const Pe=new s.MercatorCoordinate(pe.x+25e-6,pe.y,pe.z),Se=new s.MercatorCoordinate(pe.x,pe.y+25e-6,pe.z),Re=pe.toLngLat(),Ke=Pe.toLngLat(),ot=Se.toLngLat(),We=this.locationCoordinate(Re),et=this.locationCoordinate(Ke),bt=this.locationCoordinate(ot),yt=Math.hypot(et.x-We.x,et.y-We.y),Ye=Math.hypot(bt.x-We.x,bt.y-We.y);return Math.sqrt(yt*Ye)*te/25e-6},ie=pe=>{const Me=$,Pe=W;return{aabb:s.tileAABB(this,b,0,0,0,pe,Pe,Me,this.projection),zoom:0,x:0,y:0,minZ:Pe,maxZ:Me,wrap:pe,fullyVisible:!1}},se=[];let ae=[];const me=o,ke=n.reparseOverscaled?h:o,he=pe=>pe*pe,Ee=he((N-this._centerAltitude)*V),_e=pe=>{if(!this._elevation||!pe.tileID||!m)return;const Me=this._elevation.getMinMaxForTile(pe.tileID),Pe=pe.aabb;Me?(Pe.min[2]=Me.min,Pe.max[2]=Me.max,Pe.center[2]=(Pe.min[2]+Pe.max[2])/2):(pe.shouldSplit=De(pe),pe.shouldSplit||(Pe.min[2]=Pe.max[2]=Pe.center[2]=this._centerAltitude))},De=pe=>{if(pe.zoom<F)return!0;if(pe.zoom===me)return!1;if(null!=pe.shouldSplit)return pe.shouldSplit;const Me=pe.aabb.distanceX(U),Pe=pe.aabb.distanceY(U);let Se=Ee,Re=1;if(E){Se=he(pe.aabb.distanceZ(U));const We=Math.pow(2,pe.zoom),et=s.latFromMercatorY((pe.y+1)/We),bt=s.latFromMercatorY(pe.y/We),yt=Math.min(Math.max(v,et),bt),Ye=s.circumferenceAtLatitude(yt)/s.circumferenceAtLatitude(v);if(Re=yt===v?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,Ye/this._mercatorScaleRatio),this.zoom<=s.GLOBE_ZOOM_THRESHOLD_MIN&&pe.zoom===me-1&&Ye>=.9)return!0}else if(d&&(Se=he(pe.aabb.distanceZ(U)*V)),this.projection.isReprojectedInTileSpace&&h<=5){const We=Math.pow(2,pe.zoom),et=ne(new s.MercatorCoordinate((pe.x+.5)/We,(pe.y+.5)/We));Re=et>.85?1:et}const Ke=Me*Me+Pe*Pe+Se;return Ke<he((1<<me-pe.zoom)*D*Re*((We,et)=>{if(et*he(.707)<We)return 1;const bt=Math.sqrt(et/We);return bt/(1.4144271570014144+(Math.pow(1.1,bt-1.4144271570014144+1)-1)/(1.1-1)-1)})(Math.max(Se,Ee),Ke))};if(this.renderWorldCopies)for(let pe=1;pe<=3;pe++)se.push(ie(-pe)),se.push(ie(pe));for(se.push(ie(0));se.length>0;){const pe=se.pop(),Me=pe.x,Pe=pe.y;let Se=pe.fullyVisible;if(!Se){const Re=pe.aabb.intersects(L);if(0===Re)continue;Se=2===Re}if(pe.zoom!==me&&De(pe))for(let Re=0;Re<4;Re++){const Ke=(Me<<1)+Re%2,ot=(Pe<<1)+(Re>>1),We={aabb:m?pe.aabb.quadrant(Re):s.tileAABB(this,b,pe.zoom+1,Ke,ot,pe.wrap,pe.minZ,pe.maxZ,this.projection),zoom:pe.zoom+1,x:Ke,y:ot,wrap:pe.wrap,fullyVisible:Se,tileID:void 0,shouldSplit:void 0,minZ:pe.minZ,maxZ:pe.maxZ};d&&!E&&(We.tileID=new s.OverscaledTileID(pe.zoom+1===me?ke:pe.zoom+1,pe.wrap,pe.zoom+1,Ke,ot),_e(We)),se.push(We)}else{const Re=pe.zoom===me?ke:pe.zoom;if(n.minzoom&&n.minzoom>Re)continue;const Ke=C[0]-(.5+Me+(pe.wrap<<pe.zoom))*(1<<o-pe.zoom),ot=C[1]-.5-Pe,We=pe.tileID?pe.tileID:new s.OverscaledTileID(Re,pe.wrap,pe.zoom,Me,Pe);ae.push({tileID:We,distanceSq:Ke*Ke+ot*ot})}}if(this.fogCullDistSq){const pe=this.fogCullDistSq,Me=this.horizonLineFromTop();ae=ae.filter(Pe=>{const Se=[0,0,0,1],Re=[s.EXTENT,s.EXTENT,0,1],Ke=this.calculateFogTileMatrix(Pe.tileID.toUnwrapped());s.transformMat4$1(Se,Se,Ke),s.transformMat4$1(Re,Re,Ke);const ot=s.getAABBPointSquareDist(Se,Re);if(0===ot)return!0;let We=!1;const et=this._elevation;if(et&&ot>pe&&0!==Me){const bt=this.calculateProjMatrix(Pe.tileID.toUnwrapped());let yt;n.isTerrainDEM||(yt=et.getMinMaxForTile(Pe.tileID)),yt||(yt={min:W,max:$});const Ye=s.furthestTileCorner(this.rotation),zt=[Ye[0]*s.EXTENT,Ye[1]*s.EXTENT,yt.max];s.transformMat4(zt,zt,bt),We=(1-zt[1])*this.height*.5<Me}return ot<pe||We})}return ae.sort((pe,Me)=>pe.distanceSq-Me.distanceSq).map(pe=>pe.tileID)}resize(n,o){this.width=n,this.height=o,this.pixelsToGLUnits=[2/n,-2/o],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(n){return Math.pow(2,n)}scaleZoom(n){return Math.log(n)/Math.LN2}project(n){const o=s.clamp(n.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),h=this.projection.project(n.lng,o);return new s.Point(h.x*this.worldSize,h.y*this.worldSize)}unproject(n){return this.projection.unproject(n.x/this.worldSize,n.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/s.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(n,o){let h,d;const m=this.centerPoint;if("globe"===this.projection.name){const v=this.worldSize;h=(o.x-m.x)/v,d=(o.y-m.y)/v}else{const v=this.pointCoordinate(o),b=this.pointCoordinate(m);h=v.x-b.x,d=v.y-b.y}const y=this.locationCoordinate(n);this.setLocation(new s.MercatorCoordinate(y.x-h,y.y-d))}setLocation(n){this.center=this.coordinateLocation(n),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(n){return this.projection.locationPoint(this,n)}locationPoint3D(n){return this.projection.locationPoint(this,n,!0)}pointLocation(n){return this.coordinateLocation(this.pointCoordinate(n))}pointLocation3D(n){return this.coordinateLocation(this.pointCoordinate3D(n))}locationCoordinate(n,o){const h=o?s.mercatorZfromAltitude(o,n.lat):void 0,d=this.projection.project(n.lng,n.lat);return new s.MercatorCoordinate(d.x,d.y,h)}coordinateLocation(n){return this.projection.unproject(n.x,n.y)}pointRayIntersection(n,o){const h=null!=o?o:this._centerAltitude,d=[n.x,n.y,0,1],m=[n.x,n.y,1,1];s.transformMat4$1(d,d,this.pixelMatrixInverse),s.transformMat4$1(m,m,this.pixelMatrixInverse);const y=m[3];s.scale$1(d,d,1/d[3]),s.scale$1(m,m,1/y);const v=d[2],b=m[2];return{p0:d,p1:m,t:v===b?0:(h-v)/(b-v)}}screenPointToMercatorRay(n){const o=[n.x,n.y,0,1],h=[n.x,n.y,1,1];return s.transformMat4$1(o,o,this.pixelMatrixInverse),s.transformMat4$1(h,h,this.pixelMatrixInverse),s.scale$1(o,o,1/o[3]),s.scale$1(h,h,1/h[3]),o[2]=s.mercatorZfromAltitude(o[2],this._center.lat)*this.worldSize,h[2]=s.mercatorZfromAltitude(h[2],this._center.lat)*this.worldSize,s.scale$1(o,o,1/this.worldSize),s.scale$1(h,h,1/this.worldSize),new s.Ray([o[0],o[1],o[2]],s.normalize([],s.sub([],h,o)))}rayIntersectionCoordinate(n){const{p0:o,p1:h,t:d}=n,m=s.mercatorZfromAltitude(o[2],this._center.lat),y=s.mercatorZfromAltitude(h[2],this._center.lat);return new s.MercatorCoordinate(s.number(o[0],h[0],d)/this.worldSize,s.number(o[1],h[1],d)/this.worldSize,s.number(m,y,d))}pointCoordinate(n,o=this._centerAltitude){return this.projection.pointCoordinate(this,n.x,n.y,o)}pointCoordinate3D(n){if(!this.elevation)return this.pointCoordinate(n);let o=this.projection.pointCoordinate3D(this,n.x,n.y);if(o)return new s.MercatorCoordinate(o[0],o[1],o[2]);let h=0,d=this.horizonLineFromTop();if(n.y>d)return this.pointCoordinate(n);const m=.02*d,y=n.clone();for(let v=0;v<10&&d-h>m;v++){y.y=s.number(h,d,.66);const b=this.projection.pointCoordinate3D(this,y.x,y.y);b?(d=y.y,o=b):h=y.y}return o?new s.MercatorCoordinate(o[0],o[1],o[2]):this.pointCoordinate(n)}isPointAboveHorizon(n){return this.projection.isPointAboveHorizon(this,n)}isPointOnSurface(n){if(n.y<0||n.y>this.height||n.x<0||n.x>this.width)return!1;if(this.elevation||this.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(n);const o=this.pointCoordinate(n);return o.y>=0&&o.y<=1}_coordinatePoint(n,o){const h=o&&this.elevation?this.elevation.getAtPointOrZero(n,this._centerAltitude):this._centerAltitude,d=[n.x*this.worldSize,n.y*this.worldSize,h+n.toAltitude(),1];return s.transformMat4$1(d,d,this.pixelMatrix),d[3]>0?new s.Point(d[0]/d[3],d[1]/d[3]):new s.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:n,left:o}=this._edgeInsets,h=this.height-this._edgeInsets.bottom,d=this.width-this._edgeInsets.right,m=this.pointLocation3D(new s.Point(o,n)),y=this.pointLocation3D(new s.Point(d,n)),v=this.pointLocation3D(new s.Point(d,h)),b=this.pointLocation3D(new s.Point(o,h));let C=Math.min(m.lng,y.lng,v.lng,b.lng),E=Math.max(m.lng,y.lng,v.lng,b.lng),I=Math.min(m.lat,y.lat,v.lat,b.lat),L=Math.max(m.lat,y.lat,v.lat,b.lat);const B=Math.pow(2,-this.zoom)/16*270,V="globe"===this.projection.name?1:4,N=(U,D,F,$,W)=>{const te=(U+F)/2,ne=(D+$)/2,ie=new s.Point(te,ne),{lng:se,lat:ae}=this.pointLocation3D(ie),me=Math.max(0,C-se,I-ae,se-E,ae-L);C=Math.min(C,se),E=Math.max(E,se),I=Math.min(I,ae),L=Math.max(L,ae),(W<V||me>B)&&(N(U,D,te,ne,W+1),N(te,ne,F,$,W+1))};if(N(o,n,d,n,1),N(d,n,d,h,1),N(d,h,o,h,1),N(o,h,o,n,1),"globe"===this.projection.name){const[U,D]=s.polesInViewport(this);U?(L=90,E=180,C=-180):D&&(I=-90,E=180,C=-180)}return new s.LngLatBounds(new s.LngLat(C,I),new s.LngLat(E,L))}_getBoundsRectangular(n,o){const{top:h,left:d}=this._edgeInsets,m=this.height-this._edgeInsets.bottom,y=this.width-this._edgeInsets.right,v=new s.Point(d,h),b=new s.Point(y,h),C=new s.Point(y,m),E=new s.Point(d,m);let I=this.pointCoordinate(v,n),L=this.pointCoordinate(b,n);const B=this.pointCoordinate(C,o),V=this.pointCoordinate(E,o),N=(U,D)=>(D.y-U.y)/(D.x-U.x);return I.y>1&&L.y>=0?I=new s.MercatorCoordinate((1-V.y)/N(V,I)+V.x,1):I.y<0&&L.y<=1&&(I=new s.MercatorCoordinate(-V.y/N(V,I)+V.x,0)),L.y>1&&I.y>=0?L=new s.MercatorCoordinate((1-B.y)/N(B,L)+B.x,1):L.y<0&&I.y<=1&&(L=new s.MercatorCoordinate(-B.y/N(B,L)+B.x,0)),(new s.LngLatBounds).extend(this.coordinateLocation(I)).extend(this.coordinateLocation(L)).extend(this.coordinateLocation(V)).extend(this.coordinateLocation(B))}_getBoundsRectangularTerrain(){const n=this.elevation;if(!n.visibleDemTiles.length||n.isUsingMockSource())return this._getBoundsRectangular(0,0);const o=n.visibleDemTiles.reduce((h,d)=>
1{if(d.dem){const m=d.dem.tree;h.min=Math.min(h.min,m.minimums[0]),h.max=Math.max(h.max,m.maximums[0])}return h},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(o.min*n.exaggeration(),o.max*n.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(n=!0){const o=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,h=this.height/2-o*(1-this._horizonShift);return n?Math.max(0,h):h}getMaxBounds(){return this.maxBounds}setMaxBounds(n){this.maxBounds=n,this.minLat=-s.MAX_MERCATOR_LATITUDE,this.maxLat=s.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,n&&(this.minLat=n.getSouth(),this.maxLat=n.getNorth(),this.minLng=n.getWest(),this.maxLng=n.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=s.mercatorXfromLng(this.minLng)*this.tileSize,this.worldMaxX=s.mercatorXfromLng(this.maxLng)*this.tileSize,this.worldMinY=s.mercatorYfromLat(this.maxLat)*this.tileSize,this.worldMaxY=s.mercatorYfromLat(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(n,o){return this.projection.createTileMatrix(this,o,n)}calculateDistanceTileData(n){const o=n.key,h=this._distanceTileDataCache;if(h[o])return h[o];const d=n.canonical,m=1/this.height,y=this.cameraWorldSize,v=y/this.zoomScale(d.z),b=(d.x+Math.pow(2,d.z)*n.wrap)*v,C=d.y*v,E=this.point;E.x*=y/this.worldSize,E.y*=y/this.worldSize;const I=this.angle,L=Math.sin(-I),B=-Math.cos(-I);return h[o]={bearing:[L,B],center:[(E.x-b)*m,(E.y-C)*m],scale:v/s.EXTENT*m},h[o]}calculateFogTileMatrix(n){const o=n.key,h=this._fogTileMatrixCache;if(h[o])return h[o];const d=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,n);return s.multiply(d,this.worldToFogMatrix,d),h[o]=new Float32Array(d),h[o]}calculateProjMatrix(n,o=!1){const h=n.key,d=o?this._alignedProjMatrixCache:this._projMatrixCache;if(d[h])return d[h];const m=this.calculatePosMatrix(n,this.worldSize);return s.multiply(m,this.projection.isReprojectedInTileSpace?this.mercatorMatrix:o?this.alignedProjMatrix:this.projMatrix,m),d[h]=new Float32Array(m),d[h]}calculatePixelsToTileUnitsMatrix(n){const o=n.tileID.key,h=this._pixelsToTileUnitsCache;if(h[o])return h[o];const d=function(m,y){const{scale:v}=m.tileTransform,b=v*s.EXTENT/(m.tileSize*Math.pow(2,y.zoom-m.tileID.overscaledZ+m.tileID.canonical.z));return C=new Float32Array(4),L=(E=y.inverseAdjustmentMatrix)[1],B=E[2],V=E[3],U=(I=[b,b])[1],C[0]=E[0]*(N=I[0]),C[1]=L*N,C[2]=B*U,C[3]=V*U,C;var C,E,I,L,B,V,N,U}(n,this);return h[o]=d,h[o]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if("globe"===this.projection.name){const n=1/this.worldSize,o=s.fromScaling([],[n,n,n]);return s.multiply(o,o,this.globeMatrix),o}}recenterOnTerrain(){if(!this._elevation||"globe"===this.projection.name)return;const n=this._elevation;this._updateCameraState();const o=s.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,h=this._computeCameraPosition(o),d=this._camera.forward(),m=s.mercatorZfromAltitude(1,this._center.lat);h[2]/=m,d[2]/=m,s.normalize(d,d);const y=n.raycast(h,d,n.exaggeration());if(y){const v=s.scaleAndAdd([],h,d,y),b=new s.MercatorCoordinate(v[0],v[1],s.mercatorZfromAltitude(v[2],s.latFromMercatorY(v[1]))),C=(b.z+s.length([b.x-h[0],b.y-h[1],b.z-h[2]*m]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(C),this._centerAltitude=b.toAltitude(),this._center=this.coordinateLocation(b),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(n=!1){if(!this._elevation)return;const o=this._elevation,h=s.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,d=this._computeCameraPosition(h),m=o.getAtPointOrZero(new s.MercatorCoordinate(...d)),y=this.pixelsPerMeter/this.worldSize*m,v=this._minimumHeightOverTerrain(),b=d[2]-y;if(b<=v)if(b<0||n){const C=this.locationCoordinate(this._center,this._centerAltitude),E=[d[0],d[1],C.z-d[2]],I=s.length(E);E[2]-=(v-b)/this._pixelsPerMercatorPixel;const L=s.length(E);if(0===L)return;s.scale$2(E,E,I/L*this._pixelsPerMercatorPixel),this._camera.position=[d[0],d[1],C.z*this._pixelsPerMercatorPixel-E[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const n="globe"===this.projection.name||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||n){const L=this.center;return L.lat=s.clamp(L.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!n)&&(L.lng=s.clamp(L.lng,this.minLng,this.maxLng)),this.center=L,void(this._constraining=!1)}const o=this._unmodified,{x:h,y:d}=this.point;let m=0,y=h,v=d;const b=this.width/2,C=this.height/2,E=this.worldMinY*this.scale,I=this.worldMaxY*this.scale;if(d-C<E&&(v=E+C),d+C>I&&(v=I-C),I-E<this.height&&(m=Math.max(m,this.height/(I-E)),v=(I+E)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const L=this.worldMinX*this.scale,B=this.worldMaxX*this.scale,V=this.worldSize/2-(L+B)/2;y=(h+V+this.worldSize)%this.worldSize-V,y-b<L&&(y=L+b),y+b>B&&(y=B-b),B-L<this.width&&(m=Math.max(m,this.width/(B-L)),y=(B+L)/2)}y===h&&v===d||(this.center=this.unproject(new s.Point(y,v))),m&&(this.zoom+=this.scaleZoom(m)),this._constrainCamera(),this._unmodified=o,this._constraining=!1}_minZoomForBounds(){let n=Math.max(0,this.scaleZoom(this.height/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(n=Math.max(n,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),n}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}
vendor: 4,197 bytes, line 1
1_calcMatrices(){if(!this.height)return;const n=this.centerOffset,o=this.pixelsPerMeter;"globe"===this.projection.name&&(this._mercatorScaleRatio=s.mercatorZfromAltitude(1,this.center.lat)/s.mercatorZfromAltitude(1,s.GLOBE_SCALE_MATCH_LATITUDE));const h=js(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,h),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;const d="meters"===this.projection.zAxisUnit?o:1,m=this._camera.getWorldToCamera(this.worldSize,d),y=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);y[8]=2*-n.x/this.width,y[9]=2*n.y/this.height;let v=s.mul([],y,m);if(this.projection.isReprojectedInTileSpace){const ne=this.locationCoordinate(this.center),ie=s.identity([]);s.translate(ie,ie,[ne.x*this.worldSize,ne.y*this.worldSize,0]),s.multiply(ie,ie,oa(this)),s.translate(ie,ie,[-ne.x*this.worldSize,-ne.y*this.worldSize,0]),s.multiply(v,v,ie),this.inverseAdjustmentMatrix=function(se){const ae=oa(se,!0);return Ve([],[ae[0],ae[1],ae[4],ae[5]])}(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];this.mercatorMatrix=s.scale([],v,[this.worldSize,this.worldSize,this.worldSize/d,1]),this.projMatrix=v,this.invProjMatrix=s.invert(new Float64Array(16),this.projMatrix);const b=s.invert([],y);this.frustumCorners=s.FrustumCorners.fromInvProjectionMatrix(b,this.horizonLineFromTop(),this.height);const C=new Float32Array(16);s.identity(C),s.scale(C,C,[1,-1,1]),s.rotateX(C,C,this._pitch),s.rotateZ(C,C,this.angle);const E=s.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ),I=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;E[8]=2*-n.x/this.width,E[9]=2*(n.y+I)/this.height,this.skyboxMatrix=s.multiply(C,E,C);const L=this.point,B=L.x,V=L.y,N=this.width%2/2,U=this.height%2/2,D=Math.cos(this.angle),F=Math.sin(this.angle),$=B-Math.round(B)+D*N+F*U,W=V-Math.round(V)+D*U+F*N,te=new Float64Array(v);if(s.translate(te,te,[$>.5?$-1:$,W>.5?W-1:W,0]),this.alignedProjMatrix=te,v=s.create(),s.scale(v,v,[this.width/2,-this.height/2,1]),s.translate(v,v,[1,-1,0]),this.labelPlaneMatrix=v,v=s.create(),s.scale(v,v,[1,-1,1]),s.translate(v,v,[-1,-1,0]),s.scale(v,v,[2/this.width,2/this.height,1]),this.glCoordMatrix=v,this.pixelMatrix=s.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},v=s.invert(new Float64Array(16),this.pixelMatrix),!v)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=v,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=s.calculateGlobeMatrix(this);const ne=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=s.transformMat4(ne,ne,m),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=v;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const n=this.cameraWorldSizeForFog,o=this.cameraPixelsPerMeter,h=this._camera.position,d=1/this.height/this._pixelsPerMercatorPixel,m=[n,n,o];s.scale$2(m,m,d),s.scale$2(h,h,-1),s.multiply$2(h,h,m);const y=s.create();s.translate(y,y,h),s.scale(y,y,m),this.mercatorFogMatrix=y,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(n,o,d)}_computeCameraPosition(n){const o=(n=n||this.pixelsPerMeter)/this.pixelsPerMeter,h=this._camera.forward(),d=this.point,m=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*o-n/this.worldSize*this._centerAltitude;return[d.x/this.worldSize-h[0]*m,d.y/this.worldSize-h[1]*m,n/this.worldSize*this._centerAltitude-h[2]*m]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(n){const o=this._maxCameraBoundsDistance()*Math.cos(this._pitch),h=this._camera.position[2],d=n[2];let m=1;this.projection.wrap&&(this.center=this.center.wrap()),d>
10&&(m=Math.min((o-h)/d,1)),this._camera.position=s.scaleAndAdd([],this._camera.position,n,m),this._updateStateFromCamera()}_updateStateFromCamera(){const n=this._camera.position,o=this._camera.forward(),{pitch:h,bearing:d}=this._camera.getPitchBearing(),m=s.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,y=this._mercatorZfromZoom(this._maxZoom)*Math.cos(s.degToRad(this._maxPitch)),v=Math.max((n[2]-m)/Math.cos(h),y),b=this._zoomFromMercatorZ(v);s.scaleAndAdd(n,n,o,v),this._pitch=s.clamp(h,s.degToRad(this.minPitch),s.degToRad(this.maxPitch)),this.angle=s.wrap(d,-Math.PI,Math.PI),this._setZoom(s.clamp(b,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new s.MercatorCoordinate(n[0],n[1],n[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(n){return Math.pow(2,n)*this.tileSize}_mercatorZfromZoom(n){return this.cameraToCenterDistance/this._worldSizeFromZoom(n)}_minimumHeightOverTerrain(){const n=Math.min((null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(n)}_zoomFromMercatorZ(n){return this.scaleZoom(this.cameraToCenterDistance/(n*this.tileSize))}zoomFromMercatorZAdjusted(n){let o=0,h=s.GLOBE_ZOOM_THRESHOLD_MAX,d=0,m=1/0;for(;h-o>1e-6&&h>o;){const y=o+.5*(h-o),v=this.tileSize*Math.pow(2,y),b=this.getCameraToCenterDistance(this.projection,y,v),C=this.scaleZoom(b/(n*this.tileSize)),E=Math.abs(y-C);E<m&&(m=E,d=y),y<C?o=y:h=y}return d}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(s.warnOnce("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(n,o){const h=Math.min(n.x,o.x),d=Math.max(n.x,o.x),m=Math.min(n.y,o.y),y=Math.max(n.y,o.y);if(m<this.horizonLineFromTop(!1))return!0;if("mercator"!==this.projection.name)return!1;const v=[new s.Point(h,m),new s.Point(d,y),new s.Point(h,y),new s.Point(d,m)],b=this.renderWorldCopies?-3:0,C=this.renderWorldCopies?4:1;for(const E of v){const I=this.pointRayIntersection(E);if(I.t<0)return!0;const L=this.rayIntersectionCoordinate(I);if(L.x<b||L.y<0||L.x>C||L.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+s.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new s.Point(0,0),new s.Point(this.width,this.height))}zoomDeltaToMovement(n,o){const h=s.length(s.sub([],this._camera.position,n)),d=this._zoomFromMercatorZ(h)+o;return h-this._mercatorZfromZoom(d)}getCameraPoint(){if("globe"===this.projection.name){const n=function([o,h,d],m){const y=[o,h,d,1];s.transformMat4$1(y,y,m);const v=y[3]=Math.max(y[3],1e-6);return y[0]/=v,y[1]/=v,y[2]/=v,y}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new s.Point(n[0],n[1])}{const n=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new s.Point(0,n))}}getCameraToCenterDistance(n,o=this.zoom,h=this.worldSize){const d=js(n,o,this.width,this.height,1024),m=n.pixelSpaceConversion(this.center.lat,h,d);return.5/Math.tan(.5*this._fov)*this.height*m}getWorldToCameraMatrix(){const n=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&s.multiply(n,n,this.globeMatrix),n}}function sa(l,n){let o=!1,h=null;const d=()=>{h=null,o&&(l(),h=setTimeout(d,n),o=!1)};return()=>(o=!0,h||d(),h)}class Ll{constructor(n){this._hashName=n&&encodeURIComponent(n),s.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=sa(this._updateHashUnthrottled.bind(this),300)}addTo(n){return this._map=n,s.window.addEventListener("hashchange",this._onHashChange,!1),n.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),s.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const n=this._map;if(!n)return"";const o=Va(n);if(this._hashName){const h=this._hashName;let d=!1;const m=s.window.location.hash.slice(1).split("&").map(y=>{const v=y.split("=")[0];return v===h?(d=!0,`${v}=${o}`):y}).filter(y=>y);return d||m.push(`${h}=${o}`),`#${m.join("&")}`}return`#${o}`}_getCurrentHash(){const n=s.window.location.hash.replace("#","");if(this._hashName){let o;return n.split("&").map(h=>
1h.split("=")).forEach(h=>{h[0]===this._hashName&&(o=h)}),(o&&o[1]||"").split("/")}return n.split("/")}_onHashChange(){const n=this._map;if(!n)return!1;const o=this._getCurrentHash();if(o.length>=3&&!o.some(h=>isNaN(h))){const h=n.dragRotate.isEnabled()&&n.touchZoomRotate.isEnabled()?+(o[3]||0):n.getBearing();return n.jumpTo({center:[+o[2],+o[1]],zoom:+o[0],bearing:h,pitch:+(o[4]||0)}),!0}return!1}_updateHashUnthrottled(){const n=s.window.location.href.replace(/(#.+)?$/,this.getHashString());s.window.history.replaceState(s.window.history.state,null,n)}}function Va(l,n){const o=l.getCenter(),h=Math.round(100*l.getZoom())/100,d=Math.ceil((h*Math.LN2+Math.log(512/360/.5))/Math.LN10),m=Math.pow(10,d),y=Math.round(o.lng*m)/m,v=Math.round(o.lat*m)/m,b=l.getBearing(),C=l.getPitch();let E=n?`/${y}/${v}/${h}`:`${h}/${v}/${y}`;return(b||C)&&(E+="/"+Math.round(10*b)/10),C&&(E+=`/${Math.round(C)}`),E}const Ua={linearity:.3,easing:s.bezier(0,0,.3,1)},Zs=s.extend({deceleration:2500,maxSpeed:1400},Ua),$s=s.extend({deceleration:20,maxSpeed:1400},Ua),$e=s.extend({deceleration:1e3,maxSpeed:360},Ua),Nn=s.extend({deceleration:1e3,maxSpeed:90},Ua);class Uc{constructor(n){this._map=n,this.clear()}clear(){this._inertiaBuffer=[]}record(n){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:s.exported.now(),settings:n})}_drainInertiaBuffer(){const n=this._inertiaBuffer,o=s.exported.now();for(;n.length>0&&o-n[0].time>160;)n.shift()}_onMoveEnd(n){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const o={zoom:0,bearing:0,pitch:0,pan:new s.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:m}of this._inertiaBuffer)o.zoom+=m.zoomDelta||0,o.bearing+=m.bearingDelta||0,o.pitch+=m.pitchDelta||0,m.panDelta&&o.pan._add(m.panDelta),m.around&&(o.around=m.around),m.pinchAround&&(o.pinchAround=m.pinchAround);const h=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,d={};if(o.pan.mag()){const m=Ga(o.pan.mag(),h,s.extend({},Zs,n||{}));d.offset=o.pan.mult(m.amount/o.pan.mag()),d.center=this._map.transform.center,ja(d,m)}if(o.zoom){const m=Ga(o.zoom,h,$s);d.zoom=this._map.transform.zoom+m.amount,ja(d,m)}if(o.bearing){const m=Ga(o.bearing,h,$e);d.bearing=this._map.transform.bearing+s.clamp(m.amount,-179,179),ja(d,m)}if(o.pitch){const m=Ga(o.pitch,h,Nn);d.pitch=this._map.transform.pitch+m.amount,ja(d,m)}if(d.zoom||d.bearing){const m=void 0===o.pinchAround?o.around:o.pinchAround;d.around=m?this._map.unproject(m):this._map.getCenter()}return this.clear(),d.noMoveStart=!0,d}}function ja(l,n){(!l.duration||l.duration<n.duration)&&(l.duration=n.duration,l.easing=n.easing)}function Ga(l,n,o){const{maxSpeed:h,linearity:d,deceleration:m}=o,y=s.clamp(l*d/(n/1e3),-h,h),v=Math.abs(y)/(m*d);return{easing:o.easing,duration:1e3*v,amount:y*(v/2)}}class Di extends s.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(n,o,h,d={}
vendor: 8,489 bytes, line 1
1){const m=Bi(o.getCanvasContainer(),h),y=o.unproject(m);super(n,s.extend({point:m,lngLat:y,originalEvent:h},d)),this._defaultPrevented=!1,this.target=o}}class Za extends s.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(n,o,h){const d="touchend"===n?h.changedTouches:h.touches,m=hr(o.getCanvasContainer(),d),y=m.map(b=>o.unproject(b)),v=m.reduce((b,C,E,I)=>b.add(C.div(I.length)),new s.Point(0,0));super(n,{points:m,point:v,lngLats:y,lngLat:o.unproject(v),originalEvent:h}),this._defaultPrevented=!1}}class qs extends s.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(n,o,h){super(n,{originalEvent:h}),this._defaultPrevented=!1}}class Rl{constructor(n,o){this._map=n,this._clickTolerance=o.clickTolerance}reset(){this._mousedownPos=void 0}wheel(n){return this._firePreventable(new qs(n.type,this._map,n))}mousedown(n,o){return this._mousedownPos=o,this._firePreventable(new Di(n.type,this._map,n))}mouseup(n){this._map.fire(new Di(n.type,this._map,n))}preclick(n){const o=s.extend({},n);o.type="preclick",this._map.fire(new Di(o.type,this._map,o))}click(n,o){this._mousedownPos&&this._mousedownPos.dist(o)>=this._clickTolerance||(this.preclick(n),this._map.fire(new Di(n.type,this._map,n)))}dblclick(n){return this._firePreventable(new Di(n.type,this._map,n))}mouseover(n){this._map.fire(new Di(n.type,this._map,n))}mouseout(n){this._map.fire(new Di(n.type,this._map,n))}touchstart(n){return this._firePreventable(new Za(n.type,this._map,n))}touchmove(n){this._map.fire(new Za(n.type,this._map,n))}touchend(n){this._map.fire(new Za(n.type,this._map,n))}touchcancel(n){this._map.fire(new Za(n.type,this._map,n))}_firePreventable(n){if(this._map.fire(n),n.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ws{constructor(n){this._map=n}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(n){this._map.fire(new Di(n.type,this._map,n))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Di("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(n){this._delayContextMenu?this._contextMenuEvent=n:this._map.fire(new Di(n.type,this._map,n)),this._map.listens("contextmenu")&&n.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class jc{constructor(n,o){this._map=n,this._el=n.getCanvasContainer(),this._container=n.getContainer(),this._clickTolerance=o.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(n,o){this.isEnabled()&&n.shiftKey&&0===n.button&&(Zi(),this._startPos=this._lastPos=o,this._active=!0)}mousemoveWindow(n,o){if(!this._active)return;const h=o,d=this._startPos,m=this._lastPos;if(!d||!m||m.equals(h)||!this._box&&h.dist(d)<this._clickTolerance)return;this._lastPos=h,this._box||(this._box=vt("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",n));const y=Math.min(d.x,h.x),v=Math.max(d.x,h.x),b=Math.min(d.y,h.y),C=Math.max(d.y,h.y);this._map._requestDomTask(()=>{this._box&&(this._box.style.transform=`translate(${y}px,${b}px)`,this._box.style.width=v-y+"px",this._box.style.height=C-b+"px")})}mouseupWindow(n,o){if(!this._active)return;const h=this._startPos,d=o;if(h&&0===n.button){if(this.reset(),Pr(),h.x!==d.x||h.y!==d.y)return this._map.fire(new s.Event("boxzoomend",{originalEvent:n})),{cameraAnimation:m=>m.fitScreenCoordinates(h,d,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",n)}}keydown(n){this._active&&27===n.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",n))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),Zn(),delete this._startPos,delete this._lastPos}_fireEvent(n,o){return this._map.fire(new s.Event(n,{originalEvent:o}))}}function Xs(l,n){const o={};for(let h=0;h<l.length;h++)o[l[h].identifier]=n[h];return o}class la{constructor(n){this.reset(),this.numTouches=n.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(n,o,h){(this.centroid||h.length>this.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=n.timeStamp),h.length===this.numTouches&&(this.centroid=function(d){const m=new s.Point(0,0);for(const y of d)m._add(y);return m.div(d.length)}(o),this.touches=Xs(h,o)))}touchmove(n,o,h){if(this.aborted||!this.centroid)return;const d=Xs(h,o);for(const m in this.touches){const y=d[m];(!y||y.dist(this.touches[m])>30)&&(this.aborted=!0)}}touchend(n,o,h){if((!this.centroid||n.timeStamp-this.startTime>500)&&(this.aborted=!0),0===h.length){const d=!this.aborted&&this.centroid;if(this.reset(),d)return d}}}class Ol{constructor(n){this.singleTap=new la(n),this.numTaps=n.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(n,o,h){this.singleTap.touchstart(n,o,h)}touchmove(n,o,h){this.singleTap.touchmove(n,o,h)}touchend(n,o,h){const d=this.singleTap.touchend(n,o,h);if(d){const m=n.timeStamp-this.lastTime<500,y=!this.lastTap||this.lastTap.dist(d)<30;if(m&&y||this.reset(),this.count++,this.lastTime=n.timeStamp,this.lastTap=d,this.count===this.numTaps)return this.reset(),d}}}class Vh{constructor(){this._zoomIn=new Ol({numTouches:1,numTaps:2}),this._zoomOut=new Ol({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(n,o,h){this._zoomIn.touchstart(n,o,h),this._zoomOut.touchstart(n,o,h)}touchmove(n,o,h){this._zoomIn.touchmove(n,o,h),this._zoomOut.touchmove(n,o,h)}touchend(n,o,h){const d=this._zoomIn.touchend(n,o,h),m=this._zoomOut.touchend(n,o,h);return d?(this._active=!0,n.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:y.getZoom()+1,around:y.unproject(d)},{originalEvent:n})}):m?(this._active=!0,n.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:y.getZoom()-1,around:y.unproject(m)},{originalEvent:n})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Gc={0:1,2:2};class ca{constructor(n){this.reset(),this._clickTolerance=n.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(n,o){return!1}_move(n,o){return{}}mousedown(n,o){if(this._lastPoint)return;const h=Dn(n);this._correctButton(n,h)&&(this._lastPoint=o,this._eventButton=h)}mousemoveWindow(n,o){const h=this._lastPoint;if(h)if(n.preventDefault(),null!=this._eventButton&&function(d,m){const y=Gc[m];return void 0===d.buttons||(d.buttons&y)!==y}(n,this._eventButton))this.reset();else if(this._moved||!(o.dist(h)<this._clickTolerance))return this._moved=!0,this._lastPoint=o,this._move(h,o)}mouseupWindow(n){this._lastPoint&&Dn(n)===this._eventButton&&(this._moved&&Pr(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Fl extends ca{mousedown(n,o){super.mousedown(n,o),this._lastPoint&&(this._active=!0)}_correctButton(n,o){return 0===o&&!n.ctrlKey}_move(n,o){return{around:o,panDelta:o.sub(n)}}}class Bl extends ca{_correctButton(n,o){return 0===o&&n.ctrlKey||2===o}_move(n,o){const h=.8*(o.x-n.x);if(h)return this._active=!0,{bearingDelta:h}}contextmenu(n){n.preventDefault()}}class Nl extends ca{_correctButton(n,o){return 0===o&&n.ctrlKey||2===o}_move(n,o){const h=-.5*(o.y-n.y);if(h)return this._active=!0,{pitchDelta:h}}contextmenu(n){n.preventDefault()}}class Ys{constructor(n,o){this._map=n,this._el=n.getCanvasContainer(),this._minTouches=1,this._clickTolerance=o.clickTolerance||1,this.reset(),s.bindAll(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new s.Point(0,0)}touchstart(n,o,h){return this._calculateTransform(n,o,h)}touchmove(n,o,h){if(this._active&&!(h.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(1===h.length&&!s.isFullscreen())return void this._showTouchPanBlockerAlert();
vendor: 4,263 bytes, line 1
1"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return n.cancelable&&n.preventDefault(),this._calculateTransform(n,o,h)}}touchend(n,o,h){this._calculateTransform(n,o,h),this._active&&h.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(n,o,h){h.length>0&&(this._active=!0);const d=Xs(h,o),m=new s.Point(0,0),y=new s.Point(0,0);let v=0;for(const C in d){const E=d[C],I=this._touches[C];I&&(m._add(E),y._add(E.sub(I)),v++,d[C]=E)}if(this._touches=d,v<this._minTouches||!y.mag())return;const b=y.div(v);return this._sum._add(b),this._sum.mag()<this._clickTolerance?void 0:{around:m.div(v),panDelta:b}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=vt("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")},500)}}class $a{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(n){}_move(n,o,h){return{}}touchstart(n,o,h){this._firstTwoTouches||h.length<2||(this._firstTwoTouches=[h[0].identifier,h[1].identifier],this._start([o[0],o[1]]))}touchmove(n,o,h){const d=this._firstTwoTouches;if(!d)return;n.preventDefault();const[m,y]=d,v=qa(h,o,m),b=qa(h,o,y);if(!v||!b)return;const C=this._aroundCenter?null:v.add(b).div(2);return this._move([v,b],C,n)}touchend(n,o,h){if(!this._firstTwoTouches)return;const[d,m]=this._firstTwoTouches,y=qa(h,o,d),v=qa(h,o,m);y&&v||(this._active&&Pr(),this.reset())}touchcancel(){this.reset()}enable(n){this._enabled=!0,this._aroundCenter=!!n&&"center"===n.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function qa(l,n,o){for(let h=0;h<l.length;h++)if(l[h].identifier===o)return n[h]}function Vl(l,n){return Math.log(l/n)/Math.LN2}class Zc extends $a{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(n){this._startDistance=this._distance=n[0].dist(n[1])}_move(n,o){const h=this._distance;if(this._distance=n[0].dist(n[1]),this._active||!(Math.abs(Vl(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Vl(this._distance,h),pinchAround:o}}}function Ul(l,n){return 180*l.angleWith(n)/Math.PI}class $c extends $a{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(n){this._startVector=this._vector=n[0].sub(n[1]),this._minDiameter=n[0].dist(n[1])}_move(n,o){const h=this._vector;if(this._vector=n[0].sub(n[1]),h&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:Ul(this._vector,h),pinchAround:o}}_isBelowThreshold(n){this._minDiameter=Math.min(this._minDiameter,n.mag());const o=25/(Math.PI*this._minDiameter)*360,h=this._startVector;if(!h)return!1;const d=Ul(n,h);return Math.abs(d)<o}}function Yr(l){return Math.abs(l.y)>Math.abs(l.x)}class qc extends $a{constructor(n){super(),this._map=n}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(n){this._lastPoints=n,Yr(n[0].sub(n[1]))&&(this._valid=!1)}_move(n,o,h){const d=this._lastPoints;if(!d)return;const m=n[0].sub(d[0]),y=n[1].sub(d[1]);return this._map._cooperativeGestures&&!s.isFullscreen()&&h.touches.length<3||(this._val
vendor: 13,811 bytes, line 1
1id=this.gestureBeginsVertically(m,y,h.timeStamp),!this._valid)?void 0:(this._lastPoints=n,this._active=!0,{pitchDelta:(m.y+y.y)/2*-.5})}gestureBeginsVertically(n,o,h){if(void 0!==this._valid)return this._valid;const d=n.mag()>=2,m=o.mag()>=2;if(!d&&!m)return;if(!d||!m)return null==this._firstMove&&(this._firstMove=h),h-this._firstMove<100&&void 0;const y=n.y>0==o.y>0;return Yr(n)&&Yr(o)&&y}}const Wc={panStep:100,bearingStep:15,pitchStep:10};class Uh{constructor(){const n=Wc;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(n){if(n.altKey||n.ctrlKey||n.metaKey)return;let o=0,h=0,d=0,m=0,y=0;switch(n.keyCode){case 61:case 107:case 171:case 187:o=1;break;case 189:case 109:case 173:o=-1;break;case 37:n.shiftKey?h=-1:(n.preventDefault(),m=-1);break;case 39:n.shiftKey?h=1:(n.preventDefault(),m=1);break;case 38:n.shiftKey?d=1:(n.preventDefault(),y=-1);break;case 40:n.shiftKey?d=-1:(n.preventDefault(),y=1);break;default:return}return this._rotationDisabled&&(h=0,d=0),{cameraAnimation:v=>{const b=v.getZoom();v.easeTo({duration:300,easeId:"keyboardHandler",easing:Xc,zoom:o?Math.round(b)+o*(n.shiftKey?2:1):b,bearing:v.getBearing()+h*this._bearingStep,pitch:v.getPitch()+d*this._pitchStep,offset:[-m*this._panStep,-y*this._panStep],center:v.getCenter()},{originalEvent:n})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Xc(l){return l*(2-l)}const jl=4.000244140625;class Yc{constructor(n,o){this._map=n,this._el=n.getCanvasContainer(),this._handler=o,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,s.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(n){this._defaultZoomRate=n}setWheelZoomRate(n){this._wheelZoomRate=n}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(n){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!n&&"center"===n.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(n){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(n.ctrlKey||n.metaKey||this.isZooming()||s.isFullscreen()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let o=n.deltaMode===s.window.WheelEvent.DOM_DELTA_LINE?40*n.deltaY:n.deltaY;const h=s.exported.now(),d=h-(this._lastWheelEventTime||0);this._lastWheelEventTime=h,0!==o&&o%jl==0?this._type="wheel":0!==o&&Math.abs(o)<4?this._type="trackpad":d>400?(this._type=null,this._lastValue=o,this._timeout=setTimeout(this._onTimeout,40,n)):this._type||(this._type=Math.abs(d*o)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,o+=this._lastValue)),n.shiftKey&&o&&(o/=4),this._type&&(this._lastWheelEvent=n,this._delta-=o,this._active||this._start(n)),n.preventDefault()}_onTimeout(n){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(n)}_start(n){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const o=Bi(this._el,n);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:o,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const n=this._map.transform;"wheel"===this._type&&n.projection.wrap&&(n._center.lng>=180||n._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const o=()=>n._terrainEnabled()&&this._aroundCoord?n.computeZoomRelativeTo(this._aroundCoord):n.zoom;if(0!==this._delta){const b="wheel"===this._type&&Math.abs(this._delta)>jl?this._wheelZoomRate:this._defaultZoomRate;let C=2/(1+Math.exp(-Math.abs(this._delta*b)));this._delta<0&&0!==C&&(C=1/C);const E=o(),I=Math.pow(2,E),L="number"==typeof this._targetZoom?n.zoomScale(this._targetZoom):I;this._targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(L*C))),"wheel"===this._type&&(this._startZoom=E,this._easing=this._smoothOutEasing(200)),this._delta=0}const h="number"==typeof this._targetZoom?this._targetZoom:o(),d=this._startZoom,m=this._easing;let y,v=!1;if("wheel"===this._type&&d&&m){const b=Math.min((s.exported.now()-this._lastWheelEventTime)/200,1),C=m(b);y=s.number(d,h,C),b<1?this._frameId||(this._frameId=!0):v=!0}else y=h,v=!0;return this._active=!0,v&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!v,zoomDelta:y-o(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(n){let o=s.ease;if(this._prevEase){const h=this._prevEase,d=(s.exported.now()-h.start)/h.duration,m=h.easing(d+.01)-h.easing(d),y=.27/Math.sqrt(m*m+1e-4)*.01,v=Math.sqrt(.0729-y*y);o=s.bezier(y,v,.25,1)}return this._prevEase={start:s.exported.now(),duration:n,easing:o},o}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=vt("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(s.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")},200)}}class Hc{constructor(n,o){this._clickZoom=n,this._tapZoom=o}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Vi{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(n,o){return n.preventDefault(),{cameraAnimation:h=>{h.easeTo({duration:300,zoom:h.getZoom()+(n.shiftKey?-1:1),around:h.unproject(o)},{originalEvent:n})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class jh{constructor(){this._tap=new Ol({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(n,o,h){this._swipePoint||(this._tapTime&&n.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?h.length>0&&(this._swipePoint=o[0],this._swipeTouch=h[0].identifier):this._tap.touchstart(n,o,h))}touchmove(n,o,h){if(this._tapTime){if(this._swipePoint){if(h[0].identifier!==this._swipeTouch)return;const d=o[0],m=d.y-this._swipePoint.y;return this._swipePoint=d,n.preventDefault(),this._active=!0,{zoomDelta:m/128}}}else this._tap.touchmove(n,o,h)}touchend(n,o,h){this._tapTime?this._swipePoint&&0===h.length&&this.reset():this._tap.touchend(n,o,h)&&(this._tapTime=n.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Kc{constructor(n,o,h){this._el=n,this._mousePan=o,this._touchPan=h}enable(n){this._inertiaOptions=n||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Gh{constructor(n,o,h){this._pitchWithRotate=n.pitchWithRotate,this._mouseRotate=o,this._mousePitch=h}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Zh{constructor(n,o,h,d){this._el=n,this._touchZoom=o,this._touchRotate=h,this._tapDragZoom=d,this._rotationDisabled=!1,this._enabled=!0}enable(n){this._touchZoom.enable(n),this._rotationDisabled||this._touchRotate.enable(n),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const wn=l=>l.zoom||l.drag||l.pitch||l.rotate;class Jc extends s.Event{}class $h{constructor(){this.constants=[1,1,.01],this.radius=0}setup(n,o){const h=s.sub([],o,n);this.radius=s.length(h[2]<0?s.div([],h,this.constants):[h[0],h[1],0])}projectRay(n){s.div(n,n,this.constants),s.normalize(n,n),s.mul$1(n,n,this.constants);const o=s.scale$2([],n,this.radius);if(o[2]>0){const h=s.scale$2([],[0,0,1],s.dot(o,[0,0,1])),d=s.scale$2([],s.normalize([],[o[0],o[1],0]),this.radius),m=s.add([],o,s.scale$2([],s.sub([],s.add([],d,h),o),2));o[0]=m[0],o[1]=m[1]}return o}}function Vn(l){return l.panDelta&&l.panDelta.mag()||l.zoomDelta||l.bearingDelta||l.pitchDelta}class rr{constructor(n,o){this._map=n,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Uc(n),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new $h,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(o),s.bindAll(["handleEvent","handleWindowEvent"],this);const h=this._el;this._listeners=[[h,"touchstart",{passive:!0}],[h,"touchmove",{passive:!1}],[h,"touchend",void 0],[h,"touchcancel",void 0],[h,"mousedown",void 0],[h,"mousemove",void 0],[h,"mouseup",void 0],[s.window.document,"mousemove",{capture:!0}],[s.window.document,"mouseup",void 0],[h,"mouseover",void 0],[h,"mouseout",void 0],[h,"dblclick",void 0],[h,"click",void 0],[h,"keydown",{capture:!1}],[h,"keyup",void 0],[h,"wheel",{passive:!1}],[h,"contextmenu",void 0],[s.window,"blur",void 0]];for(const[d,m,y]of this._listeners)d.addEventListener(m,d===s.window.document?this.handleWindowEvent:this.handleEvent,y)}destroy(){for(const[n,o,h]of this._listeners)n.removeEventListener(o,n===s.window.document?this.handleWindowEvent:this.handleEvent,h)}_addDefaultHandlers(n){const o=this._map,h=o.getCanvasContainer();this._add("mapEvent",new Rl(o,n));const d=o.boxZoom=new jc(o,n);this._add("boxZoom",d);const m=new Vh,y=new Vi;o.doubleClickZoom=new Hc(y,m),this._add("tapZoom",m),this._add("clickZoom",y);const v=new jh;this._add("tapDragZoom",v);const b=o.touchPitch=new qc(o);this._add("touchPitch",b);const C=new Bl(n),E=new Nl(n);o.dragRotate=new Gh(n,C,E),this._add("mouseRotate",C,["mousePitch"]),this._add("mousePitch",E,["mouseRotate"]);const I=new Fl(n),L=new Ys(o,n);o.dragPan=new Kc(h,I,L),this._add("mousePan",I),this._add("touchPan",L,["touchZoom","touchRotate"]);const B=new $c,V=new Zc;o.touchZoomRotate=new Zh(h,V,B,v),this._add("touchRotate",B,["touchPan","touchZoom"]),this._add("touchZoom",V,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Ws(o));const N=o.scrollZoom=new Yc(o,this);this._add("scrollZoom",N,["mousePan"]);const U=o.keyboard=new Uh;this._add("keyboard",U);for(const D of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])n.interactive&&n[D]&&o[D].enable(n[D])}_add(n,o,h){this._handlers.push({handlerName:n,handler:o,allowed:h}),this._handlersById[n]=o}stop(n){if(!this._updatingCamera){for(const{handler:o}of this._handlers)o.reset();this._inertia.clear(),this._fireEvents({},{},n),this._changes=[]}}isActive(){for(const{handler:n}of this._handlers)if(n.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!wn(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(n,o,h){for(const d in n)if(d!==h&&(!o||o.indexOf(d)<0))return!0;return!1}handleWindowEvent(n){this.handleEvent(n,`${n.type}Window`)}_getMapTouches(n){const o=[];for(const h of n)this._el.contains(h.target)&&o.push(h);return o}handleEvent(n,o){this._updatingCamera=!0;const h="renderFrame"===n.type,d=h?void 0:n,m={needsRenderFrame:!1},y={},v={},b=n.touches?this._getMapTouches(n.touches):void 0,C=b?hr(this._el,b):
1h?void 0:Bi(this._el,n);for(const{handlerName:L,handler:B,allowed:V}of this._handlers){if(!B.isEnabled())continue;let N;this._blockedByActive(v,V,L)?B.reset():B[o||n.type]&&(N=B[o||n.type](n,C,b),this.mergeHandlerResult(m,y,N,L,d),N&&N.needsRenderFrame&&this._triggerRenderFrame()),(N||B.isActive())&&(v[L]=B)}const E={};for(const L in this._previousActiveHandlers)v[L]||(E[L]=d);this._previousActiveHandlers=v,(Object.keys(E).length||Vn(m))&&(this._changes.push([m,y,E]),this._triggerRenderFrame()),(Object.keys(v).length||Vn(m))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:I}=m;I&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],I(this._map))}mergeHandlerResult(n,o,h,d,m){if(!h)return;s.extend(n,h);const y={handlerName:d,originalEvent:h.originalEvent||m};void 0!==h.zoomDelta&&(o.zoom=y),void 0!==h.panDelta&&(o.drag=y),void 0!==h.pitchDelta&&(o.pitch=y),void 0!==h.bearingDelta&&(o.rotate=y)}_applyChanges(){const n={},o={},h={};for(const[d,m,y]of this._changes)d.panDelta&&(n.panDelta=(n.panDelta||new s.Point(0,0))._add(d.panDelta)),d.zoomDelta&&(n.zoomDelta=(n.zoomDelta||0)+d.zoomDelta),d.bearingDelta&&(n.bearingDelta=(n.bearingDelta||0)+d.bearingDelta),d.pitchDelta&&(n.pitchDelta=(n.pitchDelta||0)+d.pitchDelta),void 0!==d.around&&(n.around=d.around),void 0!==d.aroundCoord&&(n.aroundCoord=d.aroundCoord),void 0!==d.pinchAround&&(n.pinchAround=d.pinchAround),d.noInertia&&(n.noInertia=d.noInertia),s.extend(o,m),s.extend(h,y);this._updateMapTransform(n,o,h),this._changes=[]}_updateMapTransform(n,o,h){const d=this._map,m=d.transform,y=F=>[F.x,F.y,F.z];if((F=>{const $=this._eventsInProgress.drag;return $&&!this._handlersById[$.handlerName].isActive()})()&&!Vn(n)){const F=m.zoom;m.cameraElevationReference="sea",m.recenterOnTerrain(),m.cameraElevationReference="ground",F!==m.zoom&&this._map._update(!0)}if(m._isCameraConstrained&&d._stop(!0),!Vn(n))return void this._fireEvents(o,h,!0);let{panDelta:v,zoomDelta:b,bearingDelta:C,pitchDelta:E,around:I,aroundCoord:L,pinchAround:B}=n;m._isCameraConstrained&&(b>0&&(b=0),m._isCameraConstrained=!1),void 0!==B&&(I=B),(b||(F=>o[F]&&!this._eventsInProgress[F])("drag"))&&I&&(this._dragOrigin=y(m.pointCoordinate3D(I)),this._trackingEllipsoid.setup(m._camera.position,this._dragOrigin)),m.cameraElevationReference="sea",d._stop(!0),I=I||d.transform.centerPoint,C&&(m.bearing+=C),E&&(m.pitch+=E),m._updateCameraState();const V=[0,0,0];if(v)if("mercator"===m.projection.name){const F=this._trackingEllipsoid.projectRay(m.screenPointToMercatorRay(I).dir),$=this._trackingEllipsoid.projectRay(m.screenPointToMercatorRay(I.sub(v)).dir);V[0]=$[0]-F[0],V[1]=$[1]-F[1]}else{const F=m.pointCoordinate(I);if("globe"===m.projection.name){v=v.rotate(-m.angle);const $=m._pixelsPerMercatorPixel/m.worldSize;V[0]=-v.x*s.mercatorScale(s.latFromMercatorY(F.y))*$,V[1]=-v.y*s.mercatorScale(m.center.lat)*$}else{const $=m.pointCoordinate(I.sub(v));F&&$&&(V[0]=$.x-F.x,V[1]=$.y-F.y)}}const N=m.zoom,U=[0,0,0];if(b){const F=y(L||m.pointCoordinate3D(I)),$={dir:s.normalize([],s.sub([],F,m._camera.position))};if($.dir[2]<0){const W=m.zoomDeltaToMovement(F,b);s.scale$2(U,$.dir,W)}}const D=s.add(V,V,U);m._translateCameraConstrained(D),b&&Math.abs(m.zoom-N)>1e-4&&m.recenterOnTerrain(),m.cameraElevationReference="ground",this._map._update(),n.noInertia||this._inertia.record(n),this._fireEvents(o,h,!0)}_fireEvents(n,o,h){const d=wn(this._eventsInProgress),m=wn(n),y={};for(const E in n){const{originalEvent:I}=n[E];this._eventsInProgress[E]||(y[`${E}start`]=I),this._eventsInProgress[E]=n[E]}!d&&m&&this._fireEvent("movestart",m.originalEvent);for(const E in y)this._fireEvent(E,y[E]);m&&this._fireEvent("move",m.originalEvent);for(const E in n){const{originalEvent:I}=n[E];this._fireEvent(E,I)}const v={};let b;for(const E in this._eventsInProgress){const{handlerName:I,originalEvent:L}=this._eventsInProgress[E];this._handlersById[I].isActive()||(delete this._eventsInProgress[E],b=o[I]||L,v[`${E}end`]=b)}for(const E in v)this._fireEvent(E,v[E]);const C=wn(this._eventsInProgress);if(h&&(d||m)&&!C){this._updatingCamera=!0;const E=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),I=L=>0!==L&&-this._bearingSnap<L&&L<this._bearingSnap;
1E?(I(E.bearing||this._map.getBearing())&&(E.bearing=0),this._map.easeTo(E,{originalEvent:b})):(this._map.fire(new s.Event("moveend",{originalEvent:b})),I(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(n,o){this._map.fire(new s.Event(n,o?{originalEvent:o}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(n=>{this._frameId=void 0,this.handleEvent(new Jc("renderFrame",{timeStamp:n})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const To="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Hs extends s.Evented{constructor(n,o){super(),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=o.bearingSnap,this._respectPrefersReducedMotion=!1!==o.respectPrefersReducedMotion,s.bindAll(["_renderFrameCallback"],this)}getCenter(){return new s.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(n,o){return this.jumpTo({center:n},o)}panBy(n,o,h){return n=s.Point.convert(n).mult(-1),this.panTo(this.transform.center,s.extend({offset:n},o),h)}panTo(n,o,h){return this.easeTo(s.extend({center:n},o),h)}getZoom(){return this.transform.zoom}setZoom(n,o){return this.jumpTo({zoom:n},o),this}zoomTo(n,o,h){return this.easeTo(s.extend({zoom:n},o),h)}zoomIn(n,o){return this.zoomTo(this.getZoom()+1,n,o),this}zoomOut(n,o){return this.zoomTo(this.getZoom()-1,n,o),this}getBearing(){return this.transform.bearing}setBearing(n,o){return this.jumpTo({bearing:n},o),this}getPadding(){return this.transform.padding}setPadding(n,o){return this.jumpTo({padding:n},o),this}rotateTo(n,o,h){return this.easeTo(s.extend({bearing:n},o),h)}resetNorth(n,o){return this.rotateTo(0,s.extend({duration:1e3},n),o),this}resetNorthPitch(n,o){return this.easeTo(s.extend({bearing:0,pitch:0,duration:1e3},n),o),this}snapToNorth(n,o){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(n,o):this}getPitch(){return this.transform.pitch}setPitch(n,o){return this.jumpTo({pitch:n},o),this}cameraForBounds(n,o){n=s.LngLatBounds.convert(n);const h=o&&o.bearing||0,d=o&&o.pitch||0,m=n.getNorthWest(),y=n.getSouthEast();return this._cameraForBounds(this.transform,m,y,h,d,o)}_extendCameraOptions(n){const o={top:0,bottom:0,right:0,left:0};if("number"==typeof(n=s.extend({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding){const h=n.padding;n.padding={top:h,bottom:h,right:h,left:h}}return n.padding=s.extend(o,n.padding),n}_minimumAABBFrustumDistance(n,o){const h=o.max[0]-o.min[0],d=o.max[1]-o.min[1];return h/d>n.aspect?h/(2*Math.tan(.5*n.fovX)*n.aspect):d/(2*Math.tan(.5*n.fovY)*n.aspect)}_cameraForBoundsOnGlobe(n,o,h,d,m,y){const v=n.clone(),b=this._extendCameraOptions(y);v.bearing=d,v.pitch=m;const C=s.LngLat.convert(o),E=s.LngLat.convert(h),I=.5*(C.lat+E.lat),L=.5*(C.lng+E.lng),B=s.latLngToECEF(I,L),V=s.normalize([],B),N=s.normalize([],s.cross([],V,[0,1,0])),U=s.cross([],N,V),D=[N[0],N[1],N[2],0,U[0],U[1],U[2],0,V[0],V[1],V[2],0,0,0,0,1],F=[B,s.latLngToECEF(C.lat,C.lng),s.latLngToECEF(E.lat,C.lng),s.latLngToECEF(E.lat,E.lng),s.latLngToECEF(C.lat,E.lng),s.latLngToECEF(I,C.lng),s.latLngToECEF(I,E.lng),s.latLngToECEF(C.lat,L),s.latLngToECEF(E.lat,L)];let $=s.Aabb.fromPoints(F.map(Se=>[s.dot(N,Se),s.dot(U,Se),s.dot(V,Se)]));const W=s.transformMat4([],$.center,D);0===s.squaredLength(W)&&s.set(W,0,0,1),s.normalize(W,W),s.scale$2(W,W,s.GLOBE_RADIUS),v.center=s.ecefToLatLng(W);const te=v.getWorldToCameraMatrix(),ne=s.invert(new Float64Array(16),te);$=s.Aabb.applyTransform($,s.multiply([],te,D)),s.transformMat4(W,W,te);const ie=.5*($.max[2]-$.min[2]),se=this._minimumAABBFrustumDistance(v,$),ae=s.scale$2([],[0,0,1],ie),me=s.add(ae,W,ae),ke=se+(0===v.pitch?0:s.distance(W,me)),he=v.globeCenterInViewSpace,Ee=s.sub([],W,[he[0],he[1],he[2]]);s.normalize(Ee,Ee),s.scale$2(Ee,Ee,ke);const _e=s.add([],W,Ee);s.transformMat4(_e,_e,ne);const De=s.earthRadius/s.GLOBE_RADIUS,pe=s.length(_e),Me=s.mercatorZfromAltitude(Math.max(pe*De-s.earthRadius,Number.EPSILON),0),Pe=Math.min(v.zoomFromMercatorZAdjusted(Me),b.maxZoom);return Pe>.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(v.setProjection({name:"mercator"}),v.zoom=Pe,this._cameraForBounds(v,o,h,d,m,y)):{center:v.center,zoom:Pe,bearing:d,pitch:m}}queryTerrainElevation(n,o){const h=this.transform.elevation;return h?(o=s.extend({},{exaggerated:!0},o),h.getAtPoint(s.MercatorCoordinate.fromLngLat(n),null,o.exaggerated)):null}_cameraForBounds(n,o,h,d,m,y){if("globe"===n.projection.name)return this._cameraForBoundsOnGlobe(n,o,h,d,m,y);const v=n.clone(),b=this._extendCameraOptions(y),C=v.padding;v.bearing=d,v.pitch=m;const E=s.LngLat.convert(o),I=s.LngLat.convert(h),L=new s.LngLat(E.lng,I.lat),B=new s.LngLat(I.lng,E.lat),V=v.project(E),N=v.project(I),U=this.queryTerrainElevation(E),D=this.queryTerrainElevation(I),F=this.queryTerrainElevation(L),$=this.queryTerrainElevation(B),W=[[V.x,V.y,Math.min(U||0,D||0,F||0,$||0)],[N.x,N.y,Math.max(U||0,D||0,F||0,$||0)]];let te=s.Aabb.fromPoints(W);const ne=v.getWorldToCameraMatrix(),ie=s.invert(new Float64Array(16),ne);te=s.Aabb.applyTransform(te,ne);const se=s.sub([],te.max,te.min),ae=C.left||0,me=C.right||0,ke=C.bottom||0,he=C.top||0,{left:Ee,right:_e,top:De,bottom:pe}=b.padding,Me=.5*(ae+me),Pe=.5*(he+ke),Se=Math.min(v.scaleZoom(v.scale*Math.min((v.width-(ae+me+Ee+_e))/se[0],(v.height-(ke+he+pe+De))/se[1])),b.maxZoom),Re=v.scale/v.zoomScale(Se);te=new s.Aabb([te.min[0]-(Ee+Me)*Re,te.min[1]-(pe+Pe)*Re,te.min[2]],[te.max[0]+(_e+Me)*Re,te.max[1]+(De+Pe)*Re,te.max[2]]);const Ke=.5*se[2],ot=this._minimumAABBFrustumDistance(v,te),We=[0,0,1,0];s.transformMat4$1(We,We,ne),s.normalize$2(We,We);const et=s.scale$2([],We,ot+Ke),bt=s.add([],te.center,et),yt=("number"==typeof b.offset.x&&"number"==typeof b.offset.y?new s.Point(b.offset.x,b.offset.y):s.Point.convert(b.offset)).rotate(-s.degToRad(d));te.center[0]-=yt.x*Re,te.center[1]+=yt.y*Re,s.transformMat4(te.center,te.center,ie),s.transformMat4(bt,bt,ie);const Ye=[te.center[0],te.center[1],bt[2]*v.pixelsPerMeter];s.scale$2(Ye,Ye,1/v.worldSize);
1const zt=s.lngFromMercatorX(Ye[0]),Pt=s.latFromMercatorY(Ye[1]),Lt=Math.min(v._zoomFromMercatorZ(Ye[2]),b.maxZoom),Rt=new s.LngLat(zt,Pt);return v.mercatorFromTransition&&Lt<.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(v.setProjection({name:"globe"}),v.zoom=Lt,this._cameraForBounds(v,o,h,d,m,y)):{center:Rt,zoom:Lt,bearing:d,pitch:m}}fitBounds(n,o,h){const d=this.cameraForBounds(n,o);return this._fitInternal(d,o,h)}fitScreenCoordinates(n,o,h,d,m){const y=s.Point.convert(n),v=s.Point.convert(o),b=new s.Point(Math.min(y.x,v.x),Math.min(y.y,v.y)),C=new s.Point(Math.max(y.x,v.x),Math.max(y.y,v.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(y,v))return this;const E=this.transform.pointLocation3D(b),I=this.transform.pointLocation3D(C),L=this.transform.pointLocation3D(new s.Point(b.x,C.y)),B=this.transform.pointLocation3D(new s.Point(C.x,b.y)),V=[Math.min(E.lng,I.lng,L.lng,B.lng),Math.min(E.lat,I.lat,L.lat,B.lat)],N=[Math.max(E.lng,I.lng,L.lng,B.lng),Math.max(E.lat,I.lat,L.lat,B.lat)],U=d&&d.pitch?d.pitch:this.getPitch(),D=this._cameraForBounds(this.transform,V,N,h,U,d);return this._fitInternal(D,d,m)}_fitInternal(n,o,h){return n?(delete(o=s.extend(n,o)).padding,o.linear?this.easeTo(o,h):this.flyTo(o,h)):this}jumpTo(n,o){this.stop();const h=n.preloadOnly?this.transform.clone():this.transform;let d=!1,m=!1,y=!1;return"zoom"in n&&h.zoom!==+n.zoom&&(d=!0,h.zoom=+n.zoom),void 0!==n.center&&(h.center=s.LngLat.convert(n.center)),"bearing"in n&&h.bearing!==+n.bearing&&(m=!0,h.bearing=+n.bearing),"pitch"in n&&h.pitch!==+n.pitch&&(y=!0,h.pitch=+n.pitch),null==n.padding||h.isPaddingEqual(n.padding)||(h.padding=n.padding),n.preloadOnly?(this._preloadTiles(h),this):(this.fire(new s.Event("movestart",o)).fire(new s.Event("move",o)),d&&this.fire(new s.Event("zoomstart",o)).fire(new s.Event("zoom",o)).fire(new s.Event("zoomend",o)),m&&this.fire(new s.Event("rotatestart",o)).fire(new s.Event("rotate",o)).fire(new s.Event("rotateend",o)),y&&this.fire(new s.Event("pitchstart",o)).fire(new s.Event("pitch",o)).fire(new s.Event("pitchend",o)),this.fire(new s.Event("moveend",o)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||s.warnOnce(To),this.transform.getFreeCameraOptions()}setFreeCameraOptions(n,o){const h=this.transform;if(!h.projection.supportsFreeCamera)return s.warnOnce(To),this;this.stop();const d=h.zoom,m=h.pitch,y=h.bearing;h.setFreeCameraOptions(n);const v=d!==h.zoom,b=m!==h.pitch,C=y!==h.bearing;return this.fire(new s.Event("movestart",o)).fire(new s.Event("move",o)),v&&this.fire(new s.Event("zoomstart",o)).fire(new s.Event("zoom",o)).fire(new s.Event("zoomend",o)),C&&this.fire(new s.Event("rotatestart",o)).fire(new s.Event("rotate",o)).fire(new s.Event("rotateend",o)),b&&this.fire(new s.Event("pitchstart",o)).fire(new s.Event("pitch",o)).fire(new s.Event("pitchend",o)),this.fire(new s.Event("moveend",o)),this}easeTo(n,o){this._stop(!1,n.easeId),(!1===(n=s.extend({offset:[0,0],duration:500,easing:s.ease},n)).animate||this._prefersReducedMotion(n))&&(n.duration=0);const h=this.transform,d=this.getZoom(),m=this.getBearing(),y=this.getPitch(),v=this.getPadding(),b="zoom"in n?+n.zoom:d,C="bearing"in n?this._normalizeBearing(n.bearing,m):m,E="pitch"in n?+n.pitch:y,I="padding"in n?n.padding:h.padding,L=s.Point.convert(n.offset);let B,V,N;if("globe"===h.projection.name){const ae=s.MercatorCoordinate.fromLngLat(h.center),me=L.rotate(-h.angle);ae.x+=me.x/h.worldSize,ae.y+=me.y/h.worldSize;const ke=ae.toLngLat(),he=s.LngLat.convert(n.center||ke);this._normalizeCenter(he),B=h.centerPoint.add(me),V=new s.Point(ae.x,ae.y).mult(h.worldSize),N=new s.Point(s.mercatorXfromLng(he.lng),s.mercatorYfromLat(he.lat)).mult(h.worldSize).sub(V)}else{B=h.centerPoint.add(L);const ae=h.pointLocation(B),me=s.LngLat.convert(n.center||ae);this._normalizeCenter(me),V=h.project(ae),N=h.project(me).sub(V)}const U=h.zoomScale(b-d);let D,F;n.around&&(D=s.LngLat.convert(n.around),F=h.locationPoint(D));const $=this._zooming||b!==d,W=this._rotating||m!==C,te=this._pitching||E!==y,ne=!h.isPaddingEqual(I),ie=ae=>me=>{if($&&(ae.zoom=s.number(d,b,me)),W&&(ae.bearing=s.number(m,C,me)),te&&(ae.pitch=s.number(y,E,me)),ne&&(ae.interpolatePadding(v,I,me),B=ae.centerPoint.add(L)),D)ae.setLocationAtPoint(D,F);
vendor: 6,983 bytes, line 1
1else{const ke=ae.zoomScale(ae.zoom-d),he=b>d?Math.min(2,U):Math.max(.5,U),Ee=Math.pow(he,1-me),_e=ae.unproject(V.add(N.mult(me*Ee)).mult(ke));ae.setLocationAtPoint(ae.renderWorldCopies?_e.wrap():_e,B)}return n.preloadOnly||this._fireMoveEvents(o),ae};if(n.preloadOnly){const ae=this._emulate(ie,n.duration,h);return this._preloadTiles(ae),this}const se={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=$,this._rotating=W,this._pitching=te,this._padding=ne,this._easeId=n.easeId,this._prepareEase(o,n.noMoveStart,se),this._ease(ie(h),ae=>{h.recenterOnTerrain(),this._afterEase(o,ae)},n),this}_prepareEase(n,o,h={}){this._moving=!0,this.transform.cameraElevationReference="sea",o||h.moving||this.fire(new s.Event("movestart",n)),this._zooming&&!h.zooming&&this.fire(new s.Event("zoomstart",n)),this._rotating&&!h.rotating&&this.fire(new s.Event("rotatestart",n)),this._pitching&&!h.pitching&&this.fire(new s.Event("pitchstart",n))}_fireMoveEvents(n){this.fire(new s.Event("move",n)),this._zooming&&this.fire(new s.Event("zoom",n)),this._rotating&&this.fire(new s.Event("rotate",n)),this._pitching&&this.fire(new s.Event("pitch",n))}_afterEase(n,o){if(this._easeId&&o&&this._easeId===o)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const h=this._zooming,d=this._rotating,m=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,h&&this.fire(new s.Event("zoomend",n)),d&&this.fire(new s.Event("rotateend",n)),m&&this.fire(new s.Event("pitchend",n)),this.fire(new s.Event("moveend",n))}flyTo(n,o){if(this._prefersReducedMotion(n)){const Se=s.pick(n,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Se,o)}this.stop(),n=s.extend({offset:[0,0],speed:1.2,curve:1.42,easing:s.ease},n);const h=this.transform,d=this.getZoom(),m=this.getBearing(),y=this.getPitch(),v=this.getPadding(),b="zoom"in n?s.clamp(+n.zoom,h.minZoom,h.maxZoom):d,C="bearing"in n?this._normalizeBearing(n.bearing,m):m,E="pitch"in n?+n.pitch:y,I="padding"in n?n.padding:h.padding,L=h.zoomScale(b-d),B=s.Point.convert(n.offset);let V=h.centerPoint.add(B);const N=h.pointLocation(V),U=s.LngLat.convert(n.center||N);this._normalizeCenter(U);const D=h.project(N),F=h.project(U).sub(D);let $=n.curve;const W=Math.max(h.width,h.height),te=W/L,ne=F.mag();if("minZoom"in n){const Se=s.clamp(Math.min(n.minZoom,d,b),h.minZoom,h.maxZoom),Re=W/h.zoomScale(Se-d);$=Math.sqrt(Re/ne*2)}const ie=$*$;function se(Se){const Re=(te*te-W*W+(Se?-1:1)*ie*ie*ne*ne)/(2*(Se?te:W)*ie*ne);return Math.log(Math.sqrt(Re*Re+1)-Re)}function ae(Se){return(Math.exp(Se)-Math.exp(-Se))/2}function me(Se){return(Math.exp(Se)+Math.exp(-Se))/2}const ke=se(0);let he=function(Se){return me(ke)/me(ke+$*Se)},Ee=function(Se){return W*((me(ke)*(ae(Re=ke+$*Se)/me(Re))-ae(ke))/ie)/ne;var Re},_e=(se(1)-ke)/$;if(Math.abs(ne)<1e-6||!isFinite(_e)){if(Math.abs(W-te)<1e-6)return this.easeTo(n,o);const Se=te<W?-1:1;_e=Math.abs(Math.log(te/W))/$,Ee=function(){return 0},he=function(Re){return Math.exp(Se*$*Re)}}n.duration="duration"in n?+n.duration:1e3*_e/("screenSpeed"in n?+n.screenSpeed/$:+n.speed),n.maxDuration&&n.duration>n.maxDuration&&(n.duration=0);const De=m!==C,pe=E!==y,Me=!h.isPaddingEqual(I),Pe=Se=>Re=>{const Ke=Re*_e,ot=1/he(Ke);Se.zoom=1===Re?b:d+Se.scaleZoom(ot),De&&(Se.bearing=s.number(m,C,Re)),pe&&(Se.pitch=s.number(y,E,Re)),Me&&(Se.interpolatePadding(v,I,Re),V=Se.centerPoint.add(B));const We=1===Re?U:Se.unproject(D.add(F.mult(Ee(Ke))).mult(ot));return Se.setLocationAtPoint(Se.renderWorldCopies?We.wrap():We,V),Se._updateCameraOnTerrain(),n.preloadOnly||this._fireMoveEvents(o),Se};if(n.preloadOnly){const Se=this._emulate(Pe,n.duration,h);return this._preloadTiles(Se),this}return this._zooming=!0,this._rotating=De,this._pitching=pe,this._padding=Me,this._prepareEase(o,!1),this._ease(Pe(h),()=>this._afterEase(o),n),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(n,o){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const h=this._onEaseEnd;this._onEaseEnd=void 0,h.call(this,o)}if(!n){const h=this.handlers;h&&h.stop(!1)}return this}_ease(n,o,h){!1===h.animate||0===h.duration?(n(1),o()):(this._easeStart=s.exported.now(),this._easeOptions=h,this._onEaseFrame=n,this._onEaseEnd=o,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const n=Math.min((s.exported.now()-this._easeStart)/this._easeOptions.duration,1),o=this._onEaseFrame;o&&o(this._easeOptions.easing(n)),n<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(n,o){n=s.wrap(n,-180,180);const h=Math.abs(n-o);return Math.abs(n-360-o)<h&&(n-=360),Math.abs(n+360-o)<h&&(n+=360),n}_normalizeCenter(n){const o=this.transform;if(!o.renderWorldCopies||o.maxBounds)return;const h=n.lng-o.center.lng;n.lng+=h>180?-360:h<-180?360:0}_prefersReducedMotion(n){return this._respectPrefersReducedMotion&&s.exported.prefersReducedMotion&&!(n&&n.essential)}_emulate(n,o,h){const d=Math.ceil(15*o/1e3),m=[],y=n(h.clone());for(let v=0;v<=d;v++){const b=y(v/d);m.push(b.clone())}return m}}class qe{constructor(n={}){this.options=n,s.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(n){const o=this.options&&this.options.compact;return this._map=n,this._container=vt("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=vt("button","mapboxgl-ctrl-attrib-button",this._container),vt("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=vt("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),o&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===o&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(n,o){const h=this._map._getUIString(`AttributionControl.${o}`);n.setAttribute("aria-label",h),n.removeAttribute("title"),n.firstElementChild&&n.firstElementChild.setAttribute("title",h)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","fal
1se")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let n=this._editLink;n||(n=this._editLink=this._container.querySelector(".mapbox-improve-map"));const o=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||s.config.ACCESS_TOKEN}];if(n){const h=o.reduce((d,m,y)=>(m.value&&(d+=`${m.key}=${m.value}${y<o.length-1?"&":""}`),d),"?");n.href=`${s.config.FEEDBACK_URL}/${h}#${Va(this._map,!0)}`,n.rel="noopener nofollow",this._setElementTitle(n,"MapFeedback")}}_updateData(n){!n||"metadata"!==n.sourceDataType&&"visibility"!==n.sourceDataType&&"style"!==n.dataType||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let n=[];if(this._map.style.stylesheet){const d=this._map.style.stylesheet;this.styleOwner=d.owner,this.styleId=d.id}const o=this._map.style._sourceCaches;for(const d in o){const m=o[d];if(m.used){const y=m.getSource();y.attribution&&n.indexOf(y.attribution)<0&&n.push(y.attribution)}}n.sort((d,m)=>d.length-m.length),n=n.filter((d,m)=>{for(let y=m+1;y<n.length;y++)if(n[y].indexOf(d)>=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?n=[...this.options.customAttribution,...n]:n.unshift(this.options.customAttribution));const h=n.join(" | ");h!==this._attribHTML&&(this._attribHTML=h,n.length?(this._innerContainer.innerHTML=h,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class Gl{constructor(){s.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(n){this._map=n,this._container=vt("div","mapboxgl-ctrl");const o=vt("a","mapboxgl-ctrl-logo");return o.target="_blank",o.rel="noopener nofollow",o.href="https://www.mapbox.com/",o.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),o.setAttribute("rel","noopener nofollow"),this._container.appendChild(o),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(n){n&&"metadata"!==n.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const n=this._map.style._sourceCaches;if(0===Object.entries(n).length)return!0;for(const o in n){const h=n[o].getSource();if(h.hasOwnProperty("mapbox_logo")&&!h.mapbox_logo)return!1}return!0}_updateCompact(){const n=this._container.children;if(n.length){const o=n[0];this._map.getCanvasContainer().offsetWidth<250?o.classList.add("mapboxgl-compact"):o.classList.remove("mapboxgl-compact")}}}class Zl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(n){const o=++this._id;return this._queue.push({callback:n,id:o,cancelled:!1}),o}remove(n){const o=this._currentlyRunning,h=o?this._queue.concat(o):this._queue;for(const d of h)if(d.id===n)return void(d.cancelled=!0)}run(n=0){const o=this._currentlyRunning=this._queue;this._queue=[];for(const h of o)if(!h.cancelled&&(h.callback(n),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function ha(l,n,o){if(l=new s.LngLat(l.lng,l.lat),n){const h=new s.LngLat(l.lng-360,l.lat),d=new s.LngLat(l.lng+360,l.lat),m=360*Math.ceil(Math.abs(l.lng-o.center.lng)/360),y=o.locationPoint(l).distSqr(n),v=n.x<0||n.y<0||n.x>o.width||n.y>o.height;o.locationPoint(h).distSqr(n)<y&&(v||Math.abs(h.lng-o.center.lng)<m)?l=h:o.locationPoint(d).distSqr(n)<y&&(v||Math.abs(d.lng-o.center.lng)<m)&&(l=d)}for(;Math.abs(l.lng-o.center.lng)>180;){const h=o.locationPoint(l);if(h.x>=0&&h.y>=0&&h.x<=o.width&&h.y<=o.height)break;l.lng>o.center.lng?l.lng-=360:l.lng+=360}return l}
1const So={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};class Ze extends s.Evented{constructor(n,o){if(super(),(n instanceof s.window.HTMLElement||o)&&(n=s.extend({element:n},o)),s.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&n.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=n&&n.occludedOpacity||.2,n&&n.element)this._element=n.element,this._offset=s.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=vt("div");const d=41,m=27,y=Ci("svg",{display:"block",height:d*this._scale+"px",width:m*this._scale+"px",viewBox:`0 0 ${m} ${d}`},this._element),v=Ci("radialGradient",{id:"shadowGradient"},Ci("defs",{},y));Ci("stop",{offset:"10%","stop-opacity":.4},v),Ci("stop",{offset:"100%","stop-opacity":.05},v),Ci("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},y),Ci("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},y),Ci("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},y),Ci("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},y),this._offset=s.Point.convert(n&&n.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",d=>{d.preventDefault()}),this._element.addEventListener("mousedown",d=>{d.preventDefault()});const h=this._element.classList;for(const d in So)h.remove(`mapboxgl-marker-anchor-${d}`);h.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(n){return n===this._map||(this.remove(),this._map=n,n.getCanvasContainer().appendChild(this._element),n.on("move",this._updateMoving),n.on("moveend",this._update),n.on("remove",this._clearFadeTimer),n._addMarker(this),this.setDraggable(this._draggable),this._update(),n.on("click",this._onMapClick)),this}remove(){const n=this._map;return n&&(n.off("click",this._onMapClick),n.off("move",this._updateMoving),n.off("moveend",this._update),n.off("mousedown",this._addDragHandler),n.off("touchstart",this._addDragHandler),n.off("mouseup",this._onUp),n.off("touchend",this._onUp),n.off("mousemove",this._onMove),n.off("touchmove",this._onMove),n.off("remove",this._clearFadeTimer),n._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(n){return this._lngLat=s.LngLat.convert(n),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(n){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),n){if(!("offset"in n.options)){const d=Math.sqrt(Math.pow(13.5,2)/2);n.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[d,-1*(24.6+d)],"bottom-right":[-d,-1*(24.6+d)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=n,n._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","fal
1se")}return this}_onKeyPress(n){const o=n.code,h=n.charCode||n.keyCode;"Space"!==o&&"Enter"!==o&&32!==h&&13!==h||this.togglePopup()}_onMapClick(n){const o=n.originalEvent.target,h=this._element;this._popup&&(o===h||h.contains(o))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const n=this._popup;return n?(n.isOpen()?(n.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(n.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const n=this._map,o=this._pos;if(!n||!o)return!1;const h=n.unproject(o),d=n.getFreeCameraOptions();if(!d.position)return!1;const m=d.position.toLngLat();return m.distanceTo(h)<.9*m.distanceTo(this._lngLat)}_evaluateOpacity(){const n=this._map;if(!n)return;const o=this._pos;if(!o||o.x<0||o.x>n.transform.width||o.y<0||o.y>n.transform.height)return void this._clearFadeTimer();const h=n.unproject(o);let d;n._showingGlobe()&&s.isLngLatBehindGlobe(n.transform,this._lngLat)?d=0:(d=1-n._queryFogOpacity(h),n.transform._terrainEnabled()&&n.getTerrain()&&this._behindTerrain()&&(d*=this._occludedOpacity)),this._element.style.opacity=`${d}`,this._element.style.pointerEvents=d>0?"auto":"none",this._popup&&this._popup._setOpacity(d),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const n=this._pos;if(!n||!this._map)return;const o=this._offset.mult(this._scale);this._element.style.transform=`\n            translate(${n.x}px,${n.y}px)\n            ${So[this._anchor]}\n            ${this._calculateXYTransform()} ${this._calculateZTransform()}\n            translate(${o.x}px,${o.y}px)\n        `}_calculateXYTransform(){const n=this._pos,o=this._map,h=this.getPitchAlignment();if(!o||!n||"map"!==h)return"";if(!o._showingGlobe()){const b=o.getPitch();return b?`rotateX(${b}deg)`:""}const d=s.radToDeg(s.globeTiltAtLngLat(o.transform,this._lngLat)),m=n.sub(s.globeCenterToScreenPoint(o.transform)),y=Math.abs(m.x)+Math.abs(m.y);if(0===y)return"";const v=d/y;return`rotateX(${-m.y*v}deg) rotateY(${m.x*v}deg)`}_calculateZTransform(){const n=this._pos,o=this._map;if(!o||!n)return"";let h=0;const d=this.getRotationAlignment();if("map"===d)if(o._showingGlobe()){const m=o.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),y=o.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(m);h=s.radToDeg(Math.atan2(y.y,y.x))-90}else h=-o.getBearing();else if("horizon"===d){const m=s.smoothstep(4,6,o.getZoom()),y=s.globeCenterToScreenPoint(o.transform);y.y+=m*o.transform.height;const v=n.sub(y),b=s.radToDeg(Math.atan2(v.y,v.x));h=(b>90?b-270:b+90)*(1-m)}return h+=this._rotation,h?`rotateZ(${h}deg)`:""}_update(n){s.window.cancelAnimationFrame(this._updateFrameId);const o=this._map;
1o&&(o.transform.renderWorldCopies&&(this._lngLat=ha(this._lngLat,this._pos,o.transform)),this._pos=o.project(this._lngLat),!0===n?this._updateFrameId=s.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),o._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(o._showingGlobe()||o.getTerrain()||o.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(n){return this._offset=s.Point.convert(n),this._update(),this}_onMove(n){const o=this._map;if(!o)return;const h=this._pointerdownPos,d=this._positionDelta;if(h&&d){if(!this._isDragging){const m=this._clickTolerance||o._clickTolerance;if(n.point.dist(h)<m)return;this._isDragging=!0}this._pos=n.point.sub(d),this._lngLat=o.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new s.Event("dragstart"))),this.fire(new s.Event("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const n=this._map;n&&(n.off("mousemove",this._onMove),n.off("touchmove",this._onMove)),"active"===this._state&&this.fire(new s.Event("dragend")),this._state="inactive"}_addDragHandler(n){const o=this._map,h=this._pos;o&&h&&this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(h),this._pointerdownPos=n.point,this._state="pending",o.on("mousemove",this._onMove),o.on("touchmove",this._onMove),o.once("mouseup",this._onUp),o.once("touchend",this._onUp))}setDraggable(n){this._draggable=!!n;const o=this._map;return o&&(n?(o.on("mousedown",this._addDragHandler),o.on("touchstart",this._addDragHandler)):(o.off("mousedown",this._addDragHandler),o.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(n){return this._rotation=n||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(n){return this._rotationAlignment=n||"auto",this._update(),this}getRotationAlignment(){return"auto"===this._rotationAlignment||"horizon"===this._rotationAlignment&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(n){return this._pitchAlignment=n||"auto",this._update(),this}getPitchAlignment(){return"auto"===this._pitchAlignment?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(n){return this._occludedOpacity=n||.2,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const $l={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},qh=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Qc(l=new s.Point(0,0),n="bottom"){if("number"==typeof l){const o=Math.round(Math.sqrt(.5*Math.pow(l,2)));switch(n){case"top":return new s.Point(0,l);case"top-left":return new s.Point(o,o);case"top-right":return new s.Point(-o,o);case"bottom":return new s.Point(0,-l);case"bottom-left":return new s.Point(o,-o);case"bottom-right":return new s.Point(-o,-o);case"left":return new s.Point(l,0);case"right":return new s.Point(-l,0)}return new s.Point(0,0)}return l instanceof s.Point||Array.isArray(l)?s.Point.convert(l):s.Point.convert(l[n]||[0,0])}class ql{constructor(n){this.jumpTo(n)}getValue(n){if(n<=this._startTime)return this._start;if(n>=this._endTime)return this._end;const o=s.easeCubicInOut((n-this._startTime)/(this._endTime-this._startTime));return this._start*(1-o)+this._end*o}isEasing(n){return n>=this._startTime&&n<=this._endTime}jumpTo(n){this._startTime=-1/0,this._endTime=-1/0,this._start=n,this._end=n}easeTo(n,o,h){this._start=this.getValue(o),this._end=n,this._startTime=o,this._endTime=o+h}}const eh={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use \u2318 + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},th={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileC
vendor: 3,171 bytes, line 1
1acheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},Wh={showCompass:!0,showZoom:!0,visualizePitch:!1};class Xh{constructor(n,o,h=!1){this._clickTolerance=10,this.element=o,this.mouseRotate=new Bl({clickTolerance:n.dragRotate._mouseRotate._clickTolerance}),this.map=n,h&&(this.mousePitch=new Nl({clickTolerance:n.dragRotate._mousePitch._clickTolerance})),s.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),o.addEventListener("mousedown",this.mousedown),o.addEventListener("touchstart",this.touchstart,{passive:!1}),o.addEventListener("touchmove",this.touchmove),o.addEventListener("touchend",this.touchend),o.addEventListener("touchcancel",this.reset)}down(n,o){this.mouseRotate.mousedown(n,o),this.mousePitch&&this.mousePitch.mousedown(n,o),Zi()}move(n,o){const h=this.map,d=this.mouseRotate.mousemoveWindow(n,o),m=d&&d.bearingDelta;if(m&&h.setBearing(h.getBearing()+m),this.mousePitch){const y=this.mousePitch.mousemoveWindow(n,o),v=y&&y.pitchDelta;v&&h.setPitch(h.getPitch()+v)}}off(){const n=this.element;n.removeEventListener("mousedown",this.mousedown),n.removeEventListener("touchstart",this.touchstart,{passive:!1}),n.removeEventListener("touchmove",this.touchmove),n.removeEventListener("touchend",this.touchend),n.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){Zn(),s.window.removeEventListener("mousemove",this.mousemove),s.window.removeEventListener("mouseup",this.mouseup)}mousedown(n){this.down(s.extend({},n,{ctrlKey:!0,preventDefault:()=>n.preventDefault()}),Bi(this.element,n)),s.window.addEventListener("mousemove",this.mousemove),s.window.addEventListener("mouseup",this.mouseup)}mousemove(n){this.move(n,Bi(this.element,n))}mouseup(n){this.mouseRotate.mouseupWindow(n),this.mousePitch&&this.mousePitch.mouseupWindow(n),this.offTemp()}touchstart(n){1!==n.targetTouches.length?this.reset():(this._startPos=this._lastPos=hr(this.element,n.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>n.preventDefault()},this._startPos))}touchmove(n){1!==n.targetTouches.length?this.reset():(this._lastPos=hr(this.element,n.targetTouches)[0],this.move({preventDefault:()=>n.preventDefault()},this._lastPos))}touchend(n){0===n.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}const Wl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},Xl={maxWidth:100,unit:"metric"},Yl={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},ua={version:s.version,supported:An,setRTLTextPlugin:s.setRTLTextPlugin,getRTLTextPluginStatus:s.getRTLTextPluginStatus,Map:class extends Hs{constructor(l){if(s.LivePerformanceUtils.mark(s.PerformanceMarkers.create),null!=(l=s.extend({}
1,th,l)).minZoom&&null!=l.maxZoom&&l.minZoom>l.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=l.minPitch&&null!=l.maxPitch&&l.minPitch>l.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=l.minPitch&&l.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=l.maxPitch&&l.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(l.antialias&&s.isSafariWithAntialiasingBug(s.window)&&(l.antialias=!1,s.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new aa(l.minZoom,l.maxZoom,l.minPitch,l.maxPitch,l.renderWorldCopies),l),this._interactive=l.interactive,this._minTileCacheSize=l.minTileCacheSize,this._maxTileCacheSize=l.maxTileCacheSize,this._failIfMajorPerformanceCaveat=l.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=l.preserveDrawingBuffer,this._antialias=l.antialias,this._useWebGL2=l.useWebGL2,this._trackResize=l.trackResize,this._bearingSnap=l.bearingSnap,this._refreshExpiredTiles=l.refreshExpiredTiles,this._fadeDuration=l.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=l.crossSourceCollisions,this._collectResourceTiming=l.collectResourceTiming,this._optimizeForTerrain=l.optimizeForTerrain,this._language=this._parseLanguage(l.language),this._worldview=l.worldview,this._renderTaskQueue=new Zl,this._domRenderTaskQueue=new Zl,this._controls=[],this._markers=[],this._popups=[],this._mapId=s.uniqueId(),this._locale=s.extend({},eh,l.locale),this._clickTolerance=l.clickTolerance,this._cooperativeGestures=l.cooperativeGestures,this._performanceMetricsCollection=l.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new ql(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new s.RequestManager(l.transformRequest,l.accessToken,l.testMode),this._silenceAuthErrors=!!l.testMode,"string"==typeof l.container){if(this._container=s.window.document.getElementById(l.container),!this._container)throw new Error(`Container '${l.container}' not found.`)}else{if(!(l.container instanceof s.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=l.container}if(this._container.childNodes.length>0&&s.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),l.maxBounds&&this.setMaxBounds(l.maxBounds),s.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),void 0!==s.window&&(s.window.addEventListener("online",this._onWindowOnline,!1),s.window.addEventListener("resize",this._onWindowResize,!1),s.window.addEventListener("orientationchange",this._onWindowResize,!1),s.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),s.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new rr(this,l),this._localFontFamily=l.localFontFamily,this._localIdeographFontFamily=l.localIdeographFontFamily,l.style&&this.setStyle(l.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),l.projection&&this.setProjection(l.projection),this._hash=l.hash&&new Ll("string"==typeof l.hash&&l.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch}),l.bounds&&(this.resize(),this.fitBounds(l.bounds,s.extend({},l.fitBoundsOptions,{duration:0})))),this.resize(),l.attributionControl&&this.addControl(new qe({customAttribution:l.customAttribution}
1)),this._logoControl=new Gl,this.addControl(this._logoControl,l.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",n=>{this._update("style"===n.dataType),this.fire(new s.Event(`${n.dataType}data`,n))}),this.on("dataloading",n=>{this.fire(new s.Event(`${n.dataType}dataloading`,n))})}_getMapId(){return this._mapId}addControl(l,n){if(void 0===n&&(n=l.getDefaultPosition?l.getDefaultPosition():"top-right"),!l||!l.onAdd)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const o=l.onAdd(this);this._controls.push(l);const h=this._controlPositions[n];return-1!==n.indexOf("bottom")?h.insertBefore(o,h.firstChild):h.appendChild(o),this}removeControl(l){if(!l||!l.onRemove)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const n=this._controls.indexOf(l);return n>-1&&this._controls.splice(n,1),l.onRemove(this),this}hasControl(l){return this._controls.indexOf(l)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(l){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const n=!this._moving;return n&&this.fire(new s.Event("movestart",l)).fire(new s.Event("move",l)),this.fire(new s.Event("resize",l)),n&&this.fire(new s.Event("moveend",l)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(l){return this.transform.setMaxBounds(s.LngLatBounds.convert(l)),this._update()}setMinZoom(l){if((l=null==l?-2:l)>=-2&&l<=this.transform.maxZoom)return this.transform.minZoom=l,this._update(),this.getZoom()<l?this.setZoom(l):this.fire(new s.Event("zoomstart")).fire(new s.Event("zoom")).fire(new s.Event("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(l){if((l=null==l?22:l)>=this.transform.minZoom)return this.transform.maxZoom=l,this._update(),this.getZoom()>l?this.setZoom(l):this.fire(new s.Event("zoomstart")).fire(new s.Event("zoom")).fire(new s.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(l){if((l=null==l?0:l)<0)throw new Error("minPitch must be greater than or equal to 0");if(l>=0&&l<=this.transform.maxPitch)return this.transform.minPitch=l,this._update(),this.getPitch()<l?this.setPitch(l):this.fire(new s.Event("pitchstart")).fire(new s.Event("pitch")).fire(new s.Event("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(l){if((l=null==l?85:l)>85)throw new Error("maxPitch must be less than or equal to 85");if(l>=this.transform.minPitch)return this.transform.maxPitch=l,this._update(),this.getPitch()>l?this.setPitch(l):this.fire(new s.Event("pitchstart")).fire(new s.Event("pitch")).fire(new s.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(l){return this.transform.renderWorldCopies=l,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(l){return"auto"===l?s.window.navigator.language:Array.isArray(l)?0===l.length?void 0:l.map(n=>"auto"===n?s.window.navigator.language:n):l}setLanguage(l){const n=this._parseLanguage(l);if(!this.style||n===this._language)return this;this._language=n,this.style._reloadSources();for(const o of this._controls)o._setLanguage&&o._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(l){return this.style&&l!==this._worldview?(this._worldview=l,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(l){return this._lazyInitEmptyStyle(),l?"string"==typeof l&&(l={name:l}):l=null,this._useExplicitProjection=!!l,this._prioritizeAndUpdateProjection(l,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const l=this.transform,n=l.projection.name;let o;"globe"===n&&l.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX?(l.setMercatorFromTransition(),o=!0):"mercator"===n&&l.zoom<s.GLOBE_ZOOM_THRESHOLD_MAX&&(l.setProjection({name:"globe"}),o=!0),o&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayer
1Update())}_prioritizeAndUpdateProjection(l,n){return this._updateProjection(l||n||{name:"mercator"})}_updateProjection(l){let n;if(n="globe"===l.name&&this.transform.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(l),this.style.applyProjectionUpdate(),n){this.painter.clearBackgroundTiles();for(const o in this.style._sourceCaches)this.style._sourceCaches[o].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(l){return this.transform.locationPoint3D(s.LngLat.convert(l))}unproject(l){return this.transform.pointLocation3D(s.Point.convert(l))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(l,n,o){if("mouseenter"===l||"mouseover"===l){let h=!1;const d=y=>{const v=n.filter(C=>this.getLayer(C)),b=v.length?this.queryRenderedFeatures(y.point,{layers:v}):[];b.length?h||(h=!0,o.call(this,new Di(l,this,y.originalEvent,{features:b}))):h=!1},m=()=>{h=!1};return{layers:new Set(n),listener:o,delegates:{mousemove:d,mouseout:m}}}if("mouseleave"===l||"mouseout"===l){let h=!1;const d=y=>{const v=n.filter(b=>this.getLayer(b));(v.length?this.queryRenderedFeatures(y.point,{layers:v}):[]).length?h=!0:h&&(h=!1,o.call(this,new Di(l,this,y.originalEvent)))},m=y=>{h&&(h=!1,o.call(this,new Di(l,this,y.originalEvent)))};return{layers:new Set(n),listener:o,delegates:{mousemove:d,mouseout:m}}}{const h=d=>{const m=n.filter(v=>this.getLayer(v)),y=m.length?this.queryRenderedFeatures(d.point,{layers:m}):[];y.length&&(d.features=y,o.call(this,d),delete d.features)};return{layers:new Set(n),listener:o,delegates:{[l]:h}}}}on(l,n,o){if(void 0===o)return super.on(l,n);Array.isArray(n)||(n=[n]);const h=this._createDelegatedListener(l,n,o);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[l]=this._delegatedListeners[l]||[],this._delegatedListeners[l].push(h);for(const d in h.delegates)this.on(d,h.delegates[d]);return this}once(l,n,o){if(void 0===o)return super.once(l,n);Array.isArray(n)||(n=[n]);const h=this._createDelegatedListener(l,n,o);for(const d in h.delegates)this.once(d,h.delegates[d]);return this}off(l,n,o){if(void 0===o)return super.off(l,n);n=new Set(Array.isArray(n)?n:[n]);const h=(m,y)=>{if(m.size!==y.size)return!1;for(const v of m)if(!y.has(v))return!1;return!0},d=this._delegatedListeners?this._delegatedListeners[l]:void 0;return d&&(m=>{for(let y=0;y<m.length;y++){const v=m[y];if(v.listener===o&&h(v.layers,n)){for(const b in v.delegates)this.off(b,v.delegates[b]);return m.splice(y,1),this}}})(d),this}
vendor: 7,515 bytes, line 1
1queryRenderedFeatures(l,n){return this.style?(void 0!==n||void 0===l||l instanceof s.Point||Array.isArray(l)||(n=l,l=void 0),this.style.queryRenderedFeatures(l=l||[[0,0],[this.transform.width,this.transform.height]],n=n||{},this.transform)):[]}querySourceFeatures(l,n){return this.style.querySourceFeatures(l,n)}isPointOnSurface(l){const{name:n}=this.transform.projection;return"globe"!==n&&"mercator"!==n&&s.warnOnce(`${n} projection does not support isPointOnSurface, this API may behave unexpectedly.`),this.transform.isPointOnSurface(s.Point.convert(l))}setStyle(l,n){return!1!==(n=s.extend({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},n)).diff&&n.localIdeographFontFamily===this._localIdeographFontFamily&&n.localFontFamily===this._localFontFamily&&this.style&&l?(this._diffStyle(l,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._localFontFamily=n.localFontFamily,this._updateStyle(l,n))}_getUIString(l){const n=this._locale[l];if(null==n)throw new Error(`Missing UI string '${l}'`);return n}_updateStyle(l,n){return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),l&&(this.style=new Rn(this,n||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof l?this.style.loadURL(l):this.style.loadJSON(l)),this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new Rn(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(l,n){if("string"==typeof l){const o=this._requestManager.normalizeStyleURL(l),h=this._requestManager.transformRequest(o,s.ResourceType.Style);s.getJSON(h,(d,m)=>{d?this.fire(new s.ErrorEvent(d)):m&&this._updateDiff(m,n)})}else"object"==typeof l&&this._updateDiff(l,n)}_updateDiff(l,n){try{this.style.setState(l)&&this._update(!0)}catch(o){s.warnOnce(`Unable to perform style diff: ${o.message||o.error||o}.  Rebuilding the style from scratch.`),this._updateStyle(l,n)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(s.warnOnce("There is no style added to the map."),!1)}addSource(l,n){return this._lazyInitEmptyStyle(),this.style.addSource(l,n),this._update(!0)}isSourceLoaded(l){return!!this.style&&this.style._isSourceCacheLoaded(l)}areTilesLoaded(){const l=this.style&&this.style._sourceCaches;for(const n in l){const o=l[n]._tiles;for(const h in o){const d=o[h];if("loaded"!==d.state&&"errored"!==d.state)return!1}}return!0}addSourceType(l,n,o){this._lazyInitEmptyStyle(),this.style.addSourceType(l,n,o)}removeSource(l){return this.style.removeSource(l),this._updateTerrain(),this._update(!0)}getSource(l){return this.style.getSource(l)}addImage(l,n,{pixelRatio:o=1,sdf:h=!1,stretchX:d,stretchY:m,content:y}={}){if(this._lazyInitEmptyStyle(),n instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&n instanceof s.window.ImageBitmap){const{width:v,height:b,data:C}=s.exported.getImageData(n);this.style.addImage(l,{data:new s.RGBAImage({width:v,height:b},C),pixelRatio:o,stretchX:d,stretchY:m,content:y,sdf:h,version:0})}else if(void 0===n.width||void 0===n.height)this.fire(new s.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{const{width:v,height:b}=n,C=n;this.style.addImage(l,{data:new s.RGBAImage({width:v,height:b},new Uint8Array(C.data)),pixelRatio:o,stretchX:d,stretchY:m,content:y,sdf:h,version:0,userImage:C}),C.onAdd&&C.onAdd(this,l)}}updateImage(l,n){const o=this.style.getImage(l);if(!o)return void this.fire(new s.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const h=n instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&n instanceof s.window.ImageBitmap?s.exported.getImageData(n):n,{width:d,height:m}=h;void 0!==d&&void 0!==m?d===o.data.width&&m===o.data.height?(o.data.replace(h.data,!(n instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&n instanceof s.window.ImageBitmap)),this.style.updateImage(l,o)):this.fire(new s.ErrorEvent(new Error(`The width and height of the updated image (${d}, ${m})\n                must be that same as the previous version of the image\n                (${o.data.width}, ${o.data.height})`))):this.fire(new s.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")))}hasImage(l){return l?!!this.style.getImage(l):(this.fire(new s.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(l){this.style.removeImage(l)}loadImage(l,n){s.getImage(this._requestManager.transformRequest(l,s.ResourceType.Image),(o,h)=>{n(o,h instanceof s.window.HTMLImageElement?s.exported.getImageData(h):h)})}listImages(){return this.style.listImages()}addLayer(l,n){return this._lazyInitEmptyStyle(),this.style.addLayer(l,n),this._update(!0)}moveLayer(l,n){return this.style.moveLayer(l,n),this._update(!0)}removeLayer(l){return this.style.removeLayer(l),this._update(!0)}getLayer(l){return this.style.getLayer(l)}setLayerZoomRange(l,n,o){return this.style.setLayerZoomRange(l,n,o),this._update(!0)}setFilter(l,n,o={}){return this.style.setFilter(l,n,o),this._update(!0)}getFilter(l){return this.style.getFilter(l)}setPaintProperty(l,n,o,h={}){return this.style.setPaintProperty(l,n,o,h),this._update(!0)}getPaintProperty(l,n){return this.style.getPaintProperty(l,n)}setLayoutProperty(l,n,o,h={}){return this.style.setLayoutProperty(l,n,o,h),this._update(!0)}getLayoutProperty(l,n){return this.style.getLayoutProperty(l,n)}setLight(l,n={}){return this._lazyInitEmptyStyle(),this.style.setLight(l,n),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(l){return this._lazyInitEmptyStyle(),!l&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(l),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(l){return this._lazyInitEmptyStyle(),this.style.setFog(l),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(l){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(s.LngLat.convert(l),this.transform):0}setFeatureState(l,n){return this.style.setFeatureState(l,n),this._update()}removeFeatureState(l,n){return this.style.removeFeatureState(l,n),this._update()}getFeatureState(l){return this.style.getFeatureState(l)}_updateContainerDimensions(){if(!this._container)return;const l=this._container.getBoundingClientRect().width||400,n=this._container.getBoundingClientRect().height||300;let o,h,d,m=this._container;for(;m&&(!h||!d);){const y=s.window.getComputedStyle(m).transform;y&&"none"!==y&&(o=y.match(/matrix.*\((.+)\)/)[1].split(", "),o[0]&&"0"!==o[0]&&"1"!==o[0]&&(h=o[0]),o[3]&&"0"!==o[3]&&"1"!==o[3]&&(d=o[3])),m=m.parentElement}this._containerWidth=h?Math.abs(l/h):l,this._containerHeight=d?Math.abs(n/d):n}_detectMissingCSS(){"rgb(250, 128, 114)"!==s.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&s.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described 
1in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const l=this._container;l.classList.add("mapboxgl-map"),(this._missingCSSCanary=vt("div","mapboxgl-canary",l)).style.visibility="hidden",this._detectMissingCSS();const n=this._canvasContainer=vt("div","mapboxgl-canvas-container",l);this._interactive&&n.classList.add("mapboxgl-interactive"),this._canvas=vt("canvas","mapboxgl-canvas",n),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const o=this._controlContainer=vt("div","mapboxgl-control-container",l),h=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(d=>{h[d]=vt("div",`mapboxgl-ctrl-${d}`,o)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(l,n){const o=s.exported.devicePixelRatio||1;this._canvas.width=o*Math.ceil(l),this._canvas.height=o*Math.ceil(n),this._canvas.style.width=`${l}px`,this._canvas.style.height=`${n}px`}_addMarker(l){this._markers.push(l)}_removeMarker(l){const n=this._markers.indexOf(l);-1!==n&&this._markers.splice(n,1)}_addPopup(l){this._popups.push(l)}_removePopup(l){const n=this._popups.indexOf(l);-1!==n&&this._popups.splice(n,1)}_setupPainter(){const l=s.extend({},An.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._useWebGL2&&this._canvas.getContext("webgl2",l),o=n||this._canvas.getContext("webgl",l)||this._canvas.getContext("experimental-webgl",l);o?(this._useWebGL2&&!n&&s.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),s.storeAuthState(o,!0),this.painter=new ra(o,this.transform,!!n),this.on("data",h=>{"source"===h.dataType&&this.painter.setTileLoadedFlag(!0)}),s.exported$1.testSupport(o)):this.fire(new s.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(l){l.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new s.Event("webglcontextlost",{originalEvent:l}))}_contextRestored(l){this._setupPainter(),this.resize(),this._update(),this.fire(new s.Event("webglcontextrestored",{originalEvent:l}))}_onMapScroll(l){if(l.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(l){return this.style?(this._styleDirty=this._styleDirty||l,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(l){return this._update(),this._renderTaskQueue.add(l)}_cancelRenderFrame(l){this._renderTaskQueue.remove(l)}_requestDomTask(l){!this.loaded()||this.loaded()&&!this.isMoving()?l():this._domRenderTaskQueue.add(l)}_render(l){let n;const o=this.painter.context.extTimerQuery,h=s.exported.now();if(this.listens("gpu-timing-frame")&&(n=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,n)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],s.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],s.window.performance.now())),this._renderTaskQueue.run(l),this._domRenderTaskQueue.run(l),this._removed)return;this._updateProjectionTransition();const d=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const v=this.transform.zoom,b=this.transform.pitch,C=s.exported.now(),E=new s.EvaluationParameters(v,{now:C,fadeDuration:d,pitch:b,transition:this.style.getTransition()});this.style.update(E)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let m=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),m=this._updateAverageElevation(h),this.style._updateSources(this.transform),this._forceMar
1kerAndPopupUpdate()):m=this._updateAverageElevation(h),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,d,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:d,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new s.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new s.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),n){const v=s.exported.now()-h;o.endQueryEXT(o.TIME_ELAPSED_EXT,n),setTimeout(()=>{const b=o.getQueryObjectEXT(n,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(n),this.fire(new s.Event("gpu-timing-frame",{cpuTime:v,gpuTime:b})),s.window.performance.mark("frame-gpu",{startTime:h,detail:{gpuTime:b}})},50)}if(this.listens("gpu-timing-layer")){const v=this.painter.collectGpuTimers();setTimeout(()=>{const b=this.painter.queryGpuTimers(v);this.fire(new s.Event("gpu-timing-layer",{layerTimes:b}))},50)}if(this.listens("gpu-timing-deferred-render")){const v=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const b=this.painter.queryGpuTimeDeferredRender(v);this.fire(new s.Event("gpu-timing-deferred-render",{gpuTime:b}))},50)}const y=this._sourcesDirty||this._styleDirty||this._placementDirty||m;if(y||this._repaint)this.triggerRepaint();else{const v=!this.isMoving()&&this.loaded();if(v&&(m=this._updateAverageElevation(h,!0)),m)this.triggerRepaint();else if(this._triggerFrame(!1),v&&(this.fire(new s.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const b=this._calculateSpeedIndex();this.fire(new s.Event("speedindexcompleted",{speedIndex:b})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||y||(this._fullyLoaded=!0,s.LivePerformanceUtils.mark(s.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&s.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(l){for(const n of this._markers)l&&!this.getRenderWorldCopies()&&(n._lngLat=n._lngLat.wrap()),n._update();for(const n of this._popups)!l||this.getRenderWorldCopies()||n._trackPointer||(n._lngLat=n._lngLat.wrap()),n._update()}_updateAverageElevation(l,n=!1){const o=h=>(this.transform.averageElevation=h,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&o(0);if((n||l-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(l)){const h=this.transform.averageElevation;let d=this.transform.sampleAverageElevation(),m=!1;this.transform.elevation&&(m=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(d)?d=0:this._averageElevationLastSampledAt=l;const y=Math.abs(h-d);if(y>1){if(this._isInitialLoad||m)return this._averageElevation.jumpTo(d),o(d);this._averageElevation.easeTo(d,l,300)}else if(y>1e-4)return this._averageElevation.jumpTo(d),o(d)}return!!this._averageElevation.isEasing(l)&&o(this._averageElevation.getValue(l))}_authenticate(){s.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,l=>{if(l&&(l.message===s.AUTH_ERR_MSG||401===l.status)){const n=this.painter.context.gl;s.storeAuthState(n,!1),this._logoControl instanceof Gl&&this._logoControl._updateLogo(),n&&n.clear(n.DEPTH_BUFFER_BIT|n.COLOR_BUFFER_BIT|n.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new s.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),s.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const l=this._isDragging();this.painter.updateTerrain(this.style,l)}_calculateSpeedIndex(){const l=this.painter.canvasCopy(),n=this.painter.getCanvasCopiesAndTimestamps();n.timeStamps.push(performance.now());const o=this.painter.context.gl,h=o.createFramebuffer();function d(m){o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,m,0);const y=new Uint8Array(o.drawingBufferWidth*o.drawingBufferHeight*4);return o.readPixels(0,0,o.drawingBufferWidth,o.drawingBufferHeight,o.RGBA,o.UNSIGNED_BYTE,y),y}return o.bindFramebuffer(o.FRAMEBUFFER,h),this._canvasPixelComparison(d(l),n.canvasCopies.map(d),n.timeStamps)}_canvasPixelComparison(l,n,o){let h=o[1]-o[0];const d=l.length/4;for(let m=0;m<n.length;m++){const y=n[m];let v=0;for(let b=0;b<y.length;
1b+=4)y[b]===l[b]&&y[b+1]===l[b+1]&&y[b+2]===l[b+2]&&y[b+3]===l[b+3]&&(v+=1);h+=(o[m+2]-o[m+1])*(1-v/d)}return h}remove(){this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),void 0!==s.window&&(s.window.removeEventListener("resize",this._onWindowResize,!1),s.window.removeEventListener("orientationchange",this._onWindowResize,!1),s.window.removeEventListener("webkitfullscreenchange",this._onWindowResize,!1),s.window.removeEventListener("online",this._onWindowOnline,!1),s.window.removeEventListener("visibilitychange",this._onVisibilityChange,!1));const l=this.painter.context.gl.getExtension("WEBGL_lose_context");l&&l.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),s.removeAuthState(this.painter.context.gl),this._removed=!0,this.fire(new s.Event("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(l){this._renderNextFrame=this._renderNextFrame||l,this.style&&!this._frame&&(this._frame=s.exported.frame(n=>{const o=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,o&&this._render(n)}))}_preloadTiles(l){const n=this.style?Object.values(this.style._sourceCaches):[];return s.asyncAll(n,(o,h)=>o._preloadTiles(l,h),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(l){this._trackResize&&this.resize({originalEvent:l})._update()}_onVisibilityChange(){"hidden"===s.window.document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(l){this._showTileBoundaries!==l&&(this._showTileBoundaries=l,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(l){this._showTerrainWireframe!==l&&(this._showTerrainWireframe=l,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(l){this._speedIndexTiming!==l&&(this._speedIndexTiming=l,this._update())}get showPadding(){return!!this._showPadding}set showPadding(l){this._showPadding!==l&&(this._showPadding=l,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(l){this._showCollisionBoxes!==l&&(this._showCollisionBoxes=l,l?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(l){this._showOverdrawInspector!==l&&(this._showOverdrawInspector=l,this._update())}get repaint(){return!!this._repaint}set repaint(l){this._repaint!==l&&(this._repaint=l,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(l){this._vertices=l,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(l){this._showTileAABBs!==l&&(this._showTileAABBs=l,l&&this._update())}_setCacheLimits(l,n){s.setCacheLimits(l,n)}get version(){return s.version}},NavigationControl:class{constructor(l){this.options=s.extend({},Wh,l),this._container=vt("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",n=>n.preventDefault()),this.options.showZoom&&(s.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",n=>{this._map&&this._map.zoomIn({},{originalEvent:n})}),vt("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",n=>{this._map&&this._map.zoomOut({},{originalEvent:n})}),vt("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(s.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",n=>{const o=this._map;o&&(this.options.visualizePitch?o.resetNorthPitch({},{originalEvent:n}):o.resetNorth({},{originalEvent:n}))}),this._compassIcon=vt("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const l=this._map;if(!l)return;
1const n=l.getZoom(),o=n===l.getMaxZoom(),h=n===l.getMinZoom();this._zoomInButton.disabled=o,this._zoomOutButton.disabled=h,this._zoomInButton.setAttribute("aria-disabled",o.toString()),this._zoomOutButton.setAttribute("aria-disabled",h.toString())}_rotateCompassArrow(){const l=this._map;if(!l)return;const n=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(l.transform.pitch*(Math.PI/180)),.5)}) rotateX(${l.transform.pitch}deg) rotateZ(${l.transform.angle*(180/Math.PI)}deg)`:`rotate(${l.transform.angle*(180/Math.PI)}deg)`;l._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=n)})}onAdd(l){return this._map=l,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),l.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&l.on("pitch",this._rotateCompassArrow),l.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Xh(l,this._compass,this.options.visualizePitch)),this._container}onRemove(){const l=this._map;l&&(this._container.remove(),this.options.showZoom&&l.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&l.off("pitch",this._rotateCompassArrow),l.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(l,n){const o=vt("button",l,this._container);return o.type="button",o.addEventListener("click",n),o}_setButtonTitle(l,n){if(!this._map)return;const o=this._map._getUIString(`NavigationControl.${n}`);l.setAttribute("aria-label",o),l.firstElementChild&&l.firstElementChild.setAttribute("title",o)}},GeolocateControl:class extends s.Evented{constructor(l){super(),this.options=s.extend({geolocation:s.window.navigator.geolocation},Wl,l),s.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=sa(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(l){return this._map=l,this._container=vt("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(l){const n=(o=!!this.options.geolocation)=>{this._supportsGeolocation=o,l(o)};void 0!==this._supportsGeolocation?l(this._supportsGeolocation):void 0!==s.window.navigator.permissions?s.window.navigator.permissions.query({name:"geolocation"}).then(o=>n("denied"!==o.state)).catch(()=>n()):n()}_isOutOfMapMaxBounds(l){const n=this._map.getMaxBounds(),o=l.coords;return!!n&&(o.longitude<n.getWest()||o.longitude>n.getEast()||o.latitude<n.getSouth()||o.latitude>n.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(l){if(this._map){if(this._isOutOfMapMaxBounds(l))return this._setErrorState(),this.fire(new s.Event("outofmaxbounds",l)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=l,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_E
1RROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(l),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(l),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("geolocate",l)),this._finish()}}_updateCamera(l){const n=new s.LngLat(l.coords.longitude,l.coords.latitude),o=l.coords.accuracy,h=this._map.getBearing(),d=s.extend({bearing:h},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(o),d,{geolocateSource:!0})}_updateMarker(l){if(l){const n=new s.LngLat(l.coords.longitude,l.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=l.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const l=this._map.transform,n=s.mercatorZfromAltitude(1,l._center.lat)*l.worldSize,o=Math.ceil(2*this._accuracy*n);this._circleElement.style.width=`${o}px`,this._circleElement.style.height=`${o}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(l){if(this._map){if(this.options.trackUserLocation)if(1===l.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",n),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",n),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===l.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("error",l)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(l){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",n=>n.preventDefault()),this._geolocateButton=vt("button","mapboxgl-ctrl-geolocate",this._container),vt("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===l){s.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",n),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",n)}else{const n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",n),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
1se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=vt("div","mapboxgl-user-location"),this._dotElement.appendChild(vt("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(vt("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Ze({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=vt("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ze({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",n=>{n.geolocateSource||"ACTIVE_LOCK"!==this._watchState||n.originalEvent&&"resize"===n.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new s.Event("trackuserlocationend")))})}}_onDeviceOrientation(l){this._userLocationDotMarker&&(l.webkitCompassHeading?this._heading=l.webkitCompassHeading:!0===l.absolute&&(this._heading=-1*l.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return s.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new s.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new s.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let l;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(l={maximumAge:6e5,timeout:0},this._noTimeout=!0):(l=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,l),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const l=()=>{s.window.addEventListener("ondeviceorientationabsolute"in s.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};void 0!==s.window.DeviceMotionEvent&&"function"==typeof s.window.DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(n=>{"granted"===n&&l()}).catch(console.error):l()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),s.window.removeEventListener("deviceorientation",this._onDeviceOrientation),s.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
1se"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:qe,ScaleControl:class{constructor(l){this.options=s.extend({},Xl,l),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch(n){return!1}}(),s.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const l=this.options.maxWidth||100,n=this._map,o=n._containerHeight/2,h=n._containerWidth/2-l/2,d=n.unproject([h,o]),m=n.unproject([h+l,o]),y=d.distanceTo(m);if("imperial"===this.options.unit){const v=3.2808*y;v>5280?this._setScale(l,v/5280,"mile"):this._setScale(l,v,"foot")}else"nautical"===this.options.unit?this._setScale(l,y/1852,"nautical-mile"):y>=1e3?this._setScale(l,y/1e3,"kilometer"):this._setScale(l,y,"meter")}_setScale(l,n,o){this._map._requestDomTask(()=>{const h=function(m){const y=Math.pow(10,`${Math.floor(m)}`.length-1);let v=m/y;return v=v>=10?10:v>=5?5:v>=3?3:v>=2?2:v>=1?1:function(b){const C=Math.pow(10,Math.ceil(-Math.log(b)/Math.LN10));return Math.round(b*C)/C}(v),y*v}(n),d=h/n;this._container.innerHTML=this._isNumberFormatSupported&&"nautical-mile"!==o?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:o}).format(h):`${h}&nbsp;${Yl[o]}`,this._container.style.width=l*d+"px"})}onAdd(l){return this._map=l,this._language=l.getLanguage(),this._container=vt("div","mapboxgl-ctrl mapboxgl-ctrl-scale",l.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(l){this._language=l,this._update()}setUnit(l){this.options.unit=l,this._update()}},FullscreenControl:class{constructor(l){this._fullscreen=!1,l&&l.container&&(l.container instanceof s.window.HTMLElement?this._container=l.container:s.warnOnce("Full screen control 'container' must be a DOM element.")),s.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in s.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in s.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(l){return this._map=l,this._container||(this._container=this._map.getContainer()),this._controlContainer=vt("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",s.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,s.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!s.window.document.fullscreenEnabled&&!s.window.document.webkitFullscreenEnabled)}_setupUI(){const l=this._fullscreenButton=vt("button","mapboxgl-ctrl-fullscreen",this._controlContainer);vt("span","mapboxgl-ctrl-icon",l).setAttribute("aria-hidden","true"),l.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),s.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const l=this._getTitle();this._fullscreenButton.setAttribute("aria-label",l),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",l)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(s.window.document.fullscreenElement||s.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?s.window.document.exitFullscreen?s.window.document.exitFullscreen():s.window.document.webkitCancelFullScreen&&s.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends s.Evented{constructor(l){super(),this.options=s.extend(Object.create($l),l),s.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(l&&l.className?l.className.trim().split(/\s+/):[])}addTo(l){return this._map&&this.remove(),this._map=l,this.options.closeOnClick&&l.on("preclick",this._onClose),this.options.closeOnMove&&l.on("move",this._onClose),l.on("remove",this.remove),this._update(),l._addPopup(this),this._focusFirstElement(),this._trackPointer?(l.on("mousemove",this._onMouseEvent),l.on("mouseup",this._onMouseEvent),l._canvasContainer.classList.add("mapboxgl-track-pointer")):l.on("move",this._update),this.fire(new s.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const l=this._map;return l&&(l.off("move",this._update),l.off("move",this._onClose),l.off("preclick",this._onClose),l.off("click",this._onClose),l.off("remove",this.remove),l.off("mousemove",this._onMouseEvent),l.off("mouseup",this._onMouseEvent),l.off("drag",this._onMouseEvent),l._canvasContainer&&l._canvasContainer.classList.remove("mapboxgl-track-pointer"),l._removePopup(this),this._map=void 0),this.fire(new s.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(l){this._lngLat=s.LngLat.convert(l),this._pos=null,this._trackPointer=!1,this._update();const n=this._map;return n&&(n.on("move",this._update),n.off("mousemove",this._onMouseEvent),n._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const l=this._map;return l&&(l.off("move",this._update),l.on("mousemove",this._onMouseEvent),l.on("drag",this._onMouseEvent),l._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(l){return this.setDOMContent(s.window.document.createTextNode(l))}setHTML(l){const n=s.window.document.createDocumentFragment(),o=s.window.document.createElement("body");let h;for(o.innerHTML=l;h=o.firstChild,h;)n.appendChild(h);return this.setDOMContent(n)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(l){return this.options.maxWidth=l,this._update(),this}setDOMContent(l){let n=this._content;if(n)for(;n.hasChildNodes();)n.firstChild&&n.removeChild(n.firstChild);else n=this._content=vt("div","mapboxgl-popup-content",this._container||void 0);if(n.appendChild(l),this.options.closeButton){const o=this._closeButton=vt("button","mapboxgl-popup-close-button",n);o.type="button",o.setAttribute("aria-label","Close popup"),o.setAttribute("aria-hidden","true"),o.innerHTML="&#215;",o.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(l){return this._classList.add(l),this._updateClassList(),this}removeClassName(l){return this._classList.delete(l),this._updateClassList(),this}setOffset(l){return this.options.offset=l,this._update(),this}toggleClassName(l){let n;return this._classList.delete(l)?n=!1:(this._classList.add(l),n=!0),this._updateClassList(),n}_onMouseEvent(l){this._update(l.point)}_getAnchor(l){if(this.options.anchor)return this.options.anchor;const n=this._map,o=this._container,h=this._pos;if(!n||!o||!h)return"bottom";const d=o.offsetWidth,m=o.offsetHeight,y=h.x<d/2,v=h.x>n.transform.width-d/2;
vendor: 2,720 bytes, line 1
1if(h.y+l<m)return y?"top-left":v?"top-right":"top";if(h.y>n.transform.height-m){if(y)return"bottom-left";if(v)return"bottom-right"}return y?"left":v?"right":"bottom"}_updateClassList(){const l=this._container;if(!l)return;const n=[...this._classList];n.push("mapboxgl-popup"),this._anchor&&n.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&n.push("mapboxgl-popup-track-pointer"),l.className=n.join(" ")}_update(l){const n=this._map,o=this._content;if(!n||!this._lngLat&&!this._trackPointer||!o)return;let h=this._container;if(h||(h=this._container=vt("div","mapboxgl-popup",n.getContainer()),this._tip=vt("div","mapboxgl-popup-tip",h),h.appendChild(o)),this.options.maxWidth&&h.style.maxWidth!==this.options.maxWidth&&(h.style.maxWidth=this.options.maxWidth),n.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=ha(this._lngLat,this._pos,n.transform)),!this._trackPointer||l){const d=this._pos=this._trackPointer&&l?l:n.project(this._lngLat),m=Qc(this.options.offset),y=this._anchor=this._getAnchor(m.y),v=Qc(this.options.offset,y),b=d.add(v).round();n._requestDomTask(()=>{this._container&&y&&(this._container.style.transform=`${So[y]} translate(${b.x}px,${b.y}px)`)})}if(!this._marker&&n._showingGlobe()){const d=s.isLngLatBehindGlobe(n.transform,this._lngLat)?0:1;this._setOpacity(d)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const l=this._container.querySelector(qh);l&&l.focus()}_onClose(){this.remove()}_setOpacity(l){this._container&&(this._container.style.opacity=`${l}`),this._content&&(this._content.style.pointerEvents=l?"auto":"none")}},Marker:Ze,Style:Rn,LngLat:s.LngLat,LngLatBounds:s.LngLatBounds,Point:s.Point,MercatorCoordinate:s.MercatorCoordinate,FreeCameraOptions:Bc,Evented:s.Evented,config:s.config,prewarm:function(){ho().acquire(_n)},clearPrewarmedResources:function(){const l=Li;l&&(l.isPreloaded()&&1===l.numActive()?(l.release(_n),Li=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return s.config.ACCESS_TOKEN},set accessToken(l){s.config.ACCESS_TOKEN=l},get baseApiUrl(){return s.config.API_URL},set baseApiUrl(l){s.config.API_URL=l},get workerCount(){return wi.workerCount},set workerCount(l){wi.workerCount=l},get maxParallelImageRequests(){return s.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(l){s.config.MAX_PARALLEL_IMAGE_REQUESTS=l},clearStorage(l){s.clearTileCache(l)},workerUrl:"",workerClass:null,setNow:s.exported.setNow,restoreNow:s.exported.restoreNow};return ua}),zr}()}}]);

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