1(self.webpackChunkFusion=self.webpackChunkFusion||[]).push([[11496],{783:(t,e,r)=>{"use strict";r.d(e,{x:()=>i});const i=Object.freeze({google:"google",uber:"uber",tomtom:"tomtom",tmap:"tmap",here:"here",unknown:"unknown"})},1029:(t,e,r)=>{"use strict";r.d(e,{D:()=>o,l:()=>n});var i=r(52474);function n(t){var e;if(!t)return!1;Array.isArray(t)&&(t=t[0]);return Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions)}function o(t){var e,r;let o;return(0,i.v)(t,"null loader"),(0,i.v)(n(t),"invalid loader"),Array.isArray(t)&&(o=t[1],t=t[0],t={...t,options:{...t.options,...o}}),(null!==(e=t)&&void 0!==e&&e.parseTextSync||null!==(r=t)&&void 0!==r&&r.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}},1764:(t,e,r)=>{"use strict";r.d(e,{$M:()=>o,Vl:()=>s,cT:()=>d,on:()=>l,zi:()=>a});var i=r(80598),n=r(86926);function o(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(t,e){const r=t%e;return r<0?e+r:r}function s(t){return[t[12],t[13],t[14]]}function l(t){return{left:c(t[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:c(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:c(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:c(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:c(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),far:c(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}}const u=new n.A;function c(t,e,r,i){u.set(t,e,r);const o=u.len();return{distance:i/o,normal:new n.A(-t/o,-e/o,-r/o)}}function h(t){return t-Math.fround(t)}let p;function d(t,e){const{size:r=1,startIndex:n=0}=e,o=void 0!==e.endIndex?e.endIndex:t.length,a=(o-n)/r;p=i.A.allocate(p,a,{type:Float32Array,size:2*r});let s=n,l=0;for(;s<o;){for(let e=0;e<r;e++){const i=t[s++];p[l+e]=i,p[l+e+r]=h(i)}l+=2*r}return p.subarray(0,a*r*2)}},5575:(t,e,r)=>{"use strict";r.d(e,{A:()=>p});var i=r(67811),n=r(93450),o=r(99932),a=r(73742),s=r(85971),l=r(36471),u=r(93092);const c=Math.PI/180;function h(t){return 512/4003e4/Math.cos(t*c)}class p extends n.A{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{latitude:e=0,longitude:r=0,zoom:n=0,pitch:a=0,bearing:s=0,nearZMultiplier:l=.1,farZMultiplier:c=1.01,orthographic:h=!1,projectionMatrix:p,repeat:d=!1,worldOffset:f=0,legacyMeterSizes:m=!1}=t;let{width:g,height:y,altitude:v=1.5}=t;const _=Math.pow(2,n);let b;g=g||1,y=y||1;let x=null;p?(v=p[5]/2,b=(0,o.Os)(v)):(t.fovy?(b=t.fovy,v=(0,o.wZ)(b)):b=(0,o.Os)(v),x=(0,o.om)({width:g,height:y,pitch:a,fovy:b,nearZMultiplier:l,farZMultiplier:c}));let w=(0,o.rY)({height:y,pitch:a,bearing:s,scale:_,altitude:v});if(f){w=(new u.A).translate([512*f,0,0]).multiplyLeft(w)}super({...t,width:g,height:y,viewMatrix:w,longitude:r,latitude:e,zoom:n,...x,fovy:b,focalDistance:v}),(0,i.A)(this,"longitude",void 0),(0,i.A)(this,"latitude",void 0),(0,i.A)(this,"pitch",void 0),(0,i.A)(this,"bearing",void 0),(0,i.A)(this,"altitude",void 0),(0,i.A)(this,"fovy",void 0),(0,i.A)(this,"orthographic",void 0),(0,i.A)(this,"_subViewports",void 0),(0,i.A)(this,"_pseudoMeters",void 0),this.latitude=e,this.longitude=r,this.zoom=n,this.pitch=a,this.bearing=s,this.altitude=v,this.fovy=b,this.orthographic=h,this._subViewports=d?[]:null,this._pseudoMeters=m,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),e=Math.floor((t[0]+180)/360),r=Math.ceil((t[2]-180)/360);for(let t=e;t<=r;t++){const e=t?new p({...this,worldOffset:t}):this;this._subViewports.push(e)}}return this._subViewports}projectPosition(t){if(this._pseudoMeters)return super.projectPosition(t);const[e,r]=this.projectFlat(t);return[e,r,(t[2]||0)*h(t[1])]}unprojectPosition(t){if(this._pseudoMeters)return super.unprojectPosition(t);const[e,r]=this.unprojectFlat(t);return[e,r,(t[2]||0)/h(r)]}addMetersToLngLat(t,e){return(0,o.dT)(t,e)}panByPosition(t,e){const r=(0,o.xJ)(e,this.pixelUnprojectionMatrix),i=this.projectFlat(t),n=l.WQ([],i,l.ze([],r)),a=l.WQ([],this.center,n),[s,u]=this.unprojectFlat(a);return{longitude:s,latitude:u}}getBounds(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=(0,a.A)(this,t.z||0);return[Math.min(e[0][0],e[1][0],e[2][0],e[3][0]),Math.min(e[0][1],e[1][1],e[2][1],e[3][1]),Math.max(e[0][0],e[1][0],e[2][0],e[3][0]),Math.max(e[0][1],e[1][1],e[2][1],e[3][1])]}fitBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{width:r,height:i}
1=this,{longitude:n,latitude:o,zoom:a}=(0,s.A)({width:r,height:i,bounds:t,...e});return new p({width:r,height:i,longitude:n,latitude:o,zoom:a})}}(0,i.A)(p,"displayName","WebMercatorViewport")},7114:(t,e,r)=>{"use strict";r.d(e,{A:()=>b});var i=r(67811),n=r(29275);const o="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source";(0,n.A)();class a{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";(0,i.A)(this,"storage",void 0),(0,i.A)(this,"id",void 0),(0,i.A)(this,"config",{}),this.storage=function(t){try{const e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch(t){return null}}(r),this.id=t,this.config={},Object.assign(this.config,e),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){return this.config={},this.updateConfiguration(t)}updateConfiguration(t){if(Object.assign(this.config,t),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}function s(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600;const n=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>i&&(r=Math.min(r,i/t.width));const o=t.width*r,a=t.height*r,s=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(n,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),s]}let l;function u(t){return"string"==typeof t?l[t.toUpperCase()]||l.WHITE:t}function c(t,e){if(!t)throw new Error(e||"Assertion failed")}!function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(l||(l={}));const h={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof r.g&&r.g,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},p=h.window||h.self||h.global,d=h.process||{};function f(){let t;var e,r;if(n.A&&"performance"in p)t=null==p||null===(e=p.performance)||void 0===e||null===(r=e.now)||void 0===r?void 0:r.call(e);else if("hrtime"in d){var i;const e=null==d||null===(i=d.hrtime)||void 0===i?void 0:i.call(d);t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}const m={debug:n.A&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},g={enabled:!0,level:0};function y(){}const v={},_={once:!0};class b{constructor(){let{id:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""};(0,i.A)(this,"id",void 0),(0,i.A)(this,"VERSION",o),(0,i.A)(this,"_startTs",f()),(0,i.A)(this,"_deltaTs",f()),(0,i.A)(this,"_storage",void 0),(0,i.A)(this,"userData",{}),(0,i.A)(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this._storage=new a("__probe-".concat(this.id,"__"),g),this.userData={},this.timeStamp("".concat(this.id," started")),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"];const r=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(r);for(const r of i)"function"==typeof t[r]&&(e.find((t=>r===t))||(t[r]=t[r].bind(t)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((f()-this._startTs).toPrecision(10))}getDelta(){return Number((f()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,e){this._storage.updateConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){c(t,e)}warn(t){return this._getLogFunction(0,t,m.warn,arguments,_)}error(t){return this._getLogFunction(0,t,m.error,arguments)}deprecated(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}probe(t,e){return this._getLogFunction(t,e,m.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,m.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),n=2;n<r;n++)i[n-2]=arguments[n];return this._getLogFunction(t,e,m.debug||m.info,arguments,_)}table(t,e,r){return e?this._getLogFunction(t,e,console.table||y,r&&[r],{tag:A(e)}):y}image(t){let{logLevel:e,priority:i,image:o,message:a="",scale:l=1}=t;return this._shouldLog(e||i)?n.A?function(t){let{image:e,message:r="",scale:i=1}=t;if("string"==typeof e){const t=new Image;return t.onload=()=>{const e=s(t,r,i);console.log(...e)},t.src=e,y}const n=e.nodeName||"";
1if("img"===n.toLowerCase())return console.log(...s(e,r,i)),y;if("canvas"===n.toLowerCase()){const t=new Image;return t.onload=()=>console.log(...s(t,r,i)),t.src=e.toDataURL(),y}return y}({image:o,message:a,scale:l}):function(t){let{image:e,message:i="",scale:n=1}=t,o=null;try{o=r(14034)}catch(t){}if(o)return()=>o(e,{fit:"box",width:"".concat(Math.round(80*n),"%")}).then((t=>console.log(t)));return y}({image:o,message:a,scale:l}):y}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||y)}group(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1};const i=w({logLevel:t,message:e,opts:r}),{collapsed:n}=r;return i.method=(n?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},r,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||y)}withGroup(t,e,r){this.group(t,e)();try{r()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=x(t)}_getLogFunction(t,e,r,i,o){if(this._shouldLog(t)){o=w({logLevel:t,message:e,args:i,opts:o}),c(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=f();const a=o.tag||o.message;if(o.once){if(v[a])return y;v[a]=f()}return e=function(t,e,r){if("string"==typeof e){const i=r.time?function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}(function(t){let e;return e=t<10?"".concat(t.toFixed(2),"ms"):t<100?"".concat(t.toFixed(1),"ms"):t<1e3?"".concat(t.toFixed(0),"ms"):"".concat((t/1e3).toFixed(2),"s"),e}(r.total)):"";e=function(t,e,r){return n.A||"string"!=typeof t||(e&&(e=u(e),t="�[".concat(e,"m").concat(t,"�[39m")),r&&(e=u(r),t="�[".concat(r+10,"m").concat(t,"�[49m"))),t}(e=r.time?"".concat(t,": ").concat(i," ").concat(e):"".concat(t,": ").concat(e),r.color,r.background)}return e}(this.id,o.message,o),r.bind(console,e,...o.args)}return y}}function x(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return c(Number.isFinite(e)&&e>=0),e}function w(t){const{logLevel:e,message:r}=t;t.logLevel=x(e);const i=t.args?Array.from(t.args):[];for(;i.length&&i.shift()!==r;);switch(typeof e){case"string":case"function":void 0!==r&&i.unshift(r),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());const n=typeof t.message;return c("string"===n||"object"===n),Object.assign(t,{args:i},t.opts)}function A(t){for(const e in t)for(const r in t[e])return r||"untitled";return"empty"}(0,i.A)(b,"VERSION",o)},7148:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var i=r(32970);const n="EXT_color_buffer_float",o={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:n,bpp:2},33327:{gl2:n,bpp:4},34842:{gl2:n,bpp:8},33326:{gl2:n,bpp:4},33328:{gl2:n,bpp:8},34836:{gl2:n,bpp:16},35898:{gl2:n,bpp:4}};var a=r(56706),s=r(57971);class l extends i.A{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(t){let{format:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null};return!e||function(t,e,r){const i=r[e];if(!i)return!1;const n=(0,a.C6)(t)&&i.gl2||i.gl1;return"string"==typeof n?t.getExtension(n):n}(t,e,o)}static getSamplesForFormat(t,e){let{format:r}=e;return t.getInternalformatParameter(36161,r,32937)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.initialize(e),Object.seal(this)}initialize(t){let{format:e,width:r=1,height:i=1,samples:n=0}=t;return(0,s.v)(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==n&&(0,a.C6)(this.gl)?this.gl.renderbufferStorageMultisample(36161,n,e,r,i):this.gl.renderbufferStorage(36161,e,r,i),this.format=e,this.width=r,this.height=i,this.samples=n,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*o[this.format].bpp),this}resize(t){let{width:e,height:r}=t;return e!==this.width||r!==this.height?this.initialize({width:e,height:r,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(t){this.gl.bindRenderbuffer(36161,t)}_syncHandle(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(t){this.gl.bindRenderbuffer(36161,this.handle);return this.gl.getRenderbufferParameter(36161,t)}}},8842:(t,e,r)=>{"use strict";r.d(e,{$M:()=>n,_U:()=>o,p6:()=>l,qE:()=>s,zi:()=>a});var i=r(70549);function n(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function o(t,e){const r=(0,i.Z0)([],e,t);return(0,i.hs)(r,r,1/r[3]),r}function a(t,e){const r=t%e;return r<0?e+r:r}function s(t,e,r){return t<e?e:t>
1r?r:t}const l=Math.log2||function(t){return Math.log(t)*Math.LOG2E}},9444:(t,e,r)=>{"use strict";function i(t,e,r){const i=e[0],n=e[1],o=r[3]*i+r[7]*n||1;return t[0]=(r[0]*i+r[4]*n)/o,t[1]=(r[1]*i+r[5]*n)/o,t}function n(t,e,r){const i=e[0],n=e[1],o=e[2],a=r[3]*i+r[7]*n+r[11]*o||1;return t[0]=(r[0]*i+r[4]*n+r[8]*o)/a,t[1]=(r[1]*i+r[5]*n+r[9]*o)/a,t[2]=(r[2]*i+r[6]*n+r[10]*o)/a,t}function o(t,e,r){const i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n,t[1]=r[1]*i+r[3]*n,t[2]=e[2],t}r.d(e,{B$:()=>i,J4:()=>o,cL:()=>n})},11496:(t,e,r)=>{"use strict";r.d(e,{c:()=>Wo,O:()=>Vo});var i=r(90417),n=r(76905),o=r(67811),a=r(44504),s=r(35756);class l{constructor(t){(0,o.A)(this,"_propsToCompare",void 0),(0,o.A)(this,"_propsToExtract",void 0),(0,o.A)(this,"_requiredProps",void 0);const{compare:e,extract:r,required:i}=t;this._propsToCompare=e,this._propsToExtract=r||e,this._requiredProps=i}arePropsEqual(t,e){for(const r of this._propsToCompare)if(!(r in t)||!(r in e)||!(0,a.aI)(t[r],e[r]))return!1;return!0}initializeProps(t,e){const r={},i={};for(const n of this._propsToExtract)(n in t||n in e)&&(r[n]=t[n],i[n]=e[n]);return this._checkRequiredProps(r),this._checkRequiredProps(i),{start:r,end:i}}getDuration(t,e){return e.transitionDuration}_checkRequiredProps(t){this._requiredProps&&this._requiredProps.forEach((e=>{const r=t[e];(0,s.A)(Number.isFinite(r)||Array.isArray(r),"".concat(e," is required for transition"))}))}}const u=["longitude","latitude","zoom","bearing","pitch"],c=["longitude","latitude","zoom"];class h extends l{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=Array.isArray(t)?t:t.transitionProps,r=Array.isArray(t)?{}:t;r.transitionProps=Array.isArray(e)?{compare:e,required:e}:e||{compare:u,required:c},super(r.transitionProps),(0,o.A)(this,"opts",void 0),this.opts=r}initializeProps(t,e){const r=super.initializeProps(t,e),{makeViewport:i,around:n}=this.opts;if(i&&n){const o=i(t),a=i(e),s=o.unproject(n);r.start.around=n,Object.assign(r.end,{around:a.project(s),aroundPosition:s,width:e.width,height:e.height})}return r}interpolateProps(t,e,r){const i={};for(const n of this._propsToExtract)i[n]=(0,a.Cc)(t[n]||0,e[n]||0,r);if(e.aroundPosition&&this.opts.makeViewport){const n=this.opts.makeViewport({...e,...i});Object.assign(i,n.panByPosition(e.aroundPosition,(0,a.Cc)(t.around,e.around,r)))}return i}}var p=r(5575),d=r(80543),f=r(40014);function m(t){const[e,r]=(0,n.c6)(),i={backgroundColor:r.colors.primary100,height:"100%",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"};return(0,f.Y)("div",{className:e(i),children:"Unexpected Map Error"})}const g=Object.freeze({googleMaps:"google-maps",mapboxGL:"mapbox-gl"});const y=r("__fusion__95b4ba69e5").createContext(!1),v=[{name:"mapbox-gl",tiles:"empty"}];document.URL.startsWith("http://localhost");var _=r(13650); 2/*! ***************************************************************************** 3Copyright (c) Microsoft Corporation. 4 5Permission to use, copy, modify, and/or distribute this software for any 6purpose with or without fee is hereby granted. 7 8THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 9REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 10AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 11INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 12LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 13OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 14PERFORMANCE OF THIS SOFTWARE. 15***************************************************************************** */ 16function b(t,e,r,i){return new(r||(r=Promise))((function(n,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){t.done?n(t.value):function(t){return t instanceof r?t:new r((function(e){e(t)}))}(t.value).then(a,s)}l((i=i.apply(t,e||[])).next())}))}var x=function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var i,n,o;if(Array.isArray(e)){if((i=e.length)!=r.length)return!1;for(n=i;0!=n--;
16)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((i=(o=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(n=i;0!=n--;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=i;0!=n--;){var a=o[n];if(!t(e[a],r[a]))return!1}return!0}return e!=e&&r!=r};const w="__googleMapsScriptId";var A;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.LOADING=1]="LOADING",t[t.SUCCESS=2]="SUCCESS",t[t.FAILURE=3]="FAILURE"}(A||(A={}));class E{constructor(t){let{apiKey:e,authReferrerPolicy:r,channel:i,client:n,id:o=w,language:a,libraries:s=[],mapIds:l,nonce:u,region:c,retries:h=3,url:p="https://maps.googleapis.com/maps/api/js",version:d}=t;if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=r,this.channel=i,this.client=n,this.id=o||w,this.language=a,this.libraries=s,this.mapIds=l,this.nonce=u,this.region=c,this.retries=h,this.url=p,this.version=d,E.instance){if(!x(this.options,E.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(E.instance.options)}`);return E.instance}E.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?A.FAILURE:this.done?A.SUCCESS:this.loading?A.LOADING:A.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let t=this.url;return t+="?callback=__googleMapsCallback",this.apiKey&&(t+=`&key=${this.apiKey}`),this.channel&&(t+=`&channel=${this.channel}`),this.client&&(t+=`&client=${this.client}`),this.libraries.length>0&&(t+=`&libraries=${this.libraries.join(",")}`),this.language&&(t+=`&language=${this.language}`),this.region&&(t+=`®ion=${this.region}`),this.version&&(t+=`&v=${this.version}`),this.mapIds&&(t+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(t+=`&auth_referrer_policy=${this.authReferrerPolicy}`),t}deleteScript(){const t=document.getElementById(this.id);t&&t.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise(((t,e)=>{this.loadCallback((r=>{r?e(r.error):t(window.google)}))}))}importLibrary(t){return this.execute(),google.maps.importLibrary(t)}loadCallback(t){this.callbacks.push(t),this.execute()}setScript(){var t,e;if(document.getElementById(this.id))return void this.callback();const r={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(r).forEach((t=>!r[t]&&delete r[t])),(null===(e=null===(t=null===window||void 0===window?void 0:window.google)||void 0===t?void 0:t.maps)||void 0===e?void 0:e.importLibrary)||(t=>{let e,r,i,n="The Google Maps JavaScript API",o="google",a="importLibrary",s="__ib__",l=document,u=window;u=u[o]||(u[o]={});const c=u.maps||(u.maps={}),h=new Set,p=new URLSearchParams,d=()=>e||(e=new Promise(((a,u)=>b(this,void 0,void 0,(function*(){var d;for(i in yield r=l.createElement("script"),r.id=this.id,p.set("libraries",[...h]+""),t)p.set(i.replace(/[A-Z]/g,(t=>"_"+t[0].toLowerCase())),t[i]);p.set("callback",o+".maps."+s),r.src=this.url+"?"+p,c[s]=a,r.onerror=()=>e=u(Error(n+" could not load.")),r.nonce=this.nonce||(null===(d=l.querySelector("script[nonce]"))||void 0===d?void 0:d.nonce)||"",l.head.append(r)})))));c[a]?console.warn(n+" only loads once. Ignoring:",t):c[a]=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return h.add(t)&&d().then((()=>c[a](t,...r)))}})(r);const i=this.libraries.map((t=>this.importLibrary(t)));i.length||i.push(this.importLibrary("core")),Promise.all(i).then((()=>this.callback()),(t=>{const e=new ErrorEvent("error",{error:t});this.loadErrorCallback(e)}))}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(t){if(this.errors.push(t),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout((()=>{this.deleteScript(),this.setScript()}),t)}else this.onerrorEvent=t,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach((t=>{t(this.onerrorEvent)})),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setScript())}}}var T=r(56706);let S=1,P=1;class I{constructor(){this.time=0,this.channels=new Map,this.animations=new Map,this.playing=!1,this.lastEngineTime=-1}addChannel(t){const{delay:e=0,duration:r=Number.POSITIVE_INFINITY,rate:i=1,repeat:n=1}=t,o=S++,a={time:0,delay:e,duration:r,rate:i,repeat:n};return this._setChannelTime(a,this.time),this.channels.set(o,a),o}removeChannel(t){this.channels.delete(t);for(const[e,r]of this.animations)r.channel===t&&this.detachAnimation(e)}isFinished(t){const e=this.channels.get(t);return void 0!==e&&this.time>=e.delay+e.duration*e.repeat}getTime(t){if(void 0===t)return this.time;const e=this.channels.get(t);return void 0===e?-1:e.time}setTime(t){this.time=Math.max(0,t);const e=this.channels.values();for(const t of e)this._setChannelTime(t,this.time);const r=this.animations.values();for(const t of r){const{animation:e,channel:r}=t;e.setTime(this.getTime(r))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(t,e){const r=P++;return this.animations.set(r,{animation:t,channel:e}),t.setTime(this.getTime(e)),r}detachAnimation(t){this.animations.delete(t)}update(t){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=t),this.setTime(this.time+(t-this.lastEngineTime)),this.lastEngineTime=t)}_setChannelTime(t,e){const r=e-t.delay;r>=t.duration*t.repeat?t.time=t.duration*t.rate:(t.time=Math.max(0,r)%t.duration,t.time*=t.rate)}}var M=r(42444),C=r(62022),k=r(18718),L=r(19582),z=r(25989),R=r(88283);class O{constructor(t,e,r){(0,o.A)(this,"id",void 0),(0,o.A)(this,"context",void 0),(0,o.A)(this,"isLoaded",void 0),(0,o.A)(this,"persistent",void 0),(0,o.A)(this,"_loadCount",0),(0,o.A)(this,"_subscribers",new Set),(0,o.A)(this,"_data",void 0),(0,o.A)(this,"_loader",void 0),(0,o.A)(this,"_error",void 0),(0,o.A)(this,"_content",void 0),this.id=t,this.context=r,this.setData(e)}subscribe(t){this._subscribers.add(t)}unsubscribe(t){this._subscribers.delete(t)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then((()=>this.getData()))}setData(t,e){if(t===this._data&&!e)return;this._data=t;const r=++this._loadCount;let i=t;"string"==typeof t&&(i=(0,R.H)(t)),i instanceof Promise?(this.isLoaded=!1,this._loader=i.then((t=>{this._loadCount===r&&(this.isLoaded=!0,this._error=void 0,this._content=t)}
16)).catch((t=>{this._loadCount===r&&(this.isLoaded=!0,this._error=t||!0)}))):(this.isLoaded=!0,this._error=void 0,this._content=t);for(const t of this._subscribers)t.onChange(this.getData())}}class D{constructor(t){let{gl:e,protocol:r}=t;(0,o.A)(this,"protocol",void 0),(0,o.A)(this,"_context",void 0),(0,o.A)(this,"_resources",void 0),(0,o.A)(this,"_consumers",void 0),(0,o.A)(this,"_pruneRequest",void 0),this.protocol=r||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(t){return!!t.startsWith(this.protocol)||t in this._resources}add(t){let{resourceId:e,data:r,forceUpdate:i=!1,persistent:n=!0}=t,o=this._resources[e];o?o.setData(r,i):(o=new O(e,r,this._context),this._resources[e]=o),o.persistent=n}remove(t){const e=this._resources[t];e&&(e.delete(),delete this._resources[t])}unsubscribe(t){let{consumerId:e}=t;const r=this._consumers[e];if(r){for(const t in r){const e=r[t],i=this._resources[e.resourceId];i&&i.unsubscribe(e)}delete this._consumers[e],this.prune()}}subscribe(t){let{resourceId:e,onChange:r,consumerId:i,requestId:n="default"}=t;const{_resources:o,protocol:a}=this;e.startsWith(a)&&(e=e.replace(a,""),o[e]||this.add({resourceId:e,data:null,persistent:!1}));const s=o[e];if(this._track(i,n,s,r),s)return s.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout((()=>this._prune()),0))}finalize(){for(const t in this._resources)this._resources[t].delete()}_track(t,e,r,i){const n=this._consumers,o=n[t]=n[t]||{},a=o[e]||{},s=a.resourceId&&this._resources[a.resourceId];s&&(s.unsubscribe(a),this.prune()),r&&(o[e]=a,a.onChange=i,a.resourceId=r.id,r.subscribe(a))}_prune(){this._pruneRequest=null;for(const t of Object.keys(this._resources)){const e=this._resources[t];e.persistent||e.inUse()||(e.delete(),delete this._resources[t])}}}var B=r(93450),F=r(70260),j=r(59579);const N=[j.A],U=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function V(t){const e=F.A.getDefaultProgramManager(t);for(const t of N)e.addDefaultModule(t);for(const t of U)e.addShaderHook(t);return e}class q{constructor(t){let{deck:e,stats:r,viewport:i,timeline:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,o.A)(this,"layers",void 0),(0,o.A)(this,"context",void 0),(0,o.A)(this,"resourceManager",void 0),(0,o.A)(this,"_lastRenderedLayers",[]),(0,o.A)(this,"_needsRedraw",!1),(0,o.A)(this,"_needsUpdate",!1),(0,o.A)(this,"_nextLayers",null),(0,o.A)(this,"_debug",!1),(0,o.A)(this,"activateViewport",(t=>{(0,k.A)("layerManager.activateViewport",this,t),t&&(this.context.viewport=t)})),this.layers=[],this.resourceManager=new D({gl:t,protocol:"deck://"}),this.context={mousePosition:null,userData:{},layerManager:this,gl:t,deck:e,programManager:t&&V(t),stats:r||new z.A({id:"deck.gl"}),viewport:i||new B.A({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:n||new I,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}finalize(){this.resourceManager.finalize();for(const t of this.layers)this._finalizeLayer(t)}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);for(const r of this.layers){const i=r.getNeedsRedraw(t);e=e||i}return e}needsUpdate(){return this._nextLayers&&this._nextLayers!==this._lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(t){this._needsRedraw=this._needsRedraw||t}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t}getLayers(){let{layerIds:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t?this.layers.filter((e=>t.find((t=>0===e.id.indexOf(t))))):this.layers}setProps(t){"debug"in t&&(this._debug=t.debug),"userData"in t&&(this.context.userData=t.userData),"layers"in t&&(this._nextLayers=t.layers),"onError"in t&&(this.context.onError=t.onError)}setLayers(t,e){(0,k.A)("layerManager.setLayers",this,e,t),this._lastRenderedLayers=t;const r=(0,L.B)(t,Boolean);for(const t of r)t.context=this.context;this._updateLayers(this.layers,r)}updateLayers(){const t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(this._nextLayers||this._lastRenderedLayers,t)),this._nextLayers=null}_handleError(t,e,r){r.raiseError(e,"".concat(t," of ").concat(r))}_updateLayers(t,e){const r={};for(const e of t)r[e.id]?C.A.warn("Multiple old layers with same id ".concat(e.id))():r[e.id]=e;const i=[];this._updateSublayersRecursively(e,r,i),this._finalizeOldLayers(r);let n=!1;for(const t of i)if(t.hasUniformTransition()){n="Uniform transition in ".concat(t);break}this._needsUpdate=n,this.layers=i}_updateSublayersRecursively(t,e,r){for(const i of t){i.context=this.context;const t=e[i.id];null===t&&C.A.warn("Multiple new layers with same id ".concat(i.id))(),e[i.id]=null;let n=null;try{this._debug&&t!==i&&i.validateProps(),t?(this._transferLayerState(t,i),this._updateLayer(i)):this._initializeLayer(i),r.push(i),n=i.isComposite?i.getSubLayers():null}catch(t){this._handleError("matching",t,i)}n&&this._updateSublayersRecursively(n,e,r)}}_finalizeOldLayers(t){for(const e in t){const r=t[e];r&&this._finalizeLayer(r)}}_initializeLayer(t){try{t._initialize(),t.lifecycle=M.VD.INITIALIZED}catch(e){this._handleError("initialization",e,t)}}_transferLayerState(t,e){e._transferState(t),e.lifecycle=M.VD.MATCHED,e!==t&&(t.lifecycle=M.VD.AWAITING_GC)}_updateLayer(t){try{t._update()}catch(e){this._handleError("update",e,t)}}_finalizeLayer(t){this._needsRedraw=this._needsRedraw||"finalized ".concat(t),t.lifecycle=M.VD.AWAITING_FINALIZATION;try{t._finalize(),t.lifecycle=M.VD.FINALIZED}catch(e){this._handleError("finalization",e,t)}}}var G=r(34793);class Z{constructor(t){(0,o.A)(this,"width",void 0),(0,o.A)(this,"height",void 0),(0,o.A)(this,"views",void 0),(0,o.A)(this,"viewState",void 0),(0,o.A)(this,"controllers",void 0),(0,o.A)(this,"timeline",void 0),(0,o.A)(this,"_viewports",void 0),(0,o.A)(this,"_viewportMap",void 0),(0,o.A)(this,"_isUpdating",void 0),(0,o.A)(this,"_needsRedraw",void 0),(0,o.A)(this,"_needsUpdate",void 0),(0,o.A)(this,"_eventManager",void 0),(0,o.A)(this,"_eventCallbacks",void 0),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=t.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="First render",this._needsUpdate="Initialize",this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractionStateChange:t.onInteractionStateChange},Object.seal(this),this.setProps(t)}finalize(){for(const t in this.controllers){const e=this.controllers[t];e&&e.finalize()}this.controllers={}}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t,this._needsRedraw=this._needsRedraw||t}updateViewStates(){for(const t in this.controllers){const e=this.controllers[t];e&&e.updateTransition()}}getViewports(t){return t?this._viewports.filter((e=>e.containsPixel(t))):this._viewports}getViews(){const t={};return this.views.forEach((e=>{t[e.id]=e})),t}getView(t){return this.views.find((e=>e.id===t))}getViewState(t){const e="string"==typeof t?this.getView(t):t,r=e&&this.viewState[e.getViewStateId()]||this.viewState;return e?e.filterViewState(r):r}getViewport(t){return this._viewportMap[t]}unproject(t,e){const r=this.getViewports(),i={x:t[0],y:t[1]};for(let n=r.length-1;n>=0;--n){const o=r[n];if(o.containsPixel(i)){const r=t.slice();return r[0]-=o.x,r[1]-=o.y,o.unproject(r,e)}}return null}
vendor: 19,955 bytes, line 16
16setProps(t){t.views&&this._setViews(t.views),t.viewState&&this._setViewState(t.viewState),("width"in t||"height"in t)&&this._setSize(t.width,t.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(t,e){t===this.width&&e===this.height||(this.width=t,this.height=e,this.setNeedsUpdate("Size changed"))}_setViews(t){t=(0,L.B)(t,Boolean);this._diffViews(t,this.views)&&this.setNeedsUpdate("views changed"),this.views=t}_setViewState(t){if(t){!(0,G.b)(t,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=t}else C.A.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(t,e){this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange({...e,viewId:t})}_createController(t,e){return new(0,e.type)({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:e=>{var r;return null===(r=this.getView(t.id))||void 0===r?void 0:r.makeViewport({viewState:e,width:this.width,height:this.height})}})}_updateController(t,e,r,i){const n=t.controller;if(n){const o={...e,...n,id:t.id,x:r.x,y:r.y,width:r.width,height:r.height};return i||(i=this._createController(t,o)),i&&i.setProps(o),i}return null}_rebuildViewports(){const{views:t}=this,e=this.controllers;this._viewports=[],this.controllers={};let r=!1;for(let i=t.length;i--;){const n=t[i],o=this.getViewState(n),a=n.makeViewport({viewState:o,width:this.width,height:this.height});let s=e[n.id];const l=Boolean(n.controller);l&&!s&&(r=!0),!r&&l||!s||(s.finalize(),s=null),this.controllers[n.id]=this._updateController(n,o,a,s),this._viewports.unshift(a)}for(const t in e){const r=e[t];r&&!this.controllers[t]&&r.finalize()}this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach((t=>{t.id&&(this._viewportMap[t.id]=this._viewportMap[t.id]||t)}))}_diffViews(t,e){return t.length!==e.length||t.some(((r,i)=>!t[i].equals(e[i])))}}const W=/([0-9]+\.?[0-9]*)(%|px)/;function H(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=W.exec(t);if(e&&e.length>=3){const t="%"===e[2],r=parseFloat(e[1]);return{position:t?r/100:r,relative:t}}default:throw new Error("Could not parse position string ".concat(t))}}function X(t,e){return t.relative?Math.round(t.position*e):t.position}class Y{constructor(t){(0,o.A)(this,"id",void 0),(0,o.A)(this,"viewportInstance",void 0),(0,o.A)(this,"_x",void 0),(0,o.A)(this,"_y",void 0),(0,o.A)(this,"_width",void 0),(0,o.A)(this,"_height",void 0),(0,o.A)(this,"_padding",void 0),(0,o.A)(this,"props",void 0);const{id:e,x:r=0,y:i=0,width:n="100%",height:a="100%",padding:l=null,viewportInstance:u}=t||{};(0,s.A)(!u||u instanceof B.A),this.viewportInstance=u,this.id=e||this.constructor.displayName||"view",this.props={...t,id:this.id},this._x=H(r),this._y=H(i),this._width=H(n),this._height=H(a),this._padding=l&&{left:H(l.left||0),right:H(l.right||0),top:H(l.top||0),bottom:H(l.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}equals(t){return this===t||(this.viewportInstance?!!t.viewportInstance&&this.viewportInstance.equals(t.viewportInstance):this.ViewportType===t.ViewportType&&(0,G.b)(this.props,t.props))}makeViewport(t){let{width:e,height:r,viewState:i}=t;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const n=this.getDimensions({width:e,height:r});return new this.ViewportType({...i,...this.props,...n})}getViewStateId(){const{viewState:t}=this.props;return"string"==typeof t?t:(null==t?void 0:t.id)||this.id}filterViewState(t){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const e={...t};for(const t in this.props.viewState)"id"!==t&&(e[t]=this.props.viewState[t]);return e}return t}getDimensions(t){let{width:e,height:r}=t;const i={x:X(this._x,e),y:X(this._y,r),width:X(this._width,e),height:X(this._height,r)};return this._padding&&(i.padding={left:X(this._padding.left,e),top:X(this._padding.top,r),right:X(this._padding.right,e),bottom:X(this._padding.bottom,r)}),i}get controller(){const t=this.props.controller;return t?!0===t?{type:this.ControllerType}:"function"==typeof t?{type:t}:{type:this.ControllerType,...t}:null}}var K=r(57974);const J=()=>{},Q=2,$=3,tt=t=>t,et=1;class rt{constructor(t){(0,o.A)(this,"getControllerState",void 0),(0,o.A)(this,"props",void 0),(0,o.A)(this,"propsInTransition",void 0),(0,o.A)(this,"transition",void 0),(0,o.A)(this,"onViewStateChange",void 0),(0,o.A)(this,"onStateChange",void 0),(0,o.A)(this,"_onTransitionUpdate",(t=>{const{time:e,settings:{interpolator:r,startProps:i,endProps:n,duration:o,easing:a}}=t,s=a(e/o),l=r.interpolateProps(i,n,s);this.propsInTransition=this.getControllerState({...this.props,...l}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})})),this.getControllerState=t.getControllerState,this.propsInTransition=null,this.transition=new K.A(t.timeline),this.onViewStateChange=t.onViewStateChange||J,this.onStateChange=t.onStateChange||J}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(t){let e=!1;const r=this.props;if(this.props=t,!r||this._shouldIgnoreViewportChange(r,t))return!1;if(this._isTransitionEnabled(t)){let i=r;if(this.transition.inProgress){const{interruption:t,endProps:e}=this.transition.settings;i={...r,...t===Q?e:this.propsInTransition||r}}this._triggerTransition(i,t),e=!0}else this.transition.cancel();return e}updateTransition(){this.transition.update()}_isTransitionEnabled(t){const{transitionDuration:e,transitionInterpolator:r}=t;return(e>0||"auto"===e)&&Boolean(r)}_isUpdateDueToCurrentTransition(t){return!(!this.transition.inProgress||!this.propsInTransition)&&this.transition.settings.interpolator.arePropsEqual(t,this.propsInTransition)}_shouldIgnoreViewportChange(t,e){return this.transition.inProgress?this.transition.settings.interruption===$||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e)}_triggerTransition(t,e){const r=this.getControllerState(t),i=this.getControllerState(e).shortestPathFrom(r),n=e.transitionInterpolator,o=n.getDuration?n.getDuration(t,e):e.transitionDuration;if(0===o)return;const a=n.initializeProps(t,i);this.propsInTransition={};const s={duration:o,easing:e.transitionEasing||tt,interpolator:n,interruption:e.transitionInterruption||et,startProps:a.start,endProps:a.end,onStart:e.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(e.onTransitionInterrupt),onEnd:this._onTransitionEnd(e.onTransitionEnd)};this.transition.start(s),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(t){return e=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),null==t||t(e)}}}const it={transitionDuration:0},nt=t=>1-(1-t)*(1-t),ot=["wheel"],at=["panstart","panmove","panend"],st=["pinchstart","pinchmove","pinchend"],lt=["tripanstart","tripanmove","tripanend"],ut=["doubletap"],ct=["keydown"],ht={};class pt{constructor(t){(0,o.A)(this,"props",void 0),(0,o.A)(this,"state",{}),(0,o.A)(this,"transitionManager",void 0),(0,o.A)(this,"eventManager",void 0),(0,o.A)(this,"onViewStateChange",void 0),(0,o.A)(this,"onStateChange",void 0),(0,o.A)(this,"makeViewport",void 0),(0,o.A)(this,"_controllerState",void 0),(0,o.A)(this,"_events",{}),(0,o.A)(this,"_interactionState",{isDragging:!1}),(0,o.A)(this,"_customEvents",[]),(0,o.A)(this,"_eventStartBlocked",null),(0,o.A)(this,"_panMove",!1),(0,o.A)(this,"invertPan",!1),(0,o.A)(this,"dragMode","rotate"),(0,o.A)(this,"inertia",0),(0,o.A)(this,"scrollZoom",!0),(0,o.A)(this,"dragPan",!0),(0,o.A)(this,"dragRotate",!0),(0,o.A)(this,"doubleClickZoom",!0),(0,o.A)(this,"touchZoom",!0),(0,o.A)(this,"touchRotate",!1),(0,o.A)(this,"keyboard",!0),this.transitionManager=new rt({...t,getControllerState:t=>new this.ControllerState(t),onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}),this.handleEvent=this.handleEvent.bind(this),this.eventManager=t.eventManager,this.onViewStateChange=t.onViewStateChange||(()=>{}),this.onStateChange=t.onStateChange||(()=>{}),this.makeViewport=t.makeViewport}set events(t){this.toggleEvents(this._customEvents,!1),this.toggleEvents(t,!0),this._customEvents=t,this.props&&this.setProps(this.props)}finalize(){for(const e in this._events){var t;if(this._events[e])null===(t=this.eventManager)||void 0===t||t.off(e,this.handleEvent)}this.transitionManager.finalize()}handleEvent(t){this._controllerState=void 0;const e=this._eventStartBlocked;switch(t.type){case"panstart":return!e&&this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return!e&&this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return!e&&this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}get controllerState(){return this._controllerState=this._controllerState||new this.ControllerState({makeViewport:this.makeViewport,...this.props,...this.state}),this._controllerState}getCenter(t){const{x:e,y:r}=this.props,{offsetCenter:i}=t;return[i.x-e,i.y-r]}isPointInBounds(t,e){const{width:r,height:i}=this.props;if(e&&e.handled)return!1;const n=t[0]>=0&&t[0]<=r&&t[1]>=0&&t[1]<=i;return n&&e&&e.stopPropagation(),n}isFunctionKeyPressed(t){const{srcEvent:e}=t;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}isDragging(){return this._interactionState.isDragging||!1}blockEvents(t){const e=setTimeout((()=>{this._eventStartBlocked===e&&(this._eventStartBlocked=null)}),t);this._eventStartBlocked=e}setProps(t){t.dragMode&&(this.dragMode=t.dragMode),this.props=t,"transitionInterpolator"in t||(t.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(t);const{inertia:e}=t;this.inertia=Number.isFinite(e)?e:!0===e?300:0;const{scrollZoom:r=!0,dragPan:i=!0,dragRotate:n=!0,doubleClickZoom:o=!0,touchZoom:a=!0,touchRotate:s=!1,keyboard:l=!0}=t,u=Boolean(this.onViewStateChange);this.toggleEvents(ot,u&&r),this.toggleEvents(at,u&&(i||n)),this.toggleEvents(st,u&&(a||s)),this.toggleEvents(lt,u&&s),this.toggleEvents(ut,u&&o),this.toggleEvents(ct,u&&l),this.scrollZoom=r,this.dragPan=i,this.dragRotate=n,this.doubleClickZoom=o,this.touchZoom=a,this.touchRotate=s,this.keyboard=l}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(t,e){this.eventManager&&t.forEach((t=>{this._events[t]!==e&&(this._events[t]=e,e?this.eventManager.on(t,this.handleEvent):this.eventManager.off(t,this.handleEvent))}))}updateViewport(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={...t.getViewportProps(),...e},n=this.controllerState!==t;if(this.state=t.getState(),this._setInteractionState(r),n){const t=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:this._interactionState,oldViewState:t})}}_onTransition(t){this.onViewStateChange({...t,interactionState:this._interactionState})}_setInteractionState(t){Object.assign(this._interactionState,t),this.onStateChange(this._interactionState)}_onPanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;let r=this.isFunctionKeyPressed(t)||t.rightButton||!1;(this.invertPan||"pan"===this.dragMode)&&(r=!r);const i=this.controllerState[r?"panStart":"rotateStart"]({pos:e});return this._panMove=r,this.updateViewport(i,it,{isDragging:!0}),!0}_onPan(t){return!!this.isDragging()&&(this._panMove?this._onPanMove(t):this._onPanRotate(t))}_onPanEnd(t){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(t):this._onPanRotateEnd(t))}_onPanMove(t){if(!this.dragPan)return!1;const e=this.getCenter(t),r=this.controllerState.pan({pos:e});return this.updateViewport(r,it,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(t){const{inertia:e}=this;if(this.dragPan&&e&&t.velocity){const r=this.getCenter(t),i=[r[0]+t.velocityX*e/2,r[1]+t.velocityY*e/2],n=this.controllerState.pan({pos:i}).panEnd();this.updateViewport(n,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:nt},{isDragging:!1,isPanning:!0})}else{const t=this.controllerState.panEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(t){if(!this.dragRotate)return!1;const e=this.getCenter(t),r=this.controllerState.rotate({pos:e});return this.updateViewport(r,it,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(t){const{inertia:e}=this;if(this.dragRotate&&e&&t.velocity){const r=this.getCenter(t),i=[r[0]+t.velocityX*e/2,r[1]+t.velocityY*e/2],n=this.controllerState.rotate({pos:i}).rotateEnd();this.updateViewport(n,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:nt},{isDragging:!1,isRotating:!0})}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(t){if(!this.scrollZoom)return!1;t.srcEvent.preventDefault();const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const{speed:r=.01,smooth:i=!1}=!0===this.scrollZoom?{}:this.scrollZoom,{delta:n}=t;let o=2/(1+Math.exp(-Math.abs(n*r)));n<0&&0!==o&&(o=1/o);const a=this.controllerState.zoom({pos:e,scale:o});return this.updateViewport(a,{...this._getTransitionProps({around:e}),transitionDuration:i?250:1},{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const r=this.controllerState.rotateStart({pos:e});return this.updateViewport(r,it,{isDragging:!0}),!0}_onTriplePan(t){if(!this.touchRotate)return!1;if(!this.isDragging())return!1;const e=this.getCenter(t);e[0]-=t.deltaX;const r=this.controllerState.rotate({pos:e});return this.updateViewport(r,it,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this;if(this.touchRotate&&e&&t.velocityY){const r=this.getCenter(t),i=[r[0],r[1]+=t.velocityY*e/2],n=this.controllerState.rotate({pos:i});this.updateViewport(n,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:nt},{isDragging:!1,isRotating:!0}),this.blockEvents(e)}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const r=this.controllerState.zoomStart({pos:e}).rotateStart({pos:e});return ht._startPinchRotation=t.rotation,ht._lastPinchEvent=t,this.updateViewport(r,it,{isDragging:!0}),!0}_onPinch(t){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;let e=this.controllerState;if(this.touchZoom){const{scale:r}=t,i=this.getCenter(t);e=e.zoom({pos:i,scale:r})}if(this.touchRotate){const{rotation:r}=t;e=e.rotate({deltaAngleX:ht._startPinchRotation-r})}return this.updateViewport(e,it,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),ht._lastPinchEvent=t,!0}_onPinchEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this,{_lastPinchEvent:r}=ht;if(this.touchZoom&&e&&r&&t.scale!==r.scale){const i=this.getCenter(t);let n=this.controllerState.rotateEnd();const o=Math.log2(t.scale),a=(o-Math.log2(r.scale))/(t.deltaTime-r.deltaTime),s=Math.pow(2,o+a*e/2);n=n.zoom({pos:i,scale:s}).zoomEnd(),this.updateViewport(n,{...this._getTransitionProps({around:i}),transitionDuration:e,transitionEasing:nt},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(e)}else{const t=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return ht._startPinchRotation=null,ht._lastPinchEvent=null,!0}_onDoubleTap(t){if(!this.doubleClickZoom)return!1;const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const r=this.isFunctionKeyPressed(t),i=this.controllerState.zoom({pos:e,scale:r?.5:2});return this.updateViewport(i,this._getTransitionProps({around:e}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(t){if(!this.keyboard)return!1;const e=this.isFunctionKeyPressed(t),{zoomSpeed:r,moveSpeed:i,rotateSpeedX:n,rotateSpeedY:o}=!0===this.keyboard?{}:this.keyboard,{controllerState:a}=this;let s;const l={};switch(t.srcEvent.code){case"Minus":s=e?a.zoomOut(r).zoomOut(r):a.zoomOut(r),l.isZooming=!0;break;case"Equal":s=e?a.zoomIn(r).zoomIn(r):a.zoomIn(r),l.isZooming=!0;break;case"ArrowLeft":e?(s=a.rotateLeft(n),l.isRotating=!0):(s=a.moveLeft(i),l.isPanning=!0);break;case"ArrowRight":e?(s=a.rotateRight(n),l.isRotating=!0):(s=a.moveRight(i),l.isPanning=!0);break;case"ArrowUp":e?(s=a.rotateUp(o),l.isRotating=!0):(s=a.moveUp(i),l.isPanning=!0);break;case"ArrowDown":e?(s=a.rotateDown(o),l.isRotating=!0):(s=a.moveDown(i),l.isPanning=!0);break;default:return!1}return this.updateViewport(s,this._getTransitionProps(),l),!0}_getTransitionProps(t){const{transition:e}=this;return e&&e.transitionInterpolator?t?{...e,transitionInterpolator:new h({...t,...e.transitionInterpolator.opts,makeViewport:this.controllerState.makeViewport})}:e:it}}class dt{constructor(t,e){(0,o.A)(this,"_viewportProps",void 0),(0,o.A)(this,"_state",void 0),this._viewportProps=this.applyConstraints(t),this._state=e}getViewportProps(){return this._viewportProps}getState(){return this._state}}var ft=r(99932),mt=r(8842);class gt extends dt{constructor(t){const{width:e,height:r,latitude:i,longitude:n,zoom:a,bearing:l=0,pitch:u=0,altitude:c=1.5,position:h=[0,0,0],maxZoom:p=20,minZoom:d=0,maxPitch:f=60,minPitch:m=0,startPanLngLat:g,startZoomLngLat:y,startRotatePos:v,startBearing:_,startPitch:b,startZoom:x,normalize:w=!0}=t;(0,s.A)(Number.isFinite(n)),(0,s.A)(Number.isFinite(i)),(0,s.A)(Number.isFinite(a)),super({width:e,height:r,latitude:i,longitude:n,zoom:a,bearing:l,pitch:u,altitude:c,maxZoom:p,minZoom:d,maxPitch:f,minPitch:m,normalize:w,position:h},{startPanLngLat:g,startZoomLngLat:y,startRotatePos:v,startBearing:_,startPitch:b,startZoom:x}),(0,o.A)(this,"makeViewport",void 0),this.makeViewport=t.makeViewport}panStart(t){let{pos:e}=t;return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan(t){let{pos:e,startPos:r}=t;const i=this.getState().startPanLngLat||this._unproject(r);if(!i)return this;const n=this.makeViewport(this.getViewportProps()).panByPosition(i,e);return this._getUpdatedState(n)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart(t){let{pos:e}=t;return this._getUpdatedState({startRotatePos:e,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate(t){let{pos:e,deltaAngleX:r=0,deltaAngleY:i=0}=t;const{startRotatePos:n,startBearing:o,startPitch:a}=this.getState();if(!n||void 0===o||void 0===a)return this;let s;return s=e?this._getNewRotation(e,n,a,o):{bearing:o+r,pitch:a+i},this._getUpdatedState(s)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart(t){let{pos:e}=t;return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this.getViewportProps().zoom})}zoom(t){let{pos:e,startPos:r,scale:i}=t,{startZoom:n,startZoomLngLat:o}=this.getState();if(o||(n=this.getViewportProps().zoom,o=this._unproject(r)||this._unproject(e)),!o)return this;const{maxZoom:s,minZoom:l}=this.getViewportProps();let u=n+Math.log2(i);u=(0,a.qE)(u,l,s);const c=this.makeViewport({...this.getViewportProps(),zoom:u});
16return this._getUpdatedState({zoom:u,...c.panByPosition(o,e)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(t)}zoomOut(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(1/t)}moveLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([t,0])}moveRight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([-t,0])}moveUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,t])}moveDown(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,-t])}rotateLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this.getViewportProps().bearing-t})}rotateRight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this.getViewportProps().bearing+t})}rotateUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this.getViewportProps().pitch+t})}rotateDown(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this.getViewportProps().pitch-t})}shortestPathFrom(t){const e=t.getViewportProps(),r={...this.getViewportProps()},{bearing:i,longitude:n}=r;return Math.abs(i-e.bearing)>180&&(r.bearing=i<0?i+360:i-360),Math.abs(n-e.longitude)>180&&(r.longitude=n<0?n+360:n-360),r}applyConstraints(t){const{maxZoom:e,minZoom:r,zoom:i}=t;t.zoom=(0,a.qE)(i,r,e);const{maxPitch:n,minPitch:o,pitch:s}=t;t.pitch=(0,a.qE)(s,o,n);const{normalize:l=!0}=t;return l&&Object.assign(t,function(t){const{width:e,height:r,pitch:i=0}=t;let{longitude:n,latitude:o,zoom:a,bearing:s=0}=t;(n<-180||n>180)&&(n=(0,mt.zi)(n+180,360)-180),(s<-180||s>180)&&(s=(0,mt.zi)(s+180,360)-180);const l=(0,mt.p6)(r/512);if(a<=l)a=l,o=0;else{const t=r/2/Math.pow(2,a),e=(0,ft.iV)([0,t])[1];if(o<e)o=e;else{const e=(0,ft.iV)([0,512-t])[1];o>e&&(o=e)}}return{width:e,height:r,longitude:n,latitude:o,zoom:a,pitch:i,bearing:s}}(t)),t}_zoomFromCenter(t){const{width:e,height:r}=this.getViewportProps();return this.zoom({pos:[e/2,r/2],scale:t})}_panFromCenter(t){const{width:e,height:r}=this.getViewportProps();return this.pan({startPos:[e/2,r/2],pos:[e/2+t[0],r/2+t[1]]})}_getUpdatedState(t){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...t})}_unproject(t){const e=this.makeViewport(this.getViewportProps());return t&&e.unproject(t)}_getNewRotation(t,e,r,i){const n=t[0]-e[0],o=t[1]-e[1],s=t[1],l=e[1],{width:u,height:c}=this.getViewportProps(),h=n/u;let p=0;o>0?Math.abs(c-l)>5&&(p=o/(l-c)*1.2):o<0&&l>5&&(p=1-s/l),p=(0,a.qE)(p,-1,1);const{minPitch:d,maxPitch:f}=this.getViewportProps();let m=r;return p>0?m=r+p*(f-r):p<0&&(m=r-p*(d-r)),{pitch:m,bearing:i+180*h}}}class yt extends pt{constructor(){super(...arguments),(0,o.A)(this,"ControllerState",gt),(0,o.A)(this,"transition",{transitionDuration:300,transitionInterpolator:new h({transitionProps:{compare:["longitude","latitude","zoom","bearing","pitch","position"],required:["longitude","latitude","zoom"]}})}),(0,o.A)(this,"dragMode","pan")}setProps(t){t.position=t.position||[0,0,0];const e=this.props;super.setProps(t);(!e||e.height!==t.height)&&this.updateViewport(new this.ControllerState({makeViewport:this.makeViewport,...t,...this.state}))}}class vt extends Y{get ViewportType(){return p.A}get ControllerType(){return yt}}(0,o.A)(vt,"displayName","MapView");var _t=r(96424);const bt=[255,255,255],xt=1;let wt=0;class At{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.A)(this,"id",void 0),(0,o.A)(this,"color",void 0),(0,o.A)(this,"intensity",void 0),(0,o.A)(this,"type","ambient");const{color:e=bt}=t,{intensity:r=xt}=t;this.id=t.id||"ambient-".concat(wt++),this.color=e,this.intensity=r}}var Et=r(86926);const Tt=[255,255,255],St=1,Pt=[0,0,-1];let It=0;class Mt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.A)(this,"id",void 0),(0,o.A)(this,"color",void 0),(0,o.A)(this,"intensity",void 0),(0,o.A)(this,"type","directional"),(0,o.A)(this,"direction",void 0),(0,o.A)(this,"shadow",void 0);const{color:e=Tt}=t,{intensity:r=St}=t,{direction:i=Pt}=t,{_shadow:n=!1}=t;this.id=t.id||"directional-".concat(It++),this.color=e,this.intensity=r,this.type="directional",this.direction=new Et.A(i).normalize().toArray(),this.shadow=n}getProjectedLight(t){return this}}var Ct=r(93092);class kt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{id:"pass"};(0,o.A)(this,"id",void 0),(0,o.A)(this,"gl",void 0),(0,o.A)(this,"props",void 0);const{id:r}=e;this.id=r,this.gl=t,this.props={...e}}setProps(t){Object.assign(this.props,t)}render(t){}cleanup(){}}var Lt=r(44777);class zt extends kt{constructor(){super(...arguments),(0,o.A)(this,"_lastRenderIndex",-1)}render(t){const e=this.gl;return(0,T.Rz)(e,{framebuffer:t.target}),this._drawLayers(t)}_drawLayers(t){const{target:e,moduleParameters:r,viewports:i,views:n,onViewportActive:o,clearStack:a=!0,clearCanvas:s=!0}=t;t.pass=t.pass||"unknown";const l=this.gl;s&&function(t){const e=t.drawingBufferWidth,r=t.drawingBufferHeight;(0,T.Rz)(t,{viewport:[0,0,e,r]}),t.clear(16640)}(l),a&&(this._lastRenderIndex=-1);const u=[];for(const a of i){const i=n&&n[a.id];o(a);const s=this._getDrawLayerParams(a,t),c=a.subViewports||[a];for(const n of c){const o=this._drawLayersInViewport(l,{target:e,moduleParameters:r,viewport:n,view:i,pass:t.pass,layers:t.layers},s);u.push(o)}}return u}_getDrawLayerParams(t,e){let{layers:r,pass:i,layerFilter:n,cullRect:o,effects:a,moduleParameters:s}=e;const l=[],u=Rt(this._lastRenderIndex+1),c={layer:r[0],viewport:t,isPicking:i.startsWith("picking"),renderPass:i,cullRect:o},h={};for(let e=0;e<r.length;e++){const o=r[e],p=this._shouldDrawLayer(o,c,n,h),d={shouldDrawLayer:p};p&&(d.layerRenderIndex=u(o,p),d.moduleParameters=this._getModuleParameters(o,a,i,s),d.layerParameters=this.getLayerParameters(o,e,t)),l[e]=d}return l}_drawLayersInViewport(t,e,r){let{layers:i,moduleParameters:n,pass:o,target:a,viewport:s,view:l}=e;const u=function(t,e){let{moduleParameters:r,target:i,viewport:n}=e;const o=i&&"default-framebuffer"!==i.id,a=r&&r.devicePixelRatio||(0,T.o0)(t),s=o?i.height:t.drawingBufferHeight,l=n;return[l.x*a,s-(l.y+l.height)*a,l.width*a,l.height*a]}(t,{moduleParameters:n,target:a,viewport:s});if(l&&l.props.clear){const e=!0===l.props.clear?{color:!0,depth:!0}:l.props.clear;(0,T.zv)(t,{scissorTest:!0,scissor:u},(()=>(0,Lt.I)(t,e)))}const c={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};(0,T.Rz)(t,{viewport:u});for(let t=0;t<i.length;t++){const e=i[t],{shouldDrawLayer:n,layerRenderIndex:a,moduleParameters:l,layerParameters:u}=r[t];if(n&&e.props.pickable&&c.pickableCount++,e.isComposite)c.compositeCount++;else if(n){c.visibleCount++,this._lastRenderIndex=Math.max(this._lastRenderIndex,a),l.viewport=s;try{e._drawLayer({moduleParameters:l,uniforms:{layerIndex:a},parameters:u})}catch(t){e.raiseError(t,"drawing ".concat(e," to ").concat(o))}}}return c}shouldDrawLayer(t){return!0}getModuleParameters(t,e){return null}getLayerParameters(t,e,r){return t.props.parameters}_shouldDrawLayer(t,e,r,i){if(!(t.props.visible&&this.shouldDrawLayer(t)))return!1;e.layer=t;let n=t.parent;for(;n;){if(!n.props.visible||!n.filterSubLayer(e))return!1;e.layer=n,n=n.parent}if(r){const t=e.layer.id;if(t in i||(i[t]=r(e)),!i[t])return!1}return t.activateViewport(e.viewport),!0}_getModuleParameters(t,e,r,i){var n;const o=Object.assign(Object.create((null===(n=t.internalState)||void 0===n?void 0:n.propsInTransition)||t.props),{autoWrapLongitude:t.wrapLongitude,viewport:t.context.viewport,mousePosition:t.context.mousePosition,pickingActive:0,devicePixelRatio:(0,T.o0)(this.gl)});if(e)for(const r of e){var a;Object.assign(o,null===(a=r.getModuleParameters)||void 0===a?void 0:a.call(r,t))}return Object.assign(o,this.getModuleParameters(t,e),i)}}function Rt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r={},i=(n,o)=>{const a=n.props._offset,s=n.id,l=n.parent&&n.parent.id;let u;if(l&&!(l in e)&&i(n.parent,!1),l in r){const t=r[l]=r[l]||Rt(e[l],e);u=t(n,o),r[s]=t}else Number.isFinite(a)?(u=a+(e[l]||0),r[s]=null):u=t;return o&&u>=t&&(t=u+1),e[s]=u,u};return i}var Ot=r(7148),Dt=r(94755);class Bt extends zt{constructor(t,e){super(t,e),(0,o.A)(this,"shadowMap",void 0),(0,o.A)(this,"depthBuffer",void 0),(0,o.A)(this,"fbo",void 0),this.shadowMap=new _t.A(t,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new Ot.A(t,{format:33189,width:1,height:1}),this.fbo=new Dt.A(t,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(t){const e=this.fbo;(0,T.zv)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},(()=>{const r=t.viewports[0],i=(0,T.o0)(this.gl),n=r.width*i,o=r.height*i;n===e.width&&o===e.height||e.resize({width:n,height:o}),super.render({...t,target:e,pass:"shadow"})}))}shouldDrawLayer(t){return!1!==t.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}var Ft=r(61028),jt=r(92700);const Nt=(0,jt.A)((function(t){let{viewport:e,center:r}=t;return new Ct.A(e.viewProjectionMatrix).invert().transform(r)})),Ut=(0,jt.A)((function(t){let{viewport:e,shadowMatrices:r}=t;const i=[],n=e.pixelUnprojectionMatrix,o=e.isGeospatial?void 0:1,a=[[0,0,o],[e.width,0,o],[0,e.height,o],[e.width,e.height,o],[0,0,-1],[e.width,0,-1],[0,e.height,-1],[e.width,e.height,-1]].map((t=>function(t,e){const[r,i,n]=t,o=(0,ft.xJ)([r,i,n],e);if(Number.isFinite(n))return o;return[o[0],o[1],0]}(t,n)));for(const t of r){const r=t.clone().translate(new Et.A(e.center).negate()),n=a.map((t=>r.transform(t))),o=(new Ct.A).ortho({left:Math.min(...n.map((t=>t[0]))),right:Math.max(...n.map((t=>t[0]))),bottom:Math.min(...n.map((t=>t[1]))),top:Math.max(...n.map((t=>t[1]))),near:Math.min(...n.map((t=>-t[2]))),far:Math.max(...n.map((t=>-t[2])))});i.push(o.multiplyRight(t))}return i})),Vt=[0,0,0,1],qt=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];const Gt={name:"shadow",dependencies:[j.A],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights;
16 i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"viewport"in t&&(t.drawToShadowMap||t.shadowMaps&&t.shadowMaps.length>0)?function(t,e){const{shadowEnabled:r=!0}=t;if(!r||!t.shadowMatrices||!t.shadowMatrices.length)return{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1};const i={shadow_uDrawShadowMap:Boolean(t.drawToShadowMap),shadow_uUseShadowMap:!!t.shadowMaps&&t.shadowMaps.length>0,shadow_uColor:t.shadowColor||Vt,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},n=Nt({viewport:t.viewport,center:e.project_uCenter}),o=[],a=Ut({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice();for(let r=0;r<t.shadowMatrices.length;r++){const i=a[r],s=i.clone().translate(new Et.A(t.viewport.center).negate());e.project_uCoordinateSystem===Ft.rf.LNGLAT&&e.project_uProjectionMode===Ft.Kx.WEB_MERCATOR?(a[r]=s,o[r]=n):(a[r]=i.clone().multiplyRight(qt),o[r]=s.transform(n))}for(let e=0;e<a.length;e++)i["shadow_uViewProjectionMatrices[".concat(e,"]")]=a[e],i["shadow_uProjectCenters[".concat(e,"]")]=o[e],t.shadowMaps&&t.shadowMaps.length>0?i["shadow_uShadowMap".concat(e)]=t.shadowMaps[e]:i["shadow_uShadowMap".concat(e)]=t.dummyShadowMap;return i}(t,e):{}}},Zt={color:[255,255,255],intensity:1},Wt=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],Ht=[0,0,0,200/255];class Xt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.A)(this,"id","lighting-effect"),(0,o.A)(this,"props",null),(0,o.A)(this,"shadowColor",Ht),(0,o.A)(this,"shadow",void 0),(0,o.A)(this,"ambientLight",null),(0,o.A)(this,"directionalLights",[]),(0,o.A)(this,"pointLights",[]),(0,o.A)(this,"shadowPasses",[]),(0,o.A)(this,"shadowMaps",[]),(0,o.A)(this,"dummyShadowMap",null),(0,o.A)(this,"programManager",void 0),(0,o.A)(this,"shadowMatrices",void 0);for(const e in t){const r=t[e];switch(r.type){case"ambient":this.ambientLight=r;break;case"directional":this.directionalLights.push(r);break;case"point":this.pointLights.push(r)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some((t=>t.shadow))}preRender(t,e){let{layers:r,layerFilter:i,viewports:n,onViewportActive:o,views:a}=e;if(this.shadow){this.shadowMatrices=this._calculateMatrices(),0===this.shadowPasses.length&&this._createShadowPasses(t),this.programManager||(this.programManager=F.A.getDefaultProgramManager(t),Gt&&this.programManager.addDefaultModule(Gt)),this.dummyShadowMap||(this.dummyShadowMap=new _t.A(t,{width:1,height:1}));for(let t=0;t<this.shadowPasses.length;t++){this.shadowPasses[t].render({layers:r,layerFilter:i,viewports:n,onViewportActive:o,views:a,moduleParameters:{shadowLightId:t,dummyShadowMap:this.dummyShadowMap,shadowMatrices:this.shadowMatrices}})}}}getModuleParameters(t){const e=this.shadow?{shadowMaps:this.shadowMaps,dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{};return e.lightSources={ambientLight:this.ambientLight,directionalLights:this.directionalLights.map((e=>e.getProjectedLight({layer:t}))),pointLights:this.pointLights.map((e=>e.getProjectedLight({layer:t})))},e}cleanup(){for(const t of this.shadowPasses)t.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(Gt),this.programManager=null)}_calculateMatrices(){const t=[];for(const e of this.directionalLights){const r=(new Ct.A).lookAt({eye:new Et.A(e.direction).negate()});t.push(r)}return t}_createShadowPasses(t){for(let e=0;e<this.directionalLights.length;e++){const r=new Bt(t);this.shadowPasses[e]=r,this.shadowMaps[e]=r.shadowMap}}_applyDefaultLights(){const{ambientLight:t,pointLights:e,directionalLights:r}=this;t||0!==e.length||0!==r.length||(this.ambientLight=new At(Zt),this.directionalLights.push(new Mt(Wt[0]),new Mt(Wt[1])))}}class Yt extends zt{constructor(t,e){super(t,e),(0,o.A)(this,"maskMap",void 0),(0,o.A)(this,"fbo",void 0);const{mapSize:r=2048}=e;this.maskMap=new _t.A(t,{width:r,height:r,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.fbo=new Dt.A(t,{id:"maskmap",width:r,height:r,attachments:{36064:this.maskMap}})}render(t){const e=this.gl,r=[!1,!1,!1,!1];return r[t.channel]=!0,(0,T.zv)(e,{clearColor:[255,255,255,255],blend:!0,blendFunc:[0,1],blendEquation:32778,colorMask:r,depthTest:!1},(()=>super.render({...t,target:this.fbo,pass:"mask"})))}
16shouldDrawLayer(t){return t.props.operation===Ft.qR.MASK}delete(){this.fbo.delete(),this.maskMap.delete()}}var Kt=r(36471);const Jt=(new Ct.A).lookAt({eye:[0,0,1]});function Qt(t){let{width:e,height:r,near:i,far:n,padding:o}=t,s=-e/2,l=e/2,u=-r/2,c=r/2;if(o){const{left:t=0,right:i=0,top:n=0,bottom:h=0}=o,p=(0,a.qE)((t+e-i)/2,0,e)-e/2,d=(0,a.qE)((n+r-h)/2,0,r)-r/2;s-=p,l-=p,u+=d,c+=d}return(new Ct.A).ortho({left:s,right:l,bottom:u,top:c,near:i,far:n})}class $t extends B.A{constructor(t){const{width:e,height:r,near:i=.1,far:n=1e3,zoom:o=0,target:a=[0,0,0],padding:s=null,flipY:l=!0}=t,u=Array.isArray(o)?o[0]:o,c=Array.isArray(o)?o[1]:o,h=Math.min(u,c),p=Math.pow(2,h);let d;if(u!==c){const t=Math.pow(2,u),e=Math.pow(2,c);d={unitsPerMeter:[t/p,e/p,1],metersPerUnit:[p/t,p/e,1]}}super({...t,longitude:void 0,position:a,viewMatrix:Jt.clone().scale([p,p*(l?-1:1),p]),projectionMatrix:Qt({width:e||1,height:r||1,padding:s,near:i,far:n}),zoom:h,distanceScales:d})}projectFlat(t){let[e,r]=t;const{unitsPerMeter:i}=this.distanceScales;return[e*i[0],r*i[1]]}unprojectFlat(t){let[e,r]=t;const{metersPerUnit:i}=this.distanceScales;return[e*i[0],r*i[1]]}panByPosition(t,e){const r=(0,ft.xJ)(e,this.pixelUnprojectionMatrix),i=this.projectFlat(t),n=Kt.WQ([],i,Kt.ze([],r)),o=Kt.WQ([],this.center,n);return{target:this.unprojectFlat(o)}}}var te=r(1764);class ee extends dt{constructor(t){const{width:e,height:r,rotationX:i=0,rotationOrbit:n=0,target:a=[0,0,0],zoom:s=0,minRotationX:l=-90,maxRotationX:u=90,minZoom:c=-1/0,maxZoom:h=1/0,startPanPosition:p,startRotatePos:d,startRotationX:f,startRotationOrbit:m,startZoomPosition:g,startZoom:y}=t;super({width:e,height:r,rotationX:i,rotationOrbit:n,target:a,zoom:s,minRotationX:l,maxRotationX:u,minZoom:c,maxZoom:h},{startPanPosition:p,startRotatePos:d,startRotationX:f,startRotationOrbit:m,startZoomPosition:g,startZoom:y}),(0,o.A)(this,"makeViewport",void 0),this.makeViewport=t.makeViewport}panStart(t){let{pos:e}=t;return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan(t){let{pos:e,startPosition:r}=t;const i=this.getState().startPanPosition||r;if(!i)return this;const n=this.makeViewport(this.getViewportProps()).panByPosition(i,e);return this._getUpdatedState(n)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart(t){let{pos:e}=t;return this._getUpdatedState({startRotatePos:e,startRotationX:this.getViewportProps().rotationX,startRotationOrbit:this.getViewportProps().rotationOrbit})}rotate(t){let{pos:e,deltaAngleX:r=0,deltaAngleY:i=0}=t;const{startRotatePos:n,startRotationX:o,startRotationOrbit:a}=this.getState(),{width:s,height:l}=this.getViewportProps();if(!n||void 0===o||void 0===a)return this;let u;if(e){let t=(e[0]-n[0])/s;(o<-90||o>90)&&(t*=-1),u={rotationX:o+180*((e[1]-n[1])/l),rotationOrbit:a+180*t}}else u={rotationX:o+i,rotationOrbit:a+r};return this._getUpdatedState(u)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(t){const e=t.getViewportProps(),r={...this.getViewportProps()},{rotationOrbit:i}=r;return Math.abs(i-e.rotationOrbit)>180&&(r.rotationOrbit=i<0?i+360:i-360),r}zoomStart(t){let{pos:e}=t;return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this.getViewportProps().zoom})}zoom(t){let{pos:e,startPos:r,scale:i}=t,{startZoom:n,startZoomPosition:o}=this.getState();if(o||(n=this.getViewportProps().zoom,o=this._unproject(r)||this._unproject(e)),!o)return this;const a=this._calculateNewZoom({scale:i,startZoom:n}),s=this.makeViewport({...this.getViewportProps(),zoom:a});return this._getUpdatedState({zoom:a,...s.panByPosition(o,e)})}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:t})})}zoomOut(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/t})})}moveLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([-t,0])}moveRight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([t,0])}moveUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([0,-t])}moveDown(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([0,t])}rotateLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;
16return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit-t})}rotateRight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit+t})}rotateUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({rotationX:this.getViewportProps().rotationX-t})}rotateDown(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({rotationX:this.getViewportProps().rotationX+t})}_unproject(t){const e=this.makeViewport(this.getViewportProps());return t&&e.unproject(t)}_calculateNewZoom(t){let{scale:e,startZoom:r}=t;const{maxZoom:i,minZoom:n}=this.getViewportProps();void 0===r&&(r=this.getViewportProps().zoom);const o=r+Math.log2(e);return(0,a.qE)(o,n,i)}_panFromCenter(t){const{width:e,height:r,target:i}=this.getViewportProps();return this.pan({startPosition:i,pos:[e/2+t[0],r/2+t[1]]})}_getUpdatedState(t){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...t})}applyConstraints(t){const{maxZoom:e,minZoom:r,zoom:i,maxRotationX:n,minRotationX:o,rotationOrbit:s}=t;return t.zoom=Array.isArray(i)?[(0,a.qE)(i[0],r,e),(0,a.qE)(i[1],r,e)]:(0,a.qE)(i,r,e),t.rotationX=(0,a.qE)(t.rotationX,o,n),(s<-180||s>180)&&(t.rotationOrbit=(0,te.zi)(s+180,360)-180),t}}class re extends ee{constructor(t){super(t),(0,o.A)(this,"zoomAxis",void 0),this.zoomAxis=t.zoomAxis||"all"}_calculateNewZoom(t){let{scale:e,startZoom:r}=t;const{maxZoom:i,minZoom:n}=this.getViewportProps();void 0===r&&(r=this.getViewportProps().zoom);let o=Math.log2(e);if(Array.isArray(r)){let[t,e]=r;switch(this.zoomAxis){case"X":t=(0,a.qE)(t+o,n,i);break;case"Y":e=(0,a.qE)(e+o,n,i);break;default:let r=Math.min(t+o,e+o);r<n&&(o+=n-r),r=Math.max(t+o,e+o),r>i&&(o+=i-r),t+=o,e+=o}return[t,e]}return(0,a.qE)(r+o,n,i)}}class ie extends pt{constructor(){super(...arguments),(0,o.A)(this,"ControllerState",re),(0,o.A)(this,"transition",{transitionDuration:300,transitionInterpolator:new h(["target","zoom"])}),(0,o.A)(this,"dragMode","pan")}_onPanRotate(){return!1}}class ne extends Y{get ViewportType(){return $t}get ControllerType(){return ie}}(0,o.A)(ne,"displayName","OrthographicView");var oe=r(85971);class ae{constructor(){(0,o.A)(this,"id","mask-effect"),(0,o.A)(this,"props",null),(0,o.A)(this,"useInPicking",!0),(0,o.A)(this,"dummyMaskMap",void 0),(0,o.A)(this,"channels",[]),(0,o.A)(this,"masks",null),(0,o.A)(this,"maskPass",void 0),(0,o.A)(this,"maskMap",void 0),(0,o.A)(this,"lastViewport",void 0)}preRender(t,e){let{layers:r,layerFilter:i,viewports:n,onViewportActive:o,views:a}=e;this.dummyMaskMap||(this.dummyMaskMap=new _t.A(t,{width:1,height:1}));const s=r.filter((t=>t.props.visible&&t.props.operation===Ft.qR.MASK));if(0===s.length)return this.masks=null,void(this.channels.length=0);this.masks={},this.maskPass||(this.maskPass=new Yt(t,{id:"default-mask"}),this.maskMap=this.maskPass.maskMap);const l=this._sortMaskChannels(s),u=n[0],c=!this.lastViewport||!this.lastViewport.equals(u);for(const t in l)this._renderChannel(l[t],{layerFilter:i,onViewportActive:o,views:a,viewport:u,viewportChanged:c})}_renderChannel(t,e){let{layerFilter:r,onViewportActive:i,views:n,viewport:o,viewportChanged:s}=e;const l=this.channels[t.index];if(!l)return;const u=t===l||l.layers.length!==t.layers.length||t.layerBounds.some(((t,e)=>t!==l.layerBounds[e]));if(t.bounds=l.bounds,t.maskBounds=l.maskBounds,this.channels[t.index]=t,(u||s)&&(this.lastViewport=o,t.bounds=function(t){let{layers:e,viewport:r}=t,i=null;for(const t of e){const e=t.getBounds();e&&(i?(i[0]=Math.min(i[0],e[0][0]),i[1]=Math.min(i[1],e[0][1]),i[2]=Math.max(i[2],e[1][0]),i[3]=Math.max(i[3],e[1][1])):i=[e[0][0],e[0][1],e[1][0],e[1][1]])}const n=r.getBounds();if(!i)return n;const o=function(t){const e={x:t[2]-t[0],y:t[3]-t[1]},r={x:t[0]+.5*e.x,y:t[1]+.5*e.y};return[r.x-e.x,r.y-e.y,r.x+e.x,r.y+e.y]}(n);return i[2]-i[0]<o[2]-o[0]||i[3]-i[1]<o[3]-o[1]||(i[0]=Math.max(i[0],o[0]),i[1]=Math.max(i[1],o[1]),i[2]=Math.min(i[2],o[2]),i[3]=Math.min(i[3],o[3])),i}({layers:t.layers,viewport:o}),u||!(0,a.aI)(t.bounds,l.bounds))){const{maskPass:e,maskMap:a}=this,s=function(t){let{bounds:e,viewport:r,width:i,height:n}=t;if(e[2]<=e[0]||e[3]<=e[1])return null;if(i-=2,n-=2,r instanceof p.A){const{longitude:t,latitude:r,zoom:o}=(0,oe.A)({width:i,height:n,bounds:[[e[0],e[1]],[e[2],e[3]]],maxZoom:20});return new p.A({longitude:t,latitude:r,zoom:o,x:1,y:1,width:i,height:n})}const o=[(e[0]+e[2])/2,(e[1]+e[3])/2,0],a=Math.min(20,i/(e[2]-e[0]),n/(e[3]-e[1]));return new ne({x:1,y:1}).makeViewport({width:i,height:n,viewState:{target:o,zoom:Math.log2(a)}})}({bounds:t.bounds,viewport:o,width:a.width,height:a.height});t.maskBounds=s?s.getBounds():[0,0,1,1],e.render({pass:"mask",channel:t.index,layers:t.layers,layerFilter:r,viewports:s?[s]:[],onViewportActive:i,views:n,moduleParameters:{devicePixelRatio:1}})}this.masks[t.id]={index:t.index,bounds:t.maskBounds,coordinateOrigin:t.coordinateOrigin,coordinateSystem:t.coordinateSystem}}_sortMaskChannels(t){const e={};let r=0;for(const i of t){const{id:t}=i.root;let n=e[t];
16if(!n){if(++r>4){C.A.warn("Too many mask layers. The max supported is 4")();continue}n={id:t,index:this.channels.findIndex((e=>(null==e?void 0:e.id)===t)),layers:[],layerBounds:[],coordinateOrigin:i.root.props.coordinateOrigin,coordinateSystem:i.root.props.coordinateSystem},e[t]=n}n.layers.push(i),n.layerBounds.push(i.getBounds())}for(let t=0;t<4;t++){const r=this.channels[t];r&&r.id in e||(this.channels[t]=null)}for(const t in e){const r=e[t];r.index<0&&(r.index=this.channels.findIndex((t=>!t)),this.channels[r.index]=r)}return e}getModuleParameters(){return{maskMap:this.masks?this.maskMap:this.dummyMaskMap,maskChannels:this.masks}}cleanup(){this.dummyMaskMap&&(this.dummyMaskMap.delete(),this.dummyMaskMap=void 0),this.maskPass&&(this.maskPass.delete(),this.maskPass=void 0,this.maskMap=void 0),this.lastViewport=void 0,this.masks=null,this.channels.length=0}}const se=new Xt;class le{constructor(){(0,o.A)(this,"effects",void 0),(0,o.A)(this,"_internalEffects",void 0),(0,o.A)(this,"_needsRedraw",void 0),this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(t){"effects"in t&&(t.effects.length===this.effects.length&&(0,G.b)(t.effects,this.effects)||(this.setEffects(t.effects),this._needsRedraw="effects changed"))}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=t,this._internalEffects=t.slice(),this._internalEffects.push(new ae),t.some((t=>t instanceof Xt))||this._internalEffects.push(se)}cleanup(){for(const t of this.effects)t.cleanup();for(const t of this._internalEffects)t.cleanup();this.effects.length=0,this._internalEffects.length=0}}class ue extends zt{shouldDrawLayer(t){return t.props.operation===Ft.qR.DRAW}}const ce={blendFunc:[1,0,32771,0],blendEquation:32774};class he extends zt{constructor(){super(...arguments),(0,o.A)(this,"pickZ",void 0),(0,o.A)(this,"_colors",null)}render(t){return t.pickingFBO?this._drawPickingBuffer(t):super.render(t)}_drawPickingBuffer(t){let{layers:e,layerFilter:r,views:i,viewports:n,onViewportActive:o,pickingFBO:a,deviceRect:{x:s,y:l,width:u,height:c},cullRect:h,effects:p,pass:d="picking",pickZ:f}=t;const m=this.gl;this.pickZ=f;const g=f?null:{byLayer:new Map,byAlpha:[]};this._colors=g;const y=(0,T.zv)(m,{scissorTest:!0,scissor:[s,l,u,c],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0],...ce,blend:!f},(()=>super.render({target:a,layers:e,layerFilter:r,views:i,viewports:n,onViewportActive:o,cullRect:h,effects:null==p?void 0:p.filter((t=>t.useInPicking)),pass:d})));this._colors=null;return{decodePickingColor:g&&pe.bind(null,g),stats:y}}shouldDrawLayer(t){return t.props.pickable&&t.props.operation===Ft.qR.DRAW}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(t,e,r){const i={...t.props.parameters};return this._colors?(Object.assign(i,ce),i.blend=!0,i.blendColor=function(t,e,r){const{byLayer:i,byAlpha:n}=t;let o,a=i.get(e);a?(a.viewports.push(r),o=a.a):(o=i.size+1,o<=255?(a={a:o,layer:e,viewports:[r]},i.set(e,a),n[o]=a):(C.A.warn("Too many pickable layers, only picking the first 255")(),o=0));return[0,0,0,o/255]}(this._colors,t,r)):i.blend=!1,i}}function pe(t,e){const r=t.byAlpha[e[3]];return r&&{pickedLayer:r.layer,pickedViewports:r.viewports,pickedObjectIndex:r.layer.decodePickingColor(e)}}class de{constructor(t){this.gl=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new ue(t),this.pickLayersPass=new he(t),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(t){"layerFilter"in t&&this.layerFilter!==t.layerFilter&&(this.layerFilter=t.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in t&&this.drawPickingColors!==t.drawPickingColors&&(this.drawPickingColors=t.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(t){const e=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;t.layerFilter=t.layerFilter||this.layerFilter,t.effects=t.effects||[],t.target=t.target||Dt.A.getDefaultFramebuffer(this.gl),this._preRender(t.effects,t);const r=this.lastPostProcessEffect?this.renderBuffers[0]:t.target,i=e.render({...t,target:r});this._postRender(t.effects,t),this.renderCount++,(0,k.A)("deckRenderer.renderLayers",this,i,t)}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}finalize(){const{renderBuffers:t}=this;for(const e of t)e.delete();t.length=0}_preRender(t,e){let r=null;for(const i of t)i.preRender(this.gl,e),i.postRender&&(r=i);r&&this._resizeRenderBuffers(),this.lastPostProcessEffect=r}_resizeRenderBuffers(){const{renderBuffers:t}=this;0===t.length&&t.push(new Dt.A(this.gl),new Dt.A(this.gl));for(const e of t)e.resize()}_postRender(t,e){const{renderBuffers:r}=this,i={inputBuffer:r[0],swapBuffer:r[1],target:null};for(const n of t)if(n.postRender){if(n===this.lastPostProcessEffect){i.target=e.target,n.postRender(this.gl,i);break}const t=n.postRender(this.gl,i);i.inputBuffer=t,i.swapBuffer=t===r[0]?r[1]:r[0]}}}var fe=r(58713);const me={pickedColor:null,pickedObjectIndex:-1};function ge(t){let{pickedColors:e,decodePickingColor:r,deviceX:i,deviceY:n,deviceRadius:o,deviceRect:a}=t;const{x:s,y:l,width:u,height:c}=a;let h=o*o,p=-1,d=0;for(let t=0;t<c;t++){const r=t+l-n,o=r*r;if(o>h)d+=4*u;else for(let t=0;t<u;t++){if(e[d+3]-1>=0){const e=t+s-i,r=e*e+o;r<=h&&(h=r,p=d)}d+=4}}if(p>=0){const t=e.slice(p,p+4),i=r(t);if(i){const e=Math.floor(p/4/u),r=p/4-e*u;return{...i,pickedColor:t,pickedX:s+r,pickedY:l+e}}C.A.error("Picked non-existent layer. Is picking buffer corrupt?")()}return me}function ye(t){let e,{pickInfo:r,viewports:i,pixelRatio:n,x:o,y:a,z:s}=t,l=i[0];if(i.length>1&&(l=function(t,e){for(let r=t.length-1;r>=0;r--){const i=t[r];
16if(i.containsPixel(e))return i}return t[0]}((null==r?void 0:r.pickedViewports)||i,{x:o,y:a})),l){const t=[o-l.x,a-l.y];void 0!==s&&(t[2]=s),e=l.unproject(t)}return{color:null,layer:null,viewport:l,index:-1,picked:!1,x:o,y:a,pixel:[o,a],coordinate:e,devicePixel:r&&"pickedX"in r?[r.pickedX,r.pickedY]:void 0,pixelRatio:n}}function ve(t){const{pickInfo:e,lastPickedInfo:r,mode:i,layers:n}=t,{pickedColor:o,pickedLayer:a,pickedObjectIndex:s}=e,l=a?[a]:[];if("hover"===i){const t=r.index,e=r.layerId,i=a?a.props.id:null;if(i!==e||s!==t){if(i!==e){const t=n.find((t=>t.props.id===e));t&&l.unshift(t)}r.layerId=i,r.index=s,r.info=null}}const u=ye(t),c=new Map;return c.set(null,u),l.forEach((t=>{let e={...u};t===a&&(e.color=o,e.index=s,e.picked=!0),e=_e({layer:t,info:e,mode:i});const n=e.layer;t===a&&"hover"===i&&(r.info=e),c.set(n.id,e),"hover"===i&&n.updateAutoHighlight(e)})),c}function _e(t){let{layer:e,info:r,mode:i}=t;for(;e&&r;){const t=r.layer||null;r.sourceLayer=t,r.layer=e,r=e.getPickingInfo({info:r,mode:i,sourceLayer:t}),e=e.parent}return r}class be{constructor(t){(0,o.A)(this,"gl",void 0),(0,o.A)(this,"pickingFBO",void 0),(0,o.A)(this,"depthFBO",void 0),(0,o.A)(this,"pickLayersPass",void 0),(0,o.A)(this,"layerFilter",void 0),(0,o.A)(this,"lastPickedInfo",void 0),(0,o.A)(this,"_pickable",!0),this.gl=t,this.pickLayersPass=new he(t),this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(t){"layerFilter"in t&&(this.layerFilter=t.layerFilter),"_pickable"in t&&(this._pickable=t._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}
16pickObject(t){return this._pickClosestObject(t)}pickObjects(t){return this._pickVisibleObjects(t)}getLastPickedObject(t){let{x:e,y:r,layers:i,viewports:n}=t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info;const a=o&&o.layer&&o.layer.id,s=o&&o.viewport&&o.viewport.id,l=a?i.find((t=>t.id===a)):null,u=s&&n.find((t=>t.id===s))||n[0],c=u&&u.unproject([e-u.x,r-u.y]),h={x:e,y:r,viewport:u,coordinate:c,layer:l};return{...o,...h}}_resizeBuffer(){var t,e;const{gl:r}=this;if(!this.pickingFBO&&(this.pickingFBO=new Dt.A(r),Dt.A.isSupported(r,{colorBufferFloat:!0}))){const t=new Dt.A(r);t.attach({36064:new _t.A(r,{format:(0,T.C6)(r)?34836:6408,type:5126})}),this.depthFBO=t}null===(t=this.pickingFBO)||void 0===t||t.resize({width:r.canvas.width,height:r.canvas.height}),null===(e=this.depthFBO)||void 0===e||e.resize({width:r.canvas.width,height:r.canvas.height})}_getPickable(t){if(!1===this._pickable)return null;const e=t.filter((t=>t.isPickable()&&!t.isComposite));return e.length?e:null}_pickClosestObject(t){let{layers:e,views:r,viewports:i,x:n,y:o,radius:a=0,depth:s=1,mode:l="query",unproject3D:u,onViewportActive:c,effects:h}=t;const p=this._getPickable(e),d=(0,T.o0)(this.gl);if(!p)return{result:[],emptyInfo:ye({viewports:i,x:n,y:o,pixelRatio:d})};this._resizeBuffer();const f=(0,T.w8)(this.gl,[n,o],!0),m=[f.x+Math.floor(f.width/2),f.y+Math.floor(f.height/2)],g=Math.round(a*d),{width:y,height:v}=this.pickingFBO,_=this._getPickingRect({deviceX:m[0],deviceY:m[1],deviceRadius:g,deviceWidth:y,deviceHeight:v}),b={x:n-a,y:o-a,width:2*a+1,height:2*a+1};let x;const w=[],A=new Set;for(let t=0;t<s;t++){let e,a;if(_){e=ge({...this._drawAndSample({layers:p,views:r,viewports:i,onViewportActive:c,deviceRect:_,cullRect:b,effects:h,pass:"picking:".concat(l)}),deviceX:m[0],deviceY:m[1],deviceRadius:g,deviceRect:_})}else e={pickedColor:null,pickedObjectIndex:-1};if(e.pickedLayer&&u&&this.depthFBO){a=this._drawAndSample({layers:[e.pickedLayer],views:r,viewports:i,onViewportActive:c,deviceRect:{x:e.pickedX,y:e.pickedY,width:1,height:1},cullRect:b,effects:h,pass:"picking:".concat(l,":z")},!0).pickedColors[0]}e.pickedLayer&&t+1<s&&(A.add(e.pickedLayer),e.pickedLayer.disablePickingIndex(e.pickedObjectIndex)),x=ve({pickInfo:e,lastPickedInfo:this.lastPickedInfo,mode:l,layers:p,viewports:i,x:n,y:o,z:a,pixelRatio:d});for(const t of x.values())t.layer&&w.push(t);if(!e.pickedColor)break}for(const t of A)t.restorePickingColors();return{result:w,emptyInfo:x.get(null)}}_pickVisibleObjects(t){let{layers:e,views:r,viewports:i,x:n,y:o,width:a=1,height:s=1,mode:l="query",maxObjects:u=null,onViewportActive:c,effects:h}=t;const p=this._getPickable(e);if(!p)return[];this._resizeBuffer();const d=(0,T.o0)(this.gl),f=(0,T.w8)(this.gl,[n,o],!0),m=f.x,g=f.y+f.height,y=(0,T.w8)(this.gl,[n+a,o+s],!0),v=y.x+y.width,_=y.y,b={x:m,y:_,width:v-m,height:g-_},x=function(t){let{pickedColors:e,decodePickingColor:r}=t;const i=new Map;if(e)for(let t=0;t<e.length;t+=4)if(e[t+3]-1>=0){const n=e.slice(t,t+4),o=n.join(",");if(!i.has(o)){const t=r(n);t?i.set(o,{...t,color:n}):C.A.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Array.from(i.values())}(this._drawAndSample({layers:p,views:r,viewports:i,onViewportActive:c,deviceRect:b,cullRect:{x:n,y:o,width:a,height:s},effects:h,pass:"picking:".concat(l)})),w=new Map,A=Number.isFinite(u);for(let t=0;t<x.length&&!(A&&u&&w.size>=u);t++){const e=x[t];let r={color:e.pickedColor,layer:null,index:e.pickedObjectIndex,picked:!0,x:n,y:o,pixelRatio:d};r=_e({layer:e.pickedLayer,info:r,mode:l}),w.has(r.object)||w.set(r.object,r)}return Array.from(w.values())}_drawAndSample(t){let{layers:e,views:r,viewports:i,onViewportActive:n,deviceRect:o,cullRect:a,effects:s,pass:l}=t,u=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const c=u?this.depthFBO:this.pickingFBO,{decodePickingColor:h}=this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:r,viewports:i,onViewportActive:n,pickingFBO:c,deviceRect:o,cullRect:a,effects:s,pass:l,pickZ:u}),{x:p,y:d,width:f,height:m}=o,g=new(u?Float32Array:Uint8Array)(f*m*4);return(0,fe.sy)(c,{sourceX:p,sourceY:d,sourceWidth:f,sourceHeight:m,target:g}),{pickedColors:g,decodePickingColor:h}}_getPickingRect(t){let{deviceX:e,deviceY:r,deviceRadius:i,deviceWidth:n,deviceHeight:o}=t;const a=Math.max(0,e-i),s=Math.max(0,r-i),l=Math.min(n,e+i+1)-a,u=Math.min(o,r+i+1)-s;return l<=0||u<=0?null:{x:a,y:s,width:l,height:u}}}const xe={zIndex:"1",position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:"0",left:"0",display:"none"};class we{constructor(t){(0,o.A)(this,"el",null),(0,o.A)(this,"isVisible",!1);const e=t.parentElement;e&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,xe),e.appendChild(this.el))}setTooltip(t,e,r){const i=this.el;if(i){if("string"==typeof t)i.innerText=t;else{if(!t)return this.isVisible=!1,void(i.style.display="none");t.text&&(i.innerText=t.text),t.html&&(i.innerHTML=t.html),t.className&&(i.className=t.className),Object.assign(i.style,t.style)}
16this.isVisible=!0,i.style.display="block",i.style.transform="translate(".concat(e,"px, ").concat(r,"px)")}}remove(){this.el&&(this.el.remove(),this.el=null)}}var Ae=r(80598),Ee=r(17895);var Te=r(52474),Se=r(66318);const{_parseImageNode:Pe}=globalThis,Ie="undefined"!=typeof Image,Me="undefined"!=typeof ImageBitmap,Ce=Boolean(Pe),ke=!!Se.Bd||Ce;function Le(t){const e=Re(t);if(!e)throw new Error("Not an image");return e}function ze(t){switch(Le(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function Re(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&t instanceof Image?"image":t&&"object"==typeof t&&t.data&&t.width&&t.height?"data":null}const Oe=/^data:image\/svg\+xml/,De=/\.svg((\?|#).*)?$/;function Be(t){return t&&(Oe.test(t)||De.test(t))}function Fe(t,e){if(Be(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function je(t,e,r){const i=function(t,e){if(Be(e)){let e=(new TextDecoder).decode(t);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(t){throw new Error(t.message)}return"data:image/svg+xml;base64,".concat(btoa(e))}return Fe(t,e)}(t,r),n=self.URL||self.webkitURL,o="string"!=typeof i&&n.createObjectURL(i);try{return await async function(t,e){const r=new Image;if(r.src=t,e.image&&e.image.decode&&r.decode)return await r.decode(),r;return await new Promise(((e,i)=>{try{r.onload=()=>e(r),r.onerror=e=>i(new Error("Could not load image ".concat(t,": ").concat(e)))}catch(t){i(t)}}))}(o||i,e)}finally{o&&n.revokeObjectURL(o)}}const Ne={};let Ue=!0;async function Ve(t,e,r){let i;if(Be(r)){i=await je(t,e,r)}else i=Fe(t,r);const n=e&&e.imagebitmap;return await async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!function(t){for(const e in t||Ne)return!1;return!0}(e)&&Ue||(e=null);if(e)try{return await createImageBitmap(t,e)}catch(t){console.warn(t),Ue=!1}return await createImageBitmap(t)}(i,n)}const qe=!1,Ge=!0;function Ze(t){const e=We(t);return function(t){const e=We(t),r=e.byteLength>=24&&2303741511===e.getUint32(0,qe);if(!r)return null;return{mimeType:"image/png",width:e.getUint32(16,qe),height:e.getUint32(20,qe)}}(e)||function(t){const e=We(t),r=e.byteLength>=3&&65496===e.getUint16(0,qe)&&255===e.getUint8(2);if(!r)return null;const{tableMarkers:i,sofMarkers:n}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);const e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}();let o=2;for(;o+9<e.byteLength;){const t=e.getUint16(o,qe);if(n.has(t))return{mimeType:"image/jpeg",height:e.getUint16(o+5,qe),width:e.getUint16(o+7,qe)};if(!i.has(t))return null;o+=2,o+=e.getUint16(o,qe)}return null}(e)||function(t){const e=We(t),r=e.byteLength>=10&&1195984440===e.getUint32(0,qe);if(!r)return null;return{mimeType:"image/gif",width:e.getUint16(6,Ge),height:e.getUint16(8,Ge)}}(e)||function(t){const e=We(t),r=e.byteLength>=14&&16973===e.getUint16(0,qe)&&e.getUint32(2,Ge)===e.byteLength;if(!r)return null;return{mimeType:"image/bmp",width:e.getUint32(18,Ge),height:e.getUint32(22,Ge)}}(e)}function We(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}const He={id:"image",module:"images",name:"Images",version:"3.2.9",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:async function(t,e,r){const i=((e=e||{}).image||{}).type||"auto",{url:n}=r||{};let o;switch(function(t){switch(t){case"auto":case"data":return function(){if(Me)return"imagebitmap";if(Ie)return"image";if(ke)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return Me||Ie||ke;case"imagebitmap":return Me;case"image":return Ie;case"data":return ke;default:throw new Error("@loaders.gl/images: image ".concat(t," not supported in this environment"))}}(t),t}}(i)){case"imagebitmap":o=await Ve(t,e,n);break;case"image":o=await je(t,e,n);break;case"data":o=await async function(t){const{mimeType:e}=Ze(t)||{},r=globalThis._parseImageNode;return(0,Te.v)(r),await r(t,e)}(t);break;default:(0,Te.v)(!1)}return"data"===i&&(o=ze(o)),o},tests:[t=>
16Boolean(Ze(new DataView(t)))],options:{image:{type:"auto",decode:!0}}};const Xe={id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(t){const e=t[0],r=t[t.length-1];return"{"===e&&"}"===r||"["===e&&"]"===r},parseTextSync:JSON.parse},Ye="8.8.11",Ke=globalThis.deck&&globalThis.deck.VERSION;if(Ke&&Ke!==Ye)throw new Error("deck.gl - multiple versions detected: ".concat(Ke," vs ").concat(Ye));Ke||(C.A.log(1,"deck.gl ".concat(Ye))(),globalThis.deck={...globalThis.deck,VERSION:Ye,version:Ye,log:C.A,_registerLoggers:k.k},(0,Ee.mk)([Xe,[He,{imagebitmap:{premultiplyAlpha:"none"}}]]));const Je=globalThis.deck;var Qe=r(20096),$e=r(50117),tr=r(57971),er=r(32970),rr=r(87484),ir=r(71621);class nr extends er.A{get[Symbol.toStringTag](){return"Query"}static isSupported(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,T.C6)(t),i=(0,rr.QN)(t,ir.G.TIMER_QUERY);let n=r||i;for(const t of e)switch(t){case"queries":n=n&&r;break;case"timers":n=n&&i;break;default:(0,tr.v)(!1)}return n}constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery(){let{conservative:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.begin(t?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(t){return this._queryPending||(this.target=t,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const t=this.gl2.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;let e=0;return this._pollingPromise=new Promise(((r,i)=>{const n=()=>{this.isResultAvailable()?(r(this.getResult()),this._pollingPromise=null):e++>t?(i("Timed out"),this._pollingPromise=null):requestAnimationFrame(n)};requestAnimationFrame(n)})),this._pollingPromise}_createHandle(){return nr.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const or=(0,r(29275).A)()&&"undefined"!=typeof document;let ar=0;class sr{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{onCreateContext:e=t=>(0,T.XZ)(t),onAddHTML:r=null,onInitialize:i=()=>{},onRender:n=()=>{},onFinalize:o=()=>{},onError:a,gl:s=null,glOptions:l={},debug:u=!1,createFramebuffer:c=!1,autoResizeViewport:h=!0,autoResizeDrawingBuffer:p=!0,stats:d=$e.dJ.get("animation-loop-".concat(ar++))}=t;let{useDevicePixels:f=!0}=t;"useDevicePixelRatio"in t&&(T.Rm.deprecated("useDevicePixelRatio","useDevicePixels")(),f=t.useDevicePixelRatio),this.props={onCreateContext:e,onAddHTML:r,onInitialize:i,onRender:n,onFinalize:o,onError:a,gl:s,glOptions:l,debug:u,createFramebuffer:c},this.gl=s,this.needsRedraw=null,this.timeline=null,this.stats=d,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:h,autoResizeDrawingBuffer:p,useDevicePixels:f}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(t){return(0,tr.v)("string"==typeof t),this.needsRedraw=this.needsRedraw||t,this}setProps(t){return"autoResizeViewport"in t&&(this.autoResizeViewport=t.autoResizeViewport),"autoResizeDrawingBuffer"in t&&(this.autoResizeDrawingBuffer=t.autoResizeDrawingBuffer),"useDevicePixels"in t&&(this.useDevicePixels=t.useDevicePixels),this}start(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._running)return this;this._running=!0;const e=this._getPageLoadPromise().then((()=>!this._running||this._initialized?null:(this._createWebGLContext(t),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=nr.isSupported(this.gl,["timers"])?new nr(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps)))).then((t=>{this._running&&(this._addCallbackData(t||{}),!1!==t&&this._startLoop())}));return this.props.onError&&e.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(t){return this.timeline=t,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise((t=>{this._resolveNextFrame=t}))),this._nextFramePromise}async toDataURL(){return this.setNeedsRedraw("toDataURL"),await this.waitForRender(),this.gl.canvas.toDataURL()}isContextLost(){return this.gl.isContextLost()}onCreateContext(){return this.props.onCreateContext(...arguments)}onInitialize(){return this.props.onInitialize(...arguments)}onRender(){return this.props.onRender(...arguments)}onFinalize(){return this.props.onFinalize(...arguments)}getHTMLControlValue(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const r=document.getElementById(t);return r?Number(r.value):e}
16setViewParameters(){return T.Rm.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const t=()=>{this._running&&(this.redraw(),this._animationFrameId=this._requestAnimationFrame(t))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(t)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=or?new Promise(((t,e)=>{or&&"complete"===document.readyState?t(document):window.addEventListener("load",(()=>{t(document)}))})):Promise.resolve({})),this._pageLoadPromise}_setDisplay(t){this.display&&(this.display.delete(),this.display.animationLoop=null),t&&(t.animationLoop=this),this.display=t}_cancelAnimationFrame(t){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(t):function(t){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}(t)}_requestAnimationFrame(t){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(t):function(t){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}(t)}_renderFrame(){this.display?this.display._renderFrame(...arguments):this.onRender(...arguments)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:t,height:e,aspect:r}=this._getSizeAndAspect();t===this.animationProps.width&&e===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),r!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=e,this.animationProps.aspect=r,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(t){"object"==typeof t&&null!==t&&(this.animationProps=Object.assign({},this.animationProps,t))}_createWebGLContext(t){if(this.offScreen=t.canvas&&"undefined"!=typeof OffscreenCanvas&&t.canvas instanceof OffscreenCanvas,t=Object.assign({},t,this.props.glOptions),this.gl=this.props.gl?(0,T.uZ)(this.props.gl,t):this.onCreateContext(t),!(0,T.uF)(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(0,T.AB)(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const t=document.createElement("div");document.body.appendChild(t),t.style.position="relative";const e=document.createElement("div");e.style.position="absolute",e.style.left="10px",e.style.bottom="10px",e.style.width="300px",e.style.background="white",t.appendChild(this.gl.canvas),t.appendChild(e);const r=this.props.onAddHTML(e);r&&(e.innerHTML=r)}}_getSizeAndAspect(){const t=this.gl.drawingBufferWidth,e=this.gl.drawingBufferHeight;let r=1;const{canvas:i}=this.gl;return i&&i.clientHeight?r=i.clientWidth/i.clientHeight:t>0&&e>0&&(r=t/e),{width:t,height:e,aspect:r}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&(0,T.ZA)(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new Dt.A(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint(
16)&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:t}=this.gl;t&&(t.addEventListener("mousemove",this._onMousemove),t.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(t){this.animationProps._mousePosition=[t.offsetX,t.offsetY]}_onMouseleave(t){this.animationProps._mousePosition=null}}var lr=r(55188);const ur={mousedown:1,mousemove:2,mouseup:4};!function(t){const e=t.prototype.handler;t.prototype.handler=function(t){const r=this.store;t.button>0&&"pointerdown"===t.type&&(function(t,e){for(let r=0;r<t.length;r++)if(e(t[r]))return!0;return!1}(r,(e=>e.pointerId===t.pointerId))||r.push(t)),e.call(this,t)}}(lr.PointerEventInput),function(t){t.prototype.handler=function(t){let e=ur[t.type];1&e&&t.button>=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(lr.MouseInput);const cr=lr.Manager,hr=lr;class pr{constructor(t,e,r){this.element=t,this.callback=e,this.options={enable:!0,...r}}}const dr=hr?[[hr.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[hr.Rotate,{enable:!1}],[hr.Pinch,{enable:!1}],[hr.Swipe,{enable:!1}],[hr.Pan,{threshold:0,enable:!1}],[hr.Press,{enable:!1}],[hr.Tap,{event:"doubletap",taps:2,enable:!1}],[hr.Tap,{event:"anytap",enable:!1}],[hr.Tap,{enable:!1}]]:null,fr={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},mr={doubletap:["tap"]},gr={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},yr={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},vr={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},_r={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},br="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",xr="undefined"!=typeof window?window:r.g;"undefined"!=typeof r.g?r.g:window,"undefined"!=typeof document&&document;let wr=!1;try{const t={get passive(){return wr=!0,!0}};xr.addEventListener("test",null,t),xr.removeEventListener("test",null)}catch(t){wr=!1}const Ar=-1!==br.indexOf("firefox"),{WHEEL_EVENTS:Er}=yr,Tr="wheel",Sr=4.000244140625;class Pr extends pr{constructor(t,e,r){super(t,e,r),this.handleEvent=t=>{if(!this.options.enable)return;let e=t.deltaY;xr.WheelEvent&&(Ar&&t.deltaMode===xr.WheelEvent.DOM_DELTA_PIXEL&&(e/=xr.devicePixelRatio),t.deltaMode===xr.WheelEvent.DOM_DELTA_LINE&&(e*=40)),0!==e&&e%Sr==0&&(e=Math.floor(e/Sr)),t.shiftKey&&e&&(e*=.25),this.callback({type:Tr,center:{x:t.clientX,y:t.clientY},delta:-e,srcEvent:t,pointerType:"mouse",target:t.target})},this.events=(this.options.events||[]).concat(Er),this.events.forEach((e=>t.addEventListener(e,this.handleEvent,!!wr&&{passive:!1})))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===Tr&&(this.options.enable=e)}}const{MOUSE_EVENTS:Ir}=yr,Mr="pointermove",Cr="pointerover",kr="pointerout",Lr="pointerenter",zr="pointerleave";class Rr extends pr{constructor(t,e,r){super(t,e,r),this.handleEvent=t=>{this.handleOverEvent(t),this.handleOutEvent(t),this.handleEnterEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)},this.pressed=!1;const{enable:i}=this.options;this.enableMoveEvent=i,this.enableLeaveEvent=i,this.enableEnterEvent=i,this.enableOutEvent=i,this.enableOverEvent=i,this.events=(this.options.events||[]).concat(Ir),this.events.forEac
vendor: 5,165 bytes, line 16
16h((e=>t.addEventListener(e,this.handleEvent)))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===Mr&&(this.enableMoveEvent=e),t===Cr&&(this.enableOverEvent=e),t===kr&&(this.enableOutEvent=e),t===Lr&&(this.enableEnterEvent=e),t===zr&&(this.enableLeaveEvent=e)}handleOverEvent(t){this.enableOverEvent&&"mouseover"===t.type&&this._emit(Cr,t)}handleOutEvent(t){this.enableOutEvent&&"mouseout"===t.type&&this._emit(kr,t)}handleEnterEvent(t){this.enableEnterEvent&&"mouseenter"===t.type&&this._emit(Lr,t)}handleLeaveEvent(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this._emit(zr,t)}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this._emit(Mr,t);break;case"mouseup":this.pressed=!1}}_emit(t,e){this.callback({type:t,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const{KEY_EVENTS:Or}=yr,Dr="keydown",Br="keyup";class Fr extends pr{constructor(t,e,r){super(t,e,r),this.handleEvent=t=>{const e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:Dr,srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:Br,srcEvent:t,key:t.key,target:t.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=(this.options.events||[]).concat(Or),t.tabIndex=this.options.tabIndex||0,t.style.outline="none",this.events.forEach((e=>t.addEventListener(e,this.handleEvent)))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===Dr&&(this.enableDownEvent=e),t===Br&&(this.enableUpEvent=e)}}const jr="contextmenu";class Nr extends pr{constructor(t,e,r){super(t,e,r),this.handleEvent=t=>{this.options.enable&&this.callback({type:jr,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})},t.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(t,e){t===jr&&(this.options.enable=e)}}const Ur={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};function Vr(t){const e=Ur[t.srcEvent.type];if(!e)return null;const{buttons:r,button:i,which:n}=t.srcEvent;let o=!1,a=!1,s=!1;return 4===e||2===e&&!Number.isFinite(r)?(o=1===n,a=2===n,s=3===n):2===e?(o=Boolean(1&r),a=Boolean(4&r),s=Boolean(2&r)):1===e&&(o=0===i,a=1===i,s=2===i),{leftButton:o,middleButton:a,rightButton:s}}function qr(t,e){const r=t.center;if(!r)return null;const i=e.getBoundingClientRect(),n=i.width/e.offsetWidth||1,o=i.height/e.offsetHeight||1;return{center:r,offsetCenter:{x:(r.x-i.left-e.clientLeft)/n,y:(r.y-i.top-e.clientTop)/o}}}const Gr={srcElement:"root",priority:0};class Zr{constructor(t){this.handleEvent=t=>{if(this.isEmpty())return;const e=this._normalizeEvent(t);let r=t.srcEvent.target;for(;r&&r!==e.rootElement;){if(this._emit(e,r),e.handled)return;r=r.parentNode}this._emit(e,"root")},this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const{handlers:o,handlersByElement:a}=this;let s=Gr;"string"==typeof r||r&&r.addEventListener?s={...Gr,srcElement:r}:r&&(s={...Gr,...r});let l=a.get(s.srcElement);l||(l=[],a.set(s.srcElement,l));const u={type:t,handler:e,srcElement:s.srcElement,priority:s.priority};i&&(u.once=!0),n&&(u.passive=!0),o.push(u),this._active=this._active||!u.passive;let c=l.length-1;for(;c>=0&&!(l[c].priority>=u.priority);)c--;l.splice(c+1,0,u)}remove(t,e){const{handlers:r,handlersByElement:i}=this;for(let n=r.length-1;n>=0;n--){const o=r[n];if(o.type===t&&o.handler===e){r.splice(n,1);const t=i.get(o.srcElement);t.splice(t.indexOf(o),1),0===t.length&&i.delete(o.srcElement)}}this._active=r.some((t=>!t.passive))}_emit(t,e){const r=this.handlersByElement.get(e);if(r){let e=!1;const i=()=>{t.handled=!0},n=()=>{t.handled=!0,e=!0},o=[];for(let a=0;a<r.length;a++){const{type:s,handler:l,once:u}=r[a];if(l({...t,type:s,stopPropagation:i,stopImmediatePropagation:n}),u&&o.push(r[a]),e)break}for(let t=0;t<o.length;t++){const{type:e,handler:r}=o[t];this.remove(e,r)}}}_normalizeEvent(t){const e=this.eventManager.getElement();return{...t,...Vr(t),...qr(t,e),preventDefault:()=>{t.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:e}}}const Wr={events:null,recognizers:null,recognizerOptions:{},Manager:cr,touchAction:"none",tabIndex:0};class Hr{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0;this._onBasicInput=t=>{const{srcEvent:e}=t,r=gr[e.type];r&&this.manager.emit(r,t)},this._onOtherEvent=t=>{this.manager.emit(t.type,t)},this.options={...Wr,...e},this.events=new Map,this.setElement(t);const{events:r}=this.options;r&&this.on(r)}getElement(){return this.element}
16setElement(t){if(this.element&&this.destroy(),this.element=t,!t)return;const{options:e}=this,r=e.Manager;this.manager=new r(t,{touchAction:e.touchAction,recognizers:e.recognizers||dr}).on("hammer.input",this._onBasicInput),e.recognizers||Object.keys(fr).forEach((t=>{const e=this.manager.get(t);e&&fr[t].forEach((t=>{e.recognizeWith(t)}))}));for(const t in e.recognizerOptions){const r=this.manager.get(t);if(r){const i=e.recognizerOptions[t];delete i.enable,r.set(i)}}this.wheelInput=new Pr(t,this._onOtherEvent,{enable:!1}),this.moveInput=new Rr(t,this._onOtherEvent,{enable:!1}),this.keyInput=new Fr(t,this._onOtherEvent,{enable:!1,tabIndex:e.tabIndex}),this.contextmenuInput=new Nr(t,this._onOtherEvent,{enable:!1});for(const[t,e]of this.events)e.isEmpty()||(this._toggleRecognizer(e.recognizerName,!0),this.manager.on(t,e.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(t,e,r){this._addEventHandler(t,e,r,!1)}once(t,e,r){this._addEventHandler(t,e,r,!0)}watch(t,e,r){this._addEventHandler(t,e,r,!1,!0)}off(t,e){this._removeEventHandler(t,e)}_toggleRecognizer(t,e){const{manager:r}=this;if(!r)return;const i=r.get(t);if(i&&i.options.enable!==e){i.set({enable:e});const n=mr[t];n&&!this.options.recognizers&&n.forEach((n=>{const o=r.get(n);e?(o.requireFailure(t),i.dropRequireFailure(n)):o.dropRequireFailure(t)}))}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}_addEventHandler(t,e,r,i,n){if("string"!=typeof t){r=e;for(const e in t)this._addEventHandler(e,t[e],r,i,n);return}const{manager:o,events:a}=this,s=_r[t]||t;let l=a.get(s);l||(l=new Zr(this),a.set(s,l),l.recognizerName=vr[s]||s,o&&o.on(s,l.handleEvent)),l.add(t,e,r,i,n),l.isEmpty()||this._toggleRecognizer(l.recognizerName,!0)}_removeEventHandler(t,e){if("string"!=typeof t){for(const e in t)this._removeEventHandler(e,t[e]);return}const{events:r}=this,i=_r[t]||t,n=r.get(i);if(n&&(n.remove(t,e),n.isEmpty())){const{recognizerName:t}=n;let e=!1;for(const i of r.values())if(i.recognizerName===t&&!i.isEmpty()){e=!0;break}e||this._toggleRecognizer(t,!1)}}}function Xr(){}const Yr={id:"",width:"100%",height:"100%",style:null,viewState:null,initialViewState:null,pickingRadius:0,layerFilter:null,glOptions:{},parameters:{},parent:null,gl:null,canvas:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},_customRender:null,onWebGLInitialized:Xr,onResize:Xr,onViewStateChange:Xr,onInteractionStateChange:Xr,onBeforeRender:Xr,onAfterRender:Xr,onLoad:Xr,onError:t=>C.A.error(t.message)(),onHover:null,onClick:null,onDragStart:null,onDrag:null,onDragEnd:null,_onMetrics:null,getCursor:t=>{let{isDragging:e}=t;return e?"grabbing":"grab"},getTooltip:null,debug:!1,drawPickingColors:!1};class Kr{constructor(t){(0,o.A)(this,"props",void 0),(0,o.A)(this,"width",0),(0,o.A)(this,"height",0),(0,o.A)(this,"userData",{}),(0,o.A)(this,"canvas",null),(0,o.A)(this,"viewManager",null),(0,o.A)(this,"layerManager",null),(0,o.A)(this,"effectManager",null),(0,o.A)(this,"deckRenderer",null),(0,o.A)(this,"deckPicker",null),(0,o.A)(this,"eventManager",null),(0,o.A)(this,"tooltip",null),(0,o.A)(this,"metrics",void 0),(0,o.A)(this,"animationLoop",void 0),(0,o.A)(this,"stats",void 0),(0,o.A)(this,"viewState",void 0),(0,o.A)(this,"cursorState",void 0),(0,o.A)(this,"_needsRedraw",void 0),(0,o.A)(this,"_pickRequest",void 0),(0,o.A)(this,"_lastPointerDownInfo",null),(0,o.A)(this,"_metricsCounter",void 0),(0,o.A)(this,"_onPointerMove",(t=>{const{_pickRequest:e}=this;if("pointerleave"===t.type)e.x=-1,e.y=-1,e.radius=0;else{if(t.leftButton||t.rightButton)return;{const r=t.offsetCenter;if(!r)return;e.x=r.x,e.y=r.y,e.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:e.x,y:e.y}),e.event=t})),(0,o.A)(this,"_onEvent",(t=>{const e=Ft.qY[t.type],r=t.offsetCenter;if(!e||!r||!this.layerManager)return;const i=this.layerManager.getLayers(),n=this.deckPicker.getLastPickedObject({x:r.x,y:r.y,layers:i,viewports:this.getViewports(r)},this._lastPointerDownInfo),{layer:o}=n,a=o&&(o[e.handler]||o.props[e.handler]),s=this.props[e.handler];let l=!1;a&&(l=a.call(o,n,t)),!l&&s&&s(n,t)})),(0,o.A)(this,"_onPointerDown",(t=>{const e=t.offsetCenter,r=this._pick("pickObject","pickObject Time",{x:e.x,y:e.y,radius:this.props.pickingRadius});this._lastPointerDownInfo=r.result[0]||r.emptyInfo})),this.props={...Yr,...t},t=this.props,this._needsRedraw="Initial render",this._pickRequest={mode:"hover",x:-1,y:-1,radius:0,event:null},this.cursorState={isHovering:!1,isDragging:!1},t.viewState&&t.initialViewState&&C.A.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Qe.A)()&&C.A.warn("IE 11 is not supported")(),this.viewState=t.initialViewState,t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new z.A({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),t._typedArrayManagerProps&&Ae.A.setOptions(t._typedArrayManagerProps),this.animationLoop.start()}finalize(){var t,e,r,i,n,o,a,s;(this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,null===(t=this.layerManager)||void 0===t||t.finalize(),this.layerManager=null,null===(e=this.viewManager)||void 0===e||e.finalize(),this.viewManager=null,null===(r=this.effectManager)||void 0===r||r.finalize(),this.effectManager=null,null===(i=this.deckRenderer)||void 0===i||i.finalize(),this.deckRenderer=null,null===(n=this.deckPicker)||void 0===n||n.finalize(),this.deckPicker=null,null===(o=this.eventManager)||void 0===o||o.destroy(),this.eventManager=null,null===(a=this.tooltip)||void 0===a||a.remove(),this.tooltip=null,this.props.canvas||this.props.gl||!this.canvas)||(null===(s=this.canvas.parentElement)||void 0===s||s.removeChild(this.canvas),this.canvas=null)}setProps(t){this.stats.get("setProps Time").timeStart(),"onLayerHover"in t&&C.A.removed("onLayerHover","onHover")(),"onLayerClick"in t&&C.A.removed("onLayerClick","onClick")(),t.initialViewState&&!(0,G.b)(this.props.initialViewState,t.initialViewState)&&(this.viewState=t.initialViewState),Object.assign(this.props,t),this._setCanvasSize(this.props);const e=Object.create(this.props);Object.assign(e,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(e),this.layerManager&&(this.viewManager.setProps(e),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(e),this.effectManager.setProps(e),this.deckRenderer.setProps(e),this.deckPicker.setProps(e)),this.stats.get("setProps Time").timeEnd()}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(!this.layerManager)return!1;if(this.props._animate)return"Deck._animate";let e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);const r=this.viewManager.needsRedraw(t),i=this.layerManager.needsRedraw(t),n=this.effectManager.needsRedraw(t),o=this.deckRenderer.needsRedraw(t);return e=e||r||i||n||o,e}redraw(t){if(!this.layerManager)return;let e=this.needsRedraw({clearRedrawFlags:!0});e=t||e,e&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(e):this._drawLayers(e))}get isInitialized(){return null!==this.viewManager}getViews(){return(0,s.A)(this.viewManager),this.viewManager.views}getViewports(t){return(0,s.A)(this.viewManager),this.viewManager.getViewports(t)}pickObject(t){const e=this._pick("pickObject","pickObject Time",t).result;return e.length?e[0]:null}pickMultipleObjects(t){return t.depth=t.depth||10,this._pick("pickObject","pickMultipleObjects Time",t).result}pickObjects(t){return this._pick("pickObjects","pickObjects Time",t)}_addResources(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(const r in t)this.layerManager.resourceManager.add({resourceId:r,data:t[r],forceUpdate:e})}_removeResources(t){for(const e of t)this.layerManager.resourceManager.remove(e)}_pick(t,e,r){(0,s.A)(this.deckPicker);const{stats:i}=this;i.get("Pick Count").incrementCount(),i.get(e).timeStart();const n=this.deckPicker[t]({layers:this.layerManager.getLayers(r),views:this.viewManager.getViews(),viewports:this.getViewports(r),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects(),...r});return i.get(e).timeEnd(),n}_createCanvas(t){let e=t.canvas;if("string"==typeof e&&(e=document.getElementById(e),(0,s.A)(e)),!e){e=document.createElement("canvas"),e.id=t.
16id||"deckgl-overlay";(t.parent||document.body).appendChild(e)}return Object.assign(e.style,t.style),e}_setCanvasSize(t){if(!this.canvas)return;const{width:e,height:r}=t;if(e||0===e){const t=Number.isFinite(e)?"".concat(e,"px"):e;this.canvas.style.width=t}if(r||0===r){var i;const e=Number.isFinite(r)?"".concat(r,"px"):r;this.canvas.style.position=(null===(i=t.style)||void 0===i?void 0:i.position)||"absolute",this.canvas.style.height=e}}_updateCanvasSize(){const{canvas:t}=this;if(!t)return;const e=t.clientWidth||t.width,r=t.clientHeight||t.height;var i;e===this.width&&r===this.height||(this.width=e,this.height=r,null===(i=this.viewManager)||void 0===i||i.setProps({width:e,height:r}),this.props.onResize({width:e,height:r}))}_createAnimationLoop(t){const{width:e,height:r,gl:i,glOptions:n,debug:o,onError:a,onBeforeRender:s,onAfterRender:l,useDevicePixels:u}=t;return new sr({width:e,height:r,useDevicePixels:u,autoResizeViewport:!1,gl:i,onCreateContext:t=>(0,T.XZ)({...n,...t,canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()}),onInitialize:t=>this._setGLContext(t.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:s,onAfterRender:l,onError:a})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let t=this.props.views||[new vt({id:"default-view"})];return t=Array.isArray(t)?t:[t],t.length&&this.props.controller&&(t[0].props.controller=this.props.controller),t}_onContextLost(){const{onError:t}=this.props;this.animationLoop&&t&&t(new Error("WebGL context is lost"))}_pickAndCallback(){const{_pickRequest:t}=this;if(t.event){const{result:r,emptyInfo:i}=this._pick("pickObject","pickObject Time",t);this.cursorState.isHovering=r.length>0;let n=i,o=!1;for(const i of r){var e;n=i,o=(null===(e=i.layer)||void 0===e?void 0:e.onHover(i,t.event))||o}if(!o&&this.props.onHover&&this.props.onHover(n,t.event),this.props.getTooltip&&this.tooltip){const t=this.props.getTooltip(n);this.tooltip.setTooltip(t,n.x,n.y)}t.event=null}}_updateCursor(){const t=this.props.parent||this.canvas;t&&(t.style.cursor=this.props.getCursor(this.cursorState))}_setGLContext(t){if(this.layerManager)return;this.canvas||(this.canvas=t.canvas,(0,T.uZ)(t,{enable:!0,copyState:!0})),this.tooltip=new we(this.canvas),(0,T.Rz)(t,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(t);const e=new I;e.play(),this.animationLoop.attachTimeline(e),this.eventManager=new Hr(this.props.parent||t.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const t in Ft.qY)this.eventManager.on(t,this._onEvent);this.viewManager=new Z({timeline:e,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const r=this.viewManager.getViewports()[0];this.layerManager=new q(t,{deck:this,stats:this.stats,viewport:r,timeline:e}),this.effectManager=new le,this.deckRenderer=new de(t),this.deckPicker=new be(t),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(t,e){const{gl:r}=this.layerManager.context;(0,T.Rz)(r,this.props.parameters),this.props.onBeforeRender({gl:r}),this.deckRenderer.renderLayers({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:t,effects:this.effectManager.getEffects(),...e}),this.props.onAfterRender({gl:r})}_onRenderFrame(t){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),C.A.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(t){const e=this.props.onViewStateChange(t)||t.viewState;this.viewState&&(this.viewState={...this.viewState,[t.viewId]:e},this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(t){this.cursorState.isDragging=t.isDragging||!1,this.props.onInteractionStateChange(t)}
16_getFrameStats(){const{stats:t}=this;t.get("frameRate").timeEnd(),t.get("frameRate").timeStart();const e=this.animationLoop.stats;t.get("GPU Time").addTime(e.get("GPU Time").lastTiming),t.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:t,stats:e}=this;t.fps=e.get("frameRate").getHz(),t.setPropsTime=e.get("setProps Time").time,t.updateAttributesTime=e.get("Update Attributes").time,t.framesRedrawn=e.get("Redraw Count").count,t.pickTime=e.get("pickObject Time").time+e.get("pickMultipleObjects Time").time+e.get("pickObjects Time").time,t.pickCount=e.get("Pick Count").count,t.gpuTime=e.get("GPU Time").time,t.cpuTime=e.get("CPU Time").time,t.gpuTimePerFrame=e.get("GPU Time").getAverageTime(),t.cpuTimePerFrame=e.get("CPU Time").getAverageTime();const r=$e.dJ.get("Memory Usage");t.bufferMemory=r.get("Buffer Memory").count,t.textureMemory=r.get("Texture Memory").count,t.renderbufferMemory=r.get("Renderbuffer Memory").count,t.gpuMemory=r.get("GPU Memory").count}}(0,o.A)(Kr,"defaultProps",Yr),(0,o.A)(Kr,"VERSION",Je.VERSION);var Jr=r(62031),Qr=r(55490),$r=r(9444);class ti extends Jr.A{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(2),(0,a.cy)(t)&&1===arguments.length?this.copy(t):(a.$W.debug&&((0,Qr.ws)(t),(0,Qr.ws)(e)),this[0]=t,this[1]=e)}set(t,e){return this[0]=t,this[1]=e,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return a.$W.debug&&((0,Qr.ws)(t.x),(0,Qr.ws)(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Kt.Z0(this,this,t),this.check()}transformAsVector(t){return(0,$r.B$)(this,this,t),this.check()}transformByMatrix3(t){return Kt.ei(this,this,t),this.check()}transformByMatrix2x3(t){return Kt.l0(this,this,t),this.check()}transformByMatrix2(t){return Kt.ZF(this,this,t),this.check()}}const ei=85.05113;function ri(t,e,r,i){if(r){if(r.userData._googleMap===t)return r;ni(r)}const n={click:null,dblclick:null,mousemove:null,mouseout:null},o=new Kr({...i,useDevicePixels:!!i.interleaved||i.useDevicePixels,style:i.interleaved?null:{pointerEvents:"none"},parent:ii(e,i.style),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1});for(const e in n)n[e]=t.addListener(e,(t=>ui(o,e,t)));return o.userData._googleMap=t,o.userData._eventListeners=n,o}function ii(t,e){const r=document.createElement("div");var i,n;(r.style.position="absolute",Object.assign(r.style,e),"getPanes"in t)?null===(i=t.getPanes())||void 0===i||i.overlayLayer.appendChild(r):null===(n=t.getMap())||void 0===n||n.getDiv().appendChild(r);return r}function ni(t){const{_eventListeners:e}=t.userData;for(const t in e)e[t]&&e[t].remove();t.finalize()}function oi(t,e){const{width:r,height:i}=ai(t),{center:n,heading:o,tilt:a,zoom:s}=e.getCameraParams(),l=i?r/i:1,u=(new Ct.A).perspective({fovy:25*Math.PI/180,aspect:l,near:.75,far:3e14});return{width:r,height:i,viewState:{altitude:.5*u[5],bearing:o,latitude:n.lat(),longitude:n.lng(),pitch:a,projectionMatrix:u,repeat:!0,zoom:s-1}}}function ai(t){const e=t.getDiv().firstChild;return{width:e.offsetWidth,height:e.offsetHeight}}function si(t,e,r){const i=new google.maps.Point(e,r),n=t.fromContainerPixelToLatLng(i);return[n.lng(),n.lat()]}function li(t,e){if(t.pixel)return t.pixel;const r=e.getViewports()[0].project([t.latLng.lng(),t.latLng.lat()]);return{x:r[0],y:r[1]}}function ui(t,e,r){const i={type:e,offsetCenter:li(r,t),srcEvent:r};switch(e){case"click":i.tapCount=1,t._onPointerDown(i),t._onEvent(i);break;case"dblclick":i.type="click",i.tapCount=2,t._onEvent(i);break;case"mousemove":i.type="pointermove",t._onPointerMove(i);break;case"mouseout":i.type="pointerleave",t._onPointerMove(i);break;default:return}}const ci=()=>!1,hi={depthMask:!0,depthTest:!0,blend:!0,blendFunc:[770,771,1,771],blendEquation:32774};function pi(){}const di={interleaved:!0};class fi{constructor(t){(0,o.A)(this,"props",{}),(0,o.A)(this,"_map",null),(0,o.A)(this,"_deck",null),(0,o.A)(this,"_overlay",null),this.setProps({...di,...t})}setMap(t){if(t!==this._map){var e;if(this._map)null===(e=this._overlay)||void 0===e||e.setMap(null),this._map=null;if(t){this._map=t;const{UNINITIALIZED:e}=google.maps.RenderingType;t.getRenderingType()!==e?this._createOverlay(t):t.addListener("renderingtype_changed",(()=>{this._createOverlay(t)}))}}}setProps(t){if(Object.assign(this.props,t),this._deck){if(t.style){const e=this._deck.canvas.parentElement.style;Object.assign(e,t.style),t.style=null}this._deck.setProps(t)}}pickObject(t){return this._deck&&this._deck.pickObject(t)}pickMultipleObjects(t){return this._deck&&this._deck.pickMultipleObjects(t)}pickObjects(t){return this._deck&&this._deck.pickObjects(t)}finalize(){this.setMap(null),this._deck&&(ni(this._deck),this._deck=null)}_createOverlay(t){const{interleaved:e}=this.props,{VECTOR:r,UNINITIALIZED:i}=google.maps.RenderingType,n=t.getRenderingType();if(n===i)return;const o=new(n===r&&google.maps.WebGLOverlayView?google.maps.WebGLOverlayView:google.maps.OverlayView);o instanceof google.maps.WebGLOverlayView?(e?(o.onAdd=pi,o.onContextRestored=this._onContextRestored.bind(this),o.onDraw=this._onDrawVectorInterleaved.bind(this)):(o.onAdd=this._onAdd.bind(this),o.onContextRestored=pi,o.onDraw=this._onDrawVectorOverlay.bind(this)),o.onContextLost=this._onContextLost.bind(this)):(o.onAdd=this._onAdd.bind(this),o.draw=this._onDrawRaster.bind(this)),o.onRemove=this._onRemove.bind(this),this._overlay=o,this._overlay.setMap(t)}_onAdd(){this._deck=ri(this._map,this._overlay,this._deck,this.props)}_onContextRestored(t){let{gl:e}=t;if(!this._map||!this._overlay)return;const r=ri(this._map,this._overlay,this._deck,{gl:e,_customRender:()=>{this._overlay&&this._overlay.requestRedraw()},...this.props});this._deck=r;const{animationLoop:i}=r;i._renderFrame=()=>{const t=e.getParameter(34964);(0,T.zv)(e,{},(()=>{i.onRender()})),e.bindBuffer(34962,t)}}_onContextLost(){this._deck&&(ni(this._deck),this._deck=null)}_onRemove(){var t;null===(t=this._deck)||void 0===t||t.setProps({layerFilter:ci})}_onDrawRaster(){if(!this._deck||!this._map)return;const t=this._deck,{width:e,height:r,left:i,top:n,...o}=function(t,e){const{width:r,height:i}=ai(t),n=e.getProjection(),o=t.getBounds();if(!o)return{width:r,height:i,left:0,top:0};
16const a=o.getNorthEast(),s=o.getSouthWest(),l=n.fromLatLngToDivPixel(a),u=n.fromLatLngToDivPixel(s),c=si(n,r/2,i/2),h=new google.maps.LatLng(0,c[0]),p=n.fromLatLngToContainerPixel(h),d=n.fromLatLngToDivPixel(h);if(!(l&&u&&d&&p))return{width:r,height:i,left:0,top:0};const f=Math.round(d.x-p.x);let m=d.y-p.y;const g=si(n,r/2,0),y=si(n,r/2,i);let v=c[1];const _=c[0];if(Math.abs(v)>ei){v=v>0?ei:-85.05113;const t=new google.maps.LatLng(v,_);m+=n.fromLatLngToContainerPixel(t).y-i/2}m=Math.round(m);let b=180*new ti(g).sub(y).verticalAngle()/Math.PI;b<0&&(b+=360);const x=t.getHeading()||0;let w,A=t.getZoom()-1;if(0===b)w=i?(u.y-l.y)/i:1;else if(b===x){const t=new ti([l.x,l.y]).sub([u.x,u.y]).len(),e=new ti([r,-i]).len();w=e?t/e:1}return A+=Math.log2(w||1),{width:r,height:i,left:f,top:m,zoom:A,bearing:b,pitch:t.getTilt(),latitude:v,longitude:_}}(this._map,this._overlay),a=t.canvas.parentElement.style;a.left="".concat(i,"px"),a.top="".concat(n,"px");t.setProps({width:e,height:r,viewState:{altitude:1e4,repeat:!0,...o}}),t.redraw()}_onDrawVectorInterleaved(t){let{gl:e,transformer:r}=t;if(!this._deck||!this._map)return;const i=this._deck;if(i.setProps({...oi(this._map,r),width:null,height:null}),i.isInitialized){const t=(0,T.bQ)(e,36006);i.setProps({_framebuffer:t}),i.needsRedraw({clearRedrawFlags:!0}),(0,T.Rz)(e,{viewport:[0,0,e.canvas.width,e.canvas.height],scissor:[0,0,e.canvas.width,e.canvas.height],stencilFunc:[519,0,255,519,0,255]}),(0,T.zv)(e,hi,(()=>{i._drawLayers("google-vector",{clearCanvas:!1})}))}}_onDrawVectorOverlay(t){let{transformer:e}=t;if(!this._deck||!this._map)return;const r=this._deck;r.setProps({...oi(this._map,e)}),r.redraw()}}var mi=r(60640);const gi=t=>{let{viewport:e,overlays:r}=t;return e&&Array.isArray(r)?r.map(((t,r)=>(0,f.Y)(mi.uA,{viewport:e,zIndex:"auto",children:Array.isArray(t)?t.map(((t,e)=>{const{style:r,...i}=t.propsOverride||{};return(0,f.Y)(mi.Dy,{coordinates:t.coordinates,style:{pointerEvents:"all",...r},...i,children:t.content},t.id??e)})):null},r))):null};function yi(t){let{onError:e}=t;return function(t,r,i){const n={name:"deck-gl-error",payload:Object.freeze({message:t.message,stack:t.stack,layerId:r?r.id:"",latitude:i?.latitude,longitude:i?.longitude,zoom:i?.zoom})};e&&e(n),console.error(n)}}const vi=Object.freeze({rides:"rides",eats:"eats",eatsPickup:"eats-pickup",indoor:"indoor"}),_i=Object.freeze({light:"light",dark:"dark"});const bi={height:"100%",width:"100%"},xi=t=>t+1,wi=t=>t-1;function Ai(t){const e=t.getCenter(),r=t.getZoom();return e&&r?{longitude:e.lng(),latitude:e.lat(),zoom:wi(r)}:null}const Ei=t=>t?.map((t=>t.clone({})));function Ti(t){const e=(0,i.useRef)(null),[r]=(0,n.c6)(),[,o]=(0,i.useReducer)((t=>t+1),0),[a,s]=(0,i.useState)(null),[l,u]=(0,i.useState)(null),[c,h]=(0,i.useState)(!1),{viewState:p,onViewStateChange:d,layers:m,overlays:g,onClick:y,onHover:v,onError:b,onLoad:x,styleFlavor:w,overrides:A,theme:T}=t,S=(0,i.useMemo)((()=>yi({onError:b})),[b]),P=(0,i.useMemo)((()=>function(t){let{onError:e}=t;return function(t,r){const i={name:"google-maps-error",payload:{message:t?.message,stack:t?.stack,latitude:r?.latitude,longitude:r?.longitude,zoom:r?.zoom}};e&&e(i),console.error(i)}}({onError:b})),[b]),I=A?.options?.mapId||function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_i.light;if(t!==vi.indoor)return t===vi.eatsPickup?e===_i.dark?"135d5c29af13ce20":"231fad7e1dae4a0e":e===_i.dark?"f65a5d0ebfc04ac2":"4bece55b6e256151"}(w,T),M=A?.options?.mapTypeId||function(t){if(t===vi.indoor)return"roadmap"}(w),C=(0,i.useMemo)((()=>({disableDefaultUI:!0,gestureHandling:d?"greedy":"none",isFractionalZoomEnabled:!0,clickableIcons:!1,mapId:I,...M?{mapTypeId:M}:{},draggableCursor:A?.engineInterface?.defaultCursor,draggingCursor:A?.engineInterface?.draggingCursor,...A?.options})),[d,A,I,M]);(0,i.useEffect)((()=>{(async()=>{try{if(e.current&&!a){const t=new E({apiKey:"AIzaSyA7PDtoek2wV38r1cF6_nyLGUujAx0myHg",version:"quarterly",...A?.credentials}),r=new((await t.load()).maps.Map)(e.current,{...C,center:{lat:p.latitude,lng:p.longitude},zoom:xi(p.zoom)});s(r)}}catch(t){P(t,p)}})()}),[P,a,C,A?.credentials,p]),(0,i.useEffect)((()=>{a&&a.setOptions(C)}),[a,C]),(0,i.useEffect)((()=>
16{if(!a||!x||c)return;const t=a.addListener("idle",(()=>{x(),h(!0)}));return()=>{t&&t.remove()}}),[a,x,c]),(0,i.useEffect)((()=>{if(!a)return;const t=new fi({layers:Ei(m),onClick:y,onHover:v,onAfterRender:o,onError:(t,e)=>{const r=Ai(a);S(t,e,r)}});let e=null,r=!1;const i=()=>{r||"UNINITIALIZED"===a.getRenderingType?.()||(r=!0,t.setMap(a))};return i(),r||(e=a.addListener("renderingtype_changed",i)),u(t),()=>{e?.remove(),t.finalize(),u(null)}}),[a]),(0,i.useEffect)((()=>{l&&l.setProps({layers:Ei(m),onClick:y,onHover:v,onAfterRender:o,onError:(t,e)=>{const r=Ai(a);S(t,e,r)}})}),[l,a,m,y,v,S]),(0,i.useEffect)((()=>{if(a){a.getZoom()!==xi(p.zoom)&&a.setZoom(xi(p.zoom));const t=a.getCenter();t?.lng()===p.longitude&&t?.lat()===p.latitude||a.setCenter({lat:p.latitude,lng:p.longitude})}}),[a,p.latitude,p.longitude,p.zoom]),(0,i.useEffect)((()=>{const t=a&&d?a.addListener("idle",(()=>{const t=a.getCenter(),e=a.getZoom();(t&&(t.lng()!==p.longitude||t.lat()!==p.latitude)||"number"==typeof e&&wi(e)!==p.zoom)&&d({...p,latitude:t?t.lat():p.latitude,longitude:t?t.lng():p.longitude,zoom:"number"==typeof e?wi(e):p.zoom})})):null;return()=>{t&&t.remove()}}),[a,p,d]);const k=l?._deck?.layerManager?.context.viewport,L=a?.__gm?.eventCapturer;return(0,f.Y)("div",{className:r(bi),ref:e,children:L&&k?_.createPortal((0,f.Y)(gi,{viewport:k,overlays:g}),L):null})}function Si(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Pi=r(49712);function Ii(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(0,Pi.A)(i.key),i)}}function Mi(t,e,r){return e&&Ii(t.prototype,e),r&&Ii(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ci(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var ki=r(29214);function Li(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&(0,ki.A)(t,e)}var zi=r(54492);function Ri(t,e){if(e&&("object"===(0,zi.A)(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ci(t)}
16function Oi(t){return Oi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Oi(t)}var Di=r(72057),Bi=r.n(Di);function Fi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function ji(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Fi(Object(r),!0).forEach((function(e){(0,o.A)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ni(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=function(t,e){if(!t)return;if("string"==typeof t)return Ui(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ui(t,e)}(t))){var e=0,r=function(){};return{s:r,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n,o=!0,a=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return o=t.done,t},e:function(t){a=!0,n=t},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw n}}}}function Ui(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}var Vi=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function qi(t){if(!t)return null;if("string"==typeof t)return t;t.toJS&&(t=t.toJS());var e,r={},i=Ni(t.layers);try{for(i.s();!(e=i.n()).done;){var n=e.value;r[n.id]=n}}catch(t){i.e(t)}finally{i.f()}var o=t.layers.map((function(t){var e=r[t.ref],i=null;if("interactive"in t&&delete(i=ji({},t)).interactive,e){delete(i=i||ji({},t)).ref;var n,o=Ni(Vi);try{for(o.s();!(n=o.n()).done;){var a=n.value;a in e&&(i[a]=e[a])}}catch(t){o.e(t)}finally{o.f()}}return i||t}));return ji(ji({},t),{},{layers:o})}function Gi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function Zi(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var i,n,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=o.call(r)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(t){u=!0,n=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw n}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Gi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Gi(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Wi=r(70549);function Hi(t,e){var r=Wi.Z0([],e,t);return Wi.hs(r,r,1/r[3]),r}function Xi(t,e){var r=t%e;return r<0?e+r:r}var Yi=r(91925),Ki=r(46752);function Ji(t,e){if(!t)throw new Error(e||"viewport-mercator-project: assertion failed.")}var Qi=Math.PI,$i=Qi/4,tn=Qi/180,en=180/Qi,rn=4003e4;function nn(t){return Math.pow(2,t)}function on(t,e){var r=Zi(t,2),i=r[0],n=r[1];Ji(Number.isFinite(i)&&Number.isFinite(e)),Ji(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");var o=n*tn;return[(e*=512)*(i*tn+Qi)/(2*Qi),e*(Qi-Math.log(Math.tan($i+.5*o)))/(2*Qi)]}function an(t,e){var r=Zi(t,2),i=r[0],n=r[1],o=i/(e*=512)*(2*Qi)-Qi,a=2*(Math.atan(Math.exp(Qi-n/e*(2*Qi)))-$i);return[o*en,a*en]}function sn(t){var e=t.latitude,r=t.longitude,i=t.zoom,n=t.scale,o=t.highPrecision,a=void 0!==o&&o;n=void 0!==n?n:nn(i),Ji(Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(n));var s={},l=512*n,u=Math.cos(e*tn),c=l/360,h=c/u,p=l/rn/u;if(s.pixelsPerMeter=[p,-p,p],s.metersPerPixel=[1/p,-1/p,1/p],s.pixelsPerDegree=[c,-h,p],s.degreesPerPixel=[1/c,-1/h,1/p],a){var d=tn*Math.tan(e*tn)/u,f=c*d/2,m=l/rn*d,g=m/h*p;s.pixelsPerDegree2=[0,-f,m],s.pixelsPerMeter2=[g,0,g]}return s}function ln(t){var e=t.width,r=t.height,i=t.pitch,n=function(t){var e=t.width,r=t.height,i=t.altitude,n=void 0===i?1.5:i,o=t.pitch,a=void 0===o?0:o,s=t.nearZMultiplier,l=void 0===s?1:s,u=t.farZMultiplier,c=void 0===u?1:u,h=a*tn,p=Math.atan(.5/n),d=Math.sin(p)*n/Math.sin(Math.PI/2-h-p),f=Math.cos(Math.PI/2-h)*d+n;return{fov:2*Math.atan(r/2/n),aspect:e/r,focalDistance:n,near:l,far:f*c}}({width:e,height:r,altitude:t.altitude,pitch:i,nearZMultiplier:t.nearZMultiplier,farZMultiplier:t.farZMultiplier}),o=n.fov,a=n.aspect,s=n.near,l=n.far;return Yi.fN([],o,a,s,l)}function un(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=Zi(t,3),n=i[0],o=i[1],a=i[2];if(Ji(Number.isFinite(n)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(a))return Hi(e,[n,o,a,1]);var s=Hi(e,[n,o,0,1]),l=Hi(e,[n,o,1,1]),u=s[2],c=l[2],h=u===c?0:((r||0)-u)/(c-u);return Kt.Cc([],s,l,h)}var cn=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],hn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
16,r=e.width,i=e.height,n=e.viewMatrix,o=void 0===n?cn:n,a=e.projectionMatrix,s=void 0===a?cn:a;Si(this,t),this.width=r||1,this.height=i||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=s;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Yi.lw(l,l,this.projectionMatrix),Yi.lw(l,l,this.viewMatrix),this.viewProjectionMatrix=l;var u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Yi.hs(u,u,[this.width/2,-this.height/2,1]),Yi.Tl(u,u,[1,-1,0]),Yi.lw(u,u,this.viewProjectionMatrix);var c=Yi.B8([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],u);if(!c)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=u,this.pixelUnprojectionMatrix=c,this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}return Mi(t,[{key:"equals",value:function(e){return e instanceof t&&(e.width===this.width&&e.height===this.height&&Yi.aI(e.projectionMatrix,this.projectionMatrix)&&Yi.aI(e.viewMatrix,this.viewMatrix))}},{key:"project",value:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,r=void 0===e||e,i=function(t,e){var r=Zi(t,3),i=r[0],n=r[1],o=r[2],a=void 0===o?0:o;return Ji(Number.isFinite(i)&&Number.isFinite(n)&&Number.isFinite(a)),Hi(e,[i,n,a,1])}(this.projectPosition(t),this.pixelProjectionMatrix),n=Zi(i,2),o=n[0],a=n[1],s=r?a:this.height-a;return 2===t.length?[o,s]:[o,s,i[2]]}},{key:"unproject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.topLeft,i=void 0===r||r,n=e.targetZ,o=Zi(t,3),a=o[0],s=o[1],l=o[2],u=i?s:this.height-s,c=n&&n*this.pixelsPerMeter,h=un([a,u,l],this.pixelUnprojectionMatrix,c),p=Zi(this.unprojectPosition(h),3),d=p[0],f=p[1],m=p[2];return Number.isFinite(l)?[d,f,m]:Number.isFinite(n)?[d,f,n]:[d,f]}},{key:"projectPosition",value:function(t){var e=Zi(this.projectFlat(t),2);return[e[0],e[1],(t[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(t){var e=Zi(this.unprojectFlat(t),2);return[e[0],e[1],(t[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(t){arguments.length>1&&void 0!==arguments[1]||this.scale;return t}},{key:"unprojectFlat",value:function(t){arguments.length>1&&void 0!==arguments[1]||this.scale;return t}}]),t}();function pn(t){var e=t.width,r=t.height,i=t.bounds,n=t.minExtent,o=void 0===n?0:n,a=t.maxZoom,s=void 0===a?24:a,l=t.padding,u=void 0===l?0:l,c=t.offset,h=void 0===c?[0,0]:c,p=Zi(i,2),d=Zi(p[0],2),f=d[0],m=d[1],g=Zi(p[1],2),y=g[0],v=g[1];if(Number.isFinite(u)){u={top:u,bottom:u,left:u,right:u}}else Ji(Number.isFinite(u.top)&&Number.isFinite(u.bottom)&&Number.isFinite(u.left)&&Number.isFinite(u.right));var _=new dn({width:e,height:r,longitude:0,latitude:0,zoom:0}),b=_.project([f,v]),x=_.project([y,m]),w=[Math.max(Math.abs(x[0]-b[0]),o),Math.max(Math.abs(x[1]-b[1]),o)],A=[e-u.left-u.right-2*Math.abs(h[0]),r-u.top-u.bottom-2*Math.abs(h[1])];Ji(A[0]>0&&A[1]>0);var E=A[0]/w[0],T=A[1]/w[1],S=(u.right-u.left)/2/E,P=(u.bottom-u.top)/2/T,I=[(x[0]+b[0])/2+S,(x[1]+b[1])/2+P],M=_.unproject(I),C=_.zoom+Math.log2(Math.abs(Math.min(E,T)));return{longitude:M[0],latitude:M[1],zoom:Math.min(C,s)}}var dn=function(t){function e(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.width,n=r.height,o=r.latitude,a=void 0===o?0:o,s=r.longitude,l=void 0===s?0:s,u=r.zoom,c=void 0===u?0:u,h=r.pitch,p=void 0===h?0:h,d=r.bearing,f=void 0===d?0:d,m=r.altitude,g=void 0===m?1.5:m,y=r.nearZMultiplier,v=r.farZMultiplier;Si(this,e),i=i||1,n=n||1;var _=nn(c);g=Math.max(.75,g);var b=on([l,a],_);b[2]=0;var x=ln({width:i,height:n,pitch:p,bearing:f,altitude:g,nearZMultiplier:y||1/n,farZMultiplier:v||1.01}),w=function(t){var e=t.height,r=t.pitch,i=t.bearing,n=t.altitude,o=t.center,a=void 0===o?null:o,s=t.flipY,l=void 0!==s&&s,u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return Yi.Tl(u,u,[0,0,-n]),Yi.hs(u,u,[1,1,1/e]),Yi.eL(u,u,-r*tn),Yi.Qr(u,u,i*tn),l&&Yi.hs(u,u,[1,-1,1]),a&&Yi.Tl(u,u,Ki.ze([],a)),u}
16({height:n,center:b,pitch:p,bearing:f,altitude:g,flipY:!0});return(t=Ri(this,Oi(e).call(this,{width:i,height:n,viewMatrix:w,projectionMatrix:x}))).latitude=a,t.longitude=l,t.zoom=c,t.pitch=p,t.bearing=f,t.altitude=g,t.scale=_,t.center=b,t.pixelsPerMeter=sn(Ci(Ci(t))).pixelsPerMeter[2],Object.freeze(Ci(Ci(t))),t}return Li(e,t),Mi(e,[{key:"projectFlat",value:function(t){return on(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale)}},{key:"unprojectFlat",value:function(t){return an(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale)}},{key:"getMapCenterByLngLatPosition",value:function(t){var e=t.lngLat,r=un(t.pos,this.pixelUnprojectionMatrix),i=on(e,this.scale),n=Kt.WQ([],i,Kt.ze([],r));return an(Kt.WQ([],this.center,n),this.scale)}},{key:"getLocationAtPoint",value:function(t){var e=t.lngLat,r=t.pos;return this.getMapCenterByLngLatPosition({lngLat:e,pos:r})}},{key:"fitBounds",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,n=this.height,o=pn(Object.assign({width:i,height:n,bounds:t},r));return new e({width:i,height:n,longitude:o.longitude,latitude:o.latitude,zoom:o.zoom})}}]),e}(hn);function fn(t){var e;e="undefined"!=typeof window?window:"undefined"!=typeof self?self:r.g;var i="undefined"!=typeof document&&document.attachEvent;if(!i){var n=function(){var t=e.requestAnimationFrame||e.mozRequestAnimationFrame||e.webkitRequestAnimationFrame||function(t){return e.setTimeout(t,20)};return function(e){return t(e)}}(),o=function(){var t=e.cancelAnimationFrame||e.mozCancelAnimationFrame||e.webkitCancelAnimationFrame||e.clearTimeout;return function(e){return t(e)}}(),a=function(t){var e=t.__resizeTriggers__,r=e.firstElementChild,i=e.lastElementChild,n=r.firstElementChild;i.scrollLeft=i.scrollWidth,i.scrollTop=i.scrollHeight,n.style.width=r.offsetWidth+1+"px",n.style.height=r.offsetHeight+1+"px",r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight},s=function(t){if(!(t.target.className.indexOf("contract-trigger")<0&&t.target.className.indexOf("expand-trigger")<0)){var e=this;a(this),this.__resizeRAF__&&o(this.__resizeRAF__),this.__resizeRAF__=n((function(){(function(t){return t.offsetWidth!=t.__resizeLast__.width||t.offsetHeight!=t.__resizeLast__.height})(e)&&(e.__resizeLast__.width=e.offsetWidth,e.__resizeLast__.height=e.offsetHeight,e.__resizeListeners__.forEach((function(r){r.call(e,t)})))}))}},l=!1,u="",c="animationstart",h="Webkit Moz O ms".split(" "),p="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),d=document.createElement("fakeelement");if(void 0!==d.style.animationName&&(l=!0),!1===l)for(var f=0;f<h.length;f++)if(void 0!==d.style[h[f]+"AnimationName"]){u="-"+h[f].toLowerCase()+"-",c=p[f],l=!0;break}var m="resizeanim",g="@"+u+"keyframes "+m+" { from { opacity: 0; } to { opacity: 0; } } ",y=u+"animation: 1ms "+m+"; "}return{addResizeListener:function(r,n){if(i)r.attachEvent("onresize",n);else{if(!r.__resizeTriggers__){var o=r.ownerDocument,l=e.getComputedStyle(r);l&&"static"==l.position&&(r.style.position="relative"),function(e){if(!e.getElementById("detectElementResize")){var r=(g||"")+".resize-triggers { "+(y||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',i=e.head||e.getElementsByTagName("head")[0],n=e.createElement("style");n.id="detectElementResize",n.type="text/css",null!=t&&n.setAttribute("nonce",t),n.styleSheet?n.styleSheet.cssText=r:n.appendChild(e.createTextNode(r)),i.appendChild(n)}}(o),r.__resizeLast__={},r.__resizeListeners__=[],(r.__resizeTriggers__=o.createElement("div")).className="resize-triggers",r.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',r.appendChild(r.__resizeTriggers__),a(r),r.addEventListener("scroll",s,!0),c&&(r.__resizeTriggers__.__animationListener__=function(t){t.animationName==m&&a(r)},r.__resizeTriggers__.addEventListener(c,r.__resizeTriggers__.__animationListener__))}r.__resizeListeners__.push(n)}},removeResizeListener:function(t,e){if(i)t.detachEvent("onresize",e);else if(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),!t.__resizeListeners__.length){t.removeEventListener("scroll",s,!0),t.__resizeTriggers__.__animationListener__&&(t.__resizeTriggers__.removeEventListener(c,t.__resizeTriggers__.__animationListener__),t.__resizeTriggers__.__animationListener__=null);try{t.__resizeTriggers__=!t.removeChild(t.__resizeTriggers__)}catch(t){}}}}}var mn=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),gn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},yn=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},vn=function(t){function e(){var t,r,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];return r=i=yn(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(o))),i.state={height:i.props.defaultHeight||0,width:i.props.defaultWidth||0},i._onResize=function(){var t=i.props,e=t.disableHeight,r=t.disableWidth,n=t.onResize;if(i._parentNode){var o=i._parentNode.offsetHeight||0,a=i._parentNode.offsetWidth||0,s=window.getComputedStyle(i._parentNode)||{},l=parseInt(s.paddingLeft,10)||0,u=parseInt(s.paddingRight,10)||0,c=parseInt(s.paddingTop,10)||0,h=parseInt(s.paddingBottom,10)||0,p=o-c-h,d=a-l-u;(!e&&i.state.height!==p||!r&&i.state.width!==d)&&(i.setState({height:o-c-
16h,width:a-l-u}),n({height:o,width:a}))}},i._setRef=function(t){i._autoSizer=t},yn(i,r)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),mn(e,[{key:"componentDidMount",value:function(){var t=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._detectElementResize=fn(t),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())}},{key:"componentWillUnmount",value:function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}},{key:"render",value:function(){var t=this.props,e=t.children,r=t.className,n=t.disableHeight,o=t.disableWidth,a=t.style,s=this.state,l=s.height,u=s.width,c={overflow:"visible"},h={},p=!1;return n||(0===l&&(p=!0),c.height=0,h.height=l),o||(0===u&&(p=!0),c.width=0,h.width=u),(0,i.createElement)("div",{className:r,ref:this._setRef,style:gn({},c,a)},!p&&e(h))}}]),e}(i.PureComponent);vn.defaultProps={onResize:function(){},disableHeight:!1,disableWidth:!1,style:{}};const _n=vn;"undefined"!=typeof window?window:r.g,"undefined"!=typeof r.g?r.g:window;var bn="undefined"!=typeof document?document:{};var xn={container:Bi().object,gl:Bi().object,mapboxApiAccessToken:Bi().string,mapboxApiUrl:Bi().string,attributionControl:Bi().bool,preserveDrawingBuffer:Bi().bool,reuseMaps:Bi().bool,transformRequest:Bi().func,mapOptions:Bi().object,mapStyle:Bi().oneOfType([Bi().string,Bi().object]),visible:Bi().bool,asyncRender:Bi().bool,onLoad:Bi().func,onError:Bi().func,width:Bi().number,height:Bi().number,viewState:Bi().object,longitude:Bi().number,latitude:Bi().number,zoom:Bi().number,bearing:Bi().number,pitch:Bi().number,altitude:Bi().number},wn={container:bn.body,mapboxApiAccessToken:function(){var t=null;if("undefined"!=typeof window&&window.location){var e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||"undefined"==typeof process||(t=t||process.env.MapboxAccessToken||process.env.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),mapboxApiUrl:"https://api.mapbox.com",preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:function(){},onError:function(t){t&&console.error(t.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0,altitude:1.5};function An(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"component";t.debug&&Bi().checkPropTypes(xn,t,"prop",e)}var En=function(){function t(e){var r=this;if(Si(this,t),(0,o.A)(this,"mapboxgl",void 0),(0,o.A)(this,"props",wn),(0,o.A)(this,"_map",null),(0,o.A)(this,"width",0),(0,o.A)(this,"height",0),(0,o.A)(this,"_fireLoadEvent",(function(){r.props.onLoad({type:"load",target:r._map})})),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,t.initialized||(t.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}return Mi(t,[{key:"finalize",value:function(){return this._destroy(),this}},{key:"setProps",value:function(t){return this._update(this.props,t),this}},{key:"resize",value:function(){return this._map.resize(),this}},{key:"redraw",value:function(){var t=this._map;t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}},{key:"getMap",value:function(){return this._map}},{key:"_reuse",value:function(e){this._map=t.savedMap;var r=this._map.getContainer(),i=e.container;for(i.classList.add("mapboxgl-map");r.childNodes.length>0;)i.appendChild(r.childNodes[0]);this._map._container=i,t.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!1}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}},{key:"_create",value:function(e){if(e.reuseMaps&&t.savedMap)this._reuse(e);else{if(e.gl){var r=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(){return HTMLCanvasElement.prototype.getContext=r,e.gl}}var i={container:e.container,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:e.mapStyle,interactive:!1,trackResize:!1,attributionControl:e.attributionControl,preserveDrawingBuffer:e.preserveDrawingBuffer};e.transformRequest&&(i.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},i,e.mapOptions)),this._map.once("load",e.onLoad),this._map.on("error",e.onError)}return this}},{key:"_destroy",value:function(){this._map&&(t.savedMap?this._map.remove():(t.savedMap=this._map,this._map.off("load",this.props.onLoad),this._map.off("error",this.props.onError),this._map.off("styledata",this._fireLoadEvent)),this._map=null)}},{key:"_initialize",value:function(t){var e=this;An(t=Object.assign({},wn,t),"Mapbox"),this.mapboxgl.accessToken=t.mapboxApiAccessToken||wn.mapboxApiAccessToken,this.mapboxgl.baseApiUrl=t.mapboxApiUrl,this._create(t);var r=t.container;Object.defineProperty(r,"offsetWidth",{configurable:!0,get:function(){return e.width}}),Object.defineProperty(r,"clientWidth",{configurable:!0,get:function(){return e.width}}),Object.defineProperty(r,"offsetHeight",{configurable:!0,get:function(){return e.height}}),Object.defineProperty(r,"clientHeight",{configurable:!0,get:function(){return e.height}});var i=this._map.getCanvas();i&&(i.style.outline="none"),this._updateMapViewport({},t),this._updateMapSize({},t),this.props=t}},{key:"_update",value:function(t,e){if(this._map){An(e=Object.assign({},this.props,e),"Mapbox");var r=this._updateMapViewport(t,e),i=this._updateMapSize(t,e);e.asyncRender||!r&&!i||this.redraw(),this.props=e}}},{key:"_updateMapSize",value:function(t,e){var r=t.width!==e.width||t.height!==e.height;return r&&(this.width=e.width,this.height=e.height,this.resize()),r}},{key:"_updateMapViewport",value:function(t,e){var r=this._getViewState(t),i=this._getViewState(e),n=i.latitude!==r.latitude||i.longitude!==r.longitude||i.zoom!==r.zoom||i.pitch!==r.pitch||i.bearing!==r.bearing||i.alt
16itude!==r.altitude;return n&&(this._map.jumpTo(this._viewStateToMapboxProps(i)),i.altitude!==r.altitude&&(this._map.transform.altitude=i.altitude)),n}},{key:"_getViewState",value:function(t){var e=t.viewState||t,r=e.longitude,i=e.latitude,n=e.zoom,o=e.pitch,a=void 0===o?0:o,s=e.bearing,l=void 0===s?0:s,u=e.altitude;return{longitude:r,latitude:i,zoom:n,pitch:a,bearing:l,altitude:void 0===u?1.5:u}}},{key:"_checkStyleSheet",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0.47.0";if("undefined"!=typeof bn)try{var e=bn.createElement("div");if(e.className="mapboxgl-map",e.style.display="none",bn.body.appendChild(e),!("static"!==window.getComputedStyle(e).position)){var r=bn.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v".concat(t,"/mapbox-gl.css")),bn.head.appendChild(r)}}catch(t){}}},{key:"_viewStateToMapboxProps",value:function(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}}}]),t}();(0,o.A)(En,"initialized",!1),(0,o.A)(En,"propTypes",xn),(0,o.A)(En,"defaultProps",wn),(0,o.A)(En,"savedMap",null);var Tn=r(52675),Sn=r.n(Tn),Pn=85.05113,In=-85.05113;function Mn(t,e,r){return Math.max(e,Math.min(r,t))}function Cn(t,e){if(!t)throw new Error(e||"react-map-gl: assertion failed.")}var kn={minZoom:0,maxZoom:24,minPitch:0,maxPitch:60},Ln=0,zn=0,Rn=1.5;!function(){function t(e){var r=e.width,i=e.height,n=e.latitude,a=e.longitude,s=e.zoom,l=e.bearing,u=void 0===l?zn:l,c=e.pitch,h=void 0===c?Ln:c,p=e.altitude,d=void 0===p?Rn:p,f=e.maxZoom,m=void 0===f?kn.maxZoom:f,g=e.minZoom,y=void 0===g?kn.minZoom:g,v=e.maxPitch,_=void 0===v?kn.maxPitch:v,b=e.minPitch,x=void 0===b?kn.minPitch:b,w=e.transitionDuration,A=e.transitionEasing,E=e.transitionInterpolator,T=e.transitionInterruption,S=e.startPanLngLat,P=e.startZoomLngLat,I=e.startBearing,M=e.startPitch,C=e.startZoom;Si(this,t),(0,o.A)(this,"_viewportProps",void 0),(0,o.A)(this,"_interactiveState",void 0),Cn(Number.isFinite(r),"`width` must be supplied"),Cn(Number.isFinite(i),"`height` must be supplied"),Cn(Number.isFinite(a),"`longitude` must be supplied"),Cn(Number.isFinite(n),"`latitude` must be supplied"),Cn(Number.isFinite(s),"`zoom` must be supplied"),this._viewportProps=this._applyConstraints({width:r,height:i,latitude:n,longitude:a,zoom:s,bearing:u,pitch:h,altitude:d,maxZoom:m,minZoom:y,maxPitch:_,minPitch:x,transitionDuration:w,transitionEasing:A,transitionInterpolator:E,transitionInterruption:T}),this._interactiveState={startPanLngLat:S,startZoomLngLat:P,startBearing:I,startPitch:M,startZoom:C}}Mi(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(t){var e=t.pos;return this._getUpdatedMapState({startPanLngLat:this._unproject(e)})}},{key:"pan",value:function(t){var e=t.pos,r=t.startPos,i=this._interactiveState.startPanLngLat||this._unproject(r);if(!i)return this;var n=Zi(this._calculateNewLngLat({startPanLngLat:i,pos:e}),2),o=n[0],a=n[1];return this._getUpdatedMapState({longitude:o,latitude:a})}},{key:"panEnd",value:function(){return this._getUpdatedMapState({startPanLngLat:null})}},{key:"rotateStart",value:function(t){t.pos;return this._getUpdatedMapState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(t){var e=t.deltaScaleX,r=void 0===e?0:e,i=t.deltaScaleY,n=void 0===i?0:i,o=this._interactiveState,a=o.startBearing,s=o.startPitch;if(!Number.isFinite(a)||!Number.isFinite(s))return this;var l=this._calculateNewPitchAndBearing({deltaScaleX:r,deltaScaleY:n,startBearing:a||0,startPitch:s||0}),u=l.pitch,c=l.bearing;return this._getUpdatedMapState({bearing:c,pitch:u})}},{key:"rotateEnd",value:function(){return this._getUpdatedMapState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(t){var e=t.pos;return this._getUpdatedMapState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(t){var e=t.pos,r=t.startPos,i=t.scale;Cn(i>0,"`scale` must be a positive number");var n=this._interactiveState,o=n.startZoom,a=n.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,a=this._unproject(r)||this._unproject(e)),Cn(a,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var s=this._calculateNewZoom({scale:i,startZoom:o||0}),l=Zi(new dn(Object.assign({},this._viewportProps,{zoom:s})).getMapCenterByLngLatPosition({lngLat:a,pos:e}),2),u=l[0],c=l[1];
16return this._getUpdatedMapState({zoom:s,longitude:u,latitude:c})}},{key:"zoomEnd",value:function(){return this._getUpdatedMapState({startZoomLngLat:null,startZoom:null})}},{key:"_getUpdatedMapState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(t){var e=t.maxZoom,r=t.minZoom,i=t.zoom;t.zoom=Mn(i,r,e);var n=t.maxPitch,o=t.minPitch,a=t.pitch;return t.pitch=Mn(a,o,n),Object.assign(t,function(t){var e=t.width,r=t.height,i=t.longitude,n=t.latitude,o=t.zoom,a=t.pitch,s=void 0===a?0:a,l=t.bearing,u=void 0===l?0:l;(i<-180||i>180)&&(i=Xi(i+180,360)-180),(u<-180||u>180)&&(u=Xi(u+180,360)-180);var c=new dn({width:e,height:r,longitude:i,latitude:n,zoom:o}),h=c.project([i,Pn])[1],p=c.project([i,In])[1],d=0;return p-h<r&&(o+=Math.log2(r/(p-h)),h=(c=new dn({width:e,height:r,longitude:i,latitude:n,zoom:o})).project([i,Pn])[1],p=c.project([i,In])[1]),h>0?d=h:p<r&&(d=p-r),d&&(n=c.unproject([e/2,r/2+d])[1]),{width:e,height:r,longitude:i,latitude:n,zoom:o,pitch:s,bearing:u}}(t)),t}},{key:"_unproject",value:function(t){var e=new dn(this._viewportProps);return t&&e.unproject(t)}},{key:"_calculateNewLngLat",value:function(t){var e=t.startPanLngLat,r=t.pos;return new dn(this._viewportProps).getMapCenterByLngLatPosition({lngLat:e,pos:r})}},{key:"_calculateNewZoom",value:function(t){var e=t.scale,r=t.startZoom,i=this._viewportProps,n=i.maxZoom,o=i.minZoom;return Mn(r+Math.log2(e),o,n)}},{key:"_calculateNewPitchAndBearing",value:function(t){var e=t.deltaScaleX,r=t.deltaScaleY,i=t.startBearing,n=t.startPitch;r=Mn(r,-1,1);var o=this._viewportProps,a=o.minPitch,s=o.maxPitch,l=n;return r>0?l=n+r*(s-n):r<0&&(l=n-r*(a-n)),{pitch:l,bearing:i+180*e}}}])}();function On(t){return t[0].toLowerCase()+t.slice(1)}const Dn=(0,i.createContext)({viewport:null,map:null,mapContainer:null,onViewportChange:null,onViewStateChange:null,eventManager:null,isDragging:!1});function Bn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function Fn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Bn(Object(r),!0).forEach((function(e){(0,o.A)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Bn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function jn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=Oi(t);if(e){var n=Oi(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return Ri(this,r)}}var Nn="A valid API access token is required to use Mapbox data";var Un={position:"absolute",width:"100%",height:"100%",overflow:"hidden"},Vn=Object.assign({},En.propTypes,{width:Bi().oneOfType([Bi().number,Bi().string]),height:Bi().oneOfType([Bi().number,Bi().string]),onResize:Bi().func,preventStyleDiffing:Bi().bool,disableTokenWarning:Bi().bool,visible:Bi().bool,className:Bi().string,style:Bi().object,visibilityConstraints:Bi().object}),qn=Object.assign({},En.defaultProps,{preventStyleDiffing:!1,disableTokenWarning:!1,visible:!0,onResize:function(){},className:"",style:null,visibilityConstraints:kn});function Gn(t){t.target.scrollTo(0,0)}var Zn=function(t){Li(r,t);var e=jn(r);function r(){var t;Si(this,r);for(var n=arguments.length,a=new Array(n),s=0;s<n;s++)a[s]=arguments[s];return t=e.call.apply(e,[this].concat(a)),(0,o.A)(Ci(t),"state",{accessTokenInvalid:!1}),(0,o.A)(Ci(t),"_mapbox",null),(0,o.A)(Ci(t),"_map",null),(0,o.A)(Ci(t),"_mapboxMapRef",(0,i.createRef)()),(0,o.A)(Ci(t),"_mapContainerRef",(0,i.createRef)()),(0,o.A)(Ci(t),"_queryParams",{}),(0,o.A)(Ci(t),"_width",0),(0,o.A)(Ci(t),"_height",0),(0,o.A)(Ci(t),"getMap",(function(){return t._map})),(0,o.A)(Ci(t),"queryRenderedFeatures",(function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t._map.queryRenderedFeatures(e,r)})),(0,o.A)(Ci(t),"_mapboxMapError",(function(e){401!==(e.error&&e.error.status||e.status)||t.state.accessTokenInvalid||(console.error(Nn),t.setState({accessTokenInvalid:!0})),t.props.onError(e)})),t}
16return Mi(r,[{key:"componentDidMount",value:function(){if(r.supported()){var t=this.props.mapStyle;this._mapbox=new En(Object.assign({},this.props,{mapboxgl:Sn(),width:this._width,height:this._height,container:this._mapboxMapRef.current,onError:this._mapboxMapError,mapStyle:qi(t)})),this._map=this._mapbox.getMap()}}},{key:"componentDidUpdate",value:function(t){this._mapbox&&(this._updateMapStyle(t,this.props),this._updateMapProps(this.props))}},{key:"componentWillUnmount",value:function(){this._mapbox&&(this._mapbox.finalize(),this._mapbox=null,this._map=null)}},{key:"_updateMapSize",value:function(t,e){this._width===t&&this._height===e||(this._width=t,this._height=e,this._updateMapProps(this.props))}},{key:"_updateMapStyle",value:function(t,e){var r=e.mapStyle;r!==t.mapStyle&&r&&this._map.setStyle(qi(r),{diff:!this.props.preventStyleDiffing})}},{key:"_updateMapProps",value:function(t){this._mapbox&&this._mapbox.setProps(Object.assign({},t,{width:this._width,height:this._height}))}},{key:"_renderNoTokenWarning",value:function(){if(this.state.accessTokenInvalid&&!this.props.disableTokenWarning){return i.createElement("div",{key:"warning",id:"no-token-warning",style:{position:"absolute",left:0,top:0}},i.createElement("h3",{key:"header"},Nn),i.createElement("div",{key:"text"},"For information on setting up your basemap, read"),i.createElement("a",{key:"link",href:"https://visgl.github.io/react-map-gl/docs/get-started/mapbox-tokens"},"Note on Map Tokens"))}return null}},{key:"_renderOverlays",value:function(t){var e=this,r=t.width,n=t.height;return this._updateMapSize(r,n),i.createElement(Dn.Consumer,null,(function(t){var o=Fn(Fn({},t),{},{viewport:new dn(Fn(Fn(Fn({},e.props),e.props.viewState),{},{width:r,height:n})),map:e._map,mapContainer:t.mapContainer||e._mapContainerRef.current});return i.createElement(Dn.Provider,{value:o},i.createElement("div",{key:"map-overlays",className:"overlays",style:Un,onScroll:Gn},e.props.children))}))}},{key:"render",value:function(){var t=this.props,e=t.className,r=t.width,n=t.height,o=t.style,a=t.visibilityConstraints,s=Object.assign({position:"relative"},o,{width:r,height:n}),l=this.props.visible&&function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kn;for(var r in e){var i=r.slice(0,3),n=On(r.slice(3));if("min"===i&&t[n]<e[r])return!1;if("max"===i&&t[n]>e[r])return!1}return!0}(this.props.viewState||this.props,a),u=Object.assign({},Un,{visibility:l?"inherit":"hidden"});return i.createElement("div",{key:"map-container",style:s,ref:this._mapContainerRef},i.createElement("div",{key:"map-mapbox",ref:this._mapboxMapRef,style:u,className:e}),i.createElement(_n,{key:"autosizer",onResize:this.props.onResize},this._renderOverlays.bind(this)),this._renderNoTokenWarning())}}],[{key:"supported",value:function(){return Sn()&&Sn().supported()}}]),r}(i.PureComponent);(0,o.A)(Zn,"propTypes",Vn),(0,o.A)(Zn,"defaultProps",qn);const Wn="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function Hn(t,e){for(;t;){if(t===e)return!0;t=Object.getPrototypeOf(t)}return!1}var Xn=r(28208);const Yn={position:"absolute",zIndex:-1};function Kn(t,e){if("function"==typeof t)return t(e);if(Array.isArray(t))return t.map((t=>Kn(t,e)));if(Jn(t)){if(function(t){const e=t.type,r=e&&e.defaultProps;return r&&r.mapStyle}(t))return e.style=Yn,(0,i.cloneElement)(t,e);if(function(t){const e=t.type;return e&&e.deckGLViewProps}(t))return(0,i.cloneElement)(t,e)}return t}function Jn(t){return t&&"object"==typeof t&&"type"in t||!1}function Qn(t){if("function"==typeof t)return(0,i.createElement)(Y,{},t);if(Array.isArray(t))return t.map(Qn);if(Jn(t)){if(t.type===i.Fragment)return Qn(t.props.children);if(Hn(t.type,Y))return t}return t}const $n={mixBlendMode:null};function to(t){t.redrawReason&&(t.deck._drawLayers(t.redrawReason),t.redrawReason=null)}const eo=(0,i.forwardRef)(((t,e)=>{const[r,n]=(0,i.useState)(0),o=(0,i.useRef)({control:null,version:r,forceUpdate:()=>n((t=>t+1))}).current,a=(0,i.useRef)(null),s=(0,i.useRef)(null),l=(0,i.useMemo)((()=>function(t){let{children:e,layers:r=[],views:n=null}=t;const o=[],a=[],s={};
vendor: 3,300 bytes, line 16
16return i.Children.forEach(Qn(e),(t=>{if(Jn(t)){const e=t.type;if(Hn(e,Xn.A)){const r=function(t,e){const r={},i=t.defaultProps||{};for(const t in e)i[t]!==e[t]&&(r[t]=e[t]);return new t(r)}(e,t.props);a.push(r)}else o.push(t);if(Hn(e,Y)&&e!==Y&&t.props.id){const r=new e(t.props);s[r.id]=r}}else t&&o.push(t)})),Object.keys(s).length>0&&(Array.isArray(n)?n.forEach((t=>{s[t.id]=t})):n&&(s[n.id]=n),n=Object.values(s)),r=a.length>0?[...a,...r]:r,{layers:r,children:o,views:n}}(t)),[t.layers,t.views,t.children]);let u=!0;const c=e=>{var r;return u&&t.viewState?(o.viewStateUpdateRequested=e,null):(o.viewStateUpdateRequested=null,null===(r=t.onViewStateChange)||void 0===r?void 0:r.call(t,e))},h=e=>{var r;u?o.interactionStateUpdateRequested=e:(o.interactionStateUpdateRequested=null,null===(r=t.onInteractionStateChange)||void 0===r||r.call(t,e))},p=(0,i.useMemo)((()=>{const e={...t,style:null,width:"100%",height:"100%",parent:a.current,canvas:s.current,layers:l.layers,views:l.views,onViewStateChange:c,onInteractionStateChange:h};return delete e._customRender,o.deck&&o.deck.setProps(e),e}),[t]);(0,i.useEffect)((()=>{const e=t.Deck||Kr;return o.deck=function(t,e,r){const i=new e({...r,_customRender:e=>{t.redrawReason=e;const r=i.getViewports();t.lastRenderedViewports!==r?t.forceUpdate():to(t)}});return i}(o,e,{...p,parent:a.current,canvas:s.current}),()=>{var t;return null===(t=o.deck)||void 0===t?void 0:t.finalize()}}),[]),Wn((()=>{to(o);const{viewStateUpdateRequested:t,interactionStateUpdateRequested:e}=o;t&&c(t),e&&h(e)})),(0,i.useImperativeHandle)(e,(()=>function(t){return{get deck(){return t.deck},pickObject:e=>t.deck.pickObject(e),pickMultipleObjects:e=>t.deck.pickMultipleObjects(e),pickObjects:e=>t.deck.pickObjects(e)}}(o)),[]);const d=o.deck&&o.deck.isInitialized?o.deck.getViewports():void 0,{ContextProvider:f,width:m,height:g,id:y,style:v}=t,{containerStyle:_,canvasStyle:b}=(0,i.useMemo)((()=>function(t){let{width:e,height:r,style:i}=t;const n={position:"absolute",zIndex:0,left:0,top:0,width:e,height:r},o={left:0,top:0};if(i)for(const t in i)t in $n?o[t]=i[t]:n[t]=i[t];return{containerStyle:n,canvasStyle:o}}({width:m,height:g,style:v})),[m,g,v]);if(!o.viewStateUpdateRequested&&o.lastRenderedViewports===d||o.version!==r){o.lastRenderedViewports=d,o.version=r;const t=function(t){let{children:e,deck:r,ContextProvider:n}=t;const{viewManager:o}=r||{};if(!o||!o.views.length)return[];const a={},s=o.views[0].id;for(const t of e){let e=s,r=t;Jn(t)&&Hn(t.type,Y)&&(e=t.props.id||s,r=t.props.children);const i=o.getViewport(e),n=o.getViewState(e);if(i){const{x:t,y:o,width:s,height:l}=i;r=Kn(r,{x:t,y:o,width:s,height:l,viewport:i,viewState:n}),a[e]||(a[e]={viewport:i,children:[]}),a[e].children.push(r)}}return Object.keys(a).map((t=>{const{viewport:e,children:o}=a[t],{x:s,y:l,width:u,height:c}=e,h={position:"absolute",left:s,top:l,width:u,height:c},p="view-".concat(t),d=(0,i.createElement)("div",{key:p,id:p,style:h},...o);if(n){const o={viewport:e,container:r.canvas.offsetParent,eventManager:r.eventManager,onViewStateChange:e=>{e.viewId=t,r._onViewStateChange(e)}};return(0,i.createElement)(n,{key:p,value:o},d)}return d}))}({children:l.children,deck:o.deck,ContextProvider:f}),e=(0,i.createElement)("canvas",{key:"canvas",id:y||"deckgl-overlay",ref:s,style:b});
16o.control=(0,i.createElement)("div",{id:"".concat(y||"deckgl","-wrapper"),ref:a,style:_},[e,t])}return u=!1,o.control}));eo.defaultProps=Kr.defaultProps;const ro=eo;var io=r(54348),no=r.n(io);const oo="https://tc2.uber.com/style/santurce/web?o=DEFAULT",ao=`${oo}&mode=night`,so="https://tc2.uber.com/style/santurce-eats/web?o=DEFAULT",lo=`${so}&mode=night`,uo={version:8,sources:{},layers:[{id:"background-layer",type:"background",paint:{"background-color":"#EEEEEE"}}]};var co=r(88013);function ho(t,e){(0,i.useEffect)((()=>{let e=t?.getMap();e&&e.once("styledata",(t=>{!function(t,e,r){let i=function(t){return t?["string",["get",`name_${t}`],["get","name"]," "]:["string",["get","name"]," "]}(t);for(let t of e.layers)t.layout&&"{name}"==t.layout["text-field"]&&r.setLayoutProperty(t.id,"text-field",i)}(navigator.language?.split("-")[0],t.style.stylesheet,t.target)}))}),[t,e])}const po=Sn()?Sn().setRTLTextPlugin:function(){};var fo=r(99511);function mo(t){const{viewState:e,onViewStateChange:n,layers:o,overlays:a,onClick:s,onHover:l,onError:u,onLoad:c,styleFlavor:h,tiles:p,overrides:d,theme:m}=t,[g,y]=(0,i.useState)(null),v=(0,i.useRef)();(0,i.useEffect)((()=>{v.current&&(v.current=e)}),[e]);!function(t,e,r){(0,i.useEffect)((()=>{if(!t)return;const i=t.getMap();if(i)i.on("idle",e);else if(r){const t=(0,co.y)();r({name:"mapbox-gl-error",payload:{message:String(t)}})}return()=>{i&&i.off("idle",e)}}),[t,e,r])}(g,(0,i.useCallback)((()=>{v.current&&n&&n(v.current)}),[n]),u);const _=(0,i.useMemo)((()=>function(t){let{onError:e}=t;return function(t,r){const{error:i,sourceId:n,type:o}=t,a={name:"react-map-gl-error",payload:{type:o,sourceId:n,message:i?.message,name:i?.name,status:i?.status?String(i.status):"",url:i?.url??no()?.location?.href??"",latitude:r?.latitude,longitude:r?.longitude,zoom:r?.zoom,stack:i?.stack}};e&&e(a),console.error(a)}}({onError:u})),[u]),b=(0,i.useMemo)((()=>yi({onError:u})),[u]),x=d?.mapStyle||function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_i.light;return"shibuya"===t?r===_i.dark?"https://tc2.uber.com/style/shibuya/web?mode=night&o=DEFAULT":"https://tc2.uber.com/style/shibuya/web?mode=default&o=DEFAULT":"tmap"===t?"https://u-vsm.tmobiapi.com/styles/base/v6/style.json":"empty"===t?uo:[vi.eats,vi.eatsPickup].includes(e)?r===_i.dark?lo:so:r===_i.dark?ao:oo}(p,h,m);ho(g,p),(0,i.useEffect)((()=>{try{po((0,fo.uq)(r(62547)),null,!0)}catch(t){if("setRTLTextPlugin cannot be called multiple times."===t.message)return;throw t}}),[]);const w=(0,i.useCallback)((t=>{let{isDragging:e}=t;const r=d?.engineInterface?.defaultCursor||"grab";return n?e?d?.engineInterface?.draggingCursor||"grabbing":r:d?.engineInterface?.defaultCursor||"default"}),[d?.engineInterface?.defaultCursor,d?.engineInterface?.draggingCursor,n]);return(0,f.FD)(ro,{style:{pointerEvents:n?"all":"none"},getCursor:w,initialViewState:{bearing:0,pitch:0,position:[0,0,0],...e},onViewStateChange:t=>{let{viewState:e}=t;return v.current=e},controller:Boolean(n),layers:o,onClick:s,onHover:l,onError:(t,r)=>b(t,r,e),children:[(0,f.Y)(Zn,{ref:y,mapStyle:x,mapboxApiAccessToken:d?.mapboxApiAccessToken,onError:t=>_(t,e),onLoad:c}),t=>{let{viewport:e}=t;return(0,f.Y)(gi,{viewport:e,overlays:a})}]})}var go=r(63515),yo=r(73569),vo=r(84202),_o=r(80072),bo=r(65712);const xo="18px";function wo(t){let{icon:e}=t;return e?(0,f.Y)(e,{size:xo}):(0,f.Y)(vo.A,{size:xo})}function Ao(t){const[e,r]=(0,n.c6)(),{onClickLocateMe:i,onClickZoomIn:o,onClickZoomOut:a,isLoadingLocation:s,onViewStateChange:l,overrides:u}=t;if(!i&&!o&&!a)return null;const c={container:{position:"absolute",display:"grid",gridTemplateColumns:"1fr",gap:"8px",bottom:r.sizing.scale600,right:r.sizing.scale600},base:{backgroundColor:r.colors.backgroundPrimary,padding:0,height:"40px",width:"40px"},single:{boxShadow:r.lighting.shadow600},group:{display:"flex",flexDirection:"column",borderRadius:"8px",overflow:"hidden",boxShadow:r.lighting.shadow600},groupDivider:{height:"2px",background:r.colors.borderOpaque}};return(0,f.FD)("div",{className:e(c.container),children:[i&&(0,f.Y)(go.A,{disabled:!l,onClick:i,shape:yo.IW.circle,kind:yo.Nd.tertiary,isLoading:s,type:"button","aria-label":u?.ariaLabels?.locateMe,overrides:{BaseButton:{style:{...c.base,...c.single,...u?.LocateMeButton?.style}}},name:"maps-sdk-map-controls-locate-me",children:(0,f.Y)(wo,{icon:u?.LocateMeButton?.icon})}),o&&a&&(0,f.FD)("div",{className:e(c.group),children:[(0,f.Y)(go.A,{disabled:!l,onClick:o,kind:yo.Nd.tertiary,type:"button","aria-label":u?.ariaLabels?.zoomIn,overrides:{BaseButton:{style:{...c.base,borderBottomLeftRadius:0,borderBottomRightRadius:0}}},name:"maps-sdk-map-controls-zoom-in",children:(0,f.Y)(_o.A,{size:xo})}),(0,f.Y)("div",{className:e(c.groupDivider)}),(0,f.Y)(go.A,{disabled:!l,onClick:a,kind:yo.Nd.tertiary,type:"button","aria-label":u?.ariaLabels?.zoomOut,overrides:{BaseButton:{style:{...c.base,borderTopLeftRadius:0,borderTopRightRadius:0}}},name:"maps-sdk-map-controls-zoom-out",children:(0,f.Y)(bo.A,{size:xo})})]})]})}function Eo(t,e,r){var i=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var n=0,o=e.length-1;n<e.length;o=n++){var a=e[n][0],s=e[n][1],l=e[o][0],u=e[o][1];if(t[1]*(a-l)+s*(l-t[0])+u*(t[0]-a)==0&&(a-t[0])*(l-t[0])<=0&&(s-t[1])*(u-t[1])<=0)return!r;s>t[1]!=u>t[1]&&t[0]<(l-a)*(t[1]-s)/(u-s)+a&&(i=!i)}return i}const To=function(t,e,r){if("object"!=typeof(r=r||{}
16))throw new Error("options is invalid");var i=r.ignoreBoundary;if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var n=function(t){if(!t)throw new Error("coord is required");if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates;if(Array.isArray(t)&&t.length>=2&&void 0===t[0].length&&void 0===t[1].length)return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}(t),o=function(t){if(!t)throw new Error("coords is required");if("Feature"===t.type&&null!==t.geometry)return t.geometry.coordinates;if(t.coordinates)return t.coordinates;if(Array.isArray(t))return t;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(e),a=e.geometry?e.geometry.type:e.type,s=e.bbox;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(n,s))return!1;"Polygon"===a&&(o=[o]);for(var l=0,u=!1;l<o.length&&!u;l++)if(Eo(n,o[l][0],i)){for(var c=!1,h=1;h<o[l].length&&!c;)Eo(n,o[l][h],!i)&&(c=!0),h++;c||(u=!0)}return u},So={AZ:{type:"Feature",id:"AZE",properties:{name:"Azerbaijan"},geometry:{type:"MultiPolygon",coordinates:[[[[45.001987,39.740004],[45.298145,39.471751],[45.739978,39.473999],[45.735379,39.319719],[46.143623,38.741201],[45.457722,38.874139],[44.952688,39.335765],[44.79399,39.713003],[45.001987,39.740004]]],[[[47.373315,41.219732],[47.815666,41.151416],[47.987283,41.405819],[48.584353,41.80887],[49.110264,41.282287],[49.618915,40.572924],[50.08483,40.526157],[50.392821,40.256561],[49.569202,40.176101],[49.395259,39.399482],[49.223228,39.049219],[48.856532,38.815486],[48.883249,38.320245],[48.634375,38.270378],[48.010744,38.794015],[48.355529,39.288765],[48.060095,39.582235],[47.685079,39.508364],[46.50572,38.770605],[46.483499,39.464155],[46.034534,39.628021],[45.610012,39.899994],[45.891907,40.218476],[45.359175,40.561504],[45.560351,40.81229],[45.179496,40.985354],[44.97248,41.248129],[45.217426,41.411452],[45.962601,41.123873],[46.501637,41.064445],[46.637908,41.181673],[46.145432,41.722802],[46.404951,41.860675],[46.686071,41.827137],[47.373315,41.219732]]]]}},BD:{type:"Feature",id:"BGD",properties:{name:"Bangladesh"},geometry:{type:"Polygon",coordinates:[[[92.672721,22.041239],[92.652257,21.324048],[92.303234,21.475485],[92.368554,20.670883],[92.082886,21.192195],[92.025215,21.70157],[91.834891,22.182936],[91.417087,22.765019],[90.496006,22.805017],[90.586957,22.392794],[90.272971,21.836368],[89.847467,22.039146],[89.70205,21.857116],[89.418863,21.966179],[89.031961,22.055708],[88.876312,22.879146],[88.52977,23.631142],[88.69994,24.233715],[88.084422,24.501657],[88.306373,24.866079],[88.931554,25.238692],[88.209789,25.768066],[88.563049,26.446526],[89.355094,26.014407],[89.832481,25.965082],[89.920693,25.26975],[90.872211,25.132601],[91.799596,25.147432],[92.376202,24.976693],[91.915093,24.130414],[91.46773,24.072639],[91.158963,23.503527],[91.706475,22.985264],[91.869928,23.624346],[92.146035,23.627499],[92.672721,22.041239]]]}},BO:{type:"Feature",id:"BOL",properties:{name:"Bolivia"},geometry:{type:"Polygon",coordinates:[[[-62.846468,-22.034985],[-63.986838,-21.993644],[-64.377021,-22.798091],[-64.964892,-22.075862],[-66.273339,-21.83231],[-67.106674,-22.735925],[-67.82818,-22.872919],[-68.219913,-21.494347],[-68.757167,-20.372658],[-68.442225,-19.405068],[-68.966818,-18.981683],[-69.100247,-18.260125],[-69.590424,-17.580012],[-68.959635,-16.500698],[-69.389764,-15.660129],[-69.160347,-15.323974],[-69.339535,-14.953195],[-68.948887,-14.453639],[-68.929224,-13.602684],[-68.88008,-12.899729],[-68.66508,-12.5613],[-69.529678,-10.951734],[-68.786158,-11.03638],[-68.271254,-11.014521],[-68.048192,-10.712059],[-67.173801,-10.306812],[-66.646908,-9.931331],[-65.338435,-9.761988],[-65.444837,-10.511451],[-65.321899,-10.895872],[-65.402281,-11.56627],[-64.316353,-12.461978],[-63.196499,-12.627033],[-62.80306,-13.000653],[-62.127081,-13.198781],[-61.713204,-13.489202],[-61.084121,-13.479384],[-60.503304,-13.775955],[-60.459198,-14.354007],[-60.264326,-14.645979],[-60.251149,-15.077219],[-60.542966,-15.09391],[-60.15839,-16.258284],[-58.24122,-16.299573],[-58.388058,-16.877109],[-58.280804,-17.27171],[-57.734558,-17.552468],[-57.498371,-18.174188],[-57.676009,-18.96184],[-57.949997,-19.400004],[-57.853802,-19.969995],[-58.166392,-20.176701],[-58.183471,-19.868399],[-59.115042,-19.356906],[-60.043565,-19.342747],[-61.786326,-19.633737],[-62.265961,-20.513735],[-62.291179,-21.051635],[-62.685057,-22.249029],[-62.846468,-22.034985]]]}},BY:{type:"Feature",id:"BLR",properties:{name:"Belarus"},geometry:{type:"Polygon",coordinates:[[[23.484128,53.912498],[24.450684,53.905702],[25.536354,54.282423],[25.768433,54.846963],[26.588279,55.167176],[26.494331,55.615107],[27.10246,55.783314],[28.176709,56.16913],[29.229513,55.918344],[29.371572,55.670091],[29.896294,55.789463],[30.873909,55.550976],[30.971836,55.081548],[30.757534,54.811771],[31.384472,54.157056],[31.791424,53.974639],[31.731273,53.794029],[32.405599,53.618045],[32.693643,53.351421],[32.304519,53.132726],[31.497644,53.167427],[31.305201,53.073996],[31.540018,52.742052],[31.785998,52.101678],[30.927549,52.042353],[30.619454,51.822806],[30.555117,51.319503],[30.157364,51.416138],[29.254938,51.368234],[28.992835,51.602044],[28.617613,51.427714],[28.241615,51.572227],[27.454066,51.592303],[26.337959,51.832289],[25.327788,51.910656],[24.553106,51.888461],[24.005078,51.617444],[23.527071,51.578454],[23.508002,52.023647],[23.199494,52.486977],[23.799199,52.691099],[23.804935,53.089731],[23.527536,53.470122],[23.484128,53.912498]]]}},CN:{type:"Feature",id:"CHN",properties:{name:"China"},geometry:{type:"MultiPolygon",coordinates:[[[[110.339188,18.678395],[109.47521,18.197701],[108.655208,18.507682],[108.626217,19.367888],[109.119056,19.821039],[110.211599,20.101254],[110.786551,20.077534],[111.010051,19.69593],[110.570647,19.255879],[110.339188,18.678395]]],[[[127.657407,49.76027],[129.397818,49.4406],[130.582293,48.729687],[130.987282,47.790132],[132.506672,47.78897],[133.373596,48.183442],[135.026311,48.47823],[134.500814,47.57844],[134.112362,47.212467],[133.769644,46.116927],[133.097127,45.144066],[131.883454,45.321162],[131.025212,44.967953],[131.288555,44.11152],[131.144688,42.92999],[130.633866,42.903015],[130.640016,42.395009],[129.994267,42.985387],[129.596669,42.424982],[128.052215,41.994285],[128.208433,41.466772],[127.343783,41.503152],[126.869083,41.816569],[126.182045,41.107336],[125.079942,40.569824],[124.265625,39.928493],[122.86757,39.637788],[122.131388,39.170452],[121.054554,38.897471],[121.585995,39.360854],[121.376757,39.750261],[122.168595,40.422443],[121.640359,40.94639],[120.768629,40.593388],[119.639602,39.898056],[119.023464,39.252333],[118.042749,39.204274],[117.532702,38.737636],[118.059699,38.061476],[118.87815,37.897325],[118.911636,37.448464],[119.702802,37.156389],[120.823457,37.870428],[121.711259,37.481123],[122.357937,37.454484],[122.519995,36.930614],[121.104164,36.651329],[120.637009,36.11144],[119.664562,35.609791],[119.151208,34.909859],[120.227525,34.360332],[120.620369,33.376723],[121.229014,32.460319],[121.908146,31.692174],[121.891919,30.949352],[121.264257,30.676267],[121.503519,30.142915],[122.092114,29.83252],[121.938428,29.018022],[121.684439,28.225513],[121.125661,28.135673],[120.395473,27.053207],[119.585497,25.740781],[118.656871,24.547391],[117.281606,23.624501],[115.890735,22.782873],[114.763827,22.668074],[114.152547,22.22376],[113.80678,22.54834],[113.241078,22.051367],[111.843592,21.550494],[110.785466,21.397144],[110.444039,20.341033],[109.889861,20.282457],[109.627655,21.008227],[109.864488,21.395051],[108.522813,21.715212],[108.05018,21.55238],[107.04342,21.811899],[106.567273,22.218205],[106.725403,22.794268],[105.811247,22.976892],[105.329209,23.352063],[104.476858,22.81915],[103.504515,22.703757],[102.706992,22.708795],[102.170436,22.464753],[101.652018,22.318199],[101.80312,21.174367],[101.270026,21.201652],[101.180005,21.436573],[101.150033,21.849984],[100.416538,21.558839],[99.983489,21.742937],[99.240899,22.118314],[99.531992,22.949039],[98.898749,23.142722],[98.660262,24.063286],[97.60472,23.897405],[97.724609,25.083637],[98.671838,25.918703],[98.712094,26.743536],[98.68269,27.508812],[98.246231,27.747221],[97.911988,28.335945],[97.327114,28.261583],[96.248833,28.411031],[96.586591,28.83098],[96.117679,29.452802],[95.404802,29.031717],[94.56599,29.277438],[93.413348,28.640629],[92.503119,27.896876],[91.696657,27.771742],[91.258854,28.040614],[90.730514,28.064954],[90.015829,28.296439],[89.47581,28.042759],[88.814248,27.299316],[88.730326,28.086865],[88.120441,27.876542],[86.954517,27.974262],[85.82332,28.203576],[85.011638,28.642774],[84.23458,28.839894],[83.898993,29.320226],[83.337115,29.463732],[82.327513,30.115268],[81.525804,30.422717],[81.111256,30.183481],[79.721367,30.882715],[78.738894,31.515906],[78.458446,32.618164],[79.176129,32.48378],[79.208892,32.994395],[78.811086,33.506198],[78.912269,34.321936],[77.837451,35.49401],[76.192848,35.898403],[75.896897,36.666806],[75.158028,37.133031],[74.980002,37.41999],[74.829986,37.990007],[74.864816,38.378846],[74.257514,38.606507],[73.928852,38.505815],[73.675379,39.431237],[73.960013,39.660008],[73.822244,39.893973],[74.776862,40.366425],[75.467828,40.562072],[76.526368,40.427946],[76.904484,41.066486],[78.187197,41.185316],[78.543661,41.582243],[80.11943,42.123941],[80.25999,42.349999],[80.18015,42.920068],[80.866206,43.180362],[79.966106,44.917517],[81.947071,45.317027],[82.458926,45.53965],[83.180484,47.330031],[85.16429,47.000956],[85.720484,47.452969],[85.768233,48.455751],[86.598776,48.549182],[87.35997,49.214981],[87.751264,49.297198],[88.013832,48.599463],[88.854298,48.069082],[90.280826,47.693549],[90.970809,46.888146],[90.585768,45.719716],[90.94554,45.286073],[92.133891,45.115076],[93.480734,44.975472],[94.688929,44.352332],[95.306875,44.241331],[95.762455,43.319449],[96.349396,42.725635],[97.451757,42.74889],[99.515817,42.524691],[100.845866,42.663804],[101.83304,42.514873],[103.312278,41.907468],[104.522282,41.908347],[104.964994,41.59741],[106.129316,42.134328],[107.744773,42.481516],[109.243596,42.519446],[110.412103,42.871234],[111.129682,43.406834],[111.829588,43.743118],[111.667737,44.073176],[111.348377,44.457442],[111.873306,45.102079],[112.436062,45.011646],[113.463907,44.808893],[114.460332,45.339817],[115.985096,45.727235],[116.717868,46.388202],[117.421701,46.672733],[118.874326,46.805412],[119.66327,46.69268],[119.772824,47.048059],[118.866574,47.74706],[118.064143,48.06673],[117.295507,47.697709],[116.308953,47.85341],[115.742837,47.726545],[115.485282,48.135383],[116.191802,49.134598],[116.678801,49.888531],[117.879244,49.510983],[119.288461,50.142883],[119.279366,50.582908],[120.18205,51.643566],[120.738191,51.964115],[120.725789,52.516226],[120.177089,52.753886],[121.003085,53.251401],[122.245748,53.431726],[123.571507,53.458804],[125.068211,53.161045],[125.946349,52.792799],[126.564399,51.784255],[126.939157,51.353894],[127.287456,50.739797],[127.657407,49.76027]]]]}},EC:{type:"Feature",id:"ECU",properties:{name:"Ecuador"},geometry:{type:"Polygon",coordinates:[[[-80.302561,-3.404856],[-79.770293,-2.657512],[-79.986559,-2.220794],[-80.368784,-2.685159],[-80.967765,-2.246943],[-80.764806,-1.965048],[-80.933659,-1.057455],[-80.58337,-.906663],[-80.399325,-.283703],[-80.020898,.36034],[-80.09061,.768429],[-79.542762,.982938],[-78.855259,1.380924],[-77.855061,.809925],[-77.668613,.825893],[-77.424984,.395687],[-76.57638,.256936],[-76.292314,.416047],[-75.801466,.084801],[-75.373223,-.152032],[-75.233723,-.911417],[-75.544996,-1.56161],[-76.635394,-2.608678],[-77.837905,-3.003021],[-78.450684,-3.873097],[-78.639897,-4.547784],[-79.205289,-4.959129],[-79.624979,-4.454198],[-80.028908,-4.346091],[-80.442242,-4.425724],[-80.469295,-4.059287],[-80.184015,-3.821162],[-80.302561,-3.404856]]]}},IL:{type:"Feature",id:"ISR",properties:{name:"Israel"},geometry:{type:"Polygon",coordinates:[[[35.719918,32.709192],[35.545665,32.393992],[35.18393,32.532511],[34.974641,31.866582],[35.225892,31.754341],[34.970507,31.616778],[34.927408,31.353435],[35.397561,31.489086],[35.420918,31.100066],[34.922603,29.501326],[34.265433,31.219361],[34.556372,31.548824],[34.488107,31.605539],[34.752587,32.072926],[34.955417,32.827376],[35.
16098457,33.080539],[35.126053,33.0909],[35.460709,33.08904],[35.552797,33.264275],[35.821101,33.277426],[35.836397,32.868123],[35.700798,32.716014],[35.719918,32.709192]]]}},IN:{type:"Feature",id:"IND",properties:{name:"India"},geometry:{type:"Polygon",coordinates:[[[77.837451,35.49401],[78.912269,34.321936],[78.811086,33.506198],[79.208892,32.994395],[79.176129,32.48378],[78.458446,32.618164],[78.738894,31.515906],[79.721367,30.882715],[81.111256,30.183481],[80.476721,29.729865],[80.088425,28.79447],[81.057203,28.416095],[81.999987,27.925479],[83.304249,27.364506],[84.675018,27.234901],[85.251779,26.726198],[86.024393,26.630985],[87.227472,26.397898],[88.060238,26.414615],[88.174804,26.810405],[88.043133,27.445819],[88.120441,27.876542],[88.730326,28.086865],[88.814248,27.299316],[88.835643,27.098966],[89.744528,26.719403],[90.373275,26.875724],[91.217513,26.808648],[92.033484,26.83831],[92.103712,27.452614],[91.696657,27.771742],[92.503119,27.896876],[93.413348,28.640629],[94.56599,29.277438],[95.404802,29.031717],[96.117679,29.452802],[96.586591,28.83098],[96.248833,28.411031],[97.327114,28.261583],[97.402561,27.882536],[97.051989,27.699059],[97.133999,27.083774],[96.419366,27.264589],[95.124768,26.573572],[95.155153,26.001307],[94.603249,25.162495],[94.552658,24.675238],[94.106742,23.850741],[93.325188,24.078556],[93.286327,23.043658],[93.060294,22.703111],[93.166128,22.27846],[92.672721,22.041239],[92.146035,23.627499],[91.869928,23.624346],[91.706475,22.985264],[91.158963,23.503527],[91.46773,24.072639],[91.915093,24.130414],[92.376202,24.976693],[91.799596,25.147432],[90.872211,25.132601],[89.920693,25.26975],[89.832481,25.965082],[89.355094,26.014407],[88.563049,26.446526],[88.209789,25.768066],[88.931554,25.238692],[88.306373,24.866079],[88.084422,24.501657],[88.69994,24.233715],[88.52977,23.631142],[88.876312,22.879146],[89.031961,22.055708],[88.888766,21.690588],[88.208497,21.703172],[86.975704,21.495562],[87.033169,20.743308],[86.499351,20.151638],[85.060266,19.478579],[83.941006,18.30201],[83.189217,17.671221],[82.192792,17.016636],[82.191242,16.556664],[81.692719,16.310219],[80.791999,15.951972],[80.324896,15.899185],[80.025069,15.136415],[80.233274,13.835771],[80.286294,13.006261],[79.862547,12.056215],[79.857999,10.357275],[79.340512,10.308854],[78.885345,9.546136],[79.18972,9.216544],[78.277941,8.933047],[77.941165,8.252959],[77.539898,7.965535],[76.592979,8.899276],[76.130061,10.29963],[75.746467,11.308251],[75.396101,11.781245],[74.864816,12.741936],[74.616717,13.992583],[74.443859,14.617222],[73.534199,15.990652],[73.119909,17.92857],[72.820909,19.208234],[72.824475,20.419503],[72.630533,21.356009],[71.175273,20.757441],[70.470459,20.877331],[69.16413,22.089298],[69.644928,22.450775],[69.349597,22.84318],[68.176645,23.691965],[68.842599,24.359134],[71.04324,24.356524],[70.844699,25.215102],[70.282873,25.722229],[70.168927,26.491872],[69.514393,26.940966],[70.616496,27.989196],[71.777666,27.91318],[72.823752,28.961592],[73.450638,29.976413],[74.42138,30.979815],[74.405929,31.692639],[75.258642,32.271105],[74.451559,32.7649],[74.104294,33.441473],[73.749948,34.317699],[74.240203,34.748887],[75.757061,34.504923],[76.871722,34.653544],[77.837451,35.49401]]]}},JP:{type:"Feature",id:"JPN",properties:{name:"Japan"},geometry:{type:"MultiPolygon",coordinates:[[[[134.638428,34.149234],[134.766379,33.806335],[134.203416,33.201178],[133.79295,33.521985],[133.280268,33.28957],[133.014858,32.704567],[132.363115,32.989382],[132.371176,33.463642],[132.924373,34.060299],[133.492968,33.944621],[133.904106,34.364931],[134.638428,34.149234]]],[[[140.976388,37.142074],[140.59977,36.343983],[140.774074,35.842877],[140.253279,35.138114],[138.975528,34.6676],[137.217599,34.606286],[135.792983,33.464805],[135.120983,33.849071],[135.079435,34.596545],[133.340316,34.375938],[132.156771,33.904933],[130.986145,33.885761],[132.000036,33.149992],[131.33279,31.450355],[130.686318,31.029579],[130.20242,31.418238],[130.447676,32.319475],[129.814692,32.61031],[129.408463,33.296056],[130.353935,33.604151],[130.878451,34.232743],[131.884229,34.749714],[132.6176
1673,35.433393],[134.608301,35.731618],[135.677538,35.527134],[136.723831,37.304984],[137.390612,36.827391],[138.857602,37.827485],[139.426405,38.215962],[140.05479,39.438807],[139.883379,40.563312],[140.305783,41.195005],[141.368973,41.37856],[141.914263,39.991616],[141.884601,39.180865],[140.959489,38.174001],[140.976388,37.142074]]],[[[143.910162,44.1741],[144.613427,43.960883],[145.320825,44.384733],[145.543137,43.262088],[144.059662,42.988358],[143.18385,41.995215],[141.611491,42.678791],[141.067286,41.584594],[139.955106,41.569556],[139.817544,42.563759],[140.312087,43.333273],[141.380549,43.388825],[141.671952,44.772125],[141.967645,45.551483],[143.14287,44.510358],[143.910162,44.1741]]]]}},KH:{type:"Feature",id:"KHM",properties:{name:"Cambodia"},geometry:{type:"Polygon",coordinates:[[[103.49728,10.632555],[103.09069,11.153661],[102.584932,12.186595],[102.348099,13.394247],[102.988422,14.225721],[104.281418,14.416743],[105.218777,14.273212],[106.043946,13.881091],[106.496373,14.570584],[107.382727,14.202441],[107.614548,13.535531],[107.491403,12.337206],[105.810524,11.567615],[106.24967,10.961812],[105.199915,10.88931],[104.334335,10.486544],[103.49728,10.632555]]]}},KP:{type:"Feature",id:"PRK",properties:{name:"North Korea"},geometry:{type:"Polygon",coordinates:[[[130.640016,42.395009],[130.780007,42.220007],[130.400031,42.280004],[129.965949,41.941368],[129.667362,41.601104],[129.705189,40.882828],[129.188115,40.661808],[129.0104,40.485436],[128.633368,40.189847],[127.967414,40.025413],[127.533436,39.75685],[127.50212,39.323931],[127.385434,39.213472],[127.783343,39.050898],[128.349716,38.612243],[128.205746,38.370397],[127.780035,38.304536],[127.073309,38.256115],[126.68372,37.804773],[126.237339,37.840378],[126.174759,37.749686],[125.689104,37.94001],[125.568439,37.752089],[125.27533,37.669071],[125.240087,37.857224],[124.981033,37.948821],[124.712161,38.108346],[124.985994,38.548474],[125.221949,38.665857],[125.132859,38.848559],[125.38659,39.387958],[125.321116,39.551385],[124.737482,39.660344],[124.265625,39.928493],[125.079942,40.569824],[126.182045,41.107336],[126.869083,41.816569],[127.343783,41.503152],[128.208433,41.466772],[128.052215,41.994285],[129.596669,42.424982],[129.994267,42.985387],[130.640016,42.395009]]]}},KR:{type:"Feature",id:"KOR",properties:{name:"South Korea"},geometry:{type:"Polygon",coordinates:[[[128.349716,38.612243],[129.21292,37.432392],[129.46045,36.784189],[129.468304,35.632141],[129.091377,35.082484],[128.18585,34.890377],[127.386519,34.475674],[126.485748,34.390046],[126.37392,34.93456],[126.559231,35.684541],[126.117398,36.725485],[126.860143,36.893924],[126.174759,37.749686],[126.237339,37.840378],[126.68372,37.804773],[127.073309,38.256115],[127.780035,38.304536],[128.205746,38.370397],[128.349716,38.612243]]]}},KZ:{type:"Feature",id:"KAZ",properties:{name:"Kazakhstan"},geometry:{type:"Polygon",coordinates:[[[70.962315,42.266154],[70.388965,42.081308],[69.070027,41.384244],[68.632483,40.668681],[68.259896,40.662325],[67.985856,41.135991],[66.714047,41.168444],[66.510649,41.987644],[66.023392,41.994646],[66.098012,42.99766],[64.900824,43.728081],[63.185787,43.650075],[62.0133,43.504477],[61.05832,44.405817],[60.239972,44.784037],[58.689989,45.500014],[58.503127,45.586804],[55.928917,44.995858],[55.968191,41.308642],[55.455251,41.259859],[54.755345,42.043971],[54.079418,42.324109],[52.944293,42.116034],[52.50246,41.783316],[52.446339,42.027151],[52.692112,42.443895],[52.501426,42.792298],[51.342427,43.132975],[50.891292,44.031034],[50.339129,44.284016],[50.305643,44.609836],[51.278503,44.514854],[51.316899,45.245998],[52.16739,45.408391],[53.040876,45.259047],[53.220866,46.234646],[53.042737,46.853006],[52.042023,46.804637],[51.191945,47.048705],[50.034083,46.60899],[49.10116,46.39933],[48.593241,46.561034],[48.694734,47.075628],[48.057253,47.743753],[47.315231,47.715847],[46.466446,48.394152],[47.043672,49.152039],[46.751596,49.356006],[47.54948,50.454698],[48.577841,49.87476],[48.702382,50.605128],[50.766648,51.692762],[52.328724,51.718652],[54.532878,51.02624],[55.716941,50.621717],[56.777961,51.043551],[58.363291,51.063653],[59.642282,50.545442],[59.932807,50.842194],[61.337424,50.79907],[61.588003,51.272659],[59.967534,51.96042],[60.927269,52.447548],[60.739993,52.719986],[61.699986,52.979996],[60.978066,53.664993],[61.436591,54.006265],[65.178534,54.354228],[65.666876,54.601267],[68.1691,54.970392],[69.068167,55.38525],[70.865267,55.169734],[71.180131,54.133285],[72.22415,54.376655],[73.508516,54.035617],[73.425679,53.48981],[74.384845,53.546861],[76.8911,54.490524],[76.525179,54.177003],[77.800916,53.404415],[80.03556,50.864751],[80.568447,51.388336],[81.945986,50.812196],[83.383004,51.069183],[83.935115,50.889246],[84.416377,50.3114],[85.11556,50.117303],[85.54127,49.692859],[86.829357,49.826675],[87.35997,49.214981],[86.598776,48.549182],[85.768233,48.455751],[85.720484,47.452969],[85.16429,47.000956],[83.180484,47.330031],[82.458926,45.53965],[81.947071,45.317027],[79.966106,44.917517],[80.866206,43.180362],[80.18015,42.920068],[80.25999,42.349999],[79.643645,42.496683],[79.142177,42.856092],[77.658392,42.960686],[76.000354,42.988022],[75.636965,42.8779],[74.212866,43.298339],[73.645304,43.091272],[73.489758,42.500894],[71.844638,42.845395],[71.186281,42.704293],[70.962315,42.266154]]]}},LK:{type:"Feature",id:"LKA",properties:{name:"Sri Lanka"},geometry:{type:"Polygon",coordinates:[[[81.787959,7.523055],[81.637322,6.481775],[81.21802,6.197141],[80.348357,5.96837],[79.872469,6.763463],[79.695167,8.200843],[80.147801,9.824078],[80.838818,9.268427],[81.304319,8.564206],[81.787959,7.523055]]]}},MM:{type:"Feature",id:"MMR",properties:{name:"Myanmar"},geometry:{type:"Polygon",coordinates:[[[99.543309,20.186598],[98.959676,19.752981],[98.253724,19.708203],[97.797783,18.62708],[97.375896,18.445438],[97.859123,17.567946],[98.493761,16.837836],[98.903348,16.177824],[98.537376,15.308497],[98.192074,15.123703],[98.430819,14.622028],[99.097755,13.827503],[99.212012,13.269294],[99.196354,12.804748],[99.587286,11.892763],[99.038121,10.960546],[98.553551,9.93296],[98.457174,10.675266],[98.764546,11.441292],[98.428339,12.032987],[98.509574,13.122378],[98.103604,13.64046],[97.777732,14.837286],[97.597072,16.100568],[97.16454,16.928734],[96.505769,16.427241],[95.369352,15.71439],[94.808405,15.803454],[94.188804,16.037936],[94.533486,17.27724],[94.324817,18.213514],[93.540988,19.366493],[93.663255,19.726962],[93.078278,19.855145],[92.368554,20.670883],[92.303234,21.475485],[92.652257,21.324048],[92.672721,22.041239],[93.166128,22.27846],[93.060294,22.703111],[93.286327,23.043658],[93.325188,24.078556],[94.106742,23.850741],[94.552658,24.675238],[94.603249,25.162495],[95.155153,26.001307],[95.124768,26.573572],[96.419366,27.264589],[97.133999,27.083774],[97.051989,27.699059],[97.402561,27.882536],[97.327114,28.261583],[97.911988,28.335945],[98.246231,27.747221],[98.68269,27.508812],[98.712094,26.743536],[98.671838,25.918703],[97.724609,25.083637],[97.60472,23.897405],[98.660262,24.063286],[98.898749,23.142722],[99.531992,22.949039],[99.240899,22.118314],[99.983489,21.742937],[100.416538,21.558839],[101.150033,21.849984],[101.180005,21.436573],[100.329101,20.786122],[100.115988,20.41785],[99.543309,20.186598]]]}},PK:{type:"Feature",id:"PAK",properties:{name:"Pakistan"},geometry:{type:"Polygon",coordinates:[[[75.158028,37.133031],[75.896897,36.666806],[76.192848,35.898403],[77.837451,35.49401],[76.871722,34.653544],[75.757061,34.504923],[74.240203,34.748887],[73.749948,34.317699],[74.104294,33.441473],[74.451559,32.7649],[75.258642,32.271105],[74.405929,31.692639],[74.42138,30.979815],[73.450638,29.976413],[72.823752,28.961592],[71.777666,27.91318],[70.616496,27.989196],[69.514393,26.940966],[70.168927,26.491872],[70.282873,25.722229],[70.844699,25.215102],[71.04324,24.356524],[68.842599,24.359134],[68.176645,23.691965],[67.443667,23.944844],[67.145442,24.663611],[66.372828,25.425141],[64.530408,25.237039],[62.905701,25.218409],[61.497363,25.078237],[61.874187,26.239975],[63.316632,26.756532],[63.233898,27.217047],[62.755426,27.378923],[62.72783,28.259645],[61.771868,28.699334],[61.369309,29.303276],[60.874248,29.829239],[62.549857,29.318572],[63.550261,29.468331],[64.148002,29.340819],[64.350419,29.560031],[65.046862,29.472181],[66.346473,29.887943],[66.381458,30.738899],[66.938891,31.304911],[67.683394,31.303154],[67.792689,31.58293],[68.556932,31.71331],[68.926677,31.620189],[69.317764,31.901412],[69.262522,32.501944],[69.687147,33.105499],[70.323594,33.358533],[69.930543,34.02012],[70.881803,33.988856],[71.156773,34.348911],[71.115019,34.733126],[71.613076,35.153203],[71.498768,35.650563],[71.262348,36.074388],[71.846292,36.509942],[72.920025,36.720007],[74.067552,36.836176],[74.575893,37.020841],[75.158028,37.133031]]]}},TR:{type:"Feature",id:"TUR",properties:{name:"Turkey"},geometry:{type:"MultiPolygon",coordinates:[[[[36.913127,41.335358],[38.347665,40.948586],[39.512607,41.102763],[40.373433,41.013673],[41.554084,41.535656],[42.619549,41.583173],[43.582746,41.092143],[43.752658,40.740201],[43.656436,40.253564],[44.400009,40.005],[44.79399,39.713003],[44.109225,39.428136],[44.421403,38.281281],[44.225756,37.971584],[44.772699,37.170445],[44.293452,37.001514],[43.942259,37.256228],[42.779126,37.385264],[42.349591,37.229873],[41.212089,37.074352],[40.673259,37.091276],[39.52258,36.716054],[38.699891,36.712927],[38.167727,36.90121],[37.066761,36.623036],[36.739494,36.81752],[36.685389,36.259699],[36.41755,36.040617],[36.149763,35.821535],[35.782085,36.274995],[36.160822,36.650606],[35.550936,36.565443],[34.714553,36.795532],[34.026895,36.21996],[32.509158,36.107564],[31.699595,36.644275],[30.621625,36.677865],[30.391096,36.262981],[29.699976,36.144357],[28.732903,36.676831],[27.641187,36.658822],[27.048768,37.653361],[26.318218,38.208133],[26.8047,38.98576],[26.170785,39.463612],[27.28002,40.420014],[28.819978,40.460011],[29.240004,41.219991],[31.145934,41.087622],[32.347979,41.736264],[33.513283,42.01896],[35.167704,42.040225],[36.913127,41.335358]]],[[[27.192377,40.690566],[26.358009,40.151994],[26.043351,40.617754],[26.056942,40.824123],[26.294602,40.936261],[26.604196,41.562115],[26.117042,41.826905],[27.135739,42.141485],[27.99672,42.007359],[28.115525,41.622886],[28.988443,41.299934],[28.806438,41.054962],[27.619017,40.999823],[27.192377,40.690566]]]]}}},Po=[{name:"google-maps"},{name:"mapbox-gl",tiles:"tomtom"}],Io=[{name:"google-maps"}],Mo={CN:Io,KZ:Io,TR:Io,MM:Io,JP:Io,PK:Io,EC:Io,BO:Io,IN:Io,KP:Io,KH:Io,KR:[{name:"google-maps"},{name:"mapbox-gl",tiles:"tmap"}],LK:Io,BY:Io,BD:Io,AZ:Io,IL:Io};
16var Co=r(783);function ko(t,e,r,i,n){const o=function(t,e){const r=new Set;return t&&t.forEach((t=>{const{data:e,getProvider:i}=t.props;e.forEach(((t,e)=>{const n=i(t,{index:e});r.add(n)}))})),e&&e.forEach((t=>{t.forEach((t=>{r.add(t.provider)}))})),[...r]}(r,i),a=o.map((r=>(t[r]||(t[r]=function(t,e,r){return"string"!=typeof t?(r&&r({name:"normalize-provider-error",payload:{message:"received an invalid provider",provider:String(t)}}),e):t.toLowerCase().includes(Co.x.google)?Co.x.google:t.toLowerCase().includes(Co.x.uber)?Co.x.uber:t.toLowerCase().includes(Co.x.tomtom)?Co.x.tomtom:t.toLowerCase().includes(Co.x.tmap)?Co.x.tmap:t.toLowerCase().includes(Co.x.here)?Co.x.here:(r&&r({name:"normalize-provider-error",payload:{message:"received an unknown provider",provider:t}}),e)}(r,e,n)),t[r])));return Array.from(new Set(a))}const Lo=(t,e)=>{const r=t[0]/(t[0]+t[1]),i=t[1]/(t[0]+t[1]),n=t[0]+t[1]-e+2;return[Math.ceil(n*r),Math.ceil(n*i)]},zo="DO_NOT_REPORT_PROVENANCE";Object.freeze({UBER_ID_TYPE_INVALID:"UBER_ID_TYPE_INVALID",UBER_ID_TYPE_SESSION_ID:"UBER_ID_TYPE_SESSION_ID",UBER_ID_TYPE_TRIP_ID:"UBER_ID_TYPE_TRIP_ID",UBER_ID_TYPE_WORKFLOW_ID:"UBER_ID_TYPE_WORKFLOW_ID"});const Ro=Object.freeze({PROVENANCE_INVALID:"PROVENANCE_INVALID",PROVENANCE_GOOGLE_PLACES:"PROVENANCE_GOOGLE_PLACES",PROVENANCE_UBER_PLACES:"PROVENANCE_UBER_PLACES",PROVENANCE_NONE:"PROVENANCE_NONE"});var Oo=r(89040),Do=r(68908);function Bo(t){const{isMapboxGLEngine:e,sessionId:r,onError:i,whyEngine:n,tripId:o,workflowId:a}=t;return r===zo?null:(0,f.Y)(Fo,{isMapboxGLEngine:e,sessionId:r,tripId:o,workflowId:a,onError:i,whyEngine:n})}function Fo(t){let{isMapboxGLEngine:e,sessionId:r,onError:n,whyEngine:o,tripId:a,workflowId:s}=t;const l=(0,Oo.Am)(Do.El);return(0,i.useEffect)((()=>{r||n({name:"report-provenance-error",payload:{message:`Session Id is missing: "${String(r)}"`}})}),[n,r]),(0,i.useEffect)((()=>{if(!r||r===zo)return;const t=e?[Ro.PROVENANCE_UBER_PLACES]:[Ro.PROVENANCE_GOOGLE_PLACES];l("/_maps_provenance",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:r,provenances:t,whyEngine:o,tripId:a,workflowId:s})}).catch((t=>{n({name:"report-provenance-error",payload:{message:t.message,stack:t.stack}})}))}),[r,e,o]),null}var jo=r(80454);const No=Co.x.google;const Uo={position:"relative",zIndex:0,height:"100%",width:"100%",overflow:"hidden"};const Vo={transitionDuration:300,transitionEasing:t=>Math.sin(t*Math.PI/2),transitionInterpolator:new h};function qo(t,e){const{layers:r,overlays:o,sessionId:a,tripId:s,workflowId:l,viewState:u,onViewStateChange:c,onClick:h,onHover:d,onError:m,onLoad:_,styleFlavor:b=vi.rides,isLoadingLocation:x,onClickLocateMe:w,showZoomButtons:A,overrides:E,style:T,theme:S=_i.light,allowedProviderList:P,_unsafe_allowMapboxInIndia:I}=t,[M]=(0,n.c6)();(0,i.useEffect)((()=>{m&&0===u?.longitude&&0===u?.latitude&&m({name:"maps-sdk-invalid-viewstate",payload:{message:"Use viewState=null instead of lat=0, lng=0 if the location is not yet available (to avoid using google-maps engine)"}})}),[m,u?.longitude,u?.latitude]);const C=(0,i.useContext)(y),{availableEngines:k,whyEngine:L}=(0,i.useMemo)((()=>function(t,e){if(!t)return{availableEngines:[],whyEngine:"NO_VIEW_STATE"};if(t.zoom<6)return{availableEngines:Po,whyEngine:"BELOW_ZOOM_THRESHOLD"};const r=Object.keys(Mo).find((e=>To([t.longitude,t.latitude],So[e].geometry)));return r?e?._unsafe_allowMapboxInIndia&&"IN"===r?{availableEngines:Po,whyEngine:"COUNTRY_EXCEPTION_OVERRIDDEN"}:{availableEngines:Mo[r],whyEngine:"COUNTRY_EXCEPTION"}:{availableEngines:Po,whyEngine:"ROLLED_OUT_AREA"}}(u,{_unsafe_allowMapboxInIndia:I})),[u,I]),z=(0,i.useRef)({}),R=((0,i.useContext)(Oo.E1),function(){{const t=document.getElementById("maps-fallback")?.content;if(t)return(0,jo.x4)(t)??No}return No}()),O=function(t,e,r){return r?v:e.some((t=>Co.x.google==t))?Io:t}(k,P||ko(z.current,R,r,o,m),C),D=function(t){for(const e of t)if(e.name===g.mapboxGL)return e;return null}(O),B=(0,i.useCallback)((()=>{u&&c&&c({...u,...Vo,zoom:u.zoom<22?u.zoom+1:22})}),[u,c]),F=(0,i.useCallback)((()=>{u&&c&&c({...u,...Vo,zoom:u.zoom>0?u.zoom-1:0})}),[u,c]),j=(0,i.useRef)(null);return(0,i.useImperativeHandle)(e,(()=>({getBoundingClientRect:()=>j.current?j.current.getBoundingClientRect():null,getViewStateForFeatures:(t,e,r)=>{if(!j.current||0===t.length)return u;const{width:i,height:n}
16=j.current.getBoundingClientRect();try{const o=((t,e,r,i,n)=>{if(1===t.length){const{latitude:r,longitude:n}=e(t[0]);return{latitude:r,longitude:n,zoom:i?i.zoom:16}}const{width:o,height:a}=n;let s=null;if("number"==typeof r.padding?s={left:r.padding,right:r.padding,top:r.padding,bottom:r.padding}:"object"==typeof r.padding&&(s=r.padding),s){const{left:t,right:e,top:i,bottom:n}=s;if(t+e>=o)if(r.tryFitPadding){const[r,i]=Lo([t,e],o);s={...s,left:Math.max(0,t-r),right:Math.max(0,e-i)}}else s={...s,left:0,right:0};if(i+n>=a)if(r.tryFitPadding){const[t,e]=Lo([i,n],a);s={...s,top:Math.max(0,i-t),bottom:Math.max(0,n-e)}}else s={...s,top:0,bottom:0}}s&&(r.padding=s);const l=((t,e)=>{let r=-180,i=180,n=-90,o=90;for(const a of t){const{longitude:t,latitude:s}=e(a);t>r&&(r=t),t<i&&(i=t),s>n&&(n=s),s<o&&(o=s)}return[[r,n],[i,o]]})(t,e);return(0,oe.A)({bounds:l,width:o,height:a,...r})})(t,e,r||{},u,{width:i,height:n});return{...o,...Vo,zoom:Math.min(Math.max(o.zoom,0),22)}}catch(t){return m&&m({name:"maps-sdk-fit-bounds-error",payload:{message:t.message,stack:t.stack,params:JSON.stringify({width:i,height:n,opts:r})}}),u}},getMercatorViewport:()=>{if(!j.current)return null;const{width:t,height:e}=j.current.getBoundingClientRect();return new p.A({...u,width:t,height:e})}}))),(0,f.Y)("div",{ref:j,className:M({...Uo,...T}),children:u?(0,f.FD)(f.FK,{children:[D?(0,f.Y)(mo,{viewState:u,layers:r,overlays:o,onViewStateChange:c,onClick:h,onHover:d,onError:m,onLoad:_,styleFlavor:b,tiles:D.tiles,overrides:{engineInterface:E?.EngineInterface,...E?.MapboxGL},theme:S}):(0,f.Y)(Ti,{viewState:u,layers:r,overlays:o,onViewStateChange:c,onClick:h,onHover:d,onError:m,onLoad:_,styleFlavor:b,overrides:{engineInterface:E?.EngineInterface,...E?.GoogleMaps},theme:S}),(0,f.Y)(Ao,{onViewStateChange:c,isLoadingLocation:x,onClickLocateMe:w,onClickZoomIn:A?B:null,onClickZoomOut:A?F:null,overrides:E?.MapControls}),(0,f.Y)(Bo,{isMapboxGLEngine:Boolean(D),whyEngine:L,sessionId:a,tripId:s,workflowId:l,onError:m})]}):null})}const Go=(0,i.forwardRef)(qo);function Zo(t,e){const{onError:r}=t,n=(0,i.useRef)(r);n.current=r;const o=(0,i.useCallback)((t=>n.current?.(t)),[]),a=(0,i.useCallback)(((t,e)=>{o({name:"maps-sdk-error-boundary",payload:{message:t.message,stack:t.stack,type:e}})}),[o]);return(0,f.Y)(d.ErrorBoundary,{FallbackComponent:m,onError:a,children:(0,f.Y)(Go,{...t,onError:o,ref:e})})}const Wo=(0,i.forwardRef)(Zo)},11876:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==l(t)&&"function"!=typeof t)return{default:t};var e=s();if(e&&e.has(t))return e.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var o=i?Object.getOwnPropertyDescriptor(t,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=t[n]}r.default=t,e&&e.set(t,r);return r}(r("__fusion__95b4ba69e5")),n=a(r(74734)),o=a(r(40100));function a(t){return t&&t.__esModule?t:{default:t}}function s(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return s=function(){return t},t}function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function u(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function c(t){return function(){var e,r=p(t);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()){var i=p(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(t,e){if(e&&("object"===l(e)||"function"==typeof e))return e;return h(t)}(this,e)}}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}
16function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function d(t,e){return d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},d(t,e)}function f(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var m={tooltip:{transform:"translate(-50%,-100%)",backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"4px 8px",borderRadius:8,color:"white"}},g=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&d(t,e)}(r,t);var e=c(r);function r(t){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),f(h(i=e.call(this,t)),"timeoutID",null),f(h(i),"state",void 0),i.state={visible:!1,pickingInfo:null},i}return function(t,e,r){e&&u(t.prototype,e),r&&u(t,r)}(r,[{key:"componentWillMount",value:function(){var t=this;this.context.nebula.queryObjectEvents.on("pick",(function(e){e.event;var r=e.pickingInfo;null!==t.timeoutID&&window.clearTimeout(t.timeoutID),t.timeoutID=null,r&&t._getTooltip(r)?t.timeoutID=window.setTimeout((function(){t.setState({visible:!0,pickingInfo:r})}),250):t.setState({visible:!1})}))}},{key:"_getTooltip",value:function(t){return t.object.style.tooltip}},{key:"_makeOverlay",value:function(){var t=this.state.pickingInfo;return t?i.createElement(o.default,{key:0,coordinates:t.lngLat,style:m.tooltip},this._getTooltip(t)):null}},{key:"getItems",value:function(){return this.state.visible?[this._makeOverlay()]:[]}}]),r}(n.default);e.default=g},12958:(t,e,r)=>{"use strict";r.d(e,{N:()=>n});var i=r(56706);function n(t,e,r){const{removedProps:n={},deprecatedProps:o={},replacedProps:a={}}=r;for(const r in n)if(r in e){const e=n[r]?"".concat(t,".").concat(n[r]):"N/A";i.Rm.removed("".concat(t,".").concat(r),e)()}for(const r in o)if(r in e){const e=o[r];i.Rm.deprecated("".concat(t,".").concat(r),"".concat(t,".").concat(e))()}let s=null;for(const r in a)if(r in e){const n=a[r];i.Rm.deprecated("".concat(t,".").concat(r),"".concat(t,".").concat(n))(),s=s||Object.assign({},e),s[n]=e[r],delete s[r]}return s||e}},14034:()=>{},15518:(t,e,r)=>{"use strict";r.d(e,{O_:()=>a,Qt:()=>h,Ay:()=>c});var i=r(88376),n=r(59885);const o={[i.T]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",[i.B]:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},a="__LUMA_INJECT_DECLARATIONS__",s=/void\s+main\s*\([^)]*\)\s*\{\n?/,l=/}\n?[^{}]*$/,u=[];function c(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const c=e===i.T;for(const e in r){const i=r[e];i.sort(((t,e)=>t.order-e.order)),u.length=i.length;for(let t=0,e=i.length;t<e;++t)u[t]=i[t].injection;const n="".concat(u.join("\n"),"\n");switch(e){case"vs:#decl":c&&(t=t.replace(a,n));break;case"vs:#main-start":c&&(t=t.replace(s,(t=>t+n)));break;case"vs:#main-end":c&&(t=t.replace(l,(t=>n+t)));break;case"fs:#decl":c||(t=t.replace(a,n));break;case"fs:#main-start":c||(t=t.replace(s,(t=>t+n)));break;case"fs:#main-end":c||(t=t.replace(l,(t=>n+t)));break;default:t=t.replace(e,(t=>t+n))}}return t=t.replace(a,""),n&&(t=t.replace(/\}\s*$/,(t=>t+o[e]))),t}function h(t){const e={};return(0,n.A)(Array.isArray(t)&&t.length>1),t.forEach((t=>{for(const r in t)e[r]=e[r]?"".concat(e[r],"\n").concat(t[r]):t[r]})),e}},15706:(t,e,r)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}r.d(e,{A:()=>i})},17553:(t,e,r)=>{"use strict";r.d(e,{A:()=>N});
16var i=r(32970),n=r(18143),o=r(94755),a=r(56706),s=r(7148),l=r(57971);const u={5126:A.bind(null,"uniform1fv",m,1,E),35664:A.bind(null,"uniform2fv",m,2,E),35665:A.bind(null,"uniform3fv",m,3,E),35666:A.bind(null,"uniform4fv",m,4,E),5124:A.bind(null,"uniform1iv",g,1,E),35667:A.bind(null,"uniform2iv",g,2,E),35668:A.bind(null,"uniform3iv",g,3,E),35669:A.bind(null,"uniform4iv",g,4,E),35670:A.bind(null,"uniform1iv",g,1,E),35671:A.bind(null,"uniform2iv",g,2,E),35672:A.bind(null,"uniform3iv",g,3,E),35673:A.bind(null,"uniform4iv",g,4,E),35674:A.bind(null,"uniformMatrix2fv",m,4,T),35675:A.bind(null,"uniformMatrix3fv",m,9,T),35676:A.bind(null,"uniformMatrix4fv",m,16,T),35678:w,35680:w,5125:A.bind(null,"uniform1uiv",y,1,E),36294:A.bind(null,"uniform2uiv",y,2,E),36295:A.bind(null,"uniform3uiv",y,3,E),36296:A.bind(null,"uniform4uiv",y,4,E),35685:A.bind(null,"uniformMatrix2x3fv",m,6,T),35686:A.bind(null,"uniformMatrix2x4fv",m,8,T),35687:A.bind(null,"uniformMatrix3x2fv",m,6,T),35688:A.bind(null,"uniformMatrix3x4fv",m,12,T),35689:A.bind(null,"uniformMatrix4x2fv",m,8,T),35690:A.bind(null,"uniformMatrix4x3fv",m,12,T),35678:w,35680:w,35679:w,35682:w,36289:w,36292:w,36293:w,36298:w,36299:w,36300:w,36303:w,36306:w,36307:w,36308:w,36311:w},c={},h={},p={},d=[0];function f(t,e,r,i){1===e&&"boolean"==typeof t&&(t=t?1:0),Number.isFinite(t)&&(d[0]=t,t=d);const n=t.length;if(n%e&&a.Rm.warn("Uniform size should be multiples of ".concat(e),t)(),t instanceof r)return t;let o=i[n];o||(o=new r(n),i[n]=o);for(let e=0;e<n;e++)o[e]=t[e];return o}function m(t,e){return f(t,e,Float32Array,c)}function g(t,e){return f(t,e,Int32Array,h)}function y(t,e){return f(t,e,Uint32Array,p)}function v(t,e,r){const i=u[r.type];if(!i)throw new Error("Unknown GLSL uniform type ".concat(r.type));return i().bind(null,t,e)}function _(t){if("]"!==t[t.length-1])return{name:t,length:1,isArray:!1};const e=t.match(/([^[]*)(\[[0-9]+\])?/);if(!e||e.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(t));return{name:e[1],length:e[2]||1,isArray:Boolean(e[2])}}function b(t){return Array.isArray(t)||ArrayBuffer.isView(t)?function(t){if(0===t.length)return!1;const e=Math.min(t.length,16);for(let r=0;r<e;++r)if(!Number.isFinite(t[r]))return!1;return!0}(t):!!isFinite(t)||(!0===t||!1===t||(t instanceof n.A||(t instanceof s.A||t instanceof o.A&&Boolean(t.texture))))}function x(t,e,r){if(Array.isArray(r)||ArrayBuffer.isView(r))if(t[e]){const i=t[e];for(let t=0,e=r.length;t<e;++t)i[t]=r[t]}else t[e]=r.slice();else t[e]=r}function w(){let t=null;return(e,r,i)=>{const n=t!==i;return n&&(e.uniform1i(r,i),t=i),n}}function A(t,e,r,i){let n=null,o=null;return(a,s,u)=>{const c=e(u,r),h=c.length;let p=!1;if(null===n)n=new Float32Array(h),o=h,p=!0;else{(0,l.v)(o===h,"Uniform length cannot change.");for(let t=0;t<h;++t)if(c[t]!==n[t]){p=!0;break}}return p&&(i(a,t,s,c),n.set(c)),p}}function E(t,e,r,i){t[e](r,i)}function T(t,e,r,i){t[e](r,!1,i)}function S(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed";const r=t.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return r?r[1]:e}function P(t,e,r,i){const n=t.split(/\r?\n/),o={},a={},s=i||S(e)||"(unnamed)",l="".concat(function(t){switch(t){case 35632:return"fragment";case 35633:return"vertex";default:return"unknown type"}}(r)," shader ").concat(s);for(let e=0;e<n.length;e++){const r=n[e];if(r.length<=1)continue;const i=r.split(":"),s=i[0],u=parseInt(i[2],10);if(isNaN(u))throw new Error("GLSL compilation error in ".concat(l,": ").concat(t));"WARNING"!==s?o[u]=r:a[u]=r}const u=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ";const i=t.split(/\r?\n/),n=String(i.length+e-1).length;return i.map(((t,i)=>{const o=String(i+e),a=o.length;return M(o,n-a)+r+t}))}(e);return{shaderName:l,errors:I(o,u),warnings:I(a,u)}}function I(t,e){let r="";for(let i=0;i<e.length;i++){const n=e[i];if((t[i+3]||t[i+2]||t[i+1])&&(r+="".concat(n,"\n"),t[i+1])){const e=t[i+1],n=e.split(":",3),o=n[0],a=parseInt(n[1],10)||0,s=e.substring(n.join(":").length+1).trim();r+=M("^^^ ".concat(o,": ").concat(s,"\n\n"),a)}}return r}function M(t,e){let r="";for(let t=0;t<e;++t)r+=" ";return"".concat(r).concat(t)}var C=r(30856);class k extends i.A{get[Symbol.toStringTag](){return"Shader"}static getTypeName(t){switch(t){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return(0,l.v)(!1),"unknown"}}constructor(t,e){(0,a.tj)(t),(0,l.v)("string"==typeof e.source,"Shader: GLSL source code must be a JavaScript string");super(t,{id:S(e.source,null)||e.id||(0,C.Ld)("unnamed ".concat(k.getTypeName(e.shaderType)))}),this.shaderType=e.shaderType,this.source=e.source,this.initialize(e)}initialize(t){let{source:e}=t;const r=S(e,null);r&&(this.id=(0,C.Ld)(r)),this._compile(e)}getParameter(t){return this.gl.getShaderParameter(this.handle,t)}toString(){return"".concat(k.getTypeName(this.shaderType),":").concat(this.id
16)}getName(){return S(this.source)||"unnamed-shader"}getSource(){return this.gl.getShaderSource(this.handle)}getTranslatedSource(){const t=this.gl.getExtension("WEBGL_debug_shaders");return t?t.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL_debug_shaders not implemented"}_compile(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.source;t.startsWith("#version ")||(t="#version 100\n".concat(t)),this.source=t,this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle);if(!this.getParameter(35713)){const t=this.gl.getShaderInfoLog(this.handle),{shaderName:e,errors:r,warnings:i}=P(t,this.source,this.shaderType,this.id);throw a.Rm.error("GLSL compilation errors in ".concat(e,"\n").concat(r))(),a.Rm.warn("GLSL compilation warnings in ".concat(e,"\n").concat(i))(),new Error("GLSL compilation errors in ".concat(e))}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class L extends k{get[Symbol.toStringTag](){return"VertexShader"}constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class z extends k{get[Symbol.toStringTag](){return"FragmentShader"}constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}var R=r(98737),O=r(72009);class D{constructor(t){this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}getAttributeInfo(t){const e=Number(t);return Number.isFinite(e)?this.attributeInfosByLocation[e]:this.attributeInfosByName[t]||null}getAttributeLocation(t){const e=this.getAttributeInfo(t);return e?e.location:-1}getAttributeAccessor(t){const e=this.getAttributeInfo(t);return e?e.accessor:null}getVaryingInfo(t){const e=Number(t);return Number.isFinite(e)?this.varyingInfos[e]:this.varyingInfosByName[t]||null}getVaryingIndex(t){const e=this.getVaryingInfo();return e?e.location:-1}getVaryingAccessor(t){const e=this.getVaryingInfo();return e?e.accessor:null}_readAttributesFromProgram(t){const{gl:e}=t,r=e.getProgramParameter(t.handle,35721);for(let i=0;i<r;i++){const{name:r,type:n,size:o}=e.getActiveAttrib(t.handle,i),a=e.getAttribLocation(t.handle,r);a>=0&&this._addAttribute(a,r,n,o)}this.attributeInfos.sort(((t,e)=>t.location-e.location))}_readVaryingsFromProgram(t){const{gl:e}=t;if(!(0,a.C6)(e))return;const r=e.getProgramParameter(t.handle,35971);for(let i=0;i<r;i++){const{name:r,type:n,size:o}=e.getTransformFeedbackVarying(t.handle,i);this._addVarying(i,r,n,o)}this.varyingInfos.sort(((t,e)=>t.location-e.location))}_addAttribute(t,e,r,i){const{type:n,components:o}=(0,O.ir)(r),a={type:n,size:i*o};this._inferProperties(t,e,a);const s={location:t,name:e,accessor:new R.A(a)};this.attributeInfos.push(s),this.attributeInfosByLocation[t]=s,this.attributeInfosByName[s.name]=s}_inferProperties(t,e,r){/instance/i.test(e)&&(r.divisor=1)}_addVarying(t,e,r,i){const{type:n,components:o}=(0,O.ir)(r),a={location:t,name:e,accessor:new R.A({type:n,size:i*o})};this.varyingInfos.push(a),this.varyingInfosByName[a.name]=a}}var B=r(88161);const F=35981,j=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class N extends i.A{get[Symbol.toStringTag](){return"Program"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.stubRemovedMethods("Program","v6.0",j),this._isCached=!1,this.initialize(e),Object.seal(this),this._setId(e.id)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{hash:e,vs:r,fs:i,varyings:n,bufferMode:o=F}=t;return this.hash=e||"",this.vs="string"==typeof r?new L(this.gl,{id:"".concat(t.id,"-vs"),source:r}):r,this.fs="string"==typeof i?new z(this.gl,{id:"".concat(t.id,"-fs"),source:i}):i,(0,l.v)(this.vs instanceof L),(0,l.v)(this.fs instanceof z),this.uniforms={},this._textureUniforms={},n&&n.length>0&&((0,a.Dz)(this.gl),this.varyings=n,this.gl2.transformFeedbackVaryings(this.handle,n,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new D(this),this.setProps(t)}delete(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:super.delete(t)}setProps(t){return"uniforms"in t&&this.setUniforms(t.uniforms),this}draw(t){let{logPriority:e,drawMode:r=4,vertexCount:i,offset:n=0,start:o,end:s,isIndexed:u=!1,indexType:c=5123,instanceCount:h=0,isInstanced:p=h>0,vertexArray:d=null,transformFeedback:f,framebuffer:m,parameters:g={},uniforms:y,samplers:v}=t;if((y||v)&&(a.Rm.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(y||{})),a.Rm.priority>=e){const t=m?m.id:"default",n="mode=".concat((0,B.i7)(this.gl,r)," verts=").concat(i," ")+"instances=".concat(h," indexType=").concat((0,B.i7)(this.gl,c)," ")+"isInstanced=".concat(p," isIndexed=").concat(u," ")+"Framebuffer=".concat(t);a.Rm.log(e,n)()}return(0,l.v)(d),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||p&&0===h)&&(d.bindForDraw(i,h,(()=>{if(void 0!==m&&(g=Object.assign({},g,{framebuffer:m})),f){const t=(0,O.F4)(r);f.begin(t)}this._bindTextures(),(0,a.zv)(this.gl,g,(()=>{u&&p?this.gl2.drawElementsInstanced(r,i,c,n,h):u&&(0,a.C6)(this.gl)&&!isNaN(o)&&!isNaN(s)?this.gl2.drawRangeElements(r,o,s,i,c,n):u?this.gl.drawElements(r,i,c,n):p?this.gl2.drawArraysInstanced(r,n,i,h):this.gl.drawArrays(r,n,i)})),f&&f.end()})),!0)}setUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a.Rm.priority>=2&&function(t,e,r){for(const i in t){const n=t[i];if((!r||Boolean(r[i]))&&!b(n))throw e=e?"".concat(e," "):"",console.error("".concat(e," Bad uniform ").concat(i),n),new Error("".concat(e," Bad uniform ").concat(i))}}(t,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const e in t){const r=t[e],i=this._uniformSetters[e];if(i){let t=r,a=!1;if(t instanceof o.A&&(t=t.texture),t instanceof n.A)if(a=this.uniforms[e]!==r,a){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);const r=t,{textureIndex:n}=i;r.bind(n),t=n,this._textureUniforms[e]=r}else t=i.textureIndex;else this._textureUniforms[e]&&delete this._textureUniforms[e];(i(t)||a)&&x(this.uniforms,e,r)}}return this}_areTexturesRenderable(){let t=!0;for(const e in this._textureUniforms){const r=this._textureUniforms[e];
16r.update(),t=t&&r.loaded}return t}_bindTextures(){for(const t in this._textureUniforms){const e=this._uniformSetters[t].textureIndex;this._textureUniforms[t].bind(e)}}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(t){const e=this.gl.getAttachedShaders(t),r={};for(const t of e){switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:r.vs=new L({handle:t});break;case 35632:r.fs=new z({handle:t})}}return r}_getParameter(t){return this.gl.getProgramParameter(this.handle,t)}_setId(t){if(!t){const t=this._getName();this.id=(0,C.Ld)(t)}}_getName(){let t=this.vs.getName()||this.fs.getName();return t=t.replace(/shader/i,""),t=t?"".concat(t,"-program"):"program",t}_compileAndLink(){const{gl:t}=this;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),a.Rm.time(4,"linkProgram for ".concat(this._getName()))(),t.linkProgram(this.handle),a.Rm.timeEnd(4,"linkProgram for ".concat(this._getName()))(),t.debug||a.Rm.level>0){if(!t.getProgramParameter(this.handle,35714))throw new Error("Error linking: ".concat(t.getProgramInfoLog(this.handle)));t.validateProgram(this.handle);if(!t.getProgramParameter(this.handle,35715))throw new Error("Error validating: ".concat(t.getProgramInfoLog(this.handle)))}}_readUniformLocationsFromLinkedProgram(){const{gl:t}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let e=0;e<this._uniformCount;e++){const r=this.gl.getActiveUniform(this.handle,e),{name:i}=_(r.name);let n=t.getUniformLocation(this.handle,i);if(this._uniformSetters[i]=v(t,n,r),r.size>1)for(let e=0;e<r.size;e++)n=t.getUniformLocation(this.handle,"".concat(i,"[").concat(e,"]")),this._uniformSetters["".concat(i,"[").concat(e,"]")]=v(t,n,r)}this._textureIndexCounter=0}getActiveUniforms(t,e){return this.gl2.getActiveUniforms(this.handle,t,e)}getUniformBlockIndex(t){return this.gl2.getUniformBlockIndex(this.handle,t)}getActiveUniformBlockParameter(t,e){return this.gl2.getActiveUniformBlockParameter(this.handle,t,e)}uniformBlockBinding(t,e){this.gl2.uniformBlockBinding(this.handle,t,e)}}},17895:(t,e,r)=>{"use strict";r.d(e,{Ph:()=>s,mk:()=>a});var i=r(1029),n=r(81109);const o=()=>{const t=(0,n.K2)();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function a(t){const e=o();t=Array.isArray(t)?t:[t];for(const r of t){const t=(0,i.D)(r);e.find((e=>t===e))||e.unshift(t)}}function s(){return o()}},18143:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(56706),n=r(32970),o=r(76340),a=r(47530),s=r(57971),l=r(30856);const u=[9729,9728],c=globalThis.WebGLBuffer||function(){};class h extends n.A{get[Symbol.toStringTag](){return"Texture"}static isSupported(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{format:r,linearFiltering:i}=e;let n=!0;return r&&(n=n&&(0,a.qS)(t,r),n=n&&(!i||(0,a.KS)(t,r))),n}constructor(t,e){const{id:r=(0,l.Ld)("texture"),handle:i,target:n}=e;super(t,{id:r,handle:i}),this.target=n,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.data;if(e instanceof Promise)return e.then((e=>this.initialize(Object.assign({},t,{pixels:e,data:e})))),this;const r="undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement;if(r&&e.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,e.addEventListener("loadeddata",(()=>this.initialize(t))),this;const{pixels:n=null,format:o=6408,border:a=0,recreate:s=!1,parameters:l={},pixelStore:u={},textureUnit:c}=t;e||(e=n);let{width:h,height:p,dataFormat:d,type:f,compressed:m=!1,mipmaps:g=!0}=t;const{depth:y=0}=t;return({width:h,height:p,compressed:m,dataFormat:d,type:f}=this._deduceParameters({format:o,type:f,dataFormat:d,compressed:m,data:e,width:h,height:p})),this.width=h,this.height=p,this.depth=y,this.format=o,this.type=f,this.dataFormat=d,this.border=a,this.textureUnit=c,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),g&&this._isNPOT()&&(i.Rm.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),g=!1,this._updateForNPOT(l)),this.mipmaps=g,this.setImageData({data:e,width:h,height:p,depth:y,format:o,type:f,dataFormat:d,border:a,mipmaps:g,parameters:u,compressed:m}),g&&this.generateMipmap(),this.setParameters(l),s&&(this.data=e),r&&(this._video={video:e,parameters:l,lastTime:e.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?e.currentTime:-1}),this}update(){if(this._video){const{video:t,parameters:e,lastTime:r}=this._video;
16if(r===t.currentTime||t.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:t,parameters:e}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=t.currentTime}}resize(t){let{height:e,width:r,mipmaps:i=!1}=t;return r!==this.width||e!==this.height?this.initialize({width:r,height:e,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:i}):this}generateMipmap(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(i.Rm.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),(0,i.zv)(this.gl,t,(()=>{this.gl.generateMipmap(this.target)})),this.gl.bindTexture(this.target,null),this)}setImageData(t){this._trackDeallocatedMemory("Texture");const{target:e=this.target,pixels:r=null,level:n=0,format:o=this.format,border:l=this.border,offset:u=0,parameters:c={}}=t;let{data:h=null,type:p=this.type,width:d=this.width,height:f=this.height,dataFormat:m=this.dataFormat,compressed:g=!1}=t;h||(h=r),({type:p,dataFormat:m,compressed:g,width:d,height:f}=this._deduceParameters({format:o,type:p,dataFormat:m,compressed:g,data:h,width:d,height:f}));const{gl:y}=this;y.bindTexture(this.target,this.handle);let v,_=null;({data:h,dataType:_}=this._getDataType({data:h,compressed:g}));let b=0;if((0,i.zv)(this.gl,c,(()=>{switch(_){case"null":y.texImage2D(e,n,o,d,f,l,m,p,h);break;case"typed-array":y.texImage2D(e,n,o,d,f,l,m,p,h,u);break;case"buffer":v=(0,i.Dz)(y),v.bindBuffer(35052,h.handle||h),v.texImage2D(e,n,o,d,f,l,m,p,u),v.bindBuffer(35052,null);break;case"browser-object":(0,i.C6)(y)?y.texImage2D(e,n,o,d,f,l,m,p,h):y.texImage2D(e,n,o,m,p,h);break;case"compressed":for(const[t,r]of h.entries())y.compressedTexImage2D(e,t,r.format,r.width,r.height,l,r.data),b+=r.levelSize;break;default:(0,s.v)(!1,"Unknown image data type")}})),"compressed"===_)this._trackAllocatedMemory(b,"Texture");else if(h&&h.byteLength)this._trackAllocatedMemory(h.byteLength,"Texture");else{const t=a.gI[this.dataFormat]||4,e=a.Ce[this.type]||1;this._trackAllocatedMemory(this.width*this.height*t*e,"Texture")}return this.loaded=!0,this}setSubImageData(t){let{target:e=this.target,pixels:r=null,data:n=null,x:a=0,y:l=0,width:u=this.width,height:h=this.height,level:p=0,format:d=this.format,type:f=this.type,dataFormat:m=this.dataFormat,compressed:g=!1,offset:y=0,border:v=this.border,parameters:_={}}=t;if(({type:f,dataFormat:m,compressed:g,width:u,height:h}=this._deduceParameters({format:d,type:f,dataFormat:m,compressed:g,data:n,width:u,height:h})),(0,s.v)(0===this.depth,"texSubImage not supported for 3D textures"),n||(n=r),n&&n.data){const t=n;n=t.data,u=t.shape[0],h=t.shape[1]}n instanceof o.A&&(n=n.handle),this.gl.bindTexture(this.target,this.handle),(0,i.zv)(this.gl,_,(()=>{if(g)this.gl.compressedTexSubImage2D(e,p,a,l,u,h,d,n);else if(null===n)this.gl.texSubImage2D(e,p,a,l,u,h,m,f,null);else if(ArrayBuffer.isView(n))this.gl.texSubImage2D(e,p,a,l,u,h,m,f,n,y);else if(n instanceof c){const t=(0,i.Dz)(this.gl);t.bindBuffer(35052,n),t.texSubImage2D(e,p,a,l,u,h,m,f,y),t.bindBuffer(35052,null)}else if((0,i.C6)(this.gl)){(0,i.Dz)(this.gl).texSubImage2D(e,p,a,l,u,h,m,f,n)}else this.gl.texSubImage2D(e,p,a,l,m,f,n)})),this.gl.bindTexture(this.target,null)}copyFramebuffer(){return i.Rm.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit;const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}unbind(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit;const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}_getDataType(t){let{data:e,compressed:r=!1}=t;return r?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof o.A?{data:e.handle,dataType:"buffer"}:e instanceof c?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(t){const{format:e,data:r}=t;let{width:i,height:n,dataFormat:o,type:s,compressed:l}=t;const u=a.pj[e];return o=o||u&&u.dataFormat,s=s||u&&u.types[0],l=l||u&&u.compressed,({width:i,height:n}=this._deduceImageSize(r,i,n)),{dataFormat:o,type:s,compressed:l,width:i,height:n,format:e,data:r}}_deduceImageSize(t,e,r){let i;return i="undefined"!=typeof ImageData&&t instanceof ImageData?{width:t.width,height:t.height}:"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?{width:t.naturalWi
16dth,height:t.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?{width:t.width,height:t.height}:"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t?{width:e,height:r}:{width:e>=0?e:1,height:r>=0?r:1},(0,s.v)(i,"Could not deduced texture size"),(0,s.v)(void 0===e||i.width===e,"Deduced texture width does not match supplied width"),(0,s.v)(void 0===r||i.height===r,"Deduced texture height does not match supplied height"),i}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}_setParameter(t,e){switch(this.gl.bindTexture(this.target,this.handle),e=this._getNPOTParam(t,e),t){case 33082:case 33083:this.gl.texParameterf(this.handle,t,e);break;case 4096:case 4097:(0,s.v)(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(0,i.C6)(this.gl)&&(!(!this.width||!this.height)&&(!(0,l.r6)(this.width)||!(0,l.r6)(this.height)))}_updateForNPOT(t){void 0===t[this.gl.TEXTURE_MIN_FILTER]&&(t[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===t[this.gl.TEXTURE_WRAP_S]&&(t[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===t[this.gl.TEXTURE_WRAP_T]&&(t[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(t,e){if(this._isNPOT())switch(t){case 10241:-1===u.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}},18718:(t,e,r)=>{"use strict";r.d(e,{A:()=>a,k:()=>o});var i=r(62022);let n={};function o(t){n=t}function a(t,e,r,o){i.A.level>0&&n[t]&&n[t].call(null,e,r,o)}},19582:(t,e,r)=>{"use strict";function i(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!0;return Array.isArray(t)?n(t,e,[]):e(t)?[t]:[]}function n(t,e,r){let i=-1;for(;++i<t.length;){const o=t[i];Array.isArray(o)?n(o,e,r):e(o)&&r.push(o)}return r}function o(t){let{target:e,source:r,start:i=0,count:n=1}=t;const o=r.length,a=n*o;let s=0;for(let t=i;s<o;s++)e[t++]=r[s];for(;s<a;)s<a-s?(e.copyWithin(i+s,i,i+s),s*=2):(e.copyWithin(i+s,i,i+a-s),s=a);return e}r.d(e,{B:()=>i,R:()=>o})},20096:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var i=r(29275),n=r(83556);const o=globalThis;function a(t){if(!t&&!(0,i.A)())return"Node";if((0,n.A)(t))return"Electron";const e="undefined"!=typeof navigator?navigator:{},r=t||e.userAgent||"";if(r.indexOf("Edge")>-1)return"Edge";const a=-1!==r.indexOf("MSIE "),s=-1!==r.indexOf("Trident/");return a||s?"IE":o.chrome?"Chrome":o.safari?"Safari":o.mozInnerScreenX?"Firefox":"Unknown"}},21576:()=>{},21986:(t,e,r)=>{"use strict";r.d(e,{p8:()=>i,tb:()=>n});var i=1e-6,n="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},25989:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var i=r(67811);function n(){let t;if("undefined"!=typeof window&&window.performance)t=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}class o{constructor(t,e){(0,i.A)(this,"name",void 0),(0,i.A)(this,"type",void 0),(0,i.A)(this,"sampleSize",1),(0,i.A)(this,"time",void 0),(0,i.A)(this,"count",void 0),(0,i.A)(this,"samples",void 0),(0,i.A)(this,"lastTiming",void 0),(0,i.A)(this,"lastSampleTime",void 0),(0,i.A)(this,"lastSampleCount",void 0),(0,i.A)(this,"_count",0),(0,i.A)(this,"_time",0),(0,i.A)(this,"_samples",0),(0,i.A)(this,"_startTime",0),(0,i.A)(this,"_timerPending",!1),this.name=t,this.type=e,this.reset()}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=n(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(n()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class a{constructor(t){(0,i.A)(this,"id",void 0),(0,i.A)(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(const t in this.stats)this.stats[t].reset();return this}forEach(t){for(const e in this.stats)t(this.stats[e])}getTable(){const t={};return this.forEach((e=>{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}})),t}_initializeStats(){(arguments.length>
160&&void 0!==arguments[0]?arguments[0]:[]).forEach((t=>this._getOrCreate(t)))}_getOrCreate(t){if(!t||!t.name)return null;const{name:e,type:r}=t;return this.stats[e]||(this.stats[e]=t instanceof o?t:new o(e,r)),this.stats[e]}}},28208:(t,e,r)=>{"use strict";r.d(e,{A:()=>ne});var i=r(67811),n=r(61028),o=r(87484),a=r(71621),s=r(76340);class l{constructor(t,e){(0,i.A)(this,"opts",void 0),(0,i.A)(this,"source",void 0),this.opts=e,this.source=t}get value(){return this.source.value}getValue(){const t=this.source.getBuffer(),e=this.getAccessor();if(t)return[t,e];const{value:r}=this.source,{size:i}=e;let n=r;if(r&&r.length!==i){n=new Float32Array(i);const t=e.elementOffset||0;for(let e=0;e<i;++e)n[e]=r[t+e]}return n}getAccessor(){return{...this.source.getAccessor(),...this.opts}}}var u=r(80598),c=r(1764),h=r(62022);function p(t){return t.stride||t.size*t.bytesPerElement}function d(t,e){e.offset&&h.A.removed("shaderAttribute.offset","vertexOffset, elementOffset")();const r=p(t),i=(void 0!==e.vertexOffset?e.vertexOffset:t.vertexOffset||0)*r+(e.elementOffset||0)*t.bytesPerElement+(t.offset||0);return{...e,offset:i,stride:r}}class f{constructor(t,e,r){(0,i.A)(this,"gl",void 0),(0,i.A)(this,"id",void 0),(0,i.A)(this,"size",void 0),(0,i.A)(this,"settings",void 0),(0,i.A)(this,"value",void 0),(0,i.A)(this,"doublePrecision",void 0),(0,i.A)(this,"_buffer",void 0),(0,i.A)(this,"state",void 0),this.gl=t,this.id=e.id||"",this.size=e.size||1;const n=e.logicalType||e.type,s=5130===n;let l,{defaultValue:u}=e;u=Number.isFinite(u)?[u]:u||new Array(this.size).fill(0),l=s?5126:!n&&e.isIndexed?t&&(0,o.jI)(t,a.G.ELEMENT_INDEX_UINT32)?5125:5123:n||5126;let c=function(t){switch(t){case 5126:return Float32Array;case 5130:return Float64Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return Uint8ClampedArray;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Unknown GL type")}}(n||l||5126);this.doublePrecision=s,s&&!1===e.fp64&&(c=Float32Array),this.value=null,this.settings={...e,defaultType:c,defaultValue:u,logicalType:n,type:l,size:this.size,bytesPerElement:c.BYTES_PER_ELEMENT},this.state={...r,externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1},this._buffer=null}get isConstant(){return this.state.constant}get buffer(){if(!this._buffer){const{isIndexed:t,type:e}=this.settings;this._buffer=new s.A(this.gl,{id:this.id,target:t?34963:34962,accessor:{type:e}})}return this._buffer}get byteOffset(){const t=this.getAccessor();return t.vertexOffset?t.vertexOffset*p(t):0}get numInstances(){return this.state.numInstances}set numInstances(t){this.state.numInstances=t}delete(){this._buffer&&(this._buffer.delete(),this._buffer=null),u.A.release(this.state.allocatedValue)}getShaderAttributes(t,e){if(this.doublePrecision){const r={},i=this.value instanceof Float64Array,n=function(t,e){const r=d(t,e);return{high:r,low:{...r,offset:r.offset+4*t.size}}}(this.getAccessor(),e||{});return r[t]=new l(this,n.high),r["".concat(t,"64Low")]=i?new l(this,n.low):new Float32Array(this.size),r}if(e){const r=d(this.getAccessor(),e);return{[t]:new l(this,r)}}return{[t]:this}}getBuffer(){return this.state.constant?null:this.state.externalBuffer||this._buffer}getValue(){return this.state.constant?this.value:[this.getBuffer(),this.getAccessor()]}getAccessor(){return this.state.bufferAccessor}getBounds(){if(this.state.bounds)return this.state.bounds;let t=null;if(this.state.constant&&this.value){const e=Array.from(this.value);t=[e,e]}else{const{value:e,numInstances:r,size:i}=this,n=r*i;if(e&&n&&e.length>=n){const r=new Array(i).fill(1/0),o=new Array(i).fill(-1/0);for(let t=0;t<n;)for(let n=0;n<i;n++){const i=e[t++];i<r[n]&&(r[n]=i),i>o[n]&&(o[n]=i)}t=[r,o]}}return this.state.bounds=t,t}setData(t){const{state:e}=this;let r;r=ArrayBuffer.isView(t)?{value:t}:t instanceof s.A?{buffer:t}:t;const i={...this.settings,...r};if(e.bufferAccessor=i,e.bounds=null,r.constant){let t=r.value;t=this._normalizeValue(t,[],0),this.settings.normalized&&(t=this.normalizeConstant(t));if(!(!e.constant||!this._areValuesEqual(t,this.value)))return!1;e.externalBuffer=null,e.constant=!0,this.value=t}else if(r.buffer){const t=r.buffer;e.externalBuffer=t,e.constant=!1,this.value=r.value||null;const n=r.value instanceof Float64Array;i.type=r.type||t.accessor.type,i.bytesPerElement=t.accessor.BYTES_PER_ELEMENT*(n?2:1),i.stride=p(i)}else if(r.value){this._checkExternalBuffer(r);let t=r.value;e.externalBuffer=null,e.constant=!1,this.value=t,i.bytesPerElement=t.BYTES_PER_ELEMENT,i.stride=p(i);const{buffer:n,byteOffset:o}=this;
16this.doublePrecision&&t instanceof Float64Array&&(t=(0,c.cT)(t,i));const a=t.byteLength+o+2*i.stride;n.byteLength<a&&n.reallocate(a),n.setAccessor(null),n.subData({data:t,offset:o}),i.type=r.type||n.accessor.type}return!0}updateSubBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.state.bounds=null;const e=this.value,{startOffset:r=0,endOffset:i}=t;this.buffer.subData({data:this.doublePrecision&&e instanceof Float64Array?(0,c.cT)(e,{size:this.size,startIndex:r,endIndex:i}):e.subarray(r,i),offset:r*e.BYTES_PER_ELEMENT+this.byteOffset})}allocate(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{state:r}=this,i=r.allocatedValue,n=u.A.allocate(i,t+1,{size:this.size,type:this.settings.defaultType,copy:e});this.value=n;const{buffer:o,byteOffset:a}=this;return o.byteLength<n.byteLength+a&&(o.reallocate(n.byteLength+a),e&&i&&o.subData({data:i instanceof Float64Array?(0,c.cT)(i,this):i,offset:a})),r.allocatedValue=n,r.constant=!1,r.externalBuffer=null,r.bufferAccessor=this.settings,!0}_checkExternalBuffer(t){const{value:e}=t;if(!ArrayBuffer.isView(e))throw new Error("Attribute ".concat(this.id," value is not TypedArray"));const r=this.settings.defaultType;let i=!1;if(this.doublePrecision&&(i=e.BYTES_PER_ELEMENT<4),i)throw new Error("Attribute ".concat(this.id," does not support ").concat(e.constructor.name));e instanceof r||!this.settings.normalized||"normalized"in t||h.A.warn("Attribute ".concat(this.id," is normalized"))()}normalizeConstant(t){switch(this.settings.type){case 5120:return new Float32Array(t).map((t=>(t+128)/255*2-1));case 5122:return new Float32Array(t).map((t=>(t+32768)/65535*2-1));case 5121:return new Float32Array(t).map((t=>t/255));case 5123:return new Float32Array(t).map((t=>t/65535));default:return t}}_normalizeValue(t,e,r){const{defaultValue:i,size:n}=this.settings;if(Number.isFinite(t))return e[r]=t,e;if(!t)return e[r]=i[0],e;switch(n){case 4:e[r+3]=Number.isFinite(t[3])?t[3]:i[3];case 3:e[r+2]=Number.isFinite(t[2])?t[2]:i[2];case 2:e[r+1]=Number.isFinite(t[1])?t[1]:i[1];case 1:e[r+0]=Number.isFinite(t[0])?t[0]:i[0];break;default:let o=n;for(;--o>=0;)e[r+o]=Number.isFinite(t[o])?t[o]:i[o]}return e}_areValuesEqual(t,e){if(!t||!e)return!1;const{size:r}=this;for(let i=0;i<r;i++)if(t[i]!==e[i])return!1;return!0}}var m=r(35756),g=r(32288),y=r(19582);const v=[],_=[[0,1/0]];function b(t){const{source:e,target:r,start:i=0,size:n,getData:o}=t,a=t.end||r.length,s=e.length,l=a-i;if(s>l)return void r.set(e.subarray(0,l),i);if(r.set(e,i),!o)return;let u=s;for(;u<l;){const t=o(u,e);for(let e=0;e<n;e++)r[i+u]=t[e]||0,u++}}const x={interpolation:{duration:0,easing:t=>t},spring:{stiffness:.05,damping:.5}};function w(t,e){if(!t)return null;Number.isFinite(t)&&(t={type:"interpolation",duration:t});const r=t.type||"interpolation";return{...x[r],...e,...t,type:r}}function A(t,e){const r=e.getBuffer();return r?[r,{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function E(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(t,'"'))}}function T(t){t.push(t.shift())}function S(t,e){const{doublePrecision:r,settings:i,value:n,size:o}=t,a=r&&n instanceof Float64Array?2:1;return(i.noAlloc?n.length:e*o)*a}function P(t){let{buffer:e,numInstances:r,attribute:i,fromLength:n,fromStartIndices:o,getData:a=t=>t}=t;const s=i.doublePrecision&&i.value instanceof Float64Array?2:1,l=i.size*s,u=i.byteOffset,c=i.startIndices,h=o&&c,p=S(i,r),d=i.isConstant;if(!h&&n>=p)return;const f=d?i.value:i.getBuffer().getData({srcByteOffset:u});if(i.settings.normalized&&!d){const t=a;a=(e,r)=>i.normalizeConstant(t(e,r))}const m=d?(t,e)=>a(f,e):(t,e)=>a(f.subarray(t,t+l),e),g=e.getData({length:n}),y=new Float32Array(p);!function(t){let{source:e,target:r,size:i,getData:n,sourceStartIndices:o,targetStartIndices:a}=t;if(!Array.isArray(a))return b({source:e,target:r,size:i,getData:n}),r;let s=0,l=0;const u=n&&((t,e)=>n(t+l,e)),c=Math.min(o.length,a.length);for(let t=1;t<c;t++){const n=o[t]*i,c=a[t]*i;b({source:e.subarray(s,n),target:r,start:l,end:c,size:i,getData:u}),s=n,l=c}l<r.length&&b({source:[],target:r,start:l,size:i,getData:u})}({source:g,target:y,sourceStartIndices:o,targetStartIndices:c,size:l,getData:m}),e.byteLength<y.byteLength+u&&e.reallocate(y.byteLength+u),e.subData({data:y,offset:u})}class I extends f{constructor(t,e){super(t,e,{startIndices:null,lastExter
16nalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,updateRanges:_}),(0,i.A)(this,"constant",!1),this.settings.update=e.update||(e.accessor?this._autoUpdater:void 0),Object.seal(this.settings),Object.seal(this.state),this._validateAttributeUpdaters()}get startIndices(){return this.state.startIndices}set startIndices(t){this.state.startIndices=t}needsUpdate(){return this.state.needsUpdate}needsRedraw(){let{clearChangedFlags:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this.state.needsRedraw;return this.state.needsRedraw=e&&!t,e}getUpdateTriggers(){const{accessor:t}=this.settings;return[this.id].concat("function"!=typeof t&&t||[])}supportsTransition(){return Boolean(this.settings.transition)}getTransitionSetting(t){if(!t||!this.supportsTransition())return null;const{accessor:e}=this.settings,r=this.settings.transition;return w(Array.isArray(e)?t[e.find((e=>t[e]))]:t[e],r)}setNeedsUpdate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,e=arguments.length>1?arguments[1]:void 0;if(this.state.needsUpdate=this.state.needsUpdate||t,this.setNeedsRedraw(t),e){const{startRow:t=0,endRow:r=1/0}=e;this.state.updateRanges=function(t,e){if(t===_)return t;if(e[0]<0&&(e[0]=0),e[0]>=e[1])return t;const r=[],i=t.length;let n=0;for(let o=0;o<i;o++){const i=t[o];i[1]<e[0]?(r.push(i),n=o+1):i[0]>e[1]?r.push(i):e=[Math.min(i[0],e[0]),Math.max(i[1],e[1])]}return r.splice(n,0,e),r}(this.state.updateRanges,[t,r])}else this.state.updateRanges=_}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=v}setNeedsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.state.needsRedraw=this.state.needsRedraw||t}allocate(t){const{state:e,settings:r}=this;return!r.noAlloc&&(!!r.update&&(super.allocate(t,e.updateRanges!==_),!0))}updateBuffer(t){let{numInstances:e,data:r,props:i,context:n}=t;if(!this.needsUpdate())return!1;const{state:{updateRanges:o},settings:{update:a,noAlloc:s}}=this;let l=!0;if(a){for(const[t,s]of o)a.call(n,this,{data:r,startRow:t,endRow:s,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength<this.value.byteLength+this.byteOffset)this.setData({value:this.value,constant:this.constant}),this.constant=!1;else for(const[t,r]of o){const i=Number.isFinite(t)?this.getVertexOffset(t):0,n=Number.isFinite(r)?this.getVertexOffset(r):s||!Number.isFinite(e)?this.value.length:e*this.size;super.updateSubBuffer({startOffset:i,endOffset:n})}else;this._checkAttributeArray()}else l=!1;return this.clearNeedsUpdate(),this.setNeedsRedraw(),l}setConstantValue(t){if(void 0===t||"function"==typeof t)return!1;return this.setData({constant:!0,value:t})&&this.setNeedsRedraw(),this.clearNeedsUpdate(),!0}setExternalBuffer(t){const{state:e}=this;return t?(this.clearNeedsUpdate(),e.lastExternalBuffer===t||(e.lastExternalBuffer=t,this.setNeedsRedraw(),this.setData(t)),!0):(e.lastExternalBuffer=null,!1)}setBinaryValue(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{state:r,settings:i}=this;if(!t)return r.binaryValue=null,r.binaryAccessor=null,!1;if(i.noAlloc)return!1;if(r.binaryValue===t)return this.clearNeedsUpdate(),!0;r.binaryValue=t,this.setNeedsRedraw();if(i.transform||e!==this.startIndices){ArrayBuffer.isView(t)&&(t={value:t});const n=t;(0,m.A)(ArrayBuffer.isView(n.value),"invalid ".concat(i.accessor));const o=Boolean(n.size)&&n.size!==this.size;return r.binaryAccessor=(0,g.I)(n.value,{size:n.size||this.size,stride:n.stride,offset:n.offset,startIndices:e,nested:o}),!1}return this.clearNeedsUpdate(),this.setData(t),!0}getVertexOffset(t){const{startIndices:e}=this;return(e?e[t]:t)*this.size}getShaderAttributes(){const t=this.settings.shaderAttributes||{[this.id]:null},e={};for(const r in t)Object.assign(e,super.getShaderAttributes(r,t[r]));return e}_autoUpdater(t,e){let{data:r,startRow:i,endRow:n,props:o,numInstances:a}=e;if(t.constant)return;const{settings:s,state:l,value:u,size:c,startIndices:h}=t,{accessor:p,transform:d}=s,f=l.binaryAccessor||("function"==typeof p?p:o[p]);(0,m.A)("function"==typeof f,'accessor "'.concat(p,'" is not a function'));let v=t.getVertexOffset(i);const{iterable:_,objectInfo:b}=(0,g.X)(r,i,n);for(const e of _){b.index++;let r=f(e,b);if(d&&(r=d.call(this,r)),h){const e=(b.index<h.length-1?h[b.index+1]:a)-h[b.index];if(r&&Array.isArray(r[0])){let e=v;for(const i of r)t._normalizeValue(i,u,e),e+=c}else r&&r.length>c?u.set(r,v):(t._normalizeValue(r,b.target,0),(0,y.R)({target:u,source:b.target,start:v,count:e}));v+=e*c}else t._normalizeValue(r,u,v),v+=c}}_validateAttributeUpdaters(){const{settings:t}=this;if(!(t.noAlloc||"function"==typeof t.update))throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:t}=this,e=Math.min(4,this.size);if(t&&t.length>=e){let r=!0;switch(e){case 4:r=r&&Number.isFinite(t[3]);case 3:r=r&&Number.isFinite(t[2]);case 2:r=r&&Number.isFinite(t[1]);case 1:r=r&&Number.isFinite(t[0]);break;default:r=!1}if(!r)throw new Error("Illegal attribute generated for ".concat(this.id
16))}}}var M=r(18718),C=r(59885);const k="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",L="#version 300 es\n".concat(k);function z(t,e){e=Array.isArray(e)?e:[e];const r=t.replace(/^\s+/,"").split(/\s+/),[i,n,o]=r;if(!e.includes(i)||!n||!o)return null;return{qualifier:i,type:n,name:o.split(";")[0]}}function R(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{version:e=100,input:r,inputType:i,output:n}=t;if(!r)return 300===e?L:e>300?"#version ".concat(e,"\n").concat(k):"void main() {gl_FragColor = vec4(0);}";const o=function(t,e){switch(e){case"float":return"vec4(".concat(t,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(t,", 0.0, 1.0)");case"vec3":return"vec4(".concat(t,", 1.0)");case"vec4":return t;default:return(0,C.A)(!1),null}}(r,i);return e>=300?"#version ".concat(e," ").concat(300===e?"es":"","\nin ").concat(i," ").concat(r,";\nout vec4 ").concat(n,";\nvoid main() {\n ").concat(n," = ").concat(o,";\n}"):"varying ".concat(i," ").concat(r,";\nvoid main() {\n gl_FragColor = ").concat(o,";\n}")}var O=r(56706),D=r(45638),B=r(57971);class F{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}setupResources(t){for(const e of this.bindings)this._setupTransformFeedback(e,t)}updateModelProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{varyings:e}=this;return e.length>0&&(t=Object.assign({},t,{varyings:e})),t}getDrawOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this.bindings[this.currentIndex],{sourceBuffers:r,transformFeedback:i}=e;return{attributes:Object.assign({},r,t.attributes),transformFeedback:i}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(t)}getBuffer(t){const{feedbackBuffers:e}=this.bindings[this.currentIndex],r=t?e[t]:null;return r?r instanceof s.A?r:r.buffer:null}getData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{varyingName:e}=t,r=this.getBuffer(e);return r?r.getData():null}delete(){for(const t in this.resources)this.resources[t].delete()}_initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(t),this.varyings=t.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&(0,B.v)((0,O.C6)(this.gl))}_getFeedbackBuffers(t){const{sourceBuffers:e={}}=t,r={};if(this.bindings[this.currentIndex]&&Object.assign(r,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const t in this.feedbackMap){const i=this.feedbackMap[t];t in e&&(r[i]=t)}Object.assign(r,t.feedbackBuffers);for(const t in r){const i=r[t];if("string"==typeof i){const n=e[i],{byteLength:o,usage:a,accessor:s}=n;r[t]=this._createNewBuffer(t,{byteLength:o,usage:a,accessor:s})}}return r}_setupBuffers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceBuffers:e=null}=t;Object.assign(this.feedbackMap,t.feedbackMap);const r=this._getFeedbackBuffers(t);this._updateBindings({sourceBuffers:e,feedbackBuffers:r})}_setupTransformFeedback(t,e){let{model:r}=e;const{program:i}=r;t.transformFeedback=new D.A(this.gl,{program:i,buffers:t.feedbackBuffers})}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:e}=this._swapBuffers(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:t,feedbackBuffers:e})}}_updateBinding(t,e){return t?(Object.assign(t.sourceBuffers,e.sourceBuffers),Object.assign(t.feedbackBuffers,e.feedbackBuffers),t.transformFeedback&&t.transformFeedback.setBuffers(t.feedbackBuffers),t):{sourceBuffers:Object.assign({},e.sourceBuffers),feedbackBuffers:Object.assign({},e.feedbackBuffers)}}_swapBuffers(t){if(!this.feedbackMap)return null;const e=Object.assign({},t.sourceBuffers),r=Object.assign({},t.feedbackBuffers);for(const i in this.feedbackMap){const n=this.feedbackMap[i];e[i]=t.feedbackBuffers[n],r[n]=t.sourceBuffers[i],(0,B.v)(r[n]instanceof s.A)}return{sourceBuffers:e,feedbackBuffers:r}}_createNewBuffer(t,e){const r=new s.A(this.gl,e);return this.resources[t]&&this.resources[t].delete(),this.resources[t]=r,r}_getNextIndex(){return(this.currentIndex+1)%2}}var j=r(58713),N=r(96424),U=r(94755),V=r(39699);function q(t){let e=100;const r=t.match(/[^\s]+/g);if(r.length>=2&&"#version"===r[0]){const t=parseInt(r[1],10);Number.isFinite(t)&&(e=t)}return e}var G=r(15518);const Z={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},W="transform_uSampler_",H="transform_uSize_",X="transform_position";function Y(t){let{vs:e,sourceTextureMap:r,targetTextureVarying:i,targetTexture:n}=t;let o=Object.keys(r).length,a=null;const s={};let l=e,u={};if(o>0||i){const t=l.split("\n"),e=t.slice();if(t.forEach(((t,n,l)=>{if(o>0){const i=function(t,e){const r={},i=function(t){return z(t,["attribute","in"])}(t);if(!i)return null;const{type:n,name:o}=i;if(o&&e[o]){const e="// ".concat(t," => Replaced by Transform with a sampler"),{samplerName:i,sizeName:a,uniformDeclerations:s}=function(t){const e="".concat(W).concat(t),r="".concat(H).concat(t),i=" uniform sampler2D ".concat(e,";
16\n uniform vec2 ").concat(r,";");return{samplerName:e,sizeName:r,uniformDeclerations:i}}(o),l=function(t){switch(t){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return(0,C.A)(!1),null}}(n),u=" ".concat(n," ").concat(o," = transform_getInput(").concat(i,", ").concat(a,").").concat(l,";\n");r[i]=o;return{updatedLine:e,inject:{"vs:#decl":s,"vs:#main-start":u},samplerTextureMap:r}}return null}(t,r);if(i){const{updatedLine:t,inject:r}=i;e[n]=t,u=(0,G.Qt)([u,r]),Object.assign(s,i.samplerTextureMap),o--}}i&&!a&&(a=function(t,e){const r=z(t,["varying","out"]);if(!r)return null;return r.name===e?r.type:null}(t,i))})),i){(0,B.v)(n);const t="".concat(H).concat(i),e={"vs:#decl":"uniform vec2 ".concat(t,";\n"),"vs:#main-start":" vec2 ".concat(X," = transform_getPos(").concat(t,");\n gl_Position = vec4(").concat(X,", 0, 1.);\n")};u=(0,G.Qt)([u,e])}l=e.join("\n")}return{vs:l,targetTextureType:a,inject:u,samplerTextureMap:s}}const K={10241:9728,10240:9728,10242:33071,10243:33071};class J{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}updateModelProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._processVertexShader(t);return Object.assign({},t,e)}getDrawOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceBuffers:e,sourceTextures:r,framebuffer:i,targetTexture:n}=this.bindings[this.currentIndex],o=Object.assign({},e,t.attributes),a=Object.assign({},t.uniforms),s=Object.assign({},t.parameters);let l=t.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const t in this.samplerTextureMap){const e=this.samplerTextureMap[t];a[t]=r[e]}this._setSourceTextureParameters();const t=function(t){let{sourceTextureMap:e,targetTextureVarying:r,targetTexture:i}=t;const n={};let o,a;r&&(({width:o,height:a}=i),n["".concat(H).concat(r)]=[o,a]);for(const t in e)({width:o,height:a}=e[t]),n["".concat(H).concat(t)]=[o,a];return n}({sourceTextureMap:r,targetTextureVarying:this.targetTextureVarying,targetTexture:n});Object.assign(a,t)}return this.hasTargetTexture&&(l=!1,s.viewport=[0,0,i.width,i.height]),{attributes:o,framebuffer:i,uniforms:a,discard:l,parameters:s}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupTextures(t)}getTargetTexture(){const{targetTexture:t}=this.bindings[this.currentIndex];return t}getData(){let{packed:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{framebuffer:e}=this.bindings[this.currentIndex],r=(0,j.sy)(e);if(!t)return r;const i=r.constructor,n=function(t){switch(t){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return(0,C.A)(!1),null}}(this.targetTextureType),o=new i(r.length*n/4);let a=0;for(let t=0;t<r.length;t+=4)for(let e=0;e<n;e++)o[a++]=r[t+e];return o}getFramebuffer(){return this.bindings[this.currentIndex].framebuffer}delete(){this.ownTexture&&this.ownTexture.delete(),this.elementIDBuffer&&this.elementIDBuffer.delete()}_initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{_targetTextureVarying:e,_swapTexture:r}=t;this._swapTexture=r,this.targetTextureVarying=e,this.hasTargetTexture=e,this._setupTextures(t)}_createTargetTexture(t){const{sourceTextures:e,textureOrReference:r}=t;if(r instanceof N.A)return r;const i=e[r];return i?(this._targetRefTexName=r,this._createNewTexture(i)):null}_setupTextures(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceBuffers:e,_sourceTextures:r={},_targetTexture:i}=t,n=this._createTargetTexture({sourceTextures:r,textureOrReference:i});this.hasSourceTextures=this.hasSourceTextures||r&&Object.keys(r).length>0,this._updateBindings({sourceBuffers:e,sourceTextures:r,targetTexture:n}),"elementCount"in t&&this._updateElementIDBuffer(t.elementCount)}
16_updateElementIDBuffer(t){if("number"!=typeof t||this.elementCount>=t)return;const e=new Float32Array(t);e.forEach(((t,e,r)=>{r[e]=e})),this.elementIDBuffer?this.elementIDBuffer.setData({data:e}):this.elementIDBuffer=new s.A(this.gl,{data:e,accessor:{size:1}}),this.elementCount=t}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this._swapTexture){const{sourceTextures:t,targetTexture:e}=this._swapTextures(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:t,targetTexture:e})}}_updateBinding(t,e){const{sourceBuffers:r,sourceTextures:i,targetTexture:n}=e;if(t||(t={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(t.sourceTextures,i),Object.assign(t.sourceBuffers,r),n){t.targetTexture=n;const{width:e,height:r}=n,{framebuffer:i}=t;i?(i.update({attachments:{36064:n},resizeAttachments:!1}),i.resize({width:e,height:r})):t.framebuffer=new U.A(this.gl,{id:"transform-framebuffer",width:e,height:r,attachments:{36064:n}})}return t}_setSourceTextureParameters(){const t=this.currentIndex,{sourceTextures:e}=this.bindings[t];for(const t in e)e[t].setParameters(K)}_swapTextures(t){if(!this._swapTexture)return null;const e=Object.assign({},t.sourceTextures);e[this._swapTexture]=t.targetTexture;return{sourceTextures:e,targetTexture:t.sourceTextures[this._swapTexture]}}_createNewTexture(t){const e=(0,V.j)(t,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=e,e}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceTextures:e,targetTexture:r}=this.bindings[this.currentIndex],{vs:i,uniforms:n,targetTextureType:o,inject:a,samplerTextureMap:s}=Y({vs:t.vs,sourceTextureMap:e,targetTextureVarying:this.targetTextureVarying,targetTexture:r}),l=(0,G.Qt)([t.inject||{},a]);this.targetTextureType=o,this.samplerTextureMap=s;return{vs:i,fs:t._fs||R({version:q(i),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Z].concat(t.modules||[]):t.modules,uniforms:n,inject:l}}}var Q=r(30856),$=r(86939);class tt{static isSupported(t){return(0,O.C6)(t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(e),Object.seal(this)}delete(){const{model:t,bufferTransform:e,textureTransform:r}=this;t&&t.delete(),e&&e.delete(),r&&r.delete()}run(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clearRenderTarget:e=!0}=t,r=this._updateDrawOptions(t);e&&r.framebuffer&&r.framebuffer.clear({color:!0}),this.model.transform(r)}swap(){let t=!1;const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of e)t=t||r.swap();(0,B.v)(t,"Nothing to swap")}getBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.bufferTransform&&this.bufferTransform.getBuffer(t)}getData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of e){const e=r.getData(t);if(e)return e}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"elementCount"in t&&this.model.setVertexCount(t.elementCount);const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of e)r.update(t)}_initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{gl:e}=this;this._buildResourceTransforms(e,t),t=this._updateModelProps(t),this.model=new $.A(e,Object.assign({},t,{fs:t.fs||R({version:q(t.vs)}),id:t.id||"transform-model",drawMode:t.drawMode||0,vertexCount:t.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(t){let e=Object.assign({},t);
16const r=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const t of r)e=t.updateModelProps(e);return e}_buildResourceTransforms(t,e){(function(t){if(!(0,Q.ZF)(t.feedbackBuffers)||!(0,Q.ZF)(t.feedbackMap)||t.varyings&&t.varyings.length>0)return!0;return!1})(e)&&(this.bufferTransform=new F(t,e)),function(t){if(!(0,Q.ZF)(t._sourceTextures)||t._targetTexture||t._targetTextureVarying)return!0;return!1}(e)&&(this.textureTransform=new J(t,e)),(0,B.v)(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(t){let e=Object.assign({},t);const r=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const t of r)e=Object.assign(e,t.getDrawOptions(e));return e}}var et=r(57974);const rt="\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n";const it={interpolation:class{constructor(t){let{gl:e,attribute:r,timeline:n}=t;(0,i.A)(this,"gl",void 0),(0,i.A)(this,"type","interpolation"),(0,i.A)(this,"attributeInTransition",void 0),(0,i.A)(this,"settings",void 0),(0,i.A)(this,"attribute",void 0),(0,i.A)(this,"transition",void 0),(0,i.A)(this,"currentStartIndices",void 0),(0,i.A)(this,"currentLength",void 0),(0,i.A)(this,"transform",void 0),(0,i.A)(this,"buffers",void 0),this.gl=e,this.transition=new et.A(n),this.attribute=r,this.attributeInTransition=new I(e,r.settings),this.currentStartIndices=r.startIndices,this.currentLength=0,this.transform=function(t,e){const r=E(e.size);return new tt(t,{vs:rt,defines:{ATTRIBUTE_TYPE:r},varyings:["vCurrent"]})}(e,r);const o={byteLength:0,usage:35050};this.buffers=[new s.A(e,o),new s.A(e,o)]}get inProgress(){return this.transition.inProgress}start(t,e){if(t.duration<=0)return void this.transition.cancel();this.settings=t;const{gl:r,buffers:i,attribute:n}=this;T(i);const o={numInstances:e,attribute:n,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const t of i)P({buffer:t,...o});this.currentStartIndices=n.startIndices,this.currentLength=S(n,e),this.attributeInTransition.setData({buffer:i[1],value:n.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/n.size),sourceBuffers:{aFrom:i[0],aTo:A(0,n)},feedbackBuffers:{vCurrent:i[1]}})}update(){const t=this.transition.update();if(t){const{duration:t,easing:e}=this.settings,{time:r}=this.transition;let i=r/t;e&&(i=e(i)),this.transform.run({uniforms:{time:i}})}return t}cancel(){this.transition.cancel(),this.transform.delete();for(const t of this.buffers)t.delete();this.buffers.length=0}},spring:class{constructor(t){let{gl:e,attribute:r,timeline:n}=t;(0,i.A)(this,"gl",void 0),(0,i.A)(this,"type","spring"),(0,i.A)(this,"attributeInTransition",void 0),(0,i.A)(this,"settings",void 0),(0,i.A)(this,"attribute",void 0),(0,i.A)(this,"transition",void 0),(0,i.A)(this,"currentStartIndices",void 0),(0,i.A)(this,"currentLength",void 0),(0,i.A)(this,"texture",void 0),(0,i.A)(this,"framebuffer",void 0),(0,i.A)(this,"transform",void 0),(0,i.A)(this,"buffers",void 0),this.gl=e,this.type="spring",this.transition=new et.A(n),this.attribute=r,this.attributeInTransition=new I(e,{...r.settings,normalized:!1}),this.currentStartIndices=r.startIndices,this.currentLength=0,this.texture=function(t){return new N.A(t,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function(t,e){return new U.A(t,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(e,this.texture),this.transform=function(t,e,r){const i=E(e.size);return new tt(t,{framebuffer:r,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(e,r,this.framebuffer);const o={byteLength:0,usage:35050};this.buffers=[new s.A(e,o),new s.A(e,o),new s.A(e,o)]}get inProgress(){return this.transition.inProgress}start(t,e){const{gl:r,buffers:i,attribute:n}=this,o={numInstances:e,attribute:n,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const t of i)P({buffer:t,...o}
16);this.settings=t,this.currentStartIndices=n.startIndices,this.currentLength=S(n,e),this.attributeInTransition.setData({buffer:i[1],value:n.value}),this.transition.start({...t,duration:1/0}),this.transform.update({elementCount:Math.floor(this.currentLength/n.size),sourceBuffers:{aTo:A(0,n)}})}update(){const{buffers:t,transform:e,framebuffer:r,transition:i}=this;if(!i.update())return!1;const n=this.settings;e.update({sourceBuffers:{aPrev:t[0],aCur:t[1]},feedbackBuffers:{vNext:t[2]}}),e.run({framebuffer:r,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:n.stiffness,damping:n.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),T(t),this.attributeInTransition.setData({buffer:t[1],value:this.attribute.value});return(0,j.sy)(r)[0]>0||i.end(),!0}cancel(){this.transition.cancel(),this.transform.delete();for(const t of this.buffers)t.delete();this.buffers.length=0,this.texture.delete(),this.framebuffer.delete()}}};class nt{constructor(t,e){let{id:r,timeline:n}=e;(0,i.A)(this,"id",void 0),(0,i.A)(this,"isSupported",void 0),(0,i.A)(this,"gl",void 0),(0,i.A)(this,"timeline",void 0),(0,i.A)(this,"transitions",void 0),(0,i.A)(this,"needsRedraw",void 0),(0,i.A)(this,"numInstances",void 0),this.id=r,this.gl=t,this.timeline=n,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=tt.isSupported(t)}finalize(){for(const t in this.transitions)this._removeTransition(t)}update(t){let{attributes:e,transitions:r,numInstances:i}=t;this.numInstances=i||1;for(const t in e){const i=e[t],n=i.getTransitionSetting(r);n&&this._updateAttribute(t,i,n)}for(const t in this.transitions){const i=e[t];i&&i.getTransitionSetting(r)||this._removeTransition(t)}}hasAttribute(t){const e=this.transitions[t];return e&&e.inProgress}getAttributes(){const t={};for(const e in this.transitions){const r=this.transitions[e];r.inProgress&&(t[e]=r.attributeInTransition)}return t}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const t in this.transitions){this.transitions[t].update()&&(this.needsRedraw=!0)}const t=this.needsRedraw;return this.needsRedraw=!1,t}_removeTransition(t){this.transitions[t].cancel(),delete this.transitions[t]}_updateAttribute(t,e,r){const i=this.transitions[t];let n=!i||i.type!==r.type;if(n){if(!this.isSupported)return void h.A.warn("WebGL2 not supported by this browser. Transition for ".concat(t," is disabled."))();i&&this._removeTransition(t);const o=it[r.type];o?this.transitions[t]=new o({attribute:e,timeline:this.timeline,gl:this.gl}):(h.A.error("unsupported transition type '".concat(r.type,"'"))(),n=!1)}(n||e.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(r,this.numInstances))}}const ot="attributeManager.invalidate";class at{constructor(t){let{id:e="attribute-manager",stats:r,timeline:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.A)(this,"id",void 0),(0,i.A)(this,"gl",void 0),(0,i.A)(this,"attributes",void 0),(0,i.A)(this,"updateTriggers",void 0),(0,i.A)(this,"needsRedraw",void 0),(0,i.A)(this,"userData",void 0),(0,i.A)(this,"stats",void 0),(0,i.A)(this,"attributeTransitionManager",void 0),this.id=e,this.gl=t,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=r,this.attributeTransitionManager=new nt(t,{id:"".concat(e,"-transitions"),timeline:n}),Object.seal(this)}finalize(){for(const t in this.attributes)this.attributes[t].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!t.clearRedrawFlags,e&&this.id}setNeedsRedraw(){this.needsRedraw=!0}add(t){this._add(t)}addInstanced(t){this._add(t,{instanced:1})}remove(t){for(const e of t)void 0!==this.attributes[e]&&(this.attributes[e].delete(),delete this.attributes[e])}invalidate(t,e){const r=this._invalidateTrigger(t,e);(0,M.A)(ot,this,t,r)}invalidateAll(t){for(const e in this.attributes)this.attributes[e].setNeedsUpdate(e,t);(0,M.A)(ot,this,"all")}update(t){let{data:e,numInstances:r,startIndices:i=null,transitions:n,props:o={},buffers:a={},context:s={}}=t,l=!1;(0,M.A)("attributeManager.updateStart",this),this.stats&&this.stats.get("Update Attributes").timeStart();for(const t in this.attributes){const n=this.attributes[t],u=n.settings.accessor;n.startIndices=i,n.numInstances=r,o[t]&&h.A.removed("props.".concat(t),"data.attributes.".concat(t))(),n.setExternalBuffer(a[t])||n.setBinaryValue("string"==typeof u?a[u]:void 0,e.startIndices)||"string"==typeof u&&!a[u]&&n.setConstantValue(o[u])||n.needsUpdate()&&(l=!0,this._updateAttribute({attribute:n,numInstances:r,data:e,props:o,context:s})),this.needsRedraw=this.needsRedraw||n.needsRedraw()}l&&(0,M.A)("attributeManager.updateEnd",this,r),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:r,transitions:n})}updateTransition(){const{attributeTransitionManager:t}=this,e=t.run();return this.needsRedraw=this.needsRedraw||e,e}getAttributes(){return this.attributes}getChangedAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1};const{attributes:e,attributeTransitionManager:r}=this,i={...r.getAttributes()};for(const n in e){const o=e[n];o.needsRedraw(t)&&!r.hasAttribute(n)&&(i[n]=o)}return i}getShaderAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t||(t=this.getAttributes());const r={};for(const i in t)e[i]||Object.assign(r,t[i].getShaderAttributes());return r}_add(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(const r in t){const i=t[r];this.attributes[r]=this._createAttribute(r,i,e)}this._mapUpdateTriggersToAttributes()}_createAttribute(t,e,r){const i={...e,id:t,size:(e.isIndexed?1:e.size)||1,divisor:r.instanced?1:e.divisor||0};return new I(this.gl,i)}_mapUpdateTriggersToAttributes(){const t={};for(const e in this.attributes){this.attributes[e].getUpdateTriggers().forEac
16h((r=>{t[r]||(t[r]=[]),t[r].push(e)}))}this.updateTriggers=t}_invalidateTrigger(t,e){const{attributes:r,updateTriggers:i}=this,n=i[t];return n&&n.forEach((t=>{const i=r[t];i&&i.setNeedsUpdate(i.id,e)})),n}_updateAttribute(t){const{attribute:e,numInstances:r}=t;if((0,M.A)("attribute.updateStart",e),e.constant)return void e.setConstantValue(e.value);e.allocate(r)&&(0,M.A)("attribute.allocate",e,r);e.updateBuffer(t)&&(this.needsRedraw=!0,(0,M.A)("attribute.updateEnd",e,r))}}var st=r(44504);class lt extends et.A{get value(){return this._value}_onUpdate(){const{time:t,settings:{fromValue:e,toValue:r,duration:i,easing:n}}=this,o=n(t/i);this._value=(0,st.Cc)(e,r,o)}}const ut=1e-5;function ct(t,e,r,i,n){const o=e-t;return(r-e)*n+-o*i+o+e}function ht(t,e){if(Array.isArray(t)){let r=0;for(let i=0;i<t.length;i++){const n=t[i]-e[i];r+=n*n}return Math.sqrt(r)}return Math.abs(t-e)}class pt extends et.A{get value(){return this._currValue}_onUpdate(){const{fromValue:t,toValue:e,damping:r,stiffness:i}=this.settings,{_prevValue:n=t,_currValue:o=t}=this;let a=function(t,e,r,i,n){if(Array.isArray(r)){const o=[];for(let a=0;a<r.length;a++)o[a]=ct(t[a],e[a],r[a],i,n);return o}return ct(t,e,r,i,n)}(n,o,e,r,i);const s=ht(a,e),l=ht(a,o);s<ut&&l<ut&&(a=e,this.end()),this._prevValue=o,this._currValue=a}}const dt={interpolation:lt,spring:pt};class ft{constructor(t){this.transitions=new Map,this.timeline=t}get active(){return this.transitions.size>0}add(t,e,r,i){const{transitions:n}=this;if(n.has(t)){const r=n.get(t),{value:i=r.settings.fromValue}=r;e=i,this.remove(t)}if(!(i=w(i)))return;const o=dt[i.type];if(!o)return void h.A.error("unsupported transition type '".concat(i.type,"'"))();const a=new o(this.timeline);a.start({...i,fromValue:e,toValue:r}),n.set(t,a)}remove(t){const{transitions:e}=this;e.has(t)&&(e.get(t).cancel(),e.delete(t))}update(){const t={};for(const[e,r]of this.transitions)r.update(),t[e]=r.value,r.inProgress||this.remove(e);return t}clear(){for(const t of this.transitions.keys())this.remove(t)}}var mt=r(42444);function gt(t,e){const r=vt({newProps:t,oldProps:e,propTypes:wt(t),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(t,e){if(null===e)return"oldProps is null, initial diff";let r=!1;const{dataComparator:i,_dataDiff:n}=t;i?i(t.data,e.data)||(r="Data comparator detected a change"):t.data!==e.data&&(r="A new data container was supplied");r&&n&&(r=n(t.data,e.data)||r);return r}(t,e);let n=!1;return i||(n=function(t,e){if(null===e)return{all:!0};if("all"in t.updateTriggers){if(xt(t,e,"all"))return{all:!0}}const r={};let i=!1;for(const n in t.updateTriggers)if("all"!==n){xt(t,e,n)&&(r[n]=!0,i=!0)}return!!i&&r}(t,e)),{dataChanged:i,propsChanged:r,updateTriggersChanged:n,extensionsChanged:bt(t,e),transitionsChanged:yt(t,e)}}function yt(t,e){if(!t.transitions)return!1;const r={},i=wt(t);let n=!1;for(const o in t.transitions){const a=i[o],s=a&&a.type;("number"===s||"color"===s||"array"===s)&&_t(t[o],e[o],a)&&(r[o]=!0,n=!0)}return!!n&&r}function vt(t){let{newProps:e,oldProps:r,ignoreProps:i={},propTypes:n={},triggerName:o="props"}=t;if(r===e)return!1;if("object"!=typeof e||null===e)return"".concat(o," changed shallowly");if("object"!=typeof r||null===r)return"".concat(o," changed shallowly");for(const t of Object.keys(e))if(!(t in i)){if(!(t in r))return"".concat(o,".").concat(t," added");const i=_t(e[t],r[t],n[t]);if(i)return"".concat(o,".").concat(t," ").concat(i)}for(const t of Object.keys(r))if(!(t in i)){if(!(t in e))return"".concat(o,".").concat(t," dropped");if(!Object.hasOwnProperty.call(e,t)){const i=_t(e[t],r[t],n[t]);if(i)return"".concat(o,".").concat(t," ").concat(i)}}return!1}function _t(t,e,r){let i=r&&r.equal;return i&&!i(t,e,r)?"changed deeply":i||(i=t&&e&&t.equals,!i||i.call(t,e))?i||e===t?null:"changed shallowly":"changed deeply"}function bt(t,e){if(null===e)return!0;const r=e.extensions,{extensions:i}=t;if(i===r)return!1;if(!r||!i)return!0;if(i.length!==r.length)return!0;for(let t=0;t<i.length;t++)if(!i[t].equals(r[t]))return!0;return!1}function xt(t,e,r){let i=t.updateTriggers[r];i=null==i?{}:i;let n=e.updateTriggers[r];n=null==n?{}:n;return vt({oldProps:n,newProps:i,triggerName:r})}function wt(t){const e=t[mt.r3],r=e&&e.constructor;return r?r._propTypes:{}}function At(t){if(!function(t){return null!==t&&"object"==typeof t}(t))throw new Error("count(): argument not an object");
16if("function"==typeof t.count)return t.count();if(Number.isFinite(t.size))return t.size;if(Number.isFinite(t.length))return t.length;if(function(t){return null!==t&&"object"==typeof t&&t.constructor===Object}(t))return Object.keys(t).length;throw new Error("count(): argument not a container")}var Et=r(92700);function Tt(t,e){if(!e)return t;const r={...t,...e};if("defines"in e&&(r.defines={...t.defines,...e.defines}),"modules"in e&&(r.modules=(t.modules||[]).concat(e.modules),e.modules.some((t=>"project64"===t.name)))){const t=r.modules.findIndex((t=>"project32"===t.name));t>=0&&r.modules.splice(t,1)}if("inject"in e)if(t.inject){const i={...t.inject};for(const t in e.inject)i[t]=(i[t]||"")+e.inject[t];r.inject=i}else r.inject=e.inject;return r}var St=r(46127),Pt=r(5575),It=r(70549),Mt=r(46752),Ct=r(99932);function kt(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=e.projectPosition(t);if(r&&e instanceof Pt.A){const[r,n,o=0]=t,a=e.getDistanceScales([r,n]);i[2]=o*a.unitsPerMeter[2]}return i}function Lt(t,e){let{viewport:r,modelMatrix:i,coordinateSystem:o,coordinateOrigin:a,offsetMode:s}=e,[l,u,c=0]=t;switch(i&&([l,u,c]=It.Z0([],[l,u,c,1],i)),o){case n.rf.LNGLAT:return kt([l,u,c],r,s);case n.rf.LNGLAT_OFFSETS:return kt([l+a[0],u+a[1],c+(a[2]||0)],r,s);case n.rf.METER_OFFSETS:return kt((0,Ct.dT)(a,[l,u,c]),r,s);case n.rf.CARTESIAN:default:return r.isGeospatial?[l+a[0],u+a[1],c+a[2]]:r.projectPosition([l,u,c])}}function zt(t,e){const{viewport:r,coordinateSystem:i,coordinateOrigin:o,modelMatrix:a,fromCoordinateSystem:s,fromCoordinateOrigin:l}=function(t){const{viewport:e,modelMatrix:r,coordinateOrigin:i}=t;let{coordinateSystem:o,fromCoordinateSystem:a,fromCoordinateOrigin:s}=t;return o===n.rf.DEFAULT&&(o=e.isGeospatial?n.rf.LNGLAT:n.rf.CARTESIAN),void 0===a&&(a=o),void 0===s&&(s=i),{viewport:e,coordinateSystem:o,coordinateOrigin:i,modelMatrix:r,fromCoordinateSystem:a,fromCoordinateOrigin:s}}(e),{geospatialOrigin:u,shaderCoordinateOrigin:c,offsetMode:h}=(0,St.o)(r,i,o),p=Lt(t,{viewport:r,modelMatrix:a,coordinateSystem:s,coordinateOrigin:l,offsetMode:h});if(h){const t=r.projectPosition(u||c);Mt.jb(p,p,t)}return p}const Rt={10241:9987,10240:9729,10242:33071,10243:33071},Ot={};var Dt=r(34793);const Bt={boolean:{validate:(t,e)=>!0,equal:(t,e,r)=>Boolean(t)===Boolean(e)},number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},color:{validate:(t,e)=>e.optional&&!t||Ut(t)&&(3===t.length||4===t.length),equal:(t,e,r)=>Ft(t,e)},accessor:{validate(t,e){const r=Vt(t);return"function"===r||r===Vt(e.value)},equal:(t,e,r)=>"function"==typeof e||Ft(t,e)},array:{validate:(t,e)=>e.optional&&!t||Ut(t),equal:(t,e,r)=>r.compare?Ft(t,e):t===e},object:{equal:(t,e,r)=>r.compare?(0,Dt.b)(t,e):t===e},function:{validate:(t,e)=>e.optional&&!t||"function"==typeof t,equal:(t,e,r)=>!r.compare||t===e},data:{transform:(t,e,r)=>{const{dataTransform:i}=r.props;return i&&t?i(t):t}},image:{transform:(t,e,r)=>function(t,e){const r=t.context&&t.context.gl;if(!r||!e)return null;if(e instanceof N.A)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const n=new N.A(r,{...e,parameters:{...Rt,...i,...t.props.textureParameters}});return Ot[n.id]=!0,n}(r,t),release:t=>{!function(t){t&&t instanceof N.A&&Ot[t.id]&&(t.delete(),delete Ot[t.id])}(t)}}};function Ft(t,e){if(t===e)return!0;if(!Ut(t)||!Ut(e))return!1;const r=t.length;if(r!==e.length)return!1;for(let i=0;i<r;i++)if(t[i]!==e[i])return!1;return!0}function jt(t,e){switch(Vt(e)){case"object":return Nt(t,e);case"array":return Nt(t,{type:"array",value:e,compare:!1});case"boolean":return Nt(t,{type:"boolean",value:e});case"number":return Nt(t,{type:"number",value:e});case"function":return Nt(t,{type:"function",value:e,compare:!0});default:return{name:t,type:"unknown",value:e}}}function Nt(t,e){return"type"in e?{name:t,...Bt[e.type],...e}:"value"in e?{name:t,type:Vt(e.value),...e}:{name:t,type:"object",value:e}}function Ut(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function Vt(t){return Ut(t)?"array":null===t?"null":typeof t}function qt(t){const e=Wt(t,"_mergedDefaultProps");return e||(function(t){const e=t.prototype;if(!e)return;const r=Object.getPrototypeOf(t),i=qt(r),n=Wt(t,"defaultProps")||{},o=function(t){const e={},r={},i={};for(const[n,o]of Object.entries(t)){const t=null==o?void 0:o.deprecatedFor;if(t)i[n]=Array.isArray(t)?t:[t];else{const t=jt(n,o);e[n]=t,r[n]=t.value}}return{propTypes:e,defaultProps:r,deprecatedProps:i}}(n),a=function(t,e,r){const i=Object.create(null);Object.assign(i,e,t);const n=function(t){const e=Wt(t,"layerName")||Wt(t,"componentName");e||h.A.once(0,"".concat(t.name,".componentName not specified"))();return e||t.name}(r);return delete t.id,Object.defineProperties(i,{id:{writable:!0,value:n}}),i}(o.defaultProps,i,t),s={...r._propTypes,...o.propTypes};!function(t,e){const r={},i={};for(const t in e){const n=e[t],{name:o,value:a}=n;n.async&&(r[o]=a,i[o]=Gt(o))}t[mt.jA]=r,t[mt.YN]={},Object.defineProperties(t,i)}(a,s);const l={...r._deprecatedProps,...o.deprecatedProps};(function(t,e){for(const r in e)Object.defineProperty(t,r,{enumerable:!1,set(t){const i="".concat(this.id,": ").concat(r);
16for(const i of e[r])Zt(this,i)||(this[i]=t);h.A.deprecated(i,e[r].join("/"))()}})})(a,l),t._mergedDefaultProps=a,t._propTypes=s,t._deprecatedProps=l}(t),t._mergedDefaultProps)}function Gt(t){return{enumerable:!0,set(e){"string"==typeof e||e instanceof Promise||(0,g.Td)(e)?this[mt.YN][t]=e:this[mt.vf][t]=e},get(){if(this[mt.vf]){if(t in this[mt.vf]){return this[mt.vf][t]||this[mt.jA][t]}if(t in this[mt.YN]){const e=this[mt.r3]&&this[mt.r3].internalState;if(e&&e.hasAsyncProp(t))return e.getAsyncProp(t)||this[mt.jA][t]}}return this[mt.jA][t]}}}function Zt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Wt(t,e){return Zt(t,e)&&t[e]}let Ht=0;class Xt{constructor(){(0,i.A)(this,"id",void 0),(0,i.A)(this,"props",void 0),(0,i.A)(this,"count",void 0);for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this.props=function(t,e){const r=qt(t.constructor),i=Object.create(r);i[mt.r3]=t,i[mt.YN]={},i[mt.vf]={};for(let t=0;t<e.length;++t){const r=e[t];for(const t in r)i[t]=r[t]}return Object.freeze(i),i}(this,e),this.id=this.props.id,this.count=Ht++}clone(t){const{props:e}=this,r={};for(const t in e[mt.jA])t in e[mt.vf]?r[t]=e[mt.vf][t]:t in e[mt.YN]&&(r[t]=e[mt.YN][t]);return new this.constructor({...e,...r,...t})}}(0,i.A)(Xt,"componentName","Component"),(0,i.A)(Xt,"defaultProps",{});const Yt=Object.freeze({});class Kt{constructor(t){(0,i.A)(this,"component",void 0),(0,i.A)(this,"onAsyncPropUpdated",void 0),(0,i.A)(this,"asyncProps",void 0),(0,i.A)(this,"oldProps",void 0),(0,i.A)(this,"oldAsyncProps",void 0),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=()=>{},this.oldProps=null,this.oldAsyncProps=null}finalize(){for(const t in this.asyncProps){const e=this.asyncProps[t];e&&e.type&&e.type.release&&e.type.release(e.resolvedValue,e.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps||Yt}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}hasAsyncProp(t){return t in this.asyncProps}getAsyncProp(t){const e=this.asyncProps[t];return e&&e.resolvedValue}isAsyncPropLoading(t){if(t){const e=this.asyncProps[t];return Boolean(e&&e.pendingLoadCount>0&&e.pendingLoadCount!==e.resolvedLoadCount)}for(const t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(t,e){this._watchPromise(t,Promise.resolve(e))}setAsyncProps(t){const e=t[mt.vf]||{},r=t[mt.YN]||t,i=t[mt.jA]||{};for(const t in e){const r=e[t];this._createAsyncPropData(t,i[t]),this._updateAsyncProp(t,r),e[t]=this.getAsyncProp(t)}for(const t in r){const e=r[t];this._createAsyncPropData(t,i[t]),this._updateAsyncProp(t,e)}}_fetch(t,e){return null}_onResolve(t,e){}_onError(t,e){}_updateAsyncProp(t,e){this._didAsyncInputValueChange(t,e)&&("string"==typeof e&&(e=this._fetch(t,e)),e instanceof Promise?this._watchPromise(t,e):(0,g.Td)(e)?this._resolveAsyncIterable(t,e):this._setPropValue(t,e))}_freezeAsyncOldProps(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(const t in this.asyncProps)Object.defineProperty(this.oldAsyncProps,t,{enumerable:!0,value:this.oldProps[t]})}}_didAsyncInputValueChange(t,e){const r=this.asyncProps[t];return e!==r.resolvedValue&&e!==r.lastValue&&(r.lastValue=e,!0)}_setPropValue(t,e){this._freezeAsyncOldProps();const r=this.asyncProps[t];r&&(e=this._postProcessValue(r,e),r.resolvedValue=e,r.pendingLoadCount++,r.resolvedLoadCount=r.pendingLoadCount)}_setAsyncPropValue(t,e,r){const i=this.asyncProps[t];i&&r>=i.resolvedLoadCount&&void 0!==e&&(this._freezeAsyncOldProps(),i.resolvedValue=e,i.resolvedLoadCount=r,this.onAsyncPropUpdated(t,e))}_watchPromise(t,e){const r=this.asyncProps[t];if(r){r.pendingLoadCount++;const i=r.pendingLoadCount;e.then((e=>{e=this._postProcessValue(r,e),this._setAsyncPropValue(t,e,i),this._onResolve(t,e)})).catch((e=>{this._onError(t,e)}))}}async _resolveAsyncIterable(t,e){if("data"!==t)return void this._setPropValue(t,e);const r=this.asyncProps[t];if(!r)return;r.pendingLoadCount++;const i=r.pendingLoadCount;let n=[],o=0;for await(const r of e){const{dataTransform:e}=this.component.props;
16n=e?e(r,n):n.concat(r),Object.defineProperty(n,"__diff",{enumerable:!1,value:[{startRow:o,endRow:n.length}]}),o=n.length,this._setAsyncPropValue(t,n,i)}this._onResolve(t,n)}_postProcessValue(t,e){const r=t.type;return r&&(r.release&&r.release(t.resolvedValue,r,this.component),r.transform)?r.transform(e,r,this.component):e}_createAsyncPropData(t,e){if(!this.asyncProps[t]){const r=this.component&&this.component.constructor._propTypes;this.asyncProps[t]={type:r&&r[t],lastValue:null,resolvedValue:e,pendingLoadCount:0,resolvedLoadCount:0}}}}class Jt extends Kt{constructor(t){let{attributeManager:e,layer:r}=t;super(r),(0,i.A)(this,"attributeManager",void 0),(0,i.A)(this,"needsRedraw",void 0),(0,i.A)(this,"needsUpdate",void 0),(0,i.A)(this,"subLayers",void 0),(0,i.A)(this,"usesPickingColorCache",void 0),(0,i.A)(this,"changeFlags",void 0),(0,i.A)(this,"viewport",void 0),(0,i.A)(this,"uniformTransitions",void 0),(0,i.A)(this,"propsInTransition",void 0),this.attributeManager=e,this.needsRedraw=!0,this.needsUpdate=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(t){this.component=t}_fetch(t,e){const r=this.component.props.fetch;return r?r(e,{propName:t,layer:this.layer}):super._fetch(t,e)}_onResolve(t,e){const r=this.component.props.onDataLoad;"data"===t&&r&&r(e,{propName:t,layer:this.layer})}_onError(t,e){this.layer.raiseError(e,"loading ".concat(t," of ").concat(this.layer))}}var Qt=r(88283);const $t=2**24-1,te=Object.freeze([]),ee=(0,Et.A)((t=>{let{oldViewport:e,viewport:r}=t;return e.equals(r)}));let re=new Uint8ClampedArray(0);const ie={data:{type:"data",value:te,async:!0},dataComparator:{type:"function",value:null,compare:!1,optional:!0},_dataDiff:{type:"function",value:t=>t&&t.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(t,e)=>{let{propName:r,layer:i,loaders:n,loadOptions:o,signal:a}=e;const{resourceManager:s}=i.context;var l;(o=o||i.getLoadOptions(),n=n||i.props.loaders,a)&&(o={...o,fetch:{...null===(l=o)||void 0===l?void 0:l.fetch,signal:a}});let u=s.contains(t);return u||o||(s.add({resourceId:t,data:(0,Qt.H)(t,n),persistent:!1}),u=!0),u?s.subscribe({resourceId:t,onChange:t=>{var e;return null===(e=i.internalState)||void 0===e?void 0:e.reloadAsyncProp(r,t)},consumerId:i.id,requestId:r}):(0,Qt.H)(t,n,o)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:n.qR.DRAW,onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:n.rf.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{type:"object",value:{},optional:!0,compare:!0},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:t=>{let{layerIndex:e}=t;return[0,100*-e]},compare:!1},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};class ne extends Xt{constructor(){super(...arguments),(0,i.A)(this,"internalState",null),(0,i.A)(this,"lifecycle",mt.VD.NO_STATE),(0,i.A)(this,"context",void 0),(0,i.A)(this,"state",void 0),(0,i.A)(this,"parent",null)}get root(){let t=this;for(;t.parent;)t=t.parent;return t}toString(){const t=this.constructor.layerName||this.constructor.name;return"".concat(t,"({id: '").concat(this.props.id,"'})")}project(t){(0,m.A)(this.internalState);const e=this.internalState.viewport||this.context.viewport,r=Lt(t,{viewport:e,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[i,n,o]=(0,Ct.VJ)(r,e.pixelProjectionMatrix);return 2===t.length?[i,n]:[i,n,o]}unproject(t){(0,m.A)(this.internalState);return(this.internalState.viewport||this.context.viewport).unproject(t)}projectPosition(t,e){(0,m.A)(this.internalState);return zt(t,{viewport:this.internalState.viewport||this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem,...e})}get isComposite(){return!1}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(){this.internalState&&(this.internalState.needsRedraw=!0)}setNeedsUpdate(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}get isLoaded(){return!!this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||this.state.model&&[this.state.model])||[]}setModuleParameters(t){for(const e of this.getModels())e.updateModuleSettings(t)}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===n.rf.DEFAULT||t===n.rf.LNGLAT||t===n.rf.CARTESIAN}onHover(t,e){return this.props.onHover&&this.props.onHover(t,e)||!1}onClick(t,e){return this.props.onClick&&this.props.onClick(t,e)||!1}nullPickingColor(){return[0,0,0]}encodePickingColor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e[0]=t+1&255,e[1]=t+1>>8&255,e[2]=t+1>>8>>8&255,e}decodePickingColor(t){(0,m.A)(t instanceof Uint8Array);const[e,r,i]=t;return e+256*r+65536*i-1}getNumInstances(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&void 0!==this.state.numInstances?this.state.numInstances:At(this.props.data)}getStartIndices(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}getBounds(){var t;const e=this.getAttributeManager();if(!e)return null;const{positions:r,instancePositions:i}=e.attributes;return null===(t=r||i)||void 0===t?void 0:t.getBounds()}getShaders(t){for(const e of this.props.extensions)t=Tt(t,e.getShaders.call(this,e));return t}shouldUpdateState(t){return t.changeFlags.propsOrDataChanged}updateState(t){const e=this.getAttributeManager(),{dataChanged:r}=t.changeFlags;if(r&&e)if(Array.isArray(r))for(const t of r)e.invalidateAll(t);
16else e.invalidateAll();const{props:i,oldProps:n}=t,o=Number.isInteger(n.highlightedObjectIndex)||n.pickable,a=Number.isInteger(i.highlightedObjectIndex)||i.pickable;if(o!==a&&e){const{pickingColors:t,instancePickingColors:r}=e.attributes,i=t||r;i&&(a&&i.constant&&(i.constant=!1,e.invalidate(i.id)),i.value||a||(i.constant=!0,i.value=[0,0,0]))}}finalizeState(t){for(const t of this.getModels())t.delete();const e=this.getAttributeManager();e&&e.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}draw(t){for(const e of this.getModels())e.draw(t)}getPickingInfo(t){let{info:e,mode:r,sourceLayer:i}=t;const{index:n}=e;return n>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[n]),e}raiseError(t,e){var r,i,n,o;(e&&(t.message="".concat(e,": ").concat(t.message)),null!==(r=(i=this.props).onError)&&void 0!==r&&r.call(i,t))||(null===(n=this.context)||void 0===n||null===(o=n.onError)||void 0===o||o.call(n,t,this))}getNeedsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(t)}needsUpdate(){return!!this.internalState&&(this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()))}hasUniformTransition(){var t;return(null===(t=this.internalState)||void 0===t?void 0:t.uniformTransitions.active)||!1}activateViewport(t){if(!this.internalState)return;const e=this.internalState.viewport;this.internalState.viewport=t,e&&ee({oldViewport:e,viewport:t})||(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";const e=this.getAttributeManager();e&&("all"===t?e.invalidateAll():e.invalidate(t))}updateAttributes(t){for(const e of this.getModels())this._setModelAttributes(e,t)}_updateAttributes(){const t=this.getAttributeManager();if(!t)return;const e=this.props,r=this.getNumInstances(),i=this.getStartIndices();t.update({data:e.data,numInstances:r,startIndices:i,props:e,transitions:e.transitions,buffers:e.data.attributes,context:this});const n=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(n)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const e=t.update(),r=Object.create(this.props);for(const t in e)Object.defineProperty(r,t,{value:e[t]});return r}return this.props}calculateInstancePickingColors(t,e){let{numInstances:r}=e;if(t.constant)return;const i=Math.floor(re.length/3);if(this.internalState.usesPickingColorCache=!0,i<r){r>$t&&h.A.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),re=u.A.allocate(re,r,{size:3,copy:!0,maxCount:Math.max(r,$t)});const t=Math.floor(re.length/3),e=[];for(let r=i;r<t;r++)this.encodePickingColor(r,e),re[3*r+0]=e[0],re[3*r+1]=e[1],re[3*r+2]=e[2]}t.value=re.subarray(0,3*r)}_setModelAttributes(t,e){const r=this.getAttributeManager(),i=t.userData.excludeAttributes||{},n=r.getShaderAttributes(e,i);t.setAttributes(n)}disablePickingIndex(t){this._disablePickingIndex(t)}_disablePickingIndex(t){const{pickingColors:e,instancePickingColors:r}=this.getAttributeManager().attributes,i=e||r;if(!i)return;const n=i.getVertexOffset(t),o=i.getVertexOffset(t+1);i.buffer.subData({data:new Uint8Array(o-n),offset:n})}restorePickingColors(){const{pickingColors:t,instancePickingColors:e}=this.getAttributeManager().attributes,r=t||e;r&&(this.internalState.usesPickingColorCache&&r.value.buffer!==re.buffer&&(r.value=re.subarray(0,r.value.length)),r.updateSubBuffer({startOffset:0}))}_initialize(){(0,m.A)(!this.internalState),(0,m.A)(Number.isFinite(this.props.coordinateSystem)),(0,M.A)("layer.initialize",this);const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Jt({attributeManager:t,layer:this}),this._clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(h.A.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new ft(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);for(const t of this.props.extensions)t.initializeState.call(this,this.context,t);this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}_transferState(t){(0,M.A)("layer.matched",this,this===t);const{state:e,internalState:r}=t;this!==t&&(this.internalState=r,this.internalState.layer=this,this.state=e,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}
16_update(){const t=this.needsUpdate();if((0,M.A)("layer.update",this,t),!t)return;const e=this.props,r=this.context,i=this.internalState,n=r.viewport,o=this._updateUniformTransition();i.propsInTransition=o,r.viewport=i.viewport||n,this.props=o;try{const t=this._getUpdateParams(),e=this.getModels();if(r.gl)this.updateState(t);else try{this.updateState(t)}catch(t){}for(const e of this.props.extensions)e.updateState.call(this,t,e);const i=this.getModels()[0]!==e[0];this._postUpdate(t,i)}finally{r.viewport=n,this.props=e,this._clearChangeFlags(),i.needsUpdate=!1,i.resetOldProps()}}_finalize(){(0,M.A)("layer.finalize",this),this.finalizeState(this.context);for(const t of this.props.extensions)t.finalizeState.call(this,t)}_drawLayer(t){let{moduleParameters:e=null,uniforms:r={},parameters:i={}}=t;this._updateAttributeTransition();const n=this.props,o=this.context;this.props=this.internalState.propsInTransition||n;const a=this.props.opacity;r.opacity=Math.pow(a,1/2.2);try{e&&this.setModuleParameters(e);const{getPolygonOffset:t}=this.props,n=t&&t(r)||[0,0];(0,O.Rz)(o.gl,{polygonOffset:n}),(0,O.zv)(o.gl,i,(()=>{const t={moduleParameters:e,uniforms:r,parameters:i,context:o};for(const e of this.props.extensions)e.draw.call(this,t,e);this.draw(t)}))}finally{this.props=n}}getChangeFlags(){var t;return null===(t=this.internalState)||void 0===t?void 0:t.changeFlags}setChangeFlags(t){if(!this.internalState)return;const{changeFlags:e}=this.internalState;for(const r in t)if(t[r]){let i=!1;if("dataChanged"===r){const n=t[r],o=e[r];n&&Array.isArray(o)&&(e.dataChanged=Array.isArray(n)?o.concat(n):n,i=!0)}e[r]||(e[r]=t[r],i=!0),i&&(0,M.A)("layer.changeFlag",this,r,t)}const r=Boolean(e.dataChanged||e.updateTriggersChanged||e.propsChanged||e.extensionsChanged);e.propsOrDataChanged=r,e.somethingChanged=r||e.viewportChanged||e.stateChanged}_clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}_diffProps(t,e){const r=gt(t,e);if(r.updateTriggersChanged)for(const t in r.updateTriggersChanged)r.updateTriggersChanged[t]&&this.invalidateAttribute(t);if(r.transitionsChanged)for(const n in r.transitionsChanged){var i;this.internalState.uniformTransitions.add(n,e[n],t[n],null===(i=t.transitions)||void 0===i?void 0:i[n])}return this.setChangeFlags(r)}validateProps(){!function(t){const e=wt(t);for(const r in e){const i=e[r],{validate:n}=i;if(n&&!n(t[r],i))throw new Error("Invalid prop ".concat(r,": ").concat(t[r]))}}(this.props)}updateAutoHighlight(t){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const e={pickingSelectedColor:t.picked?t.color:null},{highlightColor:r}=this.props;t.picked&&"function"==typeof r&&(e.pickingHighlightColor=r(t)),this.setModuleParameters(e),this.setNeedsRedraw()}_getAttributeManager(){const t=this.context;return new at(t.gl,{id:this.props.id,stats:t.stats,timeline:t.timeline})}_postUpdate(t,e){const{props:r,oldProps:i}=t;this.setNeedsRedraw(),this._updateAttributes();const{model:n}=this.state;null==n||n.setInstanceCount(this.getNumInstances());const{autoHighlight:o,highlightedObjectIndex:a,highlightColor:s}=r;if(e||i.autoHighlight!==o||i.highlightedObjectIndex!==a||i.highlightColor!==s){const t={};o||(t.pickingSelectedColor=null),Array.isArray(s)&&(t.pickingHighlightColor=s),Number.isInteger(a)&&(t.pickingSelectedColor=Number.isFinite(a)&&a>=0?this.encodePickingColor(a):null),this.setModuleParameters(t)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let e=!1;e=e||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const r=this.getAttributeManager(),i=!!r&&r.getNeedsRedraw(t);return e=e||i,e}_onAsyncPropUpdated(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}(0,i.A)(ne,"defaultProps",ie),(0,i.A)(ne,"layerName","Layer")},29275:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});var i=r(83556);function n(){return!("object"==typeof process&&"[object process]"===String(process)&&
16!process.browser)||(0,i.A)()}},30856:(t,e,r)=>{"use strict";r.d(e,{Ld:()=>o,ZF:()=>s,r6:()=>a});var i=r(57971);const n={};function o(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";n[t]=n[t]||1;const e=n[t]++;return"".concat(t,"-").concat(e)}function a(t){return(0,i.v)("number"==typeof t,"Input must be a number"),t&&!(t&t-1)}function s(t){let e=!0;for(const r in t){e=!1;break}return e}},32288:(t,e,r)=>{"use strict";r.d(e,{I:()=>s,Td:()=>a,X:()=>o});const i=[],n=[];function o(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,o=i;const a={index:-1,data:t,target:[]};return t?"function"==typeof t[Symbol.iterator]?o=t:t.length>0&&(n.length=t.length,o=n):o=i,(e>0||Number.isFinite(r))&&(o=(Array.isArray(o)?o:Array.from(o)).slice(e,r),a.index=e-1),{iterable:o,objectInfo:a}}function a(t){return t&&t[Symbol.asyncIterator]}function s(t,e){const{size:r,stride:i,offset:n,startIndices:o,nested:a}=e,s=t.BYTES_PER_ELEMENT,l=i?i/s:r,u=n?n/s:0,c=Math.floor((t.length-u)/l);return(e,i)=>{let{index:n,target:s}=i;if(!o){const e=n*l+u;for(let i=0;i<r;i++)s[i]=t[e+i];return s}const h=o[n],p=o[n+1]||c;let d;if(a){d=new Array(p-h);for(let e=h;e<p;e++){const i=e*l+u;s=new Array(r);for(let e=0;e<r;e++)s[e]=t[i+e];d[e-h]=s}}else if(l===r)d=t.subarray(h*r+u,p*r+u);else{d=new t.constructor((p-h)*r);let e=0;for(let i=h;i<p;i++){const n=i*l+u;for(let i=0;i<r;i++)d[e++]=t[n+i]}}return d}}},32649:(t,e,r)=>{"use strict";r.d(e,{Gv:()=>o,H1:()=>p,Pe:()=>h,Sv:()=>u,Td:()=>l,aC:()=>a,qf:()=>c,xZ:()=>s});const i=t=>"boolean"==typeof t,n=t=>"function"==typeof t,o=t=>null!==t&&"object"==typeof t,a=t=>o(t)&&t.constructor==={}.constructor,s=t=>t&&"function"==typeof t[Symbol.iterator],l=t=>t&&"function"==typeof t[Symbol.asyncIterator],u=t=>"undefined"!=typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,c=t=>"undefined"!=typeof Blob&&t instanceof Blob,h=t=>t&&"object"==typeof t&&t.isBuffer,p=t=>(t=>"undefined"!=typeof ReadableStream&&t instanceof ReadableStream||o(t)&&n(t.tee)&&n(t.cancel)&&n(t.getReader))(t)||(t=>o(t)&&n(t.read)&&n(t.pipe)&&i(t.readable))(t)},32970:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var i=r(56706),n=r(50117),o=r(88161),a=r(57971),s=r(30856),l=r(36418);const u="Resource subclass must define virtual methods";class c{get[Symbol.toStringTag](){return"Resource"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.tj)(t);const{id:r,userData:n={}}=e;this.gl=t,this.gl2=t,this.id=r||(0,s.Ld)(this[Symbol.toStringTag]),this.userData=n,this._bound=!1,this._handle=e.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._initStats(),this._addStats()}toString(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}get handle(){return this._handle}delete(){let{deleteChildren:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,e&&t&&e.filter(Boolean).forEach((t=>t.delete())),this}bind(){let t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof e?(this._bindHandle(e),this):(this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t)}unbind(){this.bind(null)}getParameter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=(0,o.fm)(this.gl,t),(0,a.v)(t);const r=(this.constructor.PARAMETERS||{})[t];if(r){const t=(0,i.C6)(this.gl);if(!((!("webgl2"in r)||t)&&(!("extension"in r)||this.gl.getExtension(r.extension)))){const e=r.webgl1,i="webgl2"in r?r.webgl2:r.webgl1;return t?i:e}}return this._getParameter(t,e)}getParameters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{parameters:e,keys:r}=t,n=this.constructor.PARAMETERS||{},a=(0,i.C6)(this.gl),s={},l=e||Object.keys(n);for(const e of l){const i=n[e];if(i&&(!("webgl2"in i)||a)&&(!("extension"in i)||this.gl.getExtension(i.extension))){const n=r?(0,o.i7)(this.gl,e):e;s[n]=this.getParameter(e,t),r&&"GLenum"===i.type&&(s[n]=(0,o.i7)(this.gl,s[n]))}}return s}setParameter(t,e){t=(0,o.fm)(this.gl,t),(0,a.v)(t);const r=(this.constructor.PARAMETERS||{})[t];if(r){const t=(0,i.C6)(this.gl);
16if(!((!("webgl2"in r)||t)&&(!("extension"in r)||this.gl.getExtension(r.extension))))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(e=(0,o.fm)(e))}return this._setParameter(t,e),this}setParameters(t){for(const e in t)this.setParameter(e,t[e]);return this}stubRemovedMethods(t,e,r){return(0,l.R)(this,t,e,r)}initialize(t){}_createHandle(){throw new Error(u)}_deleteHandle(){throw new Error(u)}_bindHandle(t){throw new Error(u)}_getOptsFromHandle(){throw new Error(u)}_getParameter(t,e){throw new Error(u)}_setParameter(t,e){throw new Error(u)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_initStats(){this.gl.stats=this.gl.stats||new n.vM}_addStats(){const t=this[Symbol.toStringTag],e=n.dJ.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get("".concat(t,"s Created")).incrementCount(),e.get("".concat(t,"s Active")).incrementCount()}_removeStats(){const t=this[Symbol.toStringTag];n.dJ.get("Resource Counts").get("".concat(t,"s Active")).decrementCount()}_trackAllocatedMemory(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag];this._doTrackAllocatedMemory(t,e),this._doTrackAllocatedMemory(t,e,this.gl.stats.get("Memory Usage"))}_doTrackAllocatedMemory(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.dJ.get("Memory Usage");r.get("GPU Memory").addCount(t),r.get("".concat(e," Memory")).addCount(t),this.byteLength=t}_trackDeallocatedMemory(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag];this._doTrackDeallocatedMemory(t),this._doTrackDeallocatedMemory(t,this.gl.stats.get("Memory Usage"))}_doTrackDeallocatedMemory(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.dJ.get("Memory Usage");e.get("GPU Memory").subtractCount(this.byteLength),e.get("".concat(t," Memory")).subtractCount(this.byteLength),this.byteLength=0}}},34793:(t,e,r)=>{"use strict";function i(t,e){if(t===e)return!0;if(!t||!e)return!1;for(const r in t){const n=t[r],o=e[r];if(!(n===o||Array.isArray(n)&&Array.isArray(o)&&i(n,o)))return!1}return!0}r.d(e,{b:()=>i})},35483:(t,e,r)=>{"use strict";r.d(e,{Mz:()=>a,wv:()=>o});var i=r(32649),n=r(45514);async function o(t){if((0,i.Sv)(t))return t;const e={},r=(0,n._)(t);r>=0&&(e["content-length"]=String(r));const{url:o,type:a}=(0,n.D)(t);a&&(e["content-type"]=a);const s=await async function(t){const e=5;if("string"==typeof t)return"data:,".concat(t.slice(0,e));if(t instanceof Blob){const e=t.slice(0,5);return await new Promise((t=>{const r=new FileReader;r.onload=e=>{var r;return t(null==e||null===(r=e.target)||void 0===r?void 0:r.result)},r.readAsDataURL(e)}))}if(t instanceof ArrayBuffer){const r=function(t){let e="";const r=new Uint8Array(t);for(let t=0;t<r.byteLength;t++)e+=String.fromCharCode(r[t]);return btoa(e)}(t.slice(0,e));return"data:base64,".concat(r)}return null}(t);s&&(e["x-first-bytes"]=s),"string"==typeof t&&(t=(new TextEncoder).encode(t));const l=new Response(t,{headers:e});return Object.defineProperty(l,"url",{value:o}),l}async function a(t){if(!t.ok){const e=await async function(t){let e="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): ");try{const r=t.headers.get("Content-Type");let i=t.statusText;r.includes("application/json")&&(i+=" ".concat(await t.text())),e+=i,e=e.length>60?"".concat(e.slice(0,60),"..."):e}catch(t){}return e}(t);throw new Error(e)}}},35756:(t,e,r)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}r.d(e,{A:()=>i})},36418:(t,e,r)=>{"use strict";r.d(e,{R:()=>n});var i=r(56706);function n(t,e,r,n){const o="See luma.gl ".concat(r," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),a=Object.getPrototypeOf(t);n.forEach((t=>{a.methodName||(a[t]=()=>{throw i.Rm.removed("Calling removed method ".concat(e,".").concat(t,": "),o)(),new Error(t)})}))}},36471:(t,e,r)=>{"use strict";r.d(e,{Cc:()=>a,WQ:()=>n,Z0:()=>c,ZF:()=>s,ei:()=>u,l0:()=>l,ze:()=>o});var i=r(21986);function n(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function o(t,e){return t[0]=-e[0],t[1]=-e[1],t}function a(t,e,r,i){var n=e[0],o=e[1];return t[0]=n+i*(r[0]-n),t[1]=o+i*(r[1]-o),t}function s(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n,t[1]=r[1]*i+r[3]*n,t}function l(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n+r[4],t[1]=r[1]*i+r[3]*n+r[5],t}function u(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[3]*n+r[6],t[1]=r[1]*i+r[4]*n+r[7],t}function c(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[4]*n+r[12],t[1]=r[1]*i+r[5]*n+r[13],t}!function(){var t=function(){var t=new i.tb(2);return i.tb!=Float32Array&&(t[0]=0,t[1]=0),t}()}()},38756:(t,e,r)=>{"use strict";
16function i(t,e,r,o,a,s){if(a-o<=r)return;const l=o+a>>1;n(t,e,l,o,a,s%2),i(t,e,r,o,l-1,s+1),i(t,e,r,l+1,a,s+1)}function n(t,e,r,i,a,s){for(;a>i;){if(a-i>600){const o=a-i+1,l=r-i+1,u=Math.log(o),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(o-c)/o)*(l-o/2<0?-1:1);n(t,e,r,Math.max(i,Math.floor(r-l*c/o+h)),Math.min(a,Math.floor(r+(o-l)*c/o+h)),s)}const l=e[2*r+s];let u=i,c=a;for(o(t,e,i,r),e[2*a+s]>l&&o(t,e,i,a);u<c;){for(o(t,e,u,c),u++,c--;e[2*u+s]<l;)u++;for(;e[2*c+s]>l;)c--}e[2*i+s]===l?o(t,e,i,c):(c++,o(t,e,c,a)),c<=r&&(i=c+1),r<=c&&(a=c-1)}}function o(t,e,r,i){a(t,r,i),a(e,2*r,2*i),a(e,2*r+1,2*i+1)}function a(t,e,r){const i=t[e];t[e]=t[r],t[r]=i}function s(t,e,r,i){const n=t-r,o=e-i;return n*n+o*o}r.r(e),r.d(e,{default:()=>p});const l=t=>t[0],u=t=>t[1];class c{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Float64Array;this.nodeSize=n,this.points=t;const a=t.length<65536?Uint16Array:Uint32Array,s=this.ids=new a(t.length),c=this.coords=new o(2*t.length);for(let i=0;i<t.length;i++)s[i]=i,c[2*i]=e(t[i]),c[2*i+1]=r(t[i]);i(s,c,n,0,s.length-1,0)}range(t,e,r,i){return function(t,e,r,i,n,o,a){const s=[0,t.length-1,0],l=[];let u,c;for(;s.length;){const h=s.pop(),p=s.pop(),d=s.pop();if(p-d<=a){for(let a=d;a<=p;a++)u=e[2*a],c=e[2*a+1],u>=r&&u<=n&&c>=i&&c<=o&&l.push(t[a]);continue}const f=Math.floor((d+p)/2);u=e[2*f],c=e[2*f+1],u>=r&&u<=n&&c>=i&&c<=o&&l.push(t[f]);const m=(h+1)%2;(0===h?r<=u:i<=c)&&(s.push(d),s.push(f-1),s.push(m)),(0===h?n>=u:o>=c)&&(s.push(f+1),s.push(p),s.push(m))}return l}(this.ids,this.coords,t,e,r,i,this.nodeSize)}within(t,e,r){return function(t,e,r,i,n,o){const a=[0,t.length-1,0],l=[],u=n*n;for(;a.length;){const c=a.pop(),h=a.pop(),p=a.pop();if(h-p<=o){for(let n=p;n<=h;n++)s(e[2*n],e[2*n+1],r,i)<=u&&l.push(t[n]);continue}const d=Math.floor((p+h)/2),f=e[2*d],m=e[2*d+1];s(f,m,r,i)<=u&&l.push(t[d]);const g=(c+1)%2;(0===c?r-n<=f:i-n<=m)&&(a.push(p),a.push(d-1),a.push(g)),(0===c?r+n>=f:i+n>=m)&&(a.push(d+1),a.push(h),a.push(g))}return l}(this.ids,this.coords,t,e,r,this.nodeSize)}}const h={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,map:t=>t};class p{constructor(t){this.options=x(Object.create(h),t),this.trees=new Array(this.options.maxZoom+1)}load(t){const{log:e,minZoom:r,maxZoom:i,nodeSize:n}=this.options;e&&console.time("total time");const o=`prepare ${t.length} points`;e&&console.time(o),this.points=t;let a=[];for(let e=0;e<t.length;e++)t[e].geometry&&a.push(f(t[e],e));this.trees[i+1]=new c(a,w,A,n,Float32Array),e&&console.timeEnd(o);for(let t=i;t>=r;t--){const r=+Date.now();a=this._cluster(a,t),this.trees[t]=new c(a,w,A,n,Float32Array),e&&console.log("z%d: %d clusters in %dms",t,a.length,+Date.now()-r)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,t[1]));let n=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,n=180;else if(r>n){const t=this.getClusters([r,i,180,o],e),a=this.getClusters([-180,i,n,o],e);return t.concat(a)}const a=this.trees[this._limitZoom(e)],s=a.range(y(r),v(o),y(n),v(i)),l=[];for(const t of s){const e=a.points[t];l.push(e.numPoints?m(e):this.points[e.index])}return l}getChildren(t){const e=t>>5,r=t%32,i="No cluster with the specified id.",n=this.trees[r];if(!n)throw new Error(i);const o=n.points[e];if(!o)throw new Error(i);const a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=n.within(o.x,o.y,a),l=[];for(const e of s){const r=n.points[e];r.parentId===t&&l.push(r.numPoints?m(r):this.points[r.index])}if(0===l.length)throw new Error(i);return l}getLeaves(t,e,r){e=e||10,r=r||0;const i=[];return this._appendLeaves(i,t,e,r,0),i}getTile(t,e,r){const i=this.trees[this._limitZoom(t)],n=Math.pow(2,t),{extent:o,radius:a}=this.options,s=a/o,l=(r-s)/n,u=(r+1+s)/n,c={features:[]};return this._addTileFeatures(i.range((e-s)/n,l,(e+1+s)/n,u),i.points,e,r,n,c),0===e&&this._addTileFeatures(i.range(1-s/n,l,1,u),i.points,n,r,n,c),e===n-1&&this._addTileFeatures(i.range(0,l,s/n,u),i.points,-1,r,n,c),c.features.length?c:null}getClusterExpansionZoom(t){let e=t%32-1;for(;e<=this.options.maxZoom;){const r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,i,n){const o=this.getChildren(e);for(const e of o){const o=e.properties;if(o&&o.cluster?n+o.point_count<=i?n+=o.point_count:n=this._appendLeaves(t,o.cluster_id,r,i,n):n<i?n++:t.push(e),t.length===r)break}return n}_addTileFeatures(t,e,r,i,n,o){for(const a of t){const t=e[a],s={type:1,geometry:[[Math.round(this.options.extent*(t.x*n-r)),Math.round(this.options.extent*(t.y*n-i))]],tags:t.numPoints?g(t):this.points[t.index].properties},l=t.numPoints?t.id:this.points[t.index].id;void 0!==l&&(s.id=l),o.features.push(s)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))}_cluster(t,e){const r=[],{radius:i,extent:n,reduce:o}=this.options,a=i/(n*Math.pow(2,e));for(let i=0;i<t.length;i++){const n=t[i];if(n.zoom<=e)continue;n.zoom=e;const s=this.trees[e+1],l=s.within(n.x,n.y,a);let u=n.numPoints||1,c=n.x*u,h=n.y*u,p=o&&u>1?this._map(n,!0):null;const f=(i<<5)+(e+1);for(const t of l){const r=s.points[t];if(r.zoom<=e)continue;r.zoom=e;const i=r.numPoints||1;c+=r.x*i,h+=r.y*i,u+=i,r.parentId=f,o&&(p||(p=this._map(n,!0)),o(p,this._map(r)))}1===u?r.push(n):(n.parentId=f,r.push(d(c/u,h/u,f,u,p)))}return r}_map(t,e){if(t.numPoints)return e?x({},t.properties):t.properties;const r=this.points[t.index].properties,i=this.options.map(r);return e&&i===r?x({},i):i}}function d(t,e,r,i,n){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:i,properties:n}}function f(t,e){const[r,i]=t.geometry.coordinates;return{x:y(r),y:v(i),zoom:1/0,index:e,parentId:-1}}function m(t){return{type:"Feature",id:t.id,properties:g(t),geometry:{type:"Point",coordinates:[_(t.x),b(t.y)]}}}function g(t){const e=t.numPoints,r=e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?Math.round(e/100)/10+"k":e;return x(x({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function y(t){return t/360+.5}function v(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function _(t){return 360*(t-.5)}function b(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function x(t,e){for(const r in e)t[r]=e[r];return t}function w(t){return t.x}function A(t){return t.y}},39699:(t,e,r)=>{"use strict";r.d(e,{j:()=>d,$:()=>f});var i=r(96424),n=r(56706),o=r(18143);const a=[34069,34070,34071,34072,34073,34074];class s extends o.A{get[Symbol.toStringTag](){return"TextureCube"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.tj)(t),super(t,Object.assign({},e,{target:34067}
16)),this.initialize(e),Object.seal(this)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{mipmaps:e=!0,parameters:r={}}=t;return this.opts=t,this.setCubeMapImageData(t).then((()=>{this.loaded=!0,e&&this.generateMipmap(t),this.setParameters(r)})),this}subImage(t){let{face:e,data:r,x:i=0,y:n=0,mipmapLevel:o=0}=t;return this._subImage({target:e,data:r,x:i,y:n,mipmapLevel:o})}async setCubeMapImageData(t){let{width:e,height:r,pixels:i,data:o,border:s=0,format:l=6408,type:u=5121}=t;const{gl:c}=this,h=i||o,p=await Promise.all(a.map((t=>{const e=h[t];return Promise.all(Array.isArray(e)?e:[e])})));this.bind(),a.forEach(((t,i)=>{p[i].length>1&&!1!==this.opts.mipmaps&&n.Rm.warn("".concat(this.id," has mipmap and multiple LODs."))(),p[i].forEach(((i,n)=>{e&&r?c.texImage2D(t,n,l,e,r,s,l,u,i):c.texImage2D(t,n,l,l,u,i)}))})),this.unbind()}setImageDataForFace(t){const{face:e,width:r,height:i,pixels:n,data:o,border:a=0,format:s=6408,type:l=5121}=t,{gl:u}=this,c=n||o;return this.bind(),c instanceof Promise?c.then((r=>this.setImageDataForFace(Object.assign({},t,{face:e,data:r,pixels:r})))):this.width||this.height?u.texImage2D(e,0,s,r,i,a,s,l,c):u.texImage2D(e,0,s,s,l,c),this}}s.FACES=a;var l=r(47530),u=r(76340);class c extends o.A{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(t){return(0,n.C6)(t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.Dz)(t),e=Object.assign({depth:1},e,{target:32879,unpackFlipY:!1}),super(t,e),this.initialize(e),Object.seal(this)}setImageData(t){let{level:e=0,dataFormat:r=6408,width:i,height:o,depth:a=1,border:s=0,format:c,type:h=5121,offset:p=0,data:d,parameters:f={}}=t;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),(0,n.zv)(this.gl,f,(()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,r,i,o,a,s,c,h,d),d instanceof u.A&&(this.gl.bindBuffer(35052,d.handle),this.gl.texImage3D(this.target,e,r,i,o,a,s,c,h,p))})),d&&d.byteLength)this._trackAllocatedMemory(d.byteLength,"Texture");else{const t=l.gI[this.dataFormat]||4,e=l.Ce[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*t*e,"Texture")}return this.loaded=!0,this}}var h=r(94755),p=r(57971);function d(t,e){(0,p.v)(t instanceof i.A||t instanceof s||t instanceof c);const r=t.constructor,{gl:n,width:o,height:a,format:l,type:u,dataFormat:h,border:d,mipmaps:f}=t;return new r(n,Object.assign({width:o,height:a,format:l,type:u,dataFormat:h,border:d,mipmaps:f},e))}function f(t,e){const{gl:r,width:i,height:n,id:o}=t;return new h.A(r,Object.assign({},e,{id:"framebuffer-for-".concat(o),width:i,height:n,attachments:{36064:t}}))}},40100:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==o(t)&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){var s=i?Object.getOwnPropertyDescriptor(t,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=t[a]}r.default=t,e&&e.set(t,r);return r}(r("__fusion__95b4ba69e5"));function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(){return a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},a.apply(this,arguments)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};
16e%2?s(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function u(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function c(t,e){if(null==t)return{};var r,i,n=function(t,e){if(null==t)return{};var r,i,n={},o=Object.keys(t);for(i=0;i<o.length;i++)r=o[i],e.indexOf(r)>=0||(n[r]=t[r]);return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function h(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function p(t){return function(){var e,r=d(t);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()){var i=d(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(t,e){if(e&&("object"===o(e)||"function"==typeof e))return e;return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,e)}}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}function f(t,e){return f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},f(t,e)}var m=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(r,t);var e=p(r);function r(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),e.apply(this,arguments)}return function(t,e,r){e&&h(t.prototype,e),r&&h(t,r)}(r,[{key:"render",value:function(){var t=this.props,e=t.x,r=t.y,n=t.children,o=t.style,s=(t.coordinates,c(t,["x","y","children","style","coordinates"])),u=o||{},h=u.zIndex,p=void 0===h?"auto":h,d=c(u,["zIndex"]);return i.createElement("div",{style:{transform:"translate(".concat(e,"px, ").concat(r,"px)"),position:"absolute",zIndex:p}},i.createElement("div",a({style:l({userSelect:"none"},d)},s),n))}}]),r}(i.Component);e.default=m},42444:(t,e,r)=>{"use strict";r.d(e,{VD:()=>i,YN:()=>a,jA:()=>o,r3:()=>n,vf:()=>s});
16const i={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"},n=Symbol.for("component"),o=Symbol.for("asyncPropDefaults"),a=Symbol.for("asyncPropOriginal"),s=Symbol.for("asyncPropResolved")},44504:(t,e,r)=>{"use strict";r.d(e,{$W:()=>i,Cc:()=>s,Fl:()=>n,aI:()=>l,cy:()=>o,qE:()=>a});Math.PI,Math.PI;const i={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function n(t){let{precision:e=i.precision}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=function(t){return Math.round(t/i.EPSILON)*i.EPSILON}(t),"".concat(parseFloat(t.toPrecision(e)))}function o(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function a(t,e,r){return u(t,(t=>Math.max(e,Math.min(r,t))))}function s(t,e,r){return o(t)?t.map(((t,i)=>s(t,e[i],r))):r*e+(1-r)*t}function l(t,e,r){const n=i.EPSILON;r&&(i.EPSILON=r);try{if(t===e)return!0;if(o(t)&&o(e)){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!l(t[r],e[r]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):"number"==typeof t&&"number"==typeof e&&Math.abs(t-e)<=i.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{i.EPSILON=n}}function u(t,e,r){if(o(t)){const i=t;r=r||function(t){return t.clone?t.clone():new Array(t.length)}(i);for(let n=0;n<r.length&&n<i.length;++n)r[n]=e(t[n],n,r);return r}return e(t)}},44777:(t,e,r)=>{"use strict";r.d(e,{I:()=>d,i:()=>f});var i=r(56706),n=r(57971);const o=256,a=1024,s=16384,l=6144,u=6145,c=6146,h=34041,p="clear: bad arguments";function d(t){let{framebuffer:e=null,color:r=null,depth:l=null,stencil:u=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const c={};e&&(c.framebuffer=e);let h=0;r&&(h|=s,!0!==r&&(c.clearColor=r)),l&&(h|=o,!0!==l&&(c.clearDepth=l)),u&&(h|=a,!0!==l&&(c.clearStencil=l)),(0,n.v)(0!==h,p),(0,i.zv)(t,c,(()=>{t.clear(h)}))}function f(t){let{framebuffer:e=null,buffer:r=l,drawBuffer:o=0,value:a=[0,0,0,0]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.Dz)(t),(0,i.zv)(t,{framebuffer:e},(()=>{switch(r){case l:switch(a.constructor){case Int32Array:t.clearBufferiv(r,o,a);break;case Uint32Array:t.clearBufferuiv(r,o,a);break;case Float32Array:default:t.clearBufferfv(r,o,a)}break;case u:t.clearBufferfv(u,0,[a]);break;case c:t.clearBufferiv(c,0,[a]);break;case h:const[e,i]=a;t.clearBufferfi(h,0,e,i);break;default:(0,n.v)(!1,p)}}))}},45514:(t,e,r)=>{"use strict";r.d(e,{_:()=>c,D:()=>u});var i=r(32649);const n=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,o=/^([-\w.]+\/[-\w.+]+)/;function a(t){const e=o.exec(t);return e?e[1]:t}function s(t){const e=n.exec(t);return e?e[1]:""}const l=/\?.*/;function u(t){if((0,i.Sv)(t)){const e=h(t.url||"");return{url:e,type:a(t.headers.get("content-type")||"")||s(e)}}return(0,i.qf)(t)?{url:h(t.name||""),type:t.type||""}:"string"==typeof t?{url:h(t),type:s(t)}:{url:"",type:""}}function c(t){return(0,i.Sv)(t)?t.headers["content-length"]||-1:(0,i.qf)(t)?t.size:"string"==typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}function h(t){return t.replace(l,"")}},45638:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var i=r(56706),n=r(32970),o=r(76340),a=r(30856);class s extends n.A{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(t){return(0,i.C6)(t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.Dz)(t),super(t,e),this.initialize(e),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,(0,a.ZF)(this.buffers)||this.bind((()=>this._unbindBuffers())),this.setProps(t),this}setProps(t){"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"bindOnUse"in t&&(t=t.bindOnUse),"buffers"in t&&this.setBuffers(t.buffers)}setBuffers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind((()=>{for(const e in t)this.setBuffer(e,t[e])})),this}setBuffer(t,e){const r=this._getVaryingIndex(t),{buffer:n,byteSize:o,byteOffset:a}=this._getBufferParams(e);return r<0?(this.unused[t]=n,i.Rm.warn("".concat(this.id," unused varying buffer ").concat(t))(),this):(this.buffers[r]=e,this.bindOnUse||this._bindBuffer(r,n,a,o),this)}begin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(t),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(t){let e,r,i;return t instanceof o.A==!1?(i=t.buffer,r=t.byteSize,e=t.byteOffset):i=t,void 0===e&&void 0===r||(e=e||0,r=r||i.byteLength-e),{buffer:i,byteOffset:e,byteSize:r}}_getVaryingInfo(t){return this.configuration&&this.configuration.getVaryingInfo(t)}_getVaryingIndex(t){if(this.configuration)return this.configuration.getVaryingInfo(t).location;const e=Number(t);return Number.isFinite(e)?e:-1}_bindBuffers(){if(this.bindOnUse)for(const t in this.buffers){const{buffer:e,byteSize:r,byteOffset:i}=this._getBufferParams(this.buffers[t]);this._bindBuffer(t,e,i,r)}}_unbindBuffers(){if(this.bindOnUse)for(const t in this.buffers)this._bindBuffer(t,null)}_bindBuffer(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;const n=e&&e.handle;return n&&void 0!==i?this.gl.bindBufferRange(35982,t,n,r,i):this.gl.bindBufferBase(35982,t,n),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(t){this.gl.bindTransformFeedback(36386,this.handle)}}},46127:(t,e,r)=>{"use strict";r.d(e,{a:()=>f,o:()=>d});var i=r(91925),n=r(70549),o=r(61028),a=r(92700);const s=[0,0,0,0],l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],c=[0,0,0],h=[0,0,0],p=(0,a.A)((function(t){let{viewport:e,devicePixelRatio:r,coordinateSystem:a,coordinateOrigin:h}=t;const{projectionCenter:p,viewProjectionMatrix:f,originCommon:m,cameraPosCommon:g,shaderCoordinateOrigin:y,geospatialOrigin:v}=function(t,e,r){const{viewMatrixUncentered:o,projectionMatrix:a}=t;let{viewMatrix:u,viewProjectionMatrix:c}=t,h=s,p=s,f=t.cameraPosition;const{geospatialOrigin:m,shaderCoordinateOrigin:g,offsetMode:y}=d(t,e,r);
vendor: 7,301 bytes, line 16
16y&&(p=t.projectPosition(m||g),f=[f[0]-p[0],f[1]-p[1],f[2]-p[2]],p[3]=1,h=n.Z0([],p,c),u=o||u,c=i.lw([],a,u),c=i.lw([],c,l));return{viewMatrix:u,viewProjectionMatrix:c,projectionCenter:h,originCommon:p,cameraPosCommon:f,shaderCoordinateOrigin:g,geospatialOrigin:m}}(e,a,h),_=e.getDistanceScales(),b=[e.width*r,e.height*r],x=n.Z0([],[0,0,-e.focalDistance,1],e.projectionMatrix)[3]||1,w={project_uCoordinateSystem:a,project_uProjectionMode:e.projectionMode,project_uCoordinateOrigin:y,project_uCommonOrigin:m.slice(0,3),project_uCenter:p,project_uPseudoMeters:Boolean(e._pseudoMeters),project_uViewportSize:b,project_uDevicePixelRatio:r,project_uFocalDistance:x,project_uCommonUnitsPerMeter:_.unitsPerMeter,project_uCommonUnitsPerWorldUnit:_.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:c,project_uScale:e.scale,project_uWrapLongitude:!1,project_uViewProjectionMatrix:f,project_uModelMatrix:u,project_uCameraPosition:g};if(v){const t=e.getDistanceScales(v);switch(a){case o.rf.METER_OFFSETS:w.project_uCommonUnitsPerWorldUnit=t.unitsPerMeter,w.project_uCommonUnitsPerWorldUnit2=t.unitsPerMeter2;break;case o.rf.LNGLAT:case o.rf.LNGLAT_OFFSETS:e._pseudoMeters||(w.project_uCommonUnitsPerMeter=t.unitsPerMeter),w.project_uCommonUnitsPerWorldUnit=t.unitsPerDegree,w.project_uCommonUnitsPerWorldUnit2=t.unitsPerDegree2;break;case o.rf.CARTESIAN:w.project_uCommonUnitsPerWorldUnit=[1,1,t.unitsPerMeter[2]],w.project_uCommonUnitsPerWorldUnit2=[0,0,t.unitsPerMeter2[2]]}}return w}));function d(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;r.length<3&&(r=[r[0],r[1],0]);let i,n=r,a=!0;switch(i=e===o.rf.LNGLAT_OFFSETS||e===o.rf.METER_OFFSETS?r:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case o.Kx.WEB_MERCATOR:e!==o.rf.LNGLAT&&e!==o.rf.CARTESIAN||(i=[0,0,0],a=!1);break;case o.Kx.WEB_MERCATOR_AUTO_OFFSET:e===o.rf.LNGLAT?n=i:e===o.rf.CARTESIAN&&(n=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],i=t.unprojectPosition(n),n[0]-=r[0],n[1]-=r[1],n[2]-=r[2]);break;case o.Kx.IDENTITY:n=t.position.map(Math.fround),n[2]=n[2]||0;break;case o.Kx.GLOBE:a=!1,i=null;break;default:a=!1}return{geospatialOrigin:i,shaderCoordinateOrigin:n,offsetMode:a}}function f(t){let{viewport:e,devicePixelRatio:r=1,modelMatrix:i=null,coordinateSystem:n=o.rf.DEFAULT,coordinateOrigin:a=h,autoWrapLongitude:s=!1}=t;n===o.rf.DEFAULT&&(n=e.isGeospatial?o.rf.LNGLAT:o.rf.CARTESIAN);const l=p({viewport:e,devicePixelRatio:r,coordinateSystem:n,coordinateOrigin:a});return l.project_uWrapLongitude=s,l.project_uModelMatrix=i||u,l}},46752:(t,e,r)=>{"use strict";r.d(e,{$A:()=>a,WQ:()=>n,Z0:()=>s,Z8:()=>h,eL:()=>c,ei:()=>l,g7:()=>d,gL:()=>u,jb:()=>f,lK:()=>m,x6:()=>p,ze:()=>o});var i=r(21986);function n(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function o(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function a(t,e,r){var i=e[0],n=e[1],o=e[2],a=r[0],s=r[1],l=r[2];return t[0]=n*l-o*s,t[1]=o*a-i*l,t[2]=i*s-n*a,t}function s(t,e,r){var i=e[0],n=e[1],o=e[2],a=r[3]*i+r[7]*n+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*i+r[4]*n+r[8]*o+r[12])/a,t[1]=(r[1]*i+r[5]*n+r[9]*o+r[13])/a,t[2]=(r[2]*i+r[6]*n+r[10]*o+r[14])/a,t}function l(t,e,r){var i=e[0],n=e[1],o=e[2];return t[0]=i*r[0]+n*r[3]+o*r[6],t[1]=i*r[1]+n*r[4]+o*r[7],t[2]=i*r[2]+n*r[5]+o*r[8],t}function u(t,e,r){var i=r[0],n=r[1],o=r[2],a=r[3],s=e[0],l=e[1],u=e[2],c=n*u-o*l,h=o*s-i*u,p=i*l-n*s,d=n*p-o*h,f=o*c-i*p,m=i*h-n*c,g=2*a;return c*=g,h*=g,p*=g,d*=2,f*=2,m*=2,t[0]=s+c+d,t[1]=l+h+f,t[2]=u+p+m,t}function c(t,e,r,i){var n=[],o=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],o[0]=n[0],o[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),o[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function h(t,e,r,i){var n=[],o=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],o[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),o[1]=n[1],o[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function p(t,e,r,i){var n=[],o=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],o[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),o[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),o[2]=n[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function d(t,e){var r=t[0],i=t[1],n=t[2],o=e[0],a=e[1],s=e[2],l=Math.sqrt(r*r+i*i+n*n)*Math.sqrt(o*o+a*a+s*s),u=l&&function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}(t,e)/l;return Math.acos(Math.min(Math.max(u,-1),1))}var f=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t},m=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t};!function(){var t=function(){var t=new i.tb(3);return i.tb!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}()}()},47298:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});var i=r(44504);class n extends(function(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}(Array)){clone(){return(new this.constructor).copy(this)}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let r=0;r<this.ELEMENTS;++r)this[r]=t[r+e];return this.check()}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let r=0;r<this.ELEMENTS;++r)t[e+r]=this[r];return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:(0,i.cy)(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(i.$W)}formatString(t){let e="";for(let r=0;r<this.ELEMENTS;++r)e+=(r>0?", ":"")+(0,i.Fl)(this[r],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(!(0,i.aI)(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,e,r){if(void 0===r)return this.lerp(this,t,e);for(let i=0;i<this.ELEMENTS;++i){const n=t[i];this[i]=n+r*(e[i]-n)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t[r]),e[r]);return this.check()}add(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]+=t[e];return this.check()}subtract(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]-=t[e];return this.check()}scale(t){if("number"==typeof t)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(let e=0;e<this.ELEMENTS&&e<t.length;++e)this[e]*=t[e];return this.check()}multiplyByScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}check(){if(i.$W.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invali
16d numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t),e);return this.check()}get elements(){return this}}},47530:(t,e,r)=>{"use strict";r.d(e,{Ce:()=>a,KS:()=>l,gI:()=>o,pj:()=>n,qS:()=>s});var i=r(56706);const n={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},o={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},a={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1};function s(t,e){const r=n[e];if(!r)return!1;if(void 0===r.gl1&&void 0===r.gl2)return!0;const o=(0,i.C6)(t)&&r.gl2||r.gl1;return"string"==typeof o?t.getExtension(o):o}function l(t,e){const r=n[e];switch(r&&r.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}},50117:(t,e,r)=>{"use strict";r.d(e,{dJ:()=>l,vM:()=>s});var i=r(56706),n=r(25989),o=r(29275);const a="8.5.16";class s{constructor(){this.stats=new Map}get(t){return this.stats.has(t)||this.stats.set(t,new n.A({id:t})),this.stats.get(t)}}const l=new s;if(globalThis.luma&&globalThis.luma.VERSION!==a)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(a));globalThis.luma||((0,o.A)()&&i.Rm.log(1,"luma.gl ".concat(a," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),globalThis.luma=globalThis.luma||{VERSION:a,version:a,log:i.Rm,stats:l,globals:{modules:{},nodeIO:{}}});globalThis.luma},52474:(t,e,r)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"loader assertion failed.")}r.d(e,{v:()=>i})},52601:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(53987),n=o(r(38756));function o(t){return t&&t.__esModule?t:{default:t}}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function l(t){return function(){var e,r=c(t);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()){var i=c(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(t,e){if(e&&("object"===a(e)||"function"==typeof e))return e;return u(t)}(this,e)}}function u(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}function h(t,e){return h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},h(t,e)}function p(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var d=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(r,t);var e=l(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return p(u(t=e.call.apply(e,[this].concat(n))),"_superCluster",void 0),p(u(t),"_lastObjects",null),t}return function(t,e,r){e&&s(t.prototype,e),r&&s(t,r)}(r,[{key:"getItems",value:function(){var t=this,e=this.getAllObjects();
vendor: 22,758 bytes, line 16
16return e!==this._lastObjects&&(this._superCluster=new n.default(this.getClusterOptions()),this._superCluster.load(e.map((function(e){return(0,i.point)(t.getObjectCoordinates(e),{object:e})}))),this._lastObjects=e),this._superCluster.getClusters([-180,-90,180,90],Math.round(this.getZoom())).map((function(e){var r=e.geometry.coordinates,i=e.properties,n=i.cluster,o=i.point_count,a=i.cluster_id,s=i.object;return n?t.renderCluster(r,a,o):t.renderObject(r,s)}))}},{key:"getClusterObjects",value:function(t){return this._superCluster.getLeaves(t,1/0).map((function(t){return t.properties.object}))}},{key:"getAllObjects",value:function(){return[]}},{key:"getObjectCoordinates",value:function(t){return[0,0]}},{key:"getClusterOptions",value:function(){return{maxZoom:20}}},{key:"renderObject",value:function(t,e){return null}},{key:"renderCluster",value:function(t,e,r){return null}}]),r}(o(r(74734)).default);e.default=d},52675:function(t){t.exports=function(){"use strict";var t,e,r;function i(i,n){if(t)if(e){var o="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",a={};t(a),r=n(a),"undefined"!=typeof window&&(r.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else e=n;else t=n}return i(["exports"],(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=i;function i(t,e,r,i){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=r,this.p2y=i}i.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},i.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},i.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},i.prototype.solveCurveX=function(t,e){var r,i,n,o,a;for(void 0===e&&(e=1e-6),n=t,a=0;a<8;a++){if(o=this.sampleCurveX(n)-t,Math.abs(o)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=o/s}if((n=t)<(r=0))return r;if(n>(i=1))return i;for(;r<i;){if(o=this.sampleCurveX(n),Math.abs(o-t)<e)return n;t>o?r=n:i=n,n=.5*(i-r)+r}return n},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var n=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(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,r=t.y-this.y;return e*e+r*r},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),r=Math.sin(t),i=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t),n=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-i*(this.y-e.y),this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var a="undefined"!=typeof self?self:{};function s(t,e,i,n){var o=new r(t,e,i,n);return function(t){return o.solve(t)}}var l=s(.25,.1,.25,1);function u(t,e,r){return Math.min(r,Math.max(e,t))}function c(t,e,r){var i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}function h(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i<n.length;i+=1){var o=n[i];for(var a in o)t[a]=o[a]}return t}var p=1;function d(){return p++}function f(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function m(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 g(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function y(t,e){return-1!==t.indexOf(e,t.length-e.length)}function v(t,e,r){var i={};for(var n in t)i[n]=e.call(r||this,t[n],n,t);return i}function _(t,e,r){var i={};for(var n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?v(t,b):t}var x={};function w(t){x[t]||("undefined"!=typeof console&&console.warn(t),x[t]=!0)}function A(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function E(t){for(var e=0,r=0,i=t.length,n=i-1,o=void 0,a=void 0;r<i;n=r++)e+=((a=t[n]).x-(o=t[r]).x)*(o.y+a.y);return e}function T(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function S(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,i,n){var o=i||n;return e[r]=!o||o.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var P=null;function I(t){if(null==P){var e=t.navigator?t.navigator.userAgent:null;P=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return P}function M(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var C,k,L,z,R=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),O=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,D=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,B={now:R,frame:function(t){var e=O(t);return{cancel:function(){return D(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=a.document.createElement("canvas"),i=r.getContext("2d");if(!i)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,i.drawImage(t,0,0,t.width,t.height),i.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return C||(C=a.document.createElement("a")),C.href=t,C.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==k&&(k=a.matchMedia("(prefers-reduced-motion: reduce)")),k.matches)}},F={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},j={supported:!1,testSupport:function(t){!N&&z&&(U?V(t):L=t)}},N=!1,U=!1;function V(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,z),t.isContextLost())return;j.supported=!0}catch(t){}t.deleteTexture(e),N=!0}a.document&&((z=a.document.createElement("img")).onload=function(){L&&V(L),L=null,U=!0},z.onerror=function(){N=!0,L=null},z.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var q="01",G=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function Z(t){return 0===t.indexOf("mapbox:")}G.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",q,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},G.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},G.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},G.prototype.normalizeStyleURL=function(t,e){if(!Z(t))return t;var r=Y(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},G.prototype.normalizeGlyphsURL=function(t,e){if(!Z(t))return t;var r=Y(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},G.prototype.normalizeSourceURL=function(t,e){if(!Z(t))return t;var r=Y(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},G.prototype.normalizeSpriteURL=function(t,e,r,i){var n=Y(t);return Z(t)?(n.path="/styles/v1"+n.path+"/sprite"+e+r,this._makeAPIURL(n,this._customAccessToken||i)):(n.path+=""+e+r,K(n))},G.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!Z(t))return t;var r=Y(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(B.devicePixelRatio>=2||512===e?"@2x":"")+(j.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var i=this._customAccessToken||function(t){for(var e=0,r=t;e<r.length;e+=1){var i=r[e].match(/^access_token=(.*)$/);if(i)return i[1]}return null}(r.params)||F.ACCESS_TOKEN;return F.REQUIRE_ACCESS_TOKEN&&i&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,i)},G.prototype.canonicalizeTileURL=function(t,e){var r=Y(t);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return t;var i="mapbox://tiles/";i+=r.path.replace("/v4/","");var n=r.params;return e&&(n=n.filter((function(t){return!t.match(/^access_token=/)}))),n.length&&(i+="?"+n.join("&")),i},G.prototype.canonicalizeTileset=function(t,e){for(var r=!!e&&Z(e),i=[],n=0,o=t.tiles||[];n<o.length;n+=1){var a=o[n];H(a)?i.push(this.canonicalizeTileURL(a,r)):i.push(a)}return i},G.prototype._makeAPIURL=function(t,e){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",i=Y(F.API_URL);if(t.protocol=i.protocol,t.authority=i.authority,"/"!==i.path&&(t.path=""+i.path+t.path),!F.REQUIRE_ACCESS_TOKEN)return K(t);if(!(e=e||F.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),K(t)};var W=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function H(t){return W.test(t)}var X=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Y(t){var e=t.match(X);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 K(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function J(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(a.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var Q=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Q.prototype.getStorageKey=function(t){var e,r=J(F.ACCESS_TOKEN);return e=r&&r.u?a.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):F.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},Q.prototype.fetchEventData=function(){var t=M("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var i=a.localStorage.getItem(e);i&&(this.eventData=JSON.parse(i));var n=a.localStorage.getItem(r);n&&(this.anonId=n)}catch(t){w("Unable to read from LocalStorage")}},Q.prototype.saveEventData=function(){var t=M("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{a.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){w("Unable to write to LocalStorage")}},Q.prototype.processRequests=function(t){},Q.prototype.postEvent=function(t,e,r,i){var n=this;if(F.EVENTS_URL){var o=Y(F.EVENTS_URL);o.params.push("access_token="+(i||F.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.11.1",skuId:q,userId:this.anonId},s=e?h(a,e):a,l={url:K(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=bt(l,(function(t){n.pendingRequest=null,r(t),n.saveEventData(),n.processRequests(i)}))}},Q.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var $,tt,et=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,i){this.skuToken=r,(F.EVENTS_URL&&i||F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(t)||H(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},i)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),i=r.id,n=r.timestamp;i&&this.success[i]||(this.anonId||this.fetchEventData(),m(this.anonId)||(this.anonId=f()),this.postEvent(n,{skuToken:this.skuToken},(function(t){t||i&&(e.success[i]=!0)}),t))}},e}(Q),rt=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){F.EVENTS_URL&&F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(t)||H(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=J(F.ACCESS_TOKEN),i=r?r.u:F.ACCESS_TOKEN,n=i!==this.eventData.tokenU;m(this.anonId)||(this.anonId=f(),n=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),l=(o-this.eventData.lastSuccess)/864e5;n=n||l>=1||l<-1||a.getDate()!==s.getDate()}else n=!0;if(!n)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=i)}),t)}},e}(Q)),it=rt.postTurnstileEvent.bind(rt),nt=new et,ot=nt.postMapLoadEvent.bind(nt),at=500,st=50;function lt(){a.caches&&!$&&($=a.caches.open("mapbox-tiles"))}function ut(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ct,ht=1/0;function pt(){return null==ct&&(ct=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),ct}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var ft,mt,gt=function(t){function e(e,r,i){401===r&&H(i)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=i,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),yt=T()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href},vt=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(yt())&&!/^\w+:/.test(r))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,i=new a.AbortController,n=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:yt(),signal:i.signal}),o=!1,s=!1,l=(r=n.url).indexOf("sku=")>0&&H(r);"json"===t.type&&n.headers.set("Accept","application/json");var u=function(r,i,o){if(!s){if(r&&"SecurityError"!==r.message&&w(r),i&&o)return c(i);var u=Date.now();a.fetch(n).then((function(r){if(r.ok){var i=l?r.clone():null;return c(r,i,u)}return e(new gt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(r,i,l){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){s||(i&&l&&function(t,e,r){if(lt(),$){var i={status:e.status,statusText:e.statusText,headers:new a.Headers};e.headers.forEach((function(t,e){return i.headers.set(e,t)}));var n=S(e.headers.get("Cache-Control")||"");n["no-store"]||(n["max-age"]&&i.headers.set("Expires",new Date(r+1e3*n["max-age"]).toUTCString()),new Date(i.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===tt)try{new Response(new ReadableStream),tt=!0}catch(t){tt=!1}tt?e(t.body):t.blob().then(e)}(e,(function(e){var r=new a.Response(e,i);lt(),$&&$.then((function(e){return e.put(ut(t.url),r)})).catch((function(t){return w(t.message)}))})))}}(n,i,l),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return l?function(t,e){if(lt(),!$)return e(null);var r=ut(t.url);$.then((function(t){t.match(r).then((function(i){var n=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=S(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(i);t.delete(r),n&&t.put(r,i.clone()),e(null,i,n)})).catch(e)})).catch(e)}(n,u):u(null,null),{cancel:function(){s=!0,o||i.abort()}}}(t,e);if(T()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new a.XMLHttpRequest;for(var i in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(i,t.headers[i]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var i=r.response;if("json"===t.type)try{i=JSON.parse(r.response)}catch(t){return e(t)}e(null,i,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new gt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},_t=function(t,e){return vt(h(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return vt(h(t,{method:"POST"}),e)};ft=[],mt=0;var xt=function(t,e){if(j.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),mt>=F.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return ft.push(r),r}mt++;var i=!1,n=function(){if(!i)for(i=!0,mt--;ft.length&&mt<F.MAX_PARALLEL_IMAGE_REQUESTS;){var t=ft.shift();t.cancelled||(t.cancel=xt(t.requestParameters,t.callback).cancel)}},o=_t(t,(function(t,r,i,o){n(),t?e(t):r&&(pt()?function(t,e){var r=new a.Blob([new Uint8Array(t)],{type:"image/png"});a.createImageBitmap(r).then((function(t){e(null,t)})).catch((function(t){e(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}(r,e):function(t,e,r,i){var n=new a.Image,o=a.URL;n.onload=function(){e(null,n),o.revokeObjectURL(n.src)},n.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var s=new a.Blob([new Uint8Array(t)],{type:"image/png"});n.cacheControl=r,n.expires=i,n.src=t.byteLength?o.createObjectURL(s):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}(r,e,i,o))}));return{cancel:function(){o.cancel(),n()}}};function wt(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function At(t,e,r){if(r&&r[t]){var i=r[t].indexOf(e);-1!==i&&r[t].splice(i,1)}}var Et=function(t,e){void 0===e&&(e={}),h(this,e),this.type=t},Tt=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",h({error:e},r))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Et),St=function(){};St.prototype.on=function(t,e){return this._listeners=this._listeners||{},wt(t,e,this._listeners),this},St.prototype.off=function(t,e){return At(t,e,this._listeners),At(t,e,this._oneTimeListeners),this},St.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},wt(t,e,this._oneTimeListeners),this},St.prototype.fire=function(t,e){"string"==typeof t&&(t=new Et(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var i=0,n=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];i<n.length;i+=1)n[i].call(this,t);for(var o=0,a=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];o<a.length;o+=1){var s=a[o];At(r,s,this._oneTimeListeners),s.call(this,t)}var l=this._eventedParent;l&&(h(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof Tt&&console.error(t.error);return this},St.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},St.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Pt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"}
vendor: 2,035 bytes, line 16
16,bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0
vendor: 11,915 bytes, line 16
16},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},
vendor: 2,738 bytes, line 16
16expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0
vendor: 14,078 bytes, line 16
16}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}}
vendor: 159,008 bytes, line 16
16,It=function(t,e,r,i){this.message=(t?t+": ":"")+r,i&&(this.identifier=i),null!=e&&e.__line__&&(this.line=e.__line__)};function Mt(t){var e=t.value;return e?[new It(t.key,e,"constants have been deprecated as of v8")]:[]}function Ct(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i<n.length;i+=1){var o=n[i];for(var a in o)t[a]=o[a]}return t}function kt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Lt(t){if(Array.isArray(t))return t.map(Lt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=Lt(t[r]);return e}return kt(t)}var zt=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),Rt=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,i=e;r<i.length;r+=1){var n=i[r];this.bindings[n[0]]=n[1]}};Rt.prototype.concat=function(t){return new Rt(this,t)},Rt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Rt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Ot={kind:"null"},Dt={kind:"number"},Bt={kind:"string"},Ft={kind:"boolean"},jt={kind:"color"},Nt={kind:"object"},Ut={kind:"value"},Vt={kind:"collator"},qt={kind:"formatted"},Gt={kind:"resolvedImage"};function Zt(t,e){return{kind:"array",itemType:t,N:e}}function Wt(t){if("array"===t.kind){var e=Wt(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Ht=[Ot,Dt,Bt,Ft,jt,qt,Nt,Zt(Ut),Gt];function Xt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Xt(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(var r=0,i=Ht;r<i.length;r+=1)if(!Xt(i[r],e))return null}return"Expected "+Wt(t)+" but found "+Wt(e)+" instead."}function Yt(t,e){return e.some((function(e){return e.kind===t.kind}))}function Kt(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var Jt=e((function(t,e){var r={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 i(t){return(t=Math.round(t))<0?0:t>255?255:t}function n(t){return i("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.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===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=s.indexOf("("),u=s.indexOf(")");if(-1!==l&&u+1===s.length){var c=s.substr(0,l),h=s.substr(l+1,u-(l+1)).split(","),p=1;switch(c){case"rgba":if(4!==h.length)return null;p=o(h.pop());case"rgb":return 3!==h.length?null:[n(h[0]),n(h[1]),n(h[2]),p];case"hsla":if(4!==h.length)return null;p=o(h.pop());case"hsl":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,f=o(h[1]),m=o(h[2]),g=m<=.5?m*(f+1):m+f-m*f,y=2*m-g;return[i(255*a(y,g,d+1/3)),i(255*a(y,g,d)),i(255*a(y,g,d-1/3)),p];default:return null}}return null}}catch(t){}})).parseCSSColor,Qt=function(t,e,r,i){void 0===i&&(i=1),this.r=t,this.g=e,this.b=r,this.a=i};Qt.parse=function(t){if(t){if(t instanceof Qt)return t;if("string"==typeof t){var e=Jt(t);if(e)return new Qt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},Qt.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],i=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+i+")"},Qt.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},Qt.black=new Qt(0,0,0,1),Qt.white=new Qt(1,1,1,1),Qt.transparent=new Qt(0,0,0,0),Qt.red=new Qt(1,0,0,1);var $t=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};$t.prototype.compare=function(t,e){return this.collator.compare(t,e)},$t.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var te=function(t,e,r,i,n){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n},ee=function(t){this.sections=t};ee.fromString=function(t){return new ee([new te(t,null,null,null,null)])},ee.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ee.factory=function(t){return t instanceof ee?t:ee.fromString(t)},ee.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ee.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var i=r[e];if(i.image)t.push(["image",i.image.name]);else{t.push(i.text);var n={};i.fontStack&&(n["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(n["font-scale"]=i.scale),i.textColor&&(n["text-color"]=["rgba"].concat(i.textColor.toArray())),t.push(n)}}return t};var re=function(t){this.name=t.name,this.available=t.available};function ie(t,e,r,i){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:"Invalid rgba value ["+[t,e,r,i].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof i?[t,e,r,i]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ne(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof Qt)return!0;if(t instanceof $t)return!0;if(t instanceof ee)return!0;if(t instanceof re)return!0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!ne(r[e]))return!1;return!0}if("object"==typeof t){for(var i in t)if(!ne(t[i]))return!1;return!0}return!1}function oe(t){if(null===t)return Ot;if("string"==typeof t)return Bt;if("boolean"==typeof t)return Ft;if("number"==typeof t)return Dt;if(t instanceof Qt)return jt;if(t instanceof $t)return Vt;if(t instanceof ee)return qt;if(t instanceof re)return Gt;if(Array.isArray(t)){for(var e,r=t.length,i=0,n=t;i<n.length;i+=1){var o=oe(n[i]);if(e){if(e===o)continue;e=Ut;break}e=o}return Zt(e||Ut,r)}return Nt}function ae(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Qt||t instanceof ee||t instanceof re?t.toString():JSON.stringify(t)}re.prototype.toString=function(){return this.name},re.fromString=function(t){return t?new re({name:t,available:!1}):null},re.prototype.serialize=function(){return["image",this.name]};var se=function(t,e){this.type=t,this.value=e};se.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!ne(t[1]))return e.error("invalid value");var r=t[1],i=oe(r),n=e.expectedType;return"array"!==i.kind||0!==i.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(i=n),new se(i,r)},se.prototype.evaluate=function(){return this.value},se.prototype.eachChild=function(){},se.prototype.outputDefined=function(){return!0},se.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Qt?["rgba"].concat(this.value.toArray()):this.value instanceof ee?this.value.serialize():this.value};var le=function(t){this.name="ExpressionEvaluationError",this.message=t};le.prototype.toJSON=function(){return this.message};var ue={string:Bt,number:Dt,boolean:Ft,object:Nt},ce=function(t,e){this.type=t,this.args=e};ce.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,i=1,n=t[0];if("array"===n){var o,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in ue)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=ue[s],i++}else o=Ut;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],i++}r=Zt(o,a)}else r=ue[n];for(var l=[];i<t.length;i++){var u=e.parse(t[i],i,Ut);if(!u)return null;l.push(u)}return new ce(r,l)},ce.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!Xt(this.type,oe(r)))return r;if(e===this.args.length-1)throw new le("Expected value to be of type "+Wt(this.type)+", but found "+Wt(oe(r))+" instead.")}return null},ce.prototype.eachChild=function(t){this.args.forEach(t)},ce.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ce.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var i=t.N;("number"==typeof i||this.args.length>1)&&e.push(i)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var he=function(t){this.type=qt,this.sections=t};he.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var i=[],n=!1,o=1;o<=t.length-1;++o){var a=t[o];if(n&&"object"==typeof a&&!Array.isArray(a)){n=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Dt)))return null;var l=null;if(a["text-font"]&&!(l=e.parse(a["text-font"],1,Zt(Bt))))return null;var u=null;if(a["text-color"]&&!(u=e.parse(a["text-color"],1,jt)))return null;var c=i[i.length-1];c.scale=s,c.font=l,c.textColor=u}else{var h=e.parse(t[o],1,Ut);if(!h)return null;var p=h.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:h,scale:null,font:null,textColor:null})}}return new he(i)},he.prototype.evaluate=function(t){return new ee(this.sections.map((function(e){var r=e.content.evaluate(t);return oe(r)===Gt?new te("",r,null,null,null):new te(ae(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},he.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var i=r[e];t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor)}},he.prototype.outputDefined=function(){return!1},he.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var i=r[e];t.push(i.content.serialize());var n={};i.scale&&(n["font-scale"]=i.scale.serialize()),i.font&&(n["text-font"]=i.font.serialize()),i.textColor&&(n["text-color"]=i.textColor.serialize()),t.push(n)}return t};var pe=function(t){this.type=Gt,this.input=t};pe.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Bt);return r?new pe(r):e.error("No image name provided.")},pe.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=re.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},pe.prototype.eachChild=function(t){t(this.input)},pe.prototype.outputDefined=function(){return!1},pe.prototype.serialize=function(){return["image",this.input.serialize()]};var de={"to-boolean":Ft,"to-color":jt,"to-number":Dt,"to-string":Bt},fe=function(t,e){this.type=t,this.args=e};fe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var i=de[r],n=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,Ut);if(!a)return null;n.push(a)}return new fe(i,n)},fe.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,i=0,n=this.args;i<n.length;i+=1){if(r=null,(e=n[i].evaluate(t))instanceof Qt)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ie(e[0],e[1],e[2],e[3])))return new Qt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new le(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,l=this.args;s<l.length;s+=1){if(null===(a=l[s].evaluate(t)))return 0;var u=Number(a);if(!isNaN(u))return u}throw new le("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?ee.fromString(ae(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?re.fromString(ae(this.args[0].evaluate(t))):ae(this.args[0].evaluate(t))},fe.prototype.eachChild=function(t){this.args.forEach(t)},fe.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},fe.prototype.serialize=function(){if("formatted"===this.type.kind)return new he([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new pe(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var me=["Unknown","Point","LineString","Polygon"],ge=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};ge.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},ge.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?me[this.feature.type]:this.feature.type:null},ge.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},ge.prototype.canonicalID=function(){return this.canonical},ge.prototype.properties=function(){return this.feature&&this.feature.properties||{}},ge.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Qt.parse(t)),e};var ye=function(t,e,r,i){this.name=t,this.type=e,this._evaluate=r,this.args=i};ye.prototype.evaluate=function(t){return this._evaluate(t,this.args)},ye.prototype.eachChild=function(t){this.args.forEach(t)},ye.prototype.outputDefined=function(){return!1},ye.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},ye.parse=function(t,e){var r,i=t[0],n=ye.definitions[i];if(!n)return e.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=a.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),l=null,u=0,c=s;u<c.length;u+=1){var h=c[u],p=h[0],d=h[1];l=new je(e.registry,e.path,null,e.scope);for(var f=[],m=!1,g=1;g<t.length;g++){var y=t[g],v=Array.isArray(p)?p[g-1]:p.type,_=l.parse(y,1+f.length,v);if(!_){m=!0;break}f.push(_)}if(!m)if(Array.isArray(p)&&p.length!==f.length)l.error("Expected "+p.length+" arguments, but found "+f.length+" instead.");else{for(var b=0;b<f.length;b++){var x=Array.isArray(p)?p[b]:p.type,w=f[b];l.concat(b+1).checkSubtype(x,w.type)}if(0===l.errors.length)return new ye(i,o,d,f)}}if(1===s.length)(r=e.errors).push.apply(r,l.errors);else{for(var A=(s.length?s:a).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(Wt).join(", ")+")":"("+Wt(e.type)+"...)"})).join(" | "),E=[],T=1;T<t.length;T++){var S=e.parse(t[T],1+E.length);if(!S)return null;E.push(Wt(S.type))}e.error("Expected arguments of type "+A+", but found ("+E.join(", ")+") instead.")}return null},ye.register=function(t,e){for(var r in ye.definitions=e,e)t[r]=ye};var ve=function(t,e,r){this.type=Vt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function _e(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 be(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function xe(t,e){var r=(180+t[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,n=Math.pow(2,e.z);return[Math.round(r*n*8192),Math.round(i*n*8192)]}function we(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Ae(t,e){for(var r,i,n,o,a,s,l,u=!1,c=0,h=e.length;c<h;c++)for(var p=e[c],d=0,f=p.length;d<f-1;d++){if((o=(r=t)[0]-(i=p[d])[0])*(l=r[1]-(n=p[d+1])[1])-(s=r[0]-n[0])*(a=r[1]-i[1])==0&&o*s<=0&&a*l<=0)return!1;we(t,p[d],p[d+1])&&(u=!u)}return u}function Ee(t,e){for(var r=0;r<e.length;r++)if(Ae(t,e[r]))return!0;return!1}function Te(t,e,r,i){var n=i[0]-r[0],o=i[1]-r[1],a=(t[0]-r[0])*o-n*(t[1]-r[1]),s=(e[0]-r[0])*o-n*(e[1]-r[1]);return a>0&&s<0||a<0&&s>0}function Se(t,e,r){for(var i=0,n=r;i<n.length;i+=1)for(var o=n[i],a=0;a<o.length-1;++a)if(0!=(h=[(c=o[a+1])[0]-(u=o[a])[0],c[1]-u[1]])[0]*(p=[(l=e)[0]-(s=t)[0],l[1]-s[1]])[1]-h[1]*p[0]&&Te(s,l,u,c)&&Te(u,c,s,l))return!0;var s,l,u,c,h,p;return!1}function Pe(t,e){for(var r=0;r<t.length;++r)if(!Ae(t[r],e))return!1;for(var i=0;i<t.length-1;++i)if(Se(t[i],t[i+1],e))return!1;return!0}function Ie(t,e){for(var r=0;r<e.length;r++)if(Pe(t,e[r]))return!0;return!1}function Me(t,e,r){for(var i=[],n=0;n<t.length;n++){for(var o=[],a=0;a<t[n].length;a++){var s=xe(t[n][a],r);_e(e,s),o.push(s)}i.push(o)}return i}function Ce(t,e,r){for(var i=[],n=0;n<t.length;n++){var o=Me(t[n],e,r);i.push(o)}return i}function ke(t,e,r,i){if(t[0]<r[0]||t[0]>r[2]){var n=.5*i,o=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;0===o&&(o=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=o}_e(e,t)}function Le(t,e,r,i){for(var n=8192*Math.pow(2,i.z),o=[8192*i.x,8192*i.y],a=[],s=0,l=t;s<l.length;s+=1)for(var u=0,c=l[s];u<c.length;u+=1){var h=c[u],p=[h.x+o[0],h.y+o[1]];ke(p,e,r,n),a.push(p)}return a}function ze(t,e,r,i){for(var n,o=8192*Math.pow(2,i.z),a=[8192*i.x,8192*i.y],s=[],l=0,u=t;l<u.length;l+=1){for(var c=[],h=0,p=u[l];h<p.length;h+=1){var d=p[h],f=[d.x+a[0],d.y+a[1]];_e(e,f),c.push(f)}s.push(c)}if(e[2]-e[0]<=o/2){(n=e)[0]=n[1]=1/0,n[2]=n[3]=-1/0;for(var m=0,g=s;m<g.length;m+=1)for(var y=0,v=g[m];y<v.length;y+=1)ke(v[y],e,r,o)}return s}ve.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var i=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Ft);if(!i)return null;var n=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Ft);if(!n)return null;var o=null;return r.locale&&!(o=e.parse(r.locale,1,Bt))?null:new ve(i,n,o)},ve.prototype.evaluate=function(t){return new $t(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},ve.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},ve.prototype.outputDefined=function(){return!1},ve.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var Re=function(t,e){this.type=Ft,this.geojson=t,this.geometries=e};function Oe(t){if(t instanceof ye){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Re)return!1;var e=!0;return t.eachChild((function(t){e&&!Oe(t)&&(e=!1)})),e}function De(t){if(t instanceof ye&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!De(t)&&(e=!1)})),e}function Be(t,e){if(t instanceof ye&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Be(t,e)&&(r=!1)})),r}Re.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ne(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var i=0;i<r.features.length;++i){var n=r.features[i].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new Re(r,r.features[i].geometry)}else if("Feature"===r.type){var o=r.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new Re(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new Re(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Re.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){var o=Me(e.coordinates,i,n),a=Le(t.geometry(),r,i,n);if(!be(r,i))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!Ae(l[s],o))return!1}if("MultiPolygon"===e.type){var u=Ce(e.coordinates,i,n),c=Le(t.geometry(),r,i,n);if(!be(r,i))return!1;for(var h=0,p=c;h<p.length;h+=1)if(!Ee(p[h],u))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){var o=Me(e.coordinates,i,n),a=ze(t.geometry(),r,i,n);if(!be(r,i))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!Pe(l[s],o))return!1}if("MultiPolygon"===e.type){var u=Ce(e.coordinates,i,n),c=ze(t.geometry(),r,i,n);if(!be(r,i))return!1;for(var h=0,p=c;h<p.length;h+=1)if(!Ie(p[h],u))return!1}return!0}(t,this.geometries)}return!1},Re.prototype.eachChild=function(){},Re.prototype.outputDefined=function(){return!0},Re.prototype.serialize=function(){return["within",this.geojson]};var Fe=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Fe.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new Fe(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Fe.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Fe.prototype.eachChild=function(){},Fe.prototype.outputDefined=function(){return!1},Fe.prototype.serialize=function(){return["var",this.name]};var je=function(t,e,r,i,n){void 0===e&&(e=[]),void 0===i&&(i=new Rt),void 0===n&&(n=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=i,this.errors=n,this.expectedType=r};function Ne(t,e){for(var r,i=t.length-1,n=0,o=i,a=0;n<=o;)if((r=t[a=Math.floor((n+o)/2)])<=e){if(a===i||e<t[a+1])return a;n=a+1}else{if(!(r>e))throw new le("Input is not a number.");o=a-1}return 0}je.prototype.parse=function(t,e,r,i,n){return void 0===n&&(n={}),e?this.concat(e,r,i)._parse(t,n):this._parse(t,n)},je.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new ce(e,[t]):"coerce"===r?new fe(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var i=t[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found "+typeof i+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[i];if(n){var o=n.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof se)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Fe)return t(e.boundExpression);if(e instanceof ye&&"error"===e.name)return!1;if(e instanceof ve)return!1;if(e instanceof Re)return!1;var r=e instanceof fe||e instanceof ce,i=!0;return e.eachChild((function(e){i=r?i&&t(e):i&&e instanceof se})),!!i&&Oe(e)&&Be(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var l=new ge;try{o=new se(o.type,o.evaluate(l))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},je.prototype.concat=function(t,e,r){var i="number"==typeof t?this.path.concat(t):this.path,n=r?this.scope.concat(r):this.scope;return new je(this.registry,i,e||null,n,this.errors)},je.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var i=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new zt(i,t))},je.prototype.checkSubtype=function(t,e){var r=Xt(t,e);return r&&this.error(r),r};var Ue=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var i=0,n=r;i<n.length;i+=1){var o=n[i],a=o[1];this.labels.push(o[0]),this.outputs.push(a)}};function Ve(t,e,r){return t*(1-r)+e*r}Ue.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,Dt);if(!r)return null;var i=[],n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var o=1;o<t.length;o+=2){var a=1===o?-1/0:t[o],s=t[o+1],l=o,u=o+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(i.length&&i[i.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=e.parse(s,u,n);if(!c)return null;n=n||c.type,i.push([a,c])}return new Ue(n,r,i)},Ue.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;return i>=e[n-1]?r[n-1].evaluate(t):r[Ne(e,i)].evaluate(t)},Ue.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Ue.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Ue.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var qe=Object.freeze({__proto__:null,number:Ve,color:function(t,e,r){return new Qt(Ve(t.r,e.r,r),Ve(t.g,e.g,r),Ve(t.b,e.b,r),Ve(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,i){return Ve(t,e[i],r)}))}}),Ge=6/29*3*(6/29),Ze=Math.PI/180,We=180/Math.PI;function He(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ge+4/29}function Xe(t){return t>6/29?t*t*t:Ge*(t-4/29)}function Ye(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ke(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Je(t){var e=Ke(t.r),r=Ke(t.g),i=Ke(t.b),n=He((.4124564*e+.3575761*r+.1804375*i)/.95047),o=He((.2126729*e+.7151522*r+.072175*i)/1);return{l:116*o-16,a:500*(n-o),b:200*(o-He((.0193339*e+.119192*r+.9503041*i)/1.08883)),alpha:t.a}}function Qe(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*Xe(e),r=.95047*Xe(r),i=1.08883*Xe(i),new Qt(Ye(3.2404542*r-1.5371385*e-.4985314*i),Ye(-.969266*r+1.8760108*e+.041556*i),Ye(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}function $e(t,e,r){var i=e-t;return t+r*(i>180||i<-180?i-360*Math.round(i/360):i)}var tr={forward:Je,reverse:Qe,interpolate:function(t,e,r){return{l:Ve(t.l,e.l,r),a:Ve(t.a,e.a,r),b:Ve(t.b,e.b,r),alpha:Ve(t.alpha,e.alpha,r)}}},er={forward:function(t){var e=Je(t),r=e.l,i=e.a,n=e.b,o=Math.atan2(n,i)*We;return{h:o<0?o+360:o,c:Math.sqrt(i*i+n*n),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Ze,r=t.c;return Qe({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:$e(t.h,e.h,r),c:Ve(t.c,e.c,r),l:Ve(t.l,e.l,r),alpha:Ve(t.alpha,e.alpha,r)}}},rr=Object.freeze({__proto__:null,lab:tr,hcl:er}),ir=function(t,e,r,i,n){this.type=t,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(var o=0,a=n;o<a.length;o+=1){var s=a[o],l=s[1];this.labels.push(s[0]),this.outputs.push(l)}};function nr(t,e,r,i){var n=i-r,o=t-r;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}ir.interpolationFactor=function(t,e,i,n){var o=0;if("exponential"===t.name)o=nr(e,t.base,i,n);else if("linear"===t.name)o=nr(e,1,i,n);else if("cubic-bezier"===t.name){var a=t.controlPoints;o=new r(a[0],a[1],a[2],a[3]).solve(nr(e,1,i,n))}return o},ir.parse=function(t,e){var r=t[0],i=t[1],n=t[2],o=t.slice(3);if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){var a=i[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:a}}else{if("cubic-bezier"!==i[0])return e.error("Unknown interpolation type "+String(i[0]),1,0);var s=i.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,2,Dt)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=jt:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var c=0;c<o.length;c+=2){var h=o[c],p=o[c+1],d=c+3,f=c+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',d);if(l.length&&l[l.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);var m=e.parse(p,f,u);if(!m)return null;u=u||m.type,l.push([h,m])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new ir(u,r,i,n,l):e.error("Type "+Wt(u)+" is not interpolatable.")},ir.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;if(i>=e[n-1])return r[n-1].evaluate(t);var o=Ne(e,i),a=ir.interpolationFactor(this.interpolation,i,e[o],e[o+1]),s=r[o].evaluate(t),l=r[o+1].evaluate(t);return"interpolate"===this.operator?qe[this.type.kind.toLowerCase()](s,l,a):"interpolate-hcl"===this.operator?er.reverse(er.interpolate(er.forward(s),er.forward(l),a)):tr.reverse(tr.interpolate(tr.forward(s),tr.forward(l),a))},ir.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},ir.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},ir.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var or=function(t,e){this.type=t,this.args=e};or.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,i=e.expectedType;i&&"value"!==i.kind&&(r=i);for(var n=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=e.parse(a[o],1+n.length,r,void 0,{typeAnnotation:"omit"});if(!s)return null;r=r||s.type,n.push(s)}var l=i&&n.some((function(t){return Xt(i,t.type)}));return new or(l?Ut:r,n)},or.prototype.evaluate=function(t){for(var e,r=null,i=0,n=0,o=this.args;n<o.length&&(i++,(r=o[n].evaluate(t))&&r instanceof re&&!r.available&&(e||(e=r.name),r=null,i===this.args.length&&(r=e)),null===r);n+=1);return r},or.prototype.eachChild=function(t){this.args.forEach(t)},or.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},or.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ar=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};ar.prototype.evaluate=function(t){return this.result.evaluate(t)},ar.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},ar.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],i=1;i<t.length-1;i+=2){var n=t[i];if("string"!=typeof n)return e.error("Expected string, but found "+typeof n+" instead.",i);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",i);var o=e.parse(t[i+1],i+1);if(!o)return null;r.push([n,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return a?new ar(r,a):null},ar.prototype.outputDefined=function(){return this.result.outputDefined()},ar.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var i=r[e];t.push(i[0],i[1].serialize())}return t.push(this.result.serialize()),t};var sr=function(t,e,r){this.type=t,this.index=e,this.input=r};sr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Dt),i=e.parse(t[2],2,Zt(e.expectedType||Ut));return r&&i?new sr(i.type.itemType,r,i):null},sr.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new le("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new le("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new le("Array index must be an integer, but found "+e+" instead.");return r[e]},sr.prototype.eachChild=function(t){t(this.index),t(this.input)},sr.prototype.outputDefined=function(){return!1},sr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var lr=function(t,e){this.type=Ft,this.needle=t,this.haystack=e};lr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Ut),i=e.parse(t[2],2,Ut);return r&&i?Yt(r.type,[Ft,Bt,Dt,Ot,Ut])?new lr(r,i):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Wt(r.type)+" instead"):null},lr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Kt(e,["boolean","string","number","null"]))throw new le("Expected first argument to be of type boolean, string, number or null, but found "+Wt(oe(e))+" instead.");if(!Kt(r,["string","array"]))throw new le("Expected second argument to be of type array or string, but found "+Wt(oe(r))+" instead.");return r.indexOf(e)>=0},lr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},lr.prototype.outputDefined=function(){return!0},lr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var ur=function(t,e,r){this.type=Dt,this.needle=t,this.haystack=e,this.fromIndex=r};ur.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Ut),i=e.parse(t[2],2,Ut);if(!r||!i)return null;if(!Yt(r.type,[Ft,Bt,Dt,Ot,Ut]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Wt(r.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,Dt);return n?new ur(r,i,n):null}return new ur(r,i)},ur.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Kt(e,["boolean","string","number","null"]))throw new le("Expected first argument to be of type boolean, string, number or null, but found "+Wt(oe(e))+" instead.");if(!Kt(r,["string","array"]))throw new le("Expected second argument to be of type array or string, but found "+Wt(oe(r))+" instead.");if(this.fromIndex){var i=this.fromIndex.evaluate(t);return r.indexOf(e,i)}return r.indexOf(e)},ur.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},ur.prototype.outputDefined=function(){return!1},ur.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var cr=function(t,e,r,i,n,o){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=n,this.otherwise=o};cr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var n={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],l=t[a+1];Array.isArray(s)||(s=[s]);var u=e.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(var c=0,h=s;c<h.length;c+=1){var p=h[c];if("number"!=typeof p&&"string"!=typeof p)return u.error("Branch labels must be numbers or strings.");if("number"==typeof p&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,oe(p)))return null}else r=oe(p);if(void 0!==n[String(p)])return u.error("Branch labels must be unique.");n[String(p)]=o.length}var d=e.parse(l,a,i);if(!d)return null;i=i||d.type,o.push(d)}var f=e.parse(t[1],1,Ut);if(!f)return null;var m=e.parse(t[t.length-1],t.length-1,i);return m?"value"!==f.type.kind&&e.concat(1).checkSubtype(r,f.type)?null:new cr(r,i,f,n,o,m):null},cr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(oe(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},cr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},cr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},cr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],i={},n=0,o=Object.keys(this.cases).sort();n<o.length;n+=1){var a=o[n];void 0===(h=i[this.cases[a]])?(i[this.cases[a]]=r.length,r.push([this.cases[a],[a]])):r[h][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,u=r;l<u.length;l+=1){var c=u[l],h=c[0],p=c[1];e.push(1===p.length?s(p[0]):p.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var hr=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};hr.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var i=[],n=1;n<t.length-1;n+=2){var o=e.parse(t[n],n,Ft);if(!o)return null;var a=e.parse(t[n+1],n+1,r);if(!a)return null;i.push([o,a]),r=r||a.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new hr(r,i,s):null},hr.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[1];if(i[0].evaluate(t))return n.evaluate(t)}return this.otherwise.evaluate(t)},hr.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[1];t(i[0]),t(n)}t(this.otherwise)},hr.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},hr.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var pr=function(t,e,r,i){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=i};function dr(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 fr(t,e,r,i){return 0===i.compare(e,r)}function mr(t,e,r){var i="=="!==t&&"!="!==t;return function(){function n(t,e,r){this.type=Ft,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return n.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],o=e.parse(t[1],1,Ut);if(!o)return null;if(!dr(r,o.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+Wt(o.type)+"'.");var a=e.parse(t[2],2,Ut);if(!a)return null;if(!dr(r,a.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+Wt(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+Wt(o.type)+"' and '"+Wt(a.type)+"'.");i&&("value"===o.type.kind&&"value"!==a.type.kind?o=new ce(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new ce(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,Vt)))return null}return new n(o,a,s)},n.prototype.evaluate=function(n){var o=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){var s=oe(o),l=oe(a);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new le('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!i&&this.hasUntypedArgument){var u=oe(o),c=oe(a);if("string"!==u.kind||"string"!==c.kind)return e(n,o,a)}return this.collator?r(n,o,a,this.collator.evaluate(n)):e(n,o,a)},n.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},n.prototype.outputDefined=function(){return!0},n.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},n}()}pr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Ut),i=e.parse(t[2],2,Dt);if(!r||!i)return null;if(!Yt(r.type,[Zt(Ut),Bt,Ut]))return e.error("Expected first argument to be of type array or string, but found "+Wt(r.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,Dt);return n?new pr(r.type,r,i,n):null}return new pr(r.type,r,i)},pr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Kt(e,["string","array"]))throw new le("Expected first argument to be of type array or string, but found "+Wt(oe(e))+" instead.");if(this.endIndex){var i=this.endIndex.evaluate(t);return e.slice(r,i)}return e.slice(r)},pr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},pr.prototype.outputDefined=function(){return!1},pr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var gr=mr("==",(function(t,e,r){return e===r}),fr),yr=mr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,i){return!fr(0,e,r,i)})),vr=mr("<",(function(t,e,r){return e<r}),(function(t,e,r,i){return i.compare(e,r)<0})),_r=mr(">",(function(t,e,r){return e>r}),(function(t,e,r,i){return i.compare(e,r)>0})),br=mr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,i){return i.compare(e,r)<=0})),xr=mr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,i){return i.compare(e,r)>=0})),wr=function(t,e,r,i,n){this.type=Bt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=n};wr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Dt);if(!r)return null;var i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");var n=null;if(i.locale&&!(n=e.parse(i.locale,1,Bt)))return null;var o=null;if(i.currency&&!(o=e.parse(i.currency,1,Bt)))return null;var a=null;if(i["min-fraction-digits"]&&!(a=e.parse(i["min-fraction-digits"],1,Dt)))return null;var s=null;return i["max-fraction-digits"]&&!(s=e.parse(i["max-fraction-digits"],1,Dt))?null:new wr(r,n,o,a,s)},wr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},wr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},wr.prototype.outputDefined=function(){return!1},wr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Ar=function(t){this.type=Dt,this.input=t};Ar.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Wt(r.type)+" instead."):new Ar(r):null},Ar.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new le("Expected value to be of type string or array, but found "+Wt(oe(e))+" instead.")},Ar.prototype.eachChild=function(t){t(this.input)},Ar.prototype.outputDefined=function(){return!1},Ar.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Er={"==":gr,"!=":yr,">":_r,"<":vr,">=":xr,"<=":br,array:ce,at:sr,boolean:ce,case:hr,coalesce:or,collator:ve,format:he,image:pe,in:lr,"index-of":ur,interpolate:ir,"interpolate-hcl":ir,"interpolate-lab":ir,length:Ar,let:ar,literal:se,match:cr,number:ce,"number-format":wr,object:ce,slice:pr,step:Ue,string:ce,"to-boolean":fe,"to-color":fe,"to-number":fe,"to-string":fe,var:Fe,within:Re};function Tr(t,e){var r=e[0],i=e[1],n=e[2],o=e[3];r=r.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);var a=o?o.evaluate(t):1,s=ie(r,i,n,a);if(s)throw new le(s);return new Qt(r/255*a,i/255*a,n/255*a,a)}function Sr(t,e){return t in e}function Pr(t,e){var r=e[t];return void 0===r?null:r}function Ir(t){return{type:t}}function Mr(t){return{result:"success",value:t}}function Cr(t){return{result:"error",value:t}}function kr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Lr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function zr(t){return!!t.expression&&t.expression.interpolated}function Rr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Or(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Dr(t){return t}function Br(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Fr(t,e,r,i,n){return Br(typeof r===n?i[r]:void 0,t.default,e.default)}function jr(t,e,r){if("number"!==Rr(r))return Br(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var n=Ne(t.stops.map((function(t){return t[0]})),r);return t.stops[n][1]}function Nr(t,e,r){var i=void 0!==t.base?t.base:1;if("number"!==Rr(r))return Br(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var o=Ne(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,i){var n=i-r,o=t-r;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}(r,i,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],l=t.stops[o+1][1],u=qe[e.type]||Dr;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=rr[t.colorSpace];u=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return u(r,i,a)}}:u(s,l,a)}function Ur(t,e,r){return"color"===e.type?r=Qt.parse(r):"formatted"===e.type?r=ee.fromString(r.toString()):"resolvedImage"===e.type?r=re.fromString(r.toString()):Rr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Br(r,t.default,e.default)}ye.register(Er,{error:[{kind:"error"},[Bt],function(t,e){throw new le(e[0].evaluate(t))}],typeof:[Bt,[Ut],function(t,e){return Wt(oe(e[0].evaluate(t)))}],"to-rgba":[Zt(Dt,4),[jt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[jt,[Dt,Dt,Dt],Tr],rgba:[jt,[Dt,Dt,Dt,Dt],Tr],has:{type:Ft,overloads:[[[Bt],function(t,e){return Sr(e[0].evaluate(t),t.properties())}],[[Bt,Nt],function(t,e){var r=e[1];return Sr(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:Ut,overloads:[[[Bt],function(t,e){return Pr(e[0].evaluate(t),t.properties())}],[[Bt,Nt],function(t,e){var r=e[1];return Pr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[Ut,[Bt],function(t,e){return Pr(e[0].evaluate(t),t.featureState||{})}],properties:[Nt,[],function(t){return t.properties()}],"geometry-type":[Bt,[],function(t){return t.geometryType()}],id:[Ut,[],function(t){return t.id()}],zoom:[Dt,[],function(t){return t.globals.zoom}],"heatmap-density":[Dt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Dt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Ut,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Dt,Ir(Dt),function(t,e){for(var r=0,i=0,n=e;i<n.length;i+=1)r+=n[i].evaluate(t);return r}],"*":[Dt,Ir(Dt),function(t,e){for(var r=1,i=0,n=e;i<n.length;i+=1)r*=n[i].evaluate(t);return r}],"-":{type:Dt,overloads:[[[Dt,Dt],function(t,e){var r=e[1];return e[0].evaluate(t)-r.evaluate(t)}],[[Dt],function(t,e){return-e[0].evaluate(t)}]]},"/":[Dt,[Dt,Dt],function(t,e){var r=e[1];return e[0].evaluate(t)/r.evaluate(t)}],"%":[Dt,[Dt,Dt],function(t,e){var r=e[1];return e[0].evaluate(t)%r.evaluate(t)}],ln2:[Dt,[],function(){return Math.LN2}],pi:[Dt,[],function(){return Math.PI}],e:[Dt,[],function(){return Math.E}],"^":[Dt,[Dt,Dt],function(t,e){var r=e[1];return Math.pow(e[0].evaluate(t),r.evaluate(t))}],sqrt:[Dt,[Dt],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[Dt,[Dt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[Dt,[Dt],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[Dt,[Dt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[Dt,[Dt],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[Dt,[Dt],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[Dt,[Dt],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[Dt,[Dt],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[Dt,[Dt],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[Dt,[Dt],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[Dt,Ir(Dt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Dt,Ir(Dt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Dt,[Dt],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[Dt,[Dt],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Dt,[Dt],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[Dt,[Dt],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[Ft,[Bt,Ut],function(t,e){var r=e[0],i=e[1];return t.properties()[r.value]===i.value}],"filter-id-==":[Ft,[Ut],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Ft,[Bt],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Ft,[Bt,Ut],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n<o}],"filter-id-<":[Ft,[Ut],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i<n}],"filter->":[Ft,[Bt,Ut],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n>o}],"filter-id->":[Ft,[Ut],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>n}],"filter-<=":[Ft,[Bt,Ut],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[Ft,[Ut],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i<=n}],"filter->=":[Ft,[Bt,Ut],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[Ft,[Ut],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>=n}],"filter-has":[Ft,[Ut],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ft,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Ft,[Zt(Bt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ft,[Zt(Ut)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ft,[Bt,Zt(Ut)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Ft,[Bt,Zt(Ut)],function(t,e){var r=e[0],i=e[1];return function(t,e,r,i){for(;r<=i;){var n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}(t.properties()[r.value],i.value,0,i.value.length-1)}],all:{type:Ft,overloads:[[[Ft,Ft],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Ir(Ft),function(t,e){for(var r=0,i=e;r<i.length;r+=1)if(!i[r].evaluate(t))return!1;return!0}]]},any:{type:Ft,overloads:[[[Ft,Ft],function(t,e){var r=e[1];return e[0].evaluate(t)||r.evaluate(t)}],[Ir(Ft),function(t,e){for(var r=0,i=e;r<i.length;r+=1)if(i[r].evaluate(t))return!0;return!1}]]},"!":[Ft,[Ft],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Ft,[Bt],function(t,e){var r=t.globals&&t.globals.isSupportedScript;return!r||r(e[0].evaluate(t))}],upcase:[Bt,[Bt],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Bt,[Bt],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Bt,Ir(Ut),function(t,e){return e.map((function(e){return ae(e.evaluate(t))})).join("")}],"resolved-locale":[Bt,[Vt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Vr=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new ge,this._defaultValue=e?function(t){return"color"===t.type&&Or(t.default)?new Qt(0,0,0,0):"color"===t.type?Qt.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function qr(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Er}function Gr(t,e){var r=new je(Er,[],e?function(t){var e={color:jt,string:Bt,number:Dt,enum:Bt,boolean:Ft,formatted:qt,resolvedImage:Gt};return"array"===t.type?Zt(e[t.value]||Ut,t.length):e[t.type]}(e):void 0),i=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?Mr(new Vr(i,e)):Cr(r.errors)}Vr.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Vr.prototype.evaluate=function(t,e,r,i,n,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new le("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Zr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!De(e.expression)};Zr.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,o)},Zr.prototype.evaluate=function(t,e,r,i,n,o){return this._styleExpression.evaluate(t,e,r,i,n,o)};var Wr=function(t,e,r,i){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!De(e.expression),this.interpolationType=i};function Hr(t,e){if("error"===(t=Gr(t,e)).result)return t;var r=t.value.expression,i=Oe(r);if(!i&&!kr(e))return Cr([new zt("","data expressions not supported")]);var n=Be(r,["zoom"]);if(!n&&!Lr(e))return Cr([new zt("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof ar)r=t(e.result);else if(e instanceof or)for(var i=0,n=e.args;i<n.length&&!(r=t(n[i]));i+=1);else(e instanceof Ue||e instanceof ir)&&e.input instanceof ye&&"zoom"===e.input.name&&(r=e);return r instanceof zt||e.eachChild((function(e){var i=t(e);i instanceof zt?r=i:!r&&i?r=new zt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&i&&r!==i&&(r=new zt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),r}(r);return o||n?o instanceof zt?Cr([o]):o instanceof ir&&!zr(e)?Cr([new zt("",'"interpolate" expressions cannot be used with this property')]):Mr(o?new Wr(i?"camera":"composite",t.value,o.labels,o instanceof ir?o.interpolation:void 0):new Zr(i?"constant":"source",t.value)):Cr([new zt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Wr.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,o)},Wr.prototype.evaluate=function(t,e,r,i,n,o){return this._styleExpression.evaluate(t,e,r,i,n,o)},Wr.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?ir.interpolationFactor(this.interpolationType,t,e,r):0};var Xr=function(t,e){this._parameters=t,this._specification=e,Ct(this,function t(e,r){var i,n,o,a="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],l=s||!(s||void 0!==e.property),u=e.type||(zr(r)?"exponential":"interval");if(a&&((e=Ct({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],Qt.parse(t[1])]}))),e.default=Qt.parse(e.default?e.default:r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!rr[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===u)i=Nr;else if("interval"===u)i=jr;else if("categorical"===u){i=Fr,n=Object.create(null);for(var c=0,h=e.stops;c<h.length;c+=1){var p=h[c];n[p[0]]=p[1]}o=typeof e.stops[0][0]}else{if("identity"!==u)throw new Error('Unknown function type "'+u+'"');i=Ur}if(s){for(var d={},f=[],m=0;m<e.stops.length;m++){var g=e.stops[m],y=g[0].zoom;void 0===d[y]&&(d[y]={zoom:y,type:e.type,property:e.property,default:e.default,stops:[]},f.push(y)),d[y].stops.push([g[0].value,g[1]])}for(var v=[],_=0,b=f;_<b.length;_+=1){var x=b[_];v.push([d[x].zoom,t(d[x],r)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:ir.interpolationFactor.bind(void 0,w),zoomStops:v.map((function(t){return t[0]})),evaluate:function(t,i){var n=t.zoom;return Nr({stops:v,base:e.base},r,n).evaluate(n,i)}}}if(l){var A="exponential"===u?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:A,interpolationFactor:ir.interpolationFactor.bind(void 0,A),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return i(e,r,t.zoom,n,o)}}}return{kind:"source",evaluate:function(t,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?Br(e.default,r.default):i(e,r,s,n,o)}}}(this._parameters,this._specification))};function Yr(t){var e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],l=Rr(r);if("object"!==l)return[new It(e,r,"object expected, "+l+" found")];for(var u in r){var c=u.split(".")[0],h=i[c]||i["*"],p=void 0;if(n[c])p=n[c];else if(i[c])p=bi;else if(n["*"])p=n["*"];else{if(!i["*"]){s.push(new It(e,r[u],'unknown property "'+u+'"'));continue}p=bi}s=s.concat(p({key:(e?e+".":e)+u,value:r[u],valueSpec:h,style:o,styleSpec:a,object:r,objectKey:u},r))}for(var d in i)n[d]||i[d].required&&void 0===i[d].default&&void 0===r[d]&&s.push(new It(e,r,'missing required property "'+d+'"'));return s}function Kr(t){var e=t.value,r=t.valueSpec,i=t.style,n=t.styleSpec,o=t.key,a=t.arrayElementValidator||bi;if("array"!==Rr(e))return[new It(o,e,"array expected, "+Rr(e)+" found")];if(r.length&&e.length!==r.length)return[new It(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new It(o,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};n.$version<7&&(s.function=r.function),"object"===Rr(r.value)&&(s=r.value);for(var l=[],u=0;u<e.length;u++)l=l.concat(a({array:e,arrayIndex:u,value:e[u],valueSpec:s,style:i,styleSpec:n,key:o+"["+u+"]"}));return l}function Jr(t){var e=t.key,r=t.value,i=t.valueSpec,n=Rr(r);return"number"===n&&r!=r&&(n="NaN"),"number"!==n?[new It(e,r,"number expected, "+n+" found")]:"minimum"in i&&r<i.minimum?[new It(e,r,r+" is less than the minimum value "+i.minimum)]:"maximum"in i&&r>i.maximum?[new It(e,r,r+" is greater than the maximum value "+i.maximum)]:[]}function Qr(t){var e,r,i,n=t.valueSpec,o=kt(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,l=!s,u="array"===Rr(t.value.stops)&&"array"===Rr(t.value.stops[0])&&"object"===Rr(t.value.stops[0][0]),c=Yr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new It(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Kr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Rr(r)&&0===r.length&&e.push(new It(t.key,r,"array must have at least one stop")),e},default:function(t){return bi({key:t.key,value:t.value,valueSpec:n,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new It(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new It(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!zr(t.valueSpec)&&c.push(new It(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!kr(t.valueSpec)?c.push(new It(t.key,t.value,"property functions not supported")):s&&!Lr(t.valueSpec)&&c.push(new It(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!u||void 0!==t.value.property||c.push(new It(t.key,t.value,'"property" property is required')),c;function h(t){var e=[],o=t.value,s=t.key;if("array"!==Rr(o))return[new It(s,o,"array expected, "+Rr(o)+" found")];if(2!==o.length)return[new It(s,o,"array length 2 expected, length "+o.length+" found")];if(u){if("object"!==Rr(o[0]))return[new It(s,o,"object expected, "+Rr(o[0])+" found")];if(void 0===o[0].zoom)return[new It(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new It(s,o,"object stop key must have value")];if(i&&i>kt(o[0].zoom))return[new It(s,o[0].zoom,"stop zoom values must appear in ascending order")];kt(o[0].zoom)!==i&&(i=kt(o[0].zoom),r=void 0,a={}),e=e.concat(Yr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Jr,value:p}}))}else e=e.concat(p({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return qr(Lt(o[1]))?e.concat([new It(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(bi({key:s+"[1]",value:o[1],valueSpec:n,style:t.style,styleSpec:t.styleSpec}))}function p(t,i){var s=Rr(t.value),l=kt(t.value),u=null!==t.value?t.value:i;if(e){if(s!==e)return[new It(t.key,u,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new It(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var c="number expected, "+s+" found";return kr(n)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new It(t.key,u,c)]}return"categorical"!==o||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==o&&"number"===s&&void 0!==r&&l<r?[new It(t.key,u,"stop domain values must appear in ascending order")]:(r=l,"categorical"===o&&l in a?[new It(t.key,u,"stop domain values must be unique")]:(a[l]=!0,[])):[new It(t.key,u,"integer expected, found "+l)]}}function $r(t){var e=("property"===t.expressionContext?Hr:Gr)(Lt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new It(""+t.key+e.key,t.value,e.message)}));var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return[new It(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&&!De(r))return[new It(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!De(r))return[new It(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Be(r,["zoom","feature-state"]))return[new It(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Oe(r))return[new It(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ti(t){var e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?-1===i.values.indexOf(kt(r))&&n.push(new It(e,r,"expected one of ["+i.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(i.values).indexOf(kt(r))&&n.push(new It(e,r,"expected one of ["+Object.keys(i.values).join(", ")+"], "+JSON.stringify(r)+" found")),n}function ei(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(var e=0,r=t.slice(1);e<r.length;e+=1){var i=r[e];if(!ei(i)&&"boolean"!=typeof i)return!1}return!0;default:return!0}}Xr.deserialize=function(t){return new Xr(t._parameters,t._specification)},Xr.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var ri={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ii(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};ei(t)||(t=oi(t));var e=Gr(t,ri);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,r,i){return e.value.evaluate(t,r,{},i)},needGeometry:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var r=1;r<e.length;r++)if(t(e[r]))return!0;return!1}(t)}}function ni(t,e){return t<e?-1:t>e?1:0}function oi(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?ai(t[1],t[2],"=="):"!="===r?ui(ai(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?ai(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(oi))):"all"===r?["all"].concat(t.slice(1).map(oi)):"none"===r?["all"].concat(t.slice(1).map(oi).map(ui)):"in"===r?si(t[1],t.slice(2)):"!in"===r?ui(si(t[1],t.slice(2))):"has"===r?li(t[1]):"!has"===r?ui(li(t[1])):"within"!==r||t}function ai(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function si(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((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(ni)]]:["filter-in-small",t,["literal",e]]}}function li(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function ui(t){return["!",t]}function ci(t){return ei(Lt(t.value))?$r(Ct({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,i=e.key;if("array"!==Rr(r))return[new It(i,r,"array expected, "+Rr(r)+" found")];var n,o=e.styleSpec,a=[];if(r.length<1)return[new It(i,r,"filter array must have at least 1 element")];switch(a=a.concat(ti({key:i+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),kt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===kt(r[1])&&a.push(new It(i,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new It(i,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(n=Rr(r[1]))&&a.push(new It(i+"[1]",r[1],"string expected, "+n+" found"));for(var s=2;s<r.length;s++)n=Rr(r[s]),"$type"===kt(r[1])?a=a.concat(ti({key:i+"["+s+"]",value:r[s],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&a.push(new It(i+"["+s+"]",r[s],"string, number, or boolean expected, "+n+" found"));break;case"any":case"all":case"none":for(var l=1;l<r.length;l++)a=a.concat(t({key:i+"["+l+"]",value:r[l],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":n=Rr(r[1]),2!==r.length?a.push(new It(i,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==n&&a.push(new It(i+"[1]",r[1],"string expected, "+n+" found"));break;case"within":n=Rr(r[1]),2!==r.length?a.push(new It(i,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"object"!==n&&a.push(new It(i+"[1]",r[1],"object expected, "+n+" found"))}return a}(t)}function hi(t,e){var r=t.key,i=t.style,n=t.styleSpec,o=t.value,a=t.objectKey,s=n[e+"_"+t.layerType];if(!s)return[];var l=a.match(/^(.*)-transition$/);if("paint"===e&&l&&s[l[1]]&&s[l[1]].transition)return bi({key:r,value:o,valueSpec:n.transition,style:i,styleSpec:n});var u,c=t.valueSpec||s[a];if(!c)return[new It(r,o,'unknown property "'+a+'"')];if("string"===Rr(o)&&kr(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(o)))return[new It(r,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(u[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===a&&i&&!i.glyphs&&h.push(new It(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Or(Lt(o))&&"identity"===kt(o.type)&&h.push(new It(r,o,'"text-font" does not support identity functions'))),h.concat(bi({key:t.key,value:o,valueSpec:c,style:i,styleSpec:n,expressionContext:"property",propertyType:e,propertyKey:a}))}function pi(t){return hi(t,"paint")}function di(t){return hi(t,"layout")}function fi(t){var e=[],r=t.value,i=t.key,n=t.style,o=t.styleSpec;r.type||r.ref||e.push(new It(i,r,'either "type" or "ref" is required'));var a,s=kt(r.type),l=kt(r.ref);if(r.id)for(var u=kt(r.id),c=0;c<t.arrayIndex;c++){var h=n.layers[c];kt(h.id)===u&&e.push(new It(i,r.id,'duplicate layer id "'+r.id+'", previously used at line '+h.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new It(i,r[t],'"'+t+'" is prohibited for ref layers'))})),n.layers.forEach((function(t){kt(t.id)===l&&(a=t)})),a?a.ref?e.push(new It(i,r.ref,"ref cannot reference another ref layer")):s=kt(a.type):e.push(new It(i,r.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(r.source){var p=n.sources&&n.sources[r.source],d=p&&kt(p.type);p?"vector"===d&&"raster"===s?e.push(new It(i,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===d&&"raster"!==s?e.push(new It(i,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==d||r["source-layer"]?"raster-dem"===d&&"hillshade"!==s?e.push(new It(i,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===d&&p.lineMetrics||e.push(new It(i,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new It(i,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new It(i,r.source,'source "'+r.source+'" not found'))}else e.push(new It(i,r,'missing required property "source"'));return e=e.concat(Yr({key:i,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return bi({key:i+".type",value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:ci,layout:function(t){return Yr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return di(Ct({layerType:s},t))}}})},paint:function(t){return Yr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return pi(Ct({layerType:s},t))}}})}}}))}function mi(t){var e=t.value,r=t.key,i=Rr(e);return"string"!==i?[new It(r,e,"string expected, "+i+" found")]:[]}var gi={promoteId:function(t){var e=t.key,r=t.value;if("string"===Rr(r))return mi({key:e,value:r});var i=[];for(var n in r)i.push.apply(i,mi({key:e+"."+n,value:r[n]}));return i}};function yi(t){var e=t.value,r=t.key,i=t.styleSpec,n=t.style;if(!e.type)return[new It(r,e,'"type" is required')];var o,a=kt(e.type);switch(a){case"vector":case"raster":case"raster-dem":return Yr({key:r,value:e,valueSpec:i["source_"+a.replace("-","_")],style:t.style,styleSpec:i,objectElementValidators:gi});case"geojson":if(o=Yr({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,objectElementValidators:gi}),e.cluster)for(var s in e.clusterProperties){var l=e.clusterProperties[s],u=l[0],c="string"==typeof u?[u,["accumulated"],["get",s]]:u;o.push.apply(o,$r({key:r+"."+s+".map",value:l[1],expressionContext:"cluster-map"})),o.push.apply(o,$r({key:r+"."+s+".reduce",value:c,expressionContext:"cluster-reduce"}))}return o;case"video":return Yr({key:r,value:e,valueSpec:i.source_video,style:n,styleSpec:i});case"image":return Yr({key:r,value:e,valueSpec:i.source_image,style:n,styleSpec:i});case"canvas":return[new It(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ti({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,styleSpec:i})}}function vi(t){var e=t.value,r=t.styleSpec,i=r.light,n=t.style,o=[],a=Rr(e);if(void 0===e)return o;if("object"!==a)return o.concat([new It("light",e,"object expected, "+a+" found")]);for(var s in e){var l=s.match(/^(.*)-transition$/);o=o.concat(l&&i[l[1]]&&i[l[1]].transition?bi({key:s,value:e[s],valueSpec:r.transition,style:n,styleSpec:r}):i[s]?bi({key:s,value:e[s],valueSpec:i[s],style:n,styleSpec:r}):[new It(s,e[s],'unknown property "'+s+'"')])}return o}var _i={"*":function(){return[]},array:Kr,boolean:function(t){var e=t.value,r=t.key,i=Rr(e);return"boolean"!==i?[new It(r,e,"boolean expected, "+i+" found")]:[]},number:Jr,color:function(t){var e=t.key,r=t.value,i=Rr(r);return"string"!==i?[new It(e,r,"color expected, "+i+" found")]:null===Jt(r)?[new It(e,r,'color expected, "'+r+'" found')]:[]},constants:Mt,enum:ti,filter:ci,function:Qr,layer:fi,object:Yr,source:yi,light:vi,string:mi,formatted:function(t){return 0===mi(t).length?[]:$r(t)},resolvedImage:function(t){return 0===mi(t).length?[]:$r(t)}};function bi(t){var e=t.value,r=t.valueSpec,i=t.styleSpec;return r.expression&&Or(kt(e))?Qr(t):r.expression&&qr(Lt(e))?$r(t):r.type&&_i[r.type]?_i[r.type](t):Yr(Ct({},t,{valueSpec:r.type?i[r.type]:r}))}function xi(t){var e=t.value,r=t.key,i=mi(t);return i.length||(-1===e.indexOf("{fontstack}")&&i.push(new It(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&i.push(new It(r,e,'"glyphs" url must include a "{range}" token'))),i}function wi(t,e){void 0===e&&(e=Pt);var r=[];return r=r.concat(bi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:xi,"*":function(){return[]}}})),t.constants&&(r=r.concat(Mt({key:"constants",value:t.constants,style:t,styleSpec:e}))),Ai(r)}function Ai(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function Ei(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return Ai(t.apply(this,e))}}wi.source=Ei(yi),wi.light=Ei(vi),wi.layer=Ei(fi),wi.filter=Ei(ci),wi.paintProperty=Ei(pi),wi.layoutProperty=Ei(di);var Ti=wi,Si=Ti.light,Pi=Ti.paintProperty,Ii=Ti.layoutProperty;function Mi(t,e){var r=!1;if(e&&e.length)for(var i=0,n=e;i<n.length;i+=1)t.fire(new Tt(new Error(n[i].message))),r=!0;return r}var Ci=ki;function ki(t,e,r){var i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var n=new Int32Array(this.arrayBuffer);t=n[0],this.d=(e=n[1])+2*(r=n[2]);for(var o=0;o<this.d*this.d;o++){var a=n[3+o],s=n[3+o+1];i.push(a===s?null:n.subarray(a,s))}var l=n[3+i.length+1];this.keys=n.subarray(n[3+i.length],l),this.bboxes=n.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var u=0;u<this.d*this.d;u++)i.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var c=r/e*t;this.min=-c,this.max=t+c}ki.prototype.insert=function(t,e,r,i,n){this._forEachCell(e,r,i,n,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)},ki.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},ki.prototype._insertCell=function(t,e,r,i,n,o){this.cells[n].push(o)},ki.prototype.query=function(t,e,r,i,n){var o=this.min,a=this.max;if(t<=o&&e<=o&&a<=r&&a<=i&&!n)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,i,this._queryCell,s,{},n),s},ki.prototype._queryCell=function(t,e,r,i,n,o,a,s){var l=this.cells[n];if(null!==l)for(var u=this.keys,c=this.bboxes,h=0;h<l.length;h++){var p=l[h];if(void 0===a[p]){var d=4*p;(s?s(c[d+0],c[d+1],c[d+2],c[d+3]):t<=c[d+2]&&e<=c[d+3]&&r>=c[d+0]&&i>=c[d+1])?(a[p]=!0,o.push(u[p])):a[p]=!1}}},ki.prototype._forEachCell=function(t,e,r,i,n,o,a,s){for(var l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),h=this._convertToCellCoord(i),p=l;p<=c;p++)for(var d=u;d<=h;d++){var f=this.d*d+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(d),this._convertFromCellCoord(p+1),this._convertFromCellCoord(d+1)))&&n.call(this,t,e,r,i,f,o,a,s))return}},ki.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},ki.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},ki.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,i=0;i<this.cells.length;i++)r+=this.cells[i].length;var n=new Int32Array(e+r+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];n[3+a]=o,n.set(s,o),o+=s.length}return n[3+t.length]=o,n.set(this.keys,o),n[3+t.length+1]=o+=this.keys.length,n.set(this.bboxes,o),o+=this.bboxes.length,n.buffer};var Li=a.ImageData,zi=a.ImageBitmap,Ri={};function Oi(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Ri[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var Di in Oi("Object",Object),Ci.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},Ci.deserialize=function(t){return new Ci(t.buffer)},Oi("Grid",Ci),Oi("Color",Qt),Oi("Error",Error),Oi("ResolvedImage",re),Oi("StylePropertyFunction",Xr),Oi("StyleExpression",Vr,{omit:["_evaluator"]}),Oi("ZoomDependentExpression",Wr),Oi("ZoomConstantExpression",Zr),Oi("CompoundExpression",ye,{omit:["_evaluate"]}),Er)Er[Di]._classRegistryKey||Oi("Expression_"+Di,Er[Di]);function Bi(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Fi(t){return zi&&t instanceof zi}function ji(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(Bi(t)||Fi(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof Li)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var i=[],n=0,o=t;n<o.length;n+=1)i.push(ji(o[n],e));return i}if("object"==typeof t){var a=t.constructor,s=a._classRegistryKey;if(!s)throw new Error("can't serialize object of unregistered class");var l=a.serialize?a.serialize(t,e):{};if(!a.serialize){for(var u in t)if(t.hasOwnProperty(u)&&!(Ri[s].omit.indexOf(u)>=0)){var c=t[u];l[u]=Ri[s].shallow.indexOf(u)>=0?c:ji(c,e)}t instanceof Error&&(l.message=t.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(l.$name=s),l}throw new Error("can't serialize object of type "+typeof t)}function Ni(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||Bi(t)||Fi(t)||ArrayBuffer.isView(t)||t instanceof Li)return t;if(Array.isArray(t))return t.map(Ni);if("object"==typeof t){var e=t.$name||"Object",r=Ri[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var i=Object.create(r.prototype),n=0,o=Object.keys(t);n<o.length;n+=1){var a=o[n];if("$name"!==a){var s=t[a];i[a]=Ri[e].shallow.indexOf(a)>=0?s:Ni(s)}}return i}throw new Error("can't deserialize object of type "+typeof t)}var Ui=function(){this.first=!0};Ui.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var Vi={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function qi(t){for(var e=0,r=t;e<r.length;e+=1)if(Gi(r[e].charCodeAt(0)))return!0;return!1}function Gi(t){return!(746!==t&&747!==t&&(t<4352||!(Vi["Bopomofo Extended"](t)||Vi.Bopomofo(t)||Vi["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Vi["CJK Compatibility Ideographs"](t)||Vi["CJK Compatibility"](t)||Vi["CJK Radicals Supplement"](t)||Vi["CJK Strokes"](t)||!(!Vi["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Vi["CJK Unified Ideographs Extension A"](t)||Vi["CJK Unified Ideographs"](t)||Vi["Enclosed CJK Letters and Months"](t)||Vi["Hangul Compatibility Jamo"](t)||Vi["Hangul Jamo Extended-A"](t)||Vi["Hangul Jamo Extended-B"](t)||Vi["Hangul Jamo"](t)||Vi["Hangul Syllables"](t)||Vi.Hiragana(t)||Vi["Ideographic Description Characters"](t)||Vi.Kanbun(t)||Vi["Kangxi Radicals"](t)||Vi["Katakana Phonetic Extensions"](t)||Vi.Katakana(t)&&12540!==t||!(!Vi["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)||!(!Vi["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Vi["Unified Canadian Aboriginal Syllabics"](t)||Vi["Unified Canadian Aboriginal Syllabics Extended"](t)||Vi["Vertical Forms"](t)||Vi["Yijing Hexagram Symbols"](t)||Vi["Yi Syllables"](t)||Vi["Yi Radicals"](t))))}function Zi(t){return!(Gi(t)||function(t){return!!(Vi["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Vi["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Vi["Letterlike Symbols"](t)||Vi["Number Forms"](t)||Vi["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Vi["Control Pictures"](t)&&9251!==t||Vi["Optical Character Recognition"](t)||Vi["Enclosed Alphanumerics"](t)||Vi["Geometric Shapes"](t)||Vi["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Vi["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Vi["CJK Symbols and Punctuation"](t)||Vi.Katakana(t)||Vi["Private Use Area"](t)||Vi["CJK Compatibility Forms"](t)||Vi["Small Form Variants"](t)||Vi["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Wi(t){return t>=1424&&t<=2303||Vi["Arabic Presentation Forms-A"](t)||Vi["Arabic Presentation Forms-B"](t)}function Hi(t,e){return!(!e&&Wi(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Vi.Khmer(t))}function Xi(t){for(var e=0,r=t;e<r.length;e+=1)if(Wi(r[e].charCodeAt(0)))return!0;return!1}var Yi=null,Ki="unavailable",Ji=null,Qi=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(Ki="error"),Yi&&Yi(t)};function $i(){tn.fire(new Et("pluginStateChange",{pluginStatus:Ki,pluginURL:Ji}))}var tn=new St,en=function(){return Ki},rn=function(){if("deferred"!==Ki||!Ji)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ki="loading",$i(),Ji&&_t({url:Ji},(function(t){t?Qi(t):(Ki="loaded",$i())}))},nn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Ki||null!=nn.applyArabicShaping},isLoading:function(){return"loading"===Ki},setState:function(t){Ki=t.pluginStatus,Ji=t.pluginURL},isParsed:function(){return null!=nn.applyArabicShaping&&null!=nn.processBidirectionalText&&null!=nn.processStyledBidirectionalText},getPluginURL:function(){return Ji}},on=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ui,this.transition={})};on.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,i=t;r<i.length;r+=1)if(!Hi(i[r].charCodeAt(0),e))return!1;return!0}(t,nn.isLoaded())},on.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},on.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var an=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Or(t))return new Xr(t,e);if(qr(t)){var r=Hr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var i=t;return"string"==typeof t&&"color"===e.type&&(i=Qt.parse(t)),{kind:"constant",evaluate:function(){return i}}}(void 0===e?t.specification.default:e,t.specification)};an.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},an.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var sn=function(t){this.property=t,this.value=new an(t,void 0)};sn.prototype.transitioned=function(t,e){return new un(this.property,this.value,e,h({},t.transition,this.transition),t.now)},sn.prototype.untransitioned=function(){return new un(this.property,this.value,null,{},0)};var ln=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ln.prototype.getValue=function(t){return b(this._values[t].value.value)},ln.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new sn(this._values[t].property)),this._values[t].value=new an(this._values[t].property,null===e?void 0:b(e))},ln.prototype.getTransition=function(t){return b(this._values[t].transition)},ln.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new sn(this._values[t].property)),this._values[t].transition=b(e)||void 0},ln.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e],n=this.getValue(i);void 0!==n&&(t[i]=n);var o=this.getTransition(i);void 0!==o&&(t[i+"-transition"]=o)}return t},ln.prototype.transitioned=function(t,e){for(var r=new cn(this._properties),i=0,n=Object.keys(this._values);i<n.length;i+=1){var o=n[i];r._values[o]=this._values[o].transitioned(t,e._values[o])}return r},ln.prototype.untransitioned=function(){for(var t=new cn(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e];t._values[i]=this._values[i].untransitioned()}return t};var un=function(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)};un.prototype.possiblyEvaluate=function(t,e,r){var i=t.now||0,n=this.value.possiblyEvaluate(t,e,r),o=this.prior;if(o){if(i>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return o.possiblyEvaluate(t,e,r);var a=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,r),n,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(a))}return n};var cn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};cn.prototype.possiblyEvaluate=function(t,e,r){for(var i=new dn(this._properties),n=0,o=Object.keys(this._values);n<o.length;n+=1){var a=o[n];i._values[a]=this._values[a].possiblyEvaluate(t,e,r)}return i},cn.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1)if(this._values[e[t]].prior)return!0;return!1};var hn=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};hn.prototype.getValue=function(t){return b(this._values[t].value)},hn.prototype.setValue=function(t,e){this._values[t]=new an(this._values[t].property,null===e?void 0:b(e))},hn.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e],n=this.getValue(i);void 0!==n&&(t[i]=n)}return t},hn.prototype.possiblyEvaluate=function(t,e,r){for(var i=new dn(this._properties),n=0,o=Object.keys(this._values);n<o.length;n+=1){var a=o[n];i._values[a]=this._values[a].possiblyEvaluate(t,e,r)}return i};var pn=function(t,e,r){this.property=t,this.value=e,this.parameters=r};pn.prototype.isConstant=function(){return"constant"===this.value.kind},pn.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},pn.prototype.evaluate=function(t,e,r,i){return this.property.evaluate(this.value,this.parameters,t,e,r,i)};var dn=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};dn.prototype.get=function(t){return this._values[t]};var fn=function(t){this.specification=t};fn.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},fn.prototype.interpolate=function(t,e,r){var i=qe[this.specification.type];return i?i(t,e,r):t};var mn=function(t,e){this.specification=t,this.overrides=e};mn.prototype.possiblyEvaluate=function(t,e,r,i){return new pn(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,i)}:t.expression,e)},mn.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new pn(this,{kind:"constant",value:void 0},t.parameters);var i=qe[this.specification.type];return i?new pn(this,{kind:"constant",value:i(t.value.value,e.value.value,r)},t.parameters):t},mn.prototype.evaluate=function(t,e,r,i,n,o){return"constant"===t.kind?t.value:t.evaluate(e,r,i,n,o)};var gn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(t,e,r,i){if(void 0===t.value)return new pn(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},r,i),o="resolvedImage"===t.property.specification.type&&"string"!=typeof n?n.name:n,a=this._calculate(o,o,o,e);return new pn(this,{kind:"constant",value:a},e)}if("camera"===t.expression.kind){var s=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new pn(this,{kind:"constant",value:s},e)}return new pn(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,i,n,o){if("source"===t.kind){var a=t.evaluate(e,r,i,n,o);return this._calculate(a,a,a,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,i),t.evaluate({zoom:Math.floor(e.zoom)},r,i),t.evaluate({zoom:Math.floor(e.zoom)+1},r,i),e):t.value},e.prototype._calculate=function(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(mn),yn=function(t){this.specification=t};yn.prototype.possiblyEvaluate=function(t,e,r,i){if(void 0!==t.value){if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},r,i);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new on(Math.floor(e.zoom-1),e)),t.expression.evaluate(new on(Math.floor(e.zoom),e)),t.expression.evaluate(new on(Math.floor(e.zoom+1),e)),e)}},yn.prototype._calculate=function(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},yn.prototype.interpolate=function(t){return t};var vn=function(t){this.specification=t};vn.prototype.possiblyEvaluate=function(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)},vn.prototype.interpolate=function(){return!1};var _n=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var i=this.defaultPropertyValues[e]=new an(r,void 0),n=this.defaultTransitionablePropertyValues[e]=new sn(r);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}};Oi("DataDrivenProperty",mn),Oi("DataConstantProperty",fn),Oi("CrossFadedDataDrivenProperty",gn),Oi("CrossFadedProperty",yn),Oi("ColorRampProperty",vn);var bn=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new hn(r.layout)),r.paint)){for(var i in this._transitionablePaint=new ln(r.paint),e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(var n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new dn(r.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){void 0===r&&(r={}),null!=e&&this._validate(Ii,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return y(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(Pi,"layers."+this.id+".paint."+t,t,e,r))return!1;if(y(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;var i=this._transitionablePaint._values[t],n="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),a=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||n||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={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&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),_(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,i,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&Mi(this,t.call(Ti,{key:e,layerType:this.type,objectKey:r,value:i,styleSpec:Pt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof pn&&kr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(St),xn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},wn=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},An=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function En(t,e){void 0===e&&(e=1);var r=0,i=0;return{members:t.map((function(t){var n=xn[t.type].BYTES_PER_ELEMENT,o=r=Tn(r,Math.max(e,n)),a=t.components||1;return i=Math.max(i,n),r+=n*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Tn(r,Math.max(i,e)),alignment:e}}function Tn(t,e){return Math.ceil(t/e)*e}An.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},An.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},An.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},An.prototype.clear=function(){this.length=0},An.prototype.resize=function(t){this.reserve(t),this.length=t},An.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},An.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Sn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var i=2*t;return this.int16[i+0]=e,this.int16[i+1]=r,t},e}(An);Sn.prototype.bytesPerElement=4,Oi("StructArrayLayout2i4",Sn);var Pn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,n){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,t},e}(An);Pn.prototype.bytesPerElement=8,Oi("StructArrayLayout4i8",Pn);var In=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n,o)},e.prototype.emplace=function(t,e,r,i,n,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(An);In.prototype.bytesPerElement=12,Oi("StructArrayLayout2i4i12",In);var Mn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n,o)},e.prototype.emplace=function(t,e,r,i,n,o,a){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=n,this.uint8[l+6]=o,this.uint8[l+7]=a,t},e}(An);Mn.prototype.bytesPerElement=8,Oi("StructArrayLayout2i4ub8",Mn);var Cn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,l,u){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,i,n,o,a,s,l,u)},e.prototype.emplace=function(t,e,r,i,n,o,a,s,l,u,c){var h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=i,this.uint16[h+3]=n,this.uint16[h+4]=o,this.uint16[h+5]=a,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=u,this.uint16[h+9]=c,t},e}(An);Cn.prototype.bytesPerElement=20,Oi("StructArrayLayout10ui20",Cn);var kn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,l,u,c,h){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,i,n,o,a,s,l,u,c,h)},e.prototype.emplace=function(t,e,r,i,n,o,a,s,l,u,c,h,p){var d=12*t;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=o,this.uint16[d+5]=a,this.uint16[d+6]=s,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=c,this.int16[d+10]=h,this.int16[d+11]=p,t},e}(An);kn.prototype.bytesPerElement=24,Oi("StructArrayLayout4i4ui4i24",kn);var Ln=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t},e}(An);Ln.prototype.bytesPerElement=12,Oi("StructArrayLayout3f12",Ln);var zn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(An);zn.prototype.bytesPerElement=4,Oi("StructArrayLayout1ul4",zn);var Rn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,l){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,i,n,o,a,s,l)},e.prototype.emplace=function(t,e,r,i,n,o,a,s,l,u){var c=10*t,h=5*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=i,this.int16[c+3]=n,this.int16[c+4]=o,this.int16[c+5]=a,this.uint32[h+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=u,t},e}(An);Rn.prototype.bytesPerElement=20,Oi("StructArrayLayout6i1ul2ui20",Rn);var On=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n,o)},e.prototype.emplace=function(t,e,r,i,n,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(An);On.prototype.bytesPerElement=12,Oi("StructArrayLayout2i2i2i12",On);var Dn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,i,n)},e.prototype.emplace=function(t,e,r,i,n,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,this.int16[s+6]=n,this.int16[s+7]=o,t},e}(An);Dn.prototype.bytesPerElement=16,Oi("StructArrayLayout2f1f2i16",Dn);var Bn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,n){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=i,this.float32[a+2]=n,t},e}(An);Bn.prototype.bytesPerElement=12,Oi("StructArrayLayout2ub2f12",Bn);var Fn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t},e}(An);Fn.prototype.bytesPerElement=6,Oi("StructArrayLayout3ui6",Fn);var jn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g)},e.prototype.emplace=function(t,e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,y){var v=24*t,_=12*t,b=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=i,this.uint16[v+3]=n,this.uint32[_+2]=o,this.uint32[_+3]=a,this.uint32[_+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=u,this.uint16[v+12]=c,this.float32[_+7]=h,this.float32[_+8]=p,this.uint8[b+36]=d,this.uint8[b+37]=f,this.uint8[b+38]=m,this.uint32[_+10]=g,this.int16[v+22]=y,t},e}(An);jn.prototype.bytesPerElement=48,Oi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",jn);var Nn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,y,v,_,b,x,w,A,E,T,S,P){var I=this.length;return this.resize(I+1),this.emplace(I,t,e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,y,v,_,b,x,w,A,E,T,S,P)},e.prototype.emplace=function(t,e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,y,v,_,b,x,w,A,E,T,S,P,I){var M=34*t,C=17*t;return this.int16[M+0]=e,this.int16[M+1]=r,this.int16[M+2]=i,this.int16[M+3]=n,this.int16[M+4]=o,this.int16[M+5]=a,this.int16[M+6]=s,this.int16[M+7]=l,this.uint16[M+8]=u,this.uint16[M+9]=c,this.uint16[M+10]=h,this.uint16[M+11]=p,this.uint16[M+12]=d,this.uint16[M+13]=f,this.uint16[M+14]=m,this.uint16[M+15]=g,this.uint16[M+16]=y,this.uint16[M+17]=v,this.uint16[M+18]=_,this.uint16[M+19]=b,this.uint16[M+20]=x,this.uint16[M+21]=w,this.uint16[M+22]=A,this.uint32[C+12]=E,this.float32[C+13]=T,this.float32[C+14]=S,this.float32[C+15]=P,this.float32[C+16]=I,t},e}(An);Nn.prototype.bytesPerElement=68,Oi("StructArrayLayout8i15ui1ul4f68",Nn);var Un=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(An);Un.prototype.bytesPerElement=4,Oi("StructArrayLayout1f4",Un);var Vn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t},e}(An);Vn.prototype.bytesPerElement=6,Oi("StructArrayLayout3i6",Vn);var qn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=4*t;return this.uint32[2*t+0]=e,this.uint16[n+2]=r,this.uint16[n+3]=i,t},e}(An);qn.prototype.bytesPerElement=8,Oi("StructArrayLayout1ul2ui8",qn);var Gn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var i=2*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,t},e}(An);Gn.prototype.bytesPerElement=4,Oi("StructArrayLayout2ui4",Gn);var Zn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(An);Zn.prototype.bytesPerElement=2,Oi("StructArrayLayout1ui2",Zn);var Wn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var i=2*t;return this.float32[i+0]=e,this.float32[i+1]=r,t},e}(An);Wn.prototype.bytesPerElement=8,Oi("StructArrayLayout2f8",Wn);var Hn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,n){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=i,this.float32[o+3]=n,t},e}(An);Hn.prototype.bytesPerElement=16,Oi("StructArrayLayout4f16",Hn);var Xn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new n(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(wn);Xn.prototype.size=20;var Yn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Xn(this,t)},e}(Rn);Oi("CollisionBoxArray",Yn);var Kn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(wn);Kn.prototype.size=48;var Jn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Kn(this,t)},e}(jn);Oi("PlacedSymbolArray",Jn);var Qn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(wn);Qn.prototype.size=68;var $n=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Qn(this,t)},e}(Nn);Oi("SymbolInstanceArray",$n);var to=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Un);Oi("GlyphOffsetArray",to);var eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Vn);Oi("SymbolLineVertexArray",eo);var ro=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(wn);ro.prototype.size=8;var io=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ro(this,t)},e}(qn);Oi("FeatureIndexArray",io);var no=En([{name:"a_pos",components:2,type:"Int16"}],4).members,oo=function(t){void 0===t&&(t=[]),this.segments=t};function ao(t,e){return 256*(t=u(Math.floor(t),0,255))+u(Math.floor(e),0,255)}oo.prototype.prepareSegment=function(t,e,r,i){var n=this.segments[this.segments.length-1];return t>oo.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+oo.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>oo.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==i)&&(n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==i&&(n.sortKey=i),this.segments.push(n)),n},oo.prototype.get=function(){return this.segments},oo.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var i in r.vaos)r.vaos[i].destroy()}},oo.simpleSegment=function(t,e,r,i){return new oo([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:i,vaos:{},sortKey:0}])},oo.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Oi("SegmentVector",oo);var so=En([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),lo=e((function(t){t.exports=function(t,e){var r,i,n,o,a,s,l,u;for(i=t.length-(r=3&t.length),n=e,a=3432918353,s=461845907,u=0;u<i;)l=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24,++u,n=27492+(65535&(o=5*(65535&(n=(n^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return n^=t.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0}})),uo=e((function(t){t.exports=function(t,e){for(var r,i=t.length,n=e^i,o=0;i>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),i-=4,++o;switch(i){case 3:n^=(255&t.charCodeAt(o+2))<<16;case 2:n^=(255&t.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(o)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}})),co=lo,ho=uo;co.murmur3=lo,co.murmur2=ho;var po=function(){this.ids=[],this.positions=[],this.indexed=!1};po.prototype.add=function(t,e,r,i){this.ids.push(mo(t)),this.positions.push(e,r,i)},po.prototype.getPositions=function(t){for(var e=mo(t),r=0,i=this.ids.length-1;r<i;){var n=r+i>>1;this.ids[n]>=e?i=n:r=n+1}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},po.serialize=function(t,e){var r=new Float64Array(t.ids),i=new Uint32Array(t.positions);return function t(e,r,i,n){for(;i<n;){for(var o=e[i+n>>1],a=i-1,s=n+1;;){do{a++}while(e[a]<o);do{s--}while(e[s]>o);if(a>=s)break;go(e,a,s),go(r,3*a,3*s),go(r,3*a+1,3*s+1),go(r,3*a+2,3*s+2)}s-i<n-s?(t(e,r,i,s),i=s+1):(t(e,r,s+1,n),n=s)}}(r,i,0,r.length-1),e&&e.push(r.buffer,i.buffer),{ids:r,positions:i}},po.deserialize=function(t){var e=new po;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var fo=Math.pow(2,53)-1;function mo(t){var e=+t;return!isNaN(e)&&e<=fo?e:co(String(t))}function go(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}Oi("FeaturePositionMap",po);var yo=function(t,e){this.gl=t.gl,this.location=e},vo=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(yo),_o=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(yo),bo=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(yo),xo=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(yo),wo=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(yo),Ao=function(t){function e(e,r){t.call(this,e,r),this.current=Qt.transparent}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(yo),Eo=new Float32Array(16),To=function(t){function e(e,r){t.call(this,e,r),this.current=Eo}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(yo);function So(t){return[ao(255*t.r,255*t.g),ao(255*t.b,255*t.a)]}var Po=function(t,e,r){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=r};Po.prototype.setUniform=function(t,e,r){t.set(r.constantOr(this.value))},Po.prototype.getBinding=function(t,e,r){return"color"===this.type?new Ao(t,e):new _o(t,e)};var Io=function(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Io.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},Io.prototype.setUniform=function(t,e,r,i){var n="u_pattern_to"===i?this.patternTo:"u_pattern_from"===i?this.patternFrom:"u_pixel_ratio_to"===i?this.pixelRatioTo:"u_pixel_ratio_from"===i?this.pixelRatioFrom:null;n&&t.set(n)},Io.prototype.getBinding=function(t,e,r){return"u_pattern"===r.substr(0,9)?new wo(t,e):new _o(t,e)};var Mo=function(t,e,r,i){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new i};Mo.prototype.populatePaintArray=function(t,e,r,i,n){var o=this.paintVertexArray.length,a=this.expression.evaluate(new on(0),e,{},i,[],n);this.paintVertexArray.resize(t),this._setPaintValue(o,t,a)},Mo.prototype.updatePaintArray=function(t,e,r,i){var n=this.expression.evaluate({zoom:0},r,i);this._setPaintValue(t,e,n)},Mo.prototype._setPaintValue=function(t,e,r){if("color"===this.type)for(var i=So(r),n=t;n<e;n++)this.paintVertexArray.emplace(n,i[0],i[1]);else{for(var o=t;o<e;o++)this.paintVertexArray.emplace(o,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},Mo.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Mo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var Co=function(t,e,r,i,n,o){this.expression=t,this.uniformNames=e.map((function(t){return"u_"+t+"_t"})),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new o};Co.prototype.populatePaintArray=function(t,e,r,i,n){var o=this.expression.evaluate(new on(this.zoom),e,{},i,[],n),a=this.expression.evaluate(new on(this.zoom+1),e,{},i,[],n),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,o,a)},Co.prototype.updatePaintArray=function(t,e,r,i){var n=this.expression.evaluate({zoom:this.zoom},r,i),o=this.expression.evaluate({zoom:this.zoom+1},r,i);this._setPaintValue(t,e,n,o)},Co.prototype._setPaintValue=function(t,e,r,i){if("color"===this.type)for(var n=So(r),o=So(i),a=t;a<e;a++)this.paintVertexArray.emplace(a,n[0],n[1],o[0],o[1]);else{for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}},Co.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Co.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Co.prototype.setUniform=function(t,e){var r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,i=u(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(i)},Co.prototype.getBinding=function(t,e,r){return new _o(t,e)};var ko=function(t,e,r,i,n,o){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=i,this.layerId=o,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n};ko.prototype.populatePaintArray=function(t,e,r){var i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(i,t,e.patterns&&e.patterns[this.layerId],r)},ko.prototype.updatePaintArray=function(t,e,r,i,n){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],n)},ko.prototype._setPaintValues=function(t,e,r,i){if(i&&r){var n=i[r.min],o=i[r.mid],a=i[r.max];if(n&&o&&a)for(var s=t;s<e;s++)this.zoomInPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],n.tl[0],n.tl[1],n.br[0],n.br[1],o.pixelRatio,n.pixelRatio),this.zoomOutPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],a.tl[0],a.tl[1],a.br[0],a.br[1],o.pixelRatio,a.pixelRatio)}},ko.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,so.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,so.members,this.expression.isStateDependent))},ko.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Lo=function(t,e,r){this.binders={},this._buffers=[];var i=[];for(var n in t.paint._values)if(r(n)){var o=t.paint.get(n);if(o instanceof pn&&kr(o.property.specification)){var a=Ro(n,t.type),s=o.value,l=o.property.specification.type,u=o.property.useIntegerZoom,c=o.property.specification["property-type"],h="cross-faded"===c||"cross-faded-data-driven"===c;if("constant"===s.kind)this.binders[n]=h?new Io(s.value,a):new Po(s.value,a,l),i.push("/u_"+n);else if("source"===s.kind||h){var p=Oo(n,l,"source");this.binders[n]=h?new ko(s,l,u,e,p,t.id):new Mo(s,a,l,p),i.push("/a_"+n)}else{var d=Oo(n,l,"composite");this.binders[n]=new Co(s,a,l,u,e,d),i.push("/z_"+n)}}}this.cacheKey=i.sort().join("")};Lo.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof Mo||e instanceof Co?e.maxValue:0},Lo.prototype.populatePaintArrays=function(t,e,r,i,n){for(var o in this.binders){var a=this.binders[o];(a instanceof Mo||a instanceof Co||a instanceof ko)&&a.populatePaintArray(t,e,r,i,n)}},Lo.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){var i=this.binders[r];i instanceof Io&&i.setConstantPatternPositions(t,e)}},Lo.prototype.updatePaintArrays=function(t,e,r,i,n){var o=!1;for(var a in t)for(var s=0,l=e.getPositions(a);s<l.length;s+=1){var u=l[s],c=r.feature(u.index);for(var h in this.binders){var p=this.binders[h];if((p instanceof Mo||p instanceof Co||p instanceof ko)&&!0===p.expression.isStateDependent){var d=i.paint.get(h);p.expression=d.value,p.updatePaintArray(u.start,u.end,c,t[a],n),o=!0}}}return o},Lo.prototype.defines=function(){var t=[];for(var e in this.binders){var r=this.binders[e];(r instanceof Po||r instanceof Io)&&t.push.apply(t,r.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return t},Lo.prototype.getBinderAttributes=function(){var t=[];for(var e in this.binders){var r=this.binders[e];if(r instanceof Mo||r instanceof Co)for(var i=0;i<r.paintVertexAttributes.length;i++)t.push(r.paintVertexAttributes[i].name);else if(r instanceof ko)for(var n=0;n<so.members.length;n++)t.push(so.members[n].name)}return t},Lo.prototype.getBinderUniforms=function(){var t=[];for(var e in this.binders){var r=this.binders[e];if(r instanceof Po||r instanceof Io||r instanceof Co)for(var i=0,n=r.uniformNames;i<n.length;i+=1)t.push(n[i])}return t},Lo.prototype.getPaintVertexBuffers=function(){return this._buffers},Lo.prototype.getUniforms=function(t,e){var r=[];for(var i in this.binders){var n=this.binders[i];if(n instanceof Po||n instanceof Io||n instanceof Co)for(var o=0,a=n.uniformNames;o<a.length;o+=1){var s=a[o];if(e[s]){var l=n.getBinding(t,e[s],s);r.push({name:s,property:i,binding:l})}}}return r},Lo.prototype.setUniforms=function(t,e,r,i){for(var n=0,o=e;n<o.length;n+=1){var a=o[n],s=a.name,l=a.property;this.binders[l].setUniform(a.binding,i,r.get(l),s)}},Lo.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var r=this.binders[e];if(t&&r instanceof ko){var i=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof Mo||r instanceof Co)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},Lo.prototype.upload=function(t){for(var e in this.binders){var r=this.binders[e];(r instanceof Mo||r instanceof Co||r instanceof ko)&&r.upload(t)}this.updatePaintBuffers()},Lo.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof Mo||e instanceof Co||e instanceof ko)&&e.destroy()}};var zo=function(t,e,r){void 0===r&&(r=function(){return!0}),this.programConfigurations={};for(var i=0,n=t;i<n.length;i+=1){var o=n[i];this.programConfigurations[o.id]=new Lo(o,e,r)}this.needsUpload=!1,this._featureMap=new po,this._bufferOffset=0};function Ro(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function Oo(t,e,r){var i={color:{source:Wn,composite:Hn},number:{source:Un,composite:Wn}},n=function(t){return{"line-pattern":{source:Cn,composite:Cn},"fill-pattern":{source:Cn,composite:Cn},"fill-extrusion-pattern":{source:Cn,composite:Cn}}[t]}(t);return n&&n[r]||i[e][r]}zo.prototype.populatePaintArrays=function(t,e,r,i,n,o){for(var a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(t,e,i,n,o);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},zo.prototype.updatePaintArrays=function(t,e,r,i){for(var n=0,o=r;n<o.length;n+=1){var a=o[n];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,this._featureMap,e,a,i)||this.needsUpload}},zo.prototype.get=function(t){return this.programConfigurations[t]},zo.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},zo.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Oi("ConstantBinder",Po),Oi("CrossFadedConstantBinder",Io),Oi("SourceExpressionBinder",Mo),Oi("CrossFadedCompositeBinder",ko),Oi("CompositeExpressionBinder",Co),Oi("ProgramConfiguration",Lo,{omit:["_buffers"]}),Oi("ProgramConfigurationSet",zo);var Do=Math.pow(2,14)-1,Bo=-Do-1;function Fo(t){for(var e=8192/t.extent,r=t.loadGeometry(),i=0;i<r.length;i++)for(var n=r[i],o=0;o<n.length;o++){var a=n[o],s=Math.round(a.x*e),l=Math.round(a.y*e);a.x=u(s,Bo,Do),a.y=u(l,Bo,Do),(s<a.x||s>a.x+1||l<a.y||l>a.y+1)&&w("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function jo(t,e,r,i,n){t.emplaceBack(2*e+(i+1)/2,2*r+(n+1)/2)}var No=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Sn,this.indexArray=new Fn,this.segments=new oo,this.programConfigurations=new zo(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Uo(t,e){for(var r=0;r<t.length;r++)if(Ko(e,t[r]))return!0;for(var i=0;i<e.length;i++)if(Ko(t,e[i]))return!0;return!!Zo(t,e)}function Vo(t,e,r){return!!Ko(t,e)||!!Ho(e,t,r)}function qo(t,e){if(1===t.length)return Yo(e,t[0]);for(var r=0;r<e.length;r++)for(var i=e[r],n=0;n<i.length;n++)if(Ko(t,i[n]))return!0;for(var o=0;o<t.length;o++)if(Yo(e,t[o]))return!0;for(var a=0;a<e.length;a++)if(Zo(t,e[a]))return!0;return!1}function Go(t,e,r){if(t.length>1){if(Zo(t,e))return!0;for(var i=0;i<e.length;i++)if(Ho(e[i],t,r))return!0}for(var n=0;n<t.length;n++)if(Ho(t[n],e,r))return!0;return!1}function Zo(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var i=t[r],n=t[r+1],o=0;o<e.length-1;o++)if(Wo(i,n,e[o],e[o+1]))return!0;return!1}function Wo(t,e,r,i){return A(t,r,i)!==A(e,r,i)&&A(t,e,r)!==A(t,e,i)}function Ho(t,e,r){var i=r*r;if(1===e.length)return t.distSqr(e[0])<i;for(var n=1;n<e.length;n++)if(Xo(t,e[n-1],e[n])<i)return!0;return!1}function Xo(t,e,r){var i=e.distSqr(r);if(0===i)return t.distSqr(e);var n=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/i;return t.distSqr(n<0?e:n>1?r:r.sub(e)._mult(n)._add(e))}function Yo(t,e){for(var r,i,n,o=!1,a=0;a<t.length;a++)for(var s=0,l=(r=t[a]).length-1;s<r.length;l=s++)(i=r[s]).y>e.y!=(n=r[l]).y>e.y&&e.x<(n.x-i.x)*(e.y-i.y)/(n.y-i.y)+i.x&&(o=!o);return o}function Ko(t,e){for(var r=!1,i=0,n=t.length-1;i<t.length;n=i++){var o=t[i],a=t[n];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function Jo(t,e,r){var i=r[0],n=r[2];if(t.x<i.x&&e.x<i.x||t.x>n.x&&e.x>n.x||t.y<i.y&&e.y<i.y||t.y>n.y&&e.y>n.y)return!1;var o=A(t,e,r[0]);return o!==A(t,e,r[1])||o!==A(t,e,r[2])||o!==A(t,e,r[3])}function Qo(t,e,r){var i=e.paint.get(t).value;return"constant"===i.kind?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function $o(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ta(t,e,r,i,o){if(!e[0]&&!e[1])return t;var a=n.convert(e)._mult(o);"viewport"===r&&a._rotate(-i);for(var s=[],l=0;l<t.length;l++)s.push(t[l].sub(a));return s}No.prototype.populate=function(t,e,r){var i=this.layers[0],n=[],o=null;"circle"===i.type&&(o=i.layout.get("circle-sort-key"));for(var a=0,s=t;a<s.length;a+=1){var l=s[a],u=l.feature,c=l.id,h=l.index,p=l.sourceLayerIndex,d=this.layers[0]._featureFilter.needGeometry,f={type:u.type,id:c,properties:u.properties,geometry:d?Fo(u):[]};if(this.layers[0]._featureFilter.filter(new on(this.zoom),f,r)){d||(f.geometry=Fo(u));var m=o?o.evaluate(f,{},r):void 0;n.push({id:c,properties:u.properties,type:u.type,sourceLayerIndex:p,index:h,geometry:f.geometry,patterns:{},sortKey:m})}}o&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var g=0,y=n;g<y.length;g+=1){var v=y[g],_=v.geometry,b=v.index,x=v.sourceLayerIndex,w=t[b].feature;this.addFeature(v,_,b,r),e.featureIndex.insert(w,_,b,x,this.index)}},No.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},No.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},No.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},No.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,no),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},No.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},No.prototype.addFeature=function(t,e,r,i){for(var n=0,o=e;n<o.length;n+=1)for(var a=0,s=o[n];a<s.length;a+=1){var l=s[a],u=l.x,c=l.y;if(!(u<0||u>=8192||c<0||c>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),p=h.vertexLength;jo(this.layoutVertexArray,u,c,-1,-1),jo(this.layoutVertexArray,u,c,1,-1),jo(this.layoutVertexArray,u,c,1,1),jo(this.layoutVertexArray,u,c,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},i)},Oi("CircleBucket",No,{omit:["layers"]});var ea=new _n({"circle-sort-key":new mn(Pt.layout_circle["circle-sort-key"])}),ra={paint:new _n({"circle-radius":new mn(Pt.paint_circle["circle-radius"]),"circle-color":new mn(Pt.paint_circle["circle-color"]),"circle-blur":new mn(Pt.paint_circle["circle-blur"]),"circle-opacity":new mn(Pt.paint_circle["circle-opacity"]),"circle-translate":new fn(Pt.paint_circle["circle-translate"]),"circle-translate-anchor":new fn(Pt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new fn(Pt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new fn(Pt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new mn(Pt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new mn(Pt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new mn(Pt.paint_circle["circle-stroke-opacity"])}),layout:ea},ia="undefined"!=typeof Float32Array?Float32Array:Array;function na(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 oa(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],d=e[10],f=e[11],m=e[12],g=e[13],y=e[14],v=e[15],_=r[0],b=r[1],x=r[2],w=r[3];return t[0]=_*i+b*s+x*h+w*m,t[1]=_*n+b*l+x*p+w*g,t[2]=_*o+b*u+x*d+w*y,t[3]=_*a+b*c+x*f+w*v,t[4]=(_=r[4])*i+(b=r[5])*s+(x=r[6])*h+(w=r[7])*m,t[5]=_*n+b*l+x*p+w*g,t[6]=_*o+b*u+x*d+w*y,t[7]=_*a+b*c+x*f+w*v,t[8]=(_=r[8])*i+(b=r[9])*s+(x=r[10])*h+(w=r[11])*m,t[9]=_*n+b*l+x*p+w*g,t[10]=_*o+b*u+x*d+w*y,t[11]=_*a+b*c+x*f+w*v,t[12]=(_=r[12])*i+(b=r[13])*s+(x=r[14])*h+(w=r[15])*m,t[13]=_*n+b*l+x*p+w*g,t[14]=_*o+b*u+x*d+w*y,t[15]=_*a+b*c+x*f+w*v,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var aa,sa=oa;function la(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*o+r[12]*a,t[1]=r[1]*i+r[5]*n+r[9]*o+r[13]*a,t[2]=r[2]*i+r[6]*n+r[10]*o+r[14]*a,t[3]=r[3]*i+r[7]*n+r[11]*o+r[15]*a,t}aa=new ia(3),ia!=Float32Array&&(aa[0]=0,aa[1]=0,aa[2]=0),function(){var t=new ia(4);ia!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var ua=(function(){var t=new ia(2);ia!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,ra)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new No(t)},e.prototype.queryRadius=function(t){var e=t;return Qo("circle-radius",this,e)+Qo("circle-stroke-width",this,e)+$o(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,o,a,s){for(var l=ta(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),h=c?l:function(t,e){return t.map((function(t){return ca(t,e)}))}(l,s),p=c?u*a:u,d=0,f=i;d<f.length;d+=1)for(var m=0,g=f[d];m<g.length;m+=1){var y=g[m],v=c?y:ca(y,s),_=p,b=la([],[y.x,y.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?_*=b[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(_*=o.cameraToCenterDistance/b[3]),Vo(h,v,_))return!0}return!1},e}(bn));function ca(t,e){var r=la([],[t.x,t.y,0,1],e);return new n(r[0]/r[3],r[1]/r[3])}var ha=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(No);function pa(t,e,r,i){var n=e.width,o=e.height;if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==n*o*r)throw new RangeError("mismatched image size")}else i=new Uint8Array(n*o*r);return t.width=n,t.height=o,t.data=i,t}
vendor: 5,110 bytes, line 16
16function da(t,e,r){var i=e.width,n=e.height;if(i!==t.width||n!==t.height){var o=pa({},{width:i,height:n},r);fa(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,i),height:Math.min(t.height,n)},r),t.width=i,t.height=n,t.data=o.data}}function fa(t,e,r,i,n,o){if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,l=0;l<n.height;l++)for(var u=((r.y+l)*t.width+r.x)*o,c=((i.y+l)*e.width+i.x)*o,h=0;h<n.width*o;h++)s[c+h]=a[u+h];return e}Oi("HeatmapBucket",ha,{omit:["layers"]});var ma=function(t,e){pa(this,t,1,e)};ma.prototype.resize=function(t){da(this,t,1)},ma.prototype.clone=function(){return new ma({width:this.width,height:this.height},new Uint8Array(this.data))},ma.copy=function(t,e,r,i,n){fa(t,e,r,i,n,1)};var ga=function(t,e){pa(this,t,4,e)};ga.prototype.resize=function(t){da(this,t,4)},ga.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},ga.prototype.clone=function(){return new ga({width:this.width,height:this.height},new Uint8Array(this.data))},ga.copy=function(t,e,r,i,n){fa(t,e,r,i,n,4)},Oi("AlphaImage",ma),Oi("RGBAImage",ga);var ya={paint:new _n({"heatmap-radius":new mn(Pt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new mn(Pt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new fn(Pt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new vn(Pt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new fn(Pt.paint_heatmap["heatmap-opacity"])})};function va(t,e){for(var r=new Uint8Array(1024),i={},n=0,o=0;n<256;n++,o+=4){i[e]=n/255;var a=t.evaluate(i);r[o+0]=Math.floor(255*a.r/a.a),r[o+1]=Math.floor(255*a.g/a.a),r[o+2]=Math.floor(255*a.b/a.a),r[o+3]=Math.floor(255*a.a)}return new ga({width:256,height:1},r)}var _a=function(t){function e(e){t.call(this,e,ya),this._updateColorRamp()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new ha(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){this.colorRamp=va(this._transitionablePaint._values["heatmap-color"].value.expression,"heatmapDensity"),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(bn),ba={paint:new _n({"hillshade-illumination-direction":new fn(Pt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new fn(Pt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new fn(Pt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new fn(Pt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new fn(Pt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new fn(Pt.paint_hillshade["hillshade-accent-color"])})},xa=function(t){function e(e){t.call(this,e,ba)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(bn),wa=En([{name:"a_pos",components:2,type:"Int16"}],4).members,Aa=Ta,Ea=Ta;function Ta(t,e,r){r=r||2;var i,n,o,a,s,l,u,c=e&&e.length,h=c?e[0]*r:t.length,p=Sa(t,0,h,r,!0),d=[];if(!p||p.next===p.prev)return d;if(c&&(p=function(t,e,r,i){var n,o,a,s=[];for(n=0,o=e.length;n<o;n++)(a=Sa(t,e[n]*i,n<o-1?e[n+1]*i:t.length,i,!1))===a.next&&(a.steiner=!0),s.push(Ba(a));for(s.sort(za),n=0;n<s.length;n++)Ra(s[n],r),r=Pa(r,r.next);return r}(t,e,p,r)),t.length>80*r){i=o=t[0],n=a=t[1];for(var f=r;f<h;f+=r)(s=t[f])<i&&(i=s),(l=t[f+1])<n&&(n=l),s>o&&(o=s),l>a&&(a=l);u=0!==(u=Math.max(o-i,a-n))?1/u:0}return Ia(p,d,r,i,n,u),d}function Sa(t,e,r,i,n){var o,a;if(n===Ka(t,e,r,i)>0)for(o=e;o<r;o+=i)a=Ha(o,t[o],t[o+1],a);else for(o=r-i;o>=e;o-=i)a=Ha(o,t[o],t[o+1],a);return a&&Ua(a,a.next)&&(Xa(a),a=a.next),a}function Pa(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!Ua(i,i.next)&&0!==Na(i.prev,i,i.next))i=i.next;else{if(Xa(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function Ia(t,e,r,i,n,o,a){if(t){!a&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=Da(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,r,i,n,o,a,s,l,u=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,i=r,s=0,e=0;e<u&&(s++,i=i.nextZ);e++);for(l=u;s>0||l>0&&i;)0!==s&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,s--):(n=i,i=i.nextZ,l--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(a>1)}(n)}(t,i,n,o);for(var s,l,u=t;t.prev!==t.next;
vendor: 55,728 bytes, line 16
16)if(s=t.prev,l=t.next,o?Ca(t,i,n,o):Ma(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),Xa(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?Ia(t=ka(Pa(t),e,r),e,r,i,n,o,2):2===a&&La(t,e,r,i,n,o):Ia(Pa(t),e,r,i,n,o,1);break}}}function Ma(t){var e=t.prev,r=t,i=t.next;if(Na(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(Fa(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&Na(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function Ca(t,e,r,i){var n=t.prev,o=t,a=t.next;if(Na(n,o,a)>=0)return!1;for(var s=n.x>o.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,l=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,u=Da(n.x<o.x?n.x<a.x?n.x:a.x:o.x<a.x?o.x:a.x,n.y<o.y?n.y<a.y?n.y:a.y:o.y<a.y?o.y:a.y,e,r,i),c=Da(s,l,e,r,i),h=t.prevZ,p=t.nextZ;h&&h.z>=u&&p&&p.z<=c;){if(h!==t.prev&&h!==t.next&&Fa(n.x,n.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Na(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,p!==t.prev&&p!==t.next&&Fa(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Na(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;h&&h.z>=u;){if(h!==t.prev&&h!==t.next&&Fa(n.x,n.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Na(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;p&&p.z<=c;){if(p!==t.prev&&p!==t.next&&Fa(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Na(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function ka(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!Ua(n,o)&&Va(n,i,i.next,o)&&Za(n,o)&&Za(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),Xa(i),Xa(i.next),i=t=o),i=i.next}while(i!==t);return Pa(i)}function La(t,e,r,i,n,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ja(a,s)){var l=Wa(a,s);return a=Pa(a,a.next),l=Pa(l,l.next),Ia(a,e,r,i,n,o),void Ia(l,e,r,i,n,o)}s=s.next}a=a.next}while(a!==t)}function za(t,e){return t.x-e.x}function Ra(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&s>a){if(a=s,s===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!r)return null;if(n===a)return r;var l,u=r,c=r.x,h=r.y,p=1/0;i=r;do{n>=i.x&&i.x>=c&&n!==i.x&&Fa(o<h?n:a,o,c,h,o<h?a:n,o,i.x,i.y)&&(l=Math.abs(o-i.y)/(n-i.x),Za(i,t)&&(l<p||l===p&&(i.x>r.x||i.x===r.x&&Oa(r,i)))&&(r=i,p=l)),i=i.next}while(i!==u);return r}(t,e)){var r=Wa(e,t);Pa(e,e.next),Pa(r,r.next)}}function Oa(t,e){return Na(t.prev,t,e.prev)<0&&Na(e.next,t,t.next)<0}function Da(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ba(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function Fa(t,e,r,i,n,o,a,s){return(n-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(i-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(n-a)*(i-s)>=0}function ja(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Va(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Za(t,e)&&Za(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(Na(t.prev,t,e.prev)||Na(t,e.prev,e))||Ua(t,e)&&Na(t.prev,t,t.next)>0&&Na(e.prev,e,e.next)>0)}function Na(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ua(t,e){return t.x===e.x&&t.y===e.y}function Va(t,e,r,i){var n=Ga(Na(t,e,r)),o=Ga(Na(t,e,i)),a=Ga(Na(r,i,t)),s=Ga(Na(r,i,e));return n!==o&&a!==s||!(0!==n||!qa(t,r,e))||!(0!==o||!qa(t,i,e))||!(0!==a||!qa(r,t,i))||!(0!==s||!qa(r,e,i))}function qa(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ga(t){return t>0?1:t<0?-1:0}function Za(t,e){return Na(t.prev,t,t.next)<0?Na(t,e,t.next)>=0&&Na(t,t.prev,e)>=0:Na(t,e,t.prev)<0||Na(t,t.next,e)<0}function Wa(t,e){var r=new Ya(t.i,t.x,t.y),i=new Ya(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function Ha(t,e,r,i){var n=new Ya(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Xa(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 Ya(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ka(t,e,r,i){for(var n=0,o=e,a=r-i;o<r;o+=i)n+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return n}function Ja(t,e,r,i,n){!function t(e,r,i,n,o){for(;n>i;){if(n-i>600){var a=n-i+1,s=r-i+1,l=Math.log(a),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(i,Math.floor(r-s*u/a+c)),Math.min(n,Math.floor(r+(a-s)*u/a+c)),o)}var h=e[r],p=i,d=n;for(Qa(e,i,r),o(e[n],h)>0&&Qa(e,i,n);p<d;){for(Qa(e,p,d),p++,d--;o(e[p],h)<0;)p++;for(;o(e[d],h)>0;)d--}0===o(e[i],h)?Qa(e,i,d):Qa(e,++d,n),d<=r&&(i=d+1),r<=d&&(n=d-1)}}(t,e,r||0,i||t.length-1,n||$a)}function Qa(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function $a(t,e){return t<e?-1:t>e?1:0}function ts(t,e){var r=t.length;if(r<=1)return[t];for(var i,n,o=[],a=0;a<r;a++){var s=E(t[a]);0!==s&&(t[a].area=Math.abs(s),void 0===n&&(n=s<0),n===s<0?(i&&o.push(i),i=[t[a]]):i.push(t[a]))}if(i&&o.push(i),e>1)for(var l=0;l<o.length;l++)o[l].length<=e||(Ja(o[l],e,1,o[l].length-1,es),o[l]=o[l].slice(0,e));return o}function es(t,e){return e.area-t.area}function rs(t,e,r){for(var i=r.patternDependencies,n=!1,o=0,a=e;o<a.length;o+=1){var s=a[o].paint.get(t+"-pattern");s.isConstant()||(n=!0);var l=s.constantOr(null);l&&(n=!0,i[l.to]=!0,i[l.from]=!0)}return n}function is(t,e,r,i,n){for(var o=n.patternDependencies,a=0,s=e;a<s.length;a+=1){var l=s[a],u=l.paint.get(t+"-pattern").value;if("constant"!==u.kind){var c=u.evaluate({zoom:i-1},r,{},n.availableImages),h=u.evaluate({zoom:i},r,{},n.availableImages),p=u.evaluate({zoom:i+1},r,{},n.availableImages);h=h&&h.name?h.name:h,p=p&&p.name?p.name:p,o[c=c&&c.name?c.name:c]=!0,o[h]=!0,o[p]=!0,r.patterns[l.id]={min:c,mid:h,max:p}}}return r}Ta.deviation=function(t,e,r,i){var n=e&&e.length,o=Math.abs(Ka(t,0,n?e[0]*r:t.length,r));if(n)for(var a=0,s=e.length;a<s;a++)o-=Math.abs(Ka(t,e[a]*r,a<s-1?e[a+1]*r:t.length,r));var l=0;for(a=0;a<i.length;a+=3){var u=i[a]*r,c=i[a+1]*r,h=i[a+2]*r;l+=Math.abs((t[u]-t[h])*(t[c+1]-t[u+1])-(t[u]-t[c])*(t[h+1]-t[u+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},Ta.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[n][o][a]);n>0&&r.holes.push(i+=t[n-1].length)}return r},Aa.default=Ea;var ns=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Sn,this.indexArray=new Fn,this.indexArray2=new Gn,this.programConfigurations=new zo(t.layers,t.zoom),this.segments=new oo,this.segments2=new oo,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ns.prototype.populate=function(t,e,r){this.hasPattern=rs("fill",this.layers,e);for(var i=this.layers[0].layout.get("fill-sort-key"),n=[],o=0,a=t;o<a.length;o+=1){var s=a[o],l=s.feature,u=s.id,c=s.index,h=s.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,d={type:l.type,id:u,properties:l.properties,geometry:p?Fo(l):[]};if(this.layers[0]._featureFilter.filter(new on(this.zoom),d,r)){p||(d.geometry=Fo(l));var f=i?i.evaluate(d,{},r,e.availableImages):void 0;n.push({id:u,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:d.geometry,patterns:{},sortKey:f})}}i&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,g=n;m<g.length;m+=1){var y=g[m],v=y.geometry,_=y.index,b=y.sourceLayerIndex;if(this.hasPattern){var x=is("fill",this.layers,y,this.zoom,e);this.patternFeatures.push(x)}else this.addFeature(y,v,_,r,{});e.featureIndex.insert(t[_].feature,v,_,b,this.index)}},ns.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},ns.prototype.addFeatures=function(t,e,r){for(var i=0,n=this.patternFeatures;i<n.length;i+=1){var o=n[i];this.addFeature(o,o.geometry,o.index,e,r)}},ns.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ns.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ns.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,wa),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},ns.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},ns.prototype.addFeature=function(t,e,r,i,n){for(var o=0,a=ts(e,500);o<a.length;o+=1){for(var s=a[o],l=0,u=0,c=s;u<c.length;u+=1)l+=c[u].length;for(var h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),p=h.vertexLength,d=[],f=[],m=0,g=s;m<g.length;m+=1){var y=g[m];if(0!==y.length){y!==s[0]&&f.push(d.length/2);var v=this.segments2.prepareSegment(y.length,this.layoutVertexArray,this.indexArray2),_=v.vertexLength;this.layoutVertexArray.emplaceBack(y[0].x,y[0].y),this.indexArray2.emplaceBack(_+y.length-1,_),d.push(y[0].x),d.push(y[0].y);for(var b=1;b<y.length;b++)this.layoutVertexArray.emplaceBack(y[b].x,y[b].y),this.indexArray2.emplaceBack(_+b-1,_+b),d.push(y[b].x),d.push(y[b].y);v.vertexLength+=y.length,v.primitiveLength+=y.length}}for(var x=Aa(d,f),w=0;w<x.length;w+=3)this.indexArray.emplaceBack(p+x[w],p+x[w+1],p+x[w+2]);h.vertexLength+=l,h.primitiveLength+=x.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n,i)},Oi("FillBucket",ns,{omit:["layers","patternFeatures"]});var os=new _n({"fill-sort-key":new mn(Pt.layout_fill["fill-sort-key"])}),as={paint:new _n({"fill-antialias":new fn(Pt.paint_fill["fill-antialias"]),"fill-opacity":new mn(Pt.paint_fill["fill-opacity"]),"fill-color":new mn(Pt.paint_fill["fill-color"]),"fill-outline-color":new mn(Pt.paint_fill["fill-outline-color"]),"fill-translate":new fn(Pt.paint_fill["fill-translate"]),"fill-translate-anchor":new fn(Pt.paint_fill["fill-translate-anchor"]),"fill-pattern":new gn(Pt.paint_fill["fill-pattern"])}),layout:os},ss=function(t){function e(e){t.call(this,e,as)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r);var 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"])},e.prototype.createBucket=function(t){return new ns(t)},e.prototype.queryRadius=function(){return $o(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,o,a){return qo(ta(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),i)},e.prototype.isTileClipped=function(){return!0},e}(bn),ls=En([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,us=cs;function cs(t,e,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n,t.readFields(hs,this,e)}function hs(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function ps(t){for(var e,r,i=0,n=0,o=t.length,a=o-1;n<o;a=n++)i+=((r=t[a]).x-(e=t[n]).x)*(e.y+r.y);return i}cs.types=["Unknown","Point","LineString","Polygon"],cs.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,i=1,o=0,a=0,s=0,l=[];t.pos<r;){if(o<=0){var u=t.readVarint();i=7&u,o=u>>3}if(o--,1===i||2===i)a+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&l.push(e),e=[]),e.push(new n(a,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&l.push(e),l},cs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,n=0,o=0,a=1/0,s=-1/0,l=1/0,u=-1/0;t.pos<e;){if(i<=0){var c=t.readVarint();r=7&c,i=c>>3}if(i--,1===r||2===r)(n+=t.readSVarint())<a&&(a=n),n>s&&(s=n),(o+=t.readSVarint())<l&&(l=o),o>u&&(u=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,l,s,u]},cs.prototype.toGeoJSON=function(t,e,r){var i,n,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=cs.types[this.type];function c(t){for(var e=0;e<t.length;e++){var r=t[e];t[e]=[360*(r.x+a)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+s)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(i=0;i<l.length;i++)h[i]=l[i][0];c(l=h);break;case 2:for(i=0;i<l.length;i++)c(l[i]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var r,i,n=[],o=0;o<e;o++){var a=ps(t[o]);0!==a&&(void 0===i&&(i=a<0),i===a<0?(r&&n.push(r),r=[t[o]]):r.push(t[o]))}return r&&n.push(r),n}(l),i=0;i<l.length;i++)for(n=0;n<l[i].length;n++)c(l[i][n])}1===l.length?l=l[0]:u="Multi"+u;var p={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(p.id=this.id),p};var ds=fs;function fs(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(ms,this,e),this.length=this._features.length}function ms(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var i=t.readVarint()>>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(r))}function gs(t,e,r){if(3===t){var i=new ds(r,r.readVarint()+r.pos);i.length&&(e[i.name]=i)}}fs.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 us(this._pbf,e,this.extent,this._keys,this._values)};var ys={VectorTile:function(t,e){this.layers=t.readFields(gs,{},e)},VectorTileFeature:us,VectorTileLayer:ds},vs=ys.VectorTileFeature.types,_s=Math.pow(2,13);function bs(t,e,r,i,n,o,a,s){t.emplaceBack(e,r,2*Math.floor(i*_s)+a,n*_s*2,o*_s*2,Math.round(s))}var xs=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new In,this.indexArray=new Fn,this.programConfigurations=new zo(t.layers,t.zoom),this.segments=new oo,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function ws(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}xs.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=rs("fill-extrusion",this.layers,e);for(var i=0,n=t;i<n.length;i+=1){var o=n[i],a=o.feature,s=o.id,l=o.index,u=o.sourceLayerIndex,c=this.layers[0]._featureFilter.needGeometry,h={type:a.type,id:s,properties:a.properties,geometry:c?Fo(a):[]};if(this.layers[0]._featureFilter.filter(new on(this.zoom),h,r)){var p={id:s,sourceLayerIndex:u,index:l,geometry:c?h.geometry:Fo(a),properties:a.properties,type:a.type,patterns:{}};void 0!==a.id&&(p.id=a.id),this.hasPattern?this.features.push(is("fill-extrusion",this.layers,p,this.zoom,e)):this.addFeature(p,p.geometry,l,r,{}),e.featureIndex.insert(a,p.geometry,l,u,this.index,!0)}}},xs.prototype.addFeatures=function(t,e,r){for(var i=0,n=this.features;i<n.length;i+=1){var o=n[i];this.addFeature(o,o.geometry,o.index,e,r)}},xs.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},xs.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},xs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},xs.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ls),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},xs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},xs.prototype.addFeature=function(t,e,r,i,n){for(var o=0,a=ts(e,500);o<a.length;o+=1){for(var s=a[o],l=0,u=0,c=s;u<c.length;u+=1)l+=c[u].length;for(var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),p=0,d=s;p<d.length;p+=1){var f=d[p];if(0!==f.length&&!((L=f).every((function(t){return t.x<0}))||L.every((function(t){return t.x>8192}))||L.every((function(t){return t.y<0}))||L.every((function(t){return t.y>8192}))))for(var m=0,g=0;g<f.length;g++){var y=f[g];if(g>=1){var v=f[g-1];if(!ws(y,v)){h.vertexLength+4>oo.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var _=y.sub(v)._perp()._unit(),b=v.dist(y);m+b>32768&&(m=0),bs(this.layoutVertexArray,y.x,y.y,_.x,_.y,0,0,m),bs(this.layoutVertexArray,y.x,y.y,_.x,_.y,0,1,m),bs(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,0,m+=b),bs(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,1,m);var x=h.vertexLength;this.indexArray.emplaceBack(x,x+2,x+1),this.indexArray.emplaceBack(x+1,x+2,x+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+l>oo.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===vs[t.type]){for(var w=[],A=[],E=h.vertexLength,T=0,S=s;T<S.length;T+=1){var P=S[T];if(0!==P.length){P!==s[0]&&A.push(w.length/2);for(var I=0;I<P.length;I++){var M=P[I];bs(this.layoutVertexArray,M.x,M.y,0,0,1,1,0),w.push(M.x),w.push(M.y)}}}for(var C=Aa(w,A),k=0;k<C.length;k+=3)this.indexArray.emplaceBack(E+C[k],E+C[k+2],E+C[k+1]);h.primitiveLength+=C.length/3,h.vertexLength+=l}}var L;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n,i)},Oi("FillExtrusionBucket",xs,{omit:["layers","features"]});var As={paint:new _n({"fill-extrusion-opacity":new fn(Pt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new mn(Pt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new fn(Pt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new fn(Pt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new gn(Pt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new mn(Pt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new mn(Pt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new fn(Pt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Es=function(t){function e(e){t.call(this,e,As)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new xs(t)},e.prototype.queryRadius=function(){return $o(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,r,i,o,a,s,l){var u=ta(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),c=this.paint.get("fill-extrusion-height").evaluate(e,r),h=this.paint.get("fill-extrusion-base").evaluate(e,r),p=function(t,e){for(var r=[],i=0,o=t;i<o.length;i+=1){var a=o[i],s=[a.x,a.y,0,1];la(s,s,e),r.push(new n(s[0]/s[3],s[1]/s[3]))}return r}(u,l),d=function(t,e,r,i){for(var o=[],a=[],s=i[8]*e,l=i[9]*e,u=i[10]*e,c=i[11]*e,h=i[8]*r,p=i[9]*r,d=i[10]*r,f=i[11]*r,m=0,g=t;m<g.length;m+=1){for(var y=[],v=[],_=0,b=g[m];_<b.length;_+=1){var x=b[_],w=x.x,A=x.y,E=i[0]*w+i[4]*A+i[12],T=i[1]*w+i[5]*A+i[13],S=i[2]*w+i[6]*A+i[14],P=i[3]*w+i[7]*A+i[15],I=S+u,M=P+c,C=E+h,k=T+p,L=S+d,z=P+f,R=new n((E+s)/M,(T+l)/M);R.z=I/M,y.push(R);var O=new n(C/z,k/z);O.z=L/z,v.push(O)}o.push(y),a.push(v)}return[o,a]}(i,h,c,l);return function(t,e,r){var i=1/0;qo(r,e)&&(i=Ss(r,e[0]));for(var n=0;n<e.length;n++)for(var o=e[n],a=t[n],s=0;s<o.length-1;s++){var l=o[s],u=[l,o[s+1],a[s+1],a[s],l];Uo(r,u)&&(i=Math.min(i,Ss(r,u)))}return i!==1/0&&i}(d[0],d[1],p)},e}(bn);function Ts(t,e){return t.x*e.x+t.y*e.y}function Ss(t,e){if(1===t.length){for(var r,i=0,n=e[i++];!r||n.equals(r);)if(!(r=e[i++]))return 1/0;for(;i<e.length;i++){var o=e[i],a=t[0],s=r.sub(n),l=o.sub(n),u=a.sub(n),c=Ts(s,s),h=Ts(s,l),p=Ts(l,l),d=Ts(u,s),f=Ts(u,l),m=c*p-h*h,g=(p*d-h*f)/m,y=(c*f-h*d)/m,v=n.z*(1-g-y)+r.z*g+o.z*y;if(isFinite(v))return v}return 1/0}for(var _=1/0,b=0,x=e;b<x.length;b+=1)_=Math.min(_,x[b].z);return _}var Ps=En([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Is=ys.VectorTileFeature.types,Ms=Math.cos(Math.PI/180*37.5),Cs=Math.pow(2,14)/.5,ks=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Mn,this.indexArray=new Fn,this.programConfigurations=new zo(t.layers,t.zoom),this.segments=new oo,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ks.prototype.populate=function(t,e,r){this.hasPattern=rs("line",this.layers,e);for(var i=this.layers[0].layout.get("line-sort-key"),n=[],o=0,a=t;o<a.length;o+=1){var s=a[o],l=s.feature,u=s.id,c=s.index,h=s.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,d={type:l.type,id:u,properties:l.properties,geometry:p?Fo(l):[]};if(this.layers[0]._featureFilter.filter(new on(this.zoom),d,r)){p||(d.geometry=Fo(l));var f=i?i.evaluate(d,{},r):void 0;n.push({id:u,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:d.geometry,patterns:{},sortKey:f})}}i&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,g=n;m<g.length;m+=1){var y=g[m],v=y.geometry,_=y.index,b=y.sourceLayerIndex;if(this.hasPattern){var x=is("line",this.layers,y,this.zoom,e);this.patternFeatures.push(x)}else this.addFeature(y,v,_,r,{});e.featureIndex.insert(t[_].feature,v,_,b,this.index)}},ks.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},ks.prototype.addFeatures=function(t,e,r){for(var i=0,n=this.patternFeatures;i<n.length;i+=1){var o=n[i];this.addFeature(o,o.geometry,o.index,e,r)}},ks.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ks.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ks.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ps),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},ks.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},ks.prototype.addFeature=function(t,e,r,i,n){for(var o=this.layers[0].layout,a=o.get("line-join").evaluate(t,{}),s=o.get("line-cap"),l=o.get("line-miter-limit"),u=o.get("line-round-limit"),c=0,h=e;c<h.length;c+=1)this.addLine(h[c],t,a,s,l,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n,i)},ks.prototype.addLine=function(t,e,r,i,n,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+e.properties.mapbox_clip_start,this.clipEnd=+e.properties.mapbox_clip_end;for(var a=0;a<t.length-1;a++)this.totalDistance+=t[a].dist(t[a+1]);this.updateScaledDistance()}for(var s="Polygon"===Is[e.type],l=t.length;l>=2&&t[l-1].equals(t[l-2]);)l--;for(var u=0;u<l-1&&t[u].equals(t[u+1]);)u++;if(!(l<(s?3:2))){"bevel"===r&&(n=1.05);var c,h=this.overscaling<=16?122880/(512*this.overscaling):0,p=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),d=void 0,f=void 0,m=void 0,g=void 0;this.e1=this.e2=-1,s&&(g=t[u].sub(c=t[l-2])._unit()._perp());for(var y=u;y<l;y++)if(!(f=y===l-1?s?t[u+1]:void 0:t[y+1])||!t[y].equals(f)){g&&(m=g),c&&(d=c),c=t[y],g=f?f.sub(c)._unit()._perp():m;var v=(m=m||g).add(g);0===v.x&&0===v.y||v._unit();var _=m.x*g.x+m.y*g.y,b=v.x*g.x+v.y*g.y,x=0!==b?1/b:1/0,w=2*Math.sqrt(2-2*b),A=b<Ms&&d&&f,E=m.x*g.y-m.y*g.x>0;if(A&&y>u){var T=c.dist(d);if(T>2*h){var S=c.sub(c.sub(d)._mult(h/T)._round());this.updateDistance(d,S),this.addCurrentVertex(S,m,0,0,p),d=S}}var P=d&&f,I=P?r:s?"butt":i;if(P&&"round"===I&&(x<o?I="miter":x<=2&&(I="fakeround")),"miter"===I&&x>n&&(I="bevel"),"bevel"===I&&(x>2&&(I="flipbevel"),x<n&&(I="miter")),d&&this.updateDistance(d,c),"miter"===I)v._mult(x),this.addCurrentVertex(c,v,0,0,p);else if("flipbevel"===I){if(x>100)v=g.mult(-1);else{var M=x*m.add(g).mag()/m.sub(g).mag();v._perp()._mult(M*(E?-1:1))}this.addCurrentVertex(c,v,0,0,p),this.addCurrentVertex(c,v.mult(-1),0,0,p)}else if("bevel"===I||"fakeround"===I){var C=-Math.sqrt(x*x-1),k=E?C:0,L=E?0:C;if(d&&this.addCurrentVertex(c,m,k,L,p),"fakeround"===I)for(var z=Math.round(180*w/Math.PI/20),R=1;R<z;R++){var O=R/z;if(.5!==O){var D=O-.5;O+=O*D*(O-1)*((1.0904+_*(_*(3.55645-1.43519*_)-3.2452))*D*D+(.848013+_*(.215638*_-1.06021)))}var B=g.sub(m)._mult(O)._add(m)._unit()._mult(E?-1:1);this.addHalfVertex(c,B.x,B.y,!1,E,0,p)}f&&this.addCurrentVertex(c,g,-k,-L,p)}else if("butt"===I)this.addCurrentVertex(c,v,0,0,p);else if("square"===I){var F=d?1:-1;this.addCurrentVertex(c,v,F,F,p)}else"round"===I&&(d&&(this.addCurrentVertex(c,m,0,0,p),this.addCurrentVertex(c,m,1,1,p,!0)),f&&(this.addCurrentVertex(c,g,-1,-1,p,!0),this.addCurrentVertex(c,g,0,0,p)));if(A&&y<l-1){var j=c.dist(f);if(j>2*h){var N=c.add(f.sub(c)._mult(h/j)._round());this.updateDistance(c,N),this.addCurrentVertex(N,g,0,0,p),c=N}}}}},ks.prototype.addCurrentVertex=function(t,e,r,i,n,o){void 0===o&&(o=!1);var a=e.y*i-e.x,s=-e.y-e.x*i;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,n),this.addHalfVertex(t,a,s,o,!0,-i,n),this.distance>Cs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,i,n,o))},ks.prototype.addHalfVertex=function(t,e,r,i,n,o,a){var s=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((t.x<<1)+(i?1:0),(t.y<<1)+(n?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6);var l=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),a.primitiveLength++),n?this.e2=l:this.e1=l},ks.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Cs-1):this.distance},ks.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Oi("LineBucket",ks,{omit:["layers","patternFeatures"]});var Ls=new _n({"line-cap":new fn(Pt.layout_line["line-cap"]),"line-join":new mn(Pt.layout_line["line-join"]),"line-miter-limit":new fn(Pt.layout_line["line-miter-limit"]),"line-round-limit":new fn(Pt.layout_line["line-round-limit"]),"line-sort-key":new mn(Pt.layout_line["line-sort-key"])}),zs={paint:new _n({"line-opacity":new mn(Pt.paint_line["line-opacity"]),"line-color":new mn(Pt.paint_line["line-color"]),"line-translate":new fn(Pt.paint_line["line-translate"]),"line-translate-anchor":new fn(Pt.paint_line["line-translate-anchor"]),"line-width":new mn(Pt.paint_line["line-width"]),"line-gap-width":new mn(Pt.paint_line["line-gap-width"]),"line-offset":new mn(Pt.paint_line["line-offset"]),"line-blur":new mn(Pt.paint_line["line-blur"]),"line-dasharray":new yn(Pt.paint_line["line-dasharray"]),"line-pattern":new gn(Pt.paint_line["line-pattern"]),"line-gradient":new vn(Pt.paint_line["line-gradient"])}),layout:Ls},Rs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new on(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,i,n){return r=h({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,i,n)},e}(mn))(zs.paint.properties["line-width"].specification);Rs.useIntegerZoom=!0;var Os=function(t){function e(e){t.call(this,e,zs)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){this.gradient=va(this._transitionablePaint._values["line-gradient"].value.expression,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Rs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new ks(t)},e.prototype.queryRadius=function(t){var e=t,r=Ds(Qo("line-width",this,e),Qo("line-gap-width",this,e)),i=Qo("line-offset",this,e);return r/2+Math.abs(i)+$o(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,o,a,s){var l=ta(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),u=s/2*Ds(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(i=function(t,e){for(var r=[],i=new n(0,0),o=0;o<t.length;o++){for(var a=t[o],s=[],l=0;l<a.length;l++){var u=a[l],c=a[l+1],h=0===l?i:u.sub(a[l-1])._unit()._perp(),p=l===a.length-1?i:c.sub(u)._unit()._perp(),d=h._add(p)._unit();d._mult(1/(d.x*p.x+d.y*p.y)),s.push(d._mult(e)._add(u))}r.push(s)}return r}(i,c*s)),function(t,e,r){for(var i=0;i<e.length;i++){var n=e[i];if(t.length>=3)for(var o=0;o<n.length;o++)if(Ko(t,n[o]))return!0;if(Go(t,n,r))return!0}return!1}(l,i,u)},e.prototype.isTileClipped=function(){return!0},e}(bn);function Ds(t,e){return e>0?e+2*t:t}var Bs=En([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Fs=En([{name:"a_projected_pos",components:3,type:"Float32"}],4),js=(En([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),En([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Ns=(En([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),En([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Us=En([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Vs(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var i=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===i?t=t.toLocaleUpperCase():"lowercase"===i&&(t=t.toLocaleLowerCase()),nn.applyArabicShaping&&(t=nn.applyArabicShaping(t)),t}(t.text,e,r)})),t}En([{name:"triangle",components:3,type:"Uint16"}]),En([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),En([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),En([{type:"Float32",name:"offsetX"}]),En([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var qs={"!":"ï¸","#":"ï¼",$:"ï¼","%":"ï¼
","&":"ï¼","(":"︵",")":"︶","*":"ï¼","+":"ï¼",",":"ï¸","-":"︲",".":"ã»","/":"ï¼",":":"ï¸",";":"ï¸","<":"︿","=":"ï¼",">":"ï¹","?":"ï¸","@":"ï¼ ","[":"ï¹","\\":"ï¼¼","]":"ï¹","^":"ï¼¾",_:"︳","`":"ï½","{":"︷","|":"â","}":"︸","~":"ï½","¢":"ï¿ ","£":"ï¿¡","Â¥":"ï¿¥","¦":"¦","¬":"ï¿¢","¯":"ï¿£","â":"︲","â":"︱","â":"ï¹","â":"ï¹","â":"ï¹","â":"ï¹","â¦":"ï¸","â§":"ã»","â©":"₩","ã":"ï¸","ã":"ï¸","ã":"︿","ã":"ï¹","ã":"︽","ã":"︾","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"︻","ã":"︼","ã":"︹","ã":"︺","ã":"ï¸","ã":"ï¸","ï¼":"ï¸","ï¼":"︵","ï¼":"︶","ï¼":"ï¸","ï¼":"︲","ï¼":"ã»","ï¼":"ï¸","ï¼":"ï¸","ï¼":"︿","ï¼":"ï¹","ï¼":"ï¸","ï¼»":"ï¹","ï¼½":"ï¹","_":"︳","ï½":"︷","ï½":"â","ï½":"︸","ï½":"︵","ï½ ":"︶","。":"ï¸","ï½¢":"ï¹","ï½£":"ï¹"},Gs=function(t,e,r,i,n){var o,a,s=8*n-i-1,l=(1<<s)-1,u=l>>1,c=-7,h=r?n-1:0,p=r?-1:1,d=t[e+h];for(h+=p,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=i;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,i),o-=u}return(d?-1:1)*a*Math.pow(2,o-i)},Zs=function(t,e,r,i,n,o){var a,s,l,u=8*o-n-1,c=(1<<u)-1,h=c>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,f=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*l-1)*Math.pow(2,n),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[r+d]=255&s,d+=f,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;t[r+d]=255&a,d+=f,a/=256,u-=8);t[r+d-f]|=128*m},Ws=Hs;function Hs(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Hs.Varint=0,Hs.Fixed64=1,Hs.Bytes=2,Hs.Fixed32=5;var Xs="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Ys(t){return t.type===Hs.Bytes?t.readVarint()+t.pos:t.pos+1}function Ks(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Js(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n]}function Qs(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function $s(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function tl(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function el(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function rl(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function il(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function nl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function ol(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function al(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function sl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function ll(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function ul(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function cl(t,e,r){1===t&&r.readMessage(hl,e)}function hl(t,e,r){if(3===t){var i=r.readMessage(pl,{}),n=i.width,o=i.height,a=i.left,s=i.top,l=i.advance;e.push({id:i.id,bitmap:new ma({width:n+6,height:o+6},i.bitmap),metrics:{width:n,height:o,left:a,top:s,advance:l}})}}function pl(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function dl(t){for(var e=0,r=0,i=0,n=t;i<n.length;i+=1){var o=n[i];e+=o.w*o.h,r=Math.max(r,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,l=0,u=0,c=t;u<c.length;u+=1)for(var h=c[u],p=a.length-1;p>=0;p--){var d=a[p];if(!(h.w>d.w||h.h>d.h)){if(h.x=d.x,h.y=d.y,l=Math.max(l,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===d.w&&h.h===d.h){var f=a.pop();p<a.length&&(a[p]=f)}else h.h===d.h?(d.x+=h.w,d.w-=h.w):h.w===d.w?(d.y+=h.h,d.h-=h.h):(a.push({x:d.x+h.w,y:d.y,w:d.w-h.w,h:h.h}),d.y+=h.h,d.h-=h.h);break}}return{w:s,h:l,fill:e/(s*l)||0}}Hs.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var i=this.readVarint(),n=i>>3,o=this.pos;this.type=7&i,t(n,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=sl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=ul(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=sl(this.buf,this.pos)+4294967296*sl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=sl(this.buf,this.pos)+4294967296*ul(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Gs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Gs(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,i=this.buf;return e=127&(r=i[this.pos++]),r<128?e:(e|=(127&(r=i[this.pos++]))<<7,r<128?e:(e|=(127&(r=i[this.pos++]))<<14,r<128?e:(e|=(127&(r=i[this.pos++]))<<21,r<128?e:function(t,e,r){var i,n,o=r.buf;if(i=(112&(n=o[r.pos++]))>>4,n<128)return Ks(t,i,e);if(i|=(127&(n=o[r.pos++]))<<3,n<128)return Ks(t,i,e);if(i|=(127&(n=o[r.pos++]))<<10,n<128)return Ks(t,i,e);if(i|=(127&(n=o[r.pos++]))<<17,n<128)return Ks(t,i,e);if(i|=(127&(n=o[r.pos++]))<<24,n<128)return Ks(t,i,e);if(i|=(1&(n=o[r.pos++]))<<31,n<128)return Ks(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=i[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&&Xs?function(t,e,r){return Xs.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var i="",n=e;n<r;){var o,a,s,l=t[n],u=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(o=t[n+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===c?(a=t[n+2],128==(192&(o=t[n+1]))&&128==(192&a)&&((u=(15&l)<<12|(63&o)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(a=t[n+2],s=t[n+3],128==(192&(o=t[n+1]))&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,i+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),i+=String.fromCharCode(u),n+=c}return i}(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!==Hs.Bytes)return t.push(this.readVarint(e));var r=Ys(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Hs.Bytes)return t.push(this.readSVarint());var e=Ys(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Hs.Bytes)return t.push(this.readBoolean());var e=Ys(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Hs.Bytes)return t.push(this.readFloat());var e=Ys(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Hs.Bytes)return t.push(this.readDouble());var e=Ys(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Hs.Bytes)return t.push(this.readFixed32());var e=Ys(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Hs.Bytes)return t.push(this.readSFixed32());var e=Ys(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Hs.Bytes)return t.push(this.readFixed64());var e=Ys(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Hs.Bytes)return t.push(this.readSFixed64());var e=Ys(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Hs.Varint)for(;this.buf[this.pos++]>127;);else if(e===Hs.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Hs.Fixed32)this.pos+=4;else{if(e!==Hs.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 r=new Uint8Array(e);r.set(this.buf),this.buf=r,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),ll(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ll(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ll(this.buf,-1&t,this.pos),ll(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ll(this.buf,-1&t,this.pos),ll(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,i=i+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,r.buf[r.pos]=127&(t>>>=7)}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(i,e)}(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(t,e,r){for(var i,n,o=0;o<e.length;o++){if((i=e.charCodeAt(o))>55295&&i<57344){if(!n){i>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Js(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Zs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Zs(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 r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var i=this.pos-r;i>=128&&Js(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,Hs.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Qs,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,$s,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,rl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,tl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,el,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,il,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,nl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,ol,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,al,e)},writeBytesField:function(t,e){this.writeTag(t,Hs.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Hs.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Hs.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Hs.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Hs.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Hs.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Hs.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Hs.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Hs.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Hs.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var fl=function(t,e){var r=e.pixelRatio,i=e.version,n=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=n,this.stretchY=o,this.content=a,this.version=i},ml={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};ml.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},ml.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},ml.tlbr.get=function(){return this.tl.concat(this.br)},ml.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(fl.prototype,ml);var gl=function(t,e){var r={},i={};this.haveRenderCallbacks=[];var n=[];this.addImages(t,r,n),this.addImages(e,i,n);var o=dl(n),a=new ga({width:o.w||1,height:o.h||1});for(var s in t){var l=t[s],u=r[s].paddedRect;ga.copy(l.data,a,{x:0,y:0},{x:u.x+1,y:u.y+1},l.data)}for(var c in e){var h=e[c],p=i[c].paddedRect,d=p.x+1,f=p.y+1,m=h.data.width,g=h.data.height;ga.copy(h.data,a,{x:0,y:0},{x:d,y:f},h.data),ga.copy(h.data,a,{x:0,y:g-1},{x:d,y:f-1},{width:m,height:1}),ga.copy(h.data,a,{x:0,y:0},{x:d,y:f+g},{width:m,height:1}),ga.copy(h.data,a,{x:m-1,y:0},{x:d-1,y:f},{width:1,height:g}),ga.copy(h.data,a,{x:0,y:0},{x:d+m,y:f},{width:1,height:g})}this.image=a,this.iconPositions=r,this.patternPositions=i};gl.prototype.addImages=function(t,e,r){for(var i in t){var n=t[i],o={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(o),e[i]=new fl(o,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}},gl.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},gl.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var i=t.tl;r.update(e.data,void 0,{x:i[0],y:i[1]})}},Oi("ImagePosition",fl),Oi("ImageAtlas",gl);var yl={horizontal:1,vertical:2,horizontalOnly:3},vl=function(){this.scale=1,this.fontStack="",this.imageName=null};vl.forText=function(t,e){var r=new vl;return r.scale=t||1,r.fontStack=e,r},vl.forImage=function(t){var e=new vl;return e.imageName=t,e};var _l=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function bl(t,e,r,i,n,o,a,s,l,u,c,h,p,d,f,m){var g,y=_l.fromFeature(t,n);h===yl.vertical&&y.verticalizePunctuation();var v=nn.processBidirectionalText,_=nn.processStyledBidirectionalText;if(v&&1===y.sections.length){g=[];for(var b=0,x=v(y.toString(),Pl(y,u,o,e,i,d,f));b<x.length;b+=1){var w=x[b],A=new _l;A.text=w,A.sections=y.sections;for(var E=0;E<w.length;E++)A.sectionIndex.push(0);g.push(A)}}else if(_){g=[];for(var T=0,S=_(y.text,y.sectionIndex,Pl(y,u,o,e,i,d,f));T<S.length;T+=1){var P=S[T],I=new _l;I.text=P[0],I.sectionIndex=P[1],I.sections=y.sections,g.push(I)}}else g=function(t,e){for(var r=[],i=t.text,n=0,o=0,a=e;o<a.length;o+=1){var s=a[o];r.push(t.substring(n,s)),n=s}return n<i.length&&r.push(t.substring(n,i.length)),r}(y,Pl(y,u,o,e,i,d,f));var M=[],C={positionedLines:M,text:y.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(t,e,r,i,n,o,a,s,l,u,c,h){for(var p=0,d=-17,f=0,m=0,g="right"===s?1:"left"===s?0:.5,y=0,v=0,_=n;v<_.length;v+=1){var b=_[v];b.trim();var x=b.getMaxScale(),w=24*(x-1),A={positionedGlyphs:[],lineOffset:0};t.positionedLines[y]=A;var E=A.positionedGlyphs,T=0;if(b.length()){for(var S=0;S<b.length();S++){var P=b.getSection(S),I=b.getSectionIndex(S),M=b.getCharCode(S),C=0,k=null,L=null,z=null,R=24,O=!(l===yl.horizontal||!c&&!Gi(M)||c&&(xl[M]||(G=M,Vi.Arabic(G)||Vi["Arabic Supplement"](G)||Vi["Arabic Extended-A"](G)||Vi["Arabic Presentation Forms-A"](G)||Vi["Arabic Presentation Forms-B"](G))));if(P.imageName){var D=i[P.imageName];if(!D)continue;z=P.imageName,t.iconsInText=t.iconsInText||!0,L=D.paddedRect;var B=D.displaySize;P.scale=24*P.scale/h,C=w+(24-B[1]*P.scale),R=(k={width:B[0],height:B[1],left:1,top:-3,advance:O?B[1]:B[0]}).advance;var F=O?B[0]*P.scale-24*x:B[1]*P.scale-24*x;F>0&&F>T&&(T=F)}else{var j=r[P.fontStack],N=j&&j[M];if(N&&N.rect)L=N.rect,k=N.metrics;else{var U=e[P.fontStack],V=U&&U[M];if(!V)continue;k=V.metrics}C=24*(x-P.scale)}O?(t.verticalizable=!0,E.push({glyph:M,imageName:z,x:p,y:d+C,vertical:O,scale:P.scale,fontStack:P.fontStack,sectionIndex:I,metrics:k,rect:L}),p+=R*P.scale+u):(E.push({glyph:M,imageName:z,x:p,y:d+C,vertical:O,scale:P.scale,fontStack:P.fontStack,sectionIndex:I,metrics:k,rect:L}),p+=k.advance*P.scale+u)}0!==E.length&&(f=Math.max(p-u,f),Ml(E,0,E.length-1,g,T)),p=0;var q=o*x+T;A.lineOffset=Math.max(T,w),d+=q,m=Math.max(q,m),++y}else d+=o,++y}var G,Z=d- -17,W=Il(a),H=W.horizontalAlign,X=W.verticalAlign;(function(t,e,r,i,n,o,a,s,l){var u,c=(e-r)*n;u=o!==a?-s*i- -17:(-i*l+.5)*a;for(var h=0,p=t;h<p.length;h+=1)for(var d=0,f=p[h].positionedGlyphs;d<f.length;d+=1){var m=f[d];m.x+=c,m.y+=u}})(t.positionedLines,g,H,X,f,m,o,Z,n.length),t.top+=-X*Z,t.bottom=t.top+Z,t.left+=-H*f,t.right=t.left+f}(C,e,r,i,g,a,s,l,h,u,p,m),!function(t){for(var e=0,r=t;e<r.length;e+=1)if(0!==r[e].positionedGlyphs.length)return!1;return!0}(M)&&C}_l.fromFeature=function(t,e){for(var r=new _l,i=0;i<t.sections.length;i++){var n=t.sections[i];n.image?r.addImageSection(n):r.addTextSection(n,e)}return r},_l.prototype.length=function(){return this.text.length},_l.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},_l.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},_l.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},_l.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var i=t.charCodeAt(r+1)||null,n=t.charCodeAt(r-1)||null;e+=i&&Zi(i)&&!qs[t[r+1]]||n&&Zi(n)&&!qs[t[r-1]]||!qs[t[r]]?t[r]:qs[t[r]]}return e}(this.text)},_l.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&xl[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,i=this.text.length-1;i>=0&&i>=t&&xl[this.text.charCodeAt(i)];i--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},_l.prototype.substring=function(t,e){var r=new _l;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},_l.prototype.toString=function(){return this.text},_l.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},_l.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(vl.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,i=0;i<t.text.length;++i)this.sectionIndex.push(r)},_l.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(vl.forImage(e)),this.sectionIndex.push(this.sections.length-1)):w("Reached maximum number of images 6401")}else w("Can't add FormattedSection with an empty image.")},_l.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var xl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},wl={};function Al(t,e,r,i,n,o){if(e.imageName){var a=i[e.imageName];return a?a.displaySize[0]*e.scale*24/o+n:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+n:0}function El(t,e,r,i){var n=Math.pow(t-e,2);return i?t<e?n/2:2*n:n+Math.abs(r)*r}function Tl(t,e,r){var i=0;return 10===t&&(i-=1e4),r&&(i+=150),40!==t&&65288!==t||(i+=50),41!==e&&65289!==e||(i+=50),i}function Sl(t,e,r,i,n,o){for(var a=null,s=El(e,r,n,o),l=0,u=i;l<u.length;l+=1){var c=u[l],h=El(e-c.x,r,n,o)+c.badness;h<=s&&(a=c,s=h)}return{index:t,x:e,priorBreak:a,badness:s}}function Pl(t,e,r,i,n,o,a){if("point"!==o)return[];if(!t)return[];for(var s,l=[],u=function(t,e,r,i,n,o){for(var a=0,s=0;s<t.length();s++){var l=t.getSection(s);a+=Al(t.getCharCode(s),l,i,n,e,o)}return a/Math.max(1,Math.ceil(a/r))}(t,e,r,i,n,a),c=t.text.indexOf("â")>=0,h=0,p=0;p<t.length();p++){var d=t.getSection(p),f=t.getCharCode(p);if(xl[f]||(h+=Al(f,d,i,n,e,a)),p<t.length()-1){var m=!((s=f)<11904||!(Vi["Bopomofo Extended"](s)||Vi.Bopomofo(s)||Vi["CJK Compatibility Forms"](s)||Vi["CJK Compatibility Ideographs"](s)||Vi["CJK Compatibility"](s)||Vi["CJK Radicals Supplement"](s)||Vi["CJK Strokes"](s)||Vi["CJK Symbols and Punctuation"](s)||Vi["CJK Unified Ideographs Extension A"](s)||Vi["CJK Unified Ideographs"](s)||Vi["Enclosed CJK Letters and Months"](s)||Vi["Halfwidth and Fullwidth Forms"](s)||Vi.Hiragana(s)||Vi["Ideographic Description Characters"](s)||Vi["Kangxi Radicals"](s)||Vi["Katakana Phonet
16ic Extensions"](s)||Vi.Katakana(s)||Vi["Vertical Forms"](s)||Vi["Yi Radicals"](s)||Vi["Yi Syllables"](s)));(wl[f]||m||d.imageName)&&l.push(Sl(p+1,h,u,l,Tl(f,t.getCharCode(p+1),m&&c),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(Sl(t.length(),h,u,l,0,!0))}function Il(t){var e=.5,r=.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":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function Ml(t,e,r,i,n){if(i||n)for(var o=t[r],a=(t[r].x+o.metrics.advance*o.scale)*i,s=e;s<=r;s++)t[s].x-=a,t[s].y+=n}function Cl(t,e,r,i,n,o){var a,s=t.image;if(s.content){var l=s.content,u=s.pixelRatio||1;a=[l[0]/u,l[1]/u,s.displaySize[0]-l[2]/u,s.displaySize[1]-l[3]/u]}var c,h,p,d,f=e.left*o,m=e.right*o;"width"===r||"both"===r?(d=n[0]+f-i[3],h=n[0]+m+i[1]):h=(d=n[0]+(f+m-s.displaySize[0])/2)+s.displaySize[0];var g=e.top*o,y=e.bottom*o;return"height"===r||"both"===r?(c=n[1]+g-i[0],p=n[1]+y+i[2]):p=(c=n[1]+(g+y-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:c,right:h,bottom:p,left:d,collisionPadding:a}}wl[10]=!0,wl[32]=!0,wl[38]=!0,wl[40]=!0,wl[41]=!0,wl[43]=!0,wl[45]=!0,wl[47]=!0,wl[173]=!0,wl[183]=!0,wl[8203]=!0,wl[8208]=!0,wl[8211]=!0,wl[8231]=!0;var kl=function(t){function e(e,r,i,n){t.call(this,e,r),this.angle=i,void 0!==n&&(this.segment=n)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(n);function Ll(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new on(t+1))};if("source"===r.kind)return{kind:"source"};for(var i=r.zoomStops,n=r.interpolationType,o=0;o<i.length&&i[o]<=t;)o++;for(var a=o=Math.max(0,o-1);a<i.length&&i[a]<t+1;)a++;a=Math.min(i.length-1,a);var s=i[o],l=i[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:n}:{kind:"camera",minZoom:s,maxZoom:l,minSize:r.evaluate(new on(s)),maxSize:r.evaluate(new on(l)),interpolationType:n}}function zl(t,e,r){var i=e.uSize,n=r.lowerSize;return"source"===t.kind?n/128:"composite"===t.kind?Ve(n/128,r.upperSize/128,e.uSizeT):i}function Rl(t,e){var r=0,i=0;if("constant"===t.kind)i=t.layoutSize;else if("source"!==t.kind){var n=t.interpolationType,o=n?u(ir.interpolationFactor(n,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?i=Ve(t.minSize,t.maxSize,o):r=o}return{uSizeT:r,uSize:i}}Oi("Anchor",kl);var Ol=Object.freeze({__proto__:null,getSizeData:Ll,evaluateSizeForFeature:zl,evaluateSizeForZoom:Rl,SIZE_PACK_FACTOR:128});function Dl(t,e,r,i,n){if(void 0===e.segment)return!0;for(var o=e,a=e.segment+1,s=0;s>-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var l=[],u=0;s<r/2;){var c=t[a],h=t[a+1];if(!h)return!1;var p=t[a-1].angleTo(c)-c.angleTo(h);for(p=Math.abs((p+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:p}),u+=p;s-l[0].distance>i;)u-=l.shift().angleDelta;if(u>n)return!1;a++,s+=c.dist(h)}return!0}function Bl(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function Fl(t,e,r){return t?.6*e*r:0}function jl(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Nl(t,e,r,i,n,o){for(var a=Fl(r,n,o),s=jl(r,i)*o,l=0,u=Bl(t)/2,c=0;c<t.length-1;c++){var h=t[c],p=t[c+1],d=h.dist(p);if(l+d>u){var f=(u-l)/d,m=Ve(h.x,p.x,f),g=Ve(h.y,p.y,f),y=new kl(m,g,p.angleTo(h),c);return y._round(),!a||Dl(t,y,s,a,e)?y:void 0}l+=d}}function Ul(t,e,r,i,n,o,a,s,l){var u=Fl(i,o,a),c=jl(i,n),h=c*a,p=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h<e/4&&(e=h+e/4),function t(e,r,i,n,o,a,s,l,u){for(var c=a/2,h=Bl(e),p=0,d=r-i,f=[],m=0;m<e.length-1;m++){for(var g=e[m],y=e[m+1],v=g.dist(y),_=y.angleTo(g);d+i<p+v;){var b=((d+=i)-p)/v,x=Ve(g.x,y.x,b),w=Ve(g.y,y.y,b);if(x>=0&&x<u&&w>=0&&w<u&&d-c>=0&&d+c<=h){var A=new kl(x,w,_,m);A._round(),n&&!Dl(e,A,a,n,o)||f.push(A)}}p+=v}return l||f.length||s||(f=t(e,p/2,i,n,o,a,s,!0,u)),f}(t,p?e/2*s%e:(c/2+2*o)*a*s%e,e,u,r,h,p,!1,l)}function Vl(t,e,r,i,o){for(var a=[],s=0;s<t.length;s++)for(var l=t[s],u=void 0,c=0;c<l.length-1;c++){var h=l[c],p=l[c+1];h.x<e&&p.x<e||(h.x<e?h=new n(e,h.y+(e-h.x)/(p.x-h.x)*(p.y-h.y))._round():p.x<e&&(p=new n(e,h.y+(e-h.x)/(p.x-h.x)*(p.y-h.y))._round()),h.y<r&&p.y<r||(h.y<r?h=new n(h.x+(r-h.y)/(p.y-h.y)*(p.x-h.x),r)._round():p.y<r&&(p=new n(h.x+(r-h.y)/(p.y-h.y)*(p.x-h.x),r)._round()),h.x>=i&&p.x>=i||(h.x>=i?h=new n(i,h.y+(i-h.x)/(p.x-h.x)*(p.y-h.y))._round():p.x>=i&&(p=new n(i,h.y+(i-h.x)/(p.x-h.x)*(p.y-h.y))._round()),h.y>=o&&p.y>=o||(h.y>=o?h=new n(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round():p.y>=o&&(p=new n(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round()),u&&h.equals(u[u.length-1])||a.push(u=[h]),u.push(p)))))}return a}function ql(t,e,r,i){var o=[],a=t.image,s=a.pixelRatio,l=a.paddedRect.w-2,u=a.paddedRect.h-2,c=t.right-t.left,h=t.bottom-t.top,p=a.stretchX||[[0,l]],d=a.stretchY||[[0,u]],f=function(t,e){return t+e[1]-e[0]},m=p.reduce(f,0),g=d.reduce(f,0),y=l-m,v=u-g,_=0,b=m,x=0,w=g,A=0,E=y,T=0,S=v;if(a.content&&i){var P=a.content;_=Gl(p,0,P[0]),x=Gl(d,0,P[1]),b=Gl(p,P[0],P[2]),w=Gl(d,P[1],P[3]),A=P[0]-_,T=P[1]-x,E=P[2]-P[0]-b,S=P[3]-P[1]-w}var I=function(i,o,l,u){var p=Wl(i.stretch-_,b,c,t.left),d=Hl(i.fixed-A,E,i.stretch,m),f=Wl(o.stretch-x,w,h,t.top),y=Hl(o.fixed-T,S,o.stretch,g),v=Wl(l.stretch-_,b,c,t.left),P=Hl(l.fixed-A,E,l.stretch,m),I=Wl(u.stretch-x,w,h,t.top),M=Hl(u.fixed-T,S,u.stretch,g),C=new n(p,f),k=new n(v,f),L=new n(v,I),z=new n(p,I),R=new n(d/s,y/s),O
vendor: 221,751 bytes, line 16
16=new n(P/s,M/s),D=e*Math.PI/180;if(D){var B=Math.sin(D),F=Math.cos(D),j=[F,-B,B,F];C._matMult(j),k._matMult(j),z._matMult(j),L._matMult(j)}var N=i.stretch+i.fixed,U=o.stretch+o.fixed;return{tl:C,tr:k,bl:z,br:L,tex:{x:a.paddedRect.x+1+N,y:a.paddedRect.y+1+U,w:l.stretch+l.fixed-N,h:u.stretch+u.fixed-U},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:O,minFontScaleX:E/s/c,minFontScaleY:S/s/h,isSDF:r}};if(i&&(a.stretchX||a.stretchY))for(var M=Zl(p,y,m),C=Zl(d,v,g),k=0;k<M.length-1;k++)for(var L=M[k],z=M[k+1],R=0;R<C.length-1;R++)o.push(I(L,C[R],z,C[R+1]));else o.push(I({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:u+1}));return o}function Gl(t,e,r){for(var i=0,n=0,o=t;n<o.length;n+=1){var a=o[n];i+=Math.max(e,Math.min(r,a[1]))-Math.max(e,Math.min(r,a[0]))}return i}function Zl(t,e,r){for(var i=[{fixed:-1,stretch:0}],n=0,o=t;n<o.length;n+=1){var a=o[n],s=a[0],l=a[1],u=i[i.length-1];i.push({fixed:s-u.stretch,stretch:u.stretch}),i.push({fixed:s-u.stretch,stretch:u.stretch+(l-s)})}return i.push({fixed:e+1,stretch:r}),i}function Wl(t,e,r,i){return t/e*r+i}function Hl(t,e,r,i){return t-e*r/i}var Xl=function(t,e,r,i,o,a,s,l,u,c){if(this.boxStartIndex=t.length,u){var h=a.top,p=a.bottom,d=a.collisionPadding;d&&(h-=d[1],p+=d[3]);var f=p-h;f>0&&(f=Math.max(10,f),this.circleDiameter=f)}else{var m=a.top*s-l,g=a.bottom*s+l,y=a.left*s-l,v=a.right*s+l,_=a.collisionPadding;if(_&&(y-=_[0]*s,m-=_[1]*s,v+=_[2]*s,g+=_[3]*s),c){var b=new n(y,m),x=new n(v,m),w=new n(y,g),A=new n(v,g),E=c*Math.PI/180;b._rotate(E),x._rotate(E),w._rotate(E),A._rotate(E),y=Math.min(b.x,x.x,w.x,A.x),v=Math.max(b.x,x.x,w.x,A.x),m=Math.min(b.y,x.y,w.y,A.y),g=Math.max(b.y,x.y,w.y,A.y)}t.emplaceBack(e.x,e.y,y,m,v,g,r,i,o)}this.boxEndIndex=t.length},Yl=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Kl),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Kl(t,e){return t<e?-1:t>e?1:0}function Jl(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var i=1/0,o=1/0,a=-1/0,s=-1/0,l=t[0],u=0;u<l.length;u++){var c=l[u];(!u||c.x<i)&&(i=c.x),(!u||c.y<o)&&(o=c.y),(!u||c.x>a)&&(a=c.x),(!u||c.y>s)&&(s=c.y)}var h=Math.min(a-i,s-o),p=h/2,d=new Yl([],Ql);if(0===h)return new n(i,o);for(var f=i;f<a;f+=h)for(var m=o;m<s;m+=h)d.push(new $l(f+p,m+p,p,t));for(var g=function(t){for(var e=0,r=0,i=0,n=t[0],o=0,a=n.length,s=a-1;o<a;s=o++){var l=n[o],u=n[s],c=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*c,i+=(l.y+u.y)*c,e+=3*c}return new $l(r/e,i/e,0,t)}(t),y=d.length;d.length;){var v=d.pop();(v.d>g.d||!g.d)&&(g=v,r&&console.log("found best %d after %d probes",Math.round(1e4*v.d)/1e4,y)),v.max-g.d<=e||(d.push(new $l(v.p.x-(p=v.h/2),v.p.y-p,p,t)),d.push(new $l(v.p.x+p,v.p.y-p,p,t)),d.push(new $l(v.p.x-p,v.p.y+p,p,t)),d.push(new $l(v.p.x+p,v.p.y+p,p,t)),y+=4)}return r&&(console.log("num probes: "+y),console.log("best distance: "+g.d)),g.p}function Ql(t,e){return e.max-t.max}function $l(t,e,r,i){this.p=new n(t,e),this.h=r,this.d=function(t,e){for(var r=!1,i=1/0,n=0;n<e.length;n++)for(var o=e[n],a=0,s=o.length,l=s-1;a<s;l=a++){var u=o[a],c=o[l];u.y>t.y!=c.y>t.y&&t.x<(c.x-u.x)*(t.y-u.y)/(c.y-u.y)+u.x&&(r=!r),i=Math.min(i,Xo(t,u,c))}return(r?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}Yl.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Yl.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},Yl.prototype.peek=function(){return this.data[0]},Yl.prototype._up=function(t){for(var e=this.data,r=this.compare,i=e[t];t>0;){var n=t-1>>1,o=e[n];if(r(i,o)>=0)break;e[t]=o,t=n}e[t]=i},Yl.prototype._down=function(t){for(var e=this.data,r=this.compare,i=this.length>>1,n=e[t];t<i;){var o=1+(t<<1),a=e[o],s=o+1;if(s<this.length&&r(e[s],a)<0&&(o=s,a=e[s]),r(a,n)>=0)break;e[t]=a,t=o}e[t]=n};var tu=Number.POSITIVE_INFINITY;function eu(t,e){return e[1]!==tu?function(t,e,r){var i=0,n=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":n=r-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-r}switch(t){case"top-right":case"bottom-right":case"right":i=-e;break;case"top-left":case"bottom-left":case"left":i=e}return[i,n]}(t,e[0],e[1]):function(t,e){var r=0,i=0;e<0&&(e=0);var n=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":i=n-7;break;case"bottom-right":case"bottom-left":i=7-n;break;case"bottom":i=7-e;break;case"top":i=e-7}switch(t){case"top-right":case"bottom-right":r=-n;break;case"top-left":case"bottom-left":r=n;break;case"left":r=e;break;case"right":r=-e}return[r,i]}(t,e[0])}function ru(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 iu(t,e,r,i,o,a,s,l,u,c,h,p,d,f,m){var g=function(t,e,r,i,o,a,s,l){for(var u=i.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,c=[],h=0,p=e.positionedLines;h<p.length;h+=1)for(var d=p[h],f=0,m=d.positionedGlyphs;f<m.length;f+=1){var g=m[f];if(g.rect){var y=g.rect||{},v=4,_=!0,b=1,x=0,w=(o||l)&&g.vertical,A=g.metrics.advance*g.scale/2;if(l&&e.verticalizable&&(x=d.lineOffset/2-(g.imageName?-(24-g.metrics.width*g.scale)/2:24*(g.scale-1))),g.imageName){var E=s[g.imageName];_=E.sdf,v=1/(b=E.pixelRatio)}var T=o?[g.x+A,g.y]:[0,0],S=o?[0,0]:[g.x+A+r[0],g.y+r[1]-x],P=[0,0];w&&(P=S,S=[0,0]);var I=(g.metrics.left-v)*g.scale-A+S[0],M=(-g.metrics.top-v)*g.scale+S[1],C=I+y.w*g.scale/b,k=M+y.h*g.scale/b,L=new n(I,M),z=new n(C,M),R=new n(I,k),O=new n(C,k);if(w){var D=new n(-A,A- -17),B=-Math.PI/2,F=12-A,j=new n(22-F,-(g.imageName?F:0)),N=new(Function.prototype.bind.apply(n,[null].concat(P)));L._rotateAround(B,D)._add(j)._add(N),z._rotateAround(B,D)._add(j)._add(N),R._rotateAround(B,D)._add(j)._add(N),O._rotateAround(B,D)._add(j)._add(N)}if(u){var U=Math.sin(u),V=Math.cos(u),q=[V,-U,U,V];L._matMult(q),z._matMult(q),R._matMult(q),O._matMult(q)}var G=new n(0,0),Z=new n(0,0);c.push({tl:L,tr:z,bl:R,br:O,tex:y,writingMode:e.writingMode,glyphOffset:T,sectionIndex:g.sectionIndex,isSDF:_,pixelOffsetTL:G,pixelOffsetBR:Z,minFontScaleX:0,minFontScaleY:0})}}return c}(0,r,l,o,a,s,i,t.allowVerticalPlacement),y=t.textSizeData,v=null;"source"===y.kind?(v=[128*o.layout.get("text-size").evaluate(s,{})])[0]>32640&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===y.kind&&((v=[128*f.compositeTextSizes[0].evaluate(s,{},m),128*f.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||v[1]>32640)&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,g,v,l,a,s,c,e,u.lineStartIndex,u.lineLength,d,m);for(var _=0,b=h;_<b.length;_+=1)p[b[_]]=t.text.placedSymbolArray.length-1;return 4*g.length}function nu(t){for(var e in t)return t[e];return null}function ou(t,e,r,i){var n=t.compareText;if(e in n){for(var o=n[e],a=o.length-1;a>=0;a--)if(i.dist(o[a])<r)return!0}else n[e]=[];return n[e].push(i),!1}var au=ys.VectorTileFeature.types,su=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function lu(t,e,r,i,n,o,a,s,l,u,c,h,p){var d=s?Math.min(32640,Math.round(s[0])):0,f=s?Math.min(32640,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(32*i),Math.round(32*n),o,a,(d<<1)+(l?1:0),f,16*u,16*c,256*h,256*p)}function uu(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function cu(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(Xi(r[e].text))return!0;return!1}var hu=function(t){this.layoutVertexArray=new kn,this.indexArray=new Fn,this.programConfigurations=t,this.segments=new oo,this.dynamicLayoutVertexArray=new Ln,this.opacityVertexArray=new zn,this.placedSymbolArray=new Jn};hu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},hu.prototype.upload=function(t,e,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Bs.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Fs.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,su,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(t))},hu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Oi("SymbolBuffers",hu);var pu=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new oo,this.collisionVertexArray=new Bn};pu.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,js.members,!0)},pu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Oi("CollisionBuffers",pu);var du=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=na([]),this.placementViewportMatrix=na([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Ll(this.zoom,e["text-size"]),this.iconSizeData=Ll(this.zoom,e["icon-size"]);var r=this.layers[0].layout,i=r.get("symbol-sort-key"),n=r.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==n&&void 0!==i.constantOr(1),this.sortFeaturesByY=("viewport-y"===n||"auto"===n&&!this.sortFeaturesByKey)&&(r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")),"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return yl[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};du.prototype.createArrays=function(){this.text=new hu(new zo(this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new hu(new zo(this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new to,this.lineVertexArray=new eo,this.symbolInstances=new $n},du.prototype.calculateGlyphDependencies=function(t,e,r,i,n){for(var o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(r||i)&&n){var a=qs[t.charAt(o)];a&&(e[a.charCodeAt(0)]=!0)}},du.prototype.populate=function(t,e,r){var i=this.layers[0],n=i.layout,o=n.get("text-font"),a=n.get("text-field"),s=n.get("icon-image"),l=("constant"!==a.value.kind||a.value.value instanceof ee&&!a.value.value.isEmpty()||a.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),u="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=n.get("symbol-sort-key");if(this.features=[],l||u){for(var h=e.iconDependencies,p=e.glyphDependencies,d=e.availableImages,f=new on(this.zoom),m=0,g=t;m<g.length;m+=1){var y=g[m],v=y.feature,_=y.id,b=y.index,x=y.sourceLayerIndex,w=i._featureFilter.needGeometry,A={type:v.type,id:_,properties:v.properties,geometry:w?Fo(v):[]};if(i._featureFilter.filter(f,A,r)){w||(A.geometry=Fo(v));var E=void 0;if(l){var T=i.getValueAndResolveTokens("text-field",A,r,d),S=ee.factory(T);cu(S)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===en()||this.hasRTLText&&nn.isParsed())&&(E=Vs(S,i,A))}var P=void 0;if(u){var I=i.getValueAndResolveTokens("icon-image",A,r,d);P=I instanceof re?I:re.fromString(I)}if(E||P){var M=this.sortFeaturesByKey?c.evaluate(A,{},r):void 0,C={id:_,text:E,icon:P,index:b,sourceLayerIndex:x,geometry:Fo(v),properties:v.properties,type:au[v.type],sortKey:M};if(this.features.push(C),P&&(h[P.name]=!0),E){var k=o.evaluate(A,{},r).join(","),L="map"===n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(yl.vertical)>=0;for(var z=0,R=E.sections;z<R.length;z+=1){var O=R[z];if(O.image)h[O.image.name]=!0;else{var D=qi(E.toString()),B=O.fontStack||k,F=p[B]=p[B]||{};this.calculateGlyphDependencies(O.text,F,L,this.allowVerticalPlacement,D)}}}}}}"line"===n.get("symbol-placement")&&(this.features=function(t){var e={},r={},i=[],n=0;function o(e){i.push(t[e]),n++}function a(t,e,n){var o=r[t];return delete r[t],r[e]=o,i[o].geometry[0].pop(),i[o].geometry[0]=i[o].geometry[0].concat(n[0]),o}function s(t,r,n){var o=e[r];return delete e[r],e[t]=o,i[o].geometry[0].shift(),i[o].geometry[0]=n[0].concat(i[o].geometry[0]),o}function l(t,e,r){var i=r?e[0][e[0].length-1]:e[0][0];return t+":"+i.x+":"+i.y}for(var u=0;u<t.length;u++){var c=t[u],h=c.geometry,p=c.text?c.text.toString():null;if(p){var d=l(p,h),f=l(p,h,!0);if(d in r&&f in e&&r[d]!==e[f]){var m=s(d,f,h),g=a(d,f,i[m].geometry);delete e[d],delete r[f],r[l(p,i[g].geometry,!0)]=g,i[m].geometry=null}else d in r?a(d,f,h):f in e?s(d,f,h):(o(u),e[d]=n-1,r[f]=n-1)}else o(u)}return i.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},du.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},du.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},du.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},du.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},du.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},du.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},du.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),o={},a=t.segment+1;a<e.length;a++)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:i},a<e.length-1&&(i+=e[a+1].dist(e[a]));for(var s=t.segment||0;s>=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=e[s-1].dist(e[s]));for(var l=0;l<e.length;l++){var u=o[l];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},du.prototype.addSymbols=function(t,e,r,i,n,o,a,s,l,u,c,h){for(var p=t.indexArray,d=t.layoutVertexArray,f=t.segments.prepareSegment(4*e.length,d,p,o.sortKey),m=this.glyphOffsetArray.length,g=f.vertexLength,y=this.allowVerticalPlacement&&a===yl.vertical?Math.PI/2:0,v=o.text&&o.text.sections,_=0;_<e.length;_++){var b=e[_],x=b.tl,w=b.tr,A=b.bl,E=b.br,T=b.tex,S=b.pixelOffsetTL,P=b.pixelOffsetBR,I=b.minFontScaleX,M=b.minFontScaleY,C=b.glyphOffset,k=b.isSDF,L=b.sectionIndex,z=f.vertexLength,R=C[1];lu(d,s.x,s.y,x.x,R+x.y,T.x,T.y,r,k,S.x,S.y,I,M),lu(d,s.x,s.y,w.x,R+w.y,T.x+T.w,T.y,r,k,P.x,S.y,I,M),lu(d,s.x,s.y,A.x,R+A.y,T.x,T.y+T.h,r,k,S.x,P.y,I,M),lu(d,s.x,s.y,E.x,R+E.y,T.x+T.w,T.y+T.h,r,k,P.x,P.y,I,M),uu(t.dynamicLayoutVertexArray,s,y),p.emplaceBack(z,z+1,z+2),p.emplaceBack(z+1,z+2,z+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(C[0]),_!==e.length-1&&L===e[_+1].sectionIndex||t.programConfigurations.populatePaintArrays(d.length,o,o.index,{},h,v&&v[L])}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,g,l,u,s.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],a,0,!1,0,c)},du.prototype._addCollisionDebugVertex=function(t,e,r,i,n,o){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,i,n,Math.round(o.x),Math.round(o.y))},du.prototype.addCollisionDebugVertices=function(t,e,r,i,o,a,s){var l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),u=l.vertexLength,c=o.layoutVertexArray,h=o.collisionVertexArray,p=s.anchorX,d=s.anchorY;this._addCollisionDebugVertex(c,h,a,p,d,new n(t,e)),this._addCollisionDebugVertex(c,h,a,p,d,new n(r,e)),this._addCollisionDebugVertex(c,h,a,p,d,new n(r,i)),this._addCollisionDebugVertex(c,h,a,p,d,new n(t,i)),l.vertexLength+=4;var f=o.indexArray;f.emplaceBack(u,u+1),f.emplaceBack(u+1,u+2),f.emplaceBack(u+2,u+3),f.emplaceBack(u+3,u),l.primitiveLength+=4},du.prototype.addDebugCollisionBoxes=function(t,e,r,i){for(var n=t;n<e;n++){var o=this.collisionBoxArray.get(n);this.addCollisionDebugVertices(o.x1,o.y1,o.x2,o.y2,i?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,r)}},du.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new pu(On,Ns.members,Gn),this.iconCollisionBox=new pu(On,Ns.members,Gn);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},du.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,i,n,o,a,s,l){for(var u={},c=e;c<r;c++){var h=t.get(c);u.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.textFeatureIndex=h.featureIndex;break}for(var p=i;p<n;p++){var d=t.get(p);u.verticalTextBox={x1:d.x1,y1:d.y1,x2:d.x2,y2:d.y2,anchorPointX:d.anchorPointX,anchorPointY:d.anchorPointY},u.verticalTextFeatureIndex=d.featureIndex;break}for(var f=o;f<a;f++){var m=t.get(f);u.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},u.iconFeatureIndex=m.featureIndex;break}for(var g=s;g<l;g++){var y=t.get(g);u.verticalIconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},u.verticalIconFeatureIndex=y.featureIndex;break}return u},du.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},du.prototype.hasTextData=function(){return this.text.segments.get().length>0},du.prototype.hasIconData=function(){return this.icon.segments.get().length>0},du.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},du.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},du.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},du.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+4*r.numGlyphs,n=r.vertexStartIndex;n<i;n+=4)t.indexArray.emplaceBack(n,n+1,n+2),t.indexArray.emplaceBack(n+1,n+2,n+3)},du.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),i=[],n=[],o=[],a=0;a<this.symbolInstances.length;++a){o.push(a);var s=this.symbolInstances.get(a);i.push(0|Math.round(e*s.anchorX+r*s.anchorY)),n.push(s.featureIndex)}return o.sort((function(t,e){return i[t]-i[e]||n[e]-n[t]})),o},du.prototype.addToSortKeyRanges=function(t,e){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},du.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,i=this.symbolInstanceIndexes;r<i.length;r+=1){var n=this.symbolInstances.get(i[r]);this.featureSortOrder.push(n.featureIndex),[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((function(t,r,i){t>=0&&i.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),n.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,n.verticalPlacedTextSymbolIndex),n.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.placedIconSymbolIndex),n.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Oi("SymbolBucket",du,{omit:["layers","collisionBoxArray","features","compareText"]}),du.MAX_GLYPHS=65535,du.addDynamicAttributes=uu;var fu=new _n({"symbol-placement":new fn(Pt.layout_symbol["symbol-placement"]),"symbol-spacing":new fn(Pt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new fn(Pt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new mn(Pt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new fn(Pt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new fn(Pt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new fn(Pt.layout_symbol["icon-ignore-placement"]),"icon-optional":new fn(Pt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new fn(Pt.layout_symbol["icon-rotation-alignment"]),"icon-size":new mn(Pt.layout_symbol["icon-size"]),"icon-text-fit":new fn(Pt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new fn(Pt.layout_symbol["icon-text-fit-padding"]),"icon-image":new mn(Pt.layout_symbol["icon-image"]),"icon-rotate":new mn(Pt.layout_symbol["icon-rotate"]),"icon-padding":new fn(Pt.layout_symbol["icon-padding"]),"icon-keep-upright":new fn(Pt.layout_symbol["icon-keep-upright"]),"icon-offset":new mn(Pt.layout_symbol["icon-offset"]),"icon-anchor":new mn(Pt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new fn(Pt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new fn(Pt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new fn(Pt.layout_symbol["text-rotation-alignment"]),"text-field":new mn(Pt.layout_symbol["text-field"]),"text-font":new mn(Pt.layout_symbol["text-font"]),"text-size":new mn(Pt.layout_symbol["text-size"]),"text-max-width":new mn(Pt.layout_symbol["text-max-width"]),"text-line-height":new fn(Pt.layout_symbol["text-line-height"]),"text-letter-spacing":new mn(Pt.layout_symbol["text-letter-spacing"]),"text-justify":new mn(Pt.layout_symbol["text-justify"]),"text-radial-offset":new mn(Pt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new fn(Pt.layout_symbol["text-variable-anchor"]),"text-anchor":new mn(Pt.layout_symbol["text-anchor"]),"text-max-angle":new fn(Pt.layout_symbol["text-max-angle"]),"text-writing-mode":new fn(Pt.layout_symbol["text-writing-mode"]),"text-rotate":new mn(Pt.layout_symbol["text-rotate"]),"text-padding":new fn(Pt.layout_symbol["text-padding"]),"text-keep-upright":new fn(Pt.layout_symbol["text-keep-upright"]),"text-transform":new mn(Pt.layout_symbol["text-transform"]),"text-offset":new mn(Pt.layout_symbol["text-offset"]),"text-allow-overlap":new fn(Pt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new fn(Pt.layout_symbol["text-ignore-placement"]),"text-optional":new fn(Pt.layout_symbol["text-optional"])}),mu={paint:new _n({"icon-opacity":new mn(Pt.paint_symbol["icon-opacity"]),"icon-color":new mn(Pt.paint_symbol["icon-color"]),"icon-halo-color":new mn(Pt.paint_symbol["icon-halo-color"]),"icon-halo-width":new mn(Pt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new mn(Pt.paint_symbol["icon-halo-blur"]),"icon-translate":new fn(Pt.paint_symbol["icon-translate"]),"icon-translate-anchor":new fn(Pt.paint_symbol["icon-translate-anchor"]),"text-opacity":new mn(Pt.paint_symbol["text-opacity"]),"text-color":new mn(Pt.paint_symbol["text-color"],{runtimeType:jt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new mn(Pt.paint_symbol["text-halo-color"]),"text-halo-width":new mn(Pt.paint_symbol["text-halo-width"]),"text-halo-blur":new mn(Pt.paint_symbol["text-halo-blur"]),"text-translate":new fn(Pt.paint_symbol["text-translate"]),"text-translate-anchor":new fn(Pt.paint_symbol["text-translate-anchor"])}),layout:fu},gu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ot,this.defaultValue=t};gu.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},gu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},gu.prototype.outputDefined=function(){return!1},gu.prototype.serialize=function(){return null},Oi("FormatSectionOverride",gu,{omit:["defaultValue"]});var yu=function(t){function e(e){t.call(this,e,mu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"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")),"point"===this.layout.get("symbol-placement")){var i=this.layout.get("text-writing-mode");if(i){for(var n=[],o=0,a=i;o<a.length;o+=1){var s=a[o];n.indexOf(s)<0&&n.push(s)}this.layout._values["text-writing-mode"]=n}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e,r,i){var n=this.layout.get(t).evaluate(e,{},r,i),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||qr(o.value)||!n?n:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,r){return r in t?String(t[r]):""}))}(e.properties,n)},e.prototype.createBucket=function(t){return new du(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=mu.paint.overridableProperties;t<r.length;t+=1){var i=r[t];if(e.hasPaintOverride(this.layout,i)){var n,o=this.paint.get(i),a=new gu(o),s=new Vr(a,o.property.specification);n="constant"===o.value.kind||"source"===o.value.kind?new Zr("source",s):new Wr("composite",s,o.value.zoomStops,o.value._interpolationType),this.paint._values[i]=new pn(o.property,n,o.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,i){return!(!this.layout||r.isDataDriven()||i.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),i=mu.paint.properties[e],n=!1,o=function(t){for(var e=0,r=t;e<r.length;e+=1)if(i.overrides&&i.overrides.hasOverride(r[e]))return void(n=!0)};if("constant"===r.value.kind&&r.value.value instanceof ee)o(r.value.value.sections);else if("source"===r.value.kind){var a=function(t){n||(t instanceof se&&oe(t.value)===qt?o(t.value.sections):t instanceof he?o(t.sections):t.eachChild(a))},s=r.value;s._styleExpression&&a(s._styleExpression.expression)}return n},e}(bn),vu={paint:new _n({"background-color":new fn(Pt.paint_background["background-color"]),"background-pattern":new yn(Pt.paint_background["background-pattern"]),"background-opacity":new fn(Pt.paint_background["background-opacity"])})},_u=function(t){function e(e){t.call(this,e,vu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(bn),bu={paint:new _n({"raster-opacity":new fn(Pt.paint_raster["raster-opacity"]),"raster-hue-rotate":new fn(Pt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new fn(Pt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new fn(Pt.paint_raster["raster-brightness-max"]),"raster-saturation":new fn(Pt.paint_raster["raster-saturation"]),"raster-contrast":new fn(Pt.paint_raster["raster-contrast"]),"raster-resampling":new fn(Pt.paint_raster["raster-resampling"]),"raster-fade-duration":new fn(Pt.paint_raster["raster-fade-duration"])})},xu=function(t){function e(e){t.call(this,e,bu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(bn),wu=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(bn),Au={circle:ua,heatmap:_a,hillshade:xa,fill:ss,"fill-extrusion":Es,line:Os,symbol:yu,background:_u,raster:xu},Eu=a.HTMLImageElement,Tu=a.HTMLCanvasElement,Su=a.HTMLVideoElement,Pu=a.ImageData,Iu=a.ImageBitmap,Mu=function(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,i)};Mu.prototype.update=function(t,e,r){var i=t.width,n=t.height,o=!(this.size&&this.size[0]===i&&this.size[1]===n||r),a=this.context,s=a.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),o)this.size=[i,n],t instanceof Eu||t instanceof Tu||t instanceof Su||t instanceof Pu||Iu&&t instanceof Iu?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,i,n,0,this.format,s.UNSIGNED_BYTE,t.data);else{var l=r||{x:0,y:0},u=l.x,c=l.y;t instanceof Eu||t instanceof Tu||t instanceof Su||t instanceof Pu||Iu&&t instanceof Iu?s.texSubImage2D(s.TEXTURE_2D,0,u,c,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,u,c,i,n,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},Mu.prototype.bind=function(t,e,r){var i=this.context.gl;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),t!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrap=e)},Mu.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Mu.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Cu=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};Cu.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},Cu.prototype.remove=function(){delete this._channel,this._callback=function(){}};var ku=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},g(["receive","process"],this),this.invoker=new Cu(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=T()?t:a};function Lu(t,e,r){var i=2*Math.PI*6378137/256/Math.pow(2,r);return[t*i-2*Math.PI*6378137/2,e*i-2*Math.PI*6378137/2]}ku.prototype.send=function(t,e,r,i,n){var o=this;void 0===n&&(n=!1);var a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[a]=r);var s=I(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:i,mustQueue:n,sourceMapId:this.mapId,data:ji(e,s)},s),{cancel:function(){r&&delete o.callbacks[a],o.target.postMessage({id:a,type:"<cancel>",targetMapId:i,sourceMapId:o.mapId})}}},ku.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];var i=this.cancelCallbacks[r];delete this.cancelCallbacks[r],i&&i()}else T()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},ku.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},ku.prototype.processTask=function(t,e){var r=this;if("<response>"===e.type){var i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(Ni(e.error)):i(null,Ni(e.data)))}else{var n=!1,o=I(this.globalScope)?void 0:[],a=e.hasCallback?function(e,i){n=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"<response>",sourceMapId:r.mapId,error:e?ji(e):null,data:ji(i,o)},o)}:function(t){n=!0},s=null,l=Ni(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,a);else if(this.parent.getWorkerSource){var u=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,u[0],l.source)[u[1]](l,a)}else a(new Error("Could not find function "+e.type));!n&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},ku.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var zu=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};zu.prototype.setNorthEast=function(t){return this._ne=t instanceof Ru?new Ru(t.lng,t.lat):Ru.convert(t),this},zu.prototype.setSouthWest=function(t){return this._sw=t instanceof Ru?new Ru(t.lng,t.lat):Ru.convert(t),this},zu.prototype.extend=function(t){var e,r,i=this._sw,n=this._ne;if(t instanceof Ru)e=t,r=t;else{if(!(t instanceof zu))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(zu.convert(t)):this.extend(Ru.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return i||n?(i.lng=Math.min(e.lng,i.lng),i.lat=Math.min(e.lat,i.lat),n.lng=Math.max(r.lng,n.lng),n.lat=Math.max(r.lat,n.lat)):(this._sw=new Ru(e.lng,e.lat),this._ne=new Ru(r.lng,r.lat)),this},zu.prototype.getCenter=function(){return new Ru((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},zu.prototype.getSouthWest=function(){return this._sw},zu.prototype.getNorthEast=function(){return this._ne},zu.prototype.getNorthWest=function(){return new Ru(this.getWest(),this.getNorth())},zu.prototype.getSouthEast=function(){return new Ru(this.getEast(),this.getSouth())},zu.prototype.getWest=function(){return this._sw.lng},zu.prototype.getSouth=function(){return this._sw.lat},zu.prototype.getEast=function(){return this._ne.lng},zu.prototype.getNorth=function(){return this._ne.lat},zu.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},zu.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},zu.prototype.isEmpty=function(){return!(this._sw&&this._ne)},zu.prototype.contains=function(t){var e=Ru.convert(t),r=e.lng,i=e.lat,n=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&n},zu.convert=function(t){return!t||t instanceof zu?t:new zu(t)};var Ru=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Ru.prototype.wrap=function(){return new Ru(c(this.lng,-180,180),this.lat)},Ru.prototype.toArray=function(){return[this.lng,this.lat]},Ru.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Ru.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,i=t.lat*e,n=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(n,1))},Ru.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new zu(new Ru(this.lng-r,this.lat-e),new Ru(this.lng+r,this.lat+e))},Ru.convert=function(t){if(t instanceof Ru)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Ru(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Ru(Number("lng"in t?t.lng:t.lon),Number(t.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 Ou=2*Math.PI*6371008.8;function Du(t){return Ou*Math.cos(t*Math.PI/180)}function Bu(t){return(180+t)/360}function Fu(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function ju(t,e){return t/Du(e)}function Nu(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Uu=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Uu.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Ru.convert(t);return new Uu(Bu(r.lng),Fu(r.lat),ju(e,r.lat))},Uu.prototype.toLngLat=function(){return new Ru(360*this.x-180,Nu(this.y))},Uu.prototype.toAltitude=function(){return this.z*Du(Nu(this.y))},Uu.prototype.meterInMercatorCoordinateUnits=function(){return 1/Ou*(t=Nu(this.y),1/Math.cos(t*Math.PI/180));var t};var Vu=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Zu(0,t,t,e,r)};Vu.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Vu.prototype.url=function(t,e){var r,i,n,o,a,s=(i=this.y,n=this.z,o=Lu(256*(r=this.x),256*(i=Math.pow(2,n)-i-1),n),a=Lu(256*(r+1),256*(i+1),n),o[0]+","+o[1]+","+a[0]+","+a[1]),l=function(t,e,r){for(var i,n="",o=t;o>0;o--)n+=(e&(i=1<<o-1)?1:0)+(r&i?2:0);return n}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",l).replace("{bbox-epsg-3857}",s)},Vu.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new n(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},Vu.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var qu=function(t,e){this.wrap=t,this.canonical=e,this.key=Zu(t,e.z,e.z,e.x,e.y)},Gu=function(t,e,r,i,n){this.overscaledZ=t,this.wrap=e,this.canonical=new Vu(r,+i,+n),this.key=Zu(e,t,r,i,n)};function Zu(t,e,r,i,n){(t*=2)<0&&(t=-1*t-1);var o=1<<r;return(o*o*t+o*n+i).toString(36)+r.toString(36)+e.toString(36)}Gu.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Gu.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Gu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Gu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Gu.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Zu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Zu(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Gu.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Gu.prototype.children=function(t){if(this.overscaledZ>=t)return[new Gu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,i=2*this.canonical.y;return[new Gu(e,this.wrap,e,r,i),new Gu(e,this.wrap,e,r+1,i),new Gu(e,this.wrap,e,r,i+1),new Gu(e,this.wrap,e,r+1,i+1)]},Gu.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Gu.prototype.wrapped=function(){return new Gu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Gu.prototype.unwrapTo=function(t){return new Gu(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Gu.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Gu.prototype.toUnwrapped=function(){return new qu(this.wrap,this.canonical)},Gu.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Gu.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Uu(t.x-this.wrap,t.y))},Oi("CanonicalTileID",Vu),Oi("OverscaledTileID",Gu,{omit:["posMatrix"]});var Wu=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return w('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var i=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var n=0;n<i;n++)this.data[this._idx(-1,n)]=this.data[this._idx(0,n)],this.data[this._idx(i,n)]=this.data[this._idx(i-1,n)],this.data[this._idx(n,-1)]=this.data[this._idx(n,0)],this.data[this._idx(n,i)]=this.data[this._idx(n,i-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(i,-1)]=this.data[this._idx(i-1,0)],this.data[this._idx(-1,i)]=this.data[this._idx(0,i-1)],this.data[this._idx(i,i)]=this.data[this._idx(i-1,i-1)]};Wu.prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer),i=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[i],r[i+1],r[i+2])},Wu.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Wu.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Wu.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Wu.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Wu.prototype.getPixels=function(){return new ga({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Wu.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var i=e*this.dim,n=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:i=n-1;break;case 1:n=i+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,l=-r*this.dim,u=o;u<a;u++)for(var c=i;c<n;c++)this.data[this._idx(c,u)]=t.data[this._idx(c+s,u+l)]},Oi("DEMData",Wu);var Hu=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}};Hu.prototype.encode=function(t){return this._stringToNumber[t]},Hu.prototype.decode=function(t){return this._numberToString[t]};var Xu=function(t,e,r,i,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=i,this.properties=t.properties,this.id=n},Yu={geometry:{configurable:!0}};Yu.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Yu.geometry.set=function(t){this._geometry=t},Xu.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Xu.prototype,Yu);var Ku=function(){this.state={},this.stateChanges={},this.deletedStates={}};Ku.prototype.updateState=function(t,e,r){var i=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][i]=this.stateChanges[t][i]||{},h(this.stateChanges[t][i],r),null===this.deletedStates[t])for(var n in this.deletedStates[t]={},this.state[t])n!==i&&(this.deletedStates[t][n]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][i])for(var o in this.deletedStates[t][i]={},this.state[t][i])r[o]||(this.deletedStates[t][i][o]=null);else for(var a in r)this.deletedStates[t]&&this.deletedStates[t][i]&&null===this.deletedStates[t][i][a]&&delete this.deletedStates[t][i][a]},Ku.prototype.removeFeatureState=function(t,e,r){if(null!==this.deletedStates[t]){var i=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][i]&&(this.deletedStates[t][i]=this.deletedStates[t][i]||{},this.deletedStates[t][i][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][i])for(r in this.deletedStates[t][i]={},this.stateChanges[t][i])this.deletedStates[t][i][r]=null;else this.deletedStates[t][i]=null;else this.deletedStates[t]=null}},Ku.prototype.getState=function(t,e){var r=String(e),i=h({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var n=this.deletedStates[t][e];if(null===n)return{};for(var o in n)delete i[o]}return i},Ku.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},Ku.prototype.coalesceChanges=function(t,e){var r={};for(var i in this.stateChanges){this.state[i]=this.state[i]||{};var n={};for(var o in this.stateChanges[i])this.state[i][o]||(this.state[i][o]={}),h(this.state[i][o],this.stateChanges[i][o]),n[o]=this.state[i][o];r[i]=n}for(var a in this.deletedStates){this.state[a]=this.state[a]||{};var s={};if(null===this.deletedStates[a])for(var l in this.state[a])s[l]={},this.state[a][l]={};else for(var u in this.deletedStates[a]){if(null===this.deletedStates[a][u])this.state[a][u]={};else for(var c=0,p=Object.keys(this.deletedStates[a][u]);c<p.length;c+=1)delete this.state[a][u][p[c]];s[u]=this.state[a][u]}r[a]=r[a]||{},h(r[a],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var d in t)t[d].setFeatureState(r,e)};var Ju=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Ci(8192,16,0),this.grid3D=new Ci(8192,16,0),this.featureIndexArray=new io,this.promoteId=e};function Qu(t,e,r,i,n){return v(t,(function(t,o){var a=e instanceof dn?e.get(o):null;return a&&a.evaluate?a.evaluate(r,i,n):a}))}function $u(t){for(var e=1/0,r=1/0,i=-1/0,n=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),r=Math.min(r,s.y),i=Math.max(i,s.x),n=Math.max(n,s.y)}return{minX:e,minY:r,maxX:i,maxY:n}}function tc(t,e){return e-t}Ju.prototype.insert=function(t,e,r,i,n,o){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);for(var s=o?this.grid3D:this.grid,l=0;l<e.length;l++){for(var u=e[l],c=[1/0,1/0,-1/0,-1/0],h=0;h<u.length;h++){var p=u[h];c[0]=Math.min(c[0],p.x),c[1]=Math.min(c[1],p.y),c[2]=Math.max(c[2],p.x),c[3]=Math.max(c[3],p.y)}c[0]<8192&&c[1]<8192&&c[2]>=0&&c[3]>=0&&s.insert(a,c[0],c[1],c[2],c[3])}},Ju.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ys.VectorTile(new Ws(this.rawTileData)).layers,this.sourceLayerCoder=new Hu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Ju.prototype.query=function(t,e,r,i){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,l=ii(a.filter),u=t.queryGeometry,c=t.queryPadding*s,h=$u(u),p=this.grid.query(h.minX-c,h.minY-c,h.maxX+c,h.maxY+c),d=$u(t.cameraQueryGeometry),f=this.grid3D.query(d.minX-c,d.minY-c,d.maxX+c,d.maxY+c,(function(e,r,i,o){return function(t,e,r,i,o){for(var a=0,s=t;a<s.length;a+=1){var l=s[a];if(e<=l.x&&r<=l.y&&i>=l.x&&o>=l.y)return!0}var u=[new n(e,r),new n(e,o),new n(i,o),new n(i,r)];if(t.length>2)for(var c=0,h=u;c<h.length;c+=1)if(Ko(t,h[c]))return!0;for(var p=0;p<t.length-1;p++)if(Jo(t[p],t[p+1],u))return!0;return!1}(t.cameraQueryGeometry,e-c,r-c,i+c,o+c)})),m=0,g=f;m<g.length;m+=1)p.push(g[m]);p.sort(tc);for(var y,v={},_=function(n){var c=p[n];if(c!==y){y=c;var h=o.featureIndexArray.get(c),d=null;o.loadMatchingFeature(v,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,l,a.layers,a.availableImages,e,r,i,(function(e,r,i){return d||(d=Fo(e)),r.queryIntersectsFeature(u,e,i,d,o.z,t.transform,s,t.pixelPosMatrix)}))}},b=0;b<p.length;b++)_(b);return v},Ju.prototype.loadMatchingFeature=function(t,e,r,i,n,o,a,s,l,u,c){var h=this.bucketLayerIDs[e];if(!o||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(o,h)){var p=this.sourceLayerCoder.decode(r),d=this.vtLayers[p].feature(i);if(n.filter(new on(this.tileID.overscaledZ),d))for(var f=this.getId(d,p),m=0;m<h.length;m++){var g=h[m];if(!(o&&o.indexOf(g)<0)){var y=s[g];if(y){var v={};void 0!==f&&u&&(v=u.getState(y.sourceLayer||"_geojsonTileLayer",f));var _=l[g];_.paint=Qu(_.paint,y.paint,d,v,a),_.layout=Qu(_.layout,y.layout,d,v,a);var b=!c||c(d,y,v);if(b){var x=new Xu(d,this.z,this.x,this.y,f);x.layer=_;var w=t[g];void 0===w&&(w=t[g]=[]),w.push({featureIndex:i,feature:x,intersectionZ:b})}}}}}},Ju.prototype.lookupSymbolFeatures=function(t,e,r,i,n,o,a,s){var l={};this.loadVTLayers();for(var u=ii(n),c=0,h=t;c<h.length;c+=1)this.loadMatchingFeature(l,r,i,h[c],u,o,a,s,e);return l},Ju.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var i=0,n=r[e];i<n.length;i+=1)if(t===n[i])return!0;return!1},Ju.prototype.getId=function(t,e){var r=t.id;return this.promoteId&&"boolean"==typeof(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(r=Number(r)),r},Oi("FeatureIndex",Ju,{omit:["rawTileData","sourceLayerCoder"]});var ec=function(t,e){this.tileID=t,this.uid=d(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};ec.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<B.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},ec.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},ec.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var i in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var i=function(){var t=o[n],i=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==i.length){t.layers=i,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return i.filter((function(e){return e.id===t}))[0]})));for(var a=0,s=i;a<s.length;a+=1)r[s[a].id]=t}},n=0,o=t;n<o.length;n+=1)i();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var n=this.buckets[i];if(n instanceof du){if(this.hasSymbolBuckets=!0,!r)break;n.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var o in this.buckets){var a=this.buckets[o];if(a instanceof du&&a.hasRTLText){this.hasRTLText=!0,nn.isLoading()||nn.isLoaded()||"deferred"!==en()||rn();break}}for(var s in this.queryPadding=0,this.buckets){var l=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(l))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Yn},ec.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},ec.prototype.getBucket=function(t){return this.buckets[t.id]},ec.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t)}var i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Mu(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Mu(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null)},ec.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},ec.prototype.queryRenderedFeatures=function(t,e,r,i,n,o,a,s,l,u){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:n,scale:o,tileSize:this.tileSize,pixelPosMatrix:u,transform:s,params:a,queryPadding:this.queryPadding*l},t,e,r):{}},ec.prototype.querySourceFeatures=function(t,e){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var i=r.loadVTLayers(),n=e?e.sourceLayer:"",o=i._geojsonTileLayer||i[n];if(o)for(var a=ii(e&&e.filter),s=this.tileID.canonical,l=s.z,u=s.x,c=s.y,h={z:l,x:u,y:c},p=0;p<o.length;p++){var d=o.feature(p);if(a.filter(new on(this.tileID.overscaledZ),d)){var f=r.getId(d,n),m=new Xu(d,l,u,c,f);m.tile=h,t.push(m)}}}},ec.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},ec.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},ec.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=S(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var i=Date.now(),n=!1;if(this.expirationTime>i)n=!1;else if(e)if(this.expirationTime<e)n=!0;else{var o=this.expirationTime-e;o?this.expirationTime=i+Math.max(o,3e4):n=!0}else n=!0;n?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},ec.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},ec.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var i in this.buckets)if(e.style.hasLayer(i)){var n=this.buckets[i],o=n.layers[0].sourceLayer||"_geojsonTileLayer",a=r[o],s=t[o];if(a&&s&&0!==Object.keys(s).length){n.update(s,a,this.imageAtlas&&this.imageAtlas.patternPositions||{});var l=e&&e.style&&e.style.getLayer(i);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(n)))}}}},ec.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},ec.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<B.now()},ec.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},ec.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=B.now()+t},ec.prototype.setDependencies=function(t,e){for(var r={},i=0,n=e;i<n.length;i+=1)r[n[i]]=!0;this.dependencies[t]=r},ec.prototype.hasDependency=function(t,e){for(var r=0,i=t;r<i.length;r+=1){var n=this.dependencies[i[r]];if(n)for(var o=0,a=e;o<a.length;o+=1)if(n[a[o]])return!0}return!1};var rc=a.performance,ic=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},rc.mark(this._marks.start)};ic.prototype.finish=function(){rc.mark(this._marks.end);var t=rc.getEntriesByName(this._marks.measure);return 0===t.length&&(rc.measure(this._marks.measure,this._marks.start,this._marks.end),t=rc.getEntriesByName(this._marks.measure),rc.clearMarks(this._marks.start),rc.clearMarks(this._marks.end),rc.clearMeasures(this._marks.measure)),t},t.Actor=ku,t.AlphaImage=ma,t.CanonicalTileID=Vu,t.CollisionBoxArray=Yn,t.Color=Qt,t.DEMData=Wu,t.DataConstantProperty=fn,t.DictionaryCoder=Hu,t.EXTENT=8192,t.ErrorEvent=Tt,t.EvaluationParameters=on,t.Event=Et,t.Evented=St,t.FeatureIndex=Ju,t.FillBucket=ns,t.FillExtrusionBucket=xs,t.ImageAtlas=gl,t.ImagePosition=fl,t.LineBucket=ks,t.LngLat=Ru,t.LngLatBounds=zu,t.MercatorCoordinate=Uu,t.ONE_EM=24,t.OverscaledTileID=Gu,t.Point=n,t.Point$1=n,t.Properties=_n,t.Protobuf=Ws,t.RGBAImage=ga,t.RequestManager=G,t.RequestPerformance=ic,t.ResourceType=dt,t.SegmentVector=oo,t.SourceFeatureState=Ku,t.StructArrayLayout1ui2=Zn,t.StructArrayLayout2f1f2i16=Dn,t.StructArrayLayout2i4=Sn,t.StructArrayLayout3ui6=Fn,t.StructArrayLayout4i8=Pn,t.SymbolBucket=du,t.Texture=Mu,t.Tile=ec,t.Transitionable=ln,t.Uniform1f=_o,t.Uniform1i=vo,t.Uniform2f=bo,t.Uniform3f=xo,t.Uniform4f=wo,t.UniformColor=Ao,t.UniformMatrix4f=To,t.UnwrappedTileID=qu,t.ValidationError=It,t.WritingMode=yl,t.ZoomHistory=Ui,t.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},t.addDynamicAttributes=uu,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var i=t.length,n=new Array(t.length),o=null;t.forEach((function(t,a){e(t,(function(t,e){t&&(o=t),n[a]=e,0==--i&&r(o,n)}))}))},t.bezier=s,t.bindAll=g,t.browser=B,t.cacheEntryPossiblyAdded=function(t){++ht>st&&(t.getActor().send("enforceCacheSizeLimit",at),ht=0)},t.clamp=u,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Vl,t.clone=function(t){var e=new ia(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},t.clone$1=b,t.clone$2=function(t){var e=new ia(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Us,t.config=F,t.create=function(){var t=new ia(16);return ia!=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},t.create$1=function(){var t=new ia(9);return ia!=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},t.create$2=function(){var t=new ia(4);return ia!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Gr,t.createLayout=En,t.createStyleLayer=function(t){return"custom"===t.type?new wu(t):new Au[t.type](t)},t.cross=function(t,e,r){var i=e[0],n=e[1],o=e[2],a=r[0],s=r[1],l=r[2];return t[0]=n*l-o*s,t[1]=o*a-i*l,t[2]=i*s-n*a,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var i=0;i<e.length;i++)if(!t(e[i],r[i]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==r){if("object"!=typeof r)return!1;if(Object.keys(e).length!==Object.keys(r).length)return!1;for(var n in e)if(!t(e[n],r[n]))return!1;return!0}return e===r},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.dot$1=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=l,t.emitValidationErrors=Mi,t.endsWith=y,t.enforceCacheSizeLimit=function(t){lt(),$&&$.then((function(e){e.keys().then((function(r){for(var i=0;i<r.length-t;i++)e.delete(r[i])}))}))},t.evaluateSizeForFeature=zl,t.evaluateSizeForZoom=Rl,t.evaluateVariableOffset=eu,t.evented=tn,t.extend=h,t.featureFilter=ii,t.filterObject=_,t.fromRotation=function(t,e){var r=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=r,t[2]=0,t[3]=-r,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=Il,t.getAnchorJustification=ru,t.getArrayBuffer=_t,t.getImage=xt,t.getJSON=function(t,e){return vt(h(t,{type:"json"}),e)},t.getRTLTextPluginStatus=en,t.getReferrer=yt,t.getVideo=function(t,e){var r,i,n=a.document.createElement("video");n.muted=!0,n.onloadstart=function(){e(null,n)};for(var o=0;o<t.length;o++){var s=a.document.createElement("source");r=t[o],i=void 0,(i=a.document.createElement("a")).href=r,(i.protocol!==a.document.location.protocol||i.host!==a.document.location.host)&&(n.crossOrigin="Anonymous"),s.src=t[o],n.appendChild(s)}return{cancel:function(){}}},t.identity=na,t.invert=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],d=e[11],f=e[12],m=e[13],g=e[14],y=e[15],v=r*s-i*a,_=r*l-n*a,b=r*u-o*a,x=i*l-n*s,w=i*u-o*s,A=n*u-o*l,E=c*m-h*f,T=c*g-p*f,S=c*y-d*f,P=h*g-p*m,I=h*y-d*m,M=p*y-d*g,C=v*M-_*I+b*P+x*S-w*T+A*E;return C?(t[0]=(s*M-l*I+u*P)*(C=1/C),t[1]=(n*I-i*M-o*P)*C,t[2]=(m*A-g*w+y*x)*C,t[3]=(p*w-h*A-d*x)*C,t[4]=(l*S-a*M-u*T)*C,t[5]=(r*M-n*S+o*T)*C,t[6]=(g*b-f*A-y*_)*C,t[7]=(c*A-p*b+d*_)*C,t[8]=(a*I-s*S+u*E)*C,t[9]=(i*S-r*I-o*E)*C,t[10]=(f*w-m*b+y*v)*C,t[11]=(h*b-c*w-d*v)*C,t[12]=(s*T-a*P-l*E)*C,t[13]=(r*P-i*T+n*E)*C,t[14]=(m*_-f*x-g*v)*C,t[15]=(c*x-h*_+p*v)*C,t):null},t.isChar=Vi,t.isMapboxURL=Z,t.keysDifference=function(t,e){var r=[];for(var i in t)i in e||r.push(i);return r},t.makeRequest=vt,t.mapObject=v,t.mercatorXfromLng=Bu,t.mercatorYfromLat=Fu,t.mercatorZfromAltitude=ju,t.mul=sa,t.multiply=oa,t.mvt=ys,t.normalize=function(t,e){var r=e[0],i=e[1],n=e[2],o=r*r+i*i+n*n;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.number=Ve,t.offscreenCanvasSupported=pt,t.ortho=function(t,e,r,i,n,o,a){var s=1/(e-r),l=1/(i-n),u=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(n+i)*l,t[14]=(a+o)*u,t[15]=1,t},t.parseGlyphPBF=function(t){return new Ws(t).readFields(cl,[])},t.pbf=Ws,t.performSymbolLayout=function(t,e,r,i,n,o,a){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var s=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,h=c.maxZoom;u.compositeTextSizes=[l["text-size"].possiblyEvaluate(new on(c.minZoom),a),l["text-size"].possiblyEvaluate(new on(h),a)]}if("composite"===t.iconSizeData.kind){var p=t.iconSizeData,d=p.maxZoom;u.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new on(p.minZoom),a),l["icon-size"].possiblyEvaluate(new on(d),a)]}u.layoutTextSize=l["text-size"].possiblyEvaluate(new on(t.zoom+1),a),u.layoutIconSize=l["icon-size"].possiblyEvaluate(new on(t.zoom+1),a),u.textMaxSize=l["text-size"].possiblyEvaluate(new on(18));for(var f=24*s.get("text-line-height"),m="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),g=s.get("text-keep-upright"),y=s.get("text-size"),v=function(){var o=b[_],l=s.get("text-font").evaluate(o,{},a).join(","),c=y.evaluate(o,{},a),h=u.layoutTextSize.evaluate(o,{},a),p=u.layoutIconSize.evaluate(o,{},a),d={horizontal:{},vertical:void 0},v=o.text,x=[0,0];if(v){var A=v.toString(),E=24*s.get("text-letter-spacing").evaluate(o,{},a),T=function(t){for(var e=0,r=t;e<r.length;e+=1)if(i=r[e].charCodeAt(0),Vi.Arabic(i)||Vi["Arabic Supplement"](i)||Vi["Arabic Extended-A"](i)||Vi["Arabic Presentation Forms-A"](i)||Vi["Arabic Presentation Forms-B"](i))return!1;var i;return!0}(A)?E:0,S=s.get("text-anchor").evaluate(o,{},a),P=s.get("text-variable-anchor");if(!P){var I=s.get("text-radial-offset").evaluate(o,{},a);x=I?eu(S,[24*I,tu]):s.get("text-offset").evaluate(o,{},a).map((function(t){return 24*t}))}var M=m?"center":s.get("text-justify").evaluate(o,{},a),C=s.get("symbol-placement"),k="point"===C?24*s.get("text-max-width").evaluate(o,{},a):0,L=function(){t.allowVerticalPlacement&&qi(A)&&(d.vertical=bl(v,e,r,n,l,k,f,S,"left",T,x,yl.vertical,!0,C,h,c))};if(!m&&P){for(var z="auto"===M?P.map((function(t){return ru(t)})):[M],R=!1,O=0;O<z.length;O++){var D=z[O];if(!d.horizontal[D])if(R)d.horizontal[D]=d.horizontal[0];else{var B=bl(v,e,r,n,l,k,f,"center",D,T,x,yl.horizontal,!1,C,h,c);B&&(d.horizontal[D]=B,R=1===B.positionedLines.length)}}L()}else{"auto"===M&&(M=ru(S));var F=bl(v,e,r,n,l,k,f,S,M,T,x,yl.horizontal,!1,C,h,c);F&&(d.horizontal[M]=F),L(),qi(A)&&m&&g&&(d.vertical=bl(v,e,r,n,l,k,f,S,M,T,x,yl.vertical,!1,C,h,c))}}var j=void 0,N=!1;if(o.icon&&o.icon.name){var U=i[o.icon.name];U&&(j=function(t,e,r){var i=Il(r),n=e[0]-t.displaySize[0]*i.horizontalAlign,o=e[1]-t.displaySize[1]*i.verticalAlign;return{image:t,top:o,bottom:o+t.displaySize[1],left:n,right:n+t.displaySize[0]}}(n[o.icon.name],s.get("icon-offset").evaluate(o,{},a),s.get("icon-anchor").evaluate(o,{},a)),N=U.sdf,void 0===t.sdfIcons?t.sdfIcons=U.sdf:t.sdfIcons!==U.sdf&&w("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(U.pixelRatio!==t.pixelRatio||0!==s.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var V=nu(d.horizontal)||d.vertical;t.iconsInText=!!V&&V.iconsInText,(V||j)&&function(t,e,r,i,n,o,a,s,l,u,c){var h=o.textMaxSize.evaluate(e,{});void 0===h&&(h=a);var p,d=t.layers[0].layout,f=d.get("icon-offset").evaluate(e,{},c),m=nu(r.horizontal),g=a/24,y=t.tilePixelRatio*g,v=t.tilePixelRatio*h/24,_=t.tilePixelRatio*s,b=t.tilePixelRatio*d.get("symbol-spacing"),x=d.get("text-padding")*t.tilePixelRatio,A=d.get("icon-padding")*t.tilePixelRatio,E=d.get("text-max-angle")/180*Math.PI,T="map"===d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement"),S="map"===d.get("icon-rotation-alignment")&&"point"!==d.get("symbol-placement"),P=d.get("symbol-placement"),I=b/2,M=d.get("icon-text-fit");i&&"none"!==M&&(t.allowVerticalPlacement&&r.vertical&&(p=Cl(i,r.vertical,M,d.get("icon-text-fit-padding"),f,g)),m&&(i=Cl(i,m,M,d.get("icon-text-fit-padding"),f,g)));var C=function(s,h){h.x<0||h.x>=8192||h.y<0||h.y>=8192||function(t,e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,y,v,_,b,x,A,E,T){var S,P,I,M,C,k=t.addToLineVertexArray(e,r),L=0,z=0,R=0,O=0,D=-1,B=-1,F={},j=co(""),N=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(N=(S=s.layout.get("text-offset").evaluate(b,{},E).map((function(t){return 24*t})))[0],U=S[1]):(N=24*s.layout.get("text-radial-offset").evaluate(b,{},E),U=tu),t.allowVerticalPlacement&&i.vertical){var V=s.layout.get("text-rotate").evaluate(b,{},E)+90;M=new Xl(l,e,u,c,h,i.vertical,p,d,f,V),a&&(C=new Xl(l,e,u,c,h,a,g,y,f,V))}if(n){var q=s.layout.get("icon-rotate").evaluate(b,{}),G="none"!==s.layout.get("icon-text-fit"),Z=ql(n,q,A,G),W=a?ql(a,q,A,G):void 0;I=new Xl(l,e,u,c,h,n,g,y,!1,q),L=4*Z.length;var H=t.iconSizeData,X=null;"source"===H.kind?(X=[128*s.layout.get("icon-size").evaluate(b,{})])[0]>32640&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===H.kind&&((X=[128*x.compositeIconSizes[0].evaluate(b,{},E),128*x.compositeIconSizes[1].evaluate(b,{},E)])[0]>32640||X[1]>32640)&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,Z,X,_,v,b,!1,e,k.lineStartIndex,k.lineLength,-1,E),D=t.icon.placedSymbolArray.length-1,W&&(z=4*W.length,t.addSymbols(t.icon,W,X,_,v,b,yl.vertical,e,k.lineStartIndex,k.lineLength,-1,E),B=t.icon.placedSymbolArray.length-1)}for(var Y in i.horizontal){var K=i.horizontal[Y];if(!P){j=co(K.text);var J=s.layout.get("text-rotate").evaluate(b,{},E);P=new Xl(l,e,u,c,h,K,p,d,f,J)}var Q=1===K.positionedLines.length;if(R+=iu(t,e,K,o,s,f,b,m,k,i.vertical?yl.horizontal:yl.horizontalOnly,Q?Object.keys(i.horizontal):[Y],F,D,x,E),Q)break}i.vertical&&(O+=iu(t,e,i.vertical,o,s,f,b,m,k,yl.vertical,["vertical"],F,B,x,E));var $=P?P.boxStartIndex:t.collisionBoxArray.length,tt=P?P.boxEndIndex:t.collisionBoxArray.length,et=M?M.boxStartIndex:t.collisionBoxArray.length,rt=M?M.boxEndIndex:t.collisionBoxArray.length,it=I?I.boxStartIndex:t.collisionBoxArray.length,nt=I?I.boxEndIndex:t.collisionBoxArray.length,ot=C?C.boxStartIndex:t.collisionBoxArray.length,at=C?C.boxEndIndex:t.collisionBoxArray.length,st=-1,lt=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=lt(P,st),st=lt(M,st),st=lt(I,st);var ut=(st=lt(C,st))>-1?1:0;ut&&(st*=T/24),t.glyphOffsetArray.length>=du.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,F.right>=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,D,B,j,$,tt,et,rt,it,nt,ot,at,u,R,O,L,z,ut,0,p,N,U,st)}(t,h,s,r,i,n,p,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,y,x,T,l,_,A,S,f,e,o,u,c,a)};if("line"===P)for(var k=0,L=Vl(e.geometry,0,0,8192,8192);k<L.length;k+=1)for(var z=L[k],R=0,O=Ul(z,b,E,r.vertical||m,i,24,v,t.overscaling,8192);R<O.length;R+=1){var D=O[R];m&&ou(t,m.text,I,D)||C(z,D)}else if("line-center"===P)for(var B=0,F=e.geometry;B<F.length;B+=1){var j=F[B];if(j.length>1){var N=Nl(j,E,r.vertical||m,i,24,v);N&&C(j,N)}}else if("Polygon"===e.type)for(var U=0,V=ts(e.geometry,0);U<V.length;U+=1){var q=V[U],G=Jl(q,16);C(q[0],new kl(G.x,G.y,0))}else if("LineString"===e.type)for(var Z=0,W=e.geometry;Z<W.length;Z+=1){var H=W[Z];C(H,new kl(H[0].x,H[0].y,0))}else if("Point"===e.type)for(var X=0,Y=e.geometry;X<Y.length;X+=1)for(var K=0,J=Y[X];K<J.length;K+=1){var Q=J[K];C([Q],new kl(Q.x,Q.y,0))}}(t,o,d,j,i,u,h,p,x,N,a)},_=0,b=t.features;_<b.length;_+=1)v();o&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,r,i,n){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,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!=n&&n!==1/0?(t[10]=(n+i)*(o=1/(i-n)),t[14]=2*n*i*o):(t[10]=-1,t[14]=-2*i),t},t.pick=function(t,e){for(var r={},i=0;i<e.length;i++){var n=e[i];n in t&&(r[n]=t[n])}return r},t.plugin=nn,t.polygonIntersectsPolygon=Uo,t.postMapLoadEvent=ot,t.postTurnstileEvent=it,t.potpack=dl,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=Oi,t.registerForPluginStateChange=function(t){return t({pluginStatus:Ki,pluginURL:Ji}),tn.on("pluginStateChange",t),t},t.rotate=function(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=i*l+o*s,t[1]=n*l+a*s,t[2]=i*-s+o*l,t[3]=n*-s+a*l,t},t.rotateX=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],p=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]=o*n+u*i,t[5]=a*n+c*i,t[6]=s*n+h*i,t[7]=l*n+p*i,t[8]=u*n-o*i,t[9]=c*n-a*i,t[10]=h*n-s*i,t[11]=p*n-l*i,t},t.rotateZ=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[0],a=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],p=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]=o*n+u*i,t[1]=a*n+c*i,t[2]=s*n+h*i,t[3]=l*n+p*i,t[4]=u*n-o*i,t[5]=c*n-a*i,t[6]=h*n-s*i,t[7]=p*n-l*i,t},t.scale=function(t,e,r){var i=r[0],n=r[1],o=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},t.scale$2=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},t.setCacheLimits=function(t,e){at=t,st=e},t.setRTLTextPlugin=function(t,e,r){if(void 0===r&&(r=!1),"deferred"===Ki||"loading"===Ki||"loaded"===Ki)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ji=B.resolveURL(t),Ki="deferred",Yi=e,$i(),r||rn()},t.sphericalToCartesian=function(t){var e=t[0],r=t[1],i=t[2];return r+=90,r*=Math.PI/180,i*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(i),y:e*Math.sin(r)*Math.sin(i),z:e*Math.cos(i)}},t.sqrLen=function(t){var e=t[0],r=t[1];return e*e+r*r},t.styleSpec=Pt,t.sub=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t},t.symbolSize=Ol,t.transformMat3=function(t,e,r){var i=e[0],n=e[1],o=e[2];return t[0]=i*r[0]+n*r[3]+o*r[6],t[1]=i*r[1]+n*r[4]+o*r[7],t[2]=i*r[2]+n*r[5]+o*r[8],t},t.transformMat4=la,t.translate=function(t,e,r){var i,n,o,a,s,l,u,c,h,p,d,f,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],d=e[10],f=e[11],t[0]=i=e[0],t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=p,t[10]=d,t[11]=f,t[12]=i*m+s*g+h*y+e[12],t[13]=n*m+l*g+p*y+e[13],t[14]=o*m+u*g+d*y+e[14],t[15]=a*m+c*g+f*y+e[15]),t},t.triggerPluginCompletionEvent=Qi,t.uniqueId=d,t.validateCustomStyleLayer=function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=Si,t.validateStyle=Ti,t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.vectorTile=ys,t.version="1.11.1",t.warnOnce=w,t.webpSupported=j,t.window=a,t.wrap=c})),i(["./shared"],(function(t){function e(t){var r=typeof t;if("number"===r||"boolean"===r||"string"===r||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var i="[",n=0,o=t;n<o.length;n+=1)i+=e(o[n])+",";return i+"]"}for(var a=Object.keys(t).sort(),s="{",l=0;l<a.length;l++)s+=JSON.stringify(a[l])+":"+e(t[a[l]])+",";return s+"}"}function r(r){for(var i="",n=0,o=t.refProperties;n<o.length;n+=1)i+="/"+e(r[o[n]]);return i}var i=function(t){this.keyCache={},t&&this.replace(t)};i.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},i.prototype.update=function(e,i){for(var n=this,o=0,a=e;o<a.length;o+=1){var s=a[o];this._layerConfigs[s.id]=s;var l=this._layers[s.id]=t.createStyleLayer(s);l._featureFilter=t.featureFilter(l.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var u=0,c=i;u<c.length;u+=1){var h=c[u];delete this.keyCache[h],delete this._layerConfigs[h],delete this._layers[h]}this.familiesBySource={};for(var p=0,d=function(t,e){for(var i={},n=0;n<t.length;n++){var o=e&&e[t[n].id]||r(t[n]);e&&(e[t[n].id]=o);var a=i[o];a||(a=i[o]=[]),a.push(t[n])}var s=[];for(var l in i)s.push(i[l]);return s}(t.values(this._layerConfigs),this.keyCache);p<d.length;p+=1){var f=d[p].map((function(t){return n._layers[t.id]})),m=f[0];if("none"!==m.visibility){var g=m.source||"",y=this.familiesBySource[g];y||(y=this.familiesBySource[g]={});var v=m.sourceLayer||"_geojsonTileLayer",_=y[v];_||(_=y[v]=[]),_.push(f)}}};var n=function(e){var r={},i=[];for(var n in e){var o=e[n],a=r[n]={};for(var s in o){var l=o[+s];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var u={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};i.push(u),a[s]={rect:u,metrics:l.metrics}}}}var c=t.potpack(i),h=new t.AlphaImage({width:c.w||1,height:c.h||1});for(var p in e){var d=e[p];for(var f in d){var m=d[+f];if(m&&0!==m.bitmap.width&&0!==m.bitmap.height){var g=r[p][f].rect;t.AlphaImage.copy(m.bitmap,h,{x:0,y:0},{x:g.x+1,y:g.y+1},m.bitmap)}}}this.image=h,this.positions=r};t.register("GlyphAtlas",n);var o=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId};function a(e,r,i){for(var n=new t.EvaluationParameters(r),o=0,a=e;o<a.length;o+=1)a[o].recalculate(n,i)}function s(e,r){var i=t.getArrayBuffer(e.request,(function(e,i,n,o){e?r(e):i&&r(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(i)),rawData:i,cacheControl:n,expires:o})}));return function(){i.cancel(),r()}}o.prototype.parse=function(e,r,i,o,s){var l=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var u=new t.DictionaryCoder(Object.keys(e.layers).sort()),c=new t.FeatureIndex(this.tileID,this.promoteId);c.bucketLayerIDs=[];var h,p,d,f,m={},g={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:i},y=r.familiesBySource[this.source];for(var v in y){var _=e.layers[v];if(_){1===_.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+v+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var b=u.encode(v),x=[],w=0;w<_.length;w++){var A=_.feature(w),E=c.getId(A,v);x.push({feature:A,id:E,index:w,sourceLayerIndex:b})}for(var T=0,S=y[v];T<S.length;T+=1){var P=S[T],I=P[0];I.minzoom&&this.zoom<Math.floor(I.minzoom)||I.maxzoom&&this.zoom>=I.maxzoom||"none"!==I.visibility&&(a(P,this.zoom,i),(m[I.id]=I.createBucket({index:c.bucketLayerIDs.length,layers:P,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(x,g,this.tileID.canonical),c.bucketLayerIDs.push(P.map((function(t){return t.id}))))}}}var M=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(M).length?o.send("getGlyphs",{uid:this.uid,stacks:M},(function(t,e){h||(h=t,p=e,L.call(l))})):p={};var C=Object.keys(g.iconDependencies);C.length?o.send("getImages",{icons:C,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,d=e,L.call(l))})):d={};var k=Object.keys(g.patternDependencies);function L(){if(h)return s(h);if(p&&d&&f){var e=new n(p),r=new t.ImageAtlas(d,f);for(var o in m){var l=m[o];l instanceof t.SymbolBucket?(a(l.layers,this.zoom,i),t.performSymbolLayout(l,p,e.positions,d,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(a(l.layers,this.zoom,i),l.addFeatures(g,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?d:null,glyphPositions:this.returnDependencies?e.positions:null})}}k.length?o.send("getImages",{icons:k,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,f=e,L.call(l))})):f={},L.call(this)};var l=function(t,e,r,i){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=i||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var i=this,n=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[n]=new o(e);s.abort=this.loadVectorData(e,(function(e,o){if(delete i.loading[n],e||!o)return s.status="done",i.loaded[n]=s,r(e);var l=o.rawData,u={};o.expires&&(u.expires=o.expires),o.cacheControl&&(u.cacheControl=o.cacheControl);var c={};if(a){var h=a.finish();h&&(c.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=o.vectorTile,s.parse(o.vectorTile,i.layerIndex,i.availableImages,i.actor,(function(e,i){if(e||!i)return r(e);r(null,t.extend({rawTileData:l.slice(0)},i,u,c))})),i.loaded=i.loaded||{},i.loaded[n]=s}))},l.prototype.reloadTile=function(t,e){var r=this,i=this.loaded,n=t.uid,o=this;if(i&&i[n]){var a=i[n];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,i){var n=a.reloadCallback;n&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,n)),e(t,i)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,i=t.uid;r&&r[i]&&r[i].abort&&(r[i].abort(),delete r[i]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,i=t.uid;r&&r[i]&&delete r[i],e()};var u=t.window.ImageBitmap,c=function(){this.loaded={}};function h(t,e){if(0!==t.length){p(t[0],e);for(var r=1;r<t.length;r++)p(t[r],!e)}}function p(t,e){for(var r=0,i=0,n=t.length,o=n-1;i<n;o=i++)r+=(t[i][0]-t[o][0])*(t[o][1]+t[i][1]);r>=0!=!!e&&t.reverse()}c.prototype.loadTile=function(e,r){var i=e.uid,n=e.encoding,o=e.rawImageData,a=u&&o instanceof u?this.getImageData(o):o,s=new t.DEMData(i,a,n);this.loaded=this.loaded||{},this.loaded[i]=s,r(null,s)},c.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},c.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var d=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,f=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};f.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,i=this._feature.geometry;r<i.length;r+=1){var n=i[r];e.push([new t.Point$1(n[0],n[1])])}return e}for(var o=[],a=0,s=this._feature.geometry;a<s.length;a+=1){for(var l=[],u=0,c=s[a];u<c.length;u+=1){var h=c[u];l.push(new t.Point$1(h[0],h[1]))}o.push(l)}return o},f.prototype.toGeoJSON=function(t,e,r){return d.call(this,t,e,r)};var m=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};m.prototype.feature=function(t){return new f(this._features[t])};var g=t.vectorTile.VectorTileFeature,y=v;function v(t,e){this.options=e||{},this.features=t,this.length=t.length}function _(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}v.prototype.feature=function(t){return new _(this.features[t],this.options.extent)},_.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var r=0;r<e.length;r++){for(var i=e[r],n=[],o=0;o<i.length;o++)n.push(new t.Point$1(i[o][0],i[o][1]));this.geometry.push(n)}return this.geometry},_.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,i=1/0,n=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var l=a[s];e=Math.min(e,l.x),r=Math.max(r,l.x),i=Math.min(i,l.y),n=Math.max(n,l.y)}return[e,i,r,n]},_.prototype.toGeoJSON=g.prototype.toGeoJSON;var b=w,x=y;function w(e){var r=new t.pbf;return function(t,e){for(var r in t.layers)e.writeMessage(3,A,t.layers[r])}(e,r),r.finish()}function A(t,e){var r;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var i={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)i.feature=t.feature(r),e.writeMessage(2,E,i);var n=i.keys;for(r=0;r<n.length;r++)e.writeStringField(3,n[r]);var o=i.values;for(r=0;r<o.length;r++)e.writeMessage(4,M,o[r])}function E(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,T,t),e.writeVarintField(3,r.type),e.writeMessage(4,I,r)}function T(t,e){var r=t.feature,i=t.keys,n=t.values,o=t.keycache,a=t.valuecache;for(var s in r.properties){var l=o[s];void 0===l&&(i.push(s),o[s]=l=i.length-1),e.writeVarint(l);var u=r.properties[s],c=typeof u;"string"!==c&&"boolean"!==c&&"number"!==c&&(u=JSON.stringify(u));var h=c+":"+u,p=a[h];void 0===p&&(n.push(u),a[h]=p=n.length-1),e.writeVarint(p)}}function S(t,e){return(e<<3)+(7&t)}function P(t){return t<<1^t>>31}function I(t,e){for(var r=t.loadGeometry(),i=t.type,n=0,o=0,a=r.length,s=0;s<a;s++){var l=r[s],u=1;1===i&&(u=l.length),e.writeVarint(S(1,u));for(var c=3===i?l.length-1:l.length,h=0;h<c;h++){1===h&&1!==i&&e.writeVarint(S(2,c-1));var p=l[h].x-n,d=l[h].y-o;e.writeVarint(P(p)),e.writeVarint(P(d)),n+=p,o+=d}3===i&&e.writeVarint(S(7,1))}}function M(t,e){var r=typeof t;"string"===r?e.writeStringField(1,t):"boolean"===r?e.writeBooleanField(7,t):"number"===r&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function C(t,e,r,i){k(t,r,i),k(e,2*r,2*i),k(e,2*r+1,2*i+1)}function k(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function L(t,e,r,i){var n=t-r,o=e-i;return n*n+o*o}b.fromVectorTileJs=w,b.fromGeojsonVt=function(t,e){e=e||{};var r={};for(var i in t)r[i]=new y(t[i].features,e),r[i].name=i,r[i].version=e.version,r[i].extent=e.extent;return w({layers:r})},b.GeoJSONWrapper=x;var z=function(t){return t[0]},R=function(t){return t[1]},O=function(t,e,r,i,n){void 0===e&&(e=z),void 0===r&&(r=R),void 0===i&&(i=64),void 0===n&&(n=Float64Array),this.nodeSize=i,this.points=t;for(var o=t.length<65536?Uint16Array:Uint32Array,a=this.ids=new o(t.length),s=this.coords=new n(2*t.length),l=0;l<t.length;l++)a[l]=l,s[2*l]=e(t[l]),s[2*l+1]=r(t[l]);!function t(e,r,i,n,o,a){if(!(o-n<=i)){var s=n+o>>1;!function t(e,r,i,n,o,a){for(;o>n;){if(o-n>600){var s=o-n+1,l=i-n+1,u=Math.log(s),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1);t(e,r,i,Math.max(n,Math.floor(i-l*c/s+h)),Math.min(o,Math.floor(i+(s-l)*c/s+h)),a)}var p=r[2*i+a],d=n,f=o;for(C(e,r,n,i),r[2*o+a]>p&&C(e,r,n,o);d<f;){for(C(e,r,d,f),d++,f--;r[2*d+a]<p;)d++;for(;r[2*f+a]>p;)f--}r[2*n+a]===p?C(e,r,n,f):C(e,r,++f,o),f<=i&&(n=f+1),i<=f&&(o=f-1)}}(e,r,s,n,o,a%2),t(e,r,i,n,s-1,a+1),t(e,r,i,s+1,o,a+1)}}(a,s,i,0,a.length-1,0)};O.prototype.range=function(t,e,r,i){return function(t,e,r,i,n,o,a){for(var s,l,u=[0,t.length-1,0],c=[];u.length;){var h=u.pop(),p=u.pop(),d=u.pop();if(p-d<=a)for(var f=d;f<=p;f++)l=e[2*f+1],(s=e[2*f])>=r&&s<=n&&l>=i&&l<=o&&c.push(t[f]);else{var m=Math.floor((d+p)/2);l=e[2*m+1],(s=e[2*m])>=r&&s<=n&&l>=i&&l<=o&&c.push(t[m]);var g=(h+1)%2;(0===h?r<=s:i<=l)&&(u.push(d),u.push(m-1),u.push(g)),(0===h?n>=s:o>=l)&&(u.push(m+1),u.push(p),u.push(g))}}return c}(this.ids,this.coords,t,e,r,i,this.nodeSize)},O.prototype.within=function(t,e,r){return function(t,e,r,i,n,o){for(var a=[0,t.length-1,0],s=[],l=n*n;a.length;){var u=a.pop(),c=a.pop(),h=a.pop();if(c-h<=o)for(var p=h;p<=c;p++)L(e[2*p],e[2*p+1],r,i)<=l&&s.push(t[p]);else{var d=Math.floor((h+c)/2),f=e[2*d],m=e[2*d+1];L(f,m,r,i)<=l&&s.push(t[d]);var g=(u+1)%2;(0===u?r-n<=f:i-n<=m)&&(a.push(h),a.push(d-1),a.push(g)),(0===u?r+n>=f:i+n>=m)&&(a.push(d+1),a.push(c),a.push(g))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var D={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},B=function(t){this.options=G(Object.create(D),t),this.trees=new Array(this.options.maxZoom+1)};function F(t,e,r,i,n){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:i,properties:n}}function j(t,e){var r=t.geometry.coordinates,i=r[1];return{x:V(r[0]),y:q(i),zoom:1/0,index:e,parentId:-1}}function N(t){return{type:"Feature",id:t.id,properties:U(t),geometry:{type:"Point",coordinates:[(i=t.x,360*(i-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,i}function U(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return G(G({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function V(t){return t/360+.5}function q(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function G(t,e){for(var r in e)t[r]=e[r];return t}function Z(t){return t.x}function W(t){return t.y}function H(t,e,r,i,n,o){var a=n-r,s=o-i;if(0!==a||0!==s){var l=((t-r)*a+(e-i)*s)/(a*a+s*s);l>1?(r=n,i=o):l>0&&(r+=a*l,i+=s*l)}return(a=t-r)*a+(s=e-i)*s}function X(t,e,r,i){var n={id:void 0===t?null:t,type:e,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)Y(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var i=0;i<e.length;i++)Y(t,e[i]);else if("MultiPolygon"===r)for(i=0;i<e.length;i++)for(var n=0;n<e[i].length;n++)Y(t,e[i][n])}(n),n}function Y(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function K(t,e,r,i){if(e.geometry){var n=e.geometry.coordinates,o=e.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=e.id;if(r.promoteId?l=e.properties[r.promoteId]:r.generateId&&(l=i||0),"Point"===o)J(n,s);else if("MultiPoint"===o)for(var u=0;u<n.length;u++)J(n[u],s);else if("LineString"===o)Q(n,s,a,!1);else if("MultiLineString"===o){if(r.lineMetrics){for(u=0;u<n.length;u++)Q(n[u],s=[],a,!1),t.push(X(l,"LineString",s,e.properties));return}$(n,s,a,!1)}else if("Polygon"===o)$(n,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(u=0;u<e.geometry.geometries.length;u++)K(t,{id:l,geometry:e.geometry.geometries[u],properties:e.properties},r,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(u=0;u<n.length;u++){var c=[];$(n[u],c,a,!0),s.push(c)}}t.push(X(l,o,s,e.properties))}}function J(t,e){e.push(tt(t[0])),e.push(et(t[1])),e.push(0)}function Q(t,e,r,i){for(var n,o,a=0,s=0;s<t.length;s++){var l=tt(t[s][0]),u=et(t[s][1]);e.push(l),e.push(u),e.push(0),s>0&&(a+=i?(n*u-l*o)/2:Math.sqrt(Math.pow(l-n,2)+Math.pow(u-o,2))),n=l,o=u}var c=e.length-3;e[2]=1,function t(e,r,i,n){for(var o,a=n,s=i-r>>1,l=i-r,u=e[r],c=e[r+1],h=e[i],p=e[i+1],d=r+3;d<i;d+=3){var f=H(e[d],e[d+1],u,c,h,p);if(f>a)o=d,a=f;else if(f===a){var m=Math.abs(d-s);m<l&&(o=d,l=m)}}a>n&&(o-r>3&&t(e,r,o,n),e[o+2]=a,i-o>3&&t(e,o,i,n))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function $(t,e,r,i){for(var n=0;n<t.length;n++){var o=[];Q(t[n],o,r,i),e.push(o)}}function tt(t){return t/360+.5}function et(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function rt(t,e,r,i,n,o,a,s){if(i/=e,o>=(r/=e)&&a<i)return t;if(a<r||o>=i)return null;for(var l=[],u=0;u<t.length;u++){var c=t[u],h=c.geometry,p=c.type,d=0===n?c.minX:c.minY,f=0===n?c.maxX:c.maxY;if(d>=r&&f<i)l.push(c);else if(!(f<r||d>=i)){var m=[];if("Point"===p||"MultiPoint"===p)it(h,m,r,i,n);else if("LineString"===p)nt(h,m,r,i,n,!1,s.lineMetrics);else if("MultiLineString"===p)at(h,m,r,i,n,!1);else if("Polygon"===p)at(h,m,r,i,n,!0);else if("MultiPolygon"===p)for(var g=0;g<h.length;g++){var y=[];at(h[g],y,r,i,n,!0),y.length&&m.push(y)}if(m.length){if(s.lineMetrics&&"LineString"===p){for(g=0;g<m.length;g++)l.push(X(c.id,p,m[g],c.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===m.length?(p="LineString",m=m[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===m.length?"Point":"MultiPoint"),l.push(X(c.id,p,m,c.tags))}}}return l.length?l:null}function it(t,e,r,i,n){for(var o=0;o<t.length;o+=3){var a=t[o+n];a>=r&&a<=i&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function nt(t,e,r,i,n,o,a){for(var s,l,u=ot(t),c=0===n?lt:ut,h=t.start,p=0;p<t.length-3;p+=3){var d=t[p],f=t[p+1],m=t[p+2],g=t[p+3],y=t[p+4],v=0===n?d:f,_=0===n?g:y,b=!1;a&&(s=Math.sqrt(Math.pow(d-g,2)+Math.pow(f-y,2))),v<r?_>r&&(l=c(u,d,f,g,y,r),a&&(u.start=h+s*l)):v>i?_<i&&(l=c(u,d,f,g,y,i),a&&(u.start=h+s*l)):st(u,d,f,m),_<r&&v>=r&&(l=c(u,d,f,g,y,r),b=!0),_>i&&v<=i&&(l=c(u,d,f,g,y,i),b=!0),!o&&b&&(a&&(u.end=h+s*l),e.push(u),u=ot(t)),a&&(h+=s)}var x=t.length-3;d=t[x],f=t[x+1],m=t[x+2],(v=0===n?d:f)>=r&&v<=i&&st(u,d,f,m),x=u.length-3,o&&x>=3&&(u[x]!==u[0]||u[x+1]!==u[1])&&st(u,u[0],u[1],u[2]),u.length&&e.push(u)}function ot(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function at(t,e,r,i,n,o){for(var a=0;a<t.length;a++)nt(t[a],e,r,i,n,o,!1)}function st(t,e,r,i){t.push(e),t.push(r),t.push(i)}function lt(t,e,r,i,n,o){var a=(o-e)/(i-e);return t.push(o),t.push(r+(n-r)*a),t.push(1),a}function ut(t,e,r,i,n,o){var a=(o-r)/(n-r);return t.push(e+(i-e)*a),t.push(o),t.push(1),a}function ct(t,e){for(var r=[],i=0;i<t.length;i++){var n,o=t[i],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)n=ht(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){n=[];for(var s=0;s<o.geometry.length;s++)n.push(ht(o.geometry[s],e))}else if("MultiPolygon"===a)for(n=[],s=0;s<o.geometry.length;s++){for(var l=[],u=0;u<o.geometry[s].length;u++)l.push(ht(o.geometry[s][u],e));n.push(l)}r.push(X(o.id,a,n,o.tags))}return r}function ht(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var i=0;i<t.length;i+=3)r.push(t[i]+e,t[i+1],t[i+2]);return r}function pt(t,e){if(t.transformed)return t;var r,i,n,o=1<<t.z,a=t.x,s=t.y;for(r=0;r<t.features.length;r++){var l=t.features[r],u=l.geometry,c=l.type;if(l.geometry=[],1===c)for(i=0;i<u.length;i+=2)l.geometry.push(dt(u[i],u[i+1],e,o,a,s));else for(i=0;i<u.length;i++){var h=[];for(n=0;n<u[i].length;n+=2)h.push(dt(u[i][n],u[i][n+1],e,o,a,s));l.geometry.push(h)}}return t.transformed=!0,t}function dt(t,e,r,i,n,o){return[Math.round(r*(t*i-n)),Math.round(r*(e*i-o))]}function ft(t,e,r,i,n){for(var o=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,mt(a,t[s],o,n);var l=t[s].minX,u=t[s].minY,c=t[s].maxX,h=t[s].maxY;l<a.minX&&(a.minX=l),u<a.minY&&(a.minY=u),c>a.maxX&&(a.maxX=c),h>a.maxY&&(a.maxY=h)}return a}function mt(t,e,r,i){var n=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<n.length;s+=3)a.push(n[s]),a.push(n[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)gt(a,n,t,r,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<n.length;s++)gt(a,n[s],t,r,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var l=0;l<n.length;l++){var u=n[l];for(s=0;s<u.length;s++)gt(a,u[s],t,r,!0,0===s)}if(a.length){var c=e.tags||null;if("LineString"===o&&i.lineMetrics){for(var h in c={},e.tags)c[h]=e.tags[h];c.mapbox_clip_start=n.start/n.size,c.mapbox_clip_end=n.end/n.size}var p={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:c};null!==e.id&&(p.id=e.id),t.features.push(p)}}function gt(t,e,r,i,n,o){var a=i*i;if(i>0&&e.size<(n?a:i))r.numPoints+=e.length/3;else{for(var s=[],l=0;l<e.length;l+=3)(0===i||e[l+2]>a)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;n&&function(t,e){for(var r=0,i=0,n=t.length,o=n-2;i<n;o=i,i+=2)r+=(t[i]-t[o])*(t[i+1]+t[o+1]);if(r>0===e)for(i=0,n=t.length;i<n/2;i+=2){var a=t[i],s=t[i+1];t[i]=t[n-2-i],t[i+1]=t[n-1-i],t[n-2-i]=a,t[n-1-i]=s}}(s,o),t.push(s)}}function yt(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var i=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i<t.features.length;i++)K(r,t.features[i],e,i);else K(r,"Feature"===t.type?t:{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(i=function(t,e){var r=e.buffer/e.extent,i=t,n=rt(t,1,-1-r,r,0,-1,2,e),o=rt(t,1,1-r,2+r,0,-1,2,e);return(n||o)&&(i=rt(t,1,-r,1+r,0,-1,2,e)||[],n&&(i=ct(n,1).concat(i)),o&&(i=i.concat(ct(o,-1)))),i}(i,e)).length&&this.splitTile(i,0,0,0),r&&(i.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 vt(t,e,r){return 32*((1<<t)*r+e)+t}function _t(t,e){var r=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var i=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!i)return e(null,null);var n=new m(i.features),o=b(n);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:n,rawData:o.buffer})}B.prototype.load=function(t){var e=this.options,r=e.log,i=e.minZoom,n=e.maxZoom,o=e.nodeSize;r&&console.time("total time");var a="prepare "+t.length+" points";r&&console.time(a),this.points=t;for(var s=[],l=0;l<t.length;l++)t[l].geometry&&s.push(j(t[l],l));this.trees[n+1]=new O(s,Z,W,o,Float32Array),r&&console.timeEnd(a);for(var u=n;u>=i;u--){var c=+Date.now();s=this._cluster(s,u),this.trees[u]=new O(s,Z,W,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},B.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),n=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,n=180;else if(r>n){var a=this.getClusters([r,i,180,o],e),s=this.getClusters([-180,i,n,o],e);return a.concat(s)}for(var l=this.trees[this._limitZoom(e)],u=[],c=0,h=l.range(V(r),q(o),V(n),q(i));c<h.length;c+=1){var p=l.points[h[c]];u.push(p.numPoints?N(p):this.points[p.index])}return u},B.prototype.getChildren=function(t){var e=this._getOriginId(t),r=this._getOriginZoom(t),i="No cluster with the specified id.",n=this.trees[r];if(!n)throw new Error(i);var o=n.points[e];if(!o)throw new Error(i);for(var a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],l=0,u=n.within(o.x,o.y,a);l<u.length;l+=1){var c=n.points[u[l]];c.parentId===t&&s.push(c.numPoints?N(c):this.points[c.index])}if(0===s.length)throw new Error(i);return s},B.prototype.getLeaves=function(t,e,r){var i=[];return this._appendLeaves(i,t,e=e||10,r=r||0,0),i},B.prototype.getTile=function(t,e,r){var i=this.trees[this._limitZoom(t)],n=Math.pow(2,t),o=this.options,a=o.radius/o.extent,s=(r-a)/n,l=(r+1+a)/n,u={features:[]};return this._addTileFeatures(i.range((e-a)/n,s,(e+1+a)/n,l),i.points,e,r,n,u),0===e&&this._addTileFeatures(i.range(1-a/n,s,1,l),i.points,n,r,n,u),e===n-1&&this._addTileFeatures(i.range(0,s,a/n,l),i.points,-1,r,n,u),u.features.length?u:null},B.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},B.prototype._appendLeaves=function(t,e,r,i,n){for(var o=0,a=this.getChildren(e);o<a.length;o+=1){var s=a[o],l=s.properties;if(l&&l.cluster?n+l.point_count<=i?n+=l.point_count:n=this._appendLeaves(t,l.cluster_id,r,i,n):n<i?n++:t.push(s),t.length===r)break}return n},B.prototype._addTileFeatures=function(t,e,r,i,n,o){for(var a=0,s=t;a<s.length;a+=1){var l=e[s[a]],u=l.numPoints,c={type:1,geometry:[[Math.round(this.options.extent*(l.x*n-r)),Math.round(this.options.extent*(l.y*n-i))]],tags:u?U(l):this.points[l.index].properties},h=void 0;u?h=l.id:this.options.generateId?h=l.index:this.points[l.index].id&&(h=this.points[l.index].id),void 0!==h&&(c.id=h),o.features.push(c)}},B.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},B.prototype._cluster=function(t,e){for(var r=[],i=this.options,n=i.reduce,o=i.minPoints,a=i.radius/(i.extent*Math.pow(2,e)),s=0;s<t.length;s++){var l=t[s];if(!(l.zoom<=e)){l.zoom=e;for(var u=this.trees[e+1],c=u.within(l.x,l.y,a),h=l.numPoints||1,p=h,d=0,f=c;d<f.length;d+=1){var m=u.points[f[d]];m.zoom>e&&(p+=m.numPoints||1)}if(p>=o){for(var g=l.x*h,y=l.y*h,v=n&&h>1?this._map(l,!0):null,_=(s<<5)+(e+1)+this.points.length,b=0,x=c;b<x.length;b+=1){var w=u.points[x[b]];if(!(w.zoom<=e)){w.zoom=e;var A=w.numPoints||1;g+=w.x*A,y+=w.y*A,w.parentId=_,n&&(v||(v=this._map(l,!0)),n(v,this._map(w)))}}l.parentId=_,r.push(F(g/p,y/p,_,p,v))}else if(r.push(l),p>1)for(var E=0,T=c;E<T.length;E+=1){var S=u.points[T[E]];S.zoom<=e||(S.zoom=e,r.push(S))}}}return r},B.prototype._getOriginId=function(t){return t-this.points.length>>5},B.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},B.prototype._map=function(t,e){if(t.numPoints)return e?G({},t.properties):t.properties;var r=this.points[t.index].properties,i=this.options.map(r);return e&&i===r?G({},i):i},yt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},yt.prototype.splitTile=function(t,e,r,i,n,o,a){for(var s=[t,e,r,i],l=this.options,u=l.debug;s.length;){i=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c=1<<e,h=vt(e,r,i),p=this.tiles[h];if(!p&&(u>1&&console.time("creation"),p=this.tiles[h]=ft(t,e,r,i,l),this.tileCoords.push({z:e,x:r,y:i}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var d="z"+e;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(p.source=t,n){if(e===l.maxZoom||e===n)continue;var f=1<<n-e;if(r!==Math.floor(o/f)||i!==Math.floor(a/f))continue}else if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==t.length){u>1&&console.time("clipping");var m,g,y,v,_,b,x=.5*l.buffer/l.extent,w=.5-x,A=.5+x,E=1+x;m=g=y=v=null,_=rt(t,c,r-x,r+A,0,p.minX,p.maxX,l),b=rt(t,c,r+w,r+E,0,p.minX,p.maxX,l),t=null,_&&(m=rt(_,c,i-x,i+A,1,p.minY,p.maxY,l),g=rt(_,c,i+w,i+E,1,p.minY,p.maxY,l),_=null),b&&(y=rt(b,c,i-x,i+A,1,p.minY,p.maxY,l),v=rt(b,c,i+w,i+E,1,p.minY,p.maxY,l),b=null),u>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*i),s.push(g||[],e+1,2*r,2*i+1),s.push(y||[],e+1,2*r+1,2*i),s.push(v||[],e+1,2*r+1,2*i+1)}}},yt.prototype.getTile=function(t,e,r){var i=this.options,n=i.extent,o=i.debug;if(t<0||t>24)return null;var a=1<<t,s=vt(t,e=(e%a+a)%a,r);if(this.tiles[s])return pt(this.tiles[s],n);o>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,u=t,c=e,h=r;!l&&u>0;)u--,c=Math.floor(c/2),h=Math.floor(h/2),l=this.tiles[vt(u,c,h)];return l&&l.source?(o>1&&console.log("found parent tile z%d-%d-%d",u,c,h),o>1&&console.time("drilling down"),this.splitTile(l.source,u,c,h,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?pt(this.tiles[s],n):null):null};var bt=function(e){function r(t,r,i,n){e.call(this,t,r,i,_t),n&&(this.loadGeoJSON=n)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,i=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var n=!!(i&&i.request&&i.request.collectResourceTiming)&&new t.RequestPerformance(i.request);this.loadGeoJSON(i,(function(o,a){if(o||!a)return r(o);if("object"!=typeof a)return r(new Error("Input data given to '"+i.source+"' is not a valid GeoJSON object."));!function t(e,r){var i,n=e&&e.type;if("FeatureCollection"===n)for(i=0;i<e.features.length;i++)t(e.features[i],r);else if("GeometryCollection"===n)for(i=0;i<e.geometries.length;i++)t(e.geometries[i],r);else if("Feature"===n)t(e.geometry,r);else if("Polygon"===n)h(e.coordinates,r);else if("MultiPolygon"===n)for(i=0;i<e.coordinates.length;i++)h(e.coordinates[i],r);return e}(a,!0);try{e._geoJSONIndex=i.cluster?new B(function(e){var r=e.superclusterOptions,i=e.clusterProperties;if(!i||!r)return r;for(var n={},o={},a={accumulated:null,zoom:0},s={properties:null},l=Object.keys(i),u=0,c=l;u<c.length;u+=1){var h=c[u],p=i[h],d=p[0],f=t.createExpression(p[1]),m=t.createExpression("string"==typeof d?[d,["accumulated"],["get",h]]:d);n[h]=f.value,o[h]=m.value}return r.map=function(t){s.properties=t;for(var e={},r=0,i=l;r<i.length;r+=1){var o=i[r];e[o]=n[o].evaluate(a,s)}return e},r.reduce=function(t,e){s.properties=e;for(var r=0,i=l;r<i.length;r+=1){var n=i[r];a.accumulated=t[n],t[n]=o[n].evaluate(a,s)}},r}(i)).load(a.features):function(t,e){return new yt(t,e)}(a,i.geojsonVtOptions)}catch(o){return r(o)}e.loaded={};var s={};if(n){var l=n.finish();l&&(s.resourceTiming={},s.resourceTiming[i.source]=JSON.parse(JSON.stringify(l)))}r(null,s)}))}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(t,r){var i=this.loaded;return i&&i[t.uid]?e.prototype.reloadTile.call(this,t,r):this.loadTile(t,r)},r.prototype.loadGeoJSON=function(e,r){if(e.request)t.getJSON(e.request,r);else{if("string"!=typeof e.data)return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(e.data))}catch(t){return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},r.prototype.getClusterExpansionZoom=function(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}},r.prototype.getClusterChildren=function(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}},r.prototype.getClusterLeaves=function(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}},r}(l),xt=function(e){var r=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:bt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(r.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');r.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}};return xt.prototype.setReferrer=function(t,e){this.referrer=e},xt.prototype.setImages=function(t,e,r){for(var i in this.availableImages[t]=e,this.workerSources[t]){var n=this.workerSources[t][i];for(var o in n)n[o].availableImages=e}r()},xt.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},xt.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},xt.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},xt.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},xt.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},xt.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},xt.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},xt.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},xt.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var i=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==i.removeSource?i.removeSource(e,r):r()}},xt.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},xt.prototype.syncRTLPluginState=function(e,r,i){try{t.plugin.setState(r);var n=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=n){this.self.importScripts(n);var o=t.plugin.isParsed();i(o?void 0:new Error("RTL Text Plugin failed to import scripts from "+n),o)}}catch(t){i(t.toString())}},xt.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},xt.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new i),e},xt.prototype.getWorkerSource=function(t,e,r){var i=this;return this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),this.workerSources[t][e][r]||(this.workerSources[t][e][r]=new this.workerSourceTypes[e]({send:function(e,r,n){i.actor.send(e,r,n,t)}},this.getLayerIndex(t),this.getAvailableImages(t))),this.workerSources[t][e][r]},xt.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new c),this.demWorkerSources[t][e]},xt.prototype.enforceCacheSizeLimit=function(e,r){t.enforceCacheSizeLimit(r)},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new xt(self)),xt})),i(["./shared"],(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!r(t)}function r(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,r=new Blob([""],{type:"text/javascript"}),i=URL.createObjectURL(r);try{e=new Worker(i),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(i),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var r=e.getImageData(0,0,1,1);return r&&r.width===t.width}()?(void 0===i[r=t&&t.failIfMajorPerformanceCaveat]&&(i[r]=function(t){var r=function(t){var r=document.createElement("canvas"),i=Object.create(e.webGLContextAttributes);return i.failIfMajorPerformanceCaveat=t,r.probablySupportsContext?r.probablySupportsContext("webgl",i)||r.probablySupportsContext("experimental-webgl",i):r.supportsContext?r.supportsContext("webgl",i)||r.supportsContext("experimental-webgl",i):r.getContext("webgl",i)||r.getContext("experimental-webgl",i)}(t);if(!r)return!1;var i=r.createShader(r.VERTEX_SHADER);return!(!i||r.isContextLost())&&(r.shaderSource(i,"void main() {}"),r.compileShader(i),!0===r.getShaderParameter(i,r.COMPILE_STATUS))}(r)),i[r]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var r}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=r);var i={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),r={create:function(e,r,i){var n=t.window.document.createElement(e);return void 0!==r&&(n.className=r),i&&i.appendChild(n),n},createNS:function(e,r){return t.window.document.createElementNS(e,r)}},i=t.window.document&&t.window.document.documentElement.style;function n(t){if(!i)return t[0];for(var e=0;e<t.length;e++)if(t[e]in i)return t[e];return t[0]}var o,a=n(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){i&&a&&(o=i[a],i[a]="none")},r.enableDrag=function(){i&&a&&(i[a]=o)};var s=n(["transform","WebkitTransform"]);r.setTransform=function(t,e){t.style[s]=e};var l=!1;try{var u=Object.defineProperty({},"passive",{get:function(){l=!0}});t.window.addEventListener("test",u,u),t.window.removeEventListener("test",u,u)}catch(t){l=!1}r.addEventListener=function(t,e,r,i){void 0===i&&(i={}),t.addEventListener(e,r,"passive"in i&&l?i:i.capture)},r.removeEventListener=function(t,e,r,i){void 0===i&&(i={}),t.removeEventListener(e,r,"passive"in i&&l?i:i.capture)};var c=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",c,!0)};function h(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}r.suppressClick=function(){t.window.addEventListener("click",c,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",c,!0)}),0)},r.mousePos=function(e,r){var i=e.getBoundingClientRect();return new t.Point(r.clientX-i.left-e.clientLeft,r.clientY-i.top-e.clientTop)},r.touchPos=function(e,r){for(var i=e.getBoundingClientRect(),n=[],o=0;o<r.length;o++)n.push(new t.Point(r[o].clientX-i.left-e.clientLeft,r[o].clientY-i.top-e.clientTop));return n},r.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var p=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e<r.length;e+=1){var i=r[e];this._notify(i.ids,i.callback)}this.requestors=[]}},r.prototype.getImage=function(t){return this.images[t]},r.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e)},r.prototype._validate=function(e,r){var i=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),i=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),i=!1),this._validateContent(r.content,r)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),i=!1),i},r.prototype._validateStretch=function(t,e){if(!t)return!0;for(var r=0,i=0,n=t;i<n.length;i+=1){var o=n[i];if(o[0]<r||o[1]<o[0]||e<o[1])return!1;r=o[1]}return!0},r.prototype._validateContent=function(t,e){return!(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))},r.prototype.updateImage=function(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0},r.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},r.prototype.listImages=function(){return Object.keys(this.images)},r.prototype.getImages=function(t,e){var r=!0;if(!this.isLoaded())for(var i=0,n=t;i<n.length;i+=1)this.images[n[i]]||(r=!1);this.isLoaded()||r?this._notify(t,e):this.requestors.push({ids:t,callback:e})},r.prototype._notify=function(e,r){for(var i={},n=0,o=e;n<o.length;n+=1){var a=o[n];this.images[a]||this.fire(new t.Event("styleimagemissing",{id:a}));var s=this.images[a];s?i[a]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+a+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}r(null,i)},r.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},r.prototype.getPattern=function(e){var r=this.patterns[e],i=this.getImage(e);if(!i)return null;if(r&&r.position.version===i.version)return r.position;if(r)r.position.version=i.version;else{var n={w:i.data.width+2,h:i.data.height+2,x:0,y:0},o=new t.ImagePosition(n,i);this.patterns[e]={bin:n,position:o}}return this._updatePatternAtlas(),this.patterns[e].position},r.prototype.bind=function(e){var r=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)},r.prototype._updatePatternAtlas=function(){var e=[];for(var r in this.patterns)e.push(this.patterns[r].bin);var i=t.potpack(e),n=i.w,o=i.h,a=this.atlasImage;for(var s in a.resize({width:n||1,height:o||1}),this.patterns){var l=this.patterns[s].bin,u=l.x+1,c=l.y+1,h=this.images[s].data,p=h.width,d=h.height;t.RGBAImage.copy(h,a,{x:0,y:0},{x:u,y:c},{width:p,height:d}),t.RGBAImage.copy(h,a,{x:0,y:d-1},{x:u,y:c-1},{width:p,height:1}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:u,y:c+d},{width:p,height:1}),t.RGBAImage.copy(h,a,{x:p-1,y:0},{x:u-1,y:c},{width:1,height:d}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:u+p,y:c},{width:1,height:d})}this.dirty=!0},r.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},r.prototype.dispatchRenderCallbacks=function(t){for(var e=0,r=t;e<r.length;e+=1){var i=r[e];if(!this.callbackDispatchedThisFrame[i]){this.callbackDispatchedThisFrame[i]=!0;var n=this.images[i];h(n)&&this.updateImage(i,n)}}},r}(t.Evented),d=g,f=g,m=1e20;function g(t,e,r,i,n,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=i||.25,this.fontFamily=n||"sans-serif",this.fontWeight=o||"normal",this.radius=r||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function y(t,e,r,i,n,o,a){for(var s=0;s<e;s++){for(var l=0;l<r;l++)i[l]=t[l*e+s];for(v(i,n,o,a,r),l=0;l<r;l++)t[l*e+s]=n[l]}for(l=0;l<r;l++){for(s=0;s<e;s++)i[s]=t[l*e+s];for(v(i,n,o,a,e),s=0;s<e;s++)t[l*e+s]=Math.sqrt(n[s])}}function v(t,e,r,i,n){r[0]=0,i[0]=-m,i[1]=+m;for(var o=1,a=0;o<n;o++){for(var s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);s<=i[a];)a--,s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);r[++a]=o,i[a]=s,i[a+1]=+m}for(o=0,a=0;o<n;o++){for(;i[a+1]<o;)a++;e[o]=(o-r[a])*(o-r[a])+t[r[a]]}}g.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),i=0;i<this.size*this.size;i++){var n=e.data[4*i+3]/255;this.gridOuter[i]=1===n?0:0===n?m:Math.pow(Math.max(0,.5-n),2),this.gridInner[i]=1===n?m:0===n?0:Math.pow(Math.max(0,n-.5),2)}for(y(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),y(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),i=0;i<this.size*this.size;i++)r[i]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[i]-this.gridInner[i])/this.radius+this.cutoff))));return r},d.default=f;var _=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};_.prototype.setURL=function(t){this.url=t},_.prototype.getGlyphs=function(e,r){var i=this,n=[];for(var o in e)for(var a=0,s=e[o];a<s.length;a+=1)n.push({stack:o,id:s[a]});t.asyncAll(n,(function(t,e){var r=t.stack,n=t.id,o=i.entries[r];o||(o=i.entries[r]={glyphs:{},requests:{},ranges:{}});var a=o.glyphs[n];if(void 0===a){if(a=i._tinySDF(o,r,n))return o.glyphs[n]=a,void e(null,{stack:r,id:n,glyph:a});var s=Math.floor(n/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[s])e(null,{stack:r,id:n,glyph:a});else{var l=o.requests[s];l||(l=o.requests[s]=[],_.loadGlyphRange(r,s,i.url,i.requestManager,(function(t,e){if(e){for(var r in e)i._doesCharSupportLocalGlyph(+r)||(o.glyphs[+r]=e[+r]);o.ranges[s]=!0}for(var n=0,a=l;n<a.length;n+=1)(0,a[n])(t,e);delete o.requests[s]}))),l.push((function(t,i){t?e(t):i&&e(null,{stack:r,id:n,glyph:i[n]||null})}))}}else e(null,{stack:r,id:n,glyph:a})}),(function(t,e){if(t)r(t);else if(e){for(var i={},n=0,o=e;n<o.length;n+=1){var a=o[n],s=a.stack,l=a.id,u=a.glyph;(i[s]||(i[s]={}))[l]=u&&{id:u.id,bitmap:u.bitmap.clone(),metrics:u.metrics}}r(null,i)}}))},_.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},_.prototype._tinySDF=function(e,r,i){var n=this.localIdeographFontFamily;if(n&&this._doesCharSupportLocalGlyph(i)){var o=e.tinySDF;if(!o){var a="400";/bold/i.test(r)?a="900":/medium/i.test(r)?a="500":/light/i.test(r)&&(a="200"),o=e.tinySDF=new _.TinySDF(24,3,8,.25,n,a)}return{id:i,bitmap:new t.AlphaImage({width:30,height:30},o.draw(String.fromCharCode(i))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},_.loadGlyphRange=function(e,r,i,n,o){var a=256*r,s=a+255,l=n.transformRequest(n.normalizeGlyphsURL(i).replace("{fontstack}",e).replace("{range}",a+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(l,(function(e,r){if(e)o(e);else if(r){for(var i={},n=0,a=t.parseGlyphPBF(r);n<a.length;n+=1){var s=a[n];i[s.id]=s}o(null,i)}}))},_.TinySDF=d;var b=function(){this.specification=t.styleSpec.light.position};b.prototype.possiblyEvaluate=function(e,r){return t.sphericalToCartesian(e.expression.evaluate(r))},b.prototype.interpolate=function(e,r,i){return{x:t.number(e.x,r.x,i),y:t.number(e.y,r.y,i),z:t.number(e.z,r.z,i)}};var x=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new b,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),w=function(e){function r(r){e.call(this),this._transitionable=new t.Transitionable(x),this.setLight(r),this._transitioning=this._transitionable.untransitioned()}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getLight=function(){return this._transitionable.serialize()},r.prototype.setLight=function(e,r){if(void 0===r&&(r={}),!this._validate(t.validateLight,e,r))for(var i in e){var n=e[i];t.endsWith(i,"-transition")?this._transitionable.setTransition(i.slice(0,-11),n):this._transitionable.setValue(i,n)}},r.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},r.prototype.hasTransition=function(){return this._transitioning.hasTransition()},r.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},r.prototype._validate=function(e,r,i){return(!i||!1!==i.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},r}(t.Evented),A=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};A.prototype.getDash=function(t,e){var r=t.join(",")+String(e);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(t,e)),this.dashEntry[r]},A.prototype.getDashRanges=function(t,e,r){var i=[],n=t.length%2==1?-t[t.length-1]*r:0,o=t[0]*r,a=!0;i.push({left:n,right:o,isDash:a,zeroLength:0===t[0]});for(var s=t[0],l=1;l<t.length;l++){var u=t[l];i.push({left:n=s*r,right:o=(s+=u)*r,isDash:a=!a,zeroLength:0===u})}return i},A.prototype.addRoundDash=function(t,e,r){for(var i=e/2,n=-r;n<=r;n++)for(var o=this.width*(this.nextRow+r+n),a=0,s=t[a],l=0;l<this.width;l++){l/s.right>1&&(s=t[++a]);var u=Math.abs(l-s.left),c=Math.abs(l-s.right),h=Math.min(u,c),p=void 0,d=n/r*(i+1);if(s.isDash){var f=i-Math.abs(d);p=Math.sqrt(h*h+f*f)}else p=i-Math.sqrt(h*h+d*d);this.data[o+l]=Math.max(0,Math.min(255,p+128))}},A.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],i=t[e+1];r.zeroLength?t.splice(e,1):i&&i.isDash===r.isDash&&(i.left=r.left,t.splice(e,1))}var n=t[0],o=t[t.length-1];n.isDash===o.isDash&&(n.left=o.left-this.width,o.right=n.right+this.width);for(var a=this.width*this.nextRow,s=0,l=t[s],u=0;u<this.width;u++){u/l.right>1&&(l=t[++s]);var c=Math.abs(u-l.left),h=Math.abs(u-l.right),p=Math.min(c,h);this.data[a+u]=Math.max(0,Math.min(255,(l.isDash?p:-p)+128))}},A.prototype.addDash=function(e,r){var i=r?7:0,n=2*i+1;if(this.nextRow+n>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a<e.length;a++)o+=e[a];if(0!==o){var s=this.width/o,l=this.getDashRanges(e,this.width,s);r?this.addRoundDash(l,s,i):this.addRegularDash(l)}var u={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:o};return this.nextRow+=n,this.dirty=!0,u},A.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))};var E=function e(r,i){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var n=this.workerPool.acquire(this.id),o=0;o<n.length;o++){var a=new e.Actor(n[o],i,this.id);a.name="Worker "+o,this.actors.push(a)}};function T(e,r,i){var n=function(n,o){if(n)return i(n);if(o){var a=t.pick(t.extend(o,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);o.vector_layers&&(a.vectorLayers=o.vector_layers,a.vectorLayerIds=a.vectorLayers.map((function(t){return t.id}))),a.tiles=r.canonicalizeTileset(a,e.url),i(null,a)}};return e.url?t.getJSON(r.transformRequest(r.normalizeSourceURL(e.url),t.ResourceType.Source),n):t.browser.frame((function(){return n(null,e)}))}E.prototype.broadcast=function(e,r,i){t.asyncAll(this.actors,(function(t,i){t.send(e,r,i)}),i=i||function(){})},E.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},E.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},E.Actor=t.Actor;var S=function(e,r,i){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=i||24};S.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},S.prototype.contains=function(e){var r=Math.pow(2,e.z),i=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*r),n=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*r),o=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*r),a=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*r);return e.x>=i&&e.x<o&&e.y>=n&&e.y<a};var P=function(e){function r(r,i,n,o){if(e.call(this),this.id=r,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(i,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(o)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=T(this._options,this.map._requestManager,(function(r,i){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new S(i.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(i.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(i.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.loadTile=function(e,r){var i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme)),n={request:this.map._requestManager.transformRequest(i,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function o(i,n){return delete e.request,e.aborted?r(null):i&&404!==i.status?r(i):(n&&n.resourceTiming&&(e.resourceTiming=n.resourceTiming),this.map._refreshExpiredTiles&&n&&e.setExpiryData(n),e.loadVectorData(n,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}n.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=r:e.request=e.actor.send("reloadTile",n,o.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",n,o.bind(this)))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.hasTransition=function(){return!1},r}(t.Evented),I=function(e){function r(r,i,n,o){e.call(this),this.id=r,this.dispatcher=n,this.setEventedParent(o),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},i),t.extend(this,t.pick(i,["url","scheme","tileSize"]))}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=T(this._options,this.map._requestManager,(function(r,i){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new S(i.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(i.tiles),t.postMapLoadEvent(i.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.loadTile=function(e,r){var i=this,n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(n,t.ResourceType.Tile),(function(n,o){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(n)e.state="errored",r(n);else if(o){i.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var a=i.map.painter.context,s=a.gl;e.texture=i.map.painter.getTileTexture(o.width),e.texture?e.texture.update(o,{useMipmap:!0}):(e.texture=new t.Texture(a,o,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),a.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(i.dispatcher),r(null)}}))},r.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},r.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},r.prototype.hasTransition=function(){return!1},r}(t.Evented),M=function(e){function r(r,i,n,o){e.call(this,r,i,n,o),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox"}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},r.prototype.loadTile=function(e,r){var i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function n(t,i){t&&(e.state="errored",r(t)),i&&(e.dem=i,e.needsHillshadePrepare=!0,e.state="loaded",r(null))}e.request=t.getImage(this.map._requestManager.transformRequest(i,t.ResourceType.Tile),function(i,o){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(i)e.state="errored",r(i);else if(o){this.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var a=t.window.ImageBitmap&&o instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?o:t.browser.getImageData(o,1),s={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:a,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",s,n.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},r.prototype._getNeighboringTiles=function(e){var r=e.canonical,i=Math.pow(2,r.z),n=(r.x-1+i)%i,o=0===r.x?e.wrap-1:e.wrap,a=(r.x+1+i)%i,s=r.x+1===i?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,o,r.z,n,r.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y).key]={backfilled:!1},r.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,o,r.z,n,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+1<i&&(l[new t.OverscaledTileID(e.overscaledZ,o,r.z,n,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y+1).key]={backfilled:!1}),l},r.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},r}(I),C=function(e){function r(r,i,n,o){e.call(this),this.id=r,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=n.getActor(),this.setEventedParent(o),this._data=i.data,this._options=t.extend({},i),this._collectResourceTiming=i.collectResourceTiming,this._resourceTiming=[],void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;var a=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*a,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*a,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?Math.min(i.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:t.EXTENT,radius:(i.clusterRadius||50)*a,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties},i.workerOptions)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(r){if(r)e.fire(new t.ErrorEvent(r));else{var i={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(i.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",i))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var i={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(i.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",i))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,i){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},i),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var i=t.extend({},this.workerOptions),n=this._data;"string"==typeof n?(i.request=this.map._requestManager.transformRequest(t.browser.resolveURL(n),t.ResourceType.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(n),this.actor.send(this.type+".loadData",i,(function(t,n){r._removed||n&&n.abandoned||(r._loaded=!0,n&&n.resourceTiming&&n.resourceTiming[r.id]&&(r._resourceTiming=n.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:i.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var i=this,n=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(n,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,o){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(o,i.map.painter,"reloadTile"===n),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),k=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),L=function(e){function r(t,r,i,n){e.call(this),this.id=t,this.dispatcher=i,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(e,r){var i=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(n,o){i._loaded=!0,n?i.fire(new t.ErrorEvent(n)):o&&(i.image=o,e&&(i.coordinates=e),r&&r(),i._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var i=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,i=1/0,n=-1/0,o=-1/0,a=0,s=e;a<s.length;a+=1){var l=s[a];r=Math.min(r,l.x),i=Math.min(i,l.y),n=Math.max(n,l.x),o=Math.max(o,l.y)}var u=Math.max(n-r,o-i),c=Math.max(0,Math.floor(-Math.log(u)/Math.LN2)),h=Math.pow(2,c);return new t.CanonicalTileID(c,Math.floor((r+n)/2*h),Math.floor((i+o)/2*h))}(i),this.minzoom=this.maxzoom=this.tileID.z;var n=i.map((function(t){return r.tileID.getTilePoint(t)._round()}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(n[2].x,n[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,r=e.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,k.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var n=this.tiles[i];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},r.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(t.Evented),z=function(e){function r(t,r,i,n){e.call(this,t,r,i,n),this.roundZoom=!0,this.type="video",this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1;var r=this.options;this.urls=[];for(var i=0,n=r.urls;i<n.length;i+=1)this.urls.push(this.map._requestManager.transformRequest(n[i],t.ResourceType.Source).url);t.getVideo(this.urls,(function(r,i){e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):i&&(e.video=i,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint()})),e.map&&e.video.play(),e._finishLoading())}))},r.prototype.pause=function(){this.video&&this.video.pause()},r.prototype.play=function(){this.video&&this.video.play()},r.prototype.seek=function(e){if(this.video){var r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,k.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var n=this.tiles[i];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(L),R=function(e){function r(r,i,n,o){e.call(this,r,i,n,o),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,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 t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.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())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,i=r.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,k.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,i.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[n];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var r=e[t];if(isNaN(r)||r<=0)return!0}return!1},r}(L),O={vector:P,raster:I,"raster-dem":M,geojson:C,video:z,image:L,canvas:R};function D(e,r){var i=t.identity([]);return t.translate(i,i,[1,1,0]),t.scale(i,i,[.5*e.width,.5*e.height,1]),t.multiply(i,i,e.calculatePosMatrix(r.toUnwrapped()))}function B(t,e,r,i,n,o){var a=function(t,e,r){if(t)for(var i=0,n=t;i<n.length;i+=1){var o=e[n[i]];if(o&&o.source===r&&"fill-extrusion"===o.type)return!0}else for(var a in e){var s=e[a];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(n&&n.layers,e,t.id),s=o.maxPitchScaleFactor(),l=t.tilesIn(i,s,a);l.sort(F);for(var u=[],c=0,h=l;c<h.length;c+=1){var p=h[c];u.push({wrappedTileID:p.tileID.wrapped().key,queryResults:p.tile.queryRenderedFeatures(e,r,t._state,p.queryGeometry,p.cameraQueryGeometry,p.scale,n,o,s,D(t.transform,p.tileID))})}var d=function(t){for(var e={},r={},i=0,n=t;i<n.length;i+=1){var o=n[i],a=o.queryResults,s=o.wrappedTileID,l=r[s]=r[s]||{};for(var u in a)for(var c=a[u],h=l[u]=l[u]||{},p=e[u]=e[u]||[],d=0,f=c;d<f.length;d+=1){var m=f[d];h[m.featureIndex]||(h[m.featureIndex]=!0,p.push(m))}}return e}(u);for(var f in d)d[f].forEach((function(e){var r=e.feature,i=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=i}));return d}function F(t,e){var r=t.tileID,i=e.tileID;return r.overscaledZ-i.overscaledZ||r.canonical.y-i.canonical.y||r.wrap-i.wrap||r.canonical.x-i.canonical.x}var j=function(t,e){this.max=t,this.onRemove=e,this.reset()};j.prototype.reset=function(){for(var t in this.data)for(var e=0,r=this.data[t];e<r.length;e+=1){var i=r[e];i.timeout&&clearTimeout(i.timeout),this.onRemove(i.value)}return this.data={},this.order=[],this},j.prototype.add=function(t,e,r){var i=this,n=t.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);var o={value:e,timeout:void 0};if(void 0!==r&&(o.timeout=setTimeout((function(){i.remove(t,o)}),r)),this.data[n].push(o),this.order.push(n),this.order.length>this.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},j.prototype.has=function(t){return t.wrapped().key in this.data},j.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},j.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},j.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},j.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},j.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,i=void 0===e?0:this.data[r].indexOf(e),n=this.data[r][i];return this.data[r].splice(i,1),n.timeout&&clearTimeout(n.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(n.value),this.order.splice(this.order.indexOf(r),1),this},j.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},j.prototype.filter=function(t){var e=[];for(var r in this.data)for(var i=0,n=this.data[r];i<n.length;i+=1){var o=n[i];t(o.value)||e.push(o)}for(var a=0,s=e;a<s.length;a+=1){var l=s[a];this.remove(l.value.tileID,l)}};var N=function(t,e,r){this.context=t;var i=t.gl;this.buffer=i.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};N.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},N.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},N.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var U={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},V=function(t,e,r,i){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=i,this.context=t;var n=t.gl;this.buffer=n.createBuffer(),t.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};V.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},V.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},V.prototype.enableAttributes=function(t,e){for(var r=0;r<this.attributes.length;r++){var i=e.attributes[this.attributes[r].name];void 0!==i&&t.enableVertexAttribArray(i)}},V.prototype.setVertexAttribPointers=function(t,e,r){for(var i=0;i<this.attributes.length;i++){var n=this.attributes[i],o=e.attributes[n.name];void 0!==o&&t.vertexAttribPointer(o,n.components,t[U[n.type]],!1,this.itemSize,n.offset+this.itemSize*(r||0))}},V.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var q=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};q.prototype.get=function(){return this.current},q.prototype.set=function(t){},q.prototype.getDefault=function(){return this.default},q.prototype.setDefault=function(){this.set(this.default)};var G=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(q),Z=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},e}(q),W=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},e}(q),H=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[!0,!0,!0,!0]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(q),X=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}(q),Y=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}(q),K=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},e}(q),J=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},e}(q),Q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},e}(q),$=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[0,1]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},e}(q),tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},e}(q),et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(q),rt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},e}(q),it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},e}(q),nt=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(q),ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},e}(q),at=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}(q),st=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(q),lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(q),ut=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}(q),ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(q),ht=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(q),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},e}(q),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(q),ft=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}(q),mt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}(q),gt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(q),yt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},e}(q),vt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},e}(q),_t=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},e}(q),bt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}(q),xt=function(t){function e(e,r){t.call(this,e),this.context=e,this.parent=r}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e}(q),wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.setDirty=function(){this.dirty=!0},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e}(xt),At=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(xt),Et=function(t,e,r,i){this.context=t,this.width=e,this.height=r;var n=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new wt(t,n),i&&(this.depthAttachment=new At(t,n))};Et.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var r=this.depthAttachment.get();r&&t.deleteRenderbuffer(r)}t.deleteFramebuffer(this.framebuffer)};var Tt=function(t,e,r){this.func=t,this.mask=e,this.range=r};Tt.ReadOnly=!1,Tt.ReadWrite=!0,Tt.disabled=new Tt(519,Tt.ReadOnly,[0,1]);var St=function(t,e,r,i,n,o){this.test=t,this.ref=e,this.mask=r,this.fail=i,this.depthFail=n,this.pass=o};St.disabled=new St({func:519,mask:0},0,0,7680,7680,7680);var Pt=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};Pt.disabled=new Pt(Pt.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),Pt.unblended=new Pt(Pt.Replace,t.Color.transparent,[!0,!0,!0,!0]),Pt.alphaBlended=new Pt([1,771],t.Color.transparent,[!0,!0,!0,!0]);var It=function(t,e,r){this.enable=t,this.mode=e,this.frontFace=r};It.disabled=new It(!1,1029,2305),It.backCCW=new It(!0,1029,2305);var Mt=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new G(this),this.clearDepth=new Z(this),this.clearStencil=new W(this),this.colorMask=new H(this),this.depthMask=new X(this),this.stencilMask=new Y(this),this.stencilFunc=new K(this),this.stencilOp=new J(this),this.stencilTest=new Q(this),this.depthRange=new $(this),this.depthTest=new tt(this),this.depthFunc=new et(this),this.blend=new rt(this),this.blendFunc=new it(this),this.blendColor=new nt(this),this.blendEquation=new ot(this),this.cullFace=new at(this),this.cullFaceSide=new st(this),this.frontFace=new lt(this),this.program=new ut(this),this.activeTexture=new ct(this),this.viewport=new ht(this),this.bindFramebuffer=new pt(this),this.bindRenderbuffer=new dt(this),this.bindTexture=new ft(this),this.bindVertexBuffer=new mt(this),this.bindElementBuffer=new gt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new yt(this),this.pixelStoreUnpack=new vt(this),this.pixelStoreUnpackPremultiplyAlpha=new _t(this),this.pixelStoreUnpackFlipY=new bt(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(t.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query")};Mt.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Mt.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Mt.prototype.createIndexBuffer=function(t,e){return new N(this,t,e)},Mt.prototype.createVertexBuffer=function(t,e,r){return new V(this,t,e,r)},Mt.prototype.createRenderbuffer=function(t,e,r){var i=this.gl,n=i.createRenderbuffer();return this.bindRenderbuffer.set(n),i.renderbufferStorage(i.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),n},Mt.prototype.createFramebuffer=function(t,e,r){return new Et(this,t,e,r)},Mt.prototype.clear=function(t){var e=t.color,r=t.depth,i=this.gl,n=0;e&&(n|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(n|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),i.clear(n)},Mt.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},Mt.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},Mt.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},Mt.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,Pt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},Mt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Ct=function(e){function r(r,i,n){var o=this;e.call(this),this.id=r,this.dispatcher=n,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(o._sourceLoaded=!0),o._sourceLoaded&&!o._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(o.reload(),o.transform&&o.update(o.transform))})),this.on("error",(function(){o._sourceErrored=!0})),this._source=function(e,r,i,n){var o=new O[r.type](e,r,i,n);if(o.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+o.id);return t.bindAll(["load","abort","unload","serialize","prepare"],o),o}(r,i,n,this),this._tiles={},this._cache=new j(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},r.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},r.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},r.prototype.getSource=function(){return this._source},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},r.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},r.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},r.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},r.prototype.serialize=function(){return this._source.serialize()},r.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}},r.prototype.getIds=function(){return t.values(this._tiles).map((function(t){return t.tileID})).sort(kt).map((function(t){return t.key}))},r.prototype.getRenderableIds=function(e){var r=this,i=[];for(var n in this._tiles)this._isIdRenderable(n,e)&&i.push(this._tiles[n]);return e?i.sort((function(e,i){var n=e.tileID,o=i.tileID,a=new t.Point(n.canonical.x,n.canonical.y)._rotate(r.transform.angle),s=new t.Point(o.canonical.x,o.canonical.y)._rotate(r.transform.angle);return n.overscaledZ-o.overscaledZ||s.y-a.y||s.x-a.x})).map((function(t){return t.tileID.key})):i.map((function(t){return t.tileID})).sort(kt).map((function(t){return t.key}))},r.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},r.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},r.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},r.prototype._reloadTile=function(t,e){var r=this._tiles[t];r&&("loading"!==r.state&&(r.state=e),this._loadTile(r,this._tileLoaded.bind(this,r,t,e)))},r.prototype._tileLoaded=function(e,r,i,n){if(n)return e.state="errored",void(404!==n.status?this._source.fire(new t.ErrorEvent(n,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===i&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},r.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),r=0;r<e.length;r++){var i=e[r];if(t.neighboringTiles&&t.neighboringTiles[i]){var n=this.getTileByID(i);o(t,n),o(n,t)}}function o(t,e){t.needsHillshadePrepare=!0;var r=e.tileID.canonical.x-t.tileID.canonical.x,i=e.tileID.canonical.y-t.tileID.canonical.y,n=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===r&&0===i||Math.abs(i)>1||(Math.abs(r)>1&&(1===Math.abs(r+n)?r+=n:1===Math.abs(r-n)&&(r-=n)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,i),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,i){for(var n in this._tiles){var o=this._tiles[n];if(!(i[n]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>r)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var l=a;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){i[a.key]=a;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var i=t.overscaledZ-1;i>=e;i--){var n=t.scaledTo(i),o=this._getLoadedTile(n);if(o)return o}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,i=Math.floor(e*r*5),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var r={};for(var i in this._tiles){var n=this._tiles[i];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),r[n.tileID.key]=n}for(var o in this._tiles=r,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},r.prototype.update=function(e){var i=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var n;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?n=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(n=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(n=n.filter((function(t){return i._source.hasTile(t)})))):n=[];var o=e.coveringZoomLevel(this._source),a=Math.max(o-r.maxOverzooming,this._source.minzoom),s=Math.max(o+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(n,o);if(Lt(this._source.type)){for(var u={},c={},h=0,p=Object.keys(l);h<p.length;h+=1){var d=p[h],f=l[d],m=this._tiles[d];if(m&&!(m.fadeEndTime&&m.fadeEndTime<=t.browser.now())){var g=this.findLoadedParent(f,a);g&&(this._addTile(g.tileID),u[g.tileID.key]=g.tileID),c[d]=f}}for(var y in this._retainLoadedChildren(c,o,s,l),u)l[y]||(this._coveredTiles[y]=!0,l[y]=u[y])}for(var v in l)this._tiles[v].clearFadeHold();for(var _=0,b=t.keysDifference(this._tiles,l);_<b.length;_+=1){var x=b[_],w=this._tiles[x];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(x)}this._updateLoadedParentTileCache()}},r.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},r.prototype._updateRetainedTiles=function(t,e){for(var i={},n={},o=Math.max(e-r.maxOverzooming,this._source.minzoom),a=Math.max(e+r.maxUnderzooming,this._source.minzoom),s={},l=0,u=t;l<u.length;l+=1){var c=u[l],h=this._addTile(c);i[c.key]=c,h.hasData()||e<this._source.maxzoom&&(s[c.key]=c)}this._retainLoadedChildren(s,e,a,i);for(var p=0,d=t;p<d.length;p+=1){var f=d[p],m=this._tiles[f.key];if(!m.hasData()){if(e+1>this._source.maxzoom){var g=f.children(this._source.maxzoom)[0],y=this.getTile(g);if(y&&y.hasData()){i[g.key]=g;continue}}else{var v=f.children(this._source.maxzoom);if(i[v[0].key]&&i[v[1].key]&&i[v[2].key]&&i[v[3].key])continue}for(var _=m.wasRequested(),b=f.overscaledZ-1;b>=o;--b){var x=f.scaledTo(b);if(n[x.key])break;if(n[x.key]=!0,!(m=this.getTile(x))&&_&&(m=this._addTile(x)),m&&(i[x.key]=x,_=m.wasRequested(),m.hasData()))break}}}return i},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,i=this._tiles[t].tileID;i.overscaledZ>0;){if(i.key in this._loadedParentTiles){r=this._loadedParentTiles[i.key];break}e.push(i.key);var n=i.scaledTo(i.overscaledZ-1);if(r=this._getLoadedTile(n))break;i=n}for(var o=0,a=e;o<a.length;o+=1)this._loadedParentTiles[a[o]]=r}},r.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));var i=Boolean(r);return i||(r=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,i||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout((function(){r._reloadTile(t,"expired"),delete r._timers[t]}),i))},r.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,i){var n=this,o=[],a=this.transform;if(!a)return o;for(var s=i?a.getCameraQueryGeometry(e):e,l=e.map((function(t){return a.pointCoordinate(t)})),u=s.map((function(t){return a.pointCoordinate(t)})),c=this.getIds(),h=1/0,p=1/0,d=-1/0,f=-1/0,m=0,g=u;m<g.length;m+=1){var y=g[m];h=Math.min(h,y.x),p=Math.min(p,y.y),d=Math.max(d,y.x),f=Math.max(f,y.y)}for(var v=function(e){var i=n._tiles[c[e]];if(!i.holdingForFade()){var s=i.tileID,m=Math.pow(2,a.zoom-i.tileID.overscaledZ),g=r*i.queryPadding*t.EXTENT/i.tileSize/m,y=[s.getTilePoint(new t.MercatorCoordinate(h,p)),s.getTilePoint(new t.MercatorCoordinate(d,f))];if(y[0].x-g<t.EXTENT&&y[0].y-g<t.EXTENT&&y[1].x+g>=0&&y[1].y+g>=0){var v=l.map((function(t){return s.getTilePoint(t)})),_=u.map((function(t){return s.getTilePoint(t)}));o.push({tile:i,tileID:s,queryGeometry:v,cameraQueryGeometry:_,scale:m})}}},_=0;_<c.length;_++)v(_);return o},r.prototype.getVisibleCoordinates=function(t){for(var e=this,r=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),i=0,n=r;i<n.length;i+=1){var o=n[i];o.posMatrix=this.transform.calculatePosMatrix(o.toUnwrapped())}return r},r.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Lt(this._source.type))for(var e in this._tiles){var r=this._tiles[e];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)},r.prototype.removeFeatureState=function(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)},r.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},r.prototype.setDependencies=function(t,e,r){var i=this._tiles[t];i&&i.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function kt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),i=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||i-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Lt(t){return"raster"===t||"image"===t||"video"===t}function zt(){return new t.window.Worker(Xn.workerUrl)}Ct.maxOverzooming=10,Ct.maxUnderzooming=3;var Rt="mapboxgl_preloaded_worker_pool",Ot=function(){this.active={}};Ot.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Ot.workerCount;)this.workers.push(new zt);return this.active[t]=!0,this.workers.slice()},Ot.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)},Ot.prototype.isPreloaded=function(){return!!this.active[Rt]},Ot.prototype.numActive=function(){return Object.keys(this.active).length};var Dt,Bt=Math.floor(t.browser.hardwareConcurrency/2);function Ft(){return Dt||(Dt=new Ot),Dt}function jt(e,r){var i={};for(var n in e)"ref"!==n&&(i[n]=e[n]);return t.refProperties.forEach((function(t){t in r&&(i[t]=r[t])})),i}function Nt(t){t=t.slice();for(var e=Object.create(null),r=0;r<t.length;r++)e[t[r].id]=t[r];for(var i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=jt(t[i],e[t[i].ref]));return t}Ot.workerCount=Math.max(Math.min(Bt,6),1);var Ut={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Vt(t,e,r){r.push({command:Ut.addSource,args:[t,e[t]]})}function qt(t,e,r){e.push({command:Ut.removeSource,args:[t]}),r[t]=!0}function Gt(t,e,r,i){qt(t,r,i),Vt(t,e,r)}function Zt(e,r,i){var n;for(n in e[i])if(e[i].hasOwnProperty(n)&&"data"!==n&&!t.deepEqual(e[i][n],r[i][n]))return!1;for(n in r[i])if(r[i].hasOwnProperty(n)&&"data"!==n&&!t.deepEqual(e[i][n],r[i][n]))return!1;return!0}function Wt(e,r,i,n,o,a){var s;for(s in r=r||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||i.push({command:a,args:[n,s,r[s],o]}));for(s in r)r.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||i.push({command:a,args:[n,s,r[s],o]}))}function Ht(t){return t.id}function Xt(t,e){return t[e.id]=e,t}var Yt=function(t,e){this.reset(t,e)};Yt.prototype.reset=function(t,e){this.points=t||[],this._distances=[0];for(var r=1;r<this.points.length;r++)this._distances[r]=this._distances[r-1]+this.points[r].dist(this.points[r-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Yt.prototype.lerp=function(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);for(var r=1,i=this._distances[r],n=e*this.paddedLength+this.padding;i<n&&r<this._distances.length;)i=this._distances[++r];var o=r-1,a=this._distances[o],s=i-a,l=s>0?(n-a)/s:0;return this.points[o].mult(1-l).add(this.points[r].mult(l))};var Kt=function(t,e,r){var i=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var o=0;o<this.xCellCount*this.yCellCount;o++)i.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};function Jt(e,r,i,n,o){var a=t.create();return r?(t.scale(a,a,[1/o,1/o,1]),i||t.rotateZ(a,a,n.angle)):t.multiply(a,n.labelPlaneMatrix,e),a}function Qt(e,r,i,n,o){if(r){var a=t.clone(e);return t.scale(a,a,[o,o,1]),i||t.rotateZ(a,a,-n.angle),a}return n.glCoordMatrix}function $t(e,r){var i=[e.x,e.y,0,1];ce(i,i,r);var n=i[3];return{point:new t.Point(i[0]/n,i[1]/n),signedDistanceFromCamera:n}}function te(t,e){return.5+t/e*.5}function ee(t,e){var r=t[0]/t[3],i=t[1]/t[3];return r>=-e[0]&&r<=e[0]&&i>=-e[1]&&i<=e[1]}function re(e,r,i,n,o,a,s,l){var u=n?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(u,i.transform.zoom),h=[256/i.width*2+1,256/i.height*2+1],p=n?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var d=e.lineVertexArray,f=n?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=i.transform.width/i.transform.height,g=!1,y=0;y<f.length;y++){var v=f.get(y);if(v.hidden||v.writingMode===t.WritingMode.vertical&&!g)ue(v.numGlyphs,p);else{g=!1;var _=[v.anchorX,v.anchorY,0,1];if(t.transformMat4(_,_,r),ee(_,h)){var b=te(i.transform.cameraToCenterDistance,_[3]),x=t.evaluateSizeForFeature(u,c,v),w=s?x/b:x*b,A=new t.Point(v.anchorX,v.anchorY),E=$t(A,o).point,T={},S=oe(v,w,!1,l,r,o,a,e.glyphOffsetArray,d,p,E,A,T,m);g=S.useVertical,(S.notEnoughRoom||g||S.needsFlipping&&oe(v,w,!0,l,r,o,a,e.glyphOffsetArray,d,p,E,A,T,m).notEnoughRoom)&&ue(v.numGlyphs,p)}else ue(v.numGlyphs,p)}}n?e.text.dynamicLayoutVertexBuffer.updateData(p):e.icon.dynamicLayoutVertexBuffer.updateData(p)}function ie(t,e,r,i,n,o,a,s,l,u,c){var h=s.glyphStartIndex+s.numGlyphs,p=s.lineStartIndex,d=s.lineStartIndex+s.lineLength,f=e.getoffsetX(s.glyphStartIndex),m=e.getoffsetX(h-1),g=se(t*f,r,i,n,o,a,s.segment,p,d,l,u,c);if(!g)return null;var y=se(t*m,r,i,n,o,a,s.segment,p,d,l,u,c);return y?{first:g,last:y}:null}function ne(e,r,i,n){return e===t.WritingMode.horizontal&&Math.abs(i.y-r.y)>Math.abs(i.x-r.x)*n?{useVertical:!0}:(e===t.WritingMode.vertical?r.y<i.y:r.x>i.x)?{needsFlipping:!0}:null}function oe(e,r,i,n,o,a,s,l,u,c,h,p,d,f){var m,g=r/24,y=e.lineOffsetX*g,v=e.lineOffsetY*g;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,b=e.lineStartIndex,x=e.lineStartIndex+e.lineLength,w=ie(g,l,y,v,i,h,p,e,u,a,d);if(!w)return{notEnoughRoom:!0};var A=$t(w.first.point,s).point,E=$t(w.last.point,s).point;if(n&&!i){var T=ne(e.writingMode,A,E,f);if(T)return T}m=[w.first];for(var S=e.glyphStartIndex+1;S<_-1;S++)m.push(se(g*l.getoffsetX(S),y,v,i,h,p,e.segment,b,x,u,a,d));m.push(w.last)}else{if(n&&!i){var P=$t(p,o).point,I=e.lineStartIndex+e.segment+1,M=new t.Point(u.getx(I),u.gety(I)),C=$t(M,o),k=C.signedDistanceFromCamera>0?C.point:ae(p,M,P,1,o),L=ne(e.writingMode,P,k,f);if(L)return L}var z=se(g*l.getoffsetX(e.glyphStartIndex),y,v,i,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,u,a,d);if(!z)return{notEnoughRoom:!0};m=[z]}for(var R=0,O=m;R<O.length;R+=1){var D=O[R];t.addDynamicAttributes(c,D.point,D.angle)}return{}}function ae(t,e,r,i,n){var o=$t(t.add(t.sub(e)._unit()),n).point,a=r.sub(o);return r.add(a._mult(i/a.mag()))}function se(e,r,i,n,o,a,s,l,u,c,h,p){var d=n?e-r:e+r,f=d>0?1:-1,m=0;n&&(f*=-1,m=Math.PI),f<0&&(m+=Math.PI);for(var g=f>0?l+s:l+s+1,y=o,v=o,_=0,b=0,x=Math.abs(d),w=[];_+b<=x;){if((g+=f)<l||g>=u)return null;if(v=y,w.push(y),void 0===(y=p[g])){var A=new t.Point(c.getx(g),c.gety(g)),E=$t(A,h);if(E.signedDistanceFromCamera>0)y=p[g]=E.point;else{var T=g-f;y=ae(0===_?a:new t.Point(c.getx(T),c.gety(T)),A,v,x-_+1,h)}}_+=b,b=v.dist(y)}var S=(x-_)/b,P=y.sub(v),I=P.mult(S)._add(v);I._add(P._unit()._perp()._mult(i*f));var M=m+Math.atan2(y.y-v.y,y.x-v.x);return w.push(I),{point:I,angle:M,path:w}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,r,i,n){this._forEachCell(e,r,i,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)},Kt.prototype.insertCircle=function(t,e,r,i){this._forEachCell(e-i,r-i,e+i,r+i,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(i)},Kt.prototype._insertBoxCell=function(t,e,r,i,n,o){this.boxCells[n].push(o)},Kt.prototype._insertCircleCell=function(t,e,r,i,n,o){this.circleCells[n].push(o)},Kt.prototype._query=function(t,e,r,i,n,o){if(r<0||t>this.width||i<0||e>this.height)return!n&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=i){if(n)return!0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var u=this.circles[3*l],c=this.circles[3*l+1],h=this.circles[3*l+2];a.push({key:this.circleKeys[l],x1:u-h,y1:c-h,x2:u+h,y2:c+h})}return o?a.filter(o):a}return this._forEachCell(t,e,r,i,this._queryCell,a,{hitTest:n,seenUids:{box:{},circle:{}}},o),n?a.length>0:a},Kt.prototype._queryCircle=function(t,e,r,i,n){var o=t-r,a=t+r,s=e-r,l=e+r;if(a<0||o>this.width||l<0||s>this.height)return!i&&[];var u=[];return this._forEachCell(o,s,a,l,this._queryCellCircle,u,{hitTest:i,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},n),i?u.length>0:u},Kt.prototype.query=function(t,e,r,i,n){return this._query(t,e,r,i,!1,n)},Kt.prototype.hitTest=function(t,e,r,i,n){return this._query(t,e,r,i,!0,n)},Kt.prototype.hitTestCircle=function(t,e,r,i){return this._queryCircle(t,e,r,!0,i)},Kt.prototype._queryCell=function(t,e,r,i,n,o,a,s){var l=a.seenUids,u=this.boxCells[n];if(null!==u)for(var c=this.bboxes,h=0,p=u;h<p.length;h+=1){var d=p[h];if(!l.box[d]){l.box[d]=!0;var f=4*d;if(t<=c[f+2]&&e<=c[f+3]&&r>=c[f+0]&&i>=c[f+1]&&(!s||s(this.boxKeys[d]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[d],x1:c[f],y1:c[f+1],x2:c[f+2],y2:c[f+3]})}}}var m=this.circleCells[n];if(null!==m)for(var g=this.circles,y=0,v=m;y<v.length;y+=1){var _=v[y];if(!l.circle[_]){l.circle[_]=!0;var b=3*_;if(this._circleAndRectCollide(g[b],g[b+1],g[b+2],t,e,r,i)&&(!s||s(this.circleKeys[_]))){if(a.hitTest)return o.push(!0),!0;var x=g[b],w=g[b+1],A=g[b+2];o.push({key:this.circleKeys[_],x1:x-A,y1:w-A,x2:x+A,y2:w+A})}}}},Kt.prototype._queryCellCircle=function(t,e,r,i,n,o,a,s){var l=a.circle,u=a.seenUids,c=this.boxCells[n];if(null!==c)for(var h=this.bboxes,p=0,d=c;p<d.length;p+=1){var f=d[p];if(!u.box[f]){u.box[f]=!0;var m=4*f;if(this._circleAndRectCollide(l.x,l.y,l.radius,h[m+0],h[m+1],h[m+2],h[m+3])&&(!s||s(this.boxKeys[f])))return o.push(!0),!0}}var g=this.circleCells[n];if(null!==g)for(var y=this.circles,v=0,_=g;v<_.length;v+=1){var b=_[v];if(!u.circle[b]){u.circle[b]=!0;var x=3*b;if(this._circlesCollide(y[x],y[x+1],y[x+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[b])))return o.push(!0),!0}}},Kt.prototype._forEachCell=function(t,e,r,i,n,o,a,s){for(var l=this._convertToXCellCoord(t),u=this._convertToYCellCoord(e),c=this._convertToXCellCoord(r),h=this._convertToYCellCoord(i),p=l;p<=c;p++)for(var d=u;d<=h;d++)if(n.call(this,t,e,r,i,this.xCellCount*d+p,o,a,s))return},Kt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Kt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Kt.prototype._circlesCollide=function(t,e,r,i,n,o){var a=i-t,s=n-e,l=r+o;return l*l>a*a+s*s},Kt.prototype._circleAndRectCollide=function(t,e,r,i,n,o,a){var s=(o-i)/2,l=Math.abs(t-(i+s));if(l>s+r)return!1;var u=(a-n)/2,c=Math.abs(e-(n+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var h=l-s,p=c-u;return h*h+p*p<=r*r};var le=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ue(t,e){for(var r=0;r<t;r++){var i=e.length;e.resize(i+4),e.float32.set(le,3*i)}}function ce(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[4]*n+r[12],t[1]=r[1]*i+r[5]*n+r[13],t[3]=r[3]*i+r[7]*n+r[15],t}var he=function(t,e,r){void 0===e&&(e=new Kt(t.width+200,t.height+200,25)),void 0===r&&(r=new Kt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=r,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function pe(e,r,i){return r*(t.EXTENT/(e.tileSize*Math.pow(2,i-e.tileID.overscaledZ)))}he.prototype.placeCollisionBox=function(t,e,r,i,n){var o=this.projectAndGetPerspectiveRatio(i,t.anchorPointX,t.anchorPointY),a=r*o.perspectiveRatio,s=t.x1*a+o.point.x,l=t.y1*a+o.point.y,u=t.x2*a+o.point.x,c=t.y2*a+o.point.y;return!this.isInsideGrid(s,l,u,c)||!e&&this.grid.hitTest(s,l,u,c,n)?{box:[],offscreen:!1}:{box:[s,l,u,c],offscreen:this.isOffscreen(s,l,u,c)}},he.prototype.placeCollisionCircles=function(e,r,i,n,o,a,s,l,u,c,h,p,d){var f=[],m=new t.Point(r.anchorX,r.anchorY),g=$t(m,a),y=te(this.transform.cameraToCenterDistance,g.signedDistanceFromCamera),v=(c?o/y:o*y)/t.ONE_EM,_=$t(m,s).point,b=ie(v,n,r.lineOffsetX*v,r.lineOffsetY*v,!1,_,m,r,i,s,{}),x=!1,w=!1,A=!0;if(b){for(var E=.5*p*y+d,T=new t.Point(-100,-100),S=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),P=new Yt,I=b.first,M=b.last,C=[],k=I.path.length-1;k>=1;k--)C.push(I.path[k]);for(var L=1;L<M.path.length;L++)C.push(M.path[L]);var z=2.5*E;if(l){var R=C.map((function(t){return $t(t,l)}));C=R.some((function(t){return t.signedDistanceFromCamera<=0}))?[]:R.map((function(t){return t.point}))}var O=[];if(C.length>0){for(var D=C[0].clone(),B=C[0].clone(),F=1;F<C.length;F++)D.x=Math.min(D.x,C[F].x),D.y=Math.min(D.y,C[F].y),B.x=Math.max(B.x,C[F].x),B.y=Math.max(B.y,C[F].y);O=D.x>=T.x&&B.x<=S.x&&D.y>=T.y&&B.y<=S.y?[C]:B.x<T.x||D.x>S.x||B.y<T.y||D.y>S.y?[]:t.clipLine([C],T.x,T.y,S.x,S.y)}for(var j=0,N=O;j<N.length;j+=1){var U;P.reset(N[j],.25*E),U=P.length<=.5*E?1:Math.ceil(P.paddedLength/z)+1;for(var V=0;V<U;V++){var q=V/Math.max(U-1,1),G=P.lerp(q),Z=G.x+100,W=G.y+100;f.push(Z,W,E,0);var H=Z-E,X=W-E,Y=Z+E,K=W+E;if(A=A&&this.isOffscreen(H,X,Y,K),w=w||this.isInsideGrid(H,X,Y,K),!e&&this.grid.hitTestCircle(Z,W,E,h)&&(x=!0,!u))return{circles:[],offscreen:!1,collisionDetected:x}}}}return{circles:!u&&x||!w?[]:f,offscreen:A,collisionDetected:x}},he.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var r=[],i=1/0,n=1/0,o=-1/0,a=-1/0,s=0,l=e;s<l.length;s+=1){var u=l[s],c=new t.Point(u.x+100,u.y+100);i=Math.min(i,c.x),n=Math.min(n,c.y),o=Math.max(o,c.x),a=Math.max(a,c.y),r.push(c)}for(var h={},p={},d=0,f=this.grid.query(i,n,o,a).concat(this.ignoredGrid.query(i,n,o,a));d<f.length;d+=1){var m=f[d],g=m.key;if(void 0===h[g.bucketInstanceId]&&(h[g.bucketInstanceId]={}),!h[g.bucketInstanceId][g.featureIndex]){var y=[new t.Point(m.x1,m.y1),new t.Point(m.x2,m.y1),new t.Point(m.x2,m.y2),new t.Point(m.x1,m.y2)];t.polygonIntersectsPolygon(r,y)&&(h[g.bucketInstanceId][g.featureIndex]=!0,void 0===p[g.bucketInstanceId]&&(p[g.bucketInstanceId]=[]),p[g.bucketInstanceId].push(g.featureIndex))}}return p},he.prototype.insertCollisionBox=function(t,e,r,i,n){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:i,collisionGroupID:n},t[0],t[1],t[2],t[3])},he.prototype.insertCollisionCircles=function(t,e,r,i,n){for(var o=e?this.ignoredGrid:this.grid,a={bucketInstanceId:r,featureIndex:i,collisionGroupID:n},s=0;s<t.length;s+=4)o.insertCircle(a,t[s],t[s+1],t[s+2])},he.prototype.projectAndGetPerspectiveRatio=function(e,r,i){var n=[r,i,0,1];return ce(n,n,e),{point:new t.Point((n[0]/n[3]+1)/2*this.transform.width+100,(-n[1]/n[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/n[3]*.5}},he.prototype.isOffscreen=function(t,e,r,i){return r<100||t>=this.screenRightBoundary||i<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,r,i){return r>=0&&t<this.gridRightBoundary&&i>=0&&e<this.gridBottomBoundary},he.prototype.getViewportMatrix=function(){var e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e};var de=function(t,e,r,i){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):i&&r?1:0,this.placed=r};de.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var fe=function(t,e,r,i,n){this.text=new de(t?t.text:null,e,r,n),this.icon=new de(t?t.icon:null,e,i,n)};fe.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var me=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},ge=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]},ye=function(t,e,r,i,n){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=i,this.tileID=n},ve=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function _e(e,r,i,n,o){var a=t.getAnchorAlignment(e),s=-(a.horizontalAlign-.5)*r,l=-(a.verticalAlign-.5)*i,u=t.evaluateVariableOffset(e,n);return new t.Point(s+u[0]*o,l+u[1]*o)}function be(e,r,i,n,o,a){var s=e.x1,l=e.x2,u=e.y1,c=e.y2,h=e.anchorPointX,p=e.anchorPointY,d=new t.Point(r,i);return n&&d._rotate(o?a:-a),{x1:s+d.x,y1:u+d.y,x2:l+d.x,y2:c+d.y,anchorPointX:h,anchorPointY:p}}ve.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var xe=function(t,e,r,i){this.transform=t.clone(),this.collisionIndex=new he(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new ve(r),this.collisionCircleArrays={},this.prevPlacement=i,i&&(i.prevPlacement=void 0),this.placedOrientations={}};function we(t,e,r,i,n){t.emplaceBack(e?1:0,r?1:0,i||0,n||0),t.emplaceBack(e?1:0,r?1:0,i||0,n||0),t.emplaceBack(e?1:0,r?1:0,i||0,n||0),t.emplaceBack(e?1:0,r?1:0,i||0,n||0)}xe.prototype.getBucketParts=function(e,r,i,n){var o=i.getBucket(r),a=i.latestFeatureIndex;if(o&&a&&r.id===o.layerIds[0]){var s=i.collisionBoxArray,l=o.layers[0].layout,u=Math.pow(2,this.transform.zoom-i.tileID.overscaledZ),c=i.tileSize/t.EXTENT,h=this.transform.calculatePosMatrix(i.tileID.toUnwrapped()),p="map"===l.get("text-pitch-alignment"),d="map"===l.get("text-rotation-alignment"),f=pe(i,1,this.transform.zoom),m=Jt(h,p,d,this.transform,f),g=null;if(p){var y=Qt(h,p,d,this.transform,f);g=t.multiply([],this.transform.labelPlaneMatrix,y)}this.retainedQueryData[o.bucketInstanceId]=new ye(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,i.tileID);var v={bucket:o,layout:l,posMatrix:h,textLabelPlaneMatrix:m,labelToScreenMatrix:g,scale:u,textPixelRatio:c,holdingForFade:i.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(n)for(var _=0,b=o.sortKeyRanges;_<b.length;_+=1){var x=b[_];e.push({sortKey:x.sortKey,symbolInstanceStart:x.symbolInstanceStart,symbolInstanceEnd:x.symbolInstanceEnd,parameters:v})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:v})}},xe.prototype.attemptAnchorPlacement=function(t,e,r,i,n,o,a,s,l,u,c,h,p,d,f){var m,g=[h.textOffset0,h.textOffset1],y=_e(t,r,i,g,n),v=this.collisionIndex.placeCollisionBox(be(e,y.x,y.y,o,a,this.transform.angle),c,s,l,u.predicate);if(!f||0!==this.collisionIndex.placeCollisionBox(be(f,y.x,y.y,o,a,this.transform.angle),c,s,l,u.predicate).box.length)return v.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(m=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:g,width:r,height:i,anchor:t,textBoxScale:n,prevAnchor:m},this.markUsedJustification(p,t,h,d),p.allowVerticalPlacement&&(this.markUsedOrientation(p,d,h),this.placedOrientations[h.crossTileID]=d),{shift:y,placedGlyphBoxes:v}):void 0},xe.prototype.placeLayerBucketPart=function(e,r,i){var n=this,o=e.parameters,a=o.bucket,s=o.layout,l=o.posMatrix,u=o.textLabelPlaneMatrix,c=o.labelToScreenMatrix,h=o.textPixelRatio,p=o.holdingForFade,d=o.collisionBoxArray,f=o.partiallyEvaluatedTextSize,m=o.collisionGroup,g=s.get("text-optional"),y=s.get("icon-optional"),v=s.get("text-allow-overlap"),_=s.get("icon-allow-overlap"),b="map"===s.get("text-rotation-alignment"),x="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),A="viewport-y"===s.get("symbol-z-order"),E=v&&(_||!a.hasIconData()||y),T=_&&(v||!a.hasTextData()||g);!a.collisionArrays&&d&&a.deserializeCollisionBoxes(d);var S=function(e,o){if(!r[e.crossTileID])if(p)n.placements[e.crossTileID]=new me(!1,!1,!1);else{var d,A=!1,S=!1,P=!0,I=null,M={box:null,offscreen:null},C={box:null,offscreen:null},k=null,L=null,z=0,R=0,O=0;o.textFeatureIndex?z=o.textFeatureIndex:e.useRuntimeCollisionCircles&&(z=e.featureIndex),o.verticalTextFeatureIndex&&(R=o.verticalTextFeatureIndex);var D=o.textBox;if(D){var B=function(r){var i=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!r&&n.prevPlacement){var o=n.prevPlacement.placedOrientations[e.crossTileID];o&&(n.placedOrientations[e.crossTileID]=o,n.markUsedOrientation(a,i=o,e))}return i},F=function(r,i){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&o.verticalTextBox)for(var n=0,s=a.writingModes;n<s.length&&(s[n]===t.WritingMode.vertical?(M=i(),C=M):M=r(),!(M&&M.box&&M.box.length));n+=1);else M=r()};if(s.get("text-variable-anchor")){var j=s.get("text-variable-anchor");if(n.prevPlacement&&n.prevPlacement.variableOffsets[e.crossTileID]){var N=n.prevPlacement.variableOffsets[e.crossTileID];j.indexOf(N.anchor)>0&&(j=j.filter((function(t){return t!==N.anchor}))).unshift(N.anchor)}var U=function(t,r,i){for(var o=t.x2-t.x1,s=t.y2-t.y1,u=e.textBoxScale,c=w&&!_?r:null,p={box:[],offscreen:!1},d=v?2*j.length:j.length,f=0;f<d;++f){var g=n.attemptAnchorPlacement(j[f%j.length],t,o,s,u,b,x,h,l,m,f>=j.length,e,a,i,c);if(g&&(p=g.placedGlyphBoxes)&&p.box&&p.box.length){A=!0,I=g.shift;break}}return p};F((function(){return U(D,o.iconBox,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&!(M&&M.box&&M.box.length)&&e.numVerticalGlyphVertices>0&&r?U(r,o.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),M&&(A=M.box,P=M.offscreen);var V=B(M&&M.box);if(!A&&n.prevPlacement){var q=n.prevPlacement.variableOffsets[e.crossTileID];q&&(n.variableOffsets[e.crossTileID]=q,n.markUsedJustification(a,q.anchor,e,V))}}else{var G=function(t,r){var i=n.collisionIndex.placeCollisionBox(t,v,h,l,m.predicate);return i&&i.box&&i.box.length&&(n.markUsedOrientation(a,r,e),n.placedOrientations[e.crossTileID]=r),i};F((function(){return G(D,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?G(r,t.WritingMode.vertical):{box:null,offscreen:null}})),B(M&&M.box&&M.box.length)}}if(A=(d=M)&&d.box&&d.box.length>0,P=d&&d.offscreen,e.useRuntimeCollisionCircles){var Z=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),W=t.evaluateSizeForFeature(a.textSizeData,f,Z),H=s.get("text-padding");k=n.collisionIndex.placeCollisionCircles(v,Z,a.lineVertexArray,a.glyphOffsetArray,W,l,u,c,i,x,m.predicate,e.collisionCircleDiameter,H),A=v||k.circles.length>0&&!k.collisionDetected,P=P&&k.offscreen}if(o.iconFeatureIndex&&(O=o.iconFeatureIndex),o.iconBox){var X=function(t){var e=w&&I?be(t,I.x,I.y,b,x,n.transform.angle):t;return n.collisionIndex.placeCollisionBox(e,_,h,l,m.predicate)};S=C&&C.box&&C.box.length&&o.verticalIconBox?(L=X(o.verticalIconBox)).box.length>0:(L=X(o.iconBox)).box.length>0,P=P&&L.offscreen}var Y=g||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=y||0===e.numIconVertices;if(Y||K?K?Y||(S=S&&A):A=S&&A:S=A=S&&A,A&&d&&d.box&&n.collisionIndex.insertCollisionBox(d.box,s.get("text-ignore-placement"),a.bucketInstanceId,C&&C.box&&R?R:z,m.ID),S&&L&&n.collisionIndex.insertCollisionBox(L.box,s.get("icon-ignore-placement"),a.bucketInstanceId,O,m.ID),k&&(A&&n.collisionIndex.insertCollisionCircles(k.circles,s.get("text-ignore-placement"),a.bucketInstanceId,z,m.ID),i)){var J=a.bucketInstanceId,Q=n.collisionCircleArrays[J];void 0===Q&&(Q=n.collisionCircleArrays[J]=new ge);for(var $=0;$<k.circles.length;$+=4)Q.circles.push(k.circles[$+0]),Q.circles.push(k.circles[$+1]),Q.circles.push(k.circles[$+2]),Q.circles.push(k.collisionDetected?1:0)}n.placements[e.crossTileID]=new me(A||E,S||T,P||a.justReloaded),r[e.crossTileID]=!0}};if(A)for(var P=a.getSortedSymbolIndexes(this.transform.angle),I=P.length-1;I>=0;--I){var M=P[I];S(a.symbolInstances.get(M),a.collisionArrays[M])}else for(var C=e.symbolInstanceStart;C<e.symbolInstanceEnd;C++)S(a.symbolInstances.get(C),a.collisionArrays[C]);if(i&&a.bucketInstanceId in this.collisionCircleArrays){var k=this.collisionCircleArrays[a.bucketInstanceId];t.invert(k.invProjMatrix,l),k.viewportMatrix=this.collisionIndex.getViewportMatrix()}a.justReloaded=!1},xe.prototype.markUsedJustification=function(e,r,i,n){var o;o=n===t.WritingMode.vertical?i.verticalPlacedTextSymbolIndex:{left:i.leftJustifiedTextSymbolIndex,center:i.centerJustifiedTextSymbolIndex,right:i.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(r)];for(var a=0,s=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex,i.verticalPlacedTextSymbolIndex];a<s.length;a+=1){var l=s[a];l>=0&&(e.text.placedSymbolArray.get(l).crossTileID=o>=0&&l!==o?0:i.crossTileID)}},xe.prototype.markUsedOrientation=function(e,r,i){for(var n=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,o=r===t.WritingMode.vertical?r:0,a=0,s=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];a<s.length;a+=1)e.text.placedSymbolArray.get(s[a]).placedOrientation=n;i.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).placedOrientation=o)},xe.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,r=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var i=e?e.symbolFadeChange(t):1,n=e?e.opacities:{},o=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],u=n[s];u?(this.opacities[s]=new fe(u,i,l.text,l.icon),r=r||l.text!==u.text.placed||l.icon!==u.icon.placed):(this.opacities[s]=new fe(null,i,l.text,l.icon,l.skipFade),r=r||l.text||l.icon)}for(var c in n){var h=n[c];if(!this.opacities[c]){var p=new fe(h,i,!1,!1);p.isHidden()||(this.opacities[c]=p,r=r||h.text.placed||h.icon.placed)}}for(var d in o)this.variableOffsets[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.variableOffsets[d]=o[d]);for(var f in a)this.placedOrientations[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.placedOrientations[f]=a[f]);r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},xe.prototype.updateLayerOpacities=function(t,e){for(var r={},i=0,n=e;i<n.length;i+=1){var o=n[i],a=o.getBucket(t);a&&o.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,r,o.collisionBoxArray)}},xe.prototype.updateBucketOpacities=function(e,r,i){var n=this;e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();var o=e.layers[0].layout,a=new fe(null,0,!1,!1,!0),s=o.get("text-allow-overlap"),l=o.get("icon-allow-overlap"),u=o.get("text-variable-anchor"),c="map"===o.get("text-rotation-alignment"),h="map"===o.get("text-pitch-alignment"),p="none"!==o.get("icon-text-fit"),d=new fe(null,0,s&&(l||!e.hasIconData()||o.get("icon-optional")),l&&(s||!e.hasTextData()||o.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);for(var f=function(t,e,r){for(var i=0;i<e/4;i++)t.opacityVertexArray.emplaceBack(r)},m=function(i){var o=e.symbolInstances.get(i),s=o.numHorizontalGlyphVertices,l=o.numVerticalGlyphVertices,m=o.crossTileID,g=n.opacities[m];r[m]?g=a:g||(n.opacities[m]=g=d),r[m]=!0;var y=o.numIconVertices>0,v=n.placedOrientations[o.crossTileID],_=v===t.WritingMode.vertical,b=v===t.WritingMode.horizontal||v===t.WritingMode.horizontalOnly;if(s>0||l>0){var x=Ce(g.text);f(e.text,s,_?ke:x),f(e.text,l,b?ke:x);var w=g.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=w||_?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=w||b?1:0);var A=n.variableOffsets[o.crossTileID];A&&n.markUsedJustification(e,A.anchor,o,v);var E=n.placedOrientations[o.crossTileID];E&&(n.markUsedJustification(e,"left",o,E),n.markUsedOrientation(e,E,o))}if(y){var T=Ce(g.icon),S=!(p&&o.verticalPlacedIconSymbolIndex&&_);o.placedIconSymbolIndex>=0&&(f(e.icon,o.numIconVertices,S?T:ke),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=g.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(f(e.icon,o.numVerticalIconVertices,S?ke:T),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var P=e.collisionArrays[i];if(P){var I=new t.Point(0,0);if(P.textBox||P.verticalTextBox){var M=!0;if(u){var C=n.variableOffsets[m];C?(I=_e(C.anchor,C.width,C.height,C.textOffset,C.textBoxScale),c&&I._rotate(h?n.transform.angle:-n.transform.angle)):M=!1}P.textBox&&we(e.textCollisionBox.collisionVertexArray,g.text.placed,!M||_,I.x,I.y),P.verticalTextBox&&we(e.textCollisionBox.collisionVertexArray,g.text.placed,!M||b,I.x,I.y)}var k=Boolean(!b&&P.verticalIconBox);P.iconBox&&we(e.iconCollisionBox.collisionVertexArray,g.icon.placed,k,p?I.x:0,p?I.y:0),P.verticalIconBox&&we(e.iconCollisionBox.collisionVertexArray,g.icon.placed,!k,p?I.x:0,p?I.y:0)}}},g=0;g<e.symbolInstances.length;g++)m(g);if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.bucketInstanceId in this.collisionCircleArrays){var y=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=y.invProjMatrix,e.placementViewportMatrix=y.viewportMatrix,e.collisionCircleArray=y.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}},xe.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},xe.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},xe.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},xe.prototype.stillRecent=function(t,e){var r=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*r>t},xe.prototype.setStale=function(){this.stale=!0};var Ae=Math.pow(2,25),Ee=Math.pow(2,24),Te=Math.pow(2,17),Se=Math.pow(2,16),Pe=Math.pow(2,9),Ie=Math.pow(2,8),Me=Math.pow(2,1);function Ce(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Ae+e*Ee+r*Te+e*Se+r*Pe+e*Ie+r*Me+e}var ke=0,Le=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Le.prototype.continuePlacement=function(t,e,r,i,n){for(var o=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(o,i,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,n())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort((function(t,e){return t.sortKey-e.sortKey})));this._currentPartIndex<o.length;)if(e.placeLayerBucketPart(o[this._currentPartIndex],this._seenCrossTileIDs,r),this._currentPartIndex++,n())return!0;return!1};var ze=function(t,e,r,i,n,o,a){this.placement=new xe(t,n,o,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=i,this._done=!1};ze.prototype.isDone=function(){return this._done},ze.prototype.continuePlacement=function(e,r,i){for(var n=this,o=t.browser.now(),a=function(){var e=t.browser.now()-o;return!n._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Le(s)),this._inProgressLayer.continuePlacement(i[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ze.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Re=512/t.EXTENT/2,Oe=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var i=0;i<e.length;i++){var n=e.get(i),o=n.key;this.indexedSymbolInstances[o]||(this.indexedSymbolInstances[o]=[]),this.indexedSymbolInstances[o].push({crossTileID:n.crossTileID,coord:this.getScaledCoordinates(n,t)})}};Oe.prototype.getScaledCoordinates=function(e,r){var i=Re/Math.pow(2,r.canonical.z-this.tileID.canonical.z);return{x:Math.floor((r.canonical.x*t.EXTENT+e.anchorX)*i),y:Math.floor((r.canonical.y*t.EXTENT+e.anchorY)*i)}},Oe.prototype.findMatches=function(t,e,r){for(var i=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),n=0;n<t.length;n++){var o=t.get(n);if(!o.crossTileID){var a=this.indexedSymbolInstances[o.key];if(a)for(var s=this.getScaledCoordinates(o,e),l=0,u=a;l<u.length;l+=1){var c=u[l];if(Math.abs(c.coord.x-s.x)<=i&&Math.abs(c.coord.y-s.y)<=i&&!r[c.crossTileID]){r[c.crossTileID]=!0,o.crossTileID=c.crossTileID;break}}}}};var De=function(){this.maxCrossTileID=0};De.prototype.generate=function(){return++this.maxCrossTileID};var Be=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Be.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var r in this.indexes){var i=this.indexes[r],n={};for(var o in i){var a=i[o];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),n[a.tileID.key]=a}this.indexes[r]=n}this.lng=t},Be.prototype.addBucket=function(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var i=0;i<e.symbolInstances.length;i++)e.symbolInstances.get(i).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var n=this.usedCrossTileIDs[t.overscaledZ];for(var o in this.indexes){var a=this.indexes[o];if(Number(o)>t.overscaledZ)for(var s in a){var l=a[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,n)}else{var u=a[t.scaledTo(Number(o)).key];u&&u.findMatches(e.symbolInstances,t,n)}}for(var c=0;c<e.symbolInstances.length;c++){var h=e.symbolInstances.get(c);h.crossTileID||(h.crossTileID=r.generate(),n[h.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Oe(t,e.symbolInstances,e.bucketInstanceId),!0},Be.prototype.removeBucketCrossTileIDs=function(t,e){for(var r in e.indexedSymbolInstances)for(var i=0,n=e.indexedSymbolInstances[r];i<n.length;i+=1)delete this.usedCrossTileIDs[t][n[i].crossTileID]},Be.prototype.removeStaleBuckets=function(t){var e=!1;for(var r in this.indexes){var i=this.indexes[r];for(var n in i)t[i[n].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,i[n]),delete i[n],e=!0)}return e};var Fe=function(){this.layerIndexes={},this.crossTileIDs=new De,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Fe.prototype.addLayer=function(t,e,r){var i=this.layerIndexes[t.id];void 0===i&&(i=this.layerIndexes[t.id]=new Be);var n=!1,o={};i.handleWrapJump(r);for(var a=0,s=e;a<s.length;a+=1){var l=s[a],u=l.getBucket(t);u&&t.id===u.layerIds[0]&&(u.bucketInstanceId||(u.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(l.tileID,u,this.crossTileIDs)&&(n=!0),o[u.bucketInstanceId]=!0)}return i.removeStaleBuckets(o)&&(n=!0),n},Fe.prototype.pruneUnusedLayers=function(t){var e={};for(var r in t.forEach((function(t){e[t]=!0})),this.layerIndexes)e[r]||delete this.layerIndexes[r]};var je=function(e,r){return t.emitValidationErrors(e,r&&r.filter((function(t){return"source.canvas"!==t.identifier})))},Ne=t.pick(Ut,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ue=t.pick(Ut,["setCenter","setZoom","setBearing","setP
16itch"]),Ve=function(){var e={},r=t.styleSpec.$version;for(var i in t.styleSpec.$root){var n,o=t.styleSpec.$root[i];o.required&&null!=(n="version"===i?r:"array"===o.type?[]:{})&&(e[i]=n)}return e}(),qe=function(e){function r(i,n){var o=this;void 0===n&&(n={}),e.call(this),this.map=i,this.dispatcher=new E(Ft(),this),this.imageManager=new p,this.imageManager.setEventedParent(this),this.glyphManager=new _(i._requestManager,n.localIdeographFontFamily),this.lineAtlas=new A(256,512),this.crossTileSymbolIndex=new Fe,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var a=this;this._rtlTextPluginCallback=r.registerForPluginStateChange((function(e){a.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},(function(e,r){if(t.triggerPluginCompletionEvent(e),r&&r.every((function(t){return t})))for(var i in a.sourceCaches)a.sourceCaches[i].reload()}))})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=o.sourceCaches[t.sourceId];if(e){var r=e.getSource();if(r&&r.vectorLayerIds)for(var i in o._layers){var n=o._layers[i];n.source===r.id&&o._validateLayer(n)}}}}))}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadURL=function(e,r){var i=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var n="boolean"==typeof r.validate?r.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,r.accessToken);var o=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(o,(function(e,r){i._request=null,e?i.fire(new t.ErrorEvent(e)):r&&i._load(r,n)}))},r.prototype.loadJSON=function(e,r){var i=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){i._request=null,i._load(e,!1!==r.validate)}))},r.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Ve,!1)},r.prototype._load=function(e,r){if(!r||!je(this,t.validateStyle(e))){for(var i in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(i,e.sources[i],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var n=Nt(this.stylesheet.layers);this._order=n.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var o=0,a=n;o<a.length;o+=1){var s=a[o];(s=t.createStyleLayer(s)).setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=s,this._serializedLayers[s.id]=s.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new w(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},r.prototype._loadSprite=function(e){var r=this;this._spriteRequest=function(e,r,i){var n,o,a,s=t.browser.devicePixelRatio>1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,a||(a=t,n=e,c())})),u=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){u=null,a||(a=t,o=e,c())}));function c(){if(a)i(a);else if(n&&o){var e=t.browser.getImageData(o),r={};for(var s in n){var l=n[s],u=l.width,c=l.height,h=l.x,p=l.y,d=l.sdf,f=l.pixelRatio,m=l.stretchX,g=l.stretchY,y=l.content,v=new t.RGBAImage({width:u,height:c});t.RGBAImage.copy(e,v,{x:h,y:p},{x:0,y:0},{width:u,height:c}),r[s]={data:v,pixelRatio:f,sdf:d,stretchX:m,stretchY:g,content:y}}i(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),u&&(u.cancel(),u=null)}}}(e,this.map._requestManager,(function(e,i){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(i)for(var n in i)r.imageManager.addImage(n,i[n]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var i=e.sourceLayer;if(i){var n=r.getSource();("geojson"===n.type||n.vectorLayerIds&&-1===n.vectorLayerIds.indexOf(i))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+i+'" does not exist on source "'+n.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,i=t;r<i.length;r+=1){var n=this._layers[i[r]];"custom"!==n.type&&e.push(n.serialize())}return e},r.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},r.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},r.prototype.update=function(e){if(this._loaded){var r=this._changed;if(this._changed){var i=Object.keys(this._updatedLayers),n=Object.keys(this._removedLayers);for(var o in(i.length||n.length)&&this._updateWorkerLayers(i,n),this._updatedSources){var a=this._updatedSources[o];"reload"===a?this._reloadSource(o):"clear"===a&&this._clearSource(o)}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}for(var l in this.sourceCaches)this.sourceCaches[l].used=!1;for(var u=0,c=this._order;u<c.length;u+=1){var h=this._layers[c[u]];h.recalculate(e,this._availableImages),!h.isHidden(e.zoom)&&h.source&&(this.sourceCaches[h.source].used=!0)}this.light.recalculate(e),this.z=e.zoom,r&&this.fire(new t.Event("data",{dataType:"style"}))}},r.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}},r.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},r.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},r.prototype.setState=function(e){var r=this;if(this._checkLoaded(),je(this,t.validateStyle(e)))return!1;
vendor: 6,099 bytes, line 16
16(e=t.clone$1(e)).layers=Nt(e.layers);var i=function(e,r){if(!e)return[{command:Ut.setStyle,args:[r]}];var i=[];try{if(!t.deepEqual(e.version,r.version))return[{command:Ut.setStyle,args:[r]}];t.deepEqual(e.center,r.center)||i.push({command:Ut.setCenter,args:[r.center]}),t.deepEqual(e.zoom,r.zoom)||i.push({command:Ut.setZoom,args:[r.zoom]}),t.deepEqual(e.bearing,r.bearing)||i.push({command:Ut.setBearing,args:[r.bearing]}),t.deepEqual(e.pitch,r.pitch)||i.push({command:Ut.setPitch,args:[r.pitch]}),t.deepEqual(e.sprite,r.sprite)||i.push({command:Ut.setSprite,args:[r.sprite]}),t.deepEqual(e.glyphs,r.glyphs)||i.push({command:Ut.setGlyphs,args:[r.glyphs]}),t.deepEqual(e.transition,r.transition)||i.push({command:Ut.setTransition,args:[r.transition]}),t.deepEqual(e.light,r.light)||i.push({command:Ut.setLight,args:[r.light]});var n={},o=[];!function(e,r,i,n){var o;for(o in r=r||{},e=e||{})e.hasOwnProperty(o)&&(r.hasOwnProperty(o)||qt(o,i,n));for(o in r)r.hasOwnProperty(o)&&(e.hasOwnProperty(o)?t.deepEqual(e[o],r[o])||("geojson"===e[o].type&&"geojson"===r[o].type&&Zt(e,r,o)?i.push({command:Ut.setGeoJSONSourceData,args:[o,r[o].data]}):Gt(o,r,i,n)):Vt(o,r,i))}(e.sources,r.sources,o,n);var a=[];e.layers&&e.layers.forEach((function(t){n[t.source]?i.push({command:Ut.removeLayer,args:[t.id]}):a.push(t)})),i=i.concat(o),function(e,r,i){r=r||[];var n,o,a,s,l,u,c,h=(e=e||[]).map(Ht),p=r.map(Ht),d=e.reduce(Xt,{}),f=r.reduce(Xt,{}),m=h.slice(),g=Object.create(null);for(n=0,o=0;n<h.length;n++)f.hasOwnProperty(a=h[n])?o++:(i.push({command:Ut.removeLayer,args:[a]}),m.splice(m.indexOf(a,o),1));for(n=0,o=0;n<p.length;n++)m[m.length-1-n]!==(a=p[p.length-1-n])&&(d.hasOwnProperty(a)?(i.push({command:Ut.removeLayer,args:[a]}),m.splice(m.lastIndexOf(a,m.length-o),1)):o++,i.push({command:Ut.addLayer,args:[f[a],u=m[m.length-n]]}),m.splice(m.length-n,0,a),g[a]=!0);for(n=0;n<p.length;n++)if(s=d[a=p[n]],l=f[a],!g[a]&&!t.deepEqual(s,l))if(t.deepEqual(s.source,l.source)&&t.deepEqual(s["source-layer"],l["source-layer"])&&t.deepEqual(s.type,l.type)){for(c in Wt(s.layout,l.layout,i,a,null,Ut.setLayoutProperty),Wt(s.paint,l.paint,i,a,null,Ut.setPaintProperty),t.deepEqual(s.filter,l.filter)||i.push({command:Ut.setFilter,args:[a,l.filter]}),t.deepEqual(s.minzoom,l.minzoom)&&t.deepEqual(s.maxzoom,l.maxzoom)||i.push({command:Ut.setLayerZoomRange,args:[a,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Wt(s[c],l[c],i,a,c.slice(6),Ut.setPaintProperty):t.deepEqual(s[c],l[c])||i.push({command:Ut.setLayerProperty,args:[a,c,l[c]]}));for(c in l)l.hasOwnProperty(c)&&!s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Wt(s[c],l[c],i,a,c.slice(6),Ut.setPaintProperty):t.deepEqual(s[c],l[c])||i.push({command:Ut.setLayerProperty,args:[a,c,l[c]]}))}else i.push({command:Ut.removeLayer,args:[a]}),u=m[m.lastIndexOf(a)+1],i.push({command:Ut.addLayer,args:[l,u]})}(a,r.layers,i)}catch(t){console.warn("Unable to compute style diff:",t),i=[{command:Ut.setStyle,args:[r]}]}return i}(this.serialize(),e).filter((function(t){return!(t.command in Ue)}));if(0===i.length)return!1;var n=i.filter((function(t){return!(t.command in Ne)}));if(n.length>0)throw new Error("Unimplemented: "+n.map((function(t){return t.command})).join(", ")+".");return i.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,i){var n=this;if(void 0===i&&(i={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,i))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var o=this.sourceCaches[e]=new Ct(e,r,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:n.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var i=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],i.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),i.setEventedParent(null),i.clearTiles(),i.onRemove&&i.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,i){void 0===i&&(i={}),this._checkLoaded();var n=e.id;if(this.getLayer(n))this.fire(new t.ErrorEvent(new Error('Layer with i
16d "'+n+'" already exists on this map')));else{var o;if("custom"===e.type){if(je(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(n,e.source),e=t.clone$1(e),e=t.extend(e,{source:n})),this._validate(t.validateStyle.layer,"layers."+n,e,{arrayIndex:-1},i))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:n}}),this._serializedLayers[o.id]=o.serialize()}var a=r?this._order.indexOf(r):this._order.length;if(r&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(a,0,n),this._layerOrderChanged=!0,this._layers[n]=o,this._removedLayers[n]&&o.source&&"custom"!==o.type){var s=this._removedLayers[n];delete this._removedLayers[n],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var i=this._order.indexOf(e);this._order.splice(i,1);var n=r?this._order.indexOf(r):this._order.length;
vendor: 11,588 bytes, line 16
16r&&-1===n?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(n,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var i=this._order.indexOf(e);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,i){this._checkLoaded();var n=this.getLayer(e);n?n.minzoom===r&&n.maxzoom===i||(null!=r&&(n.minzoom=r),null!=i&&(n.maxzoom=i),this._updateLayer(n)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,i){void 0===i&&(i={}),this._checkLoaded();var n=this.getLayer(e);if(n){if(!t.deepEqual(n.filter,r))return null==r?(n.filter=void 0,void this._updateLayer(n)):void(this._validate(t.validateStyle.filter,"layers."+n.id+".filter",r,null,i)||(n.filter=t.clone$1(r),this._updateLayer(n)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,i,n){void 0===n&&(n={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(r),i)||(o.setLayoutProperty(r,i,n),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var i=this.getLayer(e);if(i)return i.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,i,n){void 0===n&&(n={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(r),i)||(o.setPaintProperty(r,i,n)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var i=e.source,n=e.sourceLayer,o=this.sourceCaches[i];if(void 0!==o){var a=o.getSource().type;"geojson"===a&&n?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||n?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(n,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var i=e.source,n=this.sourceCaches[i];if(void 0!==n){var o=n.getSource().type,a="vector"===o?e.sourceLayer:void 0;"vector"!==o||a?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):n.removeFeatureState(a,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,i=e.sourceLayer,n=this.sourceCaches[r];if(void 0!==n){if("vector"!==n.getSource().type||i)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),n.getFeatureState(i,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},i={},n=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(r(a)){i[a]=o;for(var s=0,l=t;s<l.length;s+=1){var u=l[s][a];if(u)for(var c=0,h=u;c<h.length;c+=1)n.push(h[c])}}}n.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var p=[],d=this._order.length-1;d>=0;d--){var f=this._order[d];if(r(f))for(var m=n.length-1;m>=0;m--){var g=n[m].feature;if(i[g.layer.id]<d)break;p.push(g),n.pop()}else for(var y=0,v=t;y<v.length;y+=1){var _=v[y][f];if(_)for(var b=0,x=_;b<x.length;b+=1)p.push(x[b].feature)}}return p},r.prototype.queryRenderedFeatures=function(e,r,i){r&&r.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);var n={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var o=0,a=r.layers;o<a.length;o+=1){var s=a[o],l=this._layers[s];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];n[l.source]=!0}}var u=[];for(var c in r.availableImages=this._availableImages,this.sourceCaches)r.layers&&!n[c]||u.push(B(this.sourceCaches[c],this._layers,this._serializedLayers,e,r,i));return this.placement&&u.push(function(t,e,r,i,n,o,a){for(var s={},l=o.queryRenderedSymbols(i),u=[],c=0,h=Object.keys(l).map(Number);c<h.length;c+=1)u.push(a[h[c]]);u.sort(F);for(var p=function(){var r=f[d],i=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],e,r.bucketIndex,r.sourceLayerIndex,n.filter,n.layers,n.availableImages,t);for(var o in i){var a=s[o]=s[o]||[],u=i[o];u.sort((function(t,e){var i=r.featureSortOrder;if(i){var n=i.indexOf(t.featureIndex);return i.indexOf(e.featureIndex)-n}return e.featureIndex-t.featureIndex}));for(var c=0,h=u;c<h.length;c+=1)a.push(h[c])}},d=0,f=u;d<f.length;d+=1)p();var m=function(e){s[e].forEach((function(i){var n=i.feature,o=r[t[e].source].getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=o}))};for(var g in s)m(g);return s}(this._layers,this._serializedLayers,this.sourceCaches,e,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(u)},r.prototype.querySourceFeatures=function(e,r){r&&r.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r);var i=this.sourceCaches[e];return i?function(t,e){for(var r=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),i=[],n={},o=0;o<r.length;o++){var a=r[o],s=a.tileID.canonical.key;n[s]||(n[s]=!0,a.querySourceFeatures(i,e))}return i}(i,r):[]},r.prototype.addSourceType=function(t,e,i){return r.getSourceType(t)?i(new Error('A source type called "'+t+'" already exists.')):(r.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},i):i(null,null))},r.prototype.getLight=function(){return this.light.getLight()},r.prototype.setLight=function(e,r){void 0===r&&(r={}),this._checkLoaded();var i=this.light.getLight(),n=!1;for(var o in e)if(!t.deepEqual(e[o],i[o])){n=!0;break}if(n){var a={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(a)}},r.prototype._validate=function(e,r,i,n,o){return void 0===o&&(o={}),(!o||!1!==o.validate)&&je(this,e.call(t.validateStyle,t.extend({key:r,style:this.serialize(),value:i,styleSpec:t.styleSpec},n)))},r.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var r in this.sourceCaches)this.sourceCaches[r].clearTiles(),this.sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},r.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},r.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},r.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},r.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},r.prototype._updatePlacement=function(e,r,i,n,o){void 0===o&&(o=!1);for(var a=!1,s=!1,l={},u=0,c=this._order;u<c.length;u+=1){var h=this._layers[c[u]];if("symbol"===h.type){if(!l[h.source]){var p=this.sourceCaches[h.source];l[h.source]=p.getRenderableIds(!0).map((function(t){return p.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))}var d=this.crossTileSymbolIndex.addLayer(h,l[h.source],e.center.lng);a=a||d}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((o=o||this._layerOrderChanged||0===i)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new ze(e,this._order,o,r,i,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(var f=0,m=this._order;f<m.length;f+=1){var g=this._layers[m[f]];"symbol"===g.type&&this.placement.updateLayerOpacities(g,l[g.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},r.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},r.prototype.getImages=function(t,e,r){this.imageManager.getImages(e.icons,r),this._updateTilesForChangedImages();var i=this.sourceCaches[e.source];i&&i.setDependencies(e.tileID.key,e.type,e.icons)},r.prototype.getGlyphs=function(t,e,r){this.glyphManager.getGlyphs(e.stacks,r)}
16,r.prototype.getResource=function(e,r,i){return t.makeRequest(r,i)},r}(t.Evented);qe.getSourceType=function(t){return O[t]},qe.setSourceType=function(t,e){O[t]=e},qe.registerForPluginStateChange=t.registerForPluginStateChange;var Ge=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ze=yr("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\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(unpack_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;}"),We=yr("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),He=yr("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),Xe=yr("varying vec3 v_data;\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(antialiased_blur,0.0,extrude_length-radius
16/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\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(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);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),Ye=yr("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);}"),Ke=yr("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 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;varying 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;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),Je=yr("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}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),Qe=yr("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),$e=yr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),tr=yr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),er=yr("#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_FragColor=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);}"),rr=yr("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);gl_FragColor=outline_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;}"),ir=yr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\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 vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),nr=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\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 vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),or=yr("varying vec4 v_color;void main() {gl_FragColor=v_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;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\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\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),ar=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\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 vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixe
16l_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),sr=yr("#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 float u_maxzoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\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;}"),lr=yr("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;\n#define PI 3.141592653589793\nvoid 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 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;}"),ur=yr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\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);gl_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;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\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 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;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),cr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\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);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\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 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;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),hr=yr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\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_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\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_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),pr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;
16uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\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);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\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\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\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\n#pragma mapbox: initialize lowp float floorwidth\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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),dr=yr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\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 float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),fr=yr("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}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\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_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.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(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),mr=yr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\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}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\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_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.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(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float 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(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),gr=yr("#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;
16gl_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}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\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_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.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(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float 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(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function yr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i=e.match(/attribute ([\w]+) ([\w]+)/g),n=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(n):n,s={};return{fragmentSource:t=t.replace(r,(function(t,e,r,i,n){return s[n]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\
16nvarying "+r+" "+i+" "+n+";\n#else\nuniform "+r+" "+i+" u_"+n+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+n+"\n "+r+" "+i+" "+n+" = u_"+n+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,i,n){var o="float"===i?"vec2":"vec4",a=n.match(/color/)?"color":o;return s[n]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+r+" "+o+" a_"+n+";\nvarying "+r+" "+i+" "+n+";\n#else\nuniform "+r+" "+i+" u_"+n+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = a_"+n+";\n#else\n "+r+" "+i+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = unpack_mix_"+a+"(a_"+n+", u_"+n+"_t);\n#else\n "+r+" "+i+" "+n+" = u_"+n+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+r+" "+o+" a_"+n+";\n#else\nuniform "+r+" "+i+" u_"+n+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+r+" "+i+" "+n+" = a_"+n+";\n#else\n "+r+" "+i+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+r+" "+i+" "+n+" = unpack_mix_"+a+"(a_"+n+", u_"+n+"_t);\n#else\n "+r+" "+i+" "+n+" = u_"+n+";\n#endif\n"})),staticAttributes:i,staticUniforms:a}}var vr=Object.freeze({__proto__:null,prelude:Ze,background:We,backgroundPattern:He,circle:Xe,clippingMask:Ye,heatmap:Ke,heatmapTexture:Je,collisionBox:Qe,collisionCircle:$e,debug:tr,fill:er,fillOutline:rr,fillOutlinePattern:ir,fillPattern:nr,fillExtrusion:or,fillExtrusionPattern:ar,hillshadePrepare:sr,hillshade:lr,line:ur,lineGradient:cr,linePattern:hr,lineSDF:pr,raster:dr,symbolIcon:fr,symbolSDF:mr,symbolTextAndIcon:gr}),_r=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function br(t){for(var e=[],r=0;r<t.length;r++)if(null!==t[r]){var i=t[r].split(" ");e.push(i.pop())}return e}_r.prototype.bind=function(t,e,r,i,n,o,a,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==i.length,u=0;!l&&u<i.length;u++)this.boundPaintVertexBuffers[u]!==i[u]&&(l=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===r&&!l&&this.boundIndexBuffer===n&&this.boundVertexOffset===o&&this.boundDynamicVertexBuffer===a&&this.boundDynamicVertexBuffer2===s?(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),n&&n.dynamicDraw&&n.bind(),s&&s.bind()):this.freshBind(e,r,i,n,o,a,s)},_r.prototype.freshBind=function(t,e,r,i,n,o,a){var s,l=t.numAttributes,u=this.context,c=u.gl;if(u.extVertexArrayObject)this.vao&&this.destroy(),this.vao=u.extVertexArrayObject.createVertexArrayOES(),u.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=i,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a;else{s=u.currentNumAttributes||0;for(var h=l;h<s;h++)c.disableVertexAttribArray(h)}e.enableAttributes(c,t);for(var p=0,d=r;p<d.length;p+=1)d[p].enableAttributes(c,t);o&&o.enableAttributes(c,t),a&&a.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,n);for(var f=0,m=r;f<m.length;f+=1){var g=m[f];g.bind(),g.setVertexAttribPointers(c,t,n)}o&&(o.bind(),o.setVertexAttribPointers(c,t,n)),i&&i.bind(),a&&(a.bind(),a.setVertexAttribPointers(c,t,n)),u.currentNumAttributes=l},_r.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var xr=function(t,e,r,i,n,o){var a=t.gl;this.program=a.createProgram();for(var s=br(r.staticAttributes),l=i?i.getBinderAttributes():[],u=s.concat(l),c=r.staticUniforms?br(r.staticUniforms):[],h=i?i.getBinderUniforms():[],p=[],d=0,f=c.concat(h);d<f.length;d+=1){var m=f[d];p.indexOf(m)<0&&p.push(m)}var g=i?i.defines():[];o&&g.push("#define OVERDRAW_INSPECTOR;");var y=g.concat(Ze.fragmentSource,r.fragmentSource).join("\n"),v=g.concat(Ze.vertexSource,r.vertexSource).join("\n"),_=a.createShader(a.FRAGMENT_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(_,y),a.compileShader(_),a.attachShader(this.program,_);var b=a.createShader(a.VERTEX_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(b,v),a.compileShader(b),a.attachShader(this.program,b),this.attributes={};var x={};this.numAttributes=u.length;for(var w=0;w<this.numAttributes;w++)u[w]&&(a.bindAttribLocation(this.program,w,u[w]),this.attributes[u[w]]=w);a.linkProgram(this.program),a.deleteShader(b),a.deleteShader(_);for(var A=0;A<p.length;A++){var E=p[A];if(E&&!x[E]){var T=a.getUniformLocation(this.program,E);T&&(x[E]=T)}}this.fixedUniforms=n(t,x),this.binderUniforms=i?i.getUniforms(t,x):[]}}};function wr(t,e,r){var i=1/pe(r,1,e.transform.tileZoom),n=Math.pow(2,r.tileID.overscaledZ
vendor: 5,688 bytes, line 16
16),o=r.tileSize*Math.pow(2,e.transform.tileZoom)/n,a=o*(r.tileID.canonical.x+r.tileID.wrap*n),s=o*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[i,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}xr.prototype.draw=function(t,e,r,i,n,o,a,s,l,u,c,h,p,d,f,m){var g,y=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(i),t.setColorMode(n),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[v].set(a[v]);d&&d.setUniforms(t,this.binderUniforms,h,{zoom:p});for(var _=(g={},g[y.LINES]=2,g[y.TRIANGLES]=3,g[y.LINE_STRIP]=1,g)[e],b=0,x=c.get();b<x.length;b+=1){var w=x[b],A=w.vaos||(w.vaos={});(A[s]||(A[s]=new _r)).bind(t,this,l,d?d.getPaintVertexBuffers():[],u,w.vertexOffset,f,m),y.drawElements(e,w.primitiveLength*_,y.UNSIGNED_SHORT,w.primitiveOffset*_*2)}}};var Ar=function(e,r,i,n){var o=r.style.light,a=o.properties.get("position"),s=[a.x,a.y,a.z],l=t.create$1();"viewport"===o.properties.get("anchor")&&t.fromRotation(l,-r.transform.angle),t.transformMat3(s,s,l);var u=o.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+i,u_opacity:n}},Er=function(e,r,i,n,o,a,s){return t.extend(Ar(e,r,i,n),wr(a,r,s),{u_height_factor:-Math.pow(2,o.overscaledZ)/s.tileSize/8})},Tr=function(t){return{u_matrix:t}},Sr=function(e,r,i,n){return t.extend(Tr(e),wr(i,r,n))},Pr=function(t,e){return{u_matrix:t,u_world:e}},Ir=function(e,r,i,n,o){return t.extend(Sr(e,r,i,n),{u_world:o})},Mr=function(e,r,i,n){var o,a,s=e.transform;if("map"===n.paint.get("circle-pitch-alignment")){var l=pe(i,1,s.zoom);o=!0,a=[l,l]}else o=!1,a=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===n.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(r.posMatrix,i,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+o,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:a}},Cr=function(t,e,r){var i=pe(r,1,e.zoom),n=Math.pow(2,e.zoom-r.tileID.overscaledZ),o=r.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:i,u_extrude_scale:[e.pixelsToGLUnits[0]/(i*n),e.pixelsToGLUnits[1]/(i*n)],u_overscale_factor:o}},kr=function(t,e,r){return{u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},Lr=function(t,e,r){return void 0===r&&(r=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}},zr=function(t){return{u_matrix:t}},Rr=function(t,e,r,i){return{u_matrix:t,u_extrude_scale:pe(e,1,r),u_intensity:i}},Or=function(e,r,i){var n=e.transform;return{u_matrix:Nr(e,r,i),u_ratio:1/pe(r,1,n.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},Dr=function(e,r,i){return t.extend(Or(e,r,i),{u_image:0})},Br=function(e,r,i,n){var o=e.transform,a=jr(r,o);return{u_matrix:Nr(e,r,i),u_texsize:r.imageAtlasTexture.size,u_ratio:1/pe(r,1,o.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[a,n.fromScale,n.toScale],u_fade:n.t,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Fr=function(e,r,i,n,o){var a=e.lineAtlas,s=jr(r,e.transform),l="round"===i.layout.get("line-cap"),u=a.getDash(n.from,l),c=a.getDash(n.to,l),h=u.width*o.fromScale,p=c.width*o.toScale;return t.extend(Or(e,r,i),{u_patternscale_a:[s/h,-u.height/2],u_patternscale_b:[s/p,-c.height/2],u_sdfgamma:a.width/(256*Math.min(h,p)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:c.y,u_mix:o.t})};function jr(t,e){return 1/pe(t,1,e.tileZoom)}function Nr(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Ur=function(t,e,r,i,n){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*n.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:n.paint.get("raster-brightness-min"),u_brightness_high:n.paint.get("raster-brightness-max"),u_saturation_factor:(a=n.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(o=n.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:Vr(n.paint.get("raster-hue-rotate"))};var o,a};function Vr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var qr,Gr=function(t,e,r,i,n,o,a,s,l,u){var c=n.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:n.options.fadeDuration?n.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+i,u_texsize:u,u_texture:0}},Zr=function(e,r,i,n,o,a,s,l,u,c,h){var p=o.transform;return t.extend(Gr(e,r,i,n,o,a,s,l,u,c),{u_gamma_scale:n?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Wr=function(e,r,i,n,o,a,s,l,u,c){return t.extend(Zr(e,r,i,n,o,a,s,l,!0,u,!0),{u_texsize_icon:c,u_texture_icon:1})},Hr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Xr=function(e,r,i,n,o,a){return t.extend(function(t,e,r,i){var n=r.imageManager.getPattern(t.from.toString()),o=r.imageManager.getPattern(t.to.toString()),a=r.imageManager.getPixelSize(),s=a.width,l=a.height,u=Math.pow(2,i.tileID.overscaledZ
vendor: 7,460 bytes, line 16
16),c=i.tileSize*Math.pow(2,r.transform.tileZoom)/u,h=c*(i.tileID.canonical.x+i.tileID.wrap*u),p=c*i.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:n.tl,u_pattern_br_a:n.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:n.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/pe(i,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(n,a,i,o),{u_matrix:e,u_opacity:r})},Yr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_maxzoom:new t.Uniform1f(e,r.u_maxzoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix
vendor: 15,226 bytes, line 16
16),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Kr(e,r,i,n,o,a,s){for(var l=e.context,u=l.gl,c=e.useProgram("collisionBox"),h=[],p=0,d=0,f=0;f<n.length;f++){var m=n[f],g=r.getTile(m),y=g.getBucket(i);if(y){var v=m.posMatrix;0===o[0]&&0===o[1]||(v=e.translatePosMatrix(m.posMatrix,g,o,a));var _=s?y.textCollisionBox:y.iconCollisionBox,b=y.collisionCircleArray;if(b.length>0){var x=t.create(),w=v;t.mul(x,y.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(x,x,y.placementViewportMatrix),h.push({circleArray:b,circleOffset:d,transform:w,invTransform:x}),d=p+=b.length/4}_&&c.draw(l,u.LINES,Tt.disabled,St.disabled,e.colorModeForRenderPass(),It.disabled,Cr(v,e.transform,g),i.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,null,e.transform.zoom,null,null,_.collisionVertexBuffer)}}if(s&&h.length){var A=e.useProgram("collisionCircle"),E=new t.StructArrayLayout2f1f2i16;E.resize(4*p),E._trim();for(var T=0,S=0,P=h;S<P.length;S+=1)for(var I=P[S],M=0;M<I.circleArray.length/4;M++){var C=4*M,k=I.circleArray[C+0],L=I.circleArray[C+1],z=I.circleArray[C+2],R=I.circleArray[C+3];E.emplace(T++,k,L,z,R,0),E.emplace(T++,k,L,z,R,1),E.emplace(T++,k,L,z,R,2),E.emplace(T++,k,L,z,R,3)}(!qr||qr.length<2*p)&&(qr=function(e){var r=2*e,i=new t.StructArrayLayout3ui6;i.resize(r),i._trim();for(var n=0;n<r;n++){var o=6*n;i.uint16[o+0]=4*n+0,i.uint16[o+1]=4*n+1,i.uint16[o+2]=4*n+2,i.uint16[o+3]=4*n+2,i.uint16[o+4]=4*n+3,i.uint16[o+5]=4*n+0}return i}(p));for(var O=l.createIndexBuffer(qr,!0),D=l.createVertexBuffer(E,t.collisionCircleLayout.members,!0),B=0,F=h;B<F.length;B+=1){var j=F[B],N=kr(j.transform,j.invTransform,e.transform);A.draw(l,u.TRIANGLES,Tt.disabled,St.disabled,e.colorModeForRenderPass(),It.disabled,N,i.id,D,O,t.SegmentVector.simpleSegment(0,2*j.circleOffset,j.circleArray.length,j.circleArray.length/2),null,e.transform.zoom,null,null,null)}D.destroy(),O.destroy()}}var Jr=t.identity(new Float32Array(16));function Qr(e,r,i,n,o,a){var s=t.getAnchorAlignment(e),l=-(s.horizontalAlign-.5)*r,u=-(s.verticalAlign-.5)*i,c=t.evaluateVariableOffset(e,n);return new t.Point((l/o+c[0])*a,(u/o+c[1])*a)}function $r(e,r,i,n,o,a,s,l,u,c,h){var p=e.text.placedSymbolArray,d=e.text.dynamicLayoutVertexArray,f=e.icon.dynamicLayoutVertexArray,m={};d.clear();for(var g=0;g<p.length;g++){var y=p.get(g),v=y.hidden||!y.crossTileID||e.allowVerticalPlacement&&!y.placedOrientation?null:n[y.crossTileID];if(v){var _=new t.Point(y.anchorX,y.anchorY),b=$t(_,i?l:s),x=te(a.cameraToCenterDistance,b.signedDistanceFromCamera),w=o.evaluateSizeForFeature(e.textSizeData,c,y)*x/t.ONE_EM;i&&(w*=e.tilePixelRatio/u);for(var A=Qr(v.anchor,v.width,v.height,v.textOffset,v.textBoxScale,w),E=i?$t(_.add(A),s).point:b.point.add(r?A.rotate(-a.angle):A),T=e.allowVerticalPlacement&&y.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,S=0;S<y.numGlyphs;S++)t.addDynamicAttributes(d,E,T);h&&y.associatedIconIndex>=0&&(m[y.associatedIconIndex]={shiftedAnchor:E,angle:T})}else ue(y.numGlyphs,d)}if(h){f.clear();for(var P=e.icon.placedSymbolArray,I=0;I<P.length;I++){var M=P.get(I);if(M.hidden)ue(M.numGlyphs,f);else{var C=m[I];if(C)for(var k=0;k<M.numGlyphs;k++)t.addDynamicAttributes(f,C.shiftedAnchor,C.angle);else ue(M.numGlyphs,f)}}e.icon.dynamicLayoutVertexBuffer.updateData(f)}e.text.dynamicLayoutVertexBuffer.updateData(d)}function ti(t,e,r){return r.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function ei(e,r,i,n,o,a,s,l,u,c,h,p){for(var d=e.context,f=d.gl,m=e.transform,g="map"===l,y="map"===u,v=g&&"point"!==i.layout.get("symbol-placement"),_=g&&!y&&!v,b=void 0!==i.layout.get("symbol-sort-key").constantOr(1),x=e.depthModeForSublayer(0,Tt.ReadOnly),w=i.layout.get("text-variable-anchor"),A=[],E=0,T=n;E<T.length;E+=1){var S=T[E],P=r.getTile(S),I=P.getBucket(i);if(I){var M=o?I.text:I.icon;if(M&&M.segments.get().length){var C=M.programConfigurations.get(i.id),k=o||I.sdfIcons,L=o?I.textSizeData:I.iconSizeData,z=y||0!==m.pitch,R=e.useProgram(ti(k,o,I),C),O=t.evaluateSizeForZoom(L,m.zoom),D=void 0,B=[0,0],F=void 0,j=void 0,N=null,U=void 0;if(o)F=P.glyphAtlasTexture,j=f.LINEAR,D=P.glyphAtlasTexture.size,I.iconsInText&&(B=P.imageAtlasTexture.size,N=P.imageAtlasTexture,U=z||e.options.rotating||e.options.zooming||"composite"===L.kind||"camera"===L.kind?f.LINEAR:f.NEAREST);else{var V=1!==i.layout.get("icon-size").constantOr(0)||I.iconsNeedLinear;F=P.imageAtlasTexture,j=k||e.options.rotating||e.options.zooming||V||z?f.LINEAR:f.NEAREST,D=P.imageAtlasTexture.size}var q=pe(P,1,e.transform.zoom),G=Jt(S.posMatrix,y,g,e.transform,q),Z=Qt(S.posMatrix,y,g,e.transform,q),W=w&&I.hasTextData(),H="none"!==i.layout.get("icon-text-fit")&&W&&I.hasIconData();v&&re(I,S.posMatrix,e,o,G,Z,y,c);var X=e.translatePosMatrix(S.posMatrix,P,a,s),Y=v||o&&w||H?Jr:G,K=e.translatePosMatrix(Z,P,a,s,!0),J=k&&0!==i.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1),Q={program:R,buffers:M,uniformValues:k?I.iconsInText?Wr(L.kind,O,_,y,e,X,Y,K,D,B):Zr(L.kind,O,_,y,e,X,Y,K,o,D,!0):Gr(L.kind,O,_,y,e,X,Y,K,o,D),atlasTexture:F,atlasTextureIcon:N,atlasInterpolation:j,atlasInterpolationIcon:U,isSDF:k,hasHalo:J};if(b)for(var $=0,tt=M.segments.get();$<tt.length;$+=1){var et=tt[$];A.push({segments:new t.SegmentVector([et]),sortKey:et.sortKey,state:Q})}else A.push({segments:M.segments,sortKey:0,state:Q})}}}b&&A.sort((function(t,e){return t.sortKey-e.sortKey}));for(var rt=0,it=A;rt<it.length;rt+=1){var nt=it[rt],ot=nt.state;if(d.activeTexture.set(f.TEXTURE0),ot.atlasTexture.bind(ot.atlasInterpolation,f.CLAMP_TO_EDGE),ot.atlasTextureIcon&&(d.activeTexture.set(f.TEXTURE1),ot.atlasTextureIcon&&ot.atlasTextureIcon.bind(ot.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),ot.isSDF){var at=ot.uniformValues;ot.hasHalo&&(at.u_is_halo=1,ri(ot.buffers,nt.segments,i,e,ot.program,x,h,p,at)),at.u_is_halo=0}ri(ot.buffers,nt.segments,i,e,ot.program,x,h,p,ot.uniformValues)}}function ri(t,e,r,i,n,o,a,s,l){var u=i.context;n.draw(u,u.gl.TRIANGLES,o,a,s,It.disabled,l,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,i.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function ii(t,e,r,i,n,o,a){var s,l,u,c,h,p=t.context.gl,d=r.paint.get("fill-pattern"),f=d&&d.constantOr(1),m=r.getCrossfadeParameters();a?(l=f&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=p.LINES):(l=f?"fillPattern":"fill",s=p.TRIANGLES);for(var g=0,y=i;g<y.length;g+=1){var v=y[g],_=e.getTile(v);if(!f||_.patternsLoaded()){var b=_.getBucket(r);if(b){var x=b.programConfigurations.get(r.id),w=t.useProgram(l,x);f&&(t.context.activeTexture.set(p.TEXTURE0),_.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),x.updatePaintBuffers(m));var A=d.constantOr(null);if(A&&_.imageAtlas){var E=_.imageAtlas,T=E.patternPositions[A.to.toString()],S=E.patternPositions[A.from.toString()];T&&S&&x.setConstantPatternPositions(T,S)}var P=t.translatePosMatrix(v.posMatrix,_,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(a){c=b.indexBuffer2,h=b.segments2;var I=[p.drawingBufferWidth,p.drawingBufferHeight];u="fillOutlinePattern"===l&&f?Ir(P,t,m,_,I):Pr(P,I)}else c=b.indexBuffer,h=b.segments,u=f?Sr(P,t,m,_):Tr(P);w.draw(t.context,s,n,t.stencilModeForClipping(v),o,It.disabled,u,r.id,b.layoutVertexBuffer,c,h,r.paint,t.transform.zoom,x)}}}}function ni(t,e,r,i,n,o,a){for(var s=t.context,l=s.gl,u=r.paint.get("fill-extrusion-pattern"),c=u.constantOr(1),h=r.getCrossfadeParameters(),p=r.paint.get("fill-extrusion-opacity"),d=0,f=i;d<f.length;d+=1){var m=f[d],g=e.getTile(m),y=g.getBucket(r);if(y){var v=y.programConfigurations.get(r.id),_=t.useProgram(c?"fillExtrusionPattern":"fillExtrusion",v);c&&(t.context.activeTexture.set(l.TEXTURE0),g.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),v.updatePaintBuffers(h));var b=u.constantOr(null);if(b&&g.imageAtlas){var x=g.imageAtlas,w=x.patternPositions[b.to.toString()],A=x.patternPositions[b.from.toString()];w&&A&&v.setConstantPatternPositions(w,A)}var E=t.translatePosMatrix(m.posMatrix,g,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),T=r.paint.get("fill-extrusion-vertical-gradient"),S=c?Er(E,t,T,p,m,h,g):Ar(E,t,T,p);_.draw(s,s.gl.TRIANGLES,n,o,a,It.backCCW,S,r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,r.paint,t.transform.zoom,v)}}}function oi(e,r,i,n,o,a){var s=e.context,l=s.gl,u=r.fbo;if(u){var c=e.useProgram("hillshade");s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,u.colorAttachment.get());var h=function(e,r,i){var n=i.paint.get("hillshade-shadow-color"),o=i.paint.get("hillshade-highlight-color"),a=i.paint.get("hillshade-accent-color"),s=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===i.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);var l,u,c,h=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(r.tileID.toUnwrapped(),h),u_image:0,u_latrange:(l=r.tileID,u=Math.pow(2,l.canonical.z),c=l.canonical.y,[new t.MercatorCoordinate(0,c/u).toLngLat().lat,new t.MercatorCoordinate(0,(c+1)/u).toLngLat().lat]),u_light:[i.paint.get("hillshade-exaggeration"),s],u_shadow:n,u_highlight:o,u_accent:a}}(e,r,i);c.draw(s,l.TRIANGLES,n,o,a,It.disabled,h,i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function ai(e,r,i,n,o,a,s){var l=e.context,u=l.gl,c=r.dem;if(c&&c.data){var h=c.dim,p=c.stride,d=c.getPixels();if(l.activeTexture.set(u.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||e.getTileTexture(p),r.demTexture){var f=r.demTexture;f.update(d,{premultiply:!1}),f.bind(u.NEAREST,u.CLAMP_TO_EDGE)}else r.demTexture=new t.Texture(l,d,u.RGBA,{premultiply:!1}),r.demTexture.bind(u.NEAREST,u.CLAMP_TO_EDGE);l.activeTexture.set(u.TEXTURE0);var m=r.fbo;if(!m){var g=new t.Texture(l,{width:h,height:h,data:null},u.RGBA);g.bind(u.LINEAR,u.CLAMP_TO_EDGE),(m=r.fbo=l.createFramebuffer(h,h,!0)).colorAttachment.set(g.texture)}l.bindFramebuffer.set(m.framebuffer),l.viewport.set([0,0,h,h]),e.useProgram("hillshadePrepare").draw(l,u.TRIANGLES,o,a,s,It.disabled,function(e,r,i){var n=r.stride,o=t.create();return t.ortho(o,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(o,o,[0,-t.EXTENT,0]),{u_matrix:o,u_image:1,u_dimension:[n,n],u_zoom:e.overscaledZ,u_maxzoom:i,u_unpack:r.getUnpackVector()}}(r.tileID,c,n),i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function si(e,r,i,n,o){var a=n.paint.get("raster-fade-duration");if(a>0){var s=t.browser.now(),l=(s-e.timeAdded)/a,u=r?(s-r.timeAdded)/a:-1,c=i.getSource(),h=o.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),d=p&&e.refreshedUponExpiration?1:t.clamp(p?l:1-u,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}var li=new t.Color(1,0,0,1),ui=new t.Color(0,1,0,1),ci=new t.Color(0,0,1,1),hi=new t.Color(1,0,1,1),pi=new t.Color(0,1,1,1);function di(t,e,r,i){mi(t,0,e+r/2,t.transform.width,r,i)}function fi(t,e,r,i){mi(t,e-r/2,0,r,t.transform.height,i)}function mi(e,r,i,n,o,a){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),s.clear({color:a}),l.disable(l.SCISSOR_TEST)}function gi(e,r,i){var n=e.context,o=n.gl,a=i.posMatrix,s=e.useProgram("debug"),l=Tt.disabled,u=St.disabled,c=e.colorModeForRenderPass();n.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.draw(n,o.LINE_STRIP,l,u,c,It.disabled,Lr(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=r.getTileByID(i.key).latestRawTileData,p=Math.floor((h&&h.byteLength||0)/1024),d=r.getTile(i).tileSize,f=512/Math.min(d,512)*(i.overscaledZ/e.transform.zoom)*.5,m=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(m+=" =>
16 "+i.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,i=t.context.gl,n=t.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,r.width,r.height),n.shadowColor="white",n.shadowBlur=2,n.lineWidth=1.5,n.strokeStyle="white",n.textBaseline="top",n.font="bold 36px Open Sans, sans-serif",n.fillText(e,5,5),n.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}(e,m+" "+p+"kb"),s.draw(n,o.TRIANGLES,l,u,Pt.alphaBlended,It.disabled,Lr(a,t.Color.transparent,f),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var yi={symbol:function(e,r,i,n,o){if("translucent"===e.renderPass){var a=St.disabled,s=e.colorModeForRenderPass();i.layout.get("text-variable-anchor")&&function(e,r,i,n,o,a,s){for(var l=r.transform,u="map"===o,c="map"===a,h=0,p=e;h<p.length;h+=1){var d=p[h],f=n.getTile(d),m=f.getBucket(i);if(m&&m.text&&m.text.segments.get().length){var g=t.evaluateSizeForZoom(m.textSizeData,l.zoom),y=pe(f,1,r.transform.zoom),v=Jt(d.posMatrix,c,u,r.transform,y),_="none"!==i.layout.get("icon-text-fit")&&m.hasIconData();if(g){var b=Math.pow(2,l.zoom-f.tileID.overscaledZ);$r(m,u,c,s,t.symbolSize,l,v,d.posMatrix,b,g,_)}}}}(n,e,i,r,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),o),0!==i.paint.get("icon-opacity").constantOr(1)&&ei(e,r,i,n,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),a,s),0!==i.paint.get("text-opacity").constantOr(1)&&ei(e,r,i,n,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),a,s),r.map.showCollisionBoxes&&(Kr(e,r,i,n,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),!0),Kr(e,r,i,n,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),!1))}},circle:function(e,r,i,n){if("translucent"===e.renderPass){var o=i.paint.get("circle-opacity"),a=i.paint.get("circle-stroke-width"),s=i.paint.get("circle-stroke-opacity"),l=void 0!==i.layout.get("circle-sort-key").constantOr(1);if(0!==o.constantOr(1)||0!==a.constantOr(1)&&0!==s.constantOr(1)){for(var u=e.context,c=u.gl,h=e.depthModeForSublayer(0,Tt.ReadOnly),p=St.disabled,d=e.colorModeForRenderPass(),f=[],m=0;m<n.length;m++){var g=n[m],y=r.getTile(g),v=y.getBucket(i);if(v){var _=v.programConfigurations.get(i.id),b={programConfiguration:_,program:e.useProgram("circle",_),layoutVertexBuffer:v.layoutVertexBuffer,indexBuffer:v.indexBuffer,uniformValues:Mr(e,g,y,i)};if(l)for(var x=0,w=v.segments.get();x<w.length;x+=1){var A=w[x];f.push({segments:new t.SegmentVector([A]),sortKey:A.sortKey,state:b})}else f.push({segments:v.segments,sortKey:0,state:b})}}l&&f.sort((function(t,e){return t.sortKey-e.sortKey}));for(var E=0,T=f;E<T.length;E+=1){var S=T[E],P=S.state;P.program.draw(u,c.TRIANGLES,h,p,d,It.disabled,P.uniformValues,i.id,P.layoutVertexBuffer,P.indexBuffer,S.segments,i.paint,e.transform.zoom,P.programConfiguration)}}}},heatmap:function(e,r,i,n){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var o=e.context,a=o.gl,s=St.disabled,l=new Pt([a.ONE,a.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,r){var i=t.gl;t.activeTexture.set(i.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var n=r.heatmapFbo;if(n)i.bindTexture(i.TEXTURE_2D,n.colorAttachment.get()),t.bindFramebuffer.set(n.framebuffer);else{var o=i.createTexture();i.bindTexture(i.TEXTURE_2D,o),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),n=r.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function(t,e,r,i){var n=t.gl;n.texImage2D(n.TEXTURE_2D,0,n.RGBA,e.width/4,e.height/4,0,n.RGBA,t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:n.UNSIGNED_BYTE,null),i.colorAttachment.set(r)}(t,e,o,n)}}(o,e,i),o.clear({color:t.Color.transparent});for(var u=0;u<n.length;u++){var c=n[u];if(!r.hasRenderableParent(c)){var h=r.getTile(c),p=h.getBucket(i);if(p){var d=p.programConfigurations.get(i.id);e.useProgram("heatmap",d).draw(o,a.TRIANGLES,Tt.disabled,s,l,It.disabled,Rr(c.posMatrix,h,e.transform.zoom,i.paint.get("heatmap-intensity")),i.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,i.paint,e.transform.zoom,d)}}}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,r){var i=e.context,n=i.gl,o=r.heatmapFbo;if(o){i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,o.colorAttachment.get()),i.activeTexture.set(n.TEXTURE1);var a=r.colorRampTexture;a||(a=r.colorRampTexture=new t.Texture(i,r.colorRamp,n.RGBA)),a.bind(n.LINEAR,n.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(i,n.TRIANGLES,Tt.disabled,St.disabled,e.colorModeForRenderPass(),It.disabled,function(e,r){var i=t.create();t.ortho(i,0,e.width,e.height,0,0,1);var n=e.context.gl;return{u_matrix:i,u_world:[n.drawingBufferWidth,n.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:r.paint.get("heatmap-opacity")}}(e,r),r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom)}}(e,i))},line:function(e,r,i,n){if("translucent"===e.renderPass){var o=i.paint.get("line-opacity"),a=i.paint.get("line-width");if(0!==o.constantOr(1)&&0!==a.constantOr(1)){var s=e.depthModeForSublayer(0,Tt.ReadOnly),l=e.colorModeForRenderPass(),u=i.paint.get("line-dasharray"),c=i.paint.get("line-pattern"),h=c.constantOr(1),p=i.paint.get("line-gradient"),d=i.getCrossfadeParameters(),f=h?"linePattern":u?"lineSDF":p?"lineGradient":"line",m=e.context,g=m.gl,y=!0;if(p){m.activeTexture.set(g.TEXTURE0);var v=i.gradientTexture;if(!i.gradient)return;v||(v=i.gradientTexture=new t.Texture(m,i.gradient,g.RGBA)),v.bind(g.LINEAR,g.CLAMP_TO_EDGE)}for(var _=0,b=n;_<b.length;_+=1){var x=b[_],w=r.getTile(x);if(!h||w.patternsLoaded()){var A=w.getBucket(i);if(A){var E=A.programConfigurations.get(i.id),T=e.context.program.get(),S=e.useProgram(f,E),P=y||S.program!==T,I=c.constantOr(null);if(I&&w.imageAtlas){var M=w.imageAtlas,C=M.patternPositions[I.to.toString()],k=M.patternPositions[I.from.toString()];C&&k&&E.setConstantPatternPositions(C,k)}var L=h?Br(e,w,i,d):u?Fr(e,w,i,u,d):p?Dr(e,w,i):Or(e,w,i);h?(m.activeTexture.set(g.TEXTURE0),w.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),E.updatePaintBuffers(d)):u&&(P||e.lineAtlas.dirty)&&(m.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(m)),S.draw(m,g.TRIANGLES,s,e.stencilModeForClipping(x),l,It.disabled,L,i.id,A.layoutVertexBuffer,A.indexBuffer,A.segments,i.paint,e.transform.zoom,E),y=!1}}}}}},fill:function(e,r,i,n){var o=i.paint.get("fill-color"),a=i.paint.get("fill-opacity");if(0!==a.constantOr(1)){var s=e.colorModeForRenderPass(),l=i.paint.get("fill-pattern"),u=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===o.constantOr(t.Color.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(e.renderPass===u){var c=e.depthModeForSublayer(1,"opaque"===e.renderPass?Tt.ReadWrite:Tt.ReadOnly);ii(e,r,i,n,c,s,!1)}if("translucent"===e.renderPass&&i.paint.get("fill-antialias")){var h=e.depthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,Tt.ReadOnly);ii(e,r,i,n,h,s,!0)}}},"fill-extrusion":function(t,e,r,i){var n=r.paint.get("fill-extrusion-opacity");if(0!==n&&"translucent"===t.renderPass){var o=new Tt(t.context.gl.LEQUAL,Tt.ReadWrite,t.depthRangeFor3D);if(1!==n||r.paint.get("fill-extrusion-pattern").constantOr(1))ni(t,e,r,i,o,St.disabled,Pt.disabled),ni(t,e,r,i,o,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var a=t.colorModeForRenderPass();ni(t,e,r,i,o,St.disabled,a)}}},hillshade:function(t,e,r,i){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var n=t.context,o=e.getSource().maxzoom,a=t.depthModeForSublayer(0,Tt.ReadOnly),s=t.colorModeForRenderPass(),l="translucent"===t.renderPass?t.stencilConfigForOverlap(i):[{},i],u=l[0],c=0,h=l[1];c<h.length;c+=1){var p=h[c],d=e.getTile(p);d.needsHillshadePrepare&&"offscreen"===t.renderPass?ai(t,d,r,o,a,St.disabled,s):"translucent"===t.renderPass&&oi(t,d,r,a,u[p.overscaledZ],s)}n.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,r,i){if("translucent"===t.renderPass&&0!==r.paint.get("raster-opacity")&&i.length)for(var n=t.context,o=n.gl,a=e.getSource(),s=t.useProgram("raster"),l=t.colorModeForRenderPass(),u=a instanceof L?[{},i]:t.stencilConfigForOverlap(i),c=u[0],h=u[1],p=h[h.length-1].overscaledZ,d=!t.options.moving,f=0,m=h;f<m.length;f+=1){var g=m[f],y=t.depthModeForSublayer(g.overscaledZ-p,1===r.paint.get("raster-opacity")?Tt.ReadWrite:Tt.ReadOnly,o.LESS),v=e.getTile(g),_=t.transform.calculatePosMatrix(g.toUnwrapped(),d);v.registerFadeDuration(r.paint.get("raster-fade-duration"));var b=e.findLoadedParent(g,0),x=si(v,b,e,r,t.transform),w=void 0,A=void 0,E="nearest"===r.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;n.activeTexture.set(o.TEXTURE0),v.texture.bind(E,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),n.activeTexture.set(o.TEXTURE1),b?(b.texture.bind(E,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),w=Math.pow(2,b.tileID.overscaledZ-v.tileID.overscaledZ
vendor: 94,634 bytes, line 16
16),A=[v.tileID.canonical.x*w%1,v.tileID.canonical.y*w%1]):v.texture.bind(E,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);var T=Ur(_,A||[0,0],w||1,x,r);a instanceof L?s.draw(n,o.TRIANGLES,y,St.disabled,l,It.disabled,T,r.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):s.draw(n,o.TRIANGLES,y,c[g.overscaledZ],l,It.disabled,T,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,r){var i=r.paint.get("background-color"),n=r.paint.get("background-opacity");if(0!==n){var o=t.context,a=o.gl,s=t.transform,l=s.tileSize,u=r.paint.get("background-pattern");if(!t.isPatternMissing(u)){var c=!u&&1===i.a&&1===n&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===c){var h=St.disabled,p=t.depthModeForSublayer(0,"opaque"===c?Tt.ReadWrite:Tt.ReadOnly),d=t.colorModeForRenderPass(),f=t.useProgram(u?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:l});u&&(o.activeTexture.set(a.TEXTURE0),t.imageManager.bind(t.context));for(var g=r.getCrossfadeParameters(),y=0,v=m;y<v.length;y+=1){var _=v[y],b=t.transform.calculatePosMatrix(_.toUnwrapped()),x=u?Xr(b,n,t,u,{tileID:_,tileSize:l},g):Hr(b,n,i);f.draw(o,a.TRIANGLES,p,h,d,It.disabled,x,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,r){for(var i=0;i<r.length;i++)gi(t,e,r[i])},custom:function(t,e,r){var i=t.context,n=r.implementation;if("offscreen"===t.renderPass){var o=n.prerender;o&&(t.setCustomLayerDefaults(),i.setColorMode(t.colorModeForRenderPass()),o.call(n,i.gl,t.transform.customLayerMatrix()),i.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),i.setColorMode(t.colorModeForRenderPass()),i.setStencilMode(St.disabled);var a="3d"===n.renderingMode?new Tt(t.context.gl.LEQUAL,Tt.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Tt.ReadOnly);i.setDepthMode(a),n.render(i.gl,t.transform.customLayerMatrix()),i.setDirty(),t.setBaseState(),i.bindFramebuffer.set(null)}}},vi=function(t,e){this.context=new Mt(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=Ct.maxUnderzooming+Ct.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Fe,this.gpuTimers={}};vi.prototype.resize=function(e,r){if(this.width=e*t.browser.devicePixelRatio,this.height=r*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var i=0,n=this.style._order;i<n.length;i+=1)this.style._layers[n[i]].resize()},vi.prototype.setup=function(){var e=this.context,r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(r,Ge.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var i=new t.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(t.EXTENT,0),i.emplaceBack(0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(i,Ge.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var n=new t.StructArrayLayout4i8;n.emplaceBack(0,0,0,0),n.emplaceBack(t.EXTENT,0,t.EXTENT,0),n.emplaceBack(0,t.EXTENT,0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(n,k.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var o=new t.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(o,Ge.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var a=new t.StructArrayLayout1ui2;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(a);var s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA);var l=this.context.gl;this.stencilClearMode=new St({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},vi.prototype.clearStencil=function(){var e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var i=t.create();t.ortho(i,0,this.width,this.height,0,0,1),t.scale(i,i,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,r.TRIANGLES,Tt.disabled,this.stencilClearMode,Pt.disabled,It.disabled,zr(i),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},vi.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var r=this.context,i=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(Pt.disabled),r.setDepthMode(Tt.disabled);var n=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o<a.length;o+=1){var s=a[o],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;n.draw(r,i.TRIANGLES,Tt.disabled,new St({func:i.ALWAYS,mask:0},l,255,i.KEEP,i.KEEP,i.REPLACE),Pt.disabled,It.disabled,zr(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},vi.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new St({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},vi.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new St({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},vi.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,i=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),n=i[i.length-1].overscaledZ,o=i[0].overscaledZ-n+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var a={},s=0;s<o;s++)a[s+n]=new St({func:r.GEQUAL,mask:255},s+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=o,[a,i]}return[(e={},e[n]=St.disabled,e),i]},vi.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new Pt([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Pt.unblended:Pt.alphaBlended},vi.prototype.depthModeForSublayer=function(t,e,r){if(!this.opaquePassEnabledForLayer())return Tt.disabled;var i=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Tt(r||this.context.gl.LEQUAL,e,[i,i])},vi.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},vi.prototype.render=function(e,r){var i=this;this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var n=this.style._order,o=this.style.sourceCaches;for(var a in o){var s=o[a];s.used&&s.prepare(this.context)}var l,u,c={},h={},p={};for(var d in o){var f=o[d];c[d]=f.getVisibleCoordinates(),h[d]=c[d].slice().reverse(),p[d]=f.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var m=0;m<n.length;m++)if(this.style._layers[n[m]].is3D()){this.opaquePassCutoff=m;break}this.renderPass="offscreen";for(var g=0,y=n;g<y.length;g+=1){var v=this.style._layers[y[g]];if(v.hasOffscreenPass()&&!v.isHidden(this.transform.zoom)){var _=h[v.source];("custom"===v.type||_.length)&&this.renderLayer(this,o[v.source],v,_)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){var b=this.style._layers[n[this.currentLayer]],x=o[b.source],w=c[b.source];this._renderTileClippingMasks(b,w),this.renderLayer(this,x,b,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){var A=this.style._layers[n[this.currentLayer]],E=o[A.source],T=("symbol"===A.type?p:h)[A.source];this._renderTileClippingMasks(A,c[A.source]),this.renderLayer(this,E,A,T)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(i.transform.zoom)&&(t.source!==(u&&u.id)&&(u=i.style.sourceCaches[t.source]),(!l||l.getSource().maxzoom<u.getSource().maxzoom)&&(l=u))})),l&&yi.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;di(t,t.transform.height-(e.top||0),3,li),di(t,e.bottom||0,3,ui),fi(t,e.left||0,3,ci),fi(t,t.transform.width-(e.right||0),3,hi);var r=t.transform.centerPoint;!function(t,e,r,i){mi(t,e-1,r-10,2,20,i),mi(t,e-10,r-1,20,2,i)}(t,r.x,t.transform.height-r.y,pi)}(this),this.context.setDefault()},vi.prototype.renderLayer=function(t,e,r,i){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||i.length)&&(this.id=r.id,this.gpuTimingStart(r),yi[r.type](t,e,r,i,this.style.placement.variableOffsets),this.gpuTimingEnd())},vi.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,r=this.gpuTimers[t.id];r||(r=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),r.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,r.query)}},vi.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},vi.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},vi.prototype.queryGpuTimers=function(t){var e={};for(var r in t){var i=t[r],n=this.context.extTimerQuery,o=n.getQueryObjectEXT(i.query,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(i.query),e[r]=o}return e},vi.prototype.translatePosMatrix=function(e,r,i,n,o){if(!i[0]&&!i[1])return e;var a=o?"map"===n?this.transform.angle:0:"viewport"===n?-this.transform.angle:0;if(a){var s=Math.sin(a),l=Math.cos(a);i=[i[0]*l-i[1]*s,i[0]*s+i[1]*l]}var u=[o?i[0]:pe(r,i[0],this.transform.zoom),o?i[1]:pe(r,i[1],this.transform.zoom),0],c=new Float32Array(16);return t.translate(c,e,u),c},vi.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},vi.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},vi.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},vi.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new xr(this.context,t,vr[t],e,Yr[t],this._showOverdrawInspector)),this.cache[r]},vi.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},vi.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},vi.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},vi.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var _i=function(t,e){this.points=t,this.planes=e};_i.fromInvProjectionMatrix=function(e,r,i){var n=Math.pow(2,i),o=[[-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((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*n)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],o[e[0]],o[e[1]]),i=t.sub([],o[e[2]],o[e[1]]),n=t.normalize([],t.cross([],r,i)),a=-t.dot(n,o[e[1]]);return n.concat(a)}));return new _i(o,a)};var bi=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};bi.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],i=t.clone$2(this.min),n=t.clone$2(this.max),o=0;o<r.length;o++)i[o]=r[o]?this.min[o]:this.center[o],n[o]=r[o]?this.center[o]:this.max[o];return n[2]=this.max[2],new bi(i,n)},bi.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},bi.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},bi.prototype.intersects=function(e){for(var r=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],i=!0,n=0;n<e.planes.length;n++){for(var o=e.planes[n],a=0,s=0;s<r.length;s++)a+=t.dot$1(o,r[s])>=0;if(0===a)return 0;a!==r.length&&(i=!1)}if(i)return 2;for(var l=0;l<3;l++){for(var u=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=0;h<e.points.length;h++){var p=e.points[h][l]-this.min[l];u=Math.min(u,p),c=Math.max(c,p)}if(c<0||u>this.max[l]-this.min[l])return 0}return 1};var xi=function(t,e,r,i){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(i)||i<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=i};xi.prototype.interpolate=function(e,r,i){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,i)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,i)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,i)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,i)),this},xi.prototype.getCenter=function(e,r){var i=t.clamp((this.left+e-this.right)/2,0,e),n=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(i,n)},xi.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},xi.prototype.clone=function(){return new xi(this.top,this.bottom,this.left,this.right)},xi.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var wi=function(e,r,i,n,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==i?0:i,this._maxPitch=null==n?60:n,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new xi,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ai={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};wi.prototype.clone=function(){var t=new wi(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},Ai.minZoom.get=function(){return this._minZoom},Ai.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Ai.maxZoom.get=function(){return this._maxZoom},Ai.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Ai.minPitch.get=function(){return this._minPitch},Ai.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},Ai.maxPitch.get=function(){return this._maxPitch},Ai.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},Ai.renderWorldCopies.get=function(){return this._renderWorldCopies},Ai.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Ai.worldSize.get=function(){return this.tileSize*this.scale},Ai.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ai.size.get=function(){return new t.Point(this.width,this.height)},Ai.bearing.get=function(){return-this.angle/Math.PI*180},Ai.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Ai.pitch.get=function(){return this._pitch/Math.PI*180},Ai.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Ai.fov.get=function(){return this._fov/Math.PI*180},Ai.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},Ai.zoom.get=function(){return this._zoom},Ai.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},Ai.center.get=function(){return this._center},Ai.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Ai.padding.get=function(){return this._edgeInsets.toJSON()},Ai.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},Ai.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},wi.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},wi.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},wi.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},wi.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var i=this.pointCoordinate(new t.Point(0,0)),n=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(i.x,n.x,o.x,a.x)),l=Math.floor(Math.max(i.x,n.x,o.x,a.x)),u=s-1;u<=l+1;u++)0!==u&&r.push(new t.UnwrappedTileID(u,e));return r},wi.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),i=r;if(void 0!==e.minzoom&&r<e.minzoom)return[];void 0!==e.maxzoom&&r>e.maxzoom&&(r=e.maxzoom);var n=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,r),a=[o*n.x,o*n.y,0],s=_i.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var u=function(t){return{aabb:new bi([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},c=[],h=[],p=r,d=e.reparseOverscaled?i:r;if(this._renderWorldCopies)for(var f=1;f<=3;f++)c.push(u(-f)),c.push(u(f));for(c.push(u(0));c.length>0;){var m=c.pop(),g=m.x,y=m.y,v=m.fullyVisible;if(!v){var _=m.aabb.intersects(s);if(0===_)continue;v=2===_}var b=m.aabb.distanceX(a),x=m.aabb.distanceY(a),w=Math.max(Math.abs(b),Math.abs(x));if(m.zoom===p||w>3+(1<<p-m.zoom)-2&&m.zoom>=l)h.push({tileID:new t.OverscaledTileID(m.zoom===p?d:m.zoom,m.wrap,m.zoom,g,y),distanceSq:t.sqrLen([a[0]-.5-g,a[1]-.5-y])});else for(var A=0;A<4;A++){var E=(g<<1)+A%2,T=(y<<1)+(A>>1);c.push({aabb:m.aabb.quadrant(A),zoom:m.zoom+1,x:E,y:T,wrap:m.wrap,fullyVisible:v})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},wi.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Ai.unmodified.get=function(){return this._unmodified},wi.prototype.zoomScale=function(t){return Math.pow(2,t)},wi.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},wi.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},wi.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},Ai.point.get=function(){return this.project(this.center)},wi.prototype.setLocationAtPoint=function(e,r){var i=this.pointCoordinate(r),n=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),a=new t.MercatorCoordinate(o.x-(i.x-n.x),o.y-(i.y-n.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())},wi.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},wi.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},wi.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},wi.prototype.coordinateLocation=function(t){return t.toLngLat()},wi.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],i=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(i,i,this.pixelMatrixInverse);var n=r[3],o=i[3],a=r[1]/n,s=i[1]/o,l=r[2]/n,u=i[2]/o,c=l===u?0:(0-l)/(u-l);return new t.MercatorCoordinate(t.number(r[0]/n,i[0]/o,c)/this.worldSize,t.number(a,s,c)/this.worldSize)},wi.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},wi.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},wi.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},wi.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},wi.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var i=e.key,n=r?this._alignedPosMatrixCache:this._posMatrixCache;if(n[i])return n[i];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*a,o.y*a,0]),t.scale(l,l,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),n[i]=new Float32Array(l),n[i]},wi.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},wi.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,i,n,o=-90,a=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var h=this.latRange;o=t.mercatorYfromLat(h[1])*this.worldSize,e=(a=t.mercatorYfromLat(h[0])*this.worldSize)-o<u.y?u.y/(a-o):0}if(this.lngRange){var p=this.lngRange;s=t.mercatorXfromLng(p[0])*this.worldSize,r=(l=t.mercatorXfromLng(p[1])*this.worldSize)-s<u.x?u.x/(l-s):0}var d=this.point,f=Math.max(r||0,e||0);if(f)return this.center=this.unproject(new t.Point(r?(l+s)/2:d.x,e?(a+o)/2:d.y)),this.zoom+=this.scaleZoom(f),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var m=d.y,g=u.y/2;m-g<o&&(n=o+g),m+g>a&&(n=a-g)}if(this.lngRange){var y=d.x,v=u.x/2;y-v<s&&(i=s+v),y+v>l&&(i=l-v)}void 0===i&&void 0===n||(this.center=this.unproject(new t.Point(void 0!==i?i:d.x,void 0!==n?n:d.y))),this._unmodified=c,this._constraining=!1}},wi.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var r=Math.PI/2+this._pitch,i=this._fov*(.5+e.y/this.height),n=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-r-i,.01,Math.PI-.01)),o=this.point,a=o.x,s=o.y,l=1.01*(Math.cos(Math.PI/2-this._pitch)*n+this.cameraToCenterDistance),u=this.height/50,c=new Float64Array(16);t.perspective(c,this._fov,this.width/this.height,u,l),c[8]=2*-e.x/this.width,c[9]=2*e.y/this.height,t.scale(c,c,[1,-1,1]),t.translate(c,c,[0,0,-this.cameraToCenterDistance]),t.rotateX(c,c,this._pitch),t.rotateZ(c,c,this.angle),t.translate(c,c,[-a,-s,0]),this.mercatorMatrix=t.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),t.scale(c,c,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=c,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,p=this.height%2/2,d=Math.cos(this.angle),f=Math.sin(this.angle),m=a-Math.round(a)+d*h+f*p,g=s-Math.round(s)+d*p+f*h,y=new Float64Array(c);if(t.translate(y,y,[m>.5?m-1:m,g>.5?g-1:g,0]),this.alignedProjMatrix=y,c=t.create(),t.scale(c,c,[this.width/2,-this.height/2,1]),t.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=t.create(),t.scale(c,c,[1,-1,1]),t.translate(c,c,[-1,-1,0]),t.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}},wi.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},wi.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},wi.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var i=r.x,n=r.y,o=r.x,a=r.y,s=0,l=e;s<l.length;s+=1){var u=l[s];i=Math.min(i,u.x),n=Math.min(n,u.y),o=Math.max(o,u.x),a=Math.max(a,u.y)}return[new t.Point(i,n),new t.Point(o,n),new t.Point(o,a),new t.Point(i,a),new t.Point(i,n)]},Object.defineProperties(wi.prototype,Ai);var Ei=function(e){var r,i,n,o;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(r=this._updateHashUnthrottled.bind(this),i=!1,n=null,o=function(){n=null,i&&(r(),n=setTimeout(o,300),i=!1)},function(){return i=!0,n||o(),n})};Ei.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Ei.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Ei.prototype.getHashString=function(e){var r=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,n=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,n),a=Math.round(r.lng*o)/o,s=Math.round(r.lat*o)/o,l=this._map.getBearing(),u=this._map.getPitch(),c="";if(c+=e?"/"+a+"/"+s+"/"+i:i+"/"+s+"/"+a,(l||u)&&(c+="/"+Math.round(10*l)/10),u&&(c+="/"+Math.round(u)),this._hashName){var h=this._hashName,p=!1,d=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===h?(p=!0,e+"="+c):t})).filter((function(t){return t}));return p||d.push(h+"="+c),"#"+d.join("&")}return"#"+c},Ei.prototype._getCurrentHash=function(){var e,r=this,i=t.window.location.hash.replace("#","");return this._hashName?(i.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===r._hashName&&(e=t)})),(e&&e[1]||"").split("/")):i.split("/")},Ei.prototype._onHashChange=function(){var t=this._getCurrentHash();if(t.length>=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Ei.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var Ti={linearity:.3,easing:t.bezier(0,0,.3,1)},Si=t.extend({deceleration:2500,maxSpeed:1400},Ti),Pi=t.extend({deceleration:20,maxSpeed:1400},Ti),Ii=t.extend({deceleration:1e3,maxSpeed:360},Ti),Mi=t.extend({deceleration:1e3,maxSpeed:90},Ti),Ci=function(t){this._map=t,this.clear()};function ki(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Li(e,r,i){var n=i.maxSpeed,o=i.linearity,a=i.deceleration,s=t.clamp(e*o/(r/1e3),-n,n),l=Math.abs(s)/(a*o);return{easing:i.easing,duration:1e3*l,amount:s*(l/2)}}Ci.prototype.clear=function(){this._inertiaBuffer=[]},Ci.prototype.record=function(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:e})},Ci.prototype._drainInertiaBuffer=function(){for(var e=this._inertiaBuffer,r=t.browser.now();e.length>0&&r-e[0].time>160;)e.shift()},Ci.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},i=0,n=this._inertiaBuffer;i<n.length;i+=1){var o=n[i].settings;r.zoom+=o.zoomDelta||0,r.bearing+=o.bearingDelta||0,r.pitch+=o.pitchDelta||0,o.panDelta&&r.pan._add(o.panDelta),o.around&&(r.around=o.around),o.pinchAround&&(r.pinchAround=o.pinchAround)}var a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(r.pan.mag()){var l=Li(r.pan.mag(),a,t.extend({},Si,e||{}));s.offset=r.pan.mult(l.amount/r.pan.mag()),s.center=this._map.transform.center,ki(s,l)}if(r.zoom){var u=Li(r.zoom,a,Pi);s.zoom=this._map.transform.zoom+u.amount,ki(s,u)}if(r.bearing){var c=Li(r.bearing,a,Ii);s.bearing=this._map.transform.bearing+t.clamp(c.amount,-179,179),ki(s,c)}if(r.pitch){var h=Li(r.pitch,a,Mi);s.pitch=this._map.transform.pitch+h.amount,ki(s,h)}if(s.zoom||s.bearing){var p=void 0===r.pinchAround?r.around:r.pinchAround;s.around=p?this._map.unproject(p):this._map.getCenter()}return this.clear(),t.extend(s,{noMoveStart:!0})}};var zi=function(e){function i(i,n,o,a){void 0===a&&(a={});var s=r.mousePos(n.getCanvasContainer(),o),l=n.unproject(s);e.call(this,i,t.extend({point:s,lngLat:l,originalEvent:o},a)),this._defaultPrevented=!1,this.target=n}e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i;var n={defaultPrevented:{configurable:!0}};return i.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(i.prototype,n),i}(t.Event),Ri=function(e){function i(i,n,o){var a="touchend"===i?o.changedTouches:o.touches,s=r.touchPos(n.getCanvasContainer(),a),l=s.map((function(t){return n.unproject(t)})),u=s.reduce((function(t,e,r,i){return t.add(e.div(i.length))}),new t.Point(0,0)),c=n.unproject(u);e.call(this,i,{points:s,point:u,lngLats:l,lngLat:c,originalEvent:o}),this._defaultPrevented=!1}e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i;var n={defaultPrevented:{configurable:!0}};return i.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(i.prototype,n),i}(t.Event),Oi=function(t){function e(e,r,i){t.call(this,e,{originalEvent:i}),this._defaultPrevented=!1}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event),Di=function(t,e){this._map=t,this._clickTolerance=e.clickTolerance};Di.prototype.reset=function(){delete this._mousedownPos},Di.prototype.wheel=function(t){return this._firePreventable(new Oi(t.type,this._map,t))},Di.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new zi(t.type,this._map,t))},Di.prototype.mouseup=function(t){this._map.fire(new zi(t.type,this._map,t))},Di.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new zi(t.type,this._map,t))},Di.prototype.dblclick=function(t){return this._firePreventable(new zi(t.type,this._map,t))},Di.prototype.mouseover=function(t){this._map.fire(new zi(t.type,this._map,t))},Di.prototype.mouseout=function(t){this._map.fire(new zi(t.type,this._map,t))},Di.prototype.touchstart=function(t){return this._firePreventable(new Ri(t.type,this._map,t))},Di.prototype.touchmove=function(t){this._map.fire(new Ri(t.type,this._map,t))},Di.prototype.touchend=function(t){this._map.fire(new Ri(t.type,this._map,t))},Di.prototype.touchcancel=function(t){this._map.fire(new Ri(t.type,this._map,t))},Di.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Di.prototype.isEnabled=function(){return!0},Di.prototype.isActive=function(){return!1},Di.prototype.enable=function(){},Di.prototype.disable=function(){};var Bi=function(t){this._map=t};Bi.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Bi.prototype.mousemove=function(t){this._map.fire(new zi(t.type,this._map,t))},Bi.prototype.mousedown=function(){this._delayContextMenu=!0},Bi.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new zi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Bi.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new zi(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Bi.prototype.isEnabled=function(){return!0},Bi.prototype.isActive=function(){return!1},Bi.prototype.enable=function(){},Bi.prototype.disable=function(){};var Fi=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function ji(t,e){for(var r={},i=0;i<t.length;i++)r[t[i].identifier]=e[i];return r}Fi.prototype.isEnabled=function(){return!!this._enabled},Fi.prototype.isActive=function(){return!!this._active},Fi.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Fi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Fi.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(r.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)},Fi.prototype.mousemoveWindow=function(t,e){if(this._active){var i=e;if(!(this._lastPos.equals(i)||!this._box&&i.dist(this._startPos)<this._clickTolerance)){var n=this._startPos;this._lastPos=i,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var o=Math.min(n.x,i.x),a=Math.max(n.x,i.x),s=Math.min(n.y,i.y),l=Math.max(n.y,i.y);r.setTransform(this._box,"translate("+o+"px,"+s+"px)"),this._box.style.width=a-o+"px",this._box.style.height=l-s+"px"}}},Fi.prototype.mouseupWindow=function(e,i){var n=this;if(this._active&&0===e.button){var o=this._startPos,a=i;if(this.reset(),r.suppressClick(),o.x!==a.x||o.y!==a.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:function(t){return t.fitScreenCoordinates(o,a,n._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",e)}},Fi.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))},Fi.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},Fi.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))};var Ni=function(t){this.reset(),this.numTouches=t.numTouches};Ni.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Ni.prototype.touchstart=function(e,r,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),i.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),i=0,n=e;i<n.length;i+=1)r._add(n[i]);return r.div(e.length)}(r),this.touches=ji(i,r)))},Ni.prototype.touchmove=function(t,e,r){if(!this.aborted&&this.centroid){var i=ji(r,e);for(var n in this.touches){var o=i[n];(!o||o.dist(this.touches[n])>30)&&(this.aborted=!0)}}},Ni.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var i=!this.aborted&&this.centroid;if(this.reset(),i)return i}};var Ui=function(t){this.singleTap=new Ni(t),this.numTaps=t.numTaps,this.reset()};Ui.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Ui.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Ui.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Ui.prototype.touchend=function(t,e,r){var i=this.singleTap.touchend(t,e,r);if(i){var n=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(i)<30;if(n&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}};var Vi=function(){this._zoomIn=new Ui({numTouches:1,numTaps:2}),this._zoomOut=new Ui({numTouches:2,numTaps:1}),this.reset()};Vi.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Vi.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Vi.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Vi.prototype.touchend=function(t,e,r){var i=this,n=this._zoomIn.touchend(t,e,r),o=this._zoomOut.touchend(t,e,r);return n?(this._active=!0,t.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(n)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},Vi.prototype.touchcancel=function(){this.reset()},Vi.prototype.enable=function(){this._enabled=!0},Vi.prototype.disable=function(){this._enabled=!1,this.reset()},Vi.prototype.isEnabled=function(){return this._enabled},Vi.prototype.isActive=function(){return this._active};var qi={0:1,2:2},Gi=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Gi.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Gi.prototype._correctButton=function(t,e){return!1},Gi.prototype._move=function(t,e){return{}},Gi.prototype.mousedown=function(t,e){if(!this._lastPoint){var i=r.mouseButton(t);this._correctButton(t,i)&&(this._lastPoint=e,this._eventButton=i)}},Gi.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(t,e){var r=qi[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=e,this._move(r,e)},Gi.prototype.mouseupWindow=function(t){this._lastPoint&&r.mouseButton(t)===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())},Gi.prototype.enable=function(){this._enabled=!0},Gi.prototype.disable=function(){this._enabled=!1,this.reset()},Gi.prototype.isEnabled=function(){return this._enabled},Gi.prototype.isActive=function(){return this._active};var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.mousedown=function(e,r){t.prototype.mousedown.call(this,e,r),this._lastPoint&&(this._active=!0)},e.prototype._correctButton=function(t,e){return 0===e&&!t.ctrlKey},e.prototype._move=function(t,e){return{around:e,panDelta:e.sub(t)}},e}(Gi),Wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var r=.8*(e.x-t.x);if(r)return this._active=!0,{bearingDelta:r}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Gi),Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var r=-.5*(e.y-t.y);if(r)return this._active=!0,{pitchDelta:r}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Gi),Xi=function(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()};Xi.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},Xi.prototype.touchstart=function(t,e,r){return this._calculateTransform(t,e,r)},Xi.prototype.touchmove=function(t,e,r){if(this._active)return t.preventDefault(),this._calculateTransform(t,e,r)},Xi.prototype.touchend=function(t,e,r){this._calculateTransform(t,e,r),this._active&&r.length<this._minTouches&&this.reset()},Xi.prototype.touchcancel=function(){this.reset()},Xi.prototype._calculateTransform=function(e,r,i){i.length>0&&(this._active=!0);var n=ji(i,r),o=new t.Point(0,0),a=new t.Point(0,0),s=0;for(var l in n){var u=n[l],c=this._touches[l];c&&(o._add(u),a._add(u.sub(c)),s++,n[l]=u)}if(this._touches=n,!(s<this._minTouches)&&a.mag()){var h=a.div(s);if(this._sum._add(h),!(this._sum.mag()<this._clickTolerance))return{around:o.div(s),panDelta:h}}},Xi.prototype.enable=function(){this._enabled=!0},Xi.prototype.disable=function(){this._enabled=!1,this.reset()},Xi.prototype.isEnabled=function(){return this._enabled},Xi.prototype.isActive=function(){return this._active};var Yi=function(){this.reset()};function Ki(t,e,r){for(var i=0;i<t.length;i++)if(t[i].identifier===r)return e[i]}function Ji(t,e){return Math.log(t/e)/Math.LN2}Yi.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Yi.prototype._start=function(t){},Yi.prototype._move=function(t,e,r){return{}},Yi.prototype.touchstart=function(t,e,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([e[0],e[1]]))},Yi.prototype.touchmove=function(t,e,r){if(this._firstTwoTouches){t.preventDefault();var i=this._firstTwoTouches,n=i[1],o=Ki(r,e,i[0]),a=Ki(r,e,n);if(o&&a){var s=this._aroundCenter?null:o.add(a).div(2);return this._move([o,a],s,t)}}},Yi.prototype.touchend=function(t,e,i){if(this._firstTwoTouches){var n=this._firstTwoTouches,o=n[1],a=Ki(i,e,n[0]),s=Ki(i,e,o);a&&s||(this._active&&r.suppressClick(),this.reset())}},Yi.prototype.touchcancel=function(){this.reset()},Yi.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around},Yi.prototype.disable=function(){this._enabled=!1,this.reset()},Yi.prototype.isEnabled=function(){return this._enabled},Yi.prototype.isActive=function(){return this._active};var Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._distance,delete this._startDistance},e.prototype._start=function(t){this._startDistance=this._distance=t[0].dist(t[1])},e.prototype._move=function(t,e){var r=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Ji(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Ji(this._distance,r),pinchAround:e}},e}(Yi);function $i(t,e){return 180*t.angleWith(e)/Math.PI}var tn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},e.prototype._start=function(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])},e.prototype._move=function(t,e){var r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:$i(this._vector,r),pinchAround:e}},e.prototype._isBelowThreshold=function(t){this._minDiameter=Math.min(this._minDiameter,t.mag());var e=25/(Math.PI*this._minDiameter)*360,r=$i(t,this._startVector);return Math.abs(r)<e},e}(Yi);function en(t){return Math.abs(t.y)>Math.abs(t.x)}var rn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,en(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var i=t[0].sub(this._lastPoints[0]),n=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(i,n,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(i.y+n.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var i=t.mag()>=2,n=e.mag()>=2;if(i||n){if(!i||!n)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return en(t)&&en(e)&&o}},e}(Yi),nn={panStep:100,bearingStep:15,pitchStep:10},on=function(){var t=nn;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep};function an(t){return t*(2-t)}on.prototype.reset=function(){this._active=!1},on.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,i=0,n=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),a=1);break;default:return}return{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:an,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+i*e._bearingStep,pitch:s.getPitch()+n*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},on.prototype.enable=function(){this._enabled=!0},on.prototype.disable=function(){this._enabled=!1,this.reset()},on.prototype.isEnabled=function(){return this._enabled},on.prototype.isActive=function(){return this._active};var sn=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};sn.prototype.setZoomRate=function(t){this._defaultZoomRate=t},sn.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},sn.prototype.isEnabled=function(){return!!this._enabled},sn.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},sn.prototype.isZooming=function(){return!!this._zooming},sn.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},sn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},sn.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,i=t.browser.now(),n=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(n*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},sn.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},sn.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var i=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(i)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},sn.prototype.renderFrame=function(){return this._onScrollFrame()},sn.prototype._onScrollFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var i="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,n=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==n&&(n=1/n);var o="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(o*n))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,u=this._easing,c=!1;if("wheel"===this._type&&l&&u){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),p=u(h);a=t.number(l,s,p),h<1?this._frameId||(this._frameId=!0):c=!0}else a=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:a-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},sn.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var i=this._prevEase,n=(t.browser.now()-i.start)/i.duration,o=i.easing(n+.01)-i.easing(n),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);r=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},sn.prototype.reset=function(){this._active=!1};var ln=function(t,e){this._clickZoom=t,this._tapZoom=e};ln.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ln.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ln.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ln.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var un=function(){this.reset()};un.prototype.reset=function(){this._active=!1},un.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},un.prototype.enable=function(){this._enabled=!0},un.prototype.disable=function(){this._enabled=!1,this.reset()},un.prototype.isEnabled=function(){return this._enabled},un.prototype.isActive=function(){return this._active};var cn=function(){this._tap=new Ui({numTouches:1,numTaps:1}),this.reset()};cn.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},cn.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},cn.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var i=e[0],n=i.y-this._swipePoint.y;return this._swipePoint=i,t.preventDefault(),this._active=!0,{zoomDelta:n/128}}}else this._tap.touchmove(t,e,r)},cn.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},cn.prototype.touchcancel=function(){this.reset()},cn.prototype.enable=function(){this._enabled=!0},cn.prototype.disable=function(){this._enabled=!1,this.reset()},cn.prototype.isEnabled=function(){return this._enabled},cn.prototype.isActive=function(){return this._active};var hn=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};hn.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},hn.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},hn.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},hn.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var pn=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};pn.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},pn.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},pn.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},pn.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var dn=function(t,e,r,i){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0};dn.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},dn.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},dn.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},dn.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},dn.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},dn.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var fn=function(t){return t.zoom||t.drag||t.pitch||t.rotate},mn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(t.Event);function gn(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var yn=function(e,i){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ci(e),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i),t.bindAll(["handleEvent","handleWindowEvent"],this);var n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[t.window,"blur",void 0]];for(var o=0,a=this._listeners;o<a.length;o+=1){var s=a[o],l=s[0];r.addEventListener(l,s[1],l===t.window.document?this.handleWindowEvent:this.handleEvent,s[2])}};yn.prototype.destroy=function(){for(var e=0,i=this._listeners;e<i.length;e+=1){var n=i[e],o=n[0];r.removeEventListener(o,n[1],o===t.window.document?this.handleWindowEvent:this.handleEvent,n[2])}},yn.prototype._addDefaultHandlers=function(t){var e=this._map,r=e.getCanvasContainer();this._add("mapEvent",new Di(e,t));var i=e.boxZoom=new Fi(e,t);this._add("boxZoom",i);var n=new Vi,o=new un;e.doubleClickZoom=new ln(o,n),this._add("tapZoom",n),this._add("clickZoom",o);var a=new cn;this._add("tapDragZoom",a);var s=e.touchPitch=new rn;this._add("touchPitch",s);var l=new Wi(t),u=new Hi(t);e.dragRotate=new pn(t,l,u),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",u,["mouseRotate"]);var c=new Zi(t),h=new Xi(t);e.dragPan=new hn(r,c,h),this._add("mousePan",c),this._add("touchPan",h,["touchZoom","touchRotate"]);var p=new tn,d=new Qi;e.touchZoomRotate=new dn(r,d,p,a),this._add("touchRotate",p,["touchPan","touchZoom"]),this._add("touchZoom",d,["touchPan","touchRotate"]);var f=e.scrollZoom=new sn(e,this);this._add("scrollZoom",f,["mousePan"]);var m=e.keyboard=new on;this._add("keyboard",m),this._add("blockableMapEvent",new Bi(e));for(var g=0,y=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];g<y.length;g+=1){var v=y[g];t.interactive&&t[v]&&e[v].enable(t[v])}},yn.prototype._add=function(t,e,r){this._handlers.push({handlerName:t,handler:e,allowed:r}),this._handlersById[t]=e},yn.prototype.stop=function(){if(!this._updatingCamera){for(var t=0,e=this._handlers;t<e.length;t+=1)e[t].handler.reset();this._inertia.clear(),this._fireEvents({},{}),this._changes=[]}},yn.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return!0;return!1},yn.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},yn.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},yn.prototype.isMoving=function(){return Boolean(fn(this._eventsInProgress))||this.isZooming()},yn.prototype._blockedByActive=function(t,e,r){for(var i in t)if(i!==r&&(!e||e.indexOf(i)<0))return!0;return!1},yn.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window")},yn.prototype._getMapTouches=function(t){for(var e=[],r=0,i=t;r<i.length;r+=1){var n=i[r];this._el.contains(n.target)&&e.push(n)}return e},yn.prototype.handleEvent=function(t,e){if("blur"!==t.type){this._updatingCamera=!0;for(var i="renderFrame"===t.type?void 0:t,n={needsRenderFrame:!1},o={},a={},s=t.touches?this._getMapTouches(t.touches):void 0,l=s?r.touchPos(this._el,s):r.mousePos(this._el,t),u=0,c=this._handlers;u<c.length;u+=1){var h=c[u],p=h.handlerName,d=h.handler,f=h.allowed;if(d.isEnabled()){var m=void 0;this._blockedByActive(a,f,p)?d.reset():d[e||t.type]&&(m=d[e||t.type](t,l,s),this.mergeHandlerResult(n,o,m,p,i),m&&m.needsRenderFrame&&this._triggerRenderFrame()),(m||d.isActive())&&(a[p]=d)}}var g={};for(var y in this._previousActiveHandlers)a[y]||(g[y]=i);this._previousActiveHandlers=a,(Object.keys(g).length||gn(n))&&(this._changes.push([n,o,g]),this._triggerRenderFrame()),(Object.keys(a).length||gn(n))&&this._map._stop(!0),this._updatingCamera=!1;var v=n.cameraAnimation;v&&(this._inertia.clear(),this._fireEvents({},{}),this._changes=[],v(this._map))}else this.stop()},yn.prototype.mergeHandlerResult=function(e,r,i,n,o){if(i){t.extend(e,i);var a={handlerName:n,originalEvent:i.originalEvent||o};void 0!==i.zoomDelta&&(r.zoom=a),void 0!==i.panDelta&&(r.drag=a),void 0!==i.pitchDelta&&(r.pitch=a),void 0!==i.bearingDelta&&(r.rotate=a)}},yn.prototype._applyChanges=function(){for(var e={},r={},i={},n=0,o=this._changes;n<o.length;n+=1){var a=o[n],s=a[0],l=a[1],u=a[2];s.panDelta&&(e.panDelta=(e.panDelta||new t.Point(0,0))._add(s.panDelta)),s.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+s.zoomDelta),s.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+s.bearingDelta),s.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+s.pitchDelta),void 0!==s.around&&(e.around=s.around),void 0!==s.pinchAround&&(e.pinchAround=s.pinchAround),s.noInertia&&(e.noInertia=s.noInertia),t.extend(r,l),t.extend(i,u)}this._updateMapTransform(e,r,i),this._changes=[]},yn.prototype._updateMapTransform=function(t,e,r){var i=this._map,n=i.transform;if(!gn(t))return this._fireEvents(e,r);var o=t.panDelta,a=t.zoomDelta,s=t.bearingDelta,l=t.pitchDelta,u=t.around,c=t.pinchAround;void 0!==c&&(u=c),i._stop(!0),u=u||i.transform.centerPoint;var h=n.pointLocation(o?u.sub(o):u);s&&(n.bearing+=s),l&&(n.pitch+=l),a&&(n.zoom+=a),n.setLocationAtPoint(h,u),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,r)},yn.prototype._fireEvents=function(e,r){var i=this,n=fn(this._eventsInProgress),o=fn(e),a={};for(var s in e)this._eventsInProgress[s]||(a[s+"start"]=e[s].originalEvent),this._eventsInProgress[s]=e[s];for(var l in!n&&o&&this._fireEvent("movestart",o.originalEvent),a)this._fireEvent(l,a[l]);for(var u in e.rotate&&(this._bearingChanged=!0),o&&this._fireEvent("move",o.originalEvent),e)this._fireEvent(u,e[u].originalEvent);var c,h={};for(var p in this._eventsInProgress){var d=this._eventsInProgress[p],f=d.handlerName,m=d.originalEvent;this._handlersById[f].isActive()||(delete this._eventsInProgress[p],h[p+"end"]=c=r[f]||m)}for(var g in h)this._fireEvent(g,h[g]);var y=fn(this._eventsInProgress);if((n||o)&&!y){this._updatingCamera=!0;var v=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),_=function(t){return 0!==t&&-i._bearingSnap<t&&t<i._bearingSnap};v?(_(v.bearing||this._map.getBearing())&&(v.bearing=0),this._map.easeTo(v,{originalEvent:c})):(this._map.fire(new t.Event("moveend",{originalEvent:c})),_(this._map.getBearing())&&this._map.resetNorth()),this._bearingChanged=!1,this._updatingCamera=!1}},yn.prototype._fireEvent=function(e,r){this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},yn.prototype._requestFrame=function(){var t=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(e){delete t._frameId,t.handleEvent(new mn("renderFrame",{timeStamp:e})),t._applyChanges()}))},yn.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var vn=function(e){function r(r,i){e.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=i.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},r.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},r.prototype.panBy=function(e,r,i){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),i)},r.prototype.panTo=function(e,r,i){return this.easeTo(t.extend({center:e},r),i)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},r.prototype.zoomTo=function(e,r,i){return this.easeTo(t.extend({zoom:e},r),i)},r.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},r.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},r.prototype.getPadding=function(){return this.transform.padding},r.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},r.prototype.rotateTo=function(e,r,i){return this.easeTo(t.extend({bearing:e},r),i)},r.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},r.prototype.resetNorthPitch=function(e,r){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),r),this},r.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},r.prototype.getPitch=function(){return this.transform.pitch},r.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},r.prototype.cameraForBounds=function(e,r){return e=t.LngLatBounds.convert(e),this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),0,r)},r.prototype._cameraForBoxAndBearing=function(e,r,i,n){var o={top:0,bottom:0,right:0,left:0};if("number"==typeof(n=t.extend({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding){var a=n.padding;n.padding={top:a,bottom:a,right:a,left:a}}n.padding=t.extend(o,n.padding);var s=this.transform,l=s.padding,u=s.project(t.LngLat.convert(e)),c=s.project(t.LngLat.convert(r)),h=u.rotate(-i*Math.PI/180),p=c.rotate(-i*Math.PI/180),d=new t.Point(Math.max(h.x,p.x),Math.max(h.y,p.y)),f=new t.Point(Math.min(h.x,p.x),Math.min(h.y,p.y)),m=d.sub(f),g=(s.width-(l.left+l.right+n.padding.left+n.padding.right))/m.x,y=(s.height-(l.top+l.bottom+n.padding.top+n.padding.bottom))/m.y;if(!(y<0||g<0)){var v=Math.min(s.scaleZoom(s.scale*Math.min(g,y)),n.maxZoom),_=t.Point.convert(n.offset),b=new t.Point(_.x+(n.padding.left-n.padding.right)/2,_.y+(n.padding.top-n.padding.bottom)/2).mult(s.scale/s.zoomScale(v));return{center:s.unproject(u.add(c).div(2).sub(b)),zoom:v,bearing:i}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},r.prototype.fitBounds=function(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)},r.prototype.fitScreenCoordinates=function(e,r,i,n,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(r)),i,n),n,o)},r.prototype._fitInternal=function(e,r,i){return e?(delete(r=t.extend(e,r)).padding,r.linear?this.easeTo(r,i):this.flyTo(r,i)):this},r.prototype.jumpTo=function(e,r){this.stop();var i=this.transform,n=!1,o=!1,a=!1;return"zoom"in e&&i.zoom!==+e.zoom&&(n=!0,i.zoom=+e.zoom),void 0!==e.center&&(i.center=t.LngLat.convert(e.center)),"bearing"in e&&i.bearing!==+e.bearing&&(o=!0,i.bearing=+e.bearing),"pitch"in e&&i.pitch!==+e.pitch&&(a=!0,i.pitch=+e.pitch),null==e.padding||i.isPaddingEqual(e.padding)||(i.padding=e.padding),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),n&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),o&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),a&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},r.prototype.easeTo=function(e,r){var i=this;this._stop(!1,e.easeId),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.browser.prefersReducedMotion)&&(e.duration=0);var n=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l=this.getPadding(),u="zoom"in e?+e.zoom:o,c="bearing"in e?this._normalizeBearing(e.bearing,a):a,h="pitch"in e?+e.pitch:s,p="padding"in e?e.padding:n.padding,d=t.Point.convert(e.offset),f=n.centerPoint.add(d),m=n.pointLocation(f),g=t.LngLat.convert(e.center||m);this._normalizeCenter(g);var y,v,_=n.project(m),b=n.project(g).sub(_),x=n.zoomScale(u-o);e.around&&(y=t.LngLat.convert(e.around),v=n.locationPoint(y));var w={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||u!==o,this._rotating=this._rotating||a!==c,this._pitching=this._pitching||h!==s,this._padding=!n.isPaddingEqual(p),this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,w),clearTimeout(this._easeEndTimeoutID),this._ease((function(e){if(i._zooming&&(n.zoom=t.number(o,u,e)),i._rotating&&(n.bearing=t.number(a,c,e)),i._pitching&&(n.pitch=t.number(s,h,e)),i._padding&&(n.interpolatePadding(l,p,e),f=n.centerPoint.add(d)),y)n.setLocationAtPoint(y,v);else{var m=n.zoomScale(n.zoom-o),g=u>o?Math.min(2,x):Math.max(.5,x),w=Math.pow(g,1-e),A=n.unproject(_.add(b.mult(e*w)).mult(m));n.setLocationAtPoint(n.renderWorldCopies?A.wrap():A,f)}i._fireMoveEvents(r)}),(function(t){i._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,i){void 0===i&&(i={}),this._moving=!0,r||i.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!i.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!i.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!i.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var i=this._zooming,n=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new t.Event("zoomend",e)),n&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var i=this;if(!e.essential&&t.browser.prefersReducedMotion){var n=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),l=this.getPitch(),u=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:l,d="padding"in e?e.padding:o.padding,f=o.zoomScale(c-a),m=t.Point.convert(e.offset),g=o.centerPoint.add(m),y=o.pointLocation(g),v=t.LngLat.convert(e.center||y);this._normalizeCenter(v);var _=o.project(y),b=o.project(v).sub(_),x=e.curve,w=Math.max(o.width,o.height),A=w/f,E=b.mag();if("minZoom"in e){var T=t.clamp(Math.min(e.minZoom,a,c),o.minZoom,o.maxZoom),S=w/o.zoomScale(T-a);x=Math.sqrt(S/E*2)}var P=x*x;function I(t){var e=(A*A-w*w+(t?-1:1)*P*P*E*E)/(2*(t?A:w)*P*E);return Math.log(Math.sqrt(e*e+1)-e)}function M(t){return(Math.exp(t)-Math.exp(-t))/2}function C(t){return(Math.exp(t)+Math.exp(-t))/2}var k=I(0),L=function(t){return C(k)/C(k+x*t)},z=function(t){return w*((C(k)*(M(e=k+x*t)/C(e))-M(k))/P)/E;var e},R=(I(1)-k)/x;if(Math.abs(E)<1e-6||!isFinite(R)){if(Math.abs(w-A)<1e-6)return this.easeTo(e,r);var O=A<w?-1:1;R=Math.abs(Math.log(A/w))/x,z=function(){return 0},L=function(t){return Math.exp(O*x*t)}}return e.duration="duration"in e?+e.duration:1e3*R/("screenSpeed"in e?+e.screenSpeed/x:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=p!==l,this._padding=!o.isPaddingEqual(d),this._prepareEase(r,!1),this._ease((function(e){var n=e*R,f=1/L(n);o.zoom=1===e?c:a+o.scaleZoom(f),i._rotating&&(o.bearing=t.number(s,h,e)),i._pitching&&(o.pitch=t.number(l,p,e)),i._padding&&(o.interpolatePadding(u,d,e),g=o.centerPoint.add(m));var y=1===e?v:o.unproject(_.add(b.mult(z(n))).mult(f));o.setLocationAtPoint(o.renderWorldCopies?y.wrap():y,g),i._fireMoveEvents(r)}),(function(){return i._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var i=this.handlers;i&&i.stop()}return this},r.prototype._ease=function(e,r,i){!1===i.animate||0===i.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=i,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var i=Math.abs(e-r);return Math.abs(e-360-r)<i&&(e-=360),Math.abs(e+360-r)<i&&(e+=360),e},r.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var r=t.lng-e.center.lng;t.lng+=r>180?-360:r<-180?360:0}},r}(t.Evented),_n=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};_n.prototype.getDefaultPosition=function(){return"bottom-right"},_n.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&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===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},_n.prototype.onRemove=function(){r.remove(this._container),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},_n.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var i=r.reduce((function(t,e,i){return e.value&&(t+=e.key+"="+e.value+(i<r.length-1?"&":"")),t}),"?");e.href=t.config.FEEDBACK_URL+"/"+i+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow"}},_n.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},_n.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return"string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var r=this._map.style.sourceCaches;for(var i in r){var n=r[i];if(n.used){var o=n.getSource();o.attribution&&t.indexOf(o.attribution)<0&&t.push(o.attribution)}}t.sort((function(t,e){return t.length-e.length}));var a=(t=t.filter((function(e,r){for(var i=r+1;i<t.length;i++)if(t[i].indexOf(e)>=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},_n.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var bn=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};bn.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},bn.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},bn.prototype.getDefaultPosition=function(){return"bottom-left"},bn.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},bn.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},bn.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var xn=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};xn.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},xn.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,i=e?this._queue.concat(e):this._queue;r<i.length;r+=1){var n=i[r];if(n.id===t)return void(n.cancelled=!0)}},xn.prototype.run=function(t){void 0===t&&(t=0);var e=this._currentlyRunning=this._queue;this._queue=[];for(var r=0,i=e;r<i.length;r+=1){var n=i[r];if(!n.cancelled&&(n.callback(t),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},xn.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var wn={"FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},An=t.window.HTMLImageElement,En=t.window.HTMLElement,Tn=t.window.ImageBitmap,Sn={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Pn=function(i){function n(e){var r=this;if(null!=(e=t.extend({},Sn,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var n=new wi(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(i.call(this,n,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new xn,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},wn,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof En))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),this.handlers=new yn(this,e),this._hash=e.hash&&new Ei("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new _n({customAttribution:e.customAttribution})),this.addControl(new bn,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}i&&(n.__proto__=i),(n.prototype=Object.create(i&&i.prototype)).constructor=n;var o={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return n.prototype._getMapId=function(){return this._mapId},n.prototype.addControl=function(e,r){if(void 0===r&&e.getDefaultPosition&&(r=e.getDefaultPosition()),void 0===r&&(r="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var i=e.onAdd(this);this._controls.push(e);var n=this._controlPositions[r];return-1!==r.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this},n.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},n.prototype.resize=function(e){var r=this._containerDimensions(),i=r[0],n=r[1];this._resizeCanvas(i,n),this.transform.resize(i,n),this.painter.resize(i,n);var o=!this._moving;return o&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),o&&this.fire(new t.Event("moveend",e)),this},n.prototype.getBounds=function(){return this.transform.getBounds()},n.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},n.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},n.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},n.prototype.getMinZoom=function(){return this.transform.minZoom},n.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},n.prototype.getMaxZoom=function(){return this.transform.maxZoom},n.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},n.prototype.getMinPitch=function(){return this.transform.minPitch},n.prototype.setMaxPitch=function(t){if((t=null==t?60:t)>60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},n.prototype.getMaxPitch=function(){return this.transform.maxPitch},n.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},n.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},n.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},n.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},n.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},n.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},n.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},n.prototype._createDelegatedListener=function(t,e,r){var i,n=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(i){var a=n.getLayer(e)?n.queryRenderedFeatures(i.point,{layers:[e]}):[];a.length?o||(o=!0,r.call(n,new zi(t,n,i.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(i){(n.getLayer(e)?n.queryRenderedFeatures(i.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(n,new zi(t,n,i.originalEvent)))},mouseout:function(e){a&&(a=!1,r.call(n,new zi(t,n,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(i={},i[t]=function(t){var i=n.getLayer(e)?n.queryRenderedFeatures(t.point,{layers:[e]}):[];i.length&&(t.features=i,r.call(n,t),delete t.features)},i)}},n.prototype.on=function(t,e,r){if(void 0===r)return i.prototype.on.call(this,t,e);var n=this._createDelegatedListener(t,e,r);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(n),n.delegates)this.on(o,n.delegates[o]);return this},n.prototype.once=function(t,e,r){if(void 0===r)return i.prototype.once.call(this,t,e);var n=this._createDelegatedListener(t,e,r);for(var o in n.delegates)this.once(o,n.delegates[o]);return this},n.prototype.off=function(t,e,r){var n=this;return void 0===r?i.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(i){for(var o=i[t],a=0;a<o.length;a++){var s=o[a];if(s.layer===e&&s.listener===r){for(var l in s.delegates)n.off(l,s.delegates[l]);return o.splice(a,1),n}}}(this._delegatedListeners),this)},n.prototype.queryRenderedFeatures=function(e,r){if(!this.style)return[];var i;if(void 0!==r||void 0===e||e instanceof t.Point||Array.isArray(e)||(r=e,e=void 0),r=r||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])i=[t.Point.convert(e)];else{var n=t.Point.convert(e[0]),o=t.Point.convert(e[1]);i=[n,new t.Point(o.x,n.y),o,new t.Point(n.x,o.y),n]}return this.style.queryRenderedFeatures(i,r,this.transform)},n.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},n.prototype.setStyle=function(e,r){return!1!==(r=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))},n.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},n.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new qe(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},n.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new qe(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},n.prototype._diffStyle=function(e,r){var i=this;if("string"==typeof e){var n=this._requestManager.normalizeStyleURL(e),o=this._requestManager.transformRequest(n,t.ResourceType.Style);t.getJSON(o,(function(e,n){e?i.fire(new t.ErrorEvent(e)):n&&i._updateDiff(n,r)}))}else"object"==typeof e&&this._updateDiff(e,r)},n.prototype._updateDiff=function(e,r){try{this.style.setState(e)&&this._update(!0)}catch(i){t.warnOnce("Unable to perform style diff: "+(i.message||i.error||i)+". Rebuilding the style from scratch."),this._updateStyle(e,r)}},n.prototype.getStyle=function(){if(this.style)return this.style.serialize()},n.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},n.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},n.prototype.isSourceLoaded=function(e){var r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},n.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var r=t[e]._tiles;for(var i in r){var n=r[i];if("loaded"!==n.state&&"errored"!==n.state)return!1}}return!0},n.prototype.addSourceType=function(t,e,r){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,r)},n.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},n.prototype.getSource=function(t){return this.style.getSource(t)},n.prototype.addImage=function(e,r,i){void 0===i&&(i={});var n=i.pixelRatio;void 0===n&&(n=1);var o=i.sdf;void 0===o&&(o=!1);var a=i.stretchX,s=i.stretchY,l=i.content;if(this._lazyInitEmptyStyle(),r instanceof An||Tn&&r instanceof Tn){var u=t.browser.getImageData(r);this.style.addImage(e,{data:new t.RGBAImage({width:u.width,height:u.height},u.data),pixelRatio:n,stretchX:a,stretchY:s,content:l,sdf:o,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new t.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`")));var c=r;this.style.addImage(e,{data:new t.RGBAImage({width:r.width,height:r.height},new Uint8Array(r.data)),pixelRatio:n,stretchX:a,stretchY:s,content:l,sdf:o,version:0,userImage:c}),c.onAdd&&c.onAdd(this,e)}},n.prototype.updateImage=function(e,r){var i=this.style.getImage(e);if(!i)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var n=r instanceof An||Tn&&r instanceof Tn?t.browser.getImageData(r):r,o=n.width,a=n.height,s=n.data;return void 0===o||void 0===a?this.fire(new t.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`"))):o!==i.data.width||a!==i.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(i.data.replace(s,!(r instanceof An||Tn&&r instanceof Tn)),void this.style.updateImage(e,i))},n.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},n.prototype.removeImage=function(t){this.style.removeImage(t)},n.prototype.loadImage=function(e,r){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),r)},n.prototype.listImages=function(){return this.style.listImages()},n.prototype.addLayer=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},n.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},n.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},n.prototype.getLayer=function(t){return this.style.getLayer(t)},n.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)},n.prototype.setFilter=function(t,e,r){return void 0===r&&(r={}),this.style.setFilter(t,e,r),this._update(!0)},n.prototype.getFilter=function(t){return this.style.getFilter(t)},n.prototype.setPaintProperty=function(t,e,r,i){return void 0===i&&(i={}),this.style.setPaintProperty(t,e,r,i),this._update(!0)},n.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},n.prototype.setLayoutProperty=function(t,e,r,i){return void 0===i&&(i={}),this.style.setLayoutProperty(t,e,r,i),this._update(!0)},n.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},n.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},n.prototype.getLight=function(){return this.style.getLight()},n.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},n.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},n.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},n.prototype.getContainer=function(){return this._container},n.prototype.getCanvasContainer=function(){return this._canvasContainer},n.prototype.getCanvas=function(){return this._canvas},n.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},n.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.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
16in https://www.mapbox.com/mapbox-gl-js/api/.")},n.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=r.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=r.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var i=this._containerDimensions();this._resizeCanvas(i[0],i[1]);var n=this._controlContainer=r.create("div","mapboxgl-control-container",t),o=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){o[t]=r.create("div","mapboxgl-ctrl-"+t,n)}))},n.prototype._resizeCanvas=function(e,r){var i=t.browser.devicePixelRatio||1;this._canvas.width=i*e,this._canvas.height=i*r,this._canvas.style.width=e+"px",this._canvas.style.height=r+"px"},n.prototype._setupPainter=function(){var r=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),i=this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r);i?(this.painter=new vi(i,this.transform),t.webpSupported.testSupport(i)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},n.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},n.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},n.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},n.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},n.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},n.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},n.prototype._render=function(e){var r,i=this,n=0,o=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(r=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,r),n=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),!this._removed){var a=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var s=this.transform.zoom,l=t.browser.now();this.style.zoomHistory.update(s,l);var u=new t.EvaluationParameters(s,{now:l,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),c=u.crossFadingFactor();1===c&&c===this._crossFadingFactor||(a=!0,this._crossFadingFactor=c),this.style.update(u)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||a)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var h=t.browser.now()-n;o.endQueryEXT(o.TIME_ELAPSED_EXT,r),setTimeout((function(){var e=o.getQueryObjectEXT(r,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(r),i.fire(new t.Event("gpu-timing-frame",{cpuTime:h,gpuTime:e}))}),50)}if(this.listens("gpu-timing-layer")){var p=this.painter.collectGpuTimers();setTimeout((function(){var e=i.painter.queryGpuTimers(p);i.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))}),50)}var d=this._sourcesDirty||this._styleDirty||this._placementDirty;return d||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),!this._loaded||this._fullyLoaded||d||(this._fullyLoaded=!0),this}},n.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,r=this._controls;e<r.length;e+=1)r[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var i=this.painter.context.gl.getExtension("WEBGL_lose_context");i&&i.loseContext(),In(this._canvasContainer),In(this._controlContainer),In(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},n.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(t){e._frame=null,e._render(t)})))},n.prototype._onWindowOnline=function(){this._update()},n.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update()},o.showTileBoundaries.get=function(){return!!this._showTileBoundaries},o.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},o.showPadding.get=function(){return!!this._showPadding},o.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update())},o.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},o.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},o.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},o.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},o.repaint.get=function(){return!!this._repaint},o.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},o.vertices.get=function(){return!!this._vertices}
vendor: 17,897 bytes, line 16
16,o.vertices.set=function(t){this._vertices=t,this._update()},n.prototype._setCacheLimits=function(e,r){t.setCacheLimits(e,r)},o.version.get=function(){return t.version},Object.defineProperties(n.prototype,o),n}(vn);function In(t){t.parentNode&&t.parentNode.removeChild(t)}var Mn={showCompass:!0,showZoom:!0,visualizePitch:!1},Cn=function(e){var i=this;this.options=t.extend({},Mn,e),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(t){return i._map.zoomIn({},{originalEvent:t})})),r.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(t){return i._map.zoomOut({},{originalEvent:t})})),r.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(t){i.options.visualizePitch?i._map.resetNorthPitch({},{originalEvent:t}):i._map.resetNorth({},{originalEvent:t})})),this._compassIcon=r.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Cn.prototype._updateZoomButtons=function(){var t=this._map.getZoom();this._zoomInButton.disabled=t===this._map.getMaxZoom(),this._zoomOutButton.disabled=t===this._map.getMinZoom()},Cn.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=t},Cn.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new kn(this._map,this._compass,this.options.visualizePitch)),this._container},Cn.prototype.onRemove=function(){r.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},Cn.prototype._createButton=function(t,e){var i=r.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i},Cn.prototype._setButtonTitle=function(t,e){var r=this._map._getUIString("NavigationControl."+e);t.title=r,t.setAttribute("aria-label",r)};var kn=function(e,i,n){void 0===n&&(n=!1),this._clickTolerance=10,this.element=i,this.mouseRotate=new Wi({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,n&&(this.mousePitch=new Hi({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(i,"mousedown",this.mousedown),r.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(i,"touchmove",this.touchmove),r.addEventListener(i,"touchend",this.touchend),r.addEventListener(i,"touchcancel",this.reset)};function Ln(e,r,i){if(e=new t.LngLat(e.lng,e.lat),r){var n=new t.LngLat(e.lng-360,e.lat),o=new t.LngLat(e.lng+360,e.lat),a=i.locationPoint(e).distSqr(r);i.locationPoint(n).distSqr(r)<a?e=n:i.locationPoint(o).distSqr(r)<a&&(e=o)}for(;Math.abs(e.lng-i.center.lng)>180;){var s=i.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=i.width&&s.y<=i.height)break;e.lng>i.center.lng?e.lng-=360:e.lng+=360}return e}kn.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},kn.prototype.move=function(t,e){var r=this.map,i=this.mouseRotate.mousemoveWindow(t,e);if(i&&i.bearingDelta&&r.setBearing(r.getBearing()+i.bearingDelta),this.mousePitch){var n=this.mousePitch.mousemoveWindow(t,e);n&&n.pitchDelta&&r.setPitch(r.getPitch()+n.pitchDelta)}},kn.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},kn.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},kn.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},kn.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},kn.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},kn.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},kn.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},kn.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},kn.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var zn={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Rn(t,e,r){var i=t.classList;for(var n in zn)i.remove("mapboxgl-"+r+"-anchor-"+n);i.add("mapboxgl-"+r+"-anchor-"+e)}var On,Dn=function(e){function i(i,n){var o=this;if(e.call(this),(i instanceof t.window.HTMLElement||n)&&(i=t.extend({element:i},n)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=i&&i.anchor||"center",this._color=i&&i.color||"#3FB1CE",this._scale=i&&i.scale||1,this._draggable=i&&i.draggable||!1,this._state="inactive",this._rotation=i&&i.rotation||0,this._rotationAlignment=i&&i.rotationAlignment||"auto",this._pitchAlignment=i&&i.pitchAlignment&&"auto"!==i.pitchAlignment?i.pitchAlignment:this._rotationAlignment,i&&i.element)this._element=i.element,this._offset=t.Point.convert(i&&i.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var a=r.createNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height","41px"),a.setAttributeNS(null,"width","27px"),a.setAttributeNS(null,"viewBox","0 0 27 41");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"stroke","none"),s.setAttributeNS(null,"stroke-width","1"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"fill-rule","evenodd");var l=r.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"fill-rule","nonzero");var u=r.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(3.0, 29.0)"),u.setAttributeNS(null,"fill","#000000");for(var c=0,h=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];c<h.length;c+=1){var p=h[c],d=r.createNS("http://www.w3.org/2000/svg","ellipse");d.setAttributeNS(null,"opacity","0.04"),d.setAttributeNS(null,"cx","10.5"),d.setAttributeNS(null,"cy","5.80029008"),d.setAttributeNS(null,"rx",p.rx),d.setAttributeNS(null,"ry",p.ry),u.appendChild(d)}var f=r.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"fill",this._color);var m=r.createNS("http://www.w3.org/2000/svg","path");m.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),f.appendChild(m);var g=r.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"fill","#000000");var y=r.createNS("http://www.w3.org/2000/svg","path");y.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),g.appendChild(y);var v=r.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(6.0, 7.0)"),v.setAttributeNS(null,"fill","#FFFFFF");var _=r.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(8.0, 8.0)");var b=r.createNS("http://www.w3.org/2000/svg","circle");b.setAttributeNS(null,"fill","#000000"),b.setAttributeNS(null,"opacity","0.25"),b.setAttributeNS(null,"cx","5.5"),b.setAttributeNS(null,"cy","5.5"),b.setAttributeNS(null,"r","5.4999962");var x=r.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#FFFFFF"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962"),_.appendChild(b),_.appendChild(x),l.appendChild(u),l.appendChild(f),l.appendChild(g),l.appendChild(v),l.appendChild(_),a.appendChild(l),a.setAttributeNS(null,"height",41*this._scale+"px"),a.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(a),this._offset=t.Point.convert(i&&i.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault()})),this._element.addEventListener("mousedown",(function(t){t.preventDefault()})),this._element.addEventListener("focus",(function(){var t=o._map.getContainer();t.scrollTop=0,t.scrollLeft=0})),Rn(this._element,this._anchor,"marker"),this._popup=null}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},i.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),r.remove(this._element),this._popup&&this._popup.remove(),this},i.prototype.getLngLat=function(){return this._lngLat},i.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},i.prototype.getElement=function(){return this._element},i.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},i.prototype._onKeyPress=function(t){var e=t.code,r=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==r&&13!==r||this.togglePopup()},i.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},i.prototype.getPopup=function(){return this._popup},i.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},i.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Ln(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),r.setTransform(this._element,zn[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+i+" "+e)}},i.prototype.getOffset=function(){return this._offset},i.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},i.prototype._onMove=function(e){this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag"))},i.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},i.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},i.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},i.prototype.isDraggable=function(){return this._draggable},i.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},i.prototype.getRotation=function(){return this._rotation},i.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},i.prototype.getRotationAlignment=function(){return this._rotationAlignment},i.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},i.prototype.getPitchAlignment=function(){return this._pitchAlignment},i}(t.Evented),Bn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Fn=0,jn=!1,Nn=function(e){function i(r){e.call(this),this.options=t.extend({},Bn,r),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.onAdd=function(e){var i;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),i=this._setupUI,void 0!==On?i(On):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){i(On="denied"!==t.state)})):i(On=!!t.window.navigator.geolocation),this._container},i.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Fn=0,jn=!1},i.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitude<e.getWest()||r.longitude>e.getEast()||r.latitude<e.getSouth()||r.latitude>e.getNorth())},i.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
16RROR",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")}},i.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},i.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),i=e.coords.accuracy,n=this._map.getBearing(),o=t.extend({bearing:n},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(i),o,{geolocateSource:!0})},i.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},i.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),i=e.distanceTo(r),n=Math.ceil(2*this._accuracy/i);this._circleElement.style.width=n+"px",this._circleElement.style.height=n+"px"},i.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},i.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.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;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&jn)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},i.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},i.prototype._setupUI=function(e){var i=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{var o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
16se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Dn(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Dn({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",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==i._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(i._watchState="BACKGROUND",i._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),i._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),i.fire(new t.Event("trackuserlocationend")))}))},i.prototype.trigger=function(){if(!this._setup)return t.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 t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Fn--,jn=!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 t.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 t.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){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Fn>1?(e={maximumAge:6e5,timeout:0},jn=!0):(e=this.options.positionOptions,jn=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},i.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},i}(t.Evented),Un={maxWidth:100,unit:"metric"},Vn=function(e){this.options=t.extend({},Un,e),t.bindAll(["_onMove","setUnit"],this)};function qn(t,e,r){var i=r&&r.maxWidth||100,n=t._container.clientHeight/2,o=t.unproject([0,n]),a=t.unproject([i,n]),s=o.distanceTo(a);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?Gn(e,i,l/5280,t._getUIString("ScaleControl.Miles")):Gn(e,i,l,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Gn(e,i,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Gn(e,i,s/1e3,t._getUIString("ScaleControl.Kilometers")):Gn(e,i,s,t._getUIString("ScaleControl.Meters"))}function Gn(t,e,r,i){var n,o,a,s=(n=r,(o=Math.pow(10,(""+Math.floor(n)).length-1))*(a=(a=n/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/r)+"px",t.innerHTML=s+" "+i}Vn.prototype.getDefaultPosition=function(){return"bottom-left"},Vn.prototype._onMove=function(){qn(this._map,this._container,this.options)},Vn.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Vn.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Vn.prototype.setUnit=function(t){this.options.unit=t,qn(this._map,this._container,this.options)};var Zn=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Zn.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Zn.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Zn.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Zn.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Zn.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Zn.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Zn.prototype._isFullscreen=function(){return this._fullscreen},Zn.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Zn.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Wn={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},Hn=function(e){function i(r){e.call(this),this.options=t.extend(Object.create(Wn),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},i.prototype.isOpen=function(){return!!this._map},i.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},i.prototype.getLngLat=function(){return this._lngLat}
vendor: 4,973 bytes, line 16
16,i.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},i.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},i.prototype.getElement=function(){return this._container},i.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},i.prototype.setHTML=function(e){var r,i=t.window.document.createDocumentFragment(),n=t.window.document.createElement("body");for(n.innerHTML=e;r=n.firstChild;)i.appendChild(r);return this.setDOMContent(i)},i.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},i.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},i.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},i.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},i.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},i.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},i.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},i.prototype._onMouseUp=function(t){this._update(t.point)},i.prototype._onMouseMove=function(t){this._update(t.point)},i.prototype._onDrag=function(t){this._update(t.point)},i.prototype._update=function(e){var i=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return i._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ln(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var n=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,a=function e(r){if(r){if("number"==typeof r){var i=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(i,i),"top-right":new t.Point(-i,i),bottom:new t.Point(0,-r),"bottom-left":new t.Point(i,-i),"bottom-right":new t.Point(-i,-i),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var n=t.Point.convert(r);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var s,l=this._container.offsetWidth,u=this._container.offsetHeight;s=n.y+a.bottom.y<u?["top"]:n.y>this._map.transform.height-u?["bottom"]:[],n.x<l/2?s.push("left"):n.x>this._map.transform.width-l/2&&s.push("right"),o=0===s.length?"bottom":s.join("-")}var c=n.add(a[o]).round();r.setTransform(this._container,zn[o]+" translate("+c.x+"px,"+c.y+"px)"),Rn(this._container,o,"popup")}},i.prototype._onClose=function(){this.remove()},i}(t.Evented),Xn={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Pn,NavigationControl:Cn,GeolocateControl:Nn,AttributionControl:_n,ScaleControl:Vn,FullscreenControl:Zn,Popup:Hn,Marker:Dn,Style:qe,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.
16Evented,config:t.config,prewarm:function(){Ft().acquire(Rt)},clearPrewarmedResources:function(){var t=Dt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Rt),Dt=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 t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Ot.workerCount},set workerCount(t){Ot.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Xn})),r}()},52697:(t,e,r)=>{"use strict";r.d(e,{H:()=>a,Ij:()=>s,Xj:()=>o,jX:()=>n});const i="Failed to deduce GL constant from typed array";function n(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(i)}}function o(t){let{clamped:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function a(t){let{data:e,width:r,height:i,bytesPerPixel:n=4,temp:o}=t;const a=r*n;o=o||new Uint8Array(a);for(let t=0;t<i/2;++t){const r=t*a,n=(i-t-1)*a;o.set(e.subarray(r,r+a)),e.copyWithin(r,n,n+a),e.set(o,n)}}function s(t){let{data:e,width:r,height:i}=t;const n=Math.round(r/2),o=Math.round(i/2),a=new Uint8Array(n*o*4);for(let t=0;t<o;t++)for(let i=0;i<n;i++)for(let o=0;o<4;o++)a[4*(t*n+i)+o]=e[4*(2*t*r+2*i)+o];return{data:a,width:n,height:o}}},53987:(t,e)=>{"use strict";function r(t,e,r){void 0===r&&(r={});var i={type:"Feature"};return(0===r.id||r.id)&&(i.id=r.id),r.bbox&&(i.bbox=r.bbox),i.properties=e||{},i.geometry=t,i}function i(t,e,i){if(void 0===i&&(i={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!d(t[0])||!d(t[1]))throw new Error("coordinates must contain numbers");return r({type:"Point",coordinates:t},e,i)}function n(t,e,i){void 0===i&&(i={});for(var n=0,o=t;n<o.length;n++){var a=o[n];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw new Error("First and last Position are not equivalent.")}return r({type:"Polygon",coordinates:t},e,i)}function o(t,e,i){if(void 0===i&&(i={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return r({type:"LineString",coordinates:t},e,i)}function a(t,e){void 0===e&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function s(t,e,i){return void 0===i&&(i={}),r({type:"MultiLineString",coordinates:t},e,i)}function l(t,e,i){return void 0===i&&(i={}),r({type:"MultiPoint",coordinates:t},e,i)}function u(t,e,i){return void 0===i&&(i={}),r({type:"MultiPolygon",coordinates:t},e,i)}function c(t,r){void 0===r&&(r="kilometers");var i=e.factors[r];
vendor: 4,224 bytes, lines 16-21
16if(!i)throw new Error(r+" units is invalid");return t*i}function h(t,r){void 0===r&&(r="kilometers");var i=e.factors[r];if(!i)throw new Error(r+" units is invalid");return t/i}function p(t){return 180*(t%(2*Math.PI))/Math.PI}function d(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius,miles:e.earthRadius/1609.344,millimeters:1e3*e.earthRadius,millimetres:1e3*e.earthRadius,nauticalmiles:e.earthRadius/1852,radians:1,yards:1.0936*e.earthRadius},e.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/e.earthRadius,yards:1.0936133},e.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},e.feature=r,e.geometry=function(t,e,r){switch(void 0===r&&(r={}),t){case"Point":return i(e).geometry;case"LineString":return o(e).geometry;case"Polygon":return n(e).geometry;case"MultiPoint":return l(e).geometry;case"MultiLineString":return s(e).geometry;case"MultiPolygon":return u(e).geometry;default:throw new Error(t+" is invalid")}},e.point=i,e.points=function(t,e,r){return void 0===r&&(r={}),a(t.map((function(t){return i(t,e)})),r)},e.polygon=n,e.polygons=function(t,e,r){return void 0===r&&(r={}),a(t.map((function(t){return n(t,e)})),r)},e.lineString=o,e.lineStrings=function(t,e,r){return void 0===r&&(r={}),a(t.map((function(t){return o(t,e)})),r)},e.featureCollection=a,e.multiLineString=s,e.multiPoint=l,e.multiPolygon=u,e.geometryCollection=function(t,e,i){return void 0===i&&(i={}),r({type:"GeometryCollection",geometries:t},e,i)},e.round=function(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},e.radiansToLength=c,e.lengthToRadians=h,e.lengthToDegrees=function(t,e){return p(h(t,e))},e.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},e.radiansToDegrees=p,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return c(h(t,e),r)},e.convertArea=function(t,r,i){if(void 0===r&&(r="meters"),void 0===i&&(i="kilometers"),!(t>=0))throw new Error("area must be a positive number");var n=e.areaFactors[r];if(!n)throw new Error("invalid original units");var o=e.areaFactors[i];if(!o)throw new Error("invalid final units");return t/n*o},e.isNumber=d,e.isObject=function(t){return!!t&&t.constructor===Object},e.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},e.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},55188:(t,e,r)=>{var i; 17/*! Hammer.JS - v2.0.7 - 2016-04-22 18 * http://hammerjs.github.io/ 19 * 20 * Copyright (c) 2016 Jorik Tangelder; 21 * Licensed under the MIT license */!function(n,o,a,s){"use strict";var l,u=["","webkit","Moz","MS","ms","o"],c=o.createElement("div"),h=Math.round,p=Math.abs,d=Date.now;function f(t,e,r){return setTimeout(x(t,r),e)}function m(t,e,r){return!!Array.isArray(t)&&(g(t,r[e],r),!0)}function g(t,e,r){var i;if(t)if(t.forEach)t.forEach(e,r);else if(t.length!==s)for(i=0;i<t.length;)e.call(r,t[i],i,t),i++;else for(i in t)t.hasOwnProperty(i)&&e.call(r,t[i],i,t)}function y(t,e,r){var i="DEPRECATED METHOD: "+e+"\n"+r+" AT \n";return function(){var e=new Error("get-stack-trace"),r=e&&e.stack?e.
vendor: 15,659 bytes, line 21
21stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=n.console&&(n.console.warn||n.console.log);return o&&o.call(n.console,i,r),t.apply(this,arguments)}}l="function"!=typeof Object.assign?function(t){if(t===s||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),r=1;r<arguments.length;r++){var i=arguments[r];if(i!==s&&null!==i)for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])}return e}:Object.assign;var v=y((function(t,e,r){for(var i=Object.keys(e),n=0;n<i.length;)(!r||r&&t[i[n]]===s)&&(t[i[n]]=e[i[n]]),n++;return t}),"extend","Use `assign`."),_=y((function(t,e){return v(t,e,!0)}),"merge","Use `assign`.");function b(t,e,r){var i,n=e.prototype;(i=t.prototype=Object.create(n)).constructor=t,i._super=n,r&&l(i,r)}function x(t,e){return function(){return t.apply(e,arguments)}}function w(t,e){return"function"==typeof t?t.apply(e&&e[0]||s,e):t}function A(t,e){return t===s?e:t}function E(t,e,r){g(I(e),(function(e){t.addEventListener(e,r,!1)}))}function T(t,e,r){g(I(e),(function(e){t.removeEventListener(e,r,!1)}))}function S(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function P(t,e){return t.indexOf(e)>-1}function I(t){return t.trim().split(/\s+/g)}function M(t,e,r){if(t.indexOf&&!r)return t.indexOf(e);for(var i=0;i<t.length;){if(r&&t[i][r]==e||!r&&t[i]===e)return i;i++}return-1}function C(t){return Array.prototype.slice.call(t,0)}function k(t,e,r){for(var i=[],n=[],o=0;o<t.length;){var a=e?t[o][e]:t[o];M(n,a)<0&&i.push(t[o]),n[o]=a,o++}return r&&(i=e?i.sort((function(t,r){return t[e]>r[e]})):i.sort()),i}function L(t,e){for(var r,i,n=e[0].toUpperCase()+e.slice(1),o=0;o<u.length;){if((i=(r=u[o])?r+n:e)in t)return i;o++}return s}var z=1;function R(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||n}var O="ontouchstart"in n,D=L(n,"PointerEvent")!==s,B=O&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),F="touch",j="mouse",N=24,U=["x","y"],V=["clientX","clientY"];function q(t,e){var r=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){w(t.options.enable,[t])&&r.handler(e)},this.init()}function G(t,e,r){var i=r.pointers.length,n=r.changedPointers.length,o=1&e&&i-n==0,a=12&e&&i-n==0;r.isFirst=!!o,r.isFinal=!!a,o&&(t.session={}),r.eventType=e,function(t,e){var r=t.session,i=e.pointers,n=i.length;r.firstInput||(r.firstInput=Z(e));n>1&&!r.firstMultiple?r.firstMultiple=Z(e):1===n&&(r.firstMultiple=!1);var o=r.firstInput,a=r.firstMultiple,l=a?a.center:o.center,u=e.center=W(i);e.timeStamp=d(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=K(l,u),e.distance=Y(l,u),function(t,e){var r=e.center,i=t.offsetDelta||{},n=t.prevDelta||{},o=t.prevInput||{};1!==e.eventType&&4!==o.eventType||(n=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=t.offsetDelta={x:r.x,y:r.y});e.deltaX=n.x+(r.x-i.x),e.deltaY=n.y+(r.y-i.y)}(r,e),e.offsetDirection=X(e.deltaX,e.deltaY);var c=H(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=p(c.x)>p(c.y)?c.x:c.y,e.scale=a?function(t,e){return Y(e[0],e[1],V)/Y(t[0],t[1],V)}(a.pointers,i):1,e.rotation=a?function(t,e){return K(e[1],e[0],V)+K(t[1],t[0],V)}(a.pointers,i):0,e.maxPointers=r.prevInput?e.pointers.length>r.prevInput.maxPointers?e.pointers.length:r.prevInput.maxPointers:e.pointers.length,function(t,e){var r,i,n,o,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(8!=e.eventType&&(l>25||a.velocity===s)){var u=e.deltaX-a.deltaX,c=e.deltaY-a.deltaY,h=H(l,u,c);i=h.x,n=h.y,r=p(h.x)>p(h.y)?h.x:h.y,o=X(u,c),t.lastInterval=e}else r=a.velocity,i=a.velocityX,n=a.velocityY,o=a.direction;e.velocity=r,e.velocityX=i,e.velocityY=n,e.direction=o}(r,e);var h=t.element;S(e.srcEvent.target,h)&&(h=e.srcEvent.target);e.target=h}(t,r),t.emit("hammer.input",r),t.recognize(r),t.session.prevInput=r}function Z(t){for(var e=[],r=0;r<t.pointers.length;)e[r]={clientX:h(t.pointers[r].clientX),clientY:h(t.pointers[r].clientY)},r++;return{timeStamp:d(),pointers:e,center:W(e),deltaX:t.deltaX,deltaY:t.deltaY}}function W(t){var e=t.length;if(1===e)return{x:h(t[0].clientX),y:h(t[0].clientY)};for(var r=0,i=0,n=0;n<e;)r+=t[n].clientX,i+=t[n].clientY,n++;return{x:h(r/e),y:h(i/e)}}function H(t,e,r){return{x:e/t||0,y:r/t||0}}function X(t,e){return t===e?1:p(t)>=p(e)?t<0?2:4:e<0?8:16}function Y(t,e,r){r||(r=U);var i=e[r[0]]-t[r[0]],n=e[r[1]]-t[r[1]];return Math.sqrt(i*i+n*n)}function K(t,e,r){r||(r=U);var i=e[r[0]]-t[r[0]],n=e[r[1]]-t[r[1]];return 180*Math.atan2(n,i)/Math.PI}q.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&T(this.element,this.evEl,this.domHandler),this.evTarget&&T(this.target,this.evTarget,this.domHandler),this.evWin&&T(R(this.element),this.evWin,this.domHandler)}};var J={mousedown:1,mousemove:2,mouseup:4},Q="mousedown",$="mousemove mouseup";function tt(){this.evEl=Q,this.evWin=$,this.pressed=!1,q.apply(this,arguments)}b(tt,q,{handler:function(t){var e=J[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:j,srcEvent:t}))}});var et={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},rt={2:F,3:"pen",4:j,5:"kinect"},it="pointerdown",nt="pointermove pointerup pointercancel";function ot(){this.evEl=it,this.evWin=nt,q.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}n.MSPointerEvent&&!n.PointerEvent&&(it="MSPointerDown",nt="MSPointerMove MSPointerUp MSPointerCancel"),b(ot,q,{handler:function(t){var e=this.store,r=!1,i=t.type.toLowerCase().replace("ms",""),n=et[i],o=rt[t.pointerType]||t.pointerType,a=o==F,s=M(e,t.pointerId,"pointerId");1&n&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):12&n&&(r=!0),s<0||(e[s]=t,this.callback(this.manager,n,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),r&&e.splice(s,1))}});var at={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function st(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,q.apply(this,arguments)}function lt(t,e){var r=C(t.touches),i=C(t.changedTouches);return 12&e&&(r=k(r.concat(i),"identifier",!0)),[r,i]}b(st,q,{handler:function(t){var e=at[t.type];if(1===e&&(this.started=!0),this.started){var r=lt.call(this,t,e);12&e&&r[0].length-r[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:r[0],changedPointers:r[1],pointerType:F,srcEvent:t})}}});var ut={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ct="touchstart touchmove touchend touchcancel";function ht(){this.evTarget=ct,this.targetIds={},q.apply(this,arguments)}function pt(t,e){var r=C(t.touches),i=this.targetIds;if(3&e&&1===r.length)return i[r[0].identifier]=!0,[r,r];var n,o,a=C(t.changedTouches),s=[],l=this.target;if(o=r.filter((function(t){return S(t.target,l)})),1===e)for(n=0;n<o.length;)i[o[n].identifier]=!0,n++;for(n=0;n<a.length;)i[a[n].identifier]&&s.push(a[n]),12&e&&delete i[a[n].identifier],n++;return s.length?[k(o.concat(s),"identifier",!0),s]:void 0}b(ht,q,{handler:function(t){var e=ut[t.type],r=pt.call(this,t,e);r&&this.callback(this.manager,e,{pointers:r[0],changedPointers:r[1],pointerType:F,srcEvent:t})}});function dt(){q.apply(this,arguments);var t=x(this.handler,this);this.touch=new ht(this.manager,t),this.mouse=new tt(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function ft(t,e){1&t?(this.primaryTouch=e.changedPointers[0].identifier,mt.call(this,e)):12&t&&mt.call(this,e)}function mt(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var r={x:e.clientX,y:e.clientY};this.lastTouches.push(r);var i=this.lastTouches;setTimeout((function(){var t=i.indexOf(r);t>-1&&i.splice(t,1)}),2500)}}function gt(t){for(var e=t.srcEvent.clientX,r=t.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var n=this.lastTouches[i],o=Math.abs(e-n.x),a=Math.abs(r-n.y);if(o<=25&&a<=25)return!0}return!1}b(dt,q,{handler:function(t,e,r){var i=r.pointerType==F,n=r.pointerType==j;if(!(n&&r.sourceCapabilities&&r.sourceCapabilities.firesTouchEvents)){if(i)ft.call(this,e,r);else if(n&>.call(this,r))return;this.callback(t,e,r)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var yt=L(c.style,"touchAction"),vt=yt!==s,_t="compute",bt="auto",xt="manipulation",wt="none",At="pan-x",Et="pan-y",Tt=function(){if(!vt)return!1;var t={},e=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(r){t[r]=!e||n.CSS.supports("touch-action",r)})),t}();function St(t,e){this.manager=t,this.set(e)}St.prototype={set:function(t){t==_t&&(t=this.compute()),vt&&this.manager.element.style&&Tt[t]&&(this.manager.element.style[yt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return g(this.manager.recognizers,(function(e){w(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(P(t,wt))return wt;var e=P(t,At),r=P(t,Et);if(e&&r)return wt;if(e||r)return e?At:Et;if(P(t,xt))return xt;return bt}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,r=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var i=this.actions,n=P(i,wt)&&!Tt[wt],o=P(i,Et)&&!Tt[Et],a=P(i,At)&&!Tt[At];if(n){var s=1===t.pointers.length,l=t.distance<2,u=t.deltaTime<250;if(s&&l&&u)return}if(!a||!o)return n||o&&6&r||a&&r&N?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var Pt=32;function It(t){this.options=l({},this.defaults,t||{}),this.id=z++,this.manager=null,this.options.enable=A(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Mt(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function Ct(t){return 16==t?"down":8==t?"up":2==t?"left":4==t?"right":""}function kt(t,e){var r=e.manager;return r?r.get(t):t}function Lt(){It.apply(this,arguments)}function zt(){Lt.apply(this,arguments),this.pX=null,this.pY=null}function Rt(){Lt.apply(this,arguments)}function Ot(){It.apply(this,arguments),this._timer=null,this._input=null}function Dt(){Lt.apply(this,arguments)}function Bt(){Lt.apply(this,arguments)}function Ft(){It.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function jt(t,e){return(e=e||{}).recognizers=A(e.recognizers,jt.defaults.preset),new Nt(t,e)}It.prototype={defaults:{},set:function(t){return l(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(m(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=kt(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return m(t,"dropRecognizeWith",this)||(t=kt(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(m(t,"requireFailure",this))return this;var e=this.requireFail;return-1===M(e,t=kt(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(m(t,"dropRequireFailure",this))return this;t=kt(t,this);var e=M(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,r=this.state;function i(r){e.manager.emit(r,t)}r<8&&i(e.options.event+Mt(r)),i(e.options.event),t.additionalEvent&&i(t.additionalEvent),r>=8&&i(e.options.event+Mt(r))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=Pt},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},recognize:function(t){var e=l({},t);if(!w(this.options.enable,[this,e]))return this.reset(),void(this.state=Pt);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},b(Lt,It,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,r=t.eventType,i=6&e,n=this.attrTest(t);return i&&(8&r||!n)?16|e:i||n?4&r?8|e:2&e?4|e:2:Pt}}),b(zt,Lt,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var t=this.options.direction,e=[];return 6&t&&e.push(Et),t&N&&e.push(At),e},directionTest:function(t){var e=this.options,r=!0,i=t.distance,n=t.direction,o=t.deltaX,a=t.deltaY;return n&e.direction||(6&e.direction?(n=0===o?1:o<0?2:4,r=o!=this.pX,i=Math.abs(t.deltaX)):(n=0===a?1:a<0?8:16,r=a!=this.pY,i=Math.abs(t.deltaY))),t.direction=n,r&&i>e.threshold&&n&e.direction},attrTest:function(t){return Lt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Ct(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),b(Rt,Lt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[wt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),b(Ot,It,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[bt]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,i=t.distance<e.threshold,n=t.deltaTime>e.time;if(this._input=t,!i||!r||12&t.eventType&&!n)this.reset();else if(1&t.eventType)this.reset(),this._timer=f((function(){this.state=8,this.tryEmit()}),e.time,this);else if(4&t.eventType)return 8;return Pt},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),b(Dt,Lt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[wt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),b(Bt,Lt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return zt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,r=this.options.direction;return 30&r?e=t.overallVelocity:6&r?e=t.overallVelocityX:r&N&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&r&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&p(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=Ct(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),b(Ft,It,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[xt]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,i=t.distance<e.threshold,n=t.deltaTime<e.time;if(this.reset(),1&t.eventType&&0===this.count)return this.failTimeout();if(i&&n&&r){if(4!=t.eventType)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||Y(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&o?this.count+=1:this.count=1,this._input=t,0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=f((function(){this.state=8,this.tryEmit()}
vendor: 4,302 bytes, line 21
21),e.interval,this),2):8}return Pt},failTimeout:function(){return this._timer=f((function(){this.state=Pt}),this.options.interval,this),Pt},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),jt.VERSION="2.0.7",jt.defaults={domEvents:!1,touchAction:_t,enable:!0,inputTarget:null,inputClass:null,preset:[[Dt,{enable:!1}],[Rt,{enable:!1},["rotate"]],[Bt,{direction:6}],[zt,{direction:6},["swipe"]],[Ft],[Ft,{event:"doubletap",taps:2},["tap"]],[Ot]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Nt(t,e){this.options=l({},jt.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=function(t){return new(t.options.inputClass||(D?ot:B?ht:O?dt:tt))(t,G)}(this),this.touchAction=new St(this,this.options.touchAction),Ut(this,!0),g(this.options.recognizers,(function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}function Ut(t,e){var r,i=t.element;i.style&&(g(t.options.cssProps,(function(n,o){r=L(i.style,o),e?(t.oldCssProps[r]=i.style[r],i.style[r]=n):i.style[r]=t.oldCssProps[r]||""})),e||(t.oldCssProps={}))}Nt.prototype={set:function(t){return l(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var r;this.touchAction.preventDefaults(t);var i=this.recognizers,n=e.curRecognizer;(!n||n&&8&n.state)&&(n=e.curRecognizer=null);for(var o=0;o<i.length;)r=i[o],2===e.stopped||n&&r!=n&&!r.canRecognizeWith(n)?r.reset():r.recognize(t),!n&&14&r.state&&(n=e.curRecognizer=r),o++}},get:function(t){if(t instanceof It)return t;for(var e=this.recognizers,r=0;r<e.length;r++)if(e[r].options.event==t)return e[r];return null},add:function(t){if(m(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(m(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,r=M(e,t);-1!==r&&(e.splice(r,1),this.touchAction.update())}return this},on:function(t,e){if(t!==s&&e!==s){var r=this.handlers;return g(I(t),(function(t){r[t]=r[t]||[],r[t].push(e)})),this}},off:function(t,e){if(t!==s){var r=this.handlers;return g(I(t),(function(t){e?r[t]&&r[t].splice(M(r[t],e),1):delete r[t]})),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var r=o.createEvent("Event");r.initEvent(t,!0,!0),r.gesture=e,e.target.dispatchEvent(r)}(t,e);var r=this.handlers[t]&&this.handlers[t].slice();if(r&&r.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](e),i++}},destroy:function(){this.element&&Ut(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},l(jt,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Pt,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:N,DIRECTION_ALL:30,Manager:Nt,Input:q,TouchAction:St,TouchInput:ht,MouseInput:tt,PointerEventInput:ot,TouchMouseInput:dt,SingleTouchInput:st,Recognizer:It,AttrRecognizer:Lt,Tap:Ft,Pan:zt,Swipe:Bt,Pinch:Rt,Rotate:Dt,Press:Ot,on:E,off:T,each:g,merge:_,extend:v,assign:l,inherit:b,bindFn:x,prefixed:L}),("undefined"!=typeof n?n:"undefined"!=typeof self?self:{}).Hammer=jt,(i=function(){return jt}.call(e,r,e,t))===s||(t.exports=i)}(window,document)},55490:(t,e,r)=>{"use strict";r.d(e,{qk:()=>o,ws:()=>n});var i=r(44504);function n(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function o(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(i.$W.debug&&!function(t,e){if(t.length!==e)return!1;for(let e=0;e<t.length;++e)if(!Number.isFinite(t[e]))return!1;return!0}(t,e))throw new Error("math.gl: ".concat(r," some fields set to invali
21d numbers'"));return t}},56706:(t,e,r)=>{"use strict";r.d(e,{Dz:()=>h,tj:()=>c,XZ:()=>lt,w8:()=>rt,o0:()=>et,bQ:()=>Q,NG:()=>u,uZ:()=>ut,uF:()=>s,C6:()=>l,Rm:()=>i,AB:()=>$,ZA:()=>ct,Rz:()=>J,zv:()=>tt});const i=new(r(7114).A)({id:"luma.gl"});function n(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}const o="Invalid WebGLRenderingContext",a="Requires WebGL2";function s(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||("undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version)))}function l(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function u(t){return l(t)?t:null}function c(t){return n(s(t),o),t}function h(t){return n(l(t),a),t}const p={};function d(t,e){p[t]=!0,void 0!==e&&function(t){globalThis.console&&globalThis.console.error&&globalThis.console.error(t)}(e)}const f=function t(e){const r=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let e=0;e<this.attribs.length;e++){const i=new t.VertexAttrib(r);this.attribs[e]=i}this.maxAttrib=0};(f.VertexAttrib=function(t){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()}).prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};const m=function(t){const e=this;this.gl=t,function(t){const e=t.getError;t.getError=function(){let r;do{r=e.apply(t),0!==r&&(p[r]=!0)}while(0!==r);for(r in p)if(p[r])return delete p[r],parseInt(r,10);return 0}}(t);const r=this.original={getParameter:t.getParameter,enableVertexAttribArray:t.enableVertexAttribArray,disableVertexAttribArray:t.disableVertexAttribArray,bindBuffer:t.bindBuffer,getVertexAttrib:t.getVertexAttrib,vertexAttribPointer:t.vertexAttribPointer};t.getParameter=function(t){return t===e.VERTEX_ARRAY_BINDING_OES?e.currentVertexArrayObject===e.defaultVertexArrayObject?null:e.currentVertexArrayObject:r.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(t){const i=e.currentVertexArrayObject;i.maxAttrib=Math.max(i.maxAttrib,t);return i.attribs[t].enabled=!0,r.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(t){const i=e.currentVertexArrayObject;i.maxAttrib=Math.max(i.maxAttrib,t);return i.attribs[t].enabled=!1,r.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(t,i){switch(t){case 34962:e.currentArrayBuffer=i;break;case 34963:e.currentVertexArrayObject.elementArrayBuffer=i}return r.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(t,i){const n=e.currentVertexArrayObject.attribs[t];switch(i){case 34975:return n.buffer;case 34338:return n.enabled;case 34339:return n.size;case 34340:return n.stride;case 34341:return n.type;case 34922:return n.normalized;default:return r.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(t,i,n,o,a,s){const l=e.currentVertexArrayObject;l.maxAttrib=Math.max(l.maxAttrib,t);const u=l.attribs[t];return u.buffer=e.currentArrayBuffer,u.size=i,u.type=n,u.normalized=o,u.stride=a,u.offset=s,u.recache(),r.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",(()=>{!function(t){globalThis.console&&globalThis.console.log&&globalThis.console.log(t)}("OESVertexArrayObject emulation library context restored"),e.reset_()}),!0),this.reset_()};m.prototype.VERTEX_ARRAY_BINDING_OES=34229,m.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let t=0;t<this.vertexArrayObjects.length;++t)this.vertexArrayObjects.isAlive=!1;const t=this.gl;this.maxVertexAttribs=t.getParameter(34921),this.defaultVertexArrayObject=new f(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},m.prototype.createVertexArrayOES=function(){const t=new f(this);return this.vertexArrayObjects.push(t),t},m.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)},m.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof f&&t.hasBeenBound&&t.ext===this)},m.prototype.bindVertexArrayOES=function(t){const e=this.gl;if(t&&!t.isAlive)return void d(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject");const r=this.original,i=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;const n=this.currentVertexArrayObject;if(i===n)return;i&&n.elementArrayBuffer===i.elementArrayBuffer||r.bindBuffer.call(e,34963,n.elementArrayBuffer);let o=this.currentArrayBuffer;const a=Math.max(i?i.maxAttrib:0,n.maxAttrib);for(let t=0;t<=a;t++){const a=n.attribs[t],s=i?i.attribs[t]:null;if(i&&a.enabled===s.enabled||(a.enabled?r.enableVertexAttribArray.call(e,t):r.disableVertexAttribArray.call(e,t)),a.enabled){let n=!1;i&&a.buffer===s.buffer||(o!==a.buffer&&(r.bindBuffer.call(e,34962,a.buffer),o=a.buffer),n=!0),(n||a.cached!==s.cached)&&r.vertexAttribPointer.call(e,t,a.size,a.type,a.normalized,a.stride,a.offset)}}
21this.currentArrayBuffer!==o&&r.bindBuffer.call(e,34962,this.currentArrayBuffer)};const g="OES_element_index",y="WEBGL_draw_buffers",v="WEBGL_debug_renderer_info",_=35723,b=36795,x=34047,w=37445,A=37446,E=t=>l(t)?void 0:0,T={3074:t=>l(t)?void 0:36064,[_]:t=>l(t)?void 0:4352,35977:E,32937:E,[b]:(t,e)=>{const r=l(t)?t.getExtension("EXT_disjoint_timer_query_webgl2"):t.getExtension("EXT_disjoint_timer_query");return r&&r.GPU_DISJOINT_EXT?e(r.GPU_DISJOINT_EXT):0},[w]:(t,e)=>{const r=t.getExtension(v);return e(r&&r.UNMASKED_VENDOR_WEBGL||7936)},[A]:(t,e)=>{const r=t.getExtension(v);return e(r&&r.UNMASKED_RENDERER_WEBGL||7937)},[x]:(t,e)=>{const r=t.luma.extensions.EXT_texture_filter_anisotropic;return r?e(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:E,35071:E,37447:E,36063:(t,e)=>{if(!l(t)){const r=t.getExtension(y);return r?e(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:E,35374:E,35377:E,34852:t=>{if(!l(t)){const e=t.getExtension(y);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:t=>t.getExtension(g)?2147483647:65535,33001:t=>t.getExtension(g)?16777216:65535,33e3:t=>16777216,37157:E,35373:E,35657:E,36183:E,37137:E,34045:E,35978:E,35979:E,35968:E,35376:E,35375:E,35659:E,37154:E,35371:E,35658:E,35076:E,35077:E,35380:E};const S="OES_vertex_array_object",P="ANGLE_instanced_arrays",I="WEBGL_draw_buffers",M="EXT_disjoint_timer_query";const C={[S]:{meta:{suffix:"OES"},createVertexArray:()=>{n(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[P]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(t,e){n(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},[I]:{meta:{suffix:"WEBGL"},drawBuffers:()=>{n(!1)}},[M]:{meta:{suffix:"EXT"},createQuery:()=>{n(!1)},deleteQuery:()=>{n(!1)},beginQuery:()=>{n(!1)},endQuery:()=>{},getQuery(t,e){return this.getQueryObject(t,e)},getQueryParameter(t,e){return this.getQueryObject(t,e)},getQueryObject:()=>{}}},k={readBuffer:(t,e,r)=>{l(t)&&e(r)},getVertexAttrib:(t,e,r,i)=>{const{webgl2:n,ext:o}=function(t,e){return{webgl2:l(t),ext:t.getExtension(e)}}(t,P);let a;switch(i){case 35069:a=!!n&&void 0;break;case 35070:a=n||o?void 0:0}return void 0!==a?a:e(r,i)},getProgramParameter:(t,e,r,i)=>{if(!l(t))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(r,i)},getInternalformatParameter:(t,e,r,i,n)=>l(t)||32937!==n?t.getInternalformatParameter(r,i,n):new Int32Array([0]),getTexParameter(t,e,r,i){if(34046===i){const{extensions:e}=t.luma,r=e.EXT_texture_filter_anisotropic;i=r&&r.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(r,i)},getParameter:function(t,e,r){const i=T[r],n="function"==typeof i?i(t,e,r):i;return void 0!==n?n:e(r)},hint:(t,e,r,i)=>e(r,i)};function L(t,e){let{extension:r,target:i,target2:o}=e;const a=C[r];n(a);const{meta:s={}}=a,{suffix:l=""}=s,u=t.getExtension(r);for(const e of Object.keys(a)){const r="".concat(e).concat(l);let n=null;"meta"===e||"function"==typeof t[e]||(u&&"function"==typeof u[r]?n=function(){return u[r](...arguments)}:"function"==typeof a[e]&&(n=a[e].bind(i))),n&&(i[e]=n,o[e]=n)}}globalThis.polyfillContext=function(t){t.luma=t.luma||{};const{luma:e}=t;return e.polyfilled||(!function(t){if("function"==typeof t.createVertexArray)return;const e=t.getSupportedExtensions;t.getSupportedExtensions=function(){const t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};const r=t.getExtension;t.getExtension=function(e){return r.call(this,e)||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new m(this)),this.__OESVertexArrayObject))}}(t),function(t){t.luma.extensions={};const e=t.getSupportedExtensions()||[];for(const r of e)t.luma[r]=t.getExtension(r)}(t),function(t,e){for(const r of Object.getOwnPropertyNames(e))"overrides"!==r&&L(t,{extension:r,target:t.luma,target2:t})}(t,C),function(t,e){let{target:r,target2:i}=e;Object.keys(k).forEach((e=>{if("function"==typeof k[e]){const n=t[e]?t[e].bind(t):()=>{},o=k[e].bind(null,t,n);r[e]=o,i[e]=o}}))}(t,{target:e,target2:t}),e.polyfilled=!0),t};const z={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},R=(t,e,r)=>e?t.enable(r):t.disable(r),O=(t,e,r)=>t.hint(r,e),D=(t,e,r)=>t.pixelStorei(r,e);function B(t){return Array.isArray(t)||ArrayBuffer.isView(t)}const F={3042:R,32773:(t,e)=>
vendor: 4,529 bytes, line 21
21t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:R,2885:(t,e)=>t.cullFace(e),2929:R,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:R,35723:O,36006:(t,e)=>{const r=l(t)?36009:36160;return t.bindFramebuffer(r,e)},2886:(t,e)=>t.frontFace(e),33170:O,2849:(t,e)=>t.lineWidth(e),32823:R,32824:"polygonOffset",10752:"polygonOffset",35977:R,32938:"sampleCoverage",32939:"sampleCoverage",3089:R,3088:(t,e)=>t.scissor(...e),2960:R,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),3333:D,3317:D,37440:D,37441:D,37443:D,3330:D,3332:D,3331:D,36010:(t,e)=>t.bindFramebuffer(36008,e),3314:D,32878:D,3316:D,3315:D,32877:D,framebuffer:(t,e)=>{const r=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,r)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{e=B(e)?e:[e,e],t.blendEquationSeparate(...e)},blendFunc:(t,e)=>{e=B(e)&&2===e.length?[...e,...e]:e,t.blendFuncSeparate(...e)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=B(e)?e:[e,e];const[r,i]=e;t.stencilMaskSeparate(1028,r),t.stencilMaskSeparate(1029,i)},stencilFunc:(t,e)=>{e=B(e)&&3===e.length?[...e,...e]:e;const[r,i,n,o,a,s]=e;t.stencilFuncSeparate(1028,r,i,n),t.stencilFuncSeparate(1029,o,a,s)},stencilOp:(t,e)=>{e=B(e)&&3===e.length?[...e,...e]:e;const[r,i,n,o,a,s]=e;t.stencilOpSeparate(1028,r,i,n),t.stencilOpSeparate(1029,o,a,s)},viewport:(t,e)=>t.viewport(...e)};function j(t,e,r){return void 0!==e[t]?e[t]:r[t]}const N={blendEquation:(t,e,r)=>t.blendEquationSeparate(j(32777,e,r),j(34877,e,r)),blendFunc:(t,e,r)=>t.blendFuncSeparate(j(32969,e,r),j(32968,e,r),j(32971,e,r),j(32970,e,r)),polygonOffset:(t,e,r)=>t.polygonOffset(j(32824,e,r),j(10752,e,r)),sampleCoverage:(t,e,r)=>t.sampleCoverage(j(32938,e,r),j(32939,e,r)),stencilFuncFront:(t,e,r)=>t.stencilFuncSeparate(1028,j(2962,e,r),j(2967,e,r),j(2963,e,r)),stencilFuncBack:(t,e,r)=>t.stencilFuncSeparate(1029,j(34816,e,r),j(36003,e,r),j(36004,e,r)),stencilOpFront:(t,e,r)=>t.stencilOpSeparate(1028,j(2964,e,r),j(2965,e,r),j(2966,e,r)),stencilOpBack:(t,e,r)=>t.stencilOpSeparate(1029,j(34817,e,r),j(34818,e,r),j(34819,e,r))},U={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,r)=>t({[e]:r}),hint:(t,e,r)=>t({[e]:r}),bindFramebuffer:(t,e,r)=>{switch(e){case 36160:return t({36006:r,36010:r});case 36009:return t({36006:r});case 36008:return t({36010:r});default:return null}},blendColor:(t,e,r,i,n)=>t({32773:new Float32Array([e,r,i,n])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,r)=>t({32777:e,34877:r}),blendFunc:(t,e,r)=>t({32969:e,32968:r,32971:e,32970:r}),blendFuncSeparate:(t,e,r,i,n)=>t({32969:e,32968:r,32971:i,32970:n}),clearColor:(t,e,r,i,n)=>t({3106:new Float32Array([e,r,i,n])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,r,i,n)=>t({3107:[e,r,i,n]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,r)=>t({2928:new Float32Array([e,r])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,r)=>t({32824:e,10752:r}),sampleCoverage:(t,e,r)=>t({32938:e,32939:r}),scissor:(t,e,r,i,n)=>
21t({3088:new Int32Array([e,r,i,n])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,r)=>t({[1028===e?2968:36005]:r}),stencilFunc:(t,e,r,i)=>t({2962:e,2967:r,2963:i,34816:e,36003:r,36004:i}),stencilFuncSeparate:(t,e,r,i,n)=>t({[1028===e?2962:34816]:r,[1028===e?2967:36003]:i,[1028===e?2963:36004]:n}),stencilOp:(t,e,r,i)=>t({2964:e,2965:r,2966:i,34817:e,34818:r,34819:i}),stencilOpSeparate:(t,e,r,i,n)=>t({[1028===e?2964:34817]:r,[1028===e?2965:34818]:i,[1028===e?2966:34819]:n}),viewport:(t,e,r,i,n)=>t({2978:[e,r,i,n]})},V=(t,e)=>t.isEnabled(e),q={3042:V,2884:V,2929:V,3024:V,32823:V,32926:V,32928:V,3089:V,2960:V,35977:V};function G(t){for(const e in t)return!1;return!0}function Z(t,e){if(t===e)return!0;const r=Array.isArray(t)||ArrayBuffer.isView(t),i=Array.isArray(e)||ArrayBuffer.isView(e);if(r&&i&&t.length===e.length){for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}return!1}function W(t,e){const r=t[e].bind(t);t[e]=function(){const e=arguments.length<=0?void 0:arguments[0];return e in t.state.cache&&t.state.enable?t.state.cache[e]:r(...arguments)},Object.defineProperty(t[e],"name",{value:"".concat(e,"-from-cache"),configurable:!1})}function H(t,e,r){const i=t[e].bind(t);t[e]=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];const{valueChanged:a,oldValue:s}=r(t.state._updateCache,...n);return a&&i(...n),s},Object.defineProperty(t[e],"name",{value:"".concat(e,"-to-cache"),configurable:!1})}class X{constructor(t){let{copyState:e=!1,log:r=()=>{}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=e?Q(t):Object.assign({},z),this.log=r,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(){this.stateStack.push({})}pop(){n(this.stateStack.length>0);const t=this.stateStack[this.stateStack.length-1];J(this.gl,t),this.stateStack.pop()}_updateCache(t){let e,r=!1;const i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const o in t){n(void 0!==o);const a=t[o],s=this.cache[o];Z(a,s)||(r=!0,e=s,i&&!(o in i)&&(i[o]=s),this.cache[o]=a)}return{valueChanged:r,oldValue:e}}}function Y(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{enable:r=!0,copyState:i}=e;if(n(void 0!==i),!t.state){const{polyfillContext:e}=globalThis;e&&e(t),t.state=new X(t,{copyState:i}),function(t){const e=t.useProgram.bind(t);t.useProgram=function(r){t.state.program!==r&&(e(r),t.state.program=r)}}(t);for(const e in U){H(t,e,U[e])}W(t,"getParameter"),W(t,"isEnabled")}return t.state.enable=r,t}function K(t){n(t.state),t.state.pop()}function J(t,e){if(n(s(t),"setParameters requires a WebGL context"),G(e))return;const r={};for(const i in e){const n=Number(i),o=F[i];o&&("string"==typeof o?r[o]=!0:o(t,e[i],n))}const i=t.state&&t.state.cache;if(i)for(const n in r){(0,N[n])(t,e,i)}}function Q(t,e){if("number"==typeof(e=e||z)){const r=e,i=q[r];return i?i(t,r):t.getParameter(r)}const r=Array.isArray(e)?e:Object.keys(e),i={};for(const e of r){const r=q[e];i[e]=r?r(t,Number(e)):t.getParameter(Number(e))}return i}function $(t){J(t,z)}function tt(t,e,r){if(G(e))return r(t);const{nocatch:i=!0}=e;let n;if(function(t){t.state||Y(t,{copyState:!1}),t.state.push()}(t),J(t,e),i)n=r(t),K(t);else try{n=r(t)}finally{K(t)}return n}function et(t){const{luma:e}=t;if(t.canvas&&e){const{clientWidth:r}=e.canvasSizeInfo;return r?t.drawingBufferWidth/r:1}return 1}function rt(t,e){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(t,e,r,i,n){const o=it(t[0],e,r);let a=nt(t[1],e,i,n),s=it(t[0]+1,e,r);const l=s===r-1?s:s-1;let u;s=nt(t[1]+1,e,i,n),n?(s=0===s?s:s+1,u=a,a=s):u=s===i-1?s:s-1;return{x:o,y:a,width:Math.max(l-o+1,1),height:Math.max(u-a+1,1)}}(e,et(t),t.drawingBufferWidth,t.drawingBufferHeight,r)}function it(t,e,r){return Math.min(Math.round(t*e),r-1)}function nt(t,e,r,i){return i?Math.max(0,r-1-Math.round(t*e)):Math.min(Math.round(t*e),r-1)}const ot=(0,r(29275).A)(),at=ot&&"undefined"!=typeof document,st={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function lt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(ot,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),t=Object.assign({},st,t);const{width:e,height:r}=t;function o(e){if(t.throwOnError)throw new Error(e);return console.error(e),null}let a;t.onError=o;const{canvas:s}=t,u=function(t){let e,{canvas:r,width:i=800,height:n=600,onError:o}=t;if("string"==typeof r){at&&"complete"===document.readyState||o("createGLContext c
21alled on canvas '".concat(r,"' before page was loaded")),e=document.getElementById(r)}else r?e=r:(e=document.createElement("canvas"),e.id="lumagl-canvas",e.style.width=Number.isFinite(i)?"".concat(i,"px"):"100%",e.style.height=Number.isFinite(n)?"".concat(n,"px"):"100%",document.body.insertBefore(e,document.body.firstChild));return e}({canvas:s,width:e,height:r,onError:o});return a=function(t,e){const{onError:r}=e;let i=null;const n=t=>i=t.statusMessage||i;t.addEventListener("webglcontextcreationerror",n,!1);const{webgl1:o=!0,webgl2:a=!0}=e;let s=null;a&&(s=s||t.getContext("webgl2",e),s=s||t.getContext("experimental-webgl2",e));o&&(s=s||t.getContext("webgl",e),s=s||t.getContext("experimental-webgl",e));if(t.removeEventListener("webglcontextcreationerror",n,!1),!s)return r("Failed to create ".concat(a&&!o?"WebGL2":"WebGL"," context: ").concat(i||"Unknown error"));e.onContextLost&&t.addEventListener("webglcontextlost",e.onContextLost,!1);e.onContextRestored&&t.addEventListener("webglcontextrestored",e.onContextRestored,!1);return s}(u,t),a?(a=ut(a,t),function(t){const e=l(t)?"WebGL2":"WebGL1",r=function(t){const e=t.getParameter(7936),r=t.getParameter(7937),i=t.getExtension("WEBGL_debug_renderer_info"),n=i&&t.getParameter(i.UNMASKED_VENDOR_WEBGL||7936),o=i&&t.getParameter(i.UNMASKED_RENDERER_WEBGL||7937);return{vendor:n||e,renderer:o||r,vendorMasked:e,rendererMasked:r,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t),n=r?"(".concat(r.vendor,",").concat(r.renderer,")"):"",o=t.debug?" debug":"";i.info(1,"".concat(e).concat(o," context ").concat(n))()}(a),a):null}function ut(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||t._instrumented)return t;t._version=t._version||function(t){if("undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext)return 2;return 1}(t),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{},e=Object.assign({},st,e);const{manageState:r,debug:n}=e;return r&&Y(t,{copyState:!1,log:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return i.log(1,...e)()}}),ot&&n&&(globalThis.makeDebugContext?(t=globalThis.makeDebugContext(t,e),i.level=Math.max(i.level,1)):i.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),t._instrumented=!0,t}function ct(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.canvas){return void function(t,e,r){let n="width"in r?r.width:t.canvas.clientWidth,o="height"in r?r.height:t.canvas.clientHeight;n&&o||(i.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,n=t.canvas.width||1,o=t.canvas.height||1);t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{};const a=t.luma.canvasSizeInfo;if(a.clientWidth!==n||a.clientHeight!==o||a.devicePixelRatio!==e){let r=e;const a=Math.floor(n*r),s=Math.floor(o*r);t.canvas.width=a,t.canvas.height=s,t.drawingBufferWidth===a&&t.drawingBufferHeight===s||(i.warn("Device pixel ratio clamped")(),r=Math.min(t.drawingBufferWidth/n,t.drawingBufferHeight/o),t.canvas.width=Math.floor(n*r),t.canvas.height=Math.floor(o*r)),Object.assign(t.luma.canvasSizeInfo,{clientWidth:n,clientHeight:o,devicePixelRatio:e})}}(t,function(t){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(t)?t<=0?1:t:t?e:1}(e.useDevicePixels),e)}const r=t.getExtension("STACKGL_resize_drawingbuffer");r&&"width"in e&&"height"in e&&r.resize(e.width,e.height)}},57971:(t,e,r)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}r.d(e,{v:()=>i})},57974:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});var i=r(67811);class n{constructor(t){(0,i.A)(this,"_inProgress",void 0),(0,i.A)(this,"_handle",void 0),(0,i.A)(this,"_timeline",void 0),(0,i.A)(this,"time",void 0),(0,i.A)(this,"settings",void 0),this._inProgress=!1,this._handle=null,this._timeline=t,this.time=0,this.settings={duration:0}}get inProgress(){return this._inProgress}start(t){var e,r;this.cancel(),this.settings=t,this._inProgress=!0,null===(e=(r=this.settings).onStart)||void 0===e||e.call(r,this)}end(){var t,e;this._inProgress&&(this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,null===(t=(e=this.settings).onEnd)||void 0===t||t.call(e,this))}cancel(){var t,e;this._inProgress&&(null===(t=(e=this.settings).onInterrupt)||void 0===t||t.call(e,this),this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){var t,e;if(!this._inProgress)return!1;if(null===this._handle){const{_timeline:t,settings:e}=this;this._handle=t.addChannel({delay:t.getTime(),duration:e.duration})}return this.time=this._timeline.getTime(this._handle),this._onUpdate(),null===(t=(e=this.settings).onUpdate)||void 0===t||t.call(e,this),this._timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}},58713:(t,e,r)=>{"use strict";r.d(e,{Cj:()=>l,sy:()=>s});var i=r(94755),n=(r(56706),r(52697)),o=r(57971);var a=r(39699);function s(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{sourceX:r=0,sourceY:i=0,sourceFormat:a=6408}=e;
21let{sourceAttachment:s=36064,target:l=null,sourceWidth:c,sourceHeight:h,sourceType:p}=e;const{framebuffer:d,deleteFramebuffer:f}=u(t);(0,o.v)(d);const{gl:m,handle:g,attachments:y}=d;c=c||d.width,h=h||d.height,36064===s&&null===g&&(s=1028),(0,o.v)(y[s]),p=p||y[s].type,l=function(t,e,r,i,a){if(t)return t;e=e||5121;const s=(0,n.Xj)(e,{clamped:!1}),l=function(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return(0,o.v)(!1),0}}(r);return new s(i*a*l)}(l,p,a,c,h),p=p||(0,n.jX)(l);const v=m.bindFramebuffer(36160,g);return m.readPixels(r,i,c,h,a,p,l),m.bindFramebuffer(36160,v||null),f&&d.delete(),l}function l(t){let{sourceAttachment:e=36064,targetMaxHeight:r=Number.MAX_SAFE_INTEGER}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=s(t,{sourceAttachment:e}),{width:o,height:a}=t;for(;a>r;)({data:i,width:o,height:a}=(0,n.Ij)({data:i,width:o,height:a}));(0,n.H)({data:i,width:o,height:a});const l=document.createElement("canvas");l.width=o,l.height=a;const u=l.getContext("2d"),c=u.createImageData(o,a);return c.data.set(i),u.putImageData(c,0,0),l.toDataURL()}function u(t){return t instanceof i.A?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:(0,a.$)(t),deleteFramebuffer:!0}}},59579:(t,e,r)=>{"use strict";r.d(e,{A:()=>d});const i={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null},n="#define SMOOTH_EDGE_RADIUS 0.5",o={name:"geometry",vs:"\n".concat(n,"\n\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n}
21 geometry = VertexGeometry(\n vec4(0.0, 0.0, 1.0, 0.0),\n vec3(0.0),\n vec3(0.0),\n vec3(0.0),\n vec2(0.0),\n vec3(0.0)\n);\n"),fs:"\n".concat(n,"\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n")};var a=r(61028);const s=Object.keys(a.rf).map((t=>"const int COORDINATE_SYSTEM_".concat(t," = ").concat(a.rf[t],";"))).join(""),l=Object.keys(a.Kx).map((t=>"const int PROJECTION_MODE_".concat(t," = ").concat(a.Kx[t],";"))).join(""),u=Object.keys(a.p5).map((t=>"const int UNIT_".concat(t.toUpperCase()," = ").concat(a.p5[t],";"))).join(""),c="".concat(s,"\n").concat(l,"\n").concat(u,'\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\nuniform bool project_uPseudoMeters;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0; // meters\nconst float GLOBE_RADIUS = 256.0;\n\n// returns an adjustment factor for uCommonUnitsPerMeter\nfloat project_size() {\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR &&\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT &&\n project_uPseudoMeters == false) {\n\n // uCommonUnitsPerMeter in low-zoom Web Mercator is non-linear\n // Adjust by 1 / cos(latitude)\n // If geometry.position (vertex in common space) is populated, use it\n // Otherwise use geometry.worldPosition (anchor in world space)\n \n if (geometry.position.w == 0.0) {\n float y = clamp(geometry.worldPosition.y, -89.9, 89.9);\n return 1.0 / cos(radians(y));\n }\n\n // latitude from common y: 2.0 * (atan(exp(y / TILE_SIZE * 2.0 * PI - PI)) - PI / 4.0)\n // Taylor series of 1 / cos(latitude)\n // Max error < 0.003\n \n float y = geometry.position.y / TILE_SIZE * 2.0 - 1.0;\n float y2 = y * y;\n float y4 = y2 * y2;\n float y6 = y4 * y2;\n return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;\n }\n return 1.0;\n}\n//\n// Scaling offsets - scales meters to "world distance"\n// Note the scalar version of project_size is for scaling the z component only\n//\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z * project_size();\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy * project_size();\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter * project_size();\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\n\n// Get rotation matrix that aligns the z axis with the given up vector\n// Find 3 unit vectors ux, uy, uz that are perpendicular to each other and uz == up\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n // Tangent on XY plane\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n\n//\n// Projecting normal - transform deltas from current coordinate system to\n// normals in the worldspace\n//\nvec3 project_normal(vec3 vector) {\n // Apply model matrix\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n vec3 n = normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n mat3 rotation;\n if (project_needs_rotation(geometry.position.xyz, rotation)) {\n n = rotation * n;\n }\n return n;\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\n\n//\n// Projecting positions - non-linear projection: lnglats => unit tile [0-1, 0-1]\n//\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;
21\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\n\n//\n// Projects positions (defined by project_uCoordinateSystem) to common space (defined by project_uProjectionMode)\n//\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n\n // Work around for a Mac+NVIDIA bug https://github.com/visgl/deck.gl/issues/4145\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n // Too far from the projection center for offset mode to be accurate\n // Only use high parts\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n // Subtract high part of 64 bit value. Convert remainder to float32, preserving precision.\n position_world.xyz -= project_uCoordinateOrigin;\n }\n\n // Translation is already added to the high parts\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\n\n//\n// Projects from common space coordinates to clip space.\n// Uses project_uViewProjectionMatrix\n//\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\n\n// Returns a clip space offset that corresponds to a given number of screen pixels\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_size_to_pixel(float size, int unit) {\n if (unit == UNIT_METERS) return project_size_to_pixel(size);\n if (unit == UNIT_COMMON) return size * project_uScale;\n // UNIT_PIXELS\n return size;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}
21\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\n');var h=r(46127);const p={};const d={name:"project",dependencies:[i,o],vs:c,getUniforms:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;return"viewport"in t?(0,h.a)(t):{}}}},59885:(t,e,r)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}r.d(e,{A:()=>i})},60640:(t,e,r)=>{"use strict";Object.defineProperty(e,"uA",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"Dy",{enumerable:!0,get:function(){return n.default}});var i=s(r(74734)),n=s(r(40100)),o=s(r(52601)),a=s(r(11876));function s(t){return t&&t.__esModule?t:{default:t}}},61028:(t,e,r)=>{"use strict";r.d(e,{Kx:()=>o,p5:()=>a,qR:()=>l,qY:()=>s,rf:()=>n});var i=r(62022);const n={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(n,"IDENTITY",{get:()=>(i.A.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});const o={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},a={common:0,meters:1,pixels:2},s={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},l={DRAW:"draw",MASK:"mask"}},62022:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});const i=new(r(7114).A)({id:"deck"})},62031:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var i=r(47298),n=r(55490);function o(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}class a extends i.A{get x(){return this[0]}set x(t){this[0]=(0,n.ws)(t)}get y(){return this[1]}set y(t){this[1]=(0,n.ws)(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let r=0;r<this.ELEMENTS;++r){const i=this[r]-t[r];e+=i*i}return(0,n.ws)(e)}dot(t){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*t[r];return(0,n.ws)(e)}normalize(){const t=this.magnitude();if(0!==t)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t[e];return this.check()}divide(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t[e];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return o(t>=0&&t<this.ELEMENTS,"index is out of range"),(0,n.ws)(this[t])}setComponent(t,e){return o(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}},62547:(t,e,r)=>{t.exports=r.p+"e4a7b2c8dd88e368.js"},66318:(t,e,r)=>{"use strict";r.d(e,{Bd:()=>i});"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof r.g&&r.g,"undefined"!=typeof document&&document;const i=Boolean("object"!=typeof process||"[object process]"!==String(process)||process.browser),n="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);n&&parseFloat(n[1])},70260:(t,e,r)=>{"use strict";r.d(e,{A:()=>B});var i=r(88376),n=r(59885);const o={number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},array:{validate:(t,e)=>Array.isArray(t)||ArrayBuffer.isView(t)}};function a(t){let e=s(t);return"object"===e?t?"type"in t?Object.assign({},t,o[t.type]):"value"in t?(e=s(t.value),Object.assign({type:e},t,o[e])):{type:"object",value:t}:{type:"object",value:null}:Object.assign({type:e,value:t},o[e])}function s(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}class l{constructor(t){let{name:e,vs:r,fs:i,dependencies:o=[],uniforms:s,getUniforms:l,deprecations:u=[],defines:c={},inject:h={},vertexShader:p,fragmentShader:d}=t;(0,n.A)("string"==typeof e),this.name=e,this.vs=r||p,this.fs=i||d,this.getModuleUniforms=l,this.dependencies=o,this.deprecations=this._parseDeprecationDefinitions(u),this.defines=c,this.injections=function(t){const e={vs:{},fs:{}};for(const r in t){let i=t[r];"string"==typeof i&&(i={order:0,injection:i}),e[r.slice(0,2)][r]=i}return e}(h),s&&(this.uniforms=function(t){const e={};for(const r in t){const i=a(t[r]);e[r]=i}return e}(s))}getModuleSource(t){let e;switch(t){case"vs":e=this.vs||"";break;case"fs":e=this.fs||"";break;default:(0,n.A)(!1)}return"#define MODULE_".concat(this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_"),"\n").concat(e,"// END MODULE_").concat(this.name,"\n\n")}getUniforms(t,e){return this.getModuleUniforms?this.getModuleUniforms(t,e):this.uniforms?this._defaultGetUniforms(t):{}}getDefines(){return this.defines}checkDeprecations(t,e){this.deprecations.forEach((r=>{r.regex.test(t)&&(r.deprecated?e.deprecated(r.old,r.new)():e.removed(r.old,r.new)())}))}_parseDeprecationDefinitions(t){return t.forEach((t=>{if("function"===t.type)t.regex=new RegExp("\\b".concat(t.old,"\\("));else t.regex=new RegExp("".concat(t.type," ").concat(t.old,";"))})),t}_defaultGetUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={},r=this.uniforms;for(const i in r){const o=r[i];i in t&&!o.private?(o.validate&&(0,n.A)(o.validate(t[i],o),"".concat(this.name,": invalid ").concat(i)),e[i]=t[i]):e[i]=o.value}return e}}function u(t){return c(p(t))}function c(t){const e={},r={};return h({modules:t,level:0,moduleMap:e,moduleDepth:r}
21),Object.keys(r).sort(((t,e)=>r[e]-r[t])).map((t=>e[t]))}function h(t){let{modules:e,level:r,moduleMap:i,moduleDepth:n}=t;if(r>=5)throw new Error("Possible loop in shader dependency graph");for(const t of e)i[t.name]=t,(void 0===n[t.name]||n[t.name]<r)&&(n[t.name]=r);for(const t of e)t.dependencies&&h({modules:t.dependencies,level:r+1,moduleMap:i,moduleDepth:n})}function p(t,e){return t.map((t=>(t instanceof l||((0,n.A)("string"!=typeof t,"Shader module use by name is deprecated. Import shader module '".concat(t,"' and use it directly.")),(0,n.A)(t.name,"shader module has no name"),(t=new l(t)).dependencies=p(t.dependencies)),t)))}const d={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},f={};Object.keys(d).forEach((t=>{f[t]=t}));const m={};function g(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=d[e];if((0,n.A)(i,e),!function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e="undefined"!=typeof window&&window.navigator||{},r=t.userAgent||e.userAgent||"",i=-1!==r.indexOf("MSIE "),n=-1!==r.indexOf("Trident/");return i||n}(r))return!0;if(e in m)return m[e];const o=i[0],a=r.behavior||"enable",s="#extension GL_".concat(o," : ").concat(a,"\nvoid main(void) {}"),l=t.createShader(35633);t.shaderSource(l,s),t.compileShader(l);const u=t.getShaderParameter(l,35713);return t.deleteShader(l),m[e]=u,u}function y(t,e){const r=d[e];(0,n.A)(r,e);const i=function(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}(t)&&r[1]||r[0],o="string"==typeof i?Boolean(t.getExtension(i)):i;return(0,n.A)(!1===o||!0===o),o}function v(t,e){return(e=Array.isArray(e)?e:[e]).every((e=>y(t,e)))}var _=r(15518);function b(t){return new RegExp("\\b".concat(t,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}const x=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],w=[...x,[b("attribute"),"in $1"],[b("varying"),"out $1"]],A=[...x,[b("varying"),"in $1"]],E=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],T=[...E,[b("in"),"attribute $1"],[b("out"),"varying $1"]],S=[...E,[b("in"),"varying $1"]],P="gl_FragColor",I=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,M=/void\s+main\s*\([^)]*\)\s*\{\n?/;function C(t,e,r){switch(e){case 300:return r?k(t,w):function(t){t=k(t,A);const e=t.match(I);if(e){const r=e[1];t=t.replace(new RegExp("\\b".concat(P,"\\b"),"g"),r)}else{const e="fragmentColor";t=t.replace(M,(t=>"out vec4 ".concat(e,";\n").concat(t))).replace(new RegExp("\\b".concat(P,"\\b"),"g"),e)}return t}(t);case 100:return r?k(t,T):function(t){t=k(t,S);const e=t.match(I);if(e){const r=e[1];t=t.replace(I,"").replace(new RegExp("\\b".concat(r,"\\b"),"g"),P)}return t}(t);default:throw new Error("unknown GLSL version ".concat(e))}}function k(t,e){for(const[r,i]of e)t=t.replace(r,i);return t}const L="\n\n".concat(_.O_,"\n\n"),z={[i.T]:"vertex",[i.B]:"fragment"};function R(t,e){let{id:r,source:o,type:a,modules:s,defines:l={},hookFunctions:u=[],inject:c={},transpileToGLSL100:h=!1,prologue:p=!0,log:d}=e;(0,n.A)("string"==typeof o,"shader source must be a string");const m=a===i.T,y=o.split("\n");let b=100,x="",w=o;0===y[0].indexOf("#version ")?(b=300,x=y[0],w=y.slice(1).join("\n")):x="#version ".concat(b);const A={};s.forEach((t=>{Object.assign(A,t.getDefines())})),Object.assign(A,l);let E=p?"".concat(x,"\n").concat(function(t){let{id:e,source:r,type:i}=t;const n=e&&"string"==typeof e&&-1===r.indexOf("SHADER_NAME");return n?"\n#define SHADER_NAME ".concat(e,"_").concat(z[i],"\n\n"):""}({id:r,source:o,type:a}),"\n").concat(function(t){let{type:e}=t;return"\n#define SHADER_TYPE_".concat(z[e].toUpperCase(),"\n")}({type:a}),"\n").concat(function(t){const e=function(t){const e=t.getExtension("WEBGL_debug_renderer_info"),r=t.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=t.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:function(t,e){return t.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":t.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":t.match(/AMD/i)||e.match(/AMD/i)||t.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(r,i),vendor:r,renderer:i,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t);switch(e.gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}(t),"\n").concat(function(t){let e="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return v(t,f.GLSL_FRAG_DEPTH)&&(e+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),v(t,f.G
21LSL_DERIVATIVES)&&g(t,f.GLSL_DERIVATIVES)&&(e+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),v(t,f.GLSL_FRAG_DATA)&&g(t,f.GLSL_FRAG_DATA,{behavior:"require"})&&(e+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),v(t,f.GLSL_TEXTURE_LOD)&&(e+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),e}(t),"\n").concat(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=0,r="";for(const i in t){0===e&&(r+="\n// APPLICATION DEFINES\n"),e++;const n=t[i];(n||Number.isFinite(n))&&(r+="#define ".concat(i.toUpperCase()," ").concat(t[i],"\n"))}0===e&&(r+="\n");return r}(A),"\n").concat(m?"":"precision highp float;\n\n","\n"):"".concat(x,"\n");const T=function(t){const e={vs:{},fs:{}};return t.forEach((t=>{let r;"string"!=typeof t?(r=t,t=r.hook):r={},t=t.trim();const[i,n]=t.split(":"),o=t.replace(/\(.+/,"");e[i][o]=Object.assign(r,{signature:n})})),e}(u),S={},P={},I={};for(const t in c){const e="string"==typeof c[t]?{injection:c[t],order:0}:c[t],r=t.match(/^(v|f)s:(#)?([\w-]+)$/);if(r){const i=r[2],n=r[3];i?"decl"===n?P[t]=[e]:I[t]=[e]:S[t]=[e]}else I[t]=[e]}for(const t of s){d&&t.checkDeprecations(w,d);E+=t.getModuleSource(a,b);const e=t.injections[a];for(const t in e){const r=t.match(/^(v|f)s:#([\w-]+)$/);if(r){const i="decl"===r[2]?P:I;i[t]=i[t]||[],i[t].push(e[t])}else S[t]=S[t]||[],S[t].push(e[t])}}return E+=L,E=(0,_.Ay)(E,a,P),E+=function(t,e){let r="";for(const i in t){const n=t[i];if(r+="void ".concat(n.signature," {\n"),n.header&&(r+=" ".concat(n.header)),e[i]){const t=e[i];t.sort(((t,e)=>t.order-e.order));for(const e of t)r+=" ".concat(e.injection,"\n")}n.footer&&(r+=" ".concat(n.footer)),r+="}\n"}return r}(T[a],S),E+=w,E=(0,_.Ay)(E,a,I),E=C(E,h?100:b,m),E}function O(t){return function(e){const r={};for(const i of t){const t=i.getUniforms(e,r);Object.assign(r,t)}return r}}var D=r(17553);class B{static getDefaultProgramManager(t){return t.luma=t.luma||{},t.luma.defaultProgramManager=t.luma.defaultProgramManager||new B(t),t.luma.defaultProgramManager}constructor(t){this.gl=t,this._programCache={},this._getUniforms={},this._registeredModules={},this._hookFunctions=[],this._defaultModules=[],this._hashes={},this._hashCounter=0,this.stateHash=0,this._useCounts={}}addDefaultModule(t){this._defaultModules.find((e=>e.name===t.name))||this._defaultModules.push(t),this.stateHash++}removeDefaultModule(t){const e="string"==typeof t?t:t.name;this._defaultModules=this._defaultModules.filter((t=>t.name!==e)),this.stateHash++}addShaderHook(t,e){e&&(t=Object.assign(e,{hook:t})),this._hookFunctions.push(t),this.stateHash++}get(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{vs:e="",fs:r="",defines:n={},inject:o={},varyings:a=[],bufferMode:s=35981,transpileToGLSL100:l=!1}=t,c=this._getModuleList(t.modules),h=this._getHash(e),p=this._getHash(r),d=c.map((t=>this._getHash(t.name))).sort(),f=a.map((t=>this._getHash(t))),m=Object.keys(n).sort(),g=Object.keys(o).sort(),y=[],v=[];for(const t of m)y.push(this._getHash(t)),y.push(this._getHash(n[t]));for(const t of g)v.push(this._getHash(t)),v.push(this._getHash(o[t]));const _="".concat(h,"/").concat(p,"D").concat(y.join("/"),"M").concat(d.join("/"),"I").concat(v.join("/"),"V").concat(f.join("/"),"H").concat(this.stateHash,"B").concat(s).concat(l?"T":"");if(!this._programCache[_]){const t=function(t,e){const{vs:r,fs:n}=e,o=u(e.modules||[]);return{gl:t,vs:R(t,Object.assign({},e,{source:r,type:i.T,modules:o})),fs:R(t,Object.assign({},e,{source:n,type:i.B,modules:o})),getUniforms:O(o)}}(this.gl,{vs:e,fs:r,modules:c,inject:o,defines:n,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[_]=new D.A(this.gl,{hash:_,vs:t.vs,fs:t.fs,varyings:a,bufferMode:s}),this._getUniforms[_]=t.getUniforms||(t=>{}),this._useCounts[_]=0}return this._useCounts[_]++,this._programCache[_]}getUniforms(t){return this._getUniforms[t.hash]||null}release(t){const e=t.hash;this._useCounts[e]--,0===this._useCounts[e]&&(this._programCache[e].delete(),delete this._programCache[e],delete this._getUniforms[e],delete this._useCounts[e])}_getHash(t){return void 0===this._hashes[t]&&(this._hashes[t]=this._hashCounter++),this._hashes[t]}_getModuleList(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=new Array(this._defaultModules.length+t.length),r={};let i=0;for(let t=0,n=this._defaultModules.length;t<n;++t){const n=this._defaultModules[t],o=n.name;e[i++]=n,r[o]=!0}for(let n=0,o=t.length;n<o;++n){const o=t[n],a=o.name;r[a]||(e[i++]=o,r[a]=!0)}return e.length=i,e}}},70549:(t,e,r)=>{"use strict";r.d(e,{Z0:()=>o,hs:()=>n});var i=r(21986);function n(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function o(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*o+r[12]*a,t[1]=r[1]*i+r[5]*n+r[9]*o+r[13]*a,t[2]=r[2]*i+r[6]*n+r[10]*o+r[14]*a,t[3]=r[3]*i+r[7]*n+r[11]*o+r[15]*a,t}!function(){var t=function(){var t=new i.tb(4);return i.tb!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}()},71621:(t,e,r)=>{"use strict";r.d(e,{A:()=>a,G:()=>o});var i=r(94755),n=r(96424);const o={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",FLOAT_BLEND:"FLOAT_BLEND",COLOR_ENCODING_SRGB:"COLOR_ENCODING_SRGB",TEXTURE_DEPTH:"TEXTURE_DEPTH",TEXTURE_FLOAT:"TEXTURE_FLOAT",TEXTURE_HALF_FLOAT:"TEXTURE_HALF_FLOAT",TEXTURE_FILTER_LINEAR_FLOAT:"TEXTURE_FILTER_LINEAR_FLOAT",TEXTURE_FILTER_LINEAR_HALF_FLOAT:"TEXTURE_FILTER_LINEAR_HALF_FLOAT",TEXTURE_FILTER_ANISOTROPIC:"TEXTURE_FILTER_ANISOTROPIC",COLOR_ATTACHMENT_RGBA32F:"COLOR_ATTACHMENT_RGBA32F",COLOR_ATTACHMENT_FLOAT:"COLOR_ATTACHMENT_FLOAT",COLOR_ATTACHMENT_HALF_FLOAT:"COLOR_ATTACHMENT_HALF_FLOAT",GLSL_FRAG_DATA:"GLSL_FRAG_DATA",GLSL_FRAG_DEPTH:"GLSL_FRAG_DEPTH",GLSL_DERIVATIVES:"GLSL_DERIVATIVES",GLSL_TEXTURE_LOD:"GLSL_TEXTURE_LOD"};const a={[o.WEBGL2]:[!1,!0],[o.VERTEX_ARRAY_OBJECT]:["OES_vertex_array_object",!0],[o.TIMER_QUERY]:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],[o.INSTANCED_RENDERING]:["ANGLE_instanced_arrays",!0],[o.MULTIPLE_RENDER_TARGETS]:["WEBGL_draw_buffers",!0],[o.ELEMENT_INDEX_UINT32]:["OES_element_index_uint",!0],[o.BLEND_EQUATION_MINMAX]:["EXT_blend_minmax",!0],[o.FLOAT_BLEND]:["EXT_float_blend"],[o.COLOR_ENCODING_SRGB]:["EXT_sRGB",!0],[o.TEXTURE_DEPTH]:["WEBGL_depth_texture",!0],[o.TEXTURE_FLOAT]:["OES_texture_float",!0],[o.TEXTURE_HALF_FLOAT]:["OES_texture_half_float",!0],[o.TEXTURE_FILTER_LINEAR_FLOAT]:["OES_texture_float_linear"],[o.TEXTURE_FILTER_LINEAR_HALF_FLOAT]:["OES_texture_half_float_linear"],[o.TEXTURE_FILTER_ANISOTROPIC]:["EXT_texture_filter_anisotropic"],[o.COLOR_ATTACHMENT_RGBA32F]:[function(t){const e=new n.A(t,{format:6408,type:5126,dataFormat:6408}),r=new i.A(t,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),o=r.getStatus();return e.delete(),r.delete(),36053===o},"EXT_color_buffer_float"],[o.COLOR_ATTACHMENT_FLOAT]:[!1,"EXT_color_buffer_float"],[o.COLOR_ATTACHMENT_HALF_FLOAT]:["EXT_color_buffer_half_float"],[o.GLSL_FRAG_DATA]:["WEBGL_draw_buffers",!0],[o.GLSL_FRAG_DEPTH]:["EXT_frag_depth",!0],[o.GLSL_DERIVATIVES]:["OES_standard_derivatives",!0],[o.GLSL_TEXTURE_LOD]:["EXT_shader_texture_lod",!0]}},72009:(t,e,r)=>{"use strict";r.d(e,{F4:()=>U,bF:()=>q,ir:()=>V});var i=r(57971);const n=5120,o=5121,a=5122,s=5123,l=0,u=1,c=2,h=3,p=4,d=5,f=6,m=5126,g=35664,y=35665,v=35666,_=5124,b=35667,x=35668,w=35669,A=5125,E=36294,T=36295,S=36296,P=35670,I=35671,M=35672,C=35673,k=35674,L=35675,z=35676,R=35685,O=35686,D=35687,B=35688,F=35689,j=35690,N={[m]:[m,1,"float"],[g]:[m,2,"vec2"],[y]:[m,3,"vec3"],[v]:[m,4,"vec4"],[_]:[_,1,"int"],[b]:[_,2,"ivec2"],[x]:[_,3,"ivec3"],[w]:[_,4,"ivec4"],[A]:[A,1,"uint"],[E]:[A,2,"uvec2"],[T]:[A,3,"uvec3"],[S]:[A,4,"uvec4"],[P]:[m,1,"bool"],[I]:[m,2,"bvec2"],[M]:[m,3,"bvec3"],[C]:[m,4,"bvec4"],[k]:[m,8,"mat2"],[R]:[m,8,"mat2x3"],[O]:[m,8,"mat2x4"],[L]:[m,12,"mat3"],[D]:[m,12,"mat3x2"],[B]:[m,12,"mat3x4"],[z]:[m,16,"mat4"],[F]:[m,16,"mat4x2"],[j]:[m,16,"mat4x3"]};function U(t){switch(t){case l:return l;case u:case h:case c:return u;case p:case d:case f:return p;default:return(0,i.v)(!1),0}}function V(t){const e=N[t];if(!e)return null;const[r,i]=e;return{type:r,components:i}}function q(t,e){switch(t){case n:case o:case a:case s:t=m}for(const r in N){const[i,n,o]=N[r];if(i===t&&n===e)return{glType:r,name:o}}return null}},73742:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var i=r(99932),n=r(36471),o=r(8842);const a=Math.PI/180;function s(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const{width:r,height:i,unproject:n}=t,o={targetZ:e},s=n([0,i],o),u=n([r,i],o);let c,h;
21return(t.fovy?.5*t.fovy*a:Math.atan(.5/t.altitude))>(90-t.pitch)*a-.01?(c=l(t,0,e),h=l(t,r,e)):(c=n([0,0],o),h=n([r,0],o)),[s,u,h,c]}function l(t,e,r){const{pixelUnprojectionMatrix:a}=t,s=(0,o._U)(a,[e,0,1,1]),l=(0,o._U)(a,[e,t.height,1,1]),u=(r*t.distanceScales.unitsPerMeter[2]-s[2])/(l[2]-s[2]),c=n.Cc([],s,l,u),h=(0,i.iV)(c);return h.push(r),h}},74734:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==o(t)&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){var s=i?Object.getOwnPropertyDescriptor(t,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=t[a]}r.default=t,e&&e.set(t,r);return r}(r("__fusion__95b4ba69e5"));function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],i=!0,n=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);i=!0);}catch(t){n=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(n)throw o}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function l(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t){return function(){var e,r=c(t);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()){var i=c(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(t,e){if(e&&("object"===o(e)||"function"==typeof e))return e;return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,e)}}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}function h(t,e){return h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},h(t,e)}var p={width:"100%",height:"100%",position:"absolute",pointerEvents:"none",overflow:"hidden"},d=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(r,t);var e=u(r);function r(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),e.apply(this,arguments)}return function(t,e,r){e&&l(t.prototype,e),r&&l(t,r)}(r,[{key:"getItems",value:function(){var t=this.props.children;return t?Array.isArray(t)?t:[t]:[]}},{key:"getCoords",value:function(t){var e=this.props.viewport.project(t);return e||[-1,-1]}},{key:"inView",value:function(t){var e=a(t,2),r=e[0],i=e[1],n=this.props,o=n.viewport,s=n.overflowMargin,l=void 0===s?0:s,u=o.width,c=o.height;return!(r<-l||i<-l||r>u+l||i>c+l)}},{key:"scaleWithZoom",value:function(t){var e=this.props.viewport.zoom;return t/Math.pow(2,20-e)}},{key:"breakpointWithZoom",value:function(t,e,r){return this.props.viewport.zoom>t?e:r}},{key:"getViewport",value:function(){return this.props.viewport}},{key:"getZoom",value:function(){return this.props.viewport.zoom}},{key:"render",value:function(){var t=this,e=this.props.zIndex,r=void 0===e?1:e,n=Object.assign({zIndex:r},p),o=[];
21return this.getItems().filter(Boolean).forEach((function(e,r){var n=a(t.getCoords(e.props.coordinates),2),s=n[0],l=n[1];if(t.inView([s,l])){var u=null===e.key||void 0===e.key?r:e.key;o.push(i.cloneElement(e,{x:s,y:l,key:u}))}})),i.createElement("div",{style:n},o)}}]),r}(i.Component);e.default=d,d.deckGLViewProps=!0},76340:(t,e,r)=>{"use strict";r.d(e,{A:()=>p});var i=r(32970),n=r(98737),o=r(52697),a=r(56706),s=r(57971),l=r(12958);const u={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},c={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:u},h={removedProps:u};class p extends i.A{get[Symbol.toStringTag](){return"Buffer"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=e.target||(this.gl.webgl2?36662:34962),this.initialize(e),Object.seal(this)}getElementCount(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/n.A.getBytesPerElement(t))}getVertexCount(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/n.A.getBytesPerVertex(t))}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=(0,l.N)("Buffer",t,c),this.usage=t.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},t,t.accessor)),t.data?this._setData(t.data,t.offset,t.byteLength):this._setByteLength(t.byteLength||0),this}setProps(t){return"accessor"in(t=(0,l.N)("Buffer",t,h))&&this.setAccessor(t.accessor),this}setAccessor(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new n.A(t),this}reallocate(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}setData(t){return this.initialize(t)}subData(t){ArrayBuffer.isView(t)&&(t={data:t});const{data:e,offset:r=0,srcOffset:i=0}=t,n=t.byteLength||t.length;(0,s.v)(e);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==i||void 0!==n?((0,a.Dz)(this.gl),this.gl.bufferSubData(this.target,r,e,i,n)):this.gl.bufferSubData(o,r,e),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(e),this}copyData(t){let{sourceBuffer:e,readOffset:r=0,writeOffset:i=0,size:n}=t;const{gl:o}=this;return(0,a.Dz)(o),o.bindBuffer(36662,e.handle),o.bindBuffer(36663,this.handle),o.copyBufferSubData(36662,36663,r,i,n),o.bindBuffer(36662,null),o.bindBuffer(36663,null),this.debugData=null,this}getData(){let{dstData:t=null,srcByteOffset:e=0,dstOffset:r=0,length:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,a.Dz)(this.gl);const n=(0,o.Xj)(this.accessor.type||5126,{clamped:!1}),l=this._getAvailableElementCount(e),u=r;let c,h;t?(h=t.length,c=h-u):(c=Math.min(l,i||l),h=u+c);const p=Math.min(l,c);return i=i||p,(0,s.v)(i<=p),t=t||new n(h),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,e,t,r,i),this.gl.bindBuffer(36662,null),t}bind(){let{target:t=this.target,index:e=this.accessor&&this.accessor.index,offset:r=0,size:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 35345===t||35982===t?void 0!==i?this.gl.bindBufferRange(t,e,this.handle,r,i):((0,s.v)(0===r),this.gl.bindBufferBase(t,e,this.handle)):this.gl.bindBuffer(t,this.handle),this}unbind(){let{target:t=this.target,index:e=this.accessor&&this.accessor.index}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 35345===t||35982===t?this.gl.bindBufferBase(t,e,null):this.gl.bindBuffer(t,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.byteLength+e;(0,s.v)(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();const i=this._getTarget();this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,r,this.usage),this.gl.bufferSubData(i,e,t),this.gl.bindBuffer(i,null),this.debugData=t.slice(0,10),this.bytesUsed=r,this._trackAllocatedMemory(r);const a=(0,o.jX)(t);return(0,s.v)(a),this.setAccessor(new n.A(this.accessor,{type:a})),this}_setByteLength(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;(0,s.v)(t>=0),this._trackDeallocatedMemory();let r=t;0===t&&(r=new Float32Array(0));const i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,r,e),this.gl.bindBuffer(i,null),this.usage=e,this.debugData=null,this.bytesUsed=t,this._trackAllocatedMemory(t),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(t){const e=t/(0,o.Xj)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}_inferType(t){this.accessor.type||this.setAccessor(new n.A(this.accessor,{type:(0,o.jX)(t)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(t){this.gl.bindBuffer(this.target,this.handle);const e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}get type(){return a.Rm.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return a.Rm.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(t){return a.Rm.deprecated("setByteLength","reallocate")(),this.reallocate(t)}updateAccessor(t){return a.Rm.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new n.A(this.accessor,t),this}}},80598:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});var i=r(67811);const n=new class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.A)(this,"_pool",[]),(0,i.A)(this,"opts",{overAlloc:2,poolSize:100}),this.setOptions(t)}setOptions(t){Object.assign(this.opts,t)}
21allocate(t,e,r){let{size:i=1,type:n,padding:o=0,copy:a=!1,initialize:s=!1,maxCount:l}=r;const u=n||t&&t.constructor||Float32Array,c=e*i+o;if(ArrayBuffer.isView(t)){if(c<=t.length)return t;if(c*t.BYTES_PER_ELEMENT<=t.buffer.byteLength)return new u(t.buffer,0,c)}let h=1/0;l&&(h=l*i+o);const p=this._allocate(u,c,s,h);return t&&a?p.set(t):s||p.fill(0,0,4),this._release(t),p}release(t){this._release(t)}_allocate(t,e,r,i){let n=Math.max(Math.ceil(e*this.opts.overAlloc),1);n>i&&(n=i);const o=this._pool,a=t.BYTES_PER_ELEMENT*n,s=o.findIndex((t=>t.byteLength>=a));if(s>=0){const e=new t(o.splice(s,1)[0],0,n);return r&&e.fill(0),e}return new t(n)}_release(t){if(!ArrayBuffer.isView(t))return;const e=this._pool,{buffer:r}=t,{byteLength:i}=r,n=e.findIndex((t=>t.byteLength>=i));n<0?e.push(r):(n>0||e.length<this.opts.poolSize)&&e.splice(n,0,r),e.length>this.opts.poolSize&&e.shift()}}},81109:(t,e,r)=>{"use strict";r.d(e,{zz:()=>y,K2:()=>f,a5:()=>g});var i=r(32649);let n="";const o={};var a=r(35483);async function s(t,e){if("string"==typeof t){t=function(t){for(const e in o)if(t.startsWith(e)){const r=o[e];t=t.replace(e,r)}return t.startsWith("http://")||t.startsWith("https://")||(t="".concat(n).concat(t)),t}(t);let r=e;return null!=e&&e.fetch&&"function"!=typeof(null==e?void 0:e.fetch)&&(r=e.fetch),await fetch(t,r)}return await(0,a.wv)(t)}var l=r(67811);const u=new(r(7114).A)({id:"loaders.gl"});class c{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}var h=r(66318);const p={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){(0,l.A)(this,"console",void 0),this.console=console}log(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.console.log.bind(this.console,...e)}info(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.console.info.bind(this.console,...e)}warn(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.console.warn.bind(this.console,...e)}error(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:h.Bd,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},d={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function f(){globalThis.loaders=globalThis.loaders||{};const{loaders:t}=globalThis;return t._state=t._state||{},t._state}const m=()=>{const t=f();return t.globalOptions=t.globalOptions||{...p},t.globalOptions};function g(t,e,r,i){return r=r||[],function(t,e){v(t,null,p,d,e);for(const r of e){const i=t&&t[r.id]||{},n=r.options&&r.options[r.id]||{},o=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};v(i,r.id,n,o,e)}}(t,r=Array.isArray(r)?r:[r]),b(e,t,i)}function y(t,e){const r=m(),n=t||r;return"function"==typeof n.fetch?n.fetch:(0,i.Gv)(n.fetch)?t=>s(t,n):null!=e&&e.fetch?null==e?void 0:e.fetch:s}function v(t,e,r,n,o){const a=e||"Top level",s=e?"".concat(e,"."):"";for(const l in t){const c=!e&&(0,i.Gv)(t[l]);if(!(l in r)&&!("baseUri"===l&&!e)&&!("workerUrl"===l&&e))if(l in n)u.warn("".concat(a," loader option '").concat(s).concat(l,"' no longer supported, use '").concat(n[l],"'"))();else if(!c){const t=_(l,o);u.warn("".concat(a," loader option '").concat(s).concat(l,"' not recognized. ").concat(t))()}}}function _(t,e){const r=t.toLowerCase();let i="";for(const n of e)for(const e in n.options){if(t===e)return"Did you mean '".concat(n.id,".").concat(e,"'?");const o=e.toLowerCase();(r.startsWith(o)||o.startsWith(r))&&(i=i||"Did you mean '".concat(n.id,".").concat(e,"'?"))}return i}function b(t,e,r){const i={...t.options||{}};return function(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}(i,r),null===i.log&&(i.log=new c),x(i,m()),x(i,e),i}function x(t,e){for(const r in e)if(r in e){const n=e[r];(0,i.aC)(n)&&(0,i.aC)(t[r])?t[r]={...t[r],...e[r]}:t[r]=e[r]}}},83556:(t,e,r)=>{"use strict";function i(t){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type)return!0;
21if("undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}r.d(e,{A:()=>i})},85971:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var i=r(15706),n=r(8842),o=r(99932);function a(t){const{width:e,height:r,bounds:a,minExtent:s=0,maxZoom:l=24,offset:u=[0,0]}=t,[[c,h],[p,d]]=a,f=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if("number"==typeof t)return{top:t,bottom:t,left:t,right:t};return(0,i.A)(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t}(t.padding),m=(0,o.Gw)([c,(0,n.qE)(d,-o.aH,o.aH)]),g=(0,o.Gw)([p,(0,n.qE)(h,-o.aH,o.aH)]),y=[Math.max(Math.abs(g[0]-m[0]),s),Math.max(Math.abs(g[1]-m[1]),s)],v=[e-f.left-f.right-2*Math.abs(u[0]),r-f.top-f.bottom-2*Math.abs(u[1])];(0,i.A)(v[0]>0&&v[1]>0);const _=v[0]/y[0],b=v[1]/y[1],x=(f.right-f.left)/2/_,w=(f.top-f.bottom)/2/b,A=[(g[0]+m[0])/2+x,(g[1]+m[1])/2+w],E=(0,o.iV)(A),T=Math.min(l,(0,n.p6)(Math.abs(Math.min(_,b))));return(0,i.A)(Number.isFinite(T)),{longitude:E[0],latitude:E[1],zoom:T}}},86926:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var i=r(62031),n=r(44504),o=r(55490),a=r(46752),s=r(9444);const l=[0,0,0];let u;class c extends i.A{static get ZERO(){return u||(u=new c(0,0,0),Object.freeze(u)),u}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;super(-0,-0,-0),1===arguments.length&&(0,n.cy)(t)?this.copy(t):(n.$W.debug&&((0,o.ws)(t),(0,o.ws)(e),(0,o.ws)(r)),this[0]=t,this[1]=e,this[2]=r)}set(t,e,r){return this[0]=t,this[1]=e,this[2]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return n.$W.debug&&((0,o.ws)(t.x),(0,o.ws)(t.y),(0,o.ws)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=(0,o.ws)(t)}angle(t){return a.g7(this,t)}cross(t){return a.$A(this,this,t),this.check()}rotateX(t){let{radians:e,origin:r=l}=t;return a.eL(this,this,r,e),this.check()}rotateY(t){let{radians:e,origin:r=l}=t;return a.Z8(this,this,r,e),this.check()}rotateZ(t){let{radians:e,origin:r=l}=t;return a.x6(this,this,r,e),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return a.Z0(this,this,t),this.check()}transformAsVector(t){return(0,s.cL)(this,this,t),this.check()}transformByMatrix3(t){return a.ei(this,this,t),this.check()}transformByMatrix2(t){return(0,s.J4)(this,this,t),this.check()}transformByQuaternion(t){return a.gL(this,this,t),this.check()}}},86939:(t,e,r)=>{"use strict";r.d(e,{A:()=>R});var i=r(56706),n=r(70260),o=r(30856),a=r(57971),s=r(44777),l=r(17553),u=r(98737),c=r(76340),h=r(32970);let p=null;function d(t,e){return new t(function(t){return(!p||p.byteLength<t)&&(p=new ArrayBuffer(t)),p}(t.BYTES_PER_ELEMENT*e),0,e)}var f=r(20096);class m extends h.A{get[Symbol.toStringTag](){return"VertexArrayObject"}static isSupported(t){return!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero||((0,i.C6)(t)||"Chrome"===(0,f.A)())}static getDefaultArray(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new m(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}static getMaxAttributes(t){return m.MAX_ATTRIBUTES=m.MAX_ATTRIBUTES||t.getParameter(34921),m.MAX_ATTRIBUTES}static setConstant(t,e,r){switch(r.constructor){case Float32Array:m._setConstantFloatArray(t,e,r);break;case Int32Array:m._setConstantIntArray(t,e,r);break;case Uint32Array:m._setConstantUintArray(t,e,r);break;default:(0,a.v)(!1)}}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=e.id||e.program&&e.program.id;super(t,Object.assign({},e,{id:r})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=e.isDefaultArray||!1,this.gl2=t,this.initialize(e),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return m.getMaxAttributes(this.gl)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(t)}setProps(t){return this}setElementBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return(0,a.v)(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind((()=>{this.gl.bindBuffer(34963,t?t.handle:null)})),this}setBuffer(t,e,r){if(34963===e.target)return this.setElementBuffer(e,r);const{size:n,type:o,stride:s,offset:l,normalized:u,integer:c,divisor:h}=r,{gl:p,gl2:d}=this;return t=Number(t),this.bind((()=>{p.bindBuffer(34962,e.handle),c?((0,a.v)((0,i.C6)(p)),d.vertexAttribIPointer(t,n,o,s,l)):p.vertexAttribPointer(t,n,o,u,s,l),p.enableVertexAttribArray(t),d.vertexAttribDivisor(t,h||0)})),this}enable(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!e&&0===t&&!m.isSupported(this.gl,{constantAttributeZero:!0})||(t=Number(t),this.bind((()=>e?this.gl.enableVertexAttribArray(t):this.gl.disableVertexAttribArray(t)))),this}getConstantBuffer(t,e){const r=this._normalizeConstantArrayValue(e),i=r.byteLength*t,n=r.length*t;let o=!this.buffer;if(this.buffer=this.buffer||new c.A(this.gl,i),o=o||this.buffer.reallocate(i),o=o||!this._compareConstantArrayValues(r,this.bufferValue),o){const t=d(e.constructor,n);!function(t){let{target:e,source:r,start:i=0,count:n=1}=t;const o=r.length,a=n*o;let s=0;for(let t=i;s<o;s++)e[t++]=r[s];for(;s<a;)s<a-s?(e.copyWithin(i+s,i,i+s),s*=2):(e.copyWithin(i+s,i,i+a-s),s=a)}({target:t,source:r,start:0,count:n}),this.buffer.subData(t),this.bufferValue=e}return this.buffer}_normalizeConstantArrayValue(t){return Array.isArray(t)?new Float32Array(t):t}_compareConstantArrayValues(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}static _setConstantFloatArray(t,e,r){switch(r.length){case 1:t.vertexAttrib1fv(e,r);break;case 2:t.vertexAttrib2fv(e,r);break;case 3:t.vertexAttrib3fv(e,r);break;case 4:t.vertexAttrib4fv(e,r);break;default:(0,a.v)(!1)}}static _setConstantIntArray(t,e,r){switch((0,a.v)((0,i.C6)(t)),r.length){case 1:t.vertexAttribI1iv(e,r);break;case 2:t.vertexAttribI2iv(e,r);break;case 3:t.vertexAttribI3iv(e,r);break;case 4:t.vertexAttribI4iv(e,r);break;default:(0,a.v)(!1)}}static _setConstantUintArray(t,e,r){switch((0,a.v)((0,i.C6)(t)),r.length){case 1:t.vertexAttribI1uiv(e,r);break;case 2:t.vertexAttribI2uiv(e,r);break;case 3:t.vertexAttribI3uiv(e,r);break;case 4:t.vertexAttribI4uiv(e,r);break;default:(0,a.v)(!1)}}_createHandle(){return this.gl.createVertexArray()}_deleteHandle(t){return this.gl2.deleteVertexArray(t),[this.elements]}_bindHandle(t){this.gl2.bindVertexArray(t)}_getParameter(t,e){let{location:r}=e;return(0,a.v)(Number.isFinite(r)),this.bind((()=>34373===t?this.gl.getVertexAttribOffset(r,t):this.gl.getVertexAttrib(r,t)))}}var g=r(36418);const y=/^(.+)__LOCATION_([0-9]+)$/,v=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class _{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=e.id||e.program&&e.program.id;this.id=r,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={}
21,this.vertexArrayObject=new m(t),(0,g.R)(this,"VertexArray","v6.0",v),this.initialize(e),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(t)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:t}=this.vertexArrayObject;return this.values=new Array(t).fill(null),this.accessors=new Array(t).fill(null),this.unused={},this.drawParams=null,this}setProps(t){return"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"attributes"in t&&this.setAttributes(t.attributes),"elements"in t&&this.setElementBuffer(t.elements),"bindOnUse"in t&&(t=t.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(t){return Object.assign(this.attributes,t),this.vertexArrayObject.bind((()=>{for(const e in t){const r=t[e];this._setAttribute(e,r)}this.gl.bindBuffer(34962,null)})),this}setElementBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=t,this.elementsAccessor=e,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(t,e),this}setBuffer(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===e.target)return this.setElementBuffer(e,r);const{location:i,accessor:n}=this._resolveLocationAndAccessor(t,e,e.accessor,r);return i>=0&&(this.values[i]=e,this.accessors[i]=n,this.clearDrawParams(),this.vertexArrayObject.setBuffer(i,e,n)),this}setConstant(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{location:i,accessor:n}=this._resolveLocationAndAccessor(t,e,Object.assign({size:e.length},r));return i>=0&&(e=this.vertexArrayObject._normalizeConstantArrayValue(e),this.values[i]=e,this.accessors[i]=n,this.clearDrawParams(),this.vertexArrayObject.enable(i,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind((()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new c.A(this.gl,{accessor:{size:4}});for(let t=0;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++)this.values[t]instanceof c.A&&(this.gl.disableVertexAttribArray(t),this.gl.bindBuffer(34962,this.buffer.handle),this.gl.vertexAttribPointer(t,1,5126,!1,0,0))})),this}bindBuffers(){return this.vertexArrayObject.bind((()=>{this.elements&&this.setElementBuffer(this.elements);for(let t=0;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++){const e=this.values[t];e instanceof c.A&&this.setBuffer(t,e)}})),this}bindForDraw(t,e,r){let i;return this.vertexArrayObject.bind((()=>{this._setConstantAttributes(t,e),i=r()})),i}_resolveLocationAndAccessor(t,e,r,n){const o={location:-1,accessor:null},{location:s,name:l}=this._getAttributeIndex(t);if(!Number.isFinite(s)||s<0)return this.unused[t]=e,i.Rm.once(3,(()=>"unused value ".concat(t," in ").concat(this.id)))(),o;const c=this._getAttributeInfo(l||s);if(!c)return o;const h=this.accessors[s]||{},p=u.A.resolve(c.accessor,h,r,n),{size:d,type:f}=p;return(0,a.v)(Number.isFinite(d)&&Number.isFinite(f)),{location:s,accessor:p}}_getAttributeInfo(t){return this.configuration&&this.configuration.getAttributeInfo(t)}_getAttributeIndex(t){const e=Number(t);if(Number.isFinite(e))return{location:e};const r=y.exec(t),i=r?r[1]:t,n=r?Number(r[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(i)+n,name:i}:{location:-1}}_setAttribute(t,e){if(e instanceof c.A)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof c.A){const r=e[0],i=e[1];this.setBuffer(t,r,i)}else if(ArrayBuffer.isView(e)||Array.isArray(e)){const r=e;this.setConstant(t,r)}else{if(!(e.buffer instanceof c.A))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");{const r=e;this.setBuffer(t,r.buffer,r)}}}_setConstantAttributes(t,e){const r=Math.max(0|t,0|e);let i=this.values[0];ArrayBuffer.isView(i)&&this._setConstantAttributeZero(i,r);for(let t=1;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++)i=this.values[t],ArrayBuffer.isView(i)&&this._setConstantAttribute(t,i)}_setConstantAttributeZero(t,e){if(m.isSupported(this.gl,{constantAttributeZero:!0}))return void this._setConstantAttribute(0,t);const r=this.vertexArrayObject.getConstantBuffer(e,t);
21this.vertexArrayObject.setBuffer(0,r,this.accessors[0])}_setConstantAttribute(t,e){m.setConstant(this.gl,t,e)}_updateDrawParams(){const t={isIndexed:!1,isInstanced:!1,indexCount:1/0,vertexCount:1/0,instanceCount:1/0};for(let e=0;e<this.vertexArrayObject.MAX_ATTRIBUTES;e++)this._updateDrawParamsForLocation(t,e);return this.elements&&(t.elementCount=this.elements.getElementCount(this.elements.accessor),t.isIndexed=!0,t.indexType=this.elementsAccessor.type||this.elements.accessor.type,t.indexOffset=this.elementsAccessor.offset||0),t.indexCount===1/0&&(t.indexCount=0),t.vertexCount===1/0&&(t.vertexCount=0),t.instanceCount===1/0&&(t.instanceCount=0),t}_updateDrawParamsForLocation(t,e){const r=this.values[e],i=this.accessors[e];if(!r)return;const{divisor:n}=i,o=n>0;if(t.isInstanced=t.isInstanced||o,r instanceof c.A){const e=r;if(o){const r=e.getVertexCount(i);t.instanceCount=Math.min(t.instanceCount,r)}else{const r=e.getVertexCount(i);t.vertexCount=Math.min(t.vertexCount,r)}}}setElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.Rm.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}var b=r(45638),x=r(88161),w=r(72009);function A(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{isInteger:r=!1}=e;if(Array.isArray(t)||ArrayBuffer.isView(t))return function(t,e){const{maxElts:r=16,size:i=1}=e;let n="[";for(let o=0;o<t.length&&o<r;++o)o>0&&(n+=",".concat(o%i==0?" ":"")),n+=A(t[o],e);const o=t.length>r?"...":"]";return"".concat(n).concat(o)}(t,e);if(!Number.isFinite(t))return String(t);if(Math.abs(t)<1e-16)return r?"0":"0.";if(r)return t.toFixed(0);if(Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);const i=t.toPrecision(2);return i.indexOf(".0")===i.length-2?i.slice(0,-1):i}function E(t,e,r,i){const{gl:n}=t;if(!e)return{[i]:"null","Format ":"N/A"};let o,a,s,l="NOT PROVIDED",u=1,h=0,p=0;if(r&&(l=r.type,u=r.size,l=String(l).replace("Array",""),o=-1!==l.indexOf("nt")),e instanceof c.A){const t=e,{data:c,changed:d}=t.getDebugData();let f;if(a=d?"*":"",s=c,p=t.byteLength,h=p/c.BYTES_PER_ELEMENT/u,r){const t=r.divisor>0;f="".concat(t?"I ":"P "," ").concat(h," (x").concat(u,"=").concat(p," bytes ").concat((0,x.i7)(n,l),")")}else o=!0,f="".concat(p," bytes");return{[i]:"".concat(a).concat(A(s,{size:u,isInteger:o})),"Format ":f}}return s=e,u=e.length,l=String(e.constructor.name).replace("Array",""),o=-1!==l.indexOf("nt"),{[i]:"".concat(A(s,{size:u,isInteger:o})," (constant)"),"Format ":"".concat(u,"x").concat(l," (constant)")}}function T(t,e){const{type:r,size:i}=e,n=(0,w.bF)(r,i);return n?"".concat(t," (").concat(n.name,")"):t}function S(t){let{header:e="Uniforms",program:r,uniforms:i,undefinedOnly:n=!1}=t;(0,a.v)(r);const o=".*Matrix",s=r._uniformSetters,l={},u=Object.keys(s).sort();let c=0;for(const t of u)t.match(".*_.*")||t.match(o)||P({table:l,header:e,uniforms:i,uniformName:t,undefinedOnly:n})&&c++;for(const t of u)t.match(o)&&P({table:l,header:e,uniforms:i,uniformName:t,undefinedOnly:n})&&c++;for(const t of u)l[t]||P({table:l,header:e,uniforms:i,uniformName:t,undefinedOnly:n})&&c++;let h=0;const p={};if(!n)for(const t in i){const r=i[t];l[t]||(h++,p[t]={Type:"NOT USED: ".concat(r),[e]:A(r)})}return{table:l,count:c,unusedTable:p,unusedCount:h}}function P(t){let{table:e,header:r,uniforms:i,uniformName:n,undefinedOnly:o}=t;const a=i[n],s=function(t){return null!=t}(a);return(!o||!s)&&(e[n]={[r]:s?A(a):"N/A","Uniform Type":s?a:"NOT PROVIDED"},!0)}function I(t){const{type:e,size:r}=t.accessor,i=(0,w.bF)(e,r);return i?"".concat(i.name," ").concat(t.name):t.name}const M={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function C(t,e){const{attributeMap:r=M}=e||{};return r&&r[t]||t}function k(t,e){let r;switch(t){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":r="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":r="vectors"}switch(r){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}(0,a.v)(Number.isFinite(e.size),"attribute ".concat(t," needs size"))}const L=()=>{},z={};class R{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};
21const{id:r=(0,o.Ld)("model")}=e;(0,a.v)((0,i.uF)(t)),this.id=r,this.gl=t,this.id=e.id||(0,o.Ld)("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(e)}initialize(t){this.props={},this.programManager=t.programManager||n.A.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:e=null,vs:r,fs:i,modules:o,defines:s,inject:l,varyings:u,bufferMode:c,transpileToGLSL100:h}=t;this.programProps={program:e,vs:r,fs:i,modules:o,defines:s,inject:l,varyings:u,bufferMode:c,transpileToGLSL100:h},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(t.moduleSettings))),this.drawMode=void 0!==t.drawMode?t.drawMode:4,this.vertexCount=t.vertexCount||0,this.geometryBuffers={},this.isInstanced=t.isInstanced||t.instanced||t.instanceCount>0,this._setModelProps(t),this.geometry={},(0,a.v)(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(t){this._setModelProps(t)}delete(){for(const t in this._attributes)this._attributes[t]!==this.attributes[t]&&this._attributes[t].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(t){const{program:e,vs:r,fs:i,modules:n,defines:o,inject:a,varyings:s,bufferMode:l,transpileToGLSL100:u}=t;this.programProps={program:e,vs:r,fs:i,modules:n,defines:o,inject:a,varyings:s,bufferMode:l,transpileToGLSL100:u},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(t){return this.drawMode=t,this}setVertexCount(t){return(0,a.v)(Number.isFinite(t)),this.vertexCount=t,this}setInstanceCount(t){return(0,a.v)(Number.isFinite(t)),this.instanceCount=t,this}setGeometry(t){return this.drawMode=t.drawMode,this.vertexCount=t.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(t,e,r){const i={};let n=e.indices;for(const o in e.attributes){const a=e.attributes[o],s=C(o,r);if("indices"===o)n=a;else if(a.constant)i[s]=a.value;else{const e=a.value,r={...a};delete r.value,i[s]=[new c.A(t,e),r],k(o,r)}}if(n){const e=n.value||n;(0,a.v)(e instanceof Uint16Array||e instanceof Uint32Array,'attribute array for "indices" must be of integer type');const r={size:1,isIndexed:void 0===n.isIndexed||n.isIndexed};i.indices=[new c.A(t,{data:e,target:34963}),r]}return i}(this.gl,t),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((0,o.ZF)(t))return this;const e={};for(const r in t){const i=t[r];e[r]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(e),this}setUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(this.uniforms,t),this}getModuleUniforms(t){this._checkProgram();const e=this.programManager.getUniforms(this.program);return e?e(t):{}}updateModuleSettings(t){const e=this.getModuleUniforms(t||{});return this.setUniforms(e)}clear(t){return(0,s.I)(this.program.gl,t),this}draw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._checkProgram();const{moduleSettings:e=null,framebuffer:r,uniforms:n={},attributes:o={},transformFeedback:a=this.transformFeedback,parameters:s={},vertexArray:l=this.vertexArray}=t;let u;this.setAttributes(o),this.updateModuleSettings(e),this.setUniforms(n),i.Rm.priority>=2&&(u=this._logDrawCallStart(2));const c=this.vertexArray.getDrawParams(),{isIndexed:h=c.isIndexed,indexType:p=c.indexType,indexOffset:d=c.indexOffset,vertexArrayInstanced:f=c.isInstanced}=this.props;f&&!this.isInstanced&&i.Rm.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:m,instanceCount:g}=this,{onBeforeRender:y=L,onAfterRender:v=L}=this.props;y(),this.program.setUniforms(this.uniforms);const _=this.program.draw(Object.assign(z,t,{logPriority:u,uniforms:null,framebuffer:r,parameters:s,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:a,isIndexed:h,indexType:p,isInstanced:m,instanceCount:g,offset:h?d:0}));return v(),i.Rm.priority>=2&&this._logDrawCallEnd(u,l,r),_}transform(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{discard:e=!0,feedbackBuffers:r,unbindModels:i=[]}=t;let{parameters:n}=t;r&&this._setFeedbackBuffers(r),e&&(n=Object.assign({},n,{35977:e}
21)),i.forEach((t=>t.vertexArray.unbindBuffers()));try{this.draw(Object.assign({},t,{parameters:n}))}finally{i.forEach((t=>t.vertexArray.bindBuffers()))}return this}render(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i.Rm.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(t).draw()}_setModelProps(t){Object.assign(this.props,t),"uniforms"in t&&this.setUniforms(t.uniforms),"pickable"in t&&(this.pickable=t.pickable),"instanceCount"in t&&(this.instanceCount=t.instanceCount),"geometry"in t&&this.setGeometry(t.geometry),"attributes"in t&&this.setAttributes(t.attributes),"_feedbackBuffers"in t&&this._setFeedbackBuffers(t._feedbackBuffers)}_checkProgram(){if(!(this._programDirty||this.programManager.stateHash!==this._programManagerState))return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:e,fs:r,modules:i,inject:n,defines:o,varyings:a,bufferMode:s,transpileToGLSL100:l}=this.programProps;t=this.programManager.get({vs:e,fs:r,modules:i,inject:n,defines:o,varyings:a,bufferMode:s,transpileToGLSL100:l}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}(0,a.v)(t instanceof l.A,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new _(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const t in this.geometryBuffers){const e=this.geometryBuffers[t][0]||this.geometryBuffers[t];e instanceof c.A&&e.delete()}}_setAnimationProps(t){this.animated&&(0,a.v)(t,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((0,o.ZF)(t))return this;const{gl:e}=this.program;return this.transformFeedback=this.transformFeedback||new b.A(e,{program:this.program}),this.transformFeedback.setBuffers(t),this}_logDrawCallStart(t){const e=t>3?0:1e4;if(!(Date.now()-this.lastLogTime<e))return this.lastLogTime=Date.now(),i.Rm.group(2,">>> DRAWING MODEL ".concat(this.id),{collapsed:i.Rm.level<=2})(),t}_logDrawCallEnd(t,e,r,n){if(void 0===t)return;const o=function(t){let{vertexArray:e,header:r="Attributes"}=t;if(!e.configuration)return{};const i={};e.elements&&(i.ELEMENT_ARRAY_BUFFER=E(e,e.elements,null,r));const n=e.values;for(const t in n){const o=e._getAttributeInfo(t);if(o){let a="".concat(t,": ").concat(o.name);const s=e.accessors[o.location];s&&(a="".concat(t,": ").concat(T(o.name,s))),i[a]=E(e,n[t],s,r)}}return i}({vertexArray:e,header:"".concat(this.id," attributes"),attributes:this._attributes}),{table:a,unusedTable:s,unusedCount:l}=S({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,r)}),{table:u,count:c}=S({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,r),undefinedOnly:!0});c>0&&i.Rm.log("MISSING UNIFORMS",Object.keys(u))(),l>0&&i.Rm.log("UNUSED UNIFORMS",Object.keys(s))();const h=function(t){const e={},r="Accessors for ".concat(t.id);for(const i of t.attributeInfos)if(i){const t=I(i);e["in ".concat(t)]={[r]:JSON.stringify(i.accessor)}}for(const i of t.varyingInfos)if(i){const t=I(i);e["out ".concat(t)]={[r]:JSON.stringify(i.accessor)}}return e}(this.vertexArray.configuration);i.Rm.table(t,o)(),i.Rm.table(t,a)(),i.Rm.table(t+1,h)(),n&&n.log({logLevel:2,message:"Rendered to ".concat(n.id)}),i.Rm.groupEnd(2)()}}},87484:(t,e,r)=>{"use strict";r.d(e,{QN:()=>l,i:()=>u,jI:()=>s});var i=r(71621),n=r(56706),o=r(57971);const a=2;function s(t,e){return l(t,e)}function l(t,e){return(e=Array.isArray(e)?e:[e]).every((e=>c(t,e)))}function u(t){t.luma=t.luma||{},t.luma.caps=t.luma.caps||{};for(const e in i.A)void 0===t.luma.caps[e]&&(t.luma.caps[e]=c(t,e));return t.luma.caps}function c(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},void 0===t.luma.caps[e]&&(t.luma.caps[e]=function(t,e){const r=i.A[e];let a;(0,o.v)(r,e);const s=(0,n.C6)(t)&&r[1]||r[0];
21if("function"==typeof s)a=s(t);else if(Array.isArray(s)){a=!0;for(const e of s)a=a&&Boolean(t.getExtension(e))}else"string"==typeof s?a=Boolean(t.getExtension(s)):"boolean"==typeof s?a=s:(0,o.v)(!1);return a}(t,e)),t.luma.caps[e]||n.Rm.log(a,"Feature: ".concat(e," not supported"))(),t.luma.caps[e]}},88013:(t,e)=>{"use strict";function r(t){return!i(t)}function i(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,r=new Blob([""],{type:"text/javascript"}),i=URL.createObjectURL(r);try{e=new Worker(i),t=!0}catch(e){t=!1}e&&e.terminate();return URL.revokeObjectURL(i),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var r=e.getImageData(0,0,1,1);return r&&r.width===t.width}()?function(t){void 0===n[t]&&(n[t]=function(t){var e,i=function(t){var e=document.createElement("canvas"),i=Object.create(r.webGLContextAttributes);return i.failIfMajorPerformanceCaveat=t,e.getContext("webgl",i)||e.getContext("experimental-webgl",i)}(t);if(!i)return!1;try{e=i.createShader(i.VERTEX_SHADER)}catch(t){return!1}if(!e||i.isContextLost())return!1;return i.shaderSource(e,"void main() {}"),i.compileShader(e),!0===i.getShaderParameter(e,i.COMPILE_STATUS)}(t));return n[t]}(t&&t.failIfMajorPerformanceCaveat)?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support":"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support"}e.y=i;var n={};r.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},88161:(t,e,r)=>{"use strict";r.d(e,{fm:()=>n,i7:()=>o});var i=r(57971);function n(t,e){if("string"!=typeof e)return e;const r=Number(e);if(!isNaN(r))return r;const n=t[e=e.replace(/^.*\./,"")];return(0,i.v)(void 0!==n,"Accessing undefined constant GL.".concat(e)),n}function o(t,e){e=Number(e);for(const r in t)if(t[r]===e)return"GL.".concat(r);return String(e)}},88283:(t,e,r)=>{"use strict";r.d(e,{H:()=>Q});var i=r(32649),n=r(1029),o=r(81109);function a(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}const s="3.2.9";"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof r.g&&r.g,"undefined"!=typeof document&&document;const l="object"!=typeof process||"[object process]"!==String(process)||process.browser,u="undefined"!=typeof window&&"undefined"!=typeof window.orientation,c="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);c&&parseFloat(c[1]);var h=r(67811);class p{}const d=new Map;function f(t){a(t.source&&!t.url||!t.source&&t.url);let e=d.get(t.source||t.url);return e||(t.url&&(e=function(t){if(!t.startsWith("http"))return t;return m(function(t){return"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")}(t))}(t.url),d.set(t.url,e)),t.source&&(e=m(t.source),d.set(t.source,e))),a(e),e}function m(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function g(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0;const i=r||new Set;if(t){if(y(t))i.add(t);else if(y(t.buffer))i.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"==typeof t)for(const r in t)g(t[r],e,i)}else;return void 0===r?Array.from(i):[]}function y(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}const v=()=>{};class _{static isSupported(){return"undefined"!=typeof Worker&&l||"undefined"!=typeof p&&!l}constructor(t){(0,h.A)(this,"name",void 0),(0,h.A)(this,"source",void 0),(0,h.A)(this,"url",void 0),(0,h.A)(this,"terminated",!1),(0,h.A)(this,"worker",void 0),(0,h.A)(this,"onMessage",void 0),(0,h.A)(this,"onError",void 0),(0,h.A)(this,"_loadableURL","");const{name:e,source:r,url:i}=t;a(r||i),this.name=e,this.source=r,this.url=i,this.onMessage=v,this.onError=t=>console.log(t),this.worker=l?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=v,this.onError=v,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,e){e=e||g(t),this.worker.postMessage(t,e)}_getErrorFromErrorEvent(t){let e="Failed to load ";return e+="worker ".concat(this.name," from ").concat(this.url,". "),t.message&&(e+="".concat(t.message," in ")),t.lineno&&(e+=":".concat(t.lineno,":").concat(t.colno)),new Error(e)}_createBrowserWorker(){this._loadableURL=f({source:this.source,url:this.url});const t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},t.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},t.onmessageerror=t=>console.error(t),t}_createNodeWorker(){let t;if(this.url){const e=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);t=new p(e,{eval:!1})}else{if(!this.source)throw new Error("no worker");t=new p(this.source,{eval:!0})}return t.on("message",(t=>{this.onMessage(t)})),t.on("error",(t=>{this.onError(t)})),t.on("exit",(t=>{})),t}}class b{constructor(t,e){(0,h.A)(this,"name",void 0),(0,h.A)(this,"workerThread",void 0),(0,h.A)(this,"isRunning",!0),(0,h.A)(this,"result",void 0),(0,h.A)(this,"_resolve",(()=>{})),(0,h.A)(this,"_reject",(()=>{})),this.name=t,this.workerThread=e,this.result=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}postMessage(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}done(t){a(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){a(this.isRunning),this.isRunning=!1,this._reject(t)}}class x{static isSupported(){return _.isSupported()}constructor(t){(0,h.A)(this,"name","unnamed"),(0,h.A)(this,"source",void 0),(0,h.A)(this,"url",void 0),(0,h.A)(this,"maxConcurrency",1),(0,h.A)(this,"maxMobileConcurrency",1),(0,h.A)(this,"onDebug",(()=>{})),(0,h.A)(this,"reuseWorkers",!0),(0,h.A)(this,"props",{}),(0,h.A)(this,"jobQueue",[]),(0,h.A)(this,"idleQueue",[]),(0,h.A)(this,"count",0),(0,h.A)(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach((t=>t.destroy())),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},void 0!==t.name&&(this.name=t.name),void 0!==t.maxConcurrency&&(this.maxConcurrency=t.maxConcurrency),void 0!==t.maxMobileConcurrency&&(this.maxMobileConcurrency=t.maxMobileConcurrency),void 0!==t.reuseWorkers&&(this.reuseWorkers=t.reuseWorkers),void 0!==t.onDebug&&(this.onDebug=t.onDebug)}async startJob(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t,e,r)=>t.done(r),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(t,e)=>t.error(e);const i=new Promise((i=>(this.jobQueue.push({name:t,onMessage:e,onError:r,onStart:i}),this)));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;const t=this._getAvailableWorker();if(!t)return;const e=this.jobQueue.shift();if(e){this.onDebug({message:"Starting job",name:e.name,workerThread:t,backlog:this.jobQueue.length});const r=new b(e.name,t);t.onMessage=t=>e.onMessage(r,t.type,t.payload),t.onError=t=>e.onError(r,t),e.onStart(r);try{await r.result}
21finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const t="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new _({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return u?this.maxMobileConcurrency:this.maxConcurrency}}const w={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};class A{static isSupported(){return _.isSupported()}static getWorkerFarm(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return A._workerFarm=A._workerFarm||new A({}),A._workerFarm.setProps(t),A._workerFarm}constructor(t){(0,h.A)(this,"props",void 0),(0,h.A)(this,"workerPools",new Map),this.props={...w},this.setProps(t),this.workerPools=new Map}destroy(){for(const t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(t){const{name:e,source:r,url:i}=t;let n=this.workerPools.get(e);return n||(n=new x({name:e,source:r,url:i}),n.setProps(this._getWorkerPoolProps()),this.workerPools.set(e,n)),n}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}(0,h.A)(A,"_workerFarm",void 0);const E="latest";async function T(t,e,r,i,n){const o=t.id,s=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=e[t.id]||{},i="".concat(t.id,"-worker.js");let n=r.workerUrl;if(n||"compression"!==t.id||(n=e.workerUrl),"test"===e._workerType&&(n="modules/".concat(t.module,"/dist/").concat(i)),!n){let e=t.version;"latest"===e&&(e=E);const r=e?"@".concat(e):"";n="https://unpkg.com/@loaders.gl/".concat(t.module).concat(r,"/dist/").concat(i)}return a(n),n}(t,r),l=A.getWorkerFarm(r).getWorkerPool({name:o,url:s});r=JSON.parse(JSON.stringify(r)),i=JSON.parse(JSON.stringify(i||{}));const u=await l.startJob("process-on-worker",S.bind(null,n));u.postMessage("process",{input:e,options:r,context:i});const c=await u.result;return await c.result}async function S(t,e,r,i){switch(r){case"done":e.done(i);break;case"error":e.error(new Error(i.error));break;case"process":const{id:n,input:o,options:a}=i;try{const r=await t(o,a);e.postMessage("done",{id:n,result:r})}catch(t){const r=t instanceof Error?t.message:"unknown error";e.postMessage("error",{id:n,error:r})}break;default:console.warn("parse-with-worker unknown message ".concat(r))}}r(21576);function P(t){return t&&"object"==typeof t&&t.isBuffer}function I(t){if(P(t))return function(t){if(P(t))return new Uint8Array(t.buffer,t.byteOffset,t.length).slice().buffer;return t}(t);if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return 0===t.byteOffset&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if("string"==typeof t){const e=t;return(new TextEncoder).encode(e).buffer}if(t&&"object"==typeof t&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}async function M(t){const e=[];for await(const r of t)e.push(r);return function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const i=e.map((t=>t instanceof ArrayBuffer?new Uint8Array(t):t)),n=i.reduce(((t,e)=>t+e.byteLength),0),o=new Uint8Array(n);let a=0;for(const t of i)o.set(t,a),a+=t.byteLength;return o.buffer}(...e)}const C=262144;const k=262144;const L=1048576;var z=r(66318);function R(t,e){return z.Bd?async function*(t,e){const r=t.getReader();let i;try{for(;;){const t=i||r.read();null!=e&&e._streamReadAhead&&(i=r.read());const{done:n,value:o}=await t;if(n)return;yield I(o)}}catch(t){r.releaseLock()}}(t,e):async function*(t){for await(const e of t)yield I(e)}(t)}function O(t,e){if("string"==typeof t)return function*(t,e){const r=(null==e?void 0:e.chunkSize)||C;let i=0;const n=new TextEncoder;for(;i<t.length;){const e=Math.min(t.length-i,r),o=t.slice(i,i+e);i+=e,yield n.encode(o)}}(t,e);if(t instanceof ArrayBuffer)return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const{chunkSize:r=k}=e;let i=0;for(;i<t.byteLength;){const e=Math.min(t.byteLength-i,r),n=new ArrayBuffer(e),o=new Uint8Array(t,i,e);new Uint8Array(n).set(o),i+=e,yield n}}()}(t,e);if((0,i.qf)(t))return async function*(t,e){const r=(null==e?void 0:e.chunkSize)||L;let i=0;for(;i<t.size;){const e=i+r,n=await t.slice(i,e).arrayBuffer();i=e,yield n}}(t,e);if((0,i.H1)(t))return R(t,e);if((0,i.Sv)(t)){return R(t.body,e)}throw new Error("makeIterator")}
21var D=r(35483);const B="Cannot convert supplied data type";async function F(t,e,r){const n=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if("string"==typeof t||n)return function(t,e){if(e.text&&"string"==typeof t)return t;if((0,i.Pe)(t)&&(t=t.buffer),t instanceof ArrayBuffer){const r=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(r):r}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);let r=t.buffer;const i=t.byteLength||t.length;return 0===t.byteOffset&&i===r.byteLength||(r=r.slice(t.byteOffset,t.byteOffset+i)),r}throw new Error(B)}(t,e);if((0,i.qf)(t)&&(t=await(0,D.wv)(t)),(0,i.Sv)(t)){const r=t;return await(0,D.Mz)(r),e.binary?await r.arrayBuffer():await r.text()}if((0,i.H1)(t)&&(t=O(t,r)),(0,i.xZ)(t)||(0,i.Td)(t))return M(t);throw new Error(B)}var j=r(45514);const N=new(r(7114).A)({id:"loaders.gl"});var U=r(17895);const V=/\.([^.]+)$/;function q(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;if(!G(t))return null;if(e&&!Array.isArray(e))return(0,n.D)(e);let o=[];e&&(o=o.concat(e)),null!=r&&r.ignoreRegisteredLoaders||o.push(...(0,U.Ph)()),function(t){for(const e of t)(0,n.D)(e)}(o);const a=function(t,e,r,i){const{url:n,type:o}=(0,j.D)(t),a=n||(null==i?void 0:i.url);let s=null,l="";null!=r&&r.mimeType&&(s=W(e,null==r?void 0:r.mimeType),l="match forced by supplied MIME type ".concat(null==r?void 0:r.mimeType));var u;s=s||function(t,e){const r=e&&V.exec(e),i=r&&r[1];return i?function(t,e){e=e.toLowerCase();for(const r of t)for(const t of r.extensions)if(t.toLowerCase()===e)return r;return null}(t,i):null}(e,a),l=l||(s?"matched url ".concat(a):""),s=s||W(e,o),l=l||(s?"matched MIME type ".concat(o):""),s=s||function(t,e){if(!e)return null;for(const r of t)if("string"==typeof e){if(H(e,r))return r}else if(ArrayBuffer.isView(e)){if(X(e.buffer,e.byteOffset,r))return r}else if(e instanceof ArrayBuffer){if(X(e,0,r))return r}return null}(e,t),l=l||(s?"matched initial data ".concat(Y(t)):""),s=s||W(e,null==r?void 0:r.fallbackMimeType),l=l||(s?"matched fallback MIME type ".concat(o):""),l&&N.log(1,"selectLoader selected ".concat(null===(u=s)||void 0===u?void 0:u.name,": ").concat(l,"."));return s}(t,o,r,i);if(!(a||null!=r&&r.nothrow))throw new Error(Z(t));return a}function G(t){return!(t instanceof Response&&204===t.status)}function Z(t){const{url:e,type:r}=(0,j.D)(t);let i="No valid loader found (";i+=e?"".concat(function(t){const e=t&&t.lastIndexOf("/");return e>=0?t.substr(e+1):""}(e),", "):"no url provided, ",i+="MIME type: ".concat(r?'"'.concat(r,'"'):"not provided",", ");const n=t?Y(t):"";return i+=n?' first bytes: "'.concat(n,'"'):"first bytes: not available",i+=")",i}function W(t,e){for(const r of t){if(r.mimeTypes&&r.mimeTypes.includes(e))return r;if(e==="application/x.".concat(r.id))return r}return null}function H(t,e){if(e.testText)return e.testText(t);return(Array.isArray(e.tests)?e.tests:[e.tests]).some((e=>t.startsWith(e)))}function X(t,e,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some((i=>function(t,e,r,i){if(i instanceof ArrayBuffer)return function(t,e,r){if(r=r||t.byteLength,t.byteLength<r||e.byteLength<r)return!1;const i=new Uint8Array(t),n=new Uint8Array(e);for(let t=0;t<i.length;++t)if(i[t]!==n[t])return!1;return!0}(i,t,i.byteLength);switch(typeof i){case"function":return i(t,r);case"string":return i===K(t,e,i.length);default:return!1}}(t,e,r,i)))}function Y(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return K(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){return K(t,0,e)}return""}function K(t,e,r){if(t.byteLength<e+r)return"";const i=new DataView(t);let n="";for(let t=0;t<r;t++)n+=String.fromCharCode(i.getUint8(e+t));return n}async function J(t,e,r,u){a(!u||"object"==typeof u),!e||Array.isArray(e)||(0,n.l)(e)||(u=void 0,r=e,e=void 0),t=await t,r=r||{};const{url:c}=(0,j.D)(t),h=function(t,e){if(!e&&t&&!Array.isArray(t))return t;let r;if(t&&(r=Array.isArray(t)?t:[t]),e&&e.loaders){const t=Array.isArray(e.loaders)?e.loaders:[e.loaders];r=r?[...r,...t]:t}return r&&r.length?r:null}(e,u),p=await async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(!G(t))return null;let o=q(t,e,{...r,nothrow:!0},n);if(o)return o;if((0,i.qf)(t)&&(o=q(t=await t.slice(0,10).arrayBuffer(),e,r,n)),!(o||null!=r&&r.nothrow))throw new Error(Z(t));return o}(t,h,r);return p?(u=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(r)return r;const i={fetch:(0,o.zz)(e,t),...t};return Array.isArray(i.loaders)||(i.loaders=null),i}({url:c,parse:J,loaders:h},r=(0,o.a5)(r,p,h,c),u),await async function(t,e,r,n){if(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;a(t,"no worker provided");const r=t.version}(t),(0,i.Sv)(e)){const t=e,{ok:r,redirected:i,status:o,statusText:a,type:s,url:l}=t,u=Object.fromEntries(t.headers.entries());n.response={headers:u,ok:r,redirected:i,status:o,statusText:a,type:s,url:l}}
21if(e=await F(e,t,r),t.parseTextSync&&"string"==typeof e)return r.dataType="text",t.parseTextSync(e,r,n,t);if(function(t,e){return!!A.isSupported()&&!!(l||null!=e&&e._nodeWorkers)&&t.worker&&(null==e?void 0:e.worker)}(t,r))return await T(t,e,r,n,J);if(t.parseText&&"string"==typeof e)return await t.parseText(e,r,n,t);if(t.parse)return await t.parse(e,r,n,t);throw a(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"))}(p,t,r,u)):null}async function Q(t,e,r,a){Array.isArray(e)||(0,n.l)(e)||(r=e,e=void 0);const s=(0,o.zz)(r);let l=t;return"string"==typeof t&&(l=await s(t)),(0,i.qf)(t)&&(l=await s(t)),await J(l,e,r)}},88376:(t,e,r)=>{"use strict";r.d(e,{B:()=>n,T:()=>i});const i="vs",n="fs"},91925:(t,e,r)=>{"use strict";r.d(e,{$h:()=>m,B8:()=>o,I0:()=>f,Qr:()=>d,Tl:()=>l,Z8:()=>p,a4:()=>a,aI:()=>_,e$:()=>c,eL:()=>h,fN:()=>g,hs:()=>u,lw:()=>s,mg:()=>n,t5:()=>v,v3:()=>y});var i=r(21986);function n(t,e){if(t===e){var r=e[1],i=e[2],n=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=o,t[11]=e[14],t[12]=n,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function o(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],d=e[11],f=e[12],m=e[13],g=e[14],y=e[15],v=r*s-i*a,_=r*l-n*a,b=r*u-o*a,x=i*l-n*s,w=i*u-o*s,A=n*u-o*l,E=c*m-h*f,T=c*g-p*f,S=c*y-d*f,P=h*g-p*m,I=h*y-d*m,M=p*y-d*g,C=v*M-_*I+b*P+x*S-w*T+A*E;return C?(C=1/C,t[0]=(s*M-l*I+u*P)*C,t[1]=(n*I-i*M-o*P)*C,t[2]=(m*A-g*w+y*x)*C,t[3]=(p*w-h*A-d*x)*C,t[4]=(l*S-a*M-u*T)*C,t[5]=(r*M-n*S+o*T)*C,t[6]=(g*b-f*A-y*_)*C,t[7]=(c*A-p*b+d*_)*C,t[8]=(a*I-s*S+u*E)*C,t[9]=(i*S-r*I-o*E)*C,t[10]=(f*w-m*b+y*v)*C,t[11]=(h*b-c*w-d*v)*C,t[12]=(s*T-a*P-l*E)*C,t[13]=(r*P-i*T+n*E)*C,t[14]=(m*_-f*x-g*v)*C,t[15]=(c*x-h*_+p*v)*C,t):null}function a(t){var e=t[0],r=t[1],i=t[2],n=t[3],o=t[4],a=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],p=t[11],d=t[12],f=t[13],m=t[14],g=t[15];return(e*a-r*o)*(h*g-p*m)-(e*s-i*o)*(c*g-p*f)+(e*l-n*o)*(c*m-h*f)+(r*s-i*a)*(u*g-p*d)-(r*l-n*a)*(u*m-h*d)+(i*l-n*s)*(u*f-c*d)}function s(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],d=e[10],f=e[11],m=e[12],g=e[13],y=e[14],v=e[15],_=r[0],b=r[1],x=r[2],w=r[3];return t[0]=_*i+b*s+x*h+w*m,t[1]=_*n+b*l+x*p+w*g,t[2]=_*o+b*u+x*d+w*y,t[3]=_*a+b*c+x*f+w*v,_=r[4],b=r[5],x=r[6],w=r[7],t[4]=_*i+b*s+x*h+w*m,t[5]=_*n+b*l+x*p+w*g,t[6]=_*o+b*u+x*d+w*y,t[7]=_*a+b*c+x*f+w*v,_=r[8],b=r[9],x=r[10],w=r[11],t[8]=_*i+b*s+x*h+w*m,t[9]=_*n+b*l+x*p+w*g,t[10]=_*o+b*u+x*d+w*y,t[11]=_*a+b*c+x*f+w*v,_=r[12],b=r[13],x=r[14],w=r[15],t[12]=_*i+b*s+x*h+w*m,t[13]=_*n+b*l+x*p+w*g,t[14]=_*o+b*u+x*d+w*y,t[15]=_*a+b*c+x*f+w*v,t}function l(t,e,r){var i,n,o,a,s,l,u,c,h,p,d,f,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],d=e[10],f=e[11],t[0]=i,t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=p,t[10]=d,t[11]=f,t[12]=i*m+s*g+h*y+e[12],t[13]=n*m+l*g+p*y+e[13],t[14]=o*m+u*g+d*y+e[14],t[15]=a*m+c*g+f*y+e[15]),t}function u(t,e,r){var i=r[0],n=r[1],o=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function c(t,e,r,n){var o,a,s,l,u,c,h,p,d,f,m,g,y,v,_,b,x,w,A,E,T,S,P,I,M=n[0],C=n[1],k=n[2],L=Math.hypot(M,C,k);return L<i.p8?null:(M*=L=1/L,C*=L,k*=L,o=Math.sin(r),s=1-(a=Math.cos(r)),l=e[0],u=e[1],c=e[2],h=e[3],p=e[4],d=e[5],f=e[6],m=e[7],g=e[8],y=e[9],v=e[10],_=e[11],b=M*M*s+a,x=C*M*s+k*o,w=k*M*s-C*o,A=M*C*s-k*o,E=C*C*s+a,T=k*C*s+M*o,S=M*k*s+C*o,P=C*k*s-M*o,I=k*k*s+a,t[0]=l*b+p*x+g*w,t[1]=u*b+d*x+y*w,t[2]=c*b+f*x+v*w,t[3]=h*b+m*x+_*w,t[4]=l*A+p*E+g*T,t[5]=u*A+d*E+y*T,t[6]=c*A+f*E+v*T,t[7]=h*A+m*E+_*T,t[8]=l*S+p*P+g*I,t[9]=u*S+d*P+y*I,t[10]=c*S+f*P+v*I,t[11]=h*S+m*P+_*I,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function h(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],p=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]=o*n+u*i,t[5]=a*n+c*i,t[6]=s*n+h*i,t[7]=l*n+p*i,t[8]=u*n-o*i,t[9]=c*n-a*i,t[10]=h*n-s*i,t[11]=p*n-l*i,t}function p(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[0],a=e[1],s=e[2],l=e[3],u=e[8],c=e[9],h=e[10],p=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]=o*n-u*i,t[1]=a*n-c*i,t[2]=s*n-h*i,t[3]=l*n-p*i,t[8]=o*i+u*n,t[9]=a*i+c*n,t[10]=s*i+h*n,t[11]=l*i+p*n,t}function d(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[0],a=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],p=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]=o*n+u*i,t[1]=a*n+c*i,t[2]=s*n+h*i,t[3]=l*n+p*i,t[4]=u*n-o*i,t[5]=c*n-a*i,t[6]=h*n-s*i,t[7]=p*n-l*i,t}
21function f(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],a=r+r,s=i+i,l=n+n,u=r*a,c=i*a,h=i*s,p=n*a,d=n*s,f=n*l,m=o*a,g=o*s,y=o*l;return t[0]=1-h-f,t[1]=c+y,t[2]=p-g,t[3]=0,t[4]=c-y,t[5]=1-u-f,t[6]=d+m,t[7]=0,t[8]=p+g,t[9]=d-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function m(t,e,r,i,n,o,a){var s=1/(r-e),l=1/(n-i),u=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(n+i)*l,t[10]=(a+o)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*u,t[15]=0,t}var g=function(t,e,r,i,n){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,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!=n&&n!==1/0?(o=1/(i-n),t[10]=(n+i)*o,t[14]=2*n*i*o):(t[10]=-1,t[14]=-2*i),t};var y=function(t,e,r,i,n,o,a){var s=1/(e-r),l=1/(i-n),u=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(n+i)*l,t[14]=(a+o)*u,t[15]=1,t};function v(t,e,r,n){var o,a,s,l,u,c,h,p,d,f,m=e[0],g=e[1],y=e[2],v=n[0],_=n[1],b=n[2],x=r[0],w=r[1],A=r[2];return Math.abs(m-x)<i.p8&&Math.abs(g-w)<i.p8&&Math.abs(y-A)<i.p8?function(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}(t):(h=m-x,p=g-w,d=y-A,o=_*(d*=f=1/Math.hypot(h,p,d))-b*(p*=f),a=b*(h*=f)-v*d,s=v*p-_*h,(f=Math.hypot(o,a,s))?(o*=f=1/f,a*=f,s*=f):(o=0,a=0,s=0),l=p*s-d*a,u=d*o-h*s,c=h*a-p*o,(f=Math.hypot(l,u,c))?(l*=f=1/f,u*=f,c*=f):(l=0,u=0,c=0),t[0]=o,t[1]=l,t[2]=h,t[3]=0,t[4]=a,t[5]=u,t[6]=p,t[7]=0,t[8]=s,t[9]=c,t[10]=d,t[11]=0,t[12]=-(o*m+a*g+s*y),t[13]=-(l*m+u*g+c*y),t[14]=-(h*m+p*g+d*y),t[15]=1,t)}function _(t,e){var r=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],p=t[9],d=t[10],f=t[11],m=t[12],g=t[13],y=t[14],v=t[15],_=e[0],b=e[1],x=e[2],w=e[3],A=e[4],E=e[5],T=e[6],S=e[7],P=e[8],I=e[9],M=e[10],C=e[11],k=e[12],L=e[13],z=e[14],R=e[15];return Math.abs(r-_)<=i.p8*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(n-b)<=i.p8*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(o-x)<=i.p8*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-w)<=i.p8*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-A)<=i.p8*Math.max(1,Math.abs(s),Math.abs(A))&&Math.abs(l-E)<=i.p8*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(u-T)<=i.p8*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(c-S)<=i.p8*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(h-P)<=i.p8*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(p-I)<=i.p8*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(d-M)<=i.p8*Math.max(1,Math.abs(d),Math.abs(M))&&Math.abs(f-C)<=i.p8*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(m-k)<=i.p8*Math.max(1,Math.abs(m),Math.abs(k))&&Math.abs(g-L)<=i.p8*Math.max(1,Math.abs(g),Math.abs(L))&&Math.abs(y-z)<=i.p8*Math.max(1,Math.abs(y),Math.abs(z))&&Math.abs(v-R)<=i.p8*Math.max(1,Math.abs(v),Math.abs(R))}},92700:(t,e,r)=>{"use strict";function i(t,e){if(t===e)return!0;if(Array.isArray(t)){const r=t.length;if(!e||e.length!==r)return!1;for(let i=0;i<r;i++)if(t[i]!==e[i])return!1;return!0}return!1}function n(t){let e,r={};return n=>{for(const o in n)if(!i(n[o],r[o])){e=t(n),r=n;break}return e}}r.d(e,{A:()=>n})},93092:(t,e,r)=>{"use strict";r.d(e,{A:()=>v});var i=r(47298),n=r(55490),o=r(44504);class a extends i.A{toString(){let t="[";if(o.$W.printRowMajor){t+="row-major:";for(let e=0;e<this.RANK;++e)for(let r=0;r<this.RANK;++r)t+=" ".concat(this[r*this.RANK+e])}else{t+="column-major:";for(let e=0;e<this.ELEMENTS;++e)t+=" ".concat(this[e])}return t+="]",t}getElementIndex(t,e){return e*this.RANK+t}getElement(t,e){return this[e*this.RANK+t]}setElement(t,e,r){return this[e*this.RANK+t]=(0,n.ws)(r),this}getColumn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0);const r=t*this.RANK;for(let t=0;t<this.RANK;++t)e[t]=this[r+t];return e}setColumn(t,e){const r=t*this.RANK;for(let t=0;t<this.RANK;++t)this[r+t]=e[t];return this}}var s,l=r(9444),u=r(91925),c=r(36471),h=r(46752),p=r(70549);!function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"}(s||(s={}));const d=45*Math.PI/180,f=1,m=.1,g=500,y=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class v extends a{static get IDENTITY(){return function(){b||(b=new v,Object.freeze(b));return b}()}static get ZERO(){return function(){_||(_=new v([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(_));return _}()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return s}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5
21]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,e,r,i,n,o,a,s,l,u,c,h,p,d,f,m){return this[0]=t,this[1]=e,this[2]=r,this[3]=i,this[4]=n,this[5]=o,this[6]=a,this[7]=s,this[8]=l,this[9]=u,this[10]=c,this[11]=h,this[12]=p,this[13]=d,this[14]=f,this[15]=m,this.check()}setRowMajor(t,e,r,i,n,o,a,s,l,u,c,h,p,d,f,m){return this[0]=t,this[1]=n,this[2]=l,this[3]=p,this[4]=e,this[5]=o,this[6]=u,this[7]=d,this[8]=r,this[9]=a,this[10]=c,this[11]=f,this[12]=i,this[13]=s,this[14]=h,this[15]=m,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(y)}fromObject(t){return this.check()}fromQuaternion(t){return u.I0(this,t),this.check()}frustum(t){const{left:e,right:r,bottom:i,top:n,near:o=m,far:a=g}=t;return a===1/0?function(t,e,r,i,n,o){const a=2*o/(r-e),s=2*o/(n-i),l=(r+e)/(r-e),u=(n+i)/(n-i),c=-1,h=-1,p=-2*o;t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=l,t[9]=u,t[10]=c,t[11]=h,t[12]=0,t[13]=0,t[14]=p,t[15]=0}(this,e,r,i,n,o):u.$h(this,e,r,i,n,o,a),this.check()}lookAt(t){const{eye:e,center:r=[0,0,0],up:i=[0,1,0]}=t;return u.t5(this,e,r,i),this.check()}ortho(t){const{left:e,right:r,bottom:i,top:n,near:o=m,far:a=g}=t;return u.v3(this,e,r,i,n,o,a),this.check()}orthographic(t){const{fovy:e=d,aspect:r=f,focalDistance:i=1,near:n=m,far:o=g}=t;x(e);const a=e/2,s=i*Math.tan(a),l=s*r;return this.ortho({left:-l,right:l,bottom:-s,top:s,near:n,far:o})}perspective(t){const{fovy:e=45*Math.PI/180,aspect:r=1,near:i=.1,far:n=500}=t;return x(e),u.fN(this,e,r,i,n),this.check()}determinant(){return u.a4(this)}getScale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const r=this.getScale(e),i=1/r[0],n=1/r[1],o=1/r[2];return t[0]=this[0]*i,t[1]=this[1]*n,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*n,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*n,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const r=this.getScale(e),i=1/r[0],n=1/r[1],o=1/r[2];return t[0]=this[0]*i,t[1]=this[1]*n,t[2]=this[2]*o,t[3]=this[4]*i,t[4]=this[5]*n,t[5]=this[6]*o,t[6]=this[8]*i,t[7]=this[9]*n,t[8]=this[10]*o,t}transpose(){return u.mg(this,this),this.check()}invert(){return u.B8(this,this),this.check()}multiplyLeft(t){return u.lw(this,t,this),this.check()}multiplyRight(t){return u.lw(this,this,t),this.check()}rotateX(t){return u.eL(this,this,t),this.check()}rotateY(t){return u.Z8(this,this,t),this.check()}rotateZ(t){return u.Qr(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,e){return u.e$(this,this,t,e),this.check()}scale(t){return u.hs(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return u.Tl(this,this,t),this.check()}transform(t,e){return 4===t.length?(e=p.Z0(e||[-0,-0,-0,-0],t,this),(0,n.qk)(e,4),e):this.transformAsPoint(t,e)}transformAsPoint(t,e){const{length:r}=t;let i;switch(r){case 2:i=c.Z0(e||[-0,-0],t,this);break;case 3:i=h.Z0(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,n.qk)(i,t.length),i}transformAsVector(t,e){let r;switch(t.length){case 2:r=(0,l.B$)(e||[-0,-0],t,this);break;case 3:r=(0,l.cL)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,n.qk)(r,t.length),r}transformPoint(t,e){return this.transformAsPoint(t,e)}transformVector(t,e){return this.transformAsPoint(t,e)}transformDirection(t,e){return this.transformAsVector(t,e)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,e,r){return this.identity().translate([t,e,r])}}let _,b;function x(t){if(t>2*Math.PI)throw Error("expected radians")}},93450:(t,e,r)=>{"use strict";r.d(e,{A:()=>g});
vendor: 5,460 bytes, line 21
21var i=r(67811),n=r(62022),o=r(1764),a=r(93092),s=r(44504),l=r(86926),u=r(91925),c=r(99932),h=r(61028);const p=Math.PI/180,d=(0,o.$M)(),f=[0,0,0],m={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};class g{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.A)(this,"id",void 0),(0,i.A)(this,"x",void 0),(0,i.A)(this,"y",void 0),(0,i.A)(this,"width",void 0),(0,i.A)(this,"height",void 0),(0,i.A)(this,"isGeospatial",void 0),(0,i.A)(this,"zoom",void 0),(0,i.A)(this,"focalDistance",void 0),(0,i.A)(this,"position",void 0),(0,i.A)(this,"modelMatrix",void 0),(0,i.A)(this,"distanceScales",void 0),(0,i.A)(this,"scale",void 0),(0,i.A)(this,"center",void 0),(0,i.A)(this,"cameraPosition",void 0),(0,i.A)(this,"projectionMatrix",void 0),(0,i.A)(this,"viewMatrix",void 0),(0,i.A)(this,"viewMatrixUncentered",void 0),(0,i.A)(this,"viewMatrixInverse",void 0),(0,i.A)(this,"viewProjectionMatrix",void 0),(0,i.A)(this,"pixelProjectionMatrix",void 0),(0,i.A)(this,"pixelUnprojectionMatrix",void 0),(0,i.A)(this,"resolution",void 0),(0,i.A)(this,"_frustumPlanes",{}),this.id=t.id||this.constructor.displayName||"viewport",this.x=t.x||0,this.y=t.y||0,this.width=t.width||1,this.height=t.height||1,this.zoom=t.zoom||0,this.distanceScales=t.distanceScales||m,this.focalDistance=t.focalDistance||1,this.position=t.position||f,this.modelMatrix=t.modelMatrix||null;const{longitude:e,latitude:r}=t;this.isGeospatial=Number.isFinite(r)&&Number.isFinite(e),this._initProps(t),this._initMatrices(t),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?h.Kx.WEB_MERCATOR:h.Kx.WEB_MERCATOR_AUTO_OFFSET:h.Kx.IDENTITY}equals(t){return t instanceof g&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&(0,s.aI)(t.projectionMatrix,this.projectionMatrix)&&(0,s.aI)(t.viewMatrix,this.viewMatrix))}project(t){let{topLeft:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=this.projectPosition(t),i=(0,c.VJ)(r,this.pixelProjectionMatrix),[n,o]=i,a=e?o:this.height-o;return 2===t.length?[n,a]:[n,a,i[2]]}unproject(t){let{topLeft:e=!0,targetZ:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[i,n,o]=t,a=e?n:this.height-n,s=r&&r*this.distanceScales.unitsPerMeter[2],l=(0,c.xJ)([i,a,o],this.pixelUnprojectionMatrix,s),[u,h,p]=this.unprojectPosition(l);return Number.isFinite(o)?[u,h,p]:Number.isFinite(r)?[u,h,r]:[u,h]}projectPosition(t){const[e,r]=this.projectFlat(t);return[e,r,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,r]=this.unprojectFlat(t);return[e,r,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){if(this.isGeospatial){const e=(0,c.Gw)(t);return e[1]=(0,s.qE)(e[1],-318,830),e}return t}unprojectFlat(t){return this.isGeospatial?(0,c.iV)(t):t}getBounds(){const t={targetZ:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).z||0},e=this.unproject([0,0],t),r=this.unproject([this.width,0],t),i=this.unproject([0,this.height],t),n=this.unproject([this.width,this.height],t);return[Math.min(e[0],r[0],i[0],n[0]),Math.min(e[1],r[1],i[1],n[1]),Math.max(e[0],r[0],i[0],n[0]),Math.max(e[1],r[1],i[1],n[1])]}getDistanceScales(t){return t?(0,c.nI)({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel(t){let{x:e,y:r,width:i=1,height:n=1}=t;return e<this.x+this.width&&this.x<e+i&&r<this.y+this.height&&this.y<r+n}getFrustumPlanes(){return this._frustumPlanes.near||Object.assign(this._frustumPlanes,(0,o.on)(this.viewProjectionMatrix)),this._frustumPlanes}panByPosition(t,e){return null}_initProps(t){const e=t.longitude,r=t.latitude;this.isGeospatial&&(Number.isFinite(t.zoom)||(this.zoom=(0,c.fO)({latitude:r})+Math.log2(this.focalDistance)),this.distanceScales=t.distanceScales||(0,c.nI)({latitude:r,longitude:e}));const i=Math.pow(2,this.zoom);this.scale=i;const{position:n,modelMatrix:o}=t;let s=f;if(n&&(s=o?new a.A(o).transformAsVector(n,[]):n),this.isGeospatial){const t=this.projectPosition([e,r,0]);this.center=new l.A(s).scale(this.distanceScales.unitsPerMeter).add(t)}else this.center=this.projectPosition(s)}_initMatrices(t){const{viewMatrix:e=d,projectionMatrix:r=null,orthographic:i=!1,fovyRadians:c,fovy:h=75,near:f=.1,far:m=1e3,padding:g=null,focalDistance:y=1}=t;this.viewMatrixUncentered=e,this.viewMatrix=(new a.A).multiplyRight(e).translate(new l.A(this.center).negate()),this.projectionMatrix=r||function(t){let{width:e,height:r,orthographic:i,fovyRadians:n,focalDistance:o,padding:l,near:u,far:c}=t;const h=e/r,p=i?(new a.A).orthographic({fovy:n,aspect:h,focalDistance:o,near:u,far:c}):(new a.A).perspective({fovy:n,aspect:h,near:u,far:c});if(l){const{left:t=0,right:i=0,top:n=0,bottom:o=0}=l,a=(0,s.qE)((t+e-i)/2,0,e)-e/2,u=(0,s.qE)((n+r-o)/2,0,r)-r/2;p[8]-=2*a/e,p[9]+=2*u/r}return p}({width:this.width,height:this.height,orthographic:i,fovyRadians:c||h*p,focalDistance:y,padding:g,near:f,far:m});const v=(0,o.$M)();u.lw(v,v,this.projectionMatrix),u.lw(v,v,this.viewMatrix),this.viewProjectionMatrix=v,this.viewMatrixInverse=u.B8([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=(0,o.
21Vl)(this.viewMatrixInverse);const _=(0,o.$M)(),b=(0,o.$M)();u.hs(_,_,[this.width/2,-this.height/2,1]),u.Tl(_,_,[1,-1,0]),u.lw(b,_,this.viewProjectionMatrix),this.pixelProjectionMatrix=b,this.pixelUnprojectionMatrix=u.B8((0,o.$M)(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||n.A.warn("Pixel project matrix not invertible")()}}(0,i.A)(g,"displayName","Viewport")},94755:(t,e,r)=>{"use strict";r.d(e,{A:()=>d});var i=r(56706),n=r(32970),o=r(96424),a=r(7148),s=r(44777),l=r(58713),u=r(87484),c=r(88161),h=r(57971);const p="Multiple render targets not supported";class d extends n.A{get[Symbol.toStringTag](){return"Framebuffer"}static isSupported(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{colorBufferFloat:r,colorBufferHalfFloat:i}=e;let n=!0;return r&&(n=Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("WEBGL_color_buffer_float")||t.getExtension("OES_texture_float"))),i&&(n=n&&Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("EXT_color_buffer_half_float"))),n}static getDefaultFramebuffer(t){return t.luma=t.luma||{},t.luma.defaultFramebuffer=t.luma.defaultFramebuffer||new d(t,{id:"default-framebuffer",handle:null,attachments:{}}),t.luma.defaultFramebuffer}get MAX_COLOR_ATTACHMENTS(){const t=(0,i.Dz)(this.gl);return t.getParameter(t.MAX_COLOR_ATTACHMENTS)}get MAX_DRAW_BUFFERS(){const t=(0,i.Dz)(this.gl);return t.getParameter(t.MAX_DRAW_BUFFERS)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.width=null,this.height=null,this.attachments={},this.readBuffer=36064,this.drawBuffers=[36064],this.ownResources=[],this.initialize(e),Object.seal(this)}get color(){return this.attachments[36064]||null}get texture(){return this.attachments[36064]||null}get depth(){return this.attachments[36096]||this.attachments[33306]||null}get stencil(){return this.attachments[36128]||this.attachments[33306]||null}initialize(t){let{width:e=1,height:r=1,attachments:i=null,color:n=!0,depth:o=!0,stencil:a=!1,check:s=!0,readBuffer:l,drawBuffers:u}=t;if((0,h.v)(e>=0&&r>=0,"Width and height need to be integers"),this.width=e,this.height=r,i)for(const t in i){const n=i[t];(Array.isArray(n)?n[0]:n).resize({width:e,height:r})}else i=this._createDefaultAttachments(n,o,a,e,r);this.update({clearAttachments:!0,attachments:i,readBuffer:l,drawBuffers:u}),i&&s&&this.checkStatus()}delete(){for(const t of this.ownResources)t.delete();return super.delete(),this}update(t){let{attachments:e={},readBuffer:r,drawBuffers:i,clearAttachments:n=!1,resizeAttachments:o=!0}=t;this.attach(e,{clearAttachments:n,resizeAttachments:o});const{gl:a}=this,s=a.bindFramebuffer(36160,this.handle);return r&&this._setReadBuffer(r),i&&this._setDrawBuffers(i),a.bindFramebuffer(36160,s||null),this}resize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{width:e,height:r}=t;if(null===this.handle)return(0,h.v)(void 0===e&&void 0===r),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===e&&(e=this.gl.drawingBufferWidth),void 0===r&&(r=this.gl.drawingBufferHeight),e!==this.width&&r!==this.height&&i.Rm.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(e,"x").concat(r))();for(const t in this.attachments)this.attachments[t].resize({width:e,height:r});return this.width=e,this.height=r,this}attach(t){let{clearAttachments:e=!1,resizeAttachments:r=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i={};e&&Object.keys(this.attachments).forEach((t=>{i[t]=null})),Object.assign(i,t);const n=this.gl.bindFramebuffer(36160,this.handle);for(const t in i){(0,h.v)(void 0!==t,"Misspelled framebuffer binding point?");const e=Number(t),n=i[e];let o=n;if(o)if(o instanceof a.A)this._attachRenderbuffer({attachment:e,renderbuffer:o});else if(Array.isArray(n)){const[t,r=0,i=0]=n;o=t,this._attachTexture({attachment:e,texture:t,layer:r,level:i})}else this._attachTexture({attachment:e,texture:o,layer:0,level:0});else this._unattach(e);r&&o&&o.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,n||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter((t=>
21!this.attachments[t])).forEach((t=>{delete this.attachments[t]}))}checkStatus(){const{gl:t}=this,e=this.getStatus();if(36053!==e)throw new Error(function(t){return(d.STATUS||{})[t]||"Framebuffer error ".concat(t)}(e));return this}getStatus(){const{gl:t}=this,e=t.bindFramebuffer(36160,this.handle),r=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),r}clear(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{color:e,depth:r,stencil:i,drawBuffers:n=[]}=t,o=this.gl.bindFramebuffer(36160,this.handle);return(e||r||i)&&(0,s.I)(this.gl,{color:e,depth:r,stencil:i}),n.forEach(((t,e)=>{(0,s.i)(this.gl,{drawBuffer:e,value:t})})),this.gl.bindFramebuffer(36160,o||null),this}readPixels(){return i.Rm.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(){return i.Rm.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(){return i.Rm.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(){return i.Rm.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(){return i.Rm.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(){return i.Rm.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate(t){let{attachments:e=[],x:r=0,y:n=0,width:o,height:a}=t;const s=(0,i.Dz)(this.gl),l=s.bindFramebuffer(36008,this.handle);return 0===r&&0===n&&void 0===o&&void 0===a?s.invalidateFramebuffer(36008,e):s.invalidateFramebuffer(36008,e,r,n,o,a),s.bindFramebuffer(36008,l),this}getAttachmentParameter(t,e,r){let i=this._getAttachmentParameterFallback(e);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,t,e),this.gl.bindFramebuffer(36160,null)),r&&i>1e3&&(i=(0,c.i7)(this.gl,i)),i}getAttachmentParameters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[];const i={};for(const n of r){i[e?(0,c.i7)(this.gl,n):n]=this.getAttachmentParameter(t,n,e)}return i}getParameters(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=Object.keys(this.attachments),r={};for(const i of e){const e=Number(i);r[t?(0,c.i7)(this.gl,e):e]=this.getAttachmentParameters(e,t)}return r}show(){return"undefined"!=typeof window&&window.open((0,l.Cj)(this),"luma-debug-texture"),this}log(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t>i.Rm.level||"undefined"==typeof window)return this;e=e||"Framebuffer ".concat(this.id);const r=(0,l.Cj)(this,{targetMaxHeight:100});return i.Rm.image({logLevel:t,message:e,image:r},e)(),this}bind(){let{target:t=36160}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.gl.bindFramebuffer(t,this.handle),this}unbind(){let{target:t=36160}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.gl.bindFramebuffer(t,null),this}_createDefaultAttachments(t,e,r,i,n){let s=null;return t&&(s=s||{},s[36064]=new o.A(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:i,height:n,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(s[36064])),e&&r?(s=s||{},s[33306]=new a.A(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:i,height:111}),this.ownResources.push(s[33306])):e?(s=s||{},s[36096]=new a.A(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:i,height:n}),this.ownResources.push(s[36096])):r&&(0,h.v)(!1),s}_unattach(t){const e=this.attachments[t];e&&(e instanceof a.A?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}_attachRenderbuffer(t){let{attachment:e=36064,renderbuffer:r}=t;const{gl:i}=this;i.framebufferRenderbuffer(36160,e,36161,r.handle),this.attachments[e]=r}_attachTexture(t){let{attachment:e=36064,texture:r,layer:n,level:o}=t;const{gl:a}=this;switch(a.bindTexture(r.target,r.handle),r.target){case 35866:case 32879:(0,i.Dz)(a).framebufferTextureLayer(36160,e,r.target,o,n);break;case 34067:const t=function(t){return t<34069?t+34069:t}(n);a.framebufferTexture2D(36160,e,t,r.handle,o);break;case 3553:a.framebufferTexture2D(36160,e,3553,r.handle,o);break;default:(0,h.v)(!1,"Illegal texture type")}a.bindTexture(r.target,null),this.attachments[e]=r}_setReadBuffer(t){const e=(0,i.NG)(this.gl);e?e.readBuffer(t):(0,h.v)(36064===t||1029===t,p),this.readBuffer=t}_setDrawBuffers(t){const{gl:e}=this,r=(0,i.Dz)(e);if(r)r.drawBuffers(t);else{const r=e.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(t):(0,h.v)(1===t.length&&(36064===t[0]||1029===t[0]),p)}this.drawBuffers=t}_getAttachmentParameterFallback(t){const e=(0,u.i)(this.gl);switch(t){case 36052:return e.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return e.WEBGL2?null:8;case 33297:return e.WEBGL2?null:5125;case 33296:return e.WEBGL2||e.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(t){return this.gl.bindFramebuffer(36160,t)}}
21d.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},96424:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var i=r(56706),n=r(18143),o=r(57971);let a="";function s(t,e){return(0,o.v)("string"==typeof t),t=a+t,new Promise(((r,i)=>{try{const n=new Image;n.onload=()=>r(n),n.onerror=()=>i(new Error("Could not load image ".concat(t,"."))),n.crossOrigin=e&&e.crossOrigin||"anonymous",n.src=t}catch(t){i(t)}}))}class l extends n.A{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(t,e){return n.A.isSupported(t,e)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.tj)(t),(e instanceof Promise||"string"==typeof e)&&(e={data:e}),"string"==typeof e.data&&(e=Object.assign({},e,{data:s(e.data)})),super(t,Object.assign({},e,{target:3553})),this.initialize(e),Object.seal(this)}}},98737:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var i=r(52697),n=r(57971),o=r(12958);const a={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},s={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}};class l{static getBytesPerElement(t){return(0,i.Xj)(t.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(t){(0,n.v)(t.size);return(0,i.Xj)(t.type||5126).BYTES_PER_ELEMENT*t.size}static resolve(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return new l(...[a,...e])}constructor(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e.forEach((t=>this._assign(t))),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return l.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return l.getBytesPerVertex(this)}_assign(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=(0,o.N)("Accessor",t,s),void 0!==t.type&&(this.type=t.type,5124!==t.type&&5125!==t.type||(this.integer=!0)),void 0!==t.size&&(this.size=t.size),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.stride&&(this.stride=t.stride),void 0!==t.normalized&&(this.normalized=t.normalized),void 0!==t.integer&&(this.integer=t.integer),void 0!==t.divisor&&(this.divisor=t.divisor),void 0!==t.buffer&&(this.buffer=t.buffer),void 0!==t.index&&("boolean"==typeof t.index?this.index=t.index?1:0:this.index=t.index),void 0!==t.instanced&&(this.divisor=t.instanced?1:0),void 0!==t.isInstanced&&(this.divisor=t.isInstanced?1:0),this}}},99932:(t,e,r)=>{"use strict";r.d(e,{Gw:()=>y,Jh:()=>E,Os:()=>T,VJ:()=>P,XM:()=>g,aH:()=>f,dT:()=>x,fO:()=>_,h0:()=>m,iV:()=>v,nI:()=>b,om:()=>A,rY:()=>w,wZ:()=>S,xJ:()=>I});var i=r(8842),n=r(91925),o=r(36471),a=r(46752),s=r(15706);const l=Math.PI,u=l/4,c=l/180,h=180/l,p=512,d=4003e4,f=85.051129,m=1.5;function g(t){return Math.pow(2,t)}function y(t){const[e,r]=t;(0,s.A)(Number.isFinite(e)),(0,s.A)(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");const i=r*c;return[p*(e*c+l)/(2*l),p*(l+Math.log(Math.tan(u+.5*i)))/(2*l)]}function v(t){const[e,r]=t,i=e/p*(2*l)-l,n=2*(Math.atan(Math.exp(r/p*(2*l)-l))-u);return[i*h,n*h]}function _(t){const{latitude:e}=t;(0,s.A)(Number.isFinite(e));const r=Math.cos(e*c);return function(t){return(0,i.p6)(t)}(d*r)-9}function b(t){const{latitude:e,longitude:r,highPrecision:i=!1}=t;(0,s.A)(Number.isFinite(e)&&Number.isFinite(r));const n=p,o=Math.cos(e*c),a=n/360,l=a/o,u=n/d/o,h={unitsPerMeter:[u,u,u],metersPerUnit:[1/u,1/u,1/u],unitsPerDegree:[a,l,u],degreesPerUnit:[1/a,1/l,1/u]};if(i){const t=c*Math.tan(e*c)/o,r=a*t/2,i=n/d*t,s=i/l*u;h.unitsPerDegree2=[0,r,i],h.unitsPerMeter2=[s,0,s]}return h}function x(t,e){const[r,i,n]=t,[o,a,s]=e,{unitsPerMeter:l,unitsPerMeter2:u}=b({longitude:r,latitude:i,highPrecision:!0}),c=y(t);c[0]+=o*(l[0]+u[0]*a),c[1]+=a*(l[1]+u[1]*a);const h=v(c),p=(n||0)+(s||0);return Number.isFinite(n)||Number.isFinite(s)?[h[0],h[1],p]:h}function w(t){const{height:e,pitch:r,bearing:o,altitude:s,scale:l,center:u}=t,h=(0,i.$M)();n.Tl(h,h,[0,0,-s]),n.eL(h,h,-r*c),n.Qr(h,h,o*c);const p=l/e;return n.hs(h,h,[p,p,p]),u&&n.Tl(h,h,a.ze([],u)),h}function A(t){const{width:e,height:r,altitude:n,pitch:o=0,offset:a,center:s,scale:l,nearZMultiplier:u=1,farZMultiplier:h=1}=t;let{fovy:p=T(m)}=t;void 0!==n&&(p=T(n));const d=p*c,f=o*c,g=S(p);let y=g;s&&(y+=s[2]*l/Math.cos(f)/r);const v=d*(.5+(a?a[1]:0)/r),_=Math.sin(v)*y/Math.sin((0,i.qE)(Math.PI/2-f-v,.01,Math.PI-.01)),b=Math.sin(f)*_+y,x=10*y;return{fov:d,aspect:e/r,focalDistance:g,near:u,far:Math.min(b*h,x)}}function E(t){const{fov:e,aspect:r,near:i,far:o}=A(t);return n.fN([],e,r,i,o)}function T(t){return 2*Math.atan(.5/t)*h}function S(t){return.5/Math.tan(.5*t*c)}function P(t,e){const[r,n,o=0]=t;return(0,s.A)(Number.isFinite(r)&&Number.isFinite(n)&&Number.isFinite(o)),(0,i._U)(e,[r,n,o,1])}function I(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const[n,a,l]=t;if((0,s.A)(Number.isFinite(n)&&Number.isFinite(a),"invalid pixel coordinate"),Number.isFinite(l)){return(0,i._U)(e,[n,a,l,1])}const u=(0,i._U)(e,[n,a,0,1]),c=(0,i._U)(e,[n,a,1,1]),h=u[2],p=c[2],d=h===p?0:((r||0)-h)/(p-h);return o.Cc([],u,c,d)}}}]); 22//# sourceMappingURL=https://sourcemaps.uberinternal.com/raw/web-eats-v2/client-11496-61f3f74e691493fc.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.