2 lines
No EOL
619 KiB
JavaScript
Vendored
2 lines
No EOL
619 KiB
JavaScript
Vendored
!function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},r.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=8)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){document.querySelector("select")&&("current-location"==t?document.querySelector('select [id="option-coords"]').selected=!0:document.querySelector('select [value="'+t+'"]').selected=!0)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=/POINT\((.*)\)/.exec(t),r=e[1].split(" ")[0];return{latitude:e[1].split(" ")[1],longitude:r}}},function(t,e){!function(r){"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define([],r):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).mapboxgl=r()}(function(){return function t(e,r,i){function n(a,s){if(!r[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){return n(e[a][1][t]||t)},c,c.exports,t,e,r,i)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<i.length;a++)n(i[a]);return n}({1:[function(t,e,r){function i(t){var e=0;if(t&&0<t.length){e+=Math.abs(n(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(n(t[r]))}return e}function n(t){var e,r,i,n,s,l,u=0,c=t.length;if(2<c){for(l=0;l<c;l++)l===c-2?(i=c-2,n=c-1,s=0):l===c-1?(i=c-1,n=0,s=1):(n=(i=l)+1,s=l+2),e=t[i],r=t[n],u+=(o(t[s][0])-o(e[0]))*Math.sin(o(r[1]));u=u*a.RADIUS*a.RADIUS/2}return u}function o(t){return t*Math.PI/180}var a=t("wgs84");e.exports.geometry=function t(e){var r,n=0;switch(e.type){case"Polygon":return i(e.coordinates);case"MultiPolygon":for(r=0;r<e.coordinates.length;r++)n+=i(e.coordinates[r]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(r=0;r<e.geometries.length;r++)n+=t(e.geometries[r]);return n}},e.exports.ring=n},{wgs84:37}],2:[function(t,e,r){var n;n=function(){"use strict";return(t=new Float32Array(3))[0]=0,t[1]=0,t[2]=0,function(){var t=new Float32Array(4);t[0]=0,t[1]=0,t[2]=0,t[3]=0}(),{vec3:{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}},vec4:{transformMat4:function(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}},mat2:{create:function(){var t=new Float32Array(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,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},scale:function(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=r[0],l=r[1];return t[0]=i*s,t[1]=n*s,t[2]=o*l,t[3]=a*l,t}},mat3:{create:function(){var t=new Float32Array(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,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}},mat4:{create:function(){var t=new Float32Array(16);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},identity: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},translate:function(t,e,r){var i,n,o,a,s,l,u,c,p,h,f,d,m=r[0],y=r[1],_=r[2];return e===t?(t[12]=e[0]*m+e[4]*y+e[8]*_+e[12],t[13]=e[1]*m+e[5]*y+e[9]*_+e[13],t[14]=e[2]*m+e[6]*y+e[10]*_+e[14],t[15]=e[3]*m+e[7]*y+e[11]*_+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],p=e[8],h=e[9],f=e[10],d=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]=p,t[9]=h,t[10]=f,t[11]=d,t[12]=i*m+s*y+p*_+e[12],t[13]=n*m+l*y+h*_+e[13],t[14]=o*m+u*y+f*_+e[14],t[15]=a*m+c*y+d*_+e[15]),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},multiply:function(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],p=e[8],h=e[9],f=e[10],d=e[11],m=e[12],y=e[13],_=e[14],g=e[15],v=r[0],x=r[1],b=r[2],w=r[3];return t[0]=v*i+x*s+b*p+w*m,t[1]=v*n+x*l+b*h+w*y,t[2]=v*o+x*u+b*f+w*_,t[3]=v*a+x*c+b*d+w*g,v=r[4],x=r[5],b=r[6],w=r[7],t[4]=v*i+x*s+b*p+w*m,t[5]=v*n+x*l+b*h+w*y,t[6]=v*o+x*u+b*f+w*_,t[7]=v*a+x*c+b*d+w*g,v=r[8],x=r[9],b=r[10],w=r[11],t[8]=v*i+x*s+b*p+w*m,t[9]=v*n+x*l+b*h+w*y,t[10]=v*o+x*u+b*f+w*_,t[11]=v*a+x*c+b*d+w*g,v=r[12],x=r[13],b=r[14],w=r[15],t[12]=v*i+x*s+b*p+w*m,t[13]=v*n+x*l+b*h+w*y,t[14]=v*o+x*u+b*f+w*_,t[15]=v*a+x*c+b*d+w*g,t},perspective:function(t,e,r,i,n){var o=1/Math.tan(e/2),a=1/(i-n);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(n+i)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*n*i*a,t[15]=0,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],p=e[10],h=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+p*i,t[7]=l*n+h*i,t[8]=u*n-o*i,t[9]=c*n-a*i,t[10]=p*n-s*i,t[11]=h*n-l*i,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],p=e[6],h=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+p*i,t[3]=l*n+h*i,t[4]=u*n-o*i,t[5]=c*n-a*i,t[6]=p*n-s*i,t[7]=h*n-l*i,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],p=e[9],h=e[10],f=e[11],d=e[12],m=e[13],y=e[14],_=e[15],g=r*s-i*a,v=r*l-n*a,x=r*u-o*a,b=i*l-n*s,w=i*u-o*s,S=n*u-o*l,A=c*m-p*d,T=c*y-h*d,z=c*_-f*d,E=p*y-h*m,k=p*_-f*m,C=h*_-f*y,I=g*C-v*k+x*E+b*z-w*T+S*A;return I?(I=1/I,t[0]=(s*C-l*k+u*E)*I,t[1]=(n*k-i*C-o*E)*I,t[2]=(m*S-y*w+_*b)*I,t[3]=(h*w-p*S-f*b)*I,t[4]=(l*z-a*C-u*T)*I,t[5]=(r*C-n*z+o*T)*I,t[6]=(y*x-d*S-_*v)*I,t[7]=(c*S-h*x+f*v)*I,t[8]=(a*k-s*z+u*A)*I,t[9]=(i*z-r*k-o*A)*I,t[10]=(d*w-m*x+_*g)*I,t[11]=(p*x-c*w-f*g)*I,t[12]=(s*T-a*E-l*A)*I,t[13]=(r*E-i*T+n*A)*I,t[14]=(m*v-d*b-y*g)*I,t[15]=(c*b-p*v+h*g)*I,t):null},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}}};var t},"object"==typeof r&&void 0!==e?e.exports=n():this.glMatrix=n()},{}],3:[function(t,e,r){"use strict";function i(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&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))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&&function(t){return void 0===n[t]&&(n[t]=function(t){var e=document.createElement("canvas"),r=Object.create(i.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}(t)),n[t]}(t&&t.failIfMajorPerformanceCaveat))}void 0!==e&&e.exports?e.exports=i:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=i);var n={};i.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],4:[function(t,e,r){"use strict";function i(t,e){this.x=t,this.y=e}(e.exports=i).prototype={clone:function(){return new i(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[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,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=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),o=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},i.convert=function(t){return t instanceof i?t:Array.isArray(t)?new i(t[0],t[1]):t}},{}],5:[function(t,e,r){var n;n=function(){function t(t,e,r){r=r||{},this.w=t||64,this.h=e||64,this.autoResize=!!r.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function e(t,e,r){this.x=0,this.y=t,this.w=this.free=e,this.h=r}return t.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var r,i,n,o,a=[],s=0;s<t.length;s++)if(r=t[s].w||t[s].width,i=t[s].h||t[s].height,n=t[s].id,r&&i){if(!(o=this.packOne(r,i,n)))continue;e.inPlace&&(t[s].x=o.x,t[s].y=o.y,t[s].id=o.id),a.push(o)}return this.shrink(),a},t.prototype.packOne=function(t,r,i){var n,o,a,s,l,u,c,p,h={freebin:-1,shelf:-1,waste:1/0},f=0;if("string"==typeof i||"number"==typeof i){if(n=this.getBin(i))return this.ref(n),n;"number"==typeof i&&(this.maxId=Math.max(i,this.maxId))}else i=++this.maxId;for(s=0;s<this.freebins.length;s++){if(r===(n=this.freebins[s]).maxh&&t===n.maxw)return this.allocFreebin(s,t,r,i);r>n.maxh||t>n.maxw||r<=n.maxh&&t<=n.maxw&&(a=n.maxw*n.maxh-t*r)<h.waste&&(h.waste=a,h.freebin=s)}for(s=0;s<this.shelves.length;s++)if(f+=(o=this.shelves[s]).h,!(t>o.free)){if(r===o.h)return this.allocShelf(s,t,r,i);r>o.h||r<o.h&&(a=(o.h-r)*t)<h.waste&&(h.freebin=-1,h.waste=a,h.shelf=s)}return-1!==h.freebin?this.allocFreebin(h.freebin,t,r,i):-1!==h.shelf?this.allocShelf(h.shelf,t,r,i):r<=this.h-f&&t<=this.w?(o=new e(f,this.w,r),this.allocShelf(this.shelves.push(o)-1,t,r,i)):this.autoResize?(l=u=this.h,((c=p=this.w)<=l||c<t)&&(p=2*Math.max(t,c)),(l<c||l<r)&&(u=2*Math.max(r,l)),this.resize(p,u),this.packOne(t,r,i)):null},t.prototype.allocFreebin=function(t,e,r,i){var n=this.freebins.splice(t,1)[0];return n.id=i,n.w=e,n.h=r,n.refcount=0,this.bins[i]=n,this.ref(n),n},t.prototype.allocShelf=function(t,e,r,i){var n=this.shelves[t].alloc(e,r,i);return this.bins[i]=n,this.ref(n),n},t.prototype.shrink=function(){if(0<this.shelves.length){for(var t=0,e=0,r=0;r<this.shelves.length;r++){var i=this.shelves[r];e+=i.h,t=Math.max(i.w-i.free,t)}this.resize(t,e)}},t.prototype.getBin=function(t){return this.bins[t]},t.prototype.ref=function(t){if(1==++t.refcount){var e=t.h;this.stats[e]=1+(0|this.stats[e])}return t.refcount},t.prototype.unref=function(t){return 0===t.refcount?0:(0==--t.refcount&&(this.stats[t.h]--,delete this.bins[t.id],this.freebins.push(t)),t.refcount)},t.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;r<this.shelves.length;r++)this.shelves[r].resize(t);return!0},e.prototype.alloc=function(t,e,r){if(t>this.free||e>this.h)return null;var i=this.x;return this.x+=t,this.free-=t,new function(t,e,r,i,n,o,a){this.id=t,this.x=e,this.y=r,this.w=i,this.h=n,this.maxw=o||i,this.maxh=a||n,this.refcount=0}(r,i,this.y,t,e,t,this.h)},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t},"object"==typeof r&&void 0!==e?e.exports=n():this.ShelfPack=n()},{}],6:[function(t,e,r){"use strict";function i(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*(0<=navigator.userAgent.indexOf("Gecko/")?1.2:1))}function n(t,e,r,i,n,a,s){for(var l=0;l<e;l++){for(var u=0;u<r;u++)i[u]=t[u*e+l];for(o(i,n,a,s,r),u=0;u<r;u++)t[u*e+l]=n[u]}for(u=0;u<r;u++){for(l=0;l<e;l++)i[l]=t[u*e+l];for(o(i,n,a,s,e),l=0;l<e;l++)t[u*e+l]=Math.sqrt(n[l])}}function o(t,e,r,i,n){i[r[0]=0]=-a,i[1]=+a;for(var o=1,s=0;o<n;o++){for(var l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);l<=i[s];)s--,l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);r[++s]=o,i[s]=l,i[s+1]=+a}for(s=o=0;o<n;o++){for(;i[s+1]<o;)s++;e[o]=(o-r[s])*(o-r[s])+t[r[s]]}}e.exports=i;var a=1e20;i.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 o=e.data[4*i+3]/255;this.gridOuter[i]=1===o?0:0===o?a:Math.pow(Math.max(0,.5-o),2),this.gridInner[i]=1===o?a:0===o?0:Math.pow(Math.max(0,o-.5),2)}for(n(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),n(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),i=0;i<this.size*this.size;i++){var s=this.gridOuter[i]-this.gridInner[i];r[i]=Math.max(0,Math.min(255,Math.round(255-255*(s/this.radius+this.cutoff))))}return r}},{}],7:[function(t,e,r){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}(e.exports=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((i=1)<n)return i;for(;r<i;){if(o=this.sampleCurveX(n),Math.abs(o-t)<e)return n;o<t?r=n:i=n,n=.5*(i-r)+r}return n},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],8:[function(t,e,r){e.exports.VectorTile=t("./lib/vectortile.js"),e.exports.VectorTileFeature=t("./lib/vectortilefeature.js"),e.exports.VectorTileLayer=t("./lib/vectortilelayer.js")},{"./lib/vectortile.js":9,"./lib/vectortilefeature.js":10,"./lib/vectortilelayer.js":11}],9:[function(t,e,r){"use strict";function i(t,e,r){if(3===t){var i=new n(r,r.readVarint()+r.pos);i.length&&(e[i.name]=i)}}var n=t("./vectortilelayer");e.exports=function(t,e){this.layers=t.readFields(i,{},e)}},{"./vectortilelayer":11}],10:[function(t,e,r){"use strict";function i(t,e,r,i,o){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=o,t.readFields(n,this,e)}function n(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 o(t){for(var e,r,i=0,n=0,o=t.length,a=o-1;n<o;a=n++)e=t[n],i+=((r=t[a]).x-e.x)*(e.y+r.y);return i}var a=t("@mapbox/point-geometry");(e.exports=i).types=["Unknown","Point","LineString","Polygon"],i.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,i=1,n=0,o=0,s=0,l=[];t.pos<r;){if(!n){var u=t.readVarint();i=7&u,n=u>>3}if(n--,1===i||2===i)o+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&l.push(e),l},i.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){var c=t.readVarint();r=7&c,i=c>>3}if(i--,1===r||2===r)(n+=t.readSVarint())<a&&(a=n),s<n&&(s=n),(o+=t.readSVarint())<l&&(l=o),u<o&&(u=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,l,s,u]},i.prototype.toGeoJSON=function(t,e,r){function n(t){for(var e=0;e<t.length;e++){var r=t[e],i=180-360*(r.y+c)/l;t[e]=[360*(r.x+u)/l-180,360/Math.PI*Math.atan(Math.exp(i*Math.PI/180))-90]}}var a,s,l=this.extent*Math.pow(2,r),u=this.extent*t,c=this.extent*e,p=this.loadGeometry(),h=i.types[this.type];switch(this.type){case 1:var f=[];for(a=0;a<p.length;a++)f[a]=p[a][0];n(p=f);break;case 2:for(a=0;a<p.length;a++)n(p[a]);break;case 3:for(p=function(t){var e=t.length;if(e<=1)return[t];for(var r,i,n=[],a=0;a<e;a++){var s=o(t[a]);0!==s&&(void 0===i&&(i=s<0),i===s<0?(r&&n.push(r),r=[t[a]]):r.push(t[a]))}return r&&n.push(r),n}(p),a=0;a<p.length;a++)for(s=0;s<p[a].length;s++)n(p[a][s])}1===p.length?p=p[0]:h="Multi"+h;var d={type:"Feature",geometry:{type:h,coordinates:p},properties:this.properties};return"id"in this&&(d.id=this.id),d}},{"@mapbox/point-geometry":4}],11:[function(t,e,r){"use strict";function i(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(n,this,e),this.length=this._features.length}function n(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))}var o=t("./vectortilefeature.js");(e.exports=i).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 o(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":10}],12:[function(t,e,r){(function(t){function e(t,e,i){var n=r(256*t,256*(e=Math.pow(2,i)-e-1),i),o=r(256*(t+1),256*(e+1),i);return n[0]+","+n[1]+","+o[0]+","+o[1]}function r(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]}t.getURL=function(t,r,i,n,o,a){return a=a||{},t+"?"+["bbox="+e(i,n,o),"format="+(a.format||"image/png"),"service="+(a.service||"WMS"),"version="+(a.version||"1.1.1"),"request="+(a.request||"GetMap"),"srs="+(a.srs||"EPSG:3857"),"width="+(a.width||256),"height="+(a.height||256),"layers="+r].join("&")},t.getTileBBox=e,t.getMercCoords=r,Object.defineProperty(t,"__esModule",{value:!0})})("object"==typeof r&&void 0!==e?r:this.WhooTS=this.WhooTS||{})},{}],13:[function(t,e,r){function i(t){return(t=Math.round(t))<0?0:255<t?255:t}function n(t){return i("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return function(t){return t<0?0:1<t?1:t}("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function a(t,e,r){return r<0?r+=1:1<r&&(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}var s={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]};try{r.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in s)return s[r].slice();if("#"===r[0])return 4===r.length?0<=(e=parseInt(r.substr(1),16))&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===r.length&&0<=(e=parseInt(r.substr(1),16))&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=r.indexOf("("),u=r.indexOf(")");if(-1!==l&&u+1===r.length){var c=r.substr(0,l),p=r.substr(l+1,u-(l+1)).split(","),h=1;switch(c){case"rgba":if(4!==p.length)return null;h=o(p.pop());case"rgb":return 3!==p.length?null:[n(p[0]),n(p[1]),n(p[2]),h];case"hsla":if(4!==p.length)return null;h=o(p.pop());case"hsl":if(3!==p.length)return null;var f=(parseFloat(p[0])%360+360)%360/360,d=o(p[1]),m=o(p[2]),y=m<=.5?m*(d+1):m+d-m*d,_=2*m-y;return[i(255*a(_,y,f+1/3)),i(255*a(_,y,f)),i(255*a(_,y,f-1/3)),h];default:return null}}return null}}catch(t){}},{}],14:[function(t,e,r){"use strict";function i(t,e,r){r=r||2;var i,s,l,u,c,f,m,y=e&&e.length,_=y?e[0]*r:t.length,g=n(t,0,_,r,!0),v=[];if(!g)return v;if(y&&(g=function(t,e,r,i){var a,s,c,f=[];for(a=0,s=e.length;a<s;a++)(c=n(t,e[a]*i,a<s-1?e[a+1]*i:t.length,i,!1))===c.next&&(c.steiner=!0),f.push(d(c));for(f.sort(p),a=0;a<f.length;a++)h(f[a],r),r=o(r,r.next);return r}(t,e,g,r)),t.length>80*r){i=l=t[0],s=u=t[1];for(var x=r;x<_;x+=r)(c=t[x])<i&&(i=c),(f=t[x+1])<s&&(s=f),l<c&&(l=c),u<f&&(u=f);m=0!==(m=Math.max(l-i,u-s))?1/m:0}return a(g,v,r,i,s,m),v}function n(t,e,r,i,n){var o,a;if(n===0<T(t,e,r,i))for(o=e;o<r;o+=i)a=w(o,t[o],t[o+1],a);else for(o=r-i;e<=o;o-=i)a=w(o,t[o],t[o+1],a);return a&&g(a,a.next)&&(S(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!g(i,i.next)&&0!==_(i.prev,i,i.next))i=i.next;else{if(S(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function a(t,e,r,i,n,p,h){if(t){!h&&p&&function(t,e,r,i){for(var n=t;null===n.z&&(n.z=f(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,(n=n.next)!==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,o=t=null,a=0;r;){for(a++,i=r,e=s=0;e<u&&(s++,i=i.nextZ);e++);for(l=u;0<s||0<l&&i;)0!==s&&(0===l||!i||r.z<=i.z)?(r=(n=r).nextZ,s--):(i=(n=i).nextZ,l--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(1<a)}(n)}(t,i,n,p);for(var d,m,y=t;t.prev!==t.next;)if(d=t.prev,m=t.next,p?l(t,i,n,p):s(t))e.push(d.i/r),e.push(t.i/r),e.push(m.i/r),S(t),t=m.next,y=m.next;else if((t=m)===y){h?1===h?a(t=u(t,e,r),e,r,i,n,p,2):2===h&&c(t,e,r,i,n,p):a(o(t),e,r,i,n,p,1);break}}}function s(t){var e=t.prev,r=t,i=t.next;if(0<=_(e,r,i))return!1;for(var n=t.next.next;n!==t.prev;){if(m(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&0<=_(n.prev,n,n.next))return!1;n=n.next}return!0}function l(t,e,r,i){var n=t.prev,o=t,a=t.next;if(0<=_(n,o,a))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=n.x>o.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,p=f(s,l,e,r,i),h=f(u,c,e,r,i),d=t.prevZ,y=t.nextZ;d&&d.z>=p&&y&&y.z<=h;){if(d!==t.prev&&d!==t.next&&m(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=_(d.prev,d,d.next))return!1;if(d=d.prevZ,y!==t.prev&&y!==t.next&&m(n.x,n.y,o.x,o.y,a.x,a.y,y.x,y.y)&&0<=_(y.prev,y,y.next))return!1;y=y.nextZ}for(;d&&d.z>=p;){if(d!==t.prev&&d!==t.next&&m(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=_(d.prev,d,d.next))return!1;d=d.prevZ}for(;y&&y.z<=h;){if(y!==t.prev&&y!==t.next&&m(n.x,n.y,o.x,o.y,a.x,a.y,y.x,y.y)&&0<=_(y.prev,y,y.next))return!1;y=y.nextZ}return!0}function u(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!g(n,o)&&v(n,i,i.next,o)&&x(n,o)&&x(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),S(i),S(i.next),i=t=o),i=i.next}while(i!==t);return i}function c(t,e,r,i,n,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&y(l,u)){var c=b(l,u);return l=o(l,l.next),c=o(c,c.next),a(l,e,r,i,n,s),void a(c,e,r,i,n,s)}u=u.next}l=l.next}while(l!==t)}function p(t,e){return t.x-e.x}function h(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&&a<s){if((a=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.prev;var l,u=r,c=r.x,p=r.y,h=1/0;for(i=r.next;i!==u;)n>=i.x&&i.x>=c&&n!==i.x&&m(o<p?n:a,o,c,p,o<p?a:n,o,i.x,i.y)&&((l=Math.abs(o-i.y)/(n-i.x))<h||l===h&&i.x>r.x)&&x(i,t)&&(r=i,h=l),i=i.next;return r}(t,e)){var r=b(e,t);o(r,r.next)}}function f(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 d(t){for(var e=t,r=t;e.x<r.x&&(r=e),(e=e.next)!==t;);return r}function m(t,e,r,i,n,o,a,s){return 0<=(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)}function y(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&&v(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&x(t,e)&&x(e,t)&&function(t,e){for(var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;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)!==t;);return i}(t,e)}function _(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function g(t,e){return t.x===e.x&&t.y===e.y}function v(t,e,r,i){return!!(g(t,e)&&g(r,i)||g(t,i)&&g(r,e))||0<_(t,e,r)!=0<_(t,e,i)&&0<_(r,i,t)!=0<_(r,i,e)}function x(t,e){return _(t.prev,t,t.next)<0?0<=_(t,e,t.next)&&0<=_(t,t.prev,e):_(t,e,t.prev)<0||_(t,t.next,e)<0}function b(t,e){var r=new A(t.i,t.x,t.y),i=new A(e.i,e.x,e.y),n=t.next,o=e.prev;return(t.next=e).prev=t,(r.next=n).prev=r,(i.next=r).prev=i,(o.next=i).prev=o,i}function w(t,e,r,i){var n=new A(t,e,r);return i?(n.next=i.next,(n.prev=i).next.prev=n,i.next=n):(n.prev=n).next=n,n}function S(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 A(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 T(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}e.exports=i,(e.exports.default=i).deviation=function(t,e,r,i){var n=e&&e.length,o=n?e[0]*r:t.length,a=Math.abs(T(t,0,o,r));if(n)for(var s=0,l=e.length;s<l;s++){var u=e[s]*r,c=s<l-1?e[s+1]*r:t.length;a-=Math.abs(T(t,u,c,r))}var p=0;for(s=0;s<i.length;s+=3){var h=i[s]*r,f=i[s+1]*r,d=i[s+2]*r;p+=Math.abs((t[h]-t[d])*(t[f+1]-t[h+1])-(t[h]-t[f])*(t[d+1]-t[h+1]))}return 0===a&&0===p?0:Math.abs((p-a)/a)},i.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]);0<n&&(i+=t[n-1].length,r.holes.push(i))}return r}},{}],15:[function(t,e,r){function i(t,e){return function(r){return t(r,e)}}function n(t,e){e=!!e,t[0]=o(t[0],e);for(var r=1;r<t.length;r++)t[r]=o(t[r],!e);return t}function o(t,e){return function(t){return 0<=a.ring(t)}(t)===e?t:t.reverse()}var a=t("@mapbox/geojson-area");e.exports=function t(e,r){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(i(t,r)),e;case"Feature":return e.geometry=t(e.geometry,r),e;case"Polygon":case"MultiPolygon":return function(t,e){return"Polygon"===t.type?t.coordinates=n(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(i(n,e))),t}(e,r);default:return e}}},{"@mapbox/geojson-area":1}],16:[function(t,e,r){"use strict";function i(t,e,r,i,n){for(var o=0;o<t.length;o+=3){var a=t[o+n];r<=a&&a<=i&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function n(t,e,r,i,n,o){for(var u=[],c=0===n?s:l,p=0;p<t.length-3;p+=3){var h=t[p],f=t[p+1],d=t[p+2],m=t[p+3],y=t[p+4],_=0===n?h:f,g=0===n?m:y,v=!1;_<r?r<=g&&c(u,h,f,m,y,r):i<_?g<=i&&c(u,h,f,m,y,i):a(u,h,f,d),g<r&&r<=_&&(c(u,h,f,m,y,r),v=!0),i<g&&_<=i&&(c(u,h,f,m,y,i),v=!0),!o&&v&&(u.size=t.size,e.push(u),u=[])}var x=t.length-3;h=t[x],f=t[x+1],d=t[x+2],(_=0===n?h:f)>=r&&_<=i&&a(u,h,f,d),x=u.length-3,o&&3<=x&&(u[x]!==u[0]||u[x+1]!==u[1])&&a(u,u[0],u[1],u[2]),u.length&&(u.size=t.size,e.push(u))}function o(t,e,r,i,o,a){for(var s=0;s<t.length;s++)n(t[s],e,r,i,o,a)}function a(t,e,r,i){t.push(e),t.push(r),t.push(i)}function s(t,e,r,i,n,o){t.push(o),t.push(r+(o-e)*(n-r)/(i-e)),t.push(1)}function l(t,e,r,i,n,o){t.push(e+(o-r)*(i-e)/(n-r)),t.push(o),t.push(1)}e.exports=function(t,e,r,a,s,l,c){if(a/=e,l>=(r/=e)&&c<=a)return t;if(a<l||c<r)return null;for(var p=[],h=0;h<t.length;h++){var f=t[h],d=f.geometry,m=f.type,y=0===s?f.minX:f.minY,_=0===s?f.maxX:f.maxY;if(r<=y&&_<=a)p.push(f);else if(!(a<y||_<r)){var g=[];if("Point"===m||"MultiPoint"===m)i(d,g,r,a,s);else if("LineString"===m)n(d,g,r,a,s,!1);else if("MultiLineString"===m)o(d,g,r,a,s,!1);else if("Polygon"===m)o(d,g,r,a,s,!0);else if("MultiPolygon"===m)for(var v=0;v<d.length;v++){var x=[];o(d[v],x,r,a,s,!0),x.length&&g.push(x)}g.length&&("LineString"!==m&&"MultiLineString"!==m||(1===g.length?(m="LineString",g=g[0]):m="MultiLineString"),"Point"!==m&&"MultiPoint"!==m||(m=3===g.length?"Point":"MultiPoint"),p.push(u(f.id,m,g,f.tags)))}}return p.length?p:null};var u=t("./feature")},{"./feature":18}],17:[function(t,e,r){"use strict";function i(t,e,r){if(e.geometry){var s=e.geometry.coordinates,l=e.geometry.type,u=r*r,p=[];if("Point"===l)n(s,p);else if("MultiPoint"===l)for(var h=0;h<s.length;h++)n(s[h],p);else if("LineString"===l)o(s,p,u,!1);else if("MultiLineString"===l)a(s,p,u,!1);else if("Polygon"===l)a(s,p,u,!0);else{if("MultiPolygon"!==l){if("GeometryCollection"===l){for(h=0;h<e.geometry.geometries.length;h++)i(t,{geometry:e.geometry.geometries[h],properties:e.properties},r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(h=0;h<s.length;h++){var f=[];a(s[h],f,u,!0),p.push(f)}}t.push(c(e.id,l,p,e.properties))}}function n(t,e){e.push(s(t[0])),e.push(l(t[1])),e.push(0)}function o(t,e,r,i){for(var n,o,a=0,c=0;c<t.length;c++){var p=s(t[c][0]),h=l(t[c][1]);e.push(p),e.push(h),e.push(0),0<c&&(a+=i?(n*h-p*o)/2:Math.sqrt(Math.pow(p-n,2)+Math.pow(h-o,2))),n=p,o=h}var f=e.length-3;e[2]=1,u(e,0,f,r),e[f+2]=1,e.size=Math.abs(a)}function a(t,e,r,i){for(var n=0;n<t.length;n++){var a=[];o(t[n],a,r,i),e.push(a)}}function s(t){return t/360+.5}function l(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:1<r?1:r}e.exports=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)i(r,t.features[n],e);else"Feature"===t.type?i(r,t,e):i(r,{geometry:t},e);return r};var u=t("./simplify"),c=t("./feature")},{"./feature":18,"./simplify":20}],18:[function(t,e,r){"use strict";function i(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])}e.exports=function(t,e,r,n){var o={id:t||null,type:e,geometry:r,tags:n,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)i(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<e.length;n++)i(t,e[n]);else if("MultiPolygon"===r)for(n=0;n<e.length;n++)for(var o=0;o<e[n].length;o++)i(t,e[n][o])}(o),o}},{}],19:[function(t,e,r){"use strict";function i(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||24<e.maxZoom)throw new Error("maxZoom should be in the 0-24 range");var i=1<<e.maxZoom,n=o(t,e.tolerance/(i*e.extent));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),(n=l(n,e.buffer/e.extent)).length&&this.splitTile(n,0,0,0),r&&(n.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 n(t,e,r){return 32*((1<<t)*r+e)+t}e.exports=function(t,e){return new i(t,e)};var o=t("./convert"),a=t("./transform"),s=t("./clip"),l=t("./wrap"),u=t("./tile");i.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,debug:0},i.prototype.splitTile=function(t,e,r,i,o,a,l){for(var c=[t,e,r,i],p=this.options,h=p.debug;c.length;){i=c.pop(),r=c.pop(),e=c.pop(),t=c.pop();var f=1<<e,d=n(e,r,i),m=this.tiles[d],y=e===p.maxZoom?0:p.tolerance/(f*p.extent);if(!m&&(1<h&&console.time("creation"),m=this.tiles[d]=u(t,f,r,i,y,e===p.maxZoom),this.tileCoords.push({z:e,x:r,y:i}),h)){1<h&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,i,m.numFeatures,m.numPoints,m.numSimplified),console.timeEnd("creation"));var _="z"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(m.source=t,o){if(e===p.maxZoom||e===o)continue;var g=1<<o-e;if(r!==Math.floor(a/g)||i!==Math.floor(l/g))continue}else if(e===p.indexMaxZoom||m.numPoints<=p.indexMaxPoints)continue;if(m.source=null,0!==t.length){1<h&&console.time("clipping");var v,x,b,w,S,A,T=.5*p.buffer/p.extent,z=.5-T,E=.5+T,k=1+T;v=x=b=w=null,S=s(t,f,r-T,r+E,0,m.minX,m.maxX),A=s(t,f,r+z,r+k,0,m.minX,m.maxX),t=null,S&&(v=s(S,f,i-T,i+E,1,m.minY,m.maxY),x=s(S,f,i+z,i+k,1,m.minY,m.maxY),S=null),A&&(b=s(A,f,i-T,i+E,1,m.minY,m.maxY),w=s(A,f,i+z,i+k,1,m.minY,m.maxY),A=null),1<h&&console.timeEnd("clipping"),c.push(v||[],e+1,2*r,2*i),c.push(x||[],e+1,2*r,2*i+1),c.push(b||[],e+1,2*r+1,2*i),c.push(w||[],e+1,2*r+1,2*i+1)}}},i.prototype.getTile=function(t,e,r){var i=this.options,o=i.extent,s=i.debug;if(t<0||24<t)return null;var l=1<<t,u=n(t,e=(e%l+l)%l,r);if(this.tiles[u])return a.tile(this.tiles[u],o);1<s&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var c,p=t,h=e,f=r;!c&&0<p;)p--,h=Math.floor(h/2),f=Math.floor(f/2),c=this.tiles[n(p,h,f)];return c&&c.source?(1<s&&console.log("found parent tile z%d-%d-%d",p,h,f),1<s&&console.time("drilling down"),this.splitTile(c.source,p,h,f,t,e,r),1<s&&console.timeEnd("drilling down"),this.tiles[u]?a.tile(this.tiles[u],o):null):null}},{"./clip":16,"./convert":17,"./tile":21,"./transform":22,"./wrap":23}],20:[function(t,e,r){"use strict";function i(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);1<l?(r=n,i=o):0<l&&(r+=a*l,i+=s*l)}return(a=t-r)*a+(s=e-i)*s}e.exports=function t(e,r,n,o){for(var a,s=o,l=e[r],u=e[r+1],c=e[n],p=e[n+1],h=r+3;h<n;h+=3){var f=i(e[h],e[h+1],l,u,c,p);s<f&&(a=h,s=f)}o<s&&(3<a-r&&t(e,r,a,o),e[a+2]=s,3<n-a&&t(e,a,n,o))}},{}],21:[function(t,e,r){"use strict";function i(t,e,r,i){var o=e.geometry,a=e.type,s=[];if("Point"===a||"MultiPoint"===a)for(var l=0;l<o.length;l+=3)s.push(o[l]),s.push(o[l+1]),t.numPoints++,t.numSimplified++;else if("LineString"===a)n(s,o,t,r,i,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(l=0;l<o.length;l++)n(s,o[l],t,r,i,"Polygon"===a,0===l);else if("MultiPolygon"===a)for(var u=0;u<o.length;u++){var c=o[u];for(l=0;l<c.length;l++)n(s,c[l],t,r,i,!0,0===l)}if(s.length){var p={geometry:s,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:e.tags||null};null!==e.id&&(p.id=e.id),t.features.push(p)}}function n(t,e,r,i,n,o,a){var s=i*i;if(!n&&e.size<(o?s:i))r.numPoints+=e.length/3;else{for(var l=[],u=0;u<e.length;u+=3)(n||e[u+2]>s)&&(r.numSimplified++,l.push(e[u]),l.push(e[u+1])),r.numPoints++;o&&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(0<r===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}}(l,a),t.push(l)}}e.exports=function(t,e,r,n,o,a){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},l=0;l<t.length;l++){s.numFeatures++,i(s,t[l],o,a);var u=t[l].minX,c=t[l].minY,p=t[l].maxX,h=t[l].maxY;u<s.minX&&(s.minX=u),c<s.minY&&(s.minY=c),p>s.maxX&&(s.maxX=p),h>s.maxY&&(s.maxY=h)}return s}},{}],22:[function(t,e,r){"use strict";function i(t,e,r,i,n,o){return[Math.round(r*(t*i-n)),Math.round(r*(e*i-o))]}r.tile=function(t,e){if(t.transformed)return t;var r,n,o,a=t.z2,s=t.x,l=t.y;for(r=0;r<t.features.length;r++){var u=t.features[r],c=u.geometry,p=u.type;if(u.geometry=[],1===p)for(n=0;n<c.length;n+=2)u.geometry.push(i(c[n],c[n+1],e,a,s,l));else for(n=0;n<c.length;n++){var h=[];for(o=0;o<c[n].length;o+=2)h.push(i(c[n][o],c[n][o+1],e,a,s,l));u.geometry.push(h)}}return t.transformed=!0,t},r.point=i},{}],23:[function(t,e,r){"use strict";function i(t,e){for(var r=[],i=0;i<t.length;i++){var o,s=t[i],l=s.type;if("Point"===l||"MultiPoint"===l||"LineString"===l)o=n(s.geometry,e);else if("MultiLineString"===l||"Polygon"===l){o=[];for(var u=0;u<s.geometry.length;u++)o.push(n(s.geometry[u],e))}else if("MultiPolygon"===l)for(o=[],u=0;u<s.geometry.length;u++){for(var c=[],p=0;p<s.geometry[u].length;p++)c.push(n(s.geometry[u][p],e));o.push(c)}r.push(a(s.id,l,o,s.tags))}return r}function n(t,e){var r=[];r.size=t.size;for(var i=0;i<t.length;i+=3)r.push(t[i]+e,t[i+1],t[i+2]);return r}var o=t("./clip"),a=t("./feature");e.exports=function(t,e){var r=t,n=o(t,1,-1-e,e,0,-1,2),a=o(t,1,1-e,2+e,0,-1,2);return(n||a)&&(r=o(t,1,-e,1+e,0,-1,2)||[],n&&(r=i(n,1).concat(r)),a&&(r=r.concat(i(a,-1)))),r}},{"./clip":16,"./feature":18}],24:[function(t,e,r){"use strict";function i(t,e,r){var i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var o=new Int32Array(this.arrayBuffer);t=o[0],e=o[1],r=o[2],this.d=e+2*r;for(var a=0;a<this.d*this.d;a++){var s=o[n+a],l=o[n+a+1];i.push(s===l?null:o.subarray(s,l))}var u=o[n+i.length],c=o[n+i.length+1];this.keys=o.subarray(u,c),this.bboxes=o.subarray(c),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var p=0;p<this.d*this.d;p++)i.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var h=r/e*t;this.min=-h,this.max=t+h}e.exports=i;var n=3;i.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)},i.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},i.prototype._insertCell=function(t,e,r,i,n,o){this.cells[n].push(o)},i.prototype.query=function(t,e,r,i){var n=this.min,o=this.max;if(t<=n&&e<=n&&o<=r&&o<=i)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(t,e,r,i,this._queryCell,a,{}),a},i.prototype._queryCell=function(t,e,r,i,n,o,a){var s=this.cells[n];if(null!==s)for(var l=this.keys,u=this.bboxes,c=0;c<s.length;c++){var p=s[c];if(void 0===a[p]){var h=4*p;t<=u[h+2]&&e<=u[h+3]&&r>=u[h+0]&&i>=u[h+1]?(a[p]=!0,o.push(l[p])):a[p]=!1}}},i.prototype._forEachCell=function(t,e,r,i,n,o,a){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(r),c=this._convertToCellCoord(i),p=s;p<=u;p++)for(var h=l;h<=c;h++){var f=this.d*h+p;if(n.call(this,t,e,r,i,f,o,a))return}},i.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},i.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=n+this.cells.length+1+1,r=0,i=0;i<this.cells.length;i++)r+=this.cells[i].length;var o=new Int32Array(e+r+this.keys.length+this.bboxes.length);o[0]=this.extent,o[1]=this.n,o[2]=this.padding;for(var a=e,s=0;s<t.length;s++){var l=t[s];o[n+s]=a,o.set(l,a),a+=l.length}return o[n+t.length]=a,o.set(this.keys,a),a+=this.keys.length,o[n+t.length+1]=a,o.set(this.bboxes,a),a+=this.bboxes.length,o.buffer}},{}],25:[function(t,e,r){r.read=function(t,e,r,i,n){var o,a,s=8*n-i-1,l=(1<<s)-1,u=l>>1,c=-7,p=r?n-1:0,h=r?-1:1,f=t[e+p];for(p+=h,o=f&(1<<-c)-1,f>>=-c,c+=s;0<c;o=256*o+t[e+p],p+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=i;0<c;a=256*a+t[e+p],p+=h,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,i),o-=u}return(f?-1:1)*a*Math.pow(2,o-i)},r.write=function(t,e,r,i,n,o){var a,s,l,u=8*o-n-1,c=(1<<u)-1,p=c>>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,d=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),2<=(e+=1<=a+p?h/l:h*Math.pow(2,1-p))*l&&(a++,l/=2),c<=a+p?(s=0,a=c):1<=a+p?(s=(e*l-1)*Math.pow(2,n),a+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,n),a=0));8<=n;t[r+f]=255&s,f+=d,s/=256,n-=8);for(a=a<<n|s,u+=n;0<u;t[r+f]=255&a,f+=d,a/=256,u-=8);t[r+f-d]|=128*m}},{}],26:[function(t,e,r){"use strict";function i(t,e,r,i,s){e=e||n,r=r||o,s=s||Array,this.nodeSize=i||64,this.points=t,this.ids=new s(t.length),this.coords=new s(2*t.length);for(var l=0;l<t.length;l++)this.ids[l]=l,this.coords[2*l]=e(t[l]),this.coords[2*l+1]=r(t[l]);a(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function n(t){return t[0]}function o(t){return t[1]}var a=t("./sort"),s=t("./range"),l=t("./within");e.exports=function(t,e,r,n,o){return new i(t,e,r,n,o)},i.prototype={range:function(t,e,r,i){return s(this.ids,this.coords,t,e,r,i,this.nodeSize)},within:function(t,e,r){return l(this.ids,this.coords,t,e,r,this.nodeSize)}}},{"./range":27,"./sort":28,"./within":29}],27:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,n,o,a){for(var s,l,u=[0,t.length-1,0],c=[];u.length;){var p=u.pop(),h=u.pop(),f=u.pop();if(h-f<=a)for(var d=f;d<=h;d++)s=e[2*d],l=e[2*d+1],r<=s&&s<=n&&i<=l&&l<=o&&c.push(t[d]);else{var m=Math.floor((f+h)/2);s=e[2*m],l=e[2*m+1],r<=s&&s<=n&&i<=l&&l<=o&&c.push(t[m]);var y=(p+1)%2;(0===p?r<=s:i<=l)&&(u.push(f),u.push(m-1),u.push(y)),(0===p?s<=n:l<=o)&&(u.push(m+1),u.push(h),u.push(y))}}return c}},{}],28:[function(t,e,r){"use strict";function i(t,e,r,i){n(t,r,i),n(e,2*r,2*i),n(e,2*r+1,2*i+1)}function n(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}e.exports=function t(e,r,n,o,a,s){if(!(a-o<=n)){var l=Math.floor((o+a)/2);(function t(e,r,n,o,a,s){for(;o<a;){if(600<a-o){var l=a-o+1,u=n-o+1,c=Math.log(l),p=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*p*(l-p)/l)*(u-l/2<0?-1:1);t(e,r,n,Math.max(o,Math.floor(n-u*p/l+h)),Math.min(a,Math.floor(n+(l-u)*p/l+h)),s)}var f=r[2*n+s],d=o,m=a;for(i(e,r,o,n),r[2*a+s]>f&&i(e,r,o,a);d<m;){for(i(e,r,d,m),d++,m--;r[2*d+s]<f;)d++;for(;r[2*m+s]>f;)m--}r[2*o+s]===f?i(e,r,o,m):i(e,r,++m,a),m<=n&&(o=m+1),n<=m&&(a=m-1)}})(e,r,l,o,a,s%2),t(e,r,n,o,l-1,s+1),t(e,r,n,l+1,a,s+1)}}},{}],29:[function(t,e,r){"use strict";function i(t,e,r,i){var n=t-r,o=e-i;return n*n+o*o}e.exports=function(t,e,r,n,o,a){for(var s=[0,t.length-1,0],l=[],u=o*o;s.length;){var c=s.pop(),p=s.pop(),h=s.pop();if(p-h<=a)for(var f=h;f<=p;f++)i(e[2*f],e[2*f+1],r,n)<=u&&l.push(t[f]);else{var d=Math.floor((h+p)/2),m=e[2*d],y=e[2*d+1];i(m,y,r,n)<=u&&l.push(t[d]);var _=(c+1)%2;(0===c?r-o<=m:n-o<=y)&&(s.push(h),s.push(d-1),s.push(_)),(0===c?m<=r+o:y<=n+o)&&(s.push(d+1),s.push(p),s.push(_))}}return l}},{}],30:[function(t,e,r){"use strict";function i(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}function n(t){return t.type===i.Bytes?t.readVarint()+t.pos:t.pos+1}function o(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function a(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;t<=n;n--)r.buf[n+i]=r.buf[n]}function s(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function l(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function u(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function c(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function f(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function m(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function y(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function _(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function g(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}e.exports=i;var v=t("ieee754");i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5,i.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=y(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=g(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=y(this.buf,this.pos)+4294967296*y(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=y(this.buf,this.pos)+4294967296*g(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=v.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=v.read(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,a=r.buf;if(i=(112&(n=a[r.pos++]))>>4,n<128)return o(t,i,e);if(i|=(127&(n=a[r.pos++]))<<3,n<128)return o(t,i,e);if(i|=(127&(n=a[r.pos++]))<<10,n<128)return o(t,i,e);if(i|=(127&(n=a[r.pos++]))<<17,n<128)return o(t,i,e);if(i|=(127&(n=a[r.pos++]))<<24,n<128)return o(t,i,e);if(i|=(1&(n=a[r.pos++]))<<31,n<128)return o(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=function(t,e,r){for(var i="",n=e;n<r;){var o,a,s,l=t[n],u=null,c=239<l?4:223<l?3:191<l?2:1;if(r<n+c)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?(o=t[n+1],a=t[n+2],128==(192&o)&&128==(192&a)&&((u=(15&l)<<12|(63&o)<<6|63&a)<=2047||55296<=u&&u<=57343)&&(u=null)):4===c&&(o=t[n+1],a=t[n+2],s=t[n+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||1114112<=u)&&(u=null)),null===u?(u=65533,c=1):65535<u&&(u-=65536,i+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),i+=String.fromCharCode(u),n+=c}return i}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var r=n(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){var e=n(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){var e=n(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){var e=n(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){var e=n(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){var e=n(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){var e=n(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){var e=n(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){var e=n(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===i.Varint)for(;127<this.buf[this.pos++];);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.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),_(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),_(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),_(this.buf,-1&t,this.pos),_(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),_(this.buf,-1&t,this.pos),_(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){268435455<(t=+t||0)||t<0?function(t,e){var r,i;if(0<=t?(r=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:i=i+1|(r=0)),0x10000000000000000<=t||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,t>>>=7,r.buf[r.pos]=127&t}(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|(127<t?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(127<t?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(127<t?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(55295<(i=e.charCodeAt(o))&&i<57344){if(!n){56319<i||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;128<=r&&a(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),v.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),v.write(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;128<=i&&a(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,i.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){this.writeMessage(t,p,e)},writePackedFloat:function(t,e){this.writeMessage(t,u,e)},writePackedDouble:function(t,e){this.writeMessage(t,c,e)},writePackedFixed32:function(t,e){this.writeMessage(t,h,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,f,e)},writePackedFixed64:function(t,e){this.writeMessage(t,d,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},{ieee754:25}],31:[function(t,e,r){"use strict";function i(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function n(t,e){return t<e?-1:e<t?1:0}e.exports=function t(e,r,o,a,s){for(o=o||0,a=a||e.length-1,s=s||n;o<a;){if(600<a-o){var l=a-o+1,u=r-o+1,c=Math.log(l),p=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*p*(l-p)/l)*(u-l/2<0?-1:1);t(e,r,Math.max(o,Math.floor(r-u*p/l+h)),Math.min(a,Math.floor(r+(l-u)*p/l+h)),s)}var f=e[r],d=o,m=a;for(i(e,o,r),0<s(e[a],f)&&i(e,o,a);d<m;){for(i(e,d,m),d++,m--;s(e[d],f)<0;)d++;for(;0<s(e[m],f);)m--}0===s(e[o],f)?i(e,o,m):i(e,++m,a),m<=r&&(o=m+1),r<=m&&(a=m-1)}}},{}],32:[function(t,e,r){"use strict";function i(t){this.options=c(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function n(t,e,r,i,n){return{x:t,y:e,zoom:1/0,id:i,properties:n,parentId:-1,numPoints:r}}function o(t,e){var r=t.geometry.coordinates;return{x:l(r[0]),y:u(r[1]),zoom:1/0,id:e,parentId:-1}}function a(t){return{type:"Feature",properties:s(t),geometry:{type:"Point",coordinates:[function(t){return 360*(t-.5)}(t.x),function(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}(t.y)]}}}function s(t){var e=t.numPoints,r=1e4<=e?Math.round(e/1e3)+"k":1e3<=e?Math.round(e/100)/10+"k":e;return c(c({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function l(t){return t/360+.5}function u(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:1<r?1:r}function c(t,e){for(var r in e)t[r]=e[r];return t}function p(t){return t.x}function h(t){return t.y}var f=t("kdbush");e.exports=function(t){return new i(t)},i.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r);var i=(this.points=t).map(o);e&&console.timeEnd(r);for(var n=this.options.maxZoom;n>=this.options.minZoom;n--){var a=+Date.now();this.trees[n+1]=f(i,p,h,this.options.nodeSize,Float32Array),i=this._cluster(i,n),e&&console.log("z%d: %d clusters in %dms",n,i.length,+Date.now()-a)}return this.trees[this.options.minZoom]=f(i,p,h,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],i=r.range(l(t[0]),u(t[3]),l(t[2]),u(t[1])),n=[],o=0;o<i.length;o++){var s=r.points[i[o]];n.push(s.numPoints?a(s):this.points[s.id])}return n},getChildren:function(t,e){for(var r=this.trees[e+1].points[t],i=this.options.radius/(this.options.extent*Math.pow(2,e)),n=this.trees[e+1].within(r.x,r.y,i),o=[],s=0;s<n.length;s++){var l=this.trees[e+1].points[n[s]];l.parentId===t&&o.push(l.numPoints?a(l):this.points[l.id])}return o},getLeaves:function(t,e,r,i){r=r||10,i=i||0;var n=[];return this._appendLeaves(n,t,e,r,i,0),n},getTile:function(t,e,r){var i=this.trees[this._limitZoom(t)],n=Math.pow(2,t),o=this.options.extent,a=this.options.radius/o,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},getClusterExpansionZoom:function(t,e){for(;e<this.options.maxZoom;){var r=this.getChildren(t,e);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},_appendLeaves:function(t,e,r,i,n,o){for(var a=this.getChildren(e,r),s=0;s<a.length;s++){var l=a[s].properties;if(l.cluster?o+l.point_count<=n?o+=l.point_count:o=this._appendLeaves(t,l.cluster_id,r+1,i,n,o):o<n?o++:t.push(a[s]),t.length===i)break}return o},_addTileFeatures:function(t,e,r,i,n,o){for(var a=0;a<t.length;a++){var l=e[t[a]];o.features.push({type:1,geometry:[[Math.round(this.options.extent*(l.x*n-r)),Math.round(this.options.extent*(l.y*n-i))]],tags:l.numPoints?s(l):this.points[l.id].properties})}},_limitZoom:function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},_cluster:function(t,e){for(var r=[],i=this.options.radius/(this.options.extent*Math.pow(2,e)),o=0;o<t.length;o++){var a=t[o];if(!(a.zoom<=e)){a.zoom=e;var s=this.trees[e+1],l=s.within(a.x,a.y,i),u=a.numPoints||1,c=a.x*u,p=a.y*u,h=null;this.options.reduce&&(h=this.options.initial(),this._accumulate(h,a));for(var f=0;f<l.length;f++){var d=s.points[l[f]];if(e<d.zoom){var m=d.numPoints||1;d.zoom=e,c+=d.x*m,p+=d.y*m,u+=m,d.parentId=o,this.options.reduce&&this._accumulate(h,d)}}1===u?r.push(a):(a.parentId=o,r.push(n(c/u,p/u,u,o,h)))}}return r},_accumulate:function(t,e){var r=e.numPoints?e.properties:this.options.map(this.points[e.id].properties);this.options.reduce(t,r)}}},{kdbush:26}],33:[function(t,e,r){"use strict";function i(t,e){if(!(this instanceof i))return new i(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||n,0<this.length)for(var r=this.length>>1;0<=r;r--)this._down(r)}function n(t,e){return t<e?-1:e<t?1:0}(e.exports=i).prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,0<this.length&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,r=this.compare,i=e[t];0<t;){var n=t-1>>1,o=e[n];if(0<=r(i,o))break;e[t]=o,t=n}e[t]=i},_down:function(t){for(var e=this.data,r=this.compare,i=this.length,n=i>>1,o=e[t];t<n;){var a=1+(t<<1),s=a+1,l=e[a];if(s<i&&r(e[s],l)<0&&(l=e[a=s]),0<=r(l,o))break;e[t]=l,t=a}e[t]=o}}},{}],34:[function(t,e,r){function i(t){var e=new p;return function(t,e){for(var r in t.layers)e.writeMessage(3,n,t.layers[r])}(t,e),e.finish()}function n(t,e){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var r,i={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)i.feature=t.feature(r),e.writeMessage(2,o,i);var n=i.keys;for(r=0;r<n.length;r++)e.writeStringField(3,n[r]);var a=i.values;for(r=0;r<a.length;r++)e.writeMessage(4,c,a[r])}function o(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,a,t),e.writeVarintField(3,r.type),e.writeMessage(4,u,r)}function a(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),l=i.length-1,o[s]=l),e.writeVarint(l);var u=r.properties[s],c=typeof u;"string"!==c&&"boolean"!==c&&"number"!==c&&(u=JSON.stringify(u));var p=c+":"+u,h=a[p];void 0===h&&(n.push(u),h=n.length-1,a[p]=h),e.writeVarint(h)}}function s(t,e){return(e<<3)+(7&t)}function l(t){return t<<1^t>>31}function u(t,e){for(var r=t.loadGeometry(),i=t.type,n=0,o=0,a=r.length,u=0;u<a;u++){var c=r[u],p=1;1===i&&(p=c.length),e.writeVarint(s(1,p));for(var h=0;h<c.length;h++){1===h&&1!==i&&e.writeVarint(s(2,c.length-1));var f=c[h].x-n,d=c[h].y-o;e.writeVarint(l(f)),e.writeVarint(l(d)),n+=f,o+=d}}}function c(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))}var p=t("pbf"),h=t("./lib/geojson_wrapper");e.exports=i,e.exports.fromVectorTileJs=i,e.exports.fromGeojsonVt=function(t){var e={};for(var r in t)e[r]=new h(t[r].features),e[r].name=r;return i({layers:e})},e.exports.GeoJSONWrapper=h},{"./lib/geojson_wrapper":35,pbf:30}],35:[function(t,e,r){"use strict";function i(t){this.features=t,this.length=t.length}function n(t){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=4096}var o=t("@mapbox/point-geometry"),a=t("@mapbox/vector-tile").VectorTileFeature;(e.exports=i).prototype.feature=function(t){return new n(this.features[t])},n.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],i=[],n=0;n<r.length;n++)i.push(new o(r[n][0],r[n][1]));this.geometry.push(i)}return this.geometry},n.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]},n.prototype.toGeoJSON=a.prototype.toGeoJSON},{"@mapbox/point-geometry":4,"@mapbox/vector-tile":8}],36:[function(t,e,r){var i=arguments[3],n=arguments[4],o=arguments[5],a=JSON.stringify;e.exports=function(t,e){for(var r,s=Object.keys(o),l=0,u=s.length;l<u;l++){var c=s[l],p=o[c].exports;if(p===t||p&&p.default===t){r=c;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var h={};for(l=0,u=s.length;l<u;l++)h[c=s[l]]=c;n[r]=["function(require,module,exports){"+t+"(self); }",h]}var f=Math.floor(Math.pow(16,8)*Math.random()).toString(16),d={};d[r]=r,n[f]=["function(require,module,exports){var f = require("+a(r)+");(f.default ? f.default : f)(self);}",d];var m={};!function t(e){for(var r in m[e]=!0,n[e][1]){var i=n[e][1][r];m[i]||t(i)}}(f);var y="("+i+")({"+Object.keys(m).map(function(t){return a(t)+":["+n[t][0]+","+a(n[t][1])+"]"}).join(",")+"},{},["+a(f)+"])",_=window.URL||window.webkitURL||window.mozURL||window.msURL,g=new Blob([y],{type:"text/javascript"});if(e&&e.bare)return g;var v=_.createObjectURL(g),x=new Worker(v);return x.objectURL=v,x}},{}],37:[function(t,e,r){e.exports.RADIUS=6378137,e.exports.FLATTENING=1/298.257223563,e.exports.POLAR_RADIUS=6356752.3142},{}],38:[function(t,e,r){e.exports={version:"0.44.2"}},{}],39:[function(t,e,r){"use strict";var i=t("../util/struct_array").StructArray,n=t("../util/struct_array").Struct,o=t("../util/web_worker_transfer").register,a=t("@mapbox/point-geometry"),s=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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;this.resize(r+1);var i=2*r;return this.int16[i+0]=t,this.int16[i+1]=e,r},e}(i);s.prototype.bytesPerElement=4,o("StructArrayLayout2i4",s);var l=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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;this.resize(n+1);var o=4*n;return this.int16[o+0]=t,this.int16[o+1]=e,this.int16[o+2]=r,this.int16[o+3]=i,n},e}(i);l.prototype.bytesPerElement=8,o("StructArrayLayout4i8",l);var u=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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;this.resize(a+1);var s=6*a;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=n,this.int16[s+5]=o,a},e}(i);u.prototype.bytesPerElement=12,o("StructArrayLayout2i4i12",u);var c=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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,a,s){var l=this.length;this.resize(l+1);var u=6*l,c=12*l;return this.int16[u+0]=t,this.int16[u+1]=e,this.int16[u+2]=r,this.int16[u+3]=i,this.uint8[c+8]=n,this.uint8[c+9]=o,this.uint8[c+10]=a,this.uint8[c+11]=s,l},e}(i);c.prototype.bytesPerElement=12,o("StructArrayLayout4i4ub12",c);var p=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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){var l=this.length;this.resize(l+1);var u=8*l;return this.int16[u+0]=t,this.int16[u+1]=e,this.int16[u+2]=r,this.int16[u+3]=i,this.uint16[u+4]=n,this.uint16[u+5]=o,this.uint16[u+6]=a,this.uint16[u+7]=s,l},e}(i);p.prototype.bytesPerElement=16,o("StructArrayLayout4i4ui16",p);var h=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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;this.resize(i+1);var n=3*i;return this.float32[n+0]=t,this.float32[n+1]=e,this.float32[n+2]=r,i},e}(i);h.prototype.bytesPerElement=12,o("StructArrayLayout3f12",h);var f=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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;this.resize(e+1);var r=1*e;return this.uint32[r+0]=t,e},e}(i);f.prototype.bytesPerElement=4,o("StructArrayLayout1ul4",f);var d=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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,u,c){var p=this.length;this.resize(p+1);var h=12*p,f=6*p;return this.int16[h+0]=t,this.int16[h+1]=e,this.int16[h+2]=r,this.int16[h+3]=i,this.int16[h+4]=n,this.int16[h+5]=o,this.uint32[f+3]=a,this.uint16[h+8]=s,this.uint16[h+9]=l,this.int16[h+10]=u,this.int16[h+11]=c,p},e}(i);d.prototype.bytesPerElement=24,o("StructArrayLayout6i1ul2ui2i24",d);var m=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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;this.resize(a+1);var s=6*a;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=n,this.int16[s+5]=o,a},e}(i);m.prototype.bytesPerElement=12,o("StructArrayLayout2i2i2i12",m);var y=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var i=4*r;return this.uint8[i+0]=t,this.uint8[i+1]=e,r},e}(i);y.prototype.bytesPerElement=4,o("StructArrayLayout2ub4",y);var _=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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,p,h,f){var d=this.length;this.resize(d+1);var m=20*d,y=10*d,_=40*d;return this.int16[m+0]=t,this.int16[m+1]=e,this.uint16[m+2]=r,this.uint16[m+3]=i,this.uint32[y+2]=n,this.uint32[y+3]=o,this.uint32[y+4]=a,this.uint16[m+10]=s,this.uint16[m+11]=l,this.uint16[m+12]=u,this.float32[y+7]=c,this.float32[y+8]=p,this.uint8[_+36]=h,this.uint8[_+37]=f,d},e}(i);_.prototype.bytesPerElement=40,o("StructArrayLayout2i2ui3ul3ui2f2ub40",_);var g=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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;this.resize(e+1);var r=1*e;return this.float32[r+0]=t,e},e}(i);g.prototype.bytesPerElement=4,o("StructArrayLayout1f4",g);var v=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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;this.resize(i+1);var n=3*i;return this.int16[n+0]=t,this.int16[n+1]=e,this.int16[n+2]=r,i},e}(i);v.prototype.bytesPerElement=6,o("StructArrayLayout3i6",v);var x=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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;this.resize(i+1);var n=2*i,o=4*i;return this.uint32[n+0]=t,this.uint16[o+2]=e,this.uint16[o+3]=r,i},e}(i);x.prototype.bytesPerElement=8,o("StructArrayLayout1ul2ui8",x);var b=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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;this.resize(i+1);var n=3*i;return this.uint16[n+0]=t,this.uint16[n+1]=e,this.uint16[n+2]=r,i},e}(i);b.prototype.bytesPerElement=6,o("StructArrayLayout3ui6",b);var w=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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;this.resize(r+1);var i=2*r;return this.uint16[i+0]=t,this.uint16[i+1]=e,r},e}(i);w.prototype.bytesPerElement=4,o("StructArrayLayout2ui4",w);var S=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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;this.resize(r+1);var i=2*r;return this.float32[i+0]=t,this.float32[i+1]=e,r},e}(i);S.prototype.bytesPerElement=8,o("StructArrayLayout2f8",S);var A=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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;this.resize(n+1);var o=4*n;return this.float32[o+0]=t,this.float32[o+1]=e,this.float32[o+2]=r,this.float32[o+3]=i,n},e}(i);A.prototype.bytesPerElement=16,o("StructArrayLayout4f16",A);var T=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorPointX:{},anchorPointY:{},x1:{},y1:{},x2:{},y2:{},featureIndex:{},sourceLayerIndex:{},bucketIndex:{},radius:{},signedDistanceFromAnchor:{},anchorPoint:{}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.radius.get=function(){return this._structArray.int16[this._pos2+10]},r.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},r.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},r.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(n);T.prototype.size=24;var z=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.get=function(t){return new T(this,t)},e}(d);o("CollisionBoxArray",z);var E=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{},anchorY:{},glyphStartIndex:{},numGlyphs:{},vertexStartIndex:{},lineStartIndex:{},lineLength:{},segment:{},lowerSize:{},upperSize:{},lineOffsetX:{},lineOffsetY:{},writingMode:{},hidden:{}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+37]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+37]=t},Object.defineProperties(e.prototype,r),e}(n);E.prototype.size=40;var k=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.get=function(t){return new E(this,t)},e}(_);o("PlacedSymbolArray",k);var C=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={offsetX:{}};return r.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},r.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,r),e}(n);C.prototype.size=4;var I=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.getoffsetX=function(t){return this.float32[1*t+0]},e.prototype.get=function(t){return new C(this,t)},e}(g);o("GlyphOffsetArray",I);var M=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={x:{},y:{},tileUnitDistanceFromAnchor:{}};return r.x.get=function(){return this._structArray.int16[this._pos2+0]},r.x.set=function(t){this._structArray.int16[this._pos2+0]=t},r.y.get=function(){return this._structArray.int16[this._pos2+1]},r.y.set=function(t){this._structArray.int16[this._pos2+1]=t},r.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},r.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,r),e}(n);M.prototype.size=6;var P=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=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.prototype.get=function(t){return new M(this,t)},e}(v);o("SymbolLineVertexArray",P);var L=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={featureIndex:{},sourceLayerIndex:{},bucketIndex:{}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,r),e}(n);L.prototype.size=8;var D=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.get=function(t){return new L(this,t)},e}(x);o("FeatureIndexArray",D),e.exports={StructArrayLayout2i4:s,StructArrayLayout4i8:l,StructArrayLayout2i4i12:u,StructArrayLayout4i4ub12:c,StructArrayLayout4i4ui16:p,StructArrayLayout3f12:h,StructArrayLayout1ul4:f,StructArrayLayout6i1ul2ui2i24:d,StructArrayLayout2i2i2i12:m,StructArrayLayout2ub4:y,StructArrayLayout2i2ui3ul3ui2f2ub40:_,StructArrayLayout1f4:g,StructArrayLayout3i6:v,StructArrayLayout1ul2ui8:x,StructArrayLayout3ui6:b,StructArrayLayout2ui4:w,StructArrayLayout2f8:S,StructArrayLayout4f16:A,PosArray:s,RasterBoundsArray:l,CircleLayoutArray:s,FillLayoutArray:s,FillExtrusionLayoutArray:u,HeatmapLayoutArray:s,LineLayoutArray:c,SymbolLayoutArray:p,SymbolDynamicLayoutArray:h,SymbolOpacityArray:f,CollisionBoxLayoutArray:m,CollisionCircleLayoutArray:m,CollisionVertexArray:y,TriangleIndexArray:b,LineIndexArray:w,CollisionBoxArray:z,PlacedSymbolArray:k,GlyphOffsetArray:I,SymbolLineVertexArray:P,FeatureIndexArray:D}},{"../util/struct_array":271,"../util/web_worker_transfer":278,"@mapbox/point-geometry":4}],40:[function(t,e,r){"use strict";e.exports={deserialize:function(t,e){var r={};if(!e)return r;for(var i=0,n=t;i<n.length;i+=1){var o=n[i],a=o.layerIds.map(function(t){return e.getLayer(t)}).filter(Boolean);if(0!==a.length)for(var s=0,l=o.layers=a;s<l.length;s+=1)r[l[s].id]=o}return r}}},{}],41:[function(t,e,r){"use strict";var i=t("../../util/struct_array").createLayout;e.exports=i([{name:"a_pos",components:2,type:"Int16"}],4)},{"../../util/struct_array":271}],42:[function(t,e,r){"use strict";function i(t,e,r,i,n){t.emplaceBack(2*e+(i+1)/2,2*r+(n+1)/2)}var n=t("../array_types").CircleLayoutArray,o=t("./circle_attributes").members,a=t("../segment").SegmentVector,s=t("../program_configuration").ProgramConfigurationSet,l=t("../index_array_type").TriangleIndexArray,u=t("../load_geometry"),c=t("../extent"),p=t("../../util/web_worker_transfer").register,h=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.layoutVertexArray=new n,this.indexArray=new l,this.segments=new a,this.programConfigurations=new s(o,t.layers,t.zoom)};h.prototype.populate=function(t,e){for(var r=this,i=0,n=t;i<n.length;i+=1){var o=n[i],a=o.feature,s=o.index,l=o.sourceLayerIndex;if(r.layers[0]._featureFilter({zoom:r.zoom},a)){var c=u(a);r.addFeature(a,c),e.featureIndex.insert(a,c,s,l,r.index)}}},h.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},h.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,o),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.programConfigurations.upload(t)},h.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},h.prototype.addFeature=function(t,e){for(var r=this,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,p=l.y;if(!(u<0||c<=u||p<0||c<=p)){var h=r.segments.prepareSegment(4,r.layoutVertexArray,r.indexArray),f=h.vertexLength;i(r.layoutVertexArray,u,p,-1,-1),i(r.layoutVertexArray,u,p,1,-1),i(r.layoutVertexArray,u,p,1,1),i(r.layoutVertexArray,u,p,-1,1),r.indexArray.emplaceBack(f,f+1,f+2),r.indexArray.emplaceBack(f,f+3,f+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t)},p("CircleBucket",h,{omit:["layers"]}),e.exports=h},{"../../util/web_worker_transfer":278,"../array_types":39,"../extent":53,"../index_array_type":55,"../load_geometry":56,"../program_configuration":58,"../segment":60,"./circle_attributes":41}],43:[function(t,e,r){arguments[4][41][0].apply(r,arguments)},{"../../util/struct_array":271,dup:41}],44:[function(t,e,r){"use strict";var i=t("../array_types").FillLayoutArray,n=t("./fill_attributes").members,o=t("../segment").SegmentVector,a=t("../program_configuration").ProgramConfigurationSet,s=t("../index_array_type"),l=s.LineIndexArray,u=s.TriangleIndexArray,c=t("../load_geometry"),p=t("earcut"),h=t("../../util/classify_rings"),f=t("../../util/web_worker_transfer").register,d=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.layoutVertexArray=new i,this.indexArray=new u,this.indexArray2=new l,this.programConfigurations=new a(n,t.layers,t.zoom),this.segments=new o,this.segments2=new o};d.prototype.populate=function(t,e){for(var r=this,i=0,n=t;i<n.length;i+=1){var o=n[i],a=o.feature,s=o.index,l=o.sourceLayerIndex;if(r.layers[0]._featureFilter({zoom:r.zoom},a)){var u=c(a);r.addFeature(a,u),e.featureIndex.insert(a,u,s,l,r.index)}}},d.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},d.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,n),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2),this.programConfigurations.upload(t)},d.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},d.prototype.addFeature=function(t,e){for(var r=this,i=0,n=h(e,500);i<n.length;i+=1){for(var o=n[i],a=0,s=0,l=o;s<l.length;s+=1)a+=l[s].length;for(var u=r.segments.prepareSegment(a,r.layoutVertexArray,r.indexArray),c=u.vertexLength,f=[],d=[],m=0,y=o;m<y.length;m+=1){var _=y[m];if(0!==_.length){_!==o[0]&&d.push(f.length/2);var g=r.segments2.prepareSegment(_.length,r.layoutVertexArray,r.indexArray2),v=g.vertexLength;r.layoutVertexArray.emplaceBack(_[0].x,_[0].y),r.indexArray2.emplaceBack(v+_.length-1,v),f.push(_[0].x),f.push(_[0].y);for(var x=1;x<_.length;x++)r.layoutVertexArray.emplaceBack(_[x].x,_[x].y),r.indexArray2.emplaceBack(v+x-1,v+x),f.push(_[x].x),f.push(_[x].y);g.vertexLength+=_.length,g.primitiveLength+=_.length}}for(var b=p(f,d),w=0;w<b.length;w+=3)r.indexArray.emplaceBack(c+b[w],c+b[w+1],c+b[w+2]);u.vertexLength+=a,u.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t)},f("FillBucket",d,{omit:["layers"]}),e.exports=d},{"../../util/classify_rings":255,"../../util/web_worker_transfer":278,"../array_types":39,"../index_array_type":55,"../load_geometry":56,"../program_configuration":58,"../segment":60,"./fill_attributes":43,earcut:14}],45:[function(t,e,r){"use strict";var i=t("../../util/struct_array").createLayout;e.exports=i([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4)},{"../../util/struct_array":271}],46:[function(t,e,r){"use strict";function i(t,e,r,i,n,o,a,s){t.emplaceBack(e,r,2*Math.floor(i*g)+a,n*g*2,o*g*2,Math.round(s))}function n(t,e){return t.x===e.x&&(t.x<0||t.x>d)||t.y===e.y&&(t.y<0||t.y>d)}function o(t){return t.every(function(t){return t.x<0})||t.every(function(t){return t.x>d})||t.every(function(t){return t.y<0})||t.every(function(t){return t.y>d})}var a=t("../array_types").FillExtrusionLayoutArray,s=t("./fill_extrusion_attributes").members,l=t("../segment"),u=l.SegmentVector,c=l.MAX_VERTEX_ARRAY_LENGTH,p=t("../program_configuration").ProgramConfigurationSet,h=t("../index_array_type").TriangleIndexArray,f=t("../load_geometry"),d=t("../extent"),m=t("earcut"),y=t("../../util/classify_rings"),_=t("../../util/web_worker_transfer").register,g=Math.pow(2,13),v=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.layoutVertexArray=new a,this.indexArray=new h,this.programConfigurations=new p(s,t.layers,t.zoom),this.segments=new u};v.prototype.populate=function(t,e){for(var r=this,i=0,n=t;i<n.length;i+=1){var o=n[i],a=o.feature,s=o.index,l=o.sourceLayerIndex;if(r.layers[0]._featureFilter({zoom:r.zoom},a)){var u=f(a);r.addFeature(a,u),e.featureIndex.insert(a,u,s,l,r.index)}}},v.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},v.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,s),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.programConfigurations.upload(t)},v.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},v.prototype.addFeature=function(t,e){for(var r=this,a=0,s=y(e,500);a<s.length;a+=1){for(var l=s[a],u=0,p=0,h=l;p<h.length;p+=1)u+=h[p].length;for(var f=r.segments.prepareSegment(4,r.layoutVertexArray,r.indexArray),d=0,_=l;d<_.length;d+=1){var g=_[d];if(0!==g.length&&!o(g))for(var v=0,x=0;x<g.length;x++){var b=g[x];if(1<=x){var w=g[x-1];if(!n(b,w)){f.vertexLength+4>c&&(f=r.segments.prepareSegment(4,r.layoutVertexArray,r.indexArray));var S=b.sub(w)._perp()._unit(),A=w.dist(b);32768<v+A&&(v=0),i(r.layoutVertexArray,b.x,b.y,S.x,S.y,0,0,v),i(r.layoutVertexArray,b.x,b.y,S.x,S.y,0,1,v),v+=A,i(r.layoutVertexArray,w.x,w.y,S.x,S.y,0,0,v),i(r.layoutVertexArray,w.x,w.y,S.x,S.y,0,1,v);var T=f.vertexLength;r.indexArray.emplaceBack(T,T+1,T+2),r.indexArray.emplaceBack(T+1,T+2,T+3),f.vertexLength+=4,f.primitiveLength+=2}}}}f.vertexLength+u>c&&(f=r.segments.prepareSegment(u,r.layoutVertexArray,r.indexArray));for(var z=[],E=[],k=f.vertexLength,C=0,I=l;C<I.length;C+=1){var M=I[C];if(0!==M.length){M!==l[0]&&E.push(z.length/2);for(var P=0;P<M.length;P++){var L=M[P];i(r.layoutVertexArray,L.x,L.y,0,0,1,1,0),z.push(L.x),z.push(L.y)}}}for(var D=m(z,E),B=0;B<D.length;B+=3)r.indexArray.emplaceBack(k+D[B],k+D[B+1],k+D[B+2]);f.primitiveLength+=D.length/3,f.vertexLength+=u}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t)},_("FillExtrusionBucket",v,{omit:["layers"]}),e.exports=v},{"../../util/classify_rings":255,"../../util/web_worker_transfer":278,"../array_types":39,"../extent":53,"../index_array_type":55,"../load_geometry":56,"../program_configuration":58,"../segment":60,"./fill_extrusion_attributes":45,earcut:14}],47:[function(t,e,r){"use strict";var i=t("./circle_bucket"),n=t("../../util/web_worker_transfer").register,o=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(i);n("HeatmapBucket",o,{omit:["layers"]}),e.exports=o},{"../../util/web_worker_transfer":278,"./circle_bucket":42}],48:[function(t,e,r){"use strict";var i=t("../../util/struct_array").createLayout;e.exports=i([{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4)},{"../../util/struct_array":271}],49:[function(t,e,r){"use strict";function i(t,e,r,i,n,o,a){t.emplaceBack(e.x,e.y,i?1:0,n?1:-1,Math.round(f*r.x)+128,Math.round(f*r.y)+128,1+(0===o?0:o<0?-1:1)|(a*m&63)<<2,a*m>>6)}var n=t("../array_types").LineLayoutArray,o=t("./line_attributes").members,a=t("../segment").SegmentVector,s=t("../program_configuration").ProgramConfigurationSet,l=t("../index_array_type").TriangleIndexArray,u=t("../load_geometry"),c=t("../extent"),p=t("@mapbox/vector-tile").VectorTileFeature.types,h=t("../../util/web_worker_transfer").register,f=63,d=Math.cos(Math.PI/180*37.5),m=.5,y=Math.pow(2,14)/m,_=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.layoutVertexArray=new n,this.indexArray=new l,this.programConfigurations=new s(o,t.layers,t.zoom),this.segments=new a};_.prototype.populate=function(t,e){for(var r=this,i=0,n=t;i<n.length;i+=1){var o=n[i],a=o.feature,s=o.index,l=o.sourceLayerIndex;if(r.layers[0]._featureFilter({zoom:r.zoom},a)){var c=u(a);r.addFeature(a,c),e.featureIndex.insert(a,c,s,l,r.index)}}},_.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},_.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,o),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.programConfigurations.upload(t)},_.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},_.prototype.addFeature=function(t,e){for(var r=this.layers[0].layout,i=r.get("line-join").evaluate(t),n=r.get("line-cap"),o=r.get("line-miter-limit"),a=r.get("line-round-limit"),s=0,l=e;s<l.length;s+=1){var u=l[s];this.addLine(u,t,i,n,o,a)}},_.prototype.addLine=function(t,e,r,i,n,o){for(var a=this,s="Polygon"===p[e.type],l=t.length;2<=l&&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 y,_,g,h=c/(512*this.overscaling)*15,f=t[u],m=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),v=i,x=s?"butt":i,b=!(this.distance=0),w=void 0,S=void 0,A=void 0,T=void 0;this.e1=this.e2=this.e3=-1,s&&(y=t[l-2],T=f.sub(y)._unit()._perp());for(var z=u;z<l;z++)if(!(S=s&&z===l-1?t[u+1]:t[z+1])||!t[z].equals(S)){T&&(A=T),y&&(w=y),y=t[z],T=S?S.sub(y)._unit()._perp():A;var E=(A=A||T).add(T);0===E.x&&0===E.y||E._unit();var k=E.x*T.x+E.y*T.y,C=0!==k?1/k:1/0,I=k<d&&w&&S;if(I&&u<z){var M=y.dist(w);if(2*h<M){var P=y.sub(y.sub(w)._mult(h/M)._round());a.distance+=P.dist(w),a.addCurrentVertex(P,a.distance,A.mult(1),0,0,!1,m),w=P}}var L=w&&S,D=L?r:S?v:x;if(L&&"round"===D&&(C<o?D="miter":C<=2&&(D="fakeround")),"miter"===D&&n<C&&(D="bevel"),"bevel"===D&&(2<C&&(D="flipbevel"),C<n&&(D="miter")),w&&(a.distance+=y.dist(w)),"miter"===D)E._mult(C),a.addCurrentVertex(y,a.distance,E,0,0,!1,m);else if("flipbevel"===D){if(100<C)E=T.clone().mult(-1);else{var B=0<A.x*T.y-A.y*T.x?-1:1,R=C*A.add(T).mag()/A.sub(T).mag();E._perp()._mult(R*B)}a.addCurrentVertex(y,a.distance,E,0,0,!1,m),a.addCurrentVertex(y,a.distance,E.mult(-1),0,0,!1,m)}else if("bevel"===D||"fakeround"===D){var O=0<A.x*T.y-A.y*T.x,F=-Math.sqrt(C*C-1);if(O?(g=0,_=F):(_=0,g=F),b||a.addCurrentVertex(y,a.distance,A,_,g,!1,m),"fakeround"===D){for(var V=Math.floor(8*(.5-(k-.5))),j=void 0,N=0;N<V;N++)j=T.mult((N+1)/(V+1))._add(A)._unit(),a.addPieSliceVertex(y,a.distance,j,O,m);a.addPieSliceVertex(y,a.distance,E,O,m);for(var U=V-1;0<=U;U--)j=A.mult((U+1)/(V+1))._add(T)._unit(),a.addPieSliceVertex(y,a.distance,j,O,m)}S&&a.addCurrentVertex(y,a.distance,T,-_,-g,!1,m)}else"butt"===D?(b||a.addCurrentVertex(y,a.distance,A,0,0,!1,m),S&&a.addCurrentVertex(y,a.distance,T,0,0,!1,m)):"square"===D?(b||(a.addCurrentVertex(y,a.distance,A,1,1,!1,m),a.e1=a.e2=-1),S&&a.addCurrentVertex(y,a.distance,T,-1,-1,!1,m)):"round"===D&&(b||(a.addCurrentVertex(y,a.distance,A,0,0,!1,m),a.addCurrentVertex(y,a.distance,A,1,1,!0,m),a.e1=a.e2=-1),S&&(a.addCurrentVertex(y,a.distance,T,-1,-1,!0,m),a.addCurrentVertex(y,a.distance,T,0,0,!1,m)));if(I&&z<l-1){var q=y.dist(S);if(2*h<q){var Z=y.add(S.sub(y)._mult(h/q)._round());a.distance+=Z.dist(y),a.addCurrentVertex(Z,a.distance,T.mult(1),0,0,!1,m),y=Z}}b=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e)}},_.prototype.addCurrentVertex=function(t,e,r,n,o,a,s){var l,u=this.layoutVertexArray,c=this.indexArray;l=r.clone(),n&&l._sub(r.perp()._mult(n)),i(u,t,l,a,!1,n,e),this.e3=s.vertexLength++,0<=this.e1&&0<=this.e2&&(c.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,l=r.mult(-1),o&&l._sub(r.perp()._mult(o)),i(u,t,l,a,!0,-o,e),this.e3=s.vertexLength++,0<=this.e1&&0<=this.e2&&(c.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,y/2<e&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,o,a,s))},_.prototype.addPieSliceVertex=function(t,e,r,n,o){r=r.mult(n?-1:1);var a=this.layoutVertexArray,s=this.indexArray;i(a,t,r,!1,n,0,e),this.e3=o.vertexLength++,0<=this.e1&&0<=this.e2&&(s.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),n?this.e2=this.e3:this.e1=this.e3},h("LineBucket",_,{omit:["layers"]}),e.exports=_},{"../../util/web_worker_transfer":278,"../array_types":39,"../extent":53,"../index_array_type":55,"../load_geometry":56,"../program_configuration":58,"../segment":60,"./line_attributes":48,"@mapbox/vector-tile":8}],50:[function(t,e,r){"use strict";var i=t("../../util/struct_array").createLayout,n={symbolLayoutAttributes:i([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),dynamicLayoutAttributes:i([{name:"a_projected_pos",components:3,type:"Float32"}],4),placementOpacityAttributes:i([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),collisionVertexAttributes:i([{name:"a_placed",components:2,type:"Uint8"}],4),collisionBox:i([{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"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),collisionBoxLayout:i([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),collisionCircleLayout:i([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),placement:i([{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:"hidden"}]),glyphOffset:i([{type:"Float32",name:"offsetX"}]),lineVertex:i([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}])};e.exports=n},{"../../util/struct_array":271}],51:[function(t,e,r){"use strict";function i(t,e,r,i,n,o,a,s){t.emplaceBack(e,r,Math.round(64*i),Math.round(64*n),o,a,s?s[0]:0,s?s[1]:0)}function n(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)}var o=t("./symbol_attributes"),a=o.symbolLayoutAttributes,s=o.collisionVertexAttributes,l=o.collisionBoxLayout,u=o.collisionCircleLayout,c=o.dynamicLayoutAttributes,p=t("../array_types"),h=p.SymbolLayoutArray,f=p.SymbolDynamicLayoutArray,d=p.SymbolOpacityArray,m=p.CollisionBoxLayoutArray,y=p.CollisionCircleLayoutArray,_=p.CollisionVertexArray,g=p.PlacedSymbolArray,v=p.GlyphOffsetArray,x=p.SymbolLineVertexArray,b=t("@mapbox/point-geometry"),w=t("../segment").SegmentVector,S=t("../program_configuration").ProgramConfigurationSet,A=t("../index_array_type"),T=A.TriangleIndexArray,z=A.LineIndexArray,E=t("../../symbol/transform_text"),k=t("../../symbol/mergelines"),C=t("../../util/script_detection"),I=t("../load_geometry"),M=t("@mapbox/vector-tile").VectorTileFeature.types,P=t("../../util/verticalize_punctuation"),L=(t("../../symbol/anchor"),t("../../symbol/symbol_size").getSizeData),D=t("../../util/web_worker_transfer").register,B=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}],R=function(t){this.layoutVertexArray=new h,this.indexArray=new T,this.programConfigurations=t,this.segments=new w,this.dynamicLayoutVertexArray=new f,this.opacityVertexArray=new d,this.placedSymbolArray=new g};R.prototype.upload=function(t,e){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,a.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.programConfigurations.upload(t),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,c.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,B,!0),this.opacityVertexBuffer.itemSize=1},R.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},D("SymbolBuffers",R);var O=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new w,this.collisionVertexArray=new _};O.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,s.members,!0)},O.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},D("CollisionBuffers",O);var F=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;var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=L(this.zoom,e["text-size"]),this.iconSizeData=L(this.zoom,e["icon-size"]);var r=this.layers[0].layout;this.sortFeaturesByY=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")};F.prototype.createArrays=function(){this.text=new R(new S(a.members,this.layers,this.zoom,function(t){return/^text/.test(t)})),this.icon=new R(new S(a.members,this.layers,this.zoom,function(t){return/^icon/.test(t)})),this.collisionBox=new O(m,l.members,z),this.collisionCircle=new O(y,u.members,T),this.glyphOffsetArray=new v,this.lineVertexArray=new x},F.prototype.populate=function(t,e){var r=this.layers[0],i=r.layout,n=i.get("text-font"),o=i.get("text-field"),a=i.get("icon-image"),s=("constant"!==o.value.kind||0<o.value.value.length)&&("constant"!==n.value.kind||0<n.value.value.length),l="constant"!==a.value.kind||a.value.value&&0<a.value.value.length;if(this.features=[],s||l){for(var u=e.iconDependencies,c=e.glyphDependencies,p={zoom:this.zoom},h=0,f=t;h<f.length;h+=1){var d=f[h],m=d.feature,y=d.index,_=d.sourceLayerIndex;if(r._featureFilter(p,m)){var g=void 0;s&&(g=r.getValueAndResolveTokens("text-field",m),g=E(g,r,m));var v=void 0;if(l&&(v=r.getValueAndResolveTokens("icon-image",m)),g||v){var x={text:g,icon:v,index:y,sourceLayerIndex:_,geometry:I(m),properties:m.properties,type:M[m.type]};if(void 0!==m.id&&(x.id=m.id),this.features.push(x),v&&(u[v]=!0),g)for(var b=n.evaluate(m).join(","),w=c[b]=c[b]||{},S="map"===i.get("text-rotation-alignment")&&"line"===i.get("symbol-placement"),A=C.allowsVerticalWritingMode(g),T=0;T<g.length;T++)if(w[g.charCodeAt(T)]=!0,S&&A){var z=P.lookup[g.charAt(T)];z&&(w[z.charCodeAt(0)]=!0)}}}}"line"===i.get("symbol-placement")&&(this.features=k(this.features))}},F.prototype.isEmpty=function(){return 0===this.symbolInstances.length},F.prototype.upload=function(t){this.text.upload(t,this.sortFeaturesByY),this.icon.upload(t,this.sortFeaturesByY),this.collisionBox.upload(t),this.collisionCircle.upload(t)},F.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()},F.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;0<=s;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},0<s&&(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}},F.prototype.addSymbols=function(t,e,r,o,a,s,l,u,c,p){for(var h=t.indexArray,f=t.layoutVertexArray,d=t.dynamicLayoutVertexArray,m=t.segments.prepareSegment(4*e.length,t.layoutVertexArray,t.indexArray),y=this.glyphOffsetArray.length,_=m.vertexLength,g=0,v=e;g<v.length;g+=1){var x=v[g],b=x.tl,w=x.tr,S=x.bl,A=x.br,T=x.tex,z=m.vertexLength,E=x.glyphOffset[1];i(f,u.x,u.y,b.x,E+b.y,T.x,T.y,r),i(f,u.x,u.y,w.x,E+w.y,T.x+T.w,T.y,r),i(f,u.x,u.y,S.x,E+S.y,T.x,T.y+T.h,r),i(f,u.x,u.y,A.x,E+A.y,T.x+T.w,T.y+T.h,r),n(d,u,0),h.emplaceBack(z,z+1,z+2),h.emplaceBack(z+1,z+2,z+3),m.vertexLength+=4,m.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(x.glyphOffset[0])}t.placedSymbolArray.emplaceBack(u.x,u.y,y,this.glyphOffsetArray.length-y,_,c,p,u.segment,r?r[0]:0,r?r[1]:0,o[0],o[1],l,!1),t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,s)},F.prototype._addCollisionDebugVertex=function(t,e,r,i,n){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,i.x,i.y,Math.round(n.x),Math.round(n.y))},F.prototype.addCollisionDebugVertices=function(t,e,r,i,n,o,a,s){var l=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),u=l.vertexLength,c=n.layoutVertexArray,p=n.collisionVertexArray;if(this._addCollisionDebugVertex(c,p,o,a.anchor,new b(t,e)),this._addCollisionDebugVertex(c,p,o,a.anchor,new b(r,e)),this._addCollisionDebugVertex(c,p,o,a.anchor,new b(r,i)),this._addCollisionDebugVertex(c,p,o,a.anchor,new b(t,i)),l.vertexLength+=4,s){var h=n.indexArray;h.emplaceBack(u,u+1,u+2),h.emplaceBack(u,u+2,u+3),l.primitiveLength+=2}else{var f=n.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}},F.prototype.generateCollisionDebugBuffers=function(){for(var t=this,e=0,r=t.symbolInstances;e<r.length;e+=1){var i=r[e];i.textCollisionFeature={boxStartIndex:i.textBoxStartIndex,boxEndIndex:i.textBoxEndIndex},i.iconCollisionFeature={boxStartIndex:i.iconBoxStartIndex,boxEndIndex:i.iconBoxEndIndex};for(var n=0;n<2;n++){var o=i[0===n?"textCollisionFeature":"iconCollisionFeature"];if(o)for(var a=o.boxStartIndex;a<o.boxEndIndex;a++){var s=t.collisionBoxArray.get(a),l=s.x1,u=s.y1,c=s.x2,p=s.y2,h=0<s.radius;t.addCollisionDebugVertices(l,u,c,p,h?t.collisionCircle:t.collisionBox,s.anchorPoint,i,h)}}}},F.prototype.deserializeCollisionBoxes=function(t,e,r,i,n){for(var o={},a=e;a<r;a++){var s=t.get(a);if(0===s.radius){o.textBox={x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,anchorPointX:s.anchorPointX,anchorPointY:s.anchorPointY};break}o.textCircles||(o.textCircles=[]),o.textCircles.push(s.anchorPointX,s.anchorPointY,s.radius,s.signedDistanceFromAnchor,1)}for(var l=i;l<n;l++){var u=t.get(l);if(0===u.radius){o.iconBox={x1:u.x1,y1:u.y1,x2:u.x2,y2:u.y2,anchorPointX:u.anchorPointX,anchorPointY:u.anchorPointY};break}}return o},F.prototype.hasTextData=function(){return 0<this.text.segments.get().length},F.prototype.hasIconData=function(){return 0<this.icon.segments.get().length},F.prototype.hasCollisionBoxData=function(){return 0<this.collisionBox.segments.get().length},F.prototype.hasCollisionCircleData=function(){return 0<this.collisionCircle.segments.get().length},F.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&(this.sortedAngle=t,!(1<this.text.segments.get().length||1<this.icon.segments.get().length))){for(var r=[],i=0;i<this.symbolInstances.length;i++)r.push(i);var n=Math.sin(t),o=Math.cos(t);r.sort(function(t,r){var i=e.symbolInstances[t],a=e.symbolInstances[r];return(n*i.anchor.x+o*i.anchor.y|0)-(n*a.anchor.x+o*a.anchor.y|0)||a.featureIndex-i.featureIndex}),this.text.indexArray.clear(),this.icon.indexArray.clear();for(var a=0,s=r;a<s.length;a+=1){for(var l=s[a],u=0,c=e.symbolInstances[l].placedTextSymbolIndices;u<c.length;u+=1)for(var p=c[u],h=e.text.placedSymbolArray.get(p),f=h.vertexStartIndex+4*h.numGlyphs,d=h.vertexStartIndex;d<f;d+=4)e.text.indexArray.emplaceBack(d,d+1,d+2),e.text.indexArray.emplaceBack(d+1,d+2,d+3);var m=e.icon.placedSymbolArray.get(l);if(m.numGlyphs){var y=m.vertexStartIndex;e.icon.indexArray.emplaceBack(y,y+1,y+2),e.icon.indexArray.emplaceBack(y+1,y+2,y+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},D("SymbolBucket",F,{omit:["layers","collisionBoxArray","features","compareText"],shallow:["symbolInstances"]}),F.MAX_GLYPHS=65535,F.addDynamicAttributes=n,e.exports=F},{"../../symbol/anchor":213,"../../symbol/mergelines":221,"../../symbol/symbol_size":228,"../../symbol/transform_text":229,"../../util/script_detection":269,"../../util/verticalize_punctuation":277,"../../util/web_worker_transfer":278,"../array_types":39,"../index_array_type":55,"../load_geometry":56,"../program_configuration":58,"../segment":60,"./symbol_attributes":50,"@mapbox/point-geometry":4,"@mapbox/vector-tile":8}],52:[function(t,e,r){"use strict";var i=t("../util/image").RGBAImage,n=t("../util/util"),o=t("../util/web_worker_transfer").register,a=function(t,e,r){if(t<=0)throw new RangeError("Level must have positive dimension");this.dim=t,this.border=e,this.stride=this.dim+2*this.border,this.data=r||new Int32Array((this.dim+2*this.border)*(this.dim+2*this.border))};a.prototype.set=function(t,e,r){this.data[this._idx(t,e)]=r+65536},a.prototype.get=function(t,e){return this.data[this._idx(t,e)]-65536},a.prototype._idx=function(t,e){if(t<-this.border||t>=this.dim+this.border||e<-this.border||e>=this.dim+this.border)throw new RangeError("out of range source coordinates for DEM data");return(e+this.border)*this.stride+(t+this.border)},o("Level",a);var s=function(t,e,r){this.uid=t,this.scale=e||1,this.level=r||new a(256,512),this.loaded=!!r};s.prototype.loadFromImage=function(t){if(t.height!==t.width)throw new RangeError("DEM tiles must be square");for(var e=this.level=new a(t.width,t.width/2),r=t.data,i=0;i<e.dim;i++)for(var n=0;n<e.dim;n++){var o=4*(i*e.dim+n);e.set(n,i,this.scale*((256*r[o]*256+256*r[o+1]+r[o+2])/10-1e4))}for(var s=0;s<e.dim;s++)e.set(-1,s,e.get(0,s)),e.set(e.dim,s,e.get(e.dim-1,s)),e.set(s,-1,e.get(s,0)),e.set(s,e.dim,e.get(s,e.dim-1));e.set(-1,-1,e.get(0,0)),e.set(e.dim,-1,e.get(e.dim-1,0)),e.set(-1,e.dim,e.get(0,e.dim-1)),e.set(e.dim,e.dim,e.get(e.dim-1,e.dim-1)),this.loaded=!0},s.prototype.getPixels=function(){return new i({width:this.level.dim+2*this.level.border,height:this.level.dim+2*this.level.border},new Uint8Array(this.level.data.buffer))},s.prototype.backfillBorder=function(t,e,r){var i=this.level,o=t.level;if(i.dim!==o.dim)throw new Error("level mismatch (dem dimension)");var a=e*i.dim,s=e*i.dim+i.dim,l=r*i.dim,u=r*i.dim+i.dim;switch(e){case-1:a=s-1;break;case 1:s=a+1}switch(r){case-1:l=u-1;break;case 1:u=l+1}for(var c=n.clamp(a,-i.border,i.dim+i.border),p=n.clamp(s,-i.border,i.dim+i.border),h=n.clamp(l,-i.border,i.dim+i.border),f=n.clamp(u,-i.border,i.dim+i.border),d=-e*i.dim,m=-r*i.dim,y=h;y<f;y++)for(var _=c;_<p;_++)i.set(_,y,o.get(_+d,y+m))},o("DEMData",s),e.exports={DEMData:s,Level:a}},{"../util/image":263,"../util/util":275,"../util/web_worker_transfer":278}],53:[function(t,e,r){"use strict";e.exports=8192},{}],54:[function(t,e,r){"use strict";function i(t,e){return e-t}t("@mapbox/point-geometry");var n=t("./load_geometry"),o=t("./extent"),a=t("../style-spec/feature_filter"),s=t("grid-index"),l=t("../util/dictionary_coder"),u=t("@mapbox/vector-tile"),c=t("pbf"),p=t("../util/vectortile_to_geojson"),h=t("../util/util").arraysIntersect,f=(t("../source/tile_id").OverscaledTileID,t("../util/web_worker_transfer").register),d=t("./array_types").FeatureIndexArray,m=function(t,e,r,i){this.tileID=t,this.overscaling=e,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=r||new s(o,16,0),this.featureIndexArray=i||new d};m.prototype.insert=function(t,e,r,i,n){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);for(var a=0;a<e.length;a++){for(var s=e[a],l=[1/0,1/0,-1/0,-1/0],u=0;u<s.length;u++){var c=s[u];l[0]=Math.min(l[0],c.x),l[1]=Math.min(l[1],c.y),l[2]=Math.max(l[2],c.x),l[3]=Math.max(l[3],c.y)}this.grid.insert(o,l[0],l[1],l[2],l[3])}},m.prototype.query=function(t,e){this.vtLayers||(this.vtLayers=new u.VectorTile(new c(this.rawTileData)).layers,this.sourceLayerCoder=new l(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]));for(var r={},n=t.params||{},s=o/t.tileSize/t.scale,p=a(n.filter),h=t.queryGeometry,f=t.additionalRadius*s,d=1/0,m=1/0,y=-1/0,_=-1/0,g=0;g<h.length;g++)for(var v=h[g],x=0;x<v.length;x++){var b=v[x];d=Math.min(d,b.x),m=Math.min(m,b.y),y=Math.max(y,b.x),_=Math.max(_,b.y)}var w=this.grid.query(d-f,m-f,y+f,_+f);w.sort(i),this.filterMatching(r,w,this.featureIndexArray,h,p,n.layers,e,t.bearing,s);var S=t.collisionIndex?t.collisionIndex.queryRenderedSymbols(h,this.tileID,o/t.tileSize,t.collisionBoxArray,t.sourceID,t.bucketInstanceIds):[];return S.sort(),this.filterMatching(r,S,t.collisionBoxArray,h,p,n.layers,e,t.bearing,s),r},m.prototype.filterMatching=function(t,e,r,i,o,a,s,l,u){for(var c,f=this,d=0;d<e.length;d++){var m=e[d];if(m!==c){c=m;var y=r.get(m),_=f.bucketLayerIDs[y.bucketIndex];if(!a||h(a,_)){var g=f.sourceLayerCoder.decode(y.sourceLayerIndex),v=f.vtLayers[g].feature(y.featureIndex);if(o({zoom:f.tileID.overscaledZ},v))for(var x=null,b=0;b<_.length;b++){var w=_[b];if(!(a&&a.indexOf(w)<0)){var S=s[w];if(S&&("symbol"===S.type||(x||(x=n(v)),S.queryIntersectsFeature(i,v,x,f.z,l,u)))){var A=new p(v,f.z,f.x,f.y);A.layer=S.serialize();var T=t[w];void 0===T&&(T=t[w]=[]),T.push({featureIndex:m,feature:A})}}}}}}},m.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},f("FeatureIndex",m,{omit:["rawTileData","sourceLayerCoder"]}),e.exports=m},{"../source/tile_id":114,"../style-spec/feature_filter":148,"../util/dictionary_coder":257,"../util/util":275,"../util/vectortile_to_geojson":276,"../util/web_worker_transfer":278,"./array_types":39,"./extent":53,"./load_geometry":56,"@mapbox/point-geometry":4,"@mapbox/vector-tile":8,"grid-index":24,pbf:30}],55:[function(t,e,r){"use strict";e.exports={LineIndexArray:t("./array_types").LineIndexArray,TriangleIndexArray:t("./array_types").TriangleIndexArray}},{"./array_types":39}],56:[function(t,e,r){"use strict";var n=t("../util/util"),o=t("./extent"),a=(16,{min:-1*Math.pow(2,15),max:Math.pow(2,15)-1});e.exports=function(t){for(var e=o/t.extent,r=t.loadGeometry(),i=0;i<r.length;i++)for(var s=r[i],l=0;l<s.length;l++){var u=s[l];u.x=Math.round(u.x*e),u.y=Math.round(u.y*e),(u.x<a.min||u.x>a.max||u.y<a.min||u.y>a.max)&&n.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}},{"../util/util":275,"./extent":53}],57:[function(t,e,r){"use strict";var i=t("../util/struct_array").createLayout;e.exports=i([{name:"a_pos",type:"Int16",components:2}])},{"../util/struct_array":271}],58:[function(t,e,r){"use strict";function i(t){return[o(255*t.r,255*t.g),o(255*t.b,255*t.a)]}function n(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"}[t]||t.replace(e+"-","").replace(/-/g,"_")}var o=t("../shaders/encode_attribute").packUint8ToFloat,a=(t("../style-spec/util/color"),t("../util/web_worker_transfer").register),s=t("../style/properties").PossiblyEvaluatedPropertyValue,l=t("./array_types"),u=l.StructArrayLayout1f4,c=l.StructArrayLayout2f8,p=l.StructArrayLayout4f16,h=function(t,e,r){this.value=t,this.name=e,this.type=r,this.statistics={max:-1/0}};h.prototype.defines=function(){return["#define HAS_UNIFORM_u_"+this.name]},h.prototype.populatePaintArray=function(){},h.prototype.upload=function(){},h.prototype.destroy=function(){},h.prototype.setUniforms=function(t,e,r,i){var n=i.constantOr(this.value),o=t.gl;"color"===this.type?o.uniform4f(e.uniforms["u_"+this.name],n.r,n.g,n.b,n.a):o.uniform1f(e.uniforms["u_"+this.name],n)};var f=function(t,e,r){this.expression=t,this.name=e,this.type=r,this.statistics={max:-1/0};var i="color"===r?c:u;this.paintVertexAttributes=[{name:"a_"+e,type:"Float32",components:"color"===r?2:1,offset:0}],this.paintVertexArray=new i};f.prototype.defines=function(){return[]},f.prototype.populatePaintArray=function(t,e){var r=this.paintVertexArray,n=r.length;r.reserve(t);var o=this.expression.evaluate({zoom:0},e);if("color"===this.type)for(var a=i(o),s=n;s<t;s++)r.emplaceBack(a[0],a[1]);else{for(var l=n;l<t;l++)r.emplaceBack(o);this.statistics.max=Math.max(this.statistics.max,o)}},f.prototype.upload=function(t){this.paintVertexArray&&(this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes))},f.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},f.prototype.setUniforms=function(t,e){t.gl.uniform1f(e.uniforms["a_"+this.name+"_t"],0)};var d=function(t,e,r,i,n){this.expression=t,this.name=e,this.type=r,this.useIntegerZoom=i,this.zoom=n,this.statistics={max:-1/0};var o="color"===r?p:c;this.paintVertexAttributes=[{name:"a_"+e,type:"Float32",components:"color"===r?4:2,offset:0}],this.paintVertexArray=new o};d.prototype.defines=function(){return[]},d.prototype.populatePaintArray=function(t,e){var r=this.paintVertexArray,n=r.length;r.reserve(t);var o=this.expression.evaluate({zoom:this.zoom},e),a=this.expression.evaluate({zoom:this.zoom+1},e);if("color"===this.type)for(var s=i(o),l=i(a),u=n;u<t;u++)r.emplaceBack(s[0],s[1],l[0],l[1]);else{for(var c=n;c<t;c++)r.emplaceBack(o,a);this.statistics.max=Math.max(this.statistics.max,o,a)}},d.prototype.upload=function(t){this.paintVertexArray&&(this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes))},d.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},d.prototype.interpolationFactor=function(t){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(t),this.zoom,this.zoom+1):this.expression.interpolationFactor(t,this.zoom,this.zoom+1)},d.prototype.setUniforms=function(t,e,r){t.gl.uniform1f(e.uniforms["a_"+this.name+"_t"],this.interpolationFactor(r.zoom))};var m=function(){this.binders={},this.cacheKey="",this._buffers=[]};m.createDynamic=function(t,e,r){var i=new m,o=[];for(var a in t.paint._values)if(r(a)){var l=t.paint.get(a);if(l instanceof s&&l.property.specification["property-function"]){var u=n(a,t.type),c=l.property.specification.type,p=l.property.useIntegerZoom;"constant"===l.value.kind?(i.binders[a]=new h(l.value,u,c),o.push("/u_"+u)):"source"===l.value.kind?(i.binders[a]=new f(l.value,u,c),o.push("/a_"+u)):(i.binders[a]=new d(l.value,u,c,p,e),o.push("/z_"+u))}}return i.cacheKey=o.sort().join(""),i},m.prototype.populatePaintArrays=function(t,e){for(var r in this.binders)this.binders[r].populatePaintArray(t,e)},m.prototype.defines=function(){var t=[];for(var e in this.binders)t.push.apply(t,this.binders[e].defines());return t},m.prototype.setUniforms=function(t,e,r,i){for(var n in this.binders)this.binders[n].setUniforms(t,e,i,r.get(n))},m.prototype.getPaintVertexBuffers=function(){return this._buffers},m.prototype.upload=function(t){var e=this;for(var r in e.binders)e.binders[r].upload(t);var i=[];for(var n in e.binders){var o=e.binders[n];(o instanceof f||o instanceof d)&&o.paintVertexBuffer&&i.push(o.paintVertexBuffer)}this._buffers=i},m.prototype.destroy=function(){for(var t in this.binders)this.binders[t].destroy()};var y=function(t,e,r,i){void 0===i&&(i=function(){return!0}),this.programConfigurations={};for(var n=0,o=e;n<o.length;n+=1){var a=o[n];this.programConfigurations[a.id]=m.createDynamic(a,r,i),this.programConfigurations[a.id].layoutAttributes=t}};y.prototype.populatePaintArrays=function(t,e){for(var r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(t,e)},y.prototype.get=function(t){return this.programConfigurations[t]},y.prototype.upload=function(t){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t)},y.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},a("ConstantBinder",h),a("SourceExpressionBinder",f),a("CompositeExpressionBinder",d),a("ProgramConfiguration",m,{omit:["_buffers"]}),a("ProgramConfigurationSet",y),e.exports={ProgramConfiguration:m,ProgramConfigurationSet:y}},{"../shaders/encode_attribute":96,"../style-spec/util/color":153,"../style/properties":188,"../util/web_worker_transfer":278,"./array_types":39}],59:[function(t,e,r){"use strict";var i=t("../util/struct_array").createLayout;e.exports=i([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}])},{"../util/struct_array":271}],60:[function(t,e,r){"use strict";var i=t("../util/util").warnOnce,n=t("../util/web_worker_transfer").register,o=Math.pow(2,16)-1,a=function(t){void 0===t&&(t=[]),this.segments=t};a.prototype.prepareSegment=function(t,r,n){var a=this.segments[this.segments.length-1];return o<t&&i("Max vertices per segment is "+o+": bucket requested "+t),(!a||a.vertexLength+t>e.exports.MAX_VERTEX_ARRAY_LENGTH)&&(a={vertexOffset:r.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},this.segments.push(a)),a},a.prototype.get=function(){return this.segments},a.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()}},n("SegmentVector",a),e.exports={SegmentVector:a,MAX_VERTEX_ARRAY_LENGTH:o}},{"../util/util":275,"../util/web_worker_transfer":278}],61:[function(t,e,r){"use strict";var i=function(t,e,r){this.column=t,this.row=e,this.zoom=r};i.prototype.clone=function(){return new i(this.column,this.row,this.zoom)},i.prototype.zoomTo=function(t){return this.clone()._zoomTo(t)},i.prototype.sub=function(t){return this.clone()._sub(t)},i.prototype._zoomTo=function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},i.prototype._sub=function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this},e.exports=i},{}],62:[function(t,e,r){"use strict";var i=t("../util/util").wrap,n=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,90<this.lat||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},n.prototype.toBounds=function(e){var r=360*e/40075017,i=r/Math.cos(Math.PI/180*this.lat);return new(t("./lng_lat_bounds"))(new n(this.lng-i,this.lat-r),new n(this.lng+i,this.lat+r))},n.convert=function(t){if(t instanceof n)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new n(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new n(Number(t.lng),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")},e.exports=n},{"../util/util":275,"./lng_lat_bounds":63}],63:[function(t,e,r){"use strict";var i=t("./lng_lat"),n=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]))};n.prototype.setNorthEast=function(t){return this._ne=t instanceof i?new i(t.lng,t.lat):i.convert(t),this},n.prototype.setSouthWest=function(t){return this._sw=t instanceof i?new i(t.lng,t.lat):i.convert(t),this},n.prototype.extend=function(t){var e,r,o=this._sw,a=this._ne;if(t instanceof i)r=e=t;else{if(!(t instanceof n))return Array.isArray(t)?t.every(Array.isArray)?this.extend(n.convert(t)):this.extend(i.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return o||a?(o.lng=Math.min(e.lng,o.lng),o.lat=Math.min(e.lat,o.lat),a.lng=Math.max(r.lng,a.lng),a.lat=Math.max(r.lat,a.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},n.prototype.getCenter=function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},n.prototype.getSouthWest=function(){return this._sw},n.prototype.getNorthEast=function(){return this._ne},n.prototype.getNorthWest=function(){return new i(this.getWest(),this.getNorth())},n.prototype.getSouthEast=function(){return new i(this.getEast(),this.getSouth())},n.prototype.getWest=function(){return this._sw.lng},n.prototype.getSouth=function(){return this._sw.lat},n.prototype.getEast=function(){return this._ne.lng},n.prototype.getNorth=function(){return this._ne.lat},n.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},n.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},n.prototype.isEmpty=function(){return!(this._sw&&this._ne)},n.convert=function(t){return!t||t instanceof n?t:new n(t)},e.exports=n},{"./lng_lat":62}],64:[function(t,e,r){"use strict";var i=t("./lng_lat"),n=t("@mapbox/point-geometry"),o=t("./coordinate"),a=t("../util/util"),s=t("../style-spec/util/interpolate").number,l=t("../util/tile_cover"),u=t("../source/tile_id"),c=(u.CanonicalTileID,u.UnwrappedTileID),p=t("../data/extent"),h=t("@mapbox/gl-matrix"),f=h.vec4,d=h.mat4,m=h.mat2,y=function(t,e,r){this.tileSize=512,this._renderWorldCopies=void 0===r||r,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={}},_={minZoom:{},maxZoom:{},renderWorldCopies:{},worldSize:{},centerPoint:{},size:{},bearing:{},pitch:{},fov:{},zoom:{},center:{},unmodified:{},x:{},y:{},point:{}};y.prototype.clone=function(){var t=new y(this._minZoom,this._maxZoom,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._calcMatrices(),t},_.minZoom.get=function(){return this._minZoom},_.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},_.maxZoom.get=function(){return this._maxZoom},_.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},_.renderWorldCopies.get=function(){return this._renderWorldCopies},_.worldSize.get=function(){return this.tileSize*this.scale},_.centerPoint.get=function(){return this.size._div(2)},_.size.get=function(){return new n(this.width,this.height)},_.bearing.get=function(){return-this.angle/Math.PI*180},_.bearing.set=function(t){var e=-a.wrap(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=m.create(),m.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},_.pitch.get=function(){return this._pitch/Math.PI*180},_.pitch.set=function(t){var e=a.clamp(t,0,60)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},_.fov.get=function(){return this._fov/Math.PI*180},_.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())},_.zoom.get=function(){return this._zoom},_.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())},_.center.get=function(){return this._center},_.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},y.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},y.prototype.getVisibleUnwrappedCoordinates=function(t){var e=this.pointCoordinate(new n(0,0),0),r=this.pointCoordinate(new n(this.width,0),0),i=Math.floor(e.column),o=Math.floor(r.column),a=[new c(0,t)];if(this._renderWorldCopies)for(var s=i;s<=o;s++)0!==s&&a.push(new c(s,t));return a},y.prototype.coveringTiles=function(t){var e=this.coveringZoomLevel(t),r=e;if(void 0!==t.minzoom&&e<t.minzoom)return[];void 0!==t.maxzoom&&e>t.maxzoom&&(e=t.maxzoom);var i=this.pointCoordinate(this.centerPoint,e),o=new n(i.column-.5,i.row-.5),a=[this.pointCoordinate(new n(0,0),e),this.pointCoordinate(new n(this.width,0),e),this.pointCoordinate(new n(this.width,this.height),e),this.pointCoordinate(new n(0,this.height),e)];return l(e,a,t.reparseOverscaled?r:e,this._renderWorldCopies).sort(function(t,e){return o.dist(t.canonical)-o.dist(e.canonical)})},y.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},_.unmodified.get=function(){return this._unmodified},y.prototype.zoomScale=function(t){return Math.pow(2,t)},y.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},y.prototype.project=function(t){return new n(this.lngX(t.lng),this.latY(t.lat))},y.prototype.unproject=function(t){return new i(this.xLng(t.x),this.yLat(t.y))},_.x.get=function(){return this.lngX(this.center.lng)},_.y.get=function(){return this.latY(this.center.lat)},_.point.get=function(){return new n(this.x,this.y)},y.prototype.lngX=function(t){return(180+t)*this.worldSize/360},y.prototype.latY=function(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*this.worldSize/360},y.prototype.xLng=function(t){return 360*t/this.worldSize-180},y.prototype.yLat=function(t){var e=180-360*t/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90},y.prototype.setLocationAtPoint=function(t,e){var r=this.pointCoordinate(e)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(t)._sub(r)),this._renderWorldCopies&&(this.center=this.center.wrap())},y.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},y.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},y.prototype.locationCoordinate=function(t){return new o(this.lngX(t.lng)/this.tileSize,this.latY(t.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)},y.prototype.coordinateLocation=function(t){var e=t.zoomTo(this.zoom);return new i(this.xLng(e.column*this.tileSize),this.yLat(e.row*this.tileSize))},y.prototype.pointCoordinate=function(t,e){void 0===e&&(e=this.tileZoom);var r=[t.x,t.y,0,1],i=[t.x,t.y,1,1];f.transformMat4(r,r,this.pixelMatrixInverse),f.transformMat4(i,i,this.pixelMatrixInverse);var n=r[3],a=i[3],l=r[1]/n,u=i[1]/a,c=r[2]/n,p=i[2]/a,h=c===p?0:(0-c)/(p-c);return new o(s(r[0]/n,i[0]/a,h)/this.tileSize,s(l,u,h)/this.tileSize,this.zoom)._zoomTo(e)},y.prototype.coordinatePoint=function(t){var e=t.zoomTo(this.zoom),r=[e.column*this.tileSize,e.row*this.tileSize,0,1];return f.transformMat4(r,r,this.pixelMatrix),new n(r[0]/r[3],r[1]/r[3])},y.prototype.calculatePosMatrix=function(t,e){void 0===e&&(e=!1);var r=t.key,i=e?this._alignedPosMatrixCache:this._posMatrixCache;if(i[r])return i[r];var n=t.canonical,o=this.worldSize/this.zoomScale(n.z),a=n.x+Math.pow(2,n.z)*t.wrap,s=d.identity(new Float64Array(16));return d.translate(s,s,[a*o,n.y*o,0]),d.scale(s,s,[o/p,o/p,1]),d.multiply(s,e?this.alignedProjMatrix:this.projMatrix,s),i[r]=new Float32Array(s),i[r]},y.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,i,o=-90,a=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var p=this.latRange;o=this.latY(p[1]),t=(a=this.latY(p[0]))-o<u.y?u.y/(a-o):0}if(this.lngRange){var h=this.lngRange;s=this.lngX(h[0]),e=(l=this.lngX(h[1]))-s<u.x?u.x/(l-s):0}var f=Math.max(e||0,t||0);if(f)return this.center=this.unproject(new n(e?(l+s)/2:this.x,t?(a+o)/2:this.y)),this.zoom+=this.scaleZoom(f),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var d=this.y,m=u.y/2;d-m<o&&(i=o+m),a<d+m&&(i=a-m)}if(this.lngRange){var y=this.x,_=u.x/2;y-_<s&&(r=s+_),l<y+_&&(r=l-_)}void 0===r&&void 0===i||(this.center=this.unproject(new n(void 0!==r?r:this.x,void 0!==i?i:this.y))),this._unmodified=c,this._constraining=!1}},y.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var t=this._fov/2,e=Math.PI/2+this._pitch,r=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-e-t),i=this.x,n=this.y,o=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),a=new Float64Array(16);d.perspective(a,this._fov,this.width/this.height,1,o),d.scale(a,a,[1,-1,1]),d.translate(a,a,[0,0,-this.cameraToCenterDistance]),d.rotateX(a,a,this._pitch),d.rotateZ(a,a,this.angle),d.translate(a,a,[-i,-n,0]);var s=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));d.scale(a,a,[1,1,s,1]),this.projMatrix=a;var l=this.width%2/2,u=this.height%2/2,c=Math.cos(this.angle),p=Math.sin(this.angle),h=i-Math.round(i)+c*l+p*u,f=n-Math.round(n)+c*u+p*l,m=new Float64Array(a);if(d.translate(m,m,[.5<h?h-1:h,.5<f?f-1:f,0]),this.alignedProjMatrix=m,a=d.create(),d.scale(a,a,[this.width/2,-this.height/2,1]),d.translate(a,a,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),a,this.projMatrix),!(a=d.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=a,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Object.defineProperties(y.prototype,_),e.exports=y},{"../data/extent":53,"../source/tile_id":114,"../style-spec/util/interpolate":158,"../util/tile_cover":273,"../util/util":275,"./coordinate":61,"./lng_lat":62,"@mapbox/gl-matrix":2,"@mapbox/point-geometry":4}],65:[function(t,e,r){"use strict";var i=t("../style-spec/util/color"),n=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};n.disabled=new n(n.Replace=[1,0],i.transparent,[!1,!1,!1,!1]),n.unblended=new n(n.Replace,i.transparent,[!0,!0,!0,!0]),n.alphaBlended=new n([1,771],i.transparent,[!0,!0,!0,!0]),e.exports=n},{"../style-spec/util/color":153}],66:[function(t,e,r){"use strict";var i=t("./index_buffer"),n=t("./vertex_buffer"),o=t("./framebuffer"),a=(t("./depth_mode"),t("./stencil_mode"),t("./color_mode")),s=t("../util/util"),l=t("./value"),u=l.ClearColor,c=l.ClearDepth,p=l.ClearStencil,h=l.ColorMask,f=l.DepthMask,d=l.StencilMask,m=l.StencilFunc,y=l.StencilOp,_=l.StencilTest,g=l.DepthRange,v=l.DepthTest,x=l.DepthFunc,b=l.Blend,w=l.BlendFunc,S=l.BlendColor,A=l.Program,T=l.LineWidth,z=l.ActiveTextureUnit,E=l.Viewport,k=l.BindFramebuffer,C=l.BindRenderbuffer,I=l.BindTexture,M=l.BindVertexBuffer,P=l.BindElementBuffer,L=l.BindVertexArrayOES,D=l.PixelStoreUnpack,B=l.PixelStoreUnpackPremultiplyAlpha,R=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.lineWidthRange=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE),this.clearColor=new u(this),this.clearDepth=new c(this),this.clearStencil=new p(this),this.colorMask=new h(this),this.depthMask=new f(this),this.stencilMask=new d(this),this.stencilFunc=new m(this),this.stencilOp=new y(this),this.stencilTest=new _(this),this.depthRange=new g(this),this.depthTest=new v(this),this.depthFunc=new x(this),this.blend=new b(this),this.blendFunc=new w(this),this.blendColor=new S(this),this.program=new A(this),this.lineWidth=new T(this),this.activeTexture=new z(this),this.viewport=new E(this),this.bindFramebuffer=new k(this),this.bindRenderbuffer=new C(this),this.bindTexture=new I(this),this.bindVertexBuffer=new M(this),this.bindElementBuffer=new P(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new L(this),this.pixelStoreUnpack=new D(this),this.pixelStoreUnpackPremultiplyAlpha=new B(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")};R.prototype.createIndexBuffer=function(t,e){return new i(this,t,e)},R.prototype.createVertexBuffer=function(t,e,r){return new n(this,t,e,r)},R.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},R.prototype.createFramebuffer=function(t,e){return new o(this,t,e)},R.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.clearDepth.set(r),this.depthMask.set(!0)),i.clear(n)},R.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)},R.prototype.setStencilMode=function(t){t.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)},R.prototype.setColorMode=function(t){s.deepEqual(t.blendFunction,a.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)},e.exports=R},{"../util/util":275,"./color_mode":65,"./depth_mode":67,"./framebuffer":68,"./index_buffer":69,"./stencil_mode":70,"./value":71,"./vertex_buffer":72}],67:[function(t,e,r){"use strict";var i=function(t,e,r){this.func=t,this.mask=e,this.range=r};i.ReadOnly=!1,i.ReadWrite=!0,i.disabled=new i(519,i.ReadOnly,[0,1]),e.exports=i},{}],68:[function(t,e,r){"use strict";var i=t("./value"),n=i.ColorAttachment,o=i.DepthAttachment,a=function(t,e,r){this.context=t,this.width=e,this.height=r;var i=t.gl,a=this.framebuffer=i.createFramebuffer();this.colorAttachment=new n(t,a),this.depthAttachment=new o(t,a)};a.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();e&&t.deleteTexture(e);var r=this.depthAttachment.get();r&&t.deleteRenderbuffer(r),t.deleteFramebuffer(this.framebuffer)},e.exports=a},{"./value":71}],69:[function(t,e,r){"use strict";var i=function(t,e,r){var i=(this.context=t).gl;this.buffer=i.createBuffer(),this.dynamicDraw=Boolean(r),this.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};i.prototype.unbindVAO=function(){this.context.extVertexArrayObject&&this.context.bindVertexArrayOES.set(null)},i.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},i.prototype.updateData=function(t){var e=this.context.gl;this.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},i.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)},e.exports=i},{}],70:[function(t,e,r){"use strict";var i=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};i.disabled=new i({func:519,mask:0},0,0,7680,7680,7680),e.exports=i},{}],71:[function(t,e,r){"use strict";var i=t("../style-spec/util/color"),n=t("../util/util"),o=function(t){this.context=t,this.current=i.transparent};o.prototype.get=function(){return this.current},o.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.context.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t)};var a=function(t){this.context=t,this.current=1};a.prototype.get=function(){return this.current},a.prototype.set=function(t){this.current!==t&&(this.context.gl.clearDepth(t),this.current=t)};var s=function(t){this.context=t,this.current=0};s.prototype.get=function(){return this.current},s.prototype.set=function(t){this.current!==t&&(this.context.gl.clearStencil(t),this.current=t)};var l=function(t){this.context=t,this.current=[!0,!0,!0,!0]};l.prototype.get=function(){return this.current},l.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.context.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t)};var u=function(t){this.context=t,this.current=!0};u.prototype.get=function(){return this.current},u.prototype.set=function(t){this.current!==t&&(this.context.gl.depthMask(t),this.current=t)};var c=function(t){this.context=t,this.current=255};c.prototype.get=function(){return this.current},c.prototype.set=function(t){this.current!==t&&(this.context.gl.stencilMask(t),this.current=t)};var p=function(t){this.context=t,this.current={func:t.gl.ALWAYS,ref:0,mask:255}};p.prototype.get=function(){return this.current},p.prototype.set=function(t){var e=this.current;t.func===e.func&&t.ref===e.ref&&t.mask===e.mask||(this.context.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t)};var h=function(t){this.context=t;var e=this.context.gl;this.current=[e.KEEP,e.KEEP,e.KEEP]};h.prototype.get=function(){return this.current},h.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]||(this.context.gl.stencilOp(t[0],t[1],t[2]),this.current=t)};var f=function(t){this.context=t,this.current=!1};f.prototype.get=function(){return this.current},f.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t}};var d=function(t){this.context=t,this.current=[0,1]};d.prototype.get=function(){return this.current},d.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]||(this.context.gl.depthRange(t[0],t[1]),this.current=t)};var m=function(t){this.context=t,this.current=!1};m.prototype.get=function(){return this.current},m.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t}};var y=function(t){this.context=t,this.current=t.gl.LESS};y.prototype.get=function(){return this.current},y.prototype.set=function(t){this.current!==t&&(this.context.gl.depthFunc(t),this.current=t)};var _=function(t){this.context=t,this.current=!1};_.prototype.get=function(){return this.current},_.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t}};var g=function(t){this.context=t;var e=this.context.gl;this.current=[e.ONE,e.ZERO]};g.prototype.get=function(){return this.current},g.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]||(this.context.gl.blendFunc(t[0],t[1]),this.current=t)};var v=function(t){this.context=t,this.current=i.transparent};v.prototype.get=function(){return this.current},v.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.context.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t)};var x=function(t){this.context=t,this.current=null};x.prototype.get=function(){return this.current},x.prototype.set=function(t){this.current!==t&&(this.context.gl.useProgram(t),this.current=t)};var b=function(t){this.context=t,this.current=1};b.prototype.get=function(){return this.current},b.prototype.set=function(t){var e=this.context.lineWidthRange,r=n.clamp(t,e[0],e[1]);this.current!==r&&(this.context.gl.lineWidth(r),this.current=t)};var w=function(t){this.context=t,this.current=t.gl.TEXTURE0};w.prototype.get=function(){return this.current},w.prototype.set=function(t){this.current!==t&&(this.context.gl.activeTexture(t),this.current=t)};var S=function(t){this.context=t;var e=this.context.gl;this.current=[0,0,e.drawingBufferWidth,e.drawingBufferHeight]};S.prototype.get=function(){return this.current},S.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.context.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t)};var A=function(t){this.context=t,this.current=null};A.prototype.get=function(){return this.current},A.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t}};var T=function(t){this.context=t,this.current=null};T.prototype.get=function(){return this.current},T.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t}};var z=function(t){this.context=t,this.current=null};z.prototype.get=function(){return this.current},z.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t}};var E=function(t){this.context=t,this.current=null};E.prototype.get=function(){return this.current},E.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t}};var k=function(t){this.context=t,this.current=null};k.prototype.get=function(){return this.current},k.prototype.set=function(t){var e=this.context.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t};var C=function(t){this.context=t,this.current=null};C.prototype.get=function(){return this.current},C.prototype.set=function(t){this.current!==t&&this.context.extVertexArrayObject&&(this.context.extVertexArrayObject.bindVertexArrayOES(t),this.current=t)};var I=function(t){this.context=t,this.current=4};I.prototype.get=function(){return this.current},I.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t}};var M=function(t){this.context=t,this.current=!1};M.prototype.get=function(){return this.current},M.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t}};var P=function(t,e){this.context=t,this.current=null,this.parent=e};P.prototype.get=function(){return this.current};var L=function(t){function e(e,r){t.call(this,e,r),this.dirty=!1}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.set=function(t){if(this.dirty||this.current!==t){var e=this.context.gl;this.context.bindFramebuffer.set(this.parent),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e.prototype.setDirty=function(){this.dirty=!0},e}(P),D=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.set=function(t){if(this.current!==t){var e=this.context.gl;this.context.bindFramebuffer.set(this.parent),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t}},e}(P);e.exports={ClearColor:o,ClearDepth:a,ClearStencil:s,ColorMask:l,DepthMask:u,StencilMask:c,StencilFunc:p,StencilOp:h,StencilTest:f,DepthRange:d,DepthTest:m,DepthFunc:y,Blend:_,BlendFunc:g,BlendColor:v,Program:x,LineWidth:b,ActiveTextureUnit:w,Viewport:S,BindFramebuffer:A,BindRenderbuffer:T,BindTexture:z,BindVertexBuffer:E,BindElementBuffer:k,BindVertexArrayOES:C,PixelStoreUnpack:I,PixelStoreUnpackPremultiplyAlpha:M,ColorAttachment:L,DepthAttachment:D}},{"../style-spec/util/color":153,"../util/util":275}],72:[function(t,e,r){"use strict";var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},n=function(t,e,r,i){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=i;var n=(this.context=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};n.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},n.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},n.prototype.enableAttributes=function(t,e){for(var r=0;r<this.attributes.length;r++){var i=this.attributes[r],n=e.attributes[i.name];void 0!==n&&t.enableVertexAttribArray(n)}},n.prototype.setVertexAttribPointers=function(t,e,r){for(var n=this,o=0;o<this.attributes.length;o++){var a=n.attributes[o],s=e.attributes[a.name];void 0!==s&&t.vertexAttribPointer(s,a.components,t[i[a.type]],!1,n.itemSize,a.offset+n.itemSize*(r||0))}},n.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)},e.exports=n},{}],73:[function(t,e,r){"use strict";var i=t("@mapbox/mapbox-gl-supported"),n=t("./util/browser"),o=t("../package.json").version,a=t("./ui/map"),s=t("./ui/control/navigation_control"),l=t("./ui/control/geolocate_control"),u=t("./ui/control/attribution_control"),c=t("./ui/control/scale_control"),p=t("./ui/control/fullscreen_control"),h=t("./ui/popup"),f=t("./ui/marker"),d=t("./style/style"),m=t("./geo/lng_lat"),y=t("./geo/lng_lat_bounds"),_=t("@mapbox/point-geometry"),g=t("./util/evented"),v=t("./util/config"),x=t("./source/rtl_text_plugin");e.exports={version:o,supported:i,workerCount:Math.max(Math.floor(n.hardwareConcurrency/2),1),setRTLTextPlugin:x.setRTLTextPlugin,Map:a,NavigationControl:s,GeolocateControl:l,AttributionControl:u,ScaleControl:c,FullscreenControl:p,Popup:h,Marker:f,Style:d,LngLat:m,LngLatBounds:y,Point:_,Evented:g,config:v,get accessToken(){return v.ACCESS_TOKEN},set accessToken(t){v.ACCESS_TOKEN=t}}},{"../package.json":38,"./geo/lng_lat":62,"./geo/lng_lat_bounds":63,"./source/rtl_text_plugin":109,"./style/style":190,"./ui/control/attribution_control":232,"./ui/control/fullscreen_control":233,"./ui/control/geolocate_control":234,"./ui/control/navigation_control":236,"./ui/control/scale_control":237,"./ui/map":247,"./ui/marker":248,"./ui/popup":249,"./util/browser":252,"./util/config":256,"./util/evented":260,"@mapbox/mapbox-gl-supported":3,"@mapbox/point-geometry":4}],74:[function(t,e,r){"use strict";var i=t("./pattern"),n=t("../gl/stencil_mode"),o=t("../gl/depth_mode");e.exports=function(t,e,r){var a=r.paint.get("background-color"),s=r.paint.get("background-opacity");if(0!==s){var l=t.context,u=l.gl,c=t.transform,p=c.tileSize,h=r.paint.get("background-pattern"),f=h||1!==a.a||1!==s?"translucent":"opaque";if(t.renderPass===f){var d;if(l.setStencilMode(n.disabled),l.setDepthMode(t.depthModeForSublayer(0,"opaque"===f?o.ReadWrite:o.ReadOnly)),l.setColorMode(t.colorModeForRenderPass()),h){if(i.isPatternMissing(h,t))return;d=t.useProgram("backgroundPattern"),i.prepare(h,t,d),t.tileExtentPatternVAO.bind(l,d,t.tileExtentBuffer,[])}else d=t.useProgram("background"),u.uniform4fv(d.uniforms.u_color,[a.r,a.g,a.b,a.a]),t.tileExtentVAO.bind(l,d,t.tileExtentBuffer,[]);u.uniform1f(d.uniforms.u_opacity,s);for(var m=0,y=c.coveringTiles({tileSize:p});m<y.length;m+=1){var _=y[m];h&&i.setTile({tileID:_,tileSize:p},t,d),u.uniformMatrix4fv(d.uniforms.u_matrix,!1,t.transform.calculatePosMatrix(_.toUnwrapped())),u.drawArrays(u.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}}}}},{"../gl/depth_mode":67,"../gl/stencil_mode":70,"./pattern":91}],75:[function(t,e,r){"use strict";var i=t("../source/pixels_to_tile_units"),n=t("../gl/stencil_mode"),o=t("../gl/depth_mode");e.exports=function(t,e,r,a){if("translucent"===t.renderPass){var s=r.paint.get("circle-opacity"),l=r.paint.get("circle-stroke-width"),u=r.paint.get("circle-stroke-opacity");if(0!==s.constantOr(1)||0!==l.constantOr(1)&&0!==u.constantOr(1)){var c=t.context,p=c.gl;c.setDepthMode(t.depthModeForSublayer(0,o.ReadOnly)),c.setStencilMode(n.disabled),c.setColorMode(t.colorModeForRenderPass());for(var h=!0,f=0;f<a.length;f++){var d=a[f],m=e.getTile(d),y=m.getBucket(r);if(y){var _=t.context.program.get(),g=y.programConfigurations.get(r.id),v=t.useProgram("circle",g);if((h||v.program!==_)&&(g.setUniforms(c,v,r.paint,{zoom:t.transform.zoom}),h=!1),p.uniform1f(v.uniforms.u_camera_to_center_distance,t.transform.cameraToCenterDistance),p.uniform1i(v.uniforms.u_scale_with_map,"map"===r.paint.get("circle-pitch-scale")?1:0),"map"===r.paint.get("circle-pitch-alignment")){p.uniform1i(v.uniforms.u_pitch_with_map,1);var x=i(m,1,t.transform.zoom);p.uniform2f(v.uniforms.u_extrude_scale,x,x)}else p.uniform1i(v.uniforms.u_pitch_with_map,0),p.uniform2fv(v.uniforms.u_extrude_scale,t.transform.pixelsToGLUnits);p.uniformMatrix4fv(v.uniforms.u_matrix,!1,t.translatePosMatrix(d.posMatrix,m,r.paint.get("circle-translate"),r.paint.get("circle-translate-anchor"))),v.draw(c,p.TRIANGLES,r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,g)}}}}}},{"../gl/depth_mode":67,"../gl/stencil_mode":70,"../source/pixels_to_tile_units":104}],76:[function(t,e,r){"use strict";function i(t,e,r,i,s){var l=t.context,u=l.gl,c=s?t.useProgram("collisionCircle"):t.useProgram("collisionBox");l.setDepthMode(o.disabled),l.setStencilMode(a.disabled),l.setColorMode(t.colorModeForRenderPass());for(var p=0;p<i.length;p++){var h=i[p],f=e.getTile(h),d=f.getBucket(r);if(d){var m=s?d.collisionCircle:d.collisionBox;if(m){u.uniformMatrix4fv(c.uniforms.u_matrix,!1,h.posMatrix),s||l.lineWidth.set(1),u.uniform1f(c.uniforms.u_camera_to_center_distance,t.transform.cameraToCenterDistance);var y=n(f,1,t.transform.zoom),_=Math.pow(2,t.transform.zoom-f.tileID.overscaledZ);u.uniform1f(c.uniforms.u_pixels_to_tile_units,y),u.uniform2f(c.uniforms.u_extrude_scale,t.transform.pixelsToGLUnits[0]/(y*_),t.transform.pixelsToGLUnits[1]/(y*_)),c.draw(l,s?u.TRIANGLES:u.LINES,r.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,null,m.collisionVertexBuffer,null)}}}}var n=t("../source/pixels_to_tile_units"),o=t("../gl/depth_mode"),a=t("../gl/stencil_mode");e.exports=function(t,e,r,n){i(t,e,r,n,!1),i(t,e,r,n,!0)}},{"../gl/depth_mode":67,"../gl/stencil_mode":70,"../source/pixels_to_tile_units":104}],77:[function(t,e,r){"use strict";function i(t,e,r){var i=t.context,f=i.gl;i.lineWidth.set(1*n.devicePixelRatio);var d=r.posMatrix,m=t.useProgram("debug");i.setDepthMode(c.disabled),i.setStencilMode(p.disabled),i.setColorMode(t.colorModeForRenderPass()),f.uniformMatrix4fv(m.uniforms.u_matrix,!1,d),f.uniform4f(m.uniforms.u_color,1,0,0,1),t.debugVAO.bind(i,m,t.debugBuffer,[]),f.drawArrays(f.LINE_STRIP,0,t.debugBuffer.length);for(var y=function(t,e,r,i){i=i||1;var n,o,a,s,l,u,c,p,f=[];for(n=0,o=t.length;n<o;n++)if(l=h[t[n]]){for(p=null,a=0,s=l[1].length;a<s;a+=2)-1===l[1][a]&&-1===l[1][a+1]?p=null:(u=e+l[1][a]*i,c=200-l[1][a+1]*i,p&&f.push(p.x,p.y,u,c),p={x:u,y:c});e+=l[0]*i}return f}(r.toString(),50,0,5),_=new l,g=0;g<y.length;g+=2)_.emplaceBack(y[g],y[g+1]);var v=i.createVertexBuffer(_,u.members);(new s).bind(i,m,v,[]),f.uniform4f(m.uniforms.u_color,1,1,1,1);for(var x=e.getTile(r).tileSize,b=a/(Math.pow(2,t.transform.zoom-r.overscaledZ)*x),w=[[-1,-1],[-1,1],[1,-1],[1,1]],S=0;S<w.length;S++){var A=w[S];f.uniformMatrix4fv(m.uniforms.u_matrix,!1,o.translate([],d,[b*A[0],b*A[1],0])),f.drawArrays(f.LINES,0,v.length)}f.uniform4f(m.uniforms.u_color,0,0,0,1),f.uniformMatrix4fv(m.uniforms.u_matrix,!1,d),f.drawArrays(f.LINES,0,v.length)}var n=t("../util/browser"),o=t("@mapbox/gl-matrix").mat4,a=t("../data/extent"),s=t("./vertex_array_object"),l=t("../data/array_types").PosArray,u=t("../data/pos_attributes"),c=t("../gl/depth_mode"),p=t("../gl/stencil_mode");e.exports=function(t,e,r){for(var n=0;n<r.length;n++)i(t,e,r[n])};var h={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]}},{"../data/array_types":39,"../data/extent":53,"../data/pos_attributes":57,"../gl/depth_mode":67,"../gl/stencil_mode":70,"../util/browser":252,"./vertex_array_object":95,"@mapbox/gl-matrix":2}],78:[function(t,e,r){"use strict";function i(t,e,r,i,n){if(!s.isPatternMissing(r.paint.get("fill-pattern"),t))for(var o=!0,a=0,l=i;a<l.length;a+=1){var u=l[a],c=e.getTile(u),p=c.getBucket(r);p&&(t.context.setStencilMode(t.stencilModeForClipping(u)),n(t,e,r,c,u,p,o),o=!1)}}function n(t,e,r,i,n,o,s){var l=t.context.gl,u=o.programConfigurations.get(r.id);a("fill",r.paint.get("fill-pattern"),t,u,r,i,n,s).draw(t.context,l.TRIANGLES,r.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,u)}function o(t,e,r,i,n,o,s){var l=t.context.gl,u=o.programConfigurations.get(r.id),c=a("fillOutline",r.getPaintProperty("fill-outline-color")?null:r.paint.get("fill-pattern"),t,u,r,i,n,s);l.uniform2f(c.uniforms.u_world,l.drawingBufferWidth,l.drawingBufferHeight),c.draw(t.context,l.LINES,r.id,o.layoutVertexBuffer,o.indexBuffer2,o.segments2,u)}function a(t,e,r,i,n,o,a,l){var u,c=r.context.program.get();return e?(u=r.useProgram(t+"Pattern",i),(l||u.program!==c)&&(i.setUniforms(r.context,u,n.paint,{zoom:r.transform.zoom}),s.prepare(e,r,u)),s.setTile(o,r,u)):(u=r.useProgram(t,i),(l||u.program!==c)&&i.setUniforms(r.context,u,n.paint,{zoom:r.transform.zoom})),r.context.gl.uniformMatrix4fv(u.uniforms.u_matrix,!1,r.translatePosMatrix(a.posMatrix,o,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"))),u}var s=t("./pattern"),l=t("../style-spec/util/color"),u=t("../gl/depth_mode");e.exports=function(t,e,r,a){var s=r.paint.get("fill-color"),c=r.paint.get("fill-opacity");if(0!==c.constantOr(1)){var p=t.context;p.setColorMode(t.colorModeForRenderPass());var h=r.paint.get("fill-pattern")||1!==s.constantOr(l.transparent).a||1!==c.constantOr(0)?"translucent":"opaque";t.renderPass===h&&(p.setDepthMode(t.depthModeForSublayer(1,"opaque"===t.renderPass?u.ReadWrite:u.ReadOnly)),i(t,e,r,a,n)),"translucent"===t.renderPass&&r.paint.get("fill-antialias")&&(p.lineWidth.set(2),p.setDepthMode(t.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,u.ReadOnly)),i(t,e,r,a,o))}}},{"../gl/depth_mode":67,"../style-spec/util/color":153,"./pattern":91}],79:[function(t,e,r){"use strict";function i(t,e,r,i,n,a,s){var l=t.context,c=l.gl,h=r.paint.get("fill-extrusion-pattern"),f=t.context.program.get(),d=a.programConfigurations.get(r.id),m=t.useProgram(h?"fillExtrusionPattern":"fillExtrusion",d);if((s||m.program!==f)&&d.setUniforms(l,m,r.paint,{zoom:t.transform.zoom}),h){if(o.isPatternMissing(h,t))return;o.prepare(h,t,m),o.setTile(i,t,m),c.uniform1f(m.uniforms.u_height_factor,-Math.pow(2,n.overscaledZ)/i.tileSize/8)}t.context.gl.uniformMatrix4fv(m.uniforms.u_matrix,!1,t.translatePosMatrix(n.posMatrix,i,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor"))),function(t,e){var r=e.context.gl,i=e.style.light,n=i.properties.get("position"),o=[n.x,n.y,n.z],a=u.create();"viewport"===i.properties.get("anchor")&&u.fromRotation(a,-e.transform.angle),p.transformMat3(o,o,a);var s=i.properties.get("color");r.uniform3fv(t.uniforms.u_lightpos,o),r.uniform1f(t.uniforms.u_lightintensity,i.properties.get("intensity")),r.uniform3f(t.uniforms.u_lightcolor,s.r,s.g,s.b)}(m,t),m.draw(l,c.TRIANGLES,r.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,d)}var n=t("@mapbox/gl-matrix"),o=t("./pattern"),a=t("./texture"),s=t("../style-spec/util/color"),l=t("../gl/depth_mode"),u=n.mat3,c=n.mat4,p=n.vec3,h=t("../gl/stencil_mode");e.exports=function(t,e,r,n){if(0!==r.paint.get("fill-extrusion-opacity"))if("offscreen"===t.renderPass){!function(t,e){var r=t.context,i=r.gl,n=e.viewportFrame;if(t.depthRboNeedsClear&&t.setupOffscreenDepthRenderbuffer(),!n){var o=new a(r,{width:t.width,height:t.height,data:null},i.RGBA);o.bind(i.LINEAR,i.CLAMP_TO_EDGE),(n=e.viewportFrame=r.createFramebuffer(t.width,t.height)).colorAttachment.set(o.texture)}r.bindFramebuffer.set(n.framebuffer),n.depthAttachment.set(t.depthRbo),t.depthRboNeedsClear&&(r.clear({depth:1}),t.depthRboNeedsClear=!1),r.clear({color:s.transparent}),r.setStencilMode(h.disabled),r.setDepthMode(new l(i.LEQUAL,l.ReadWrite,[0,1])),r.setColorMode(t.colorModeForRenderPass())}(t,r);for(var o=!0,u=0,p=n;u<p.length;u+=1){var f=p[u],d=e.getTile(f),m=d.getBucket(r);m&&(i(t,0,r,d,f,m,o),o=!1)}}else"translucent"===t.renderPass&&function(t,e){var r=e.viewportFrame;if(r){var i=t.context,n=i.gl,o=t.useProgram("extrusionTexture");i.setStencilMode(h.disabled),i.setDepthMode(l.disabled),i.setColorMode(t.colorModeForRenderPass()),i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,r.colorAttachment.get()),n.uniform1f(o.uniforms.u_opacity,e.paint.get("fill-extrusion-opacity")),n.uniform1i(o.uniforms.u_image,0);var a=c.create();c.ortho(a,0,t.width,t.height,0,0,1),n.uniformMatrix4fv(o.uniforms.u_matrix,!1,a),n.uniform2f(o.uniforms.u_world,n.drawingBufferWidth,n.drawingBufferHeight),t.viewportVAO.bind(i,o,t.viewportBuffer,[]),n.drawArrays(n.TRIANGLE_STRIP,0,4)}}(t,r)}},{"../gl/depth_mode":67,"../gl/stencil_mode":70,"../style-spec/util/color":153,"./pattern":91,"./texture":93,"@mapbox/gl-matrix":2}],80:[function(t,e,r){"use strict";var i=t("@mapbox/gl-matrix").mat4,n=t("./texture"),o=t("../source/pixels_to_tile_units"),a=t("../style-spec/util/color"),s=t("../gl/depth_mode"),l=t("../gl/stencil_mode"),u=t("../gl/color_mode");e.exports=function(t,e,r,c){if(0!==r.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){var p=t.context,h=p.gl;p.setDepthMode(t.depthModeForSublayer(0,s.ReadOnly)),p.setStencilMode(l.disabled),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),function t(e,r,i,n){var o=e.gl;o.texImage2D(o.TEXTURE_2D,0,o.RGBA,r.width/4,r.height/4,0,o.RGBA,e.extTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:o.UNSIGNED_BYTE,null),n.colorAttachment.set(i),e.extTextureHalfFloat&&o.checkFramebufferStatus(o.FRAMEBUFFER)!==o.FRAMEBUFFER_COMPLETE&&(e.extTextureHalfFloat=null,n.colorAttachment.setDirty(),t(e,r,i,n))}(t,e,o,n=r.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4))}}(p,t,r),p.clear({color:a.transparent}),p.setColorMode(new u([h.ONE,h.ONE],a.transparent,[!0,!0,!0,!0]));for(var f=!0,d=0;d<c.length;d++){var m=c[d];if(!e.hasRenderableParent(m)){var y=e.getTile(m),_=y.getBucket(r);if(_){var g=t.context.program.get(),v=_.programConfigurations.get(r.id),x=t.useProgram("heatmap",v),b=t.transform.zoom;(f||x.program!==g)&&(v.setUniforms(t.context,x,r.paint,{zoom:b}),f=!1),h.uniform1f(x.uniforms.u_extrude_scale,o(y,1,b)),h.uniform1f(x.uniforms.u_intensity,r.paint.get("heatmap-intensity")),h.uniformMatrix4fv(x.uniforms.u_matrix,!1,m.posMatrix),x.draw(p,h.TRIANGLES,r.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,v)}}}p.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,e){var r=t.context,o=r.gl,a=e.heatmapFbo;if(a){r.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,a.colorAttachment.get()),r.activeTexture.set(o.TEXTURE1);var l=e.colorRampTexture;l||(l=e.colorRampTexture=new n(r,e.colorRamp,o.RGBA)),l.bind(o.LINEAR,o.CLAMP_TO_EDGE),r.setDepthMode(s.disabled);var u=t.useProgram("heatmapTexture"),c=e.paint.get("heatmap-opacity");o.uniform1f(u.uniforms.u_opacity,c),o.uniform1i(u.uniforms.u_image,0),o.uniform1i(u.uniforms.u_color_ramp,1);var p=i.create();i.ortho(p,0,t.width,t.height,0,0,1),o.uniformMatrix4fv(u.uniforms.u_matrix,!1,p),o.uniform2f(u.uniforms.u_world,o.drawingBufferWidth,o.drawingBufferHeight),t.viewportVAO.bind(t.context,u,t.viewportBuffer,[]),o.drawArrays(o.TRIANGLE_STRIP,0,4)}}(t,r))}},{"../gl/color_mode":65,"../gl/depth_mode":67,"../gl/stencil_mode":70,"../source/pixels_to_tile_units":104,"../style-spec/util/color":153,"./texture":93,"@mapbox/gl-matrix":2}],81:[function(t,e,r){"use strict";function i(t,e,r){var i=t.context,n=i.gl,a=e.fbo;if(a){var s=t.useProgram("hillshade"),l=t.transform.calculatePosMatrix(e.tileID.toUnwrapped());!function(t,e,r){var i=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(i-=e.transform.angle),e.context.gl.uniform2f(t.uniforms.u_light,r.paint.get("hillshade-exaggeration"),i)}(s,t,r);var u=function(t,e){var r=e.toCoordinate(),i=new o(r.column,r.row+1,r.zoom);return[t.transform.coordinateLocation(r).lat,t.transform.coordinateLocation(i).lat]}(t,e.tileID);i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,a.colorAttachment.get()),n.uniformMatrix4fv(s.uniforms.u_matrix,!1,l),n.uniform2fv(s.uniforms.u_latrange,u),n.uniform1i(s.uniforms.u_image,0);var c=r.paint.get("hillshade-shadow-color");n.uniform4f(s.uniforms.u_shadow,c.r,c.g,c.b,c.a);var p=r.paint.get("hillshade-highlight-color");n.uniform4f(s.uniforms.u_highlight,p.r,p.g,p.b,p.a);var h=r.paint.get("hillshade-accent-color");if(n.uniform4f(s.uniforms.u_accent,h.r,h.g,h.b,h.a),e.maskedBoundsBuffer&&e.maskedIndexBuffer&&e.segments)s.draw(i,n.TRIANGLES,r.id,e.maskedBoundsBuffer,e.maskedIndexBuffer,e.segments);else{var f=t.rasterBoundsBuffer;t.rasterBoundsVAO.bind(i,s,f,[]),n.drawArrays(n.TRIANGLE_STRIP,0,f.length)}}}function n(t,e){var r=t.context,i=r.gl;if(e.dem&&e.dem.level){var n=e.dem.level.dim,o=e.dem.getPixels();if(r.activeTexture.set(i.TEXTURE1),r.pixelStoreUnpackPremultiplyAlpha.set(!1),e.demTexture=e.demTexture||t.getTileTexture(e.tileSize),e.demTexture){var u=e.demTexture;u.update(o,!1),u.bind(i.NEAREST,i.CLAMP_TO_EDGE)}else e.demTexture=new a(r,o,i.RGBA,!1),e.demTexture.bind(i.NEAREST,i.CLAMP_TO_EDGE);r.activeTexture.set(i.TEXTURE0);var c=e.fbo;if(!c){var p=new a(r,{width:n,height:n,data:null},i.RGBA);p.bind(i.LINEAR,i.CLAMP_TO_EDGE),(c=e.fbo=r.createFramebuffer(n,n)).colorAttachment.set(p.texture)}r.bindFramebuffer.set(c.framebuffer),r.viewport.set([0,0,n,n]);var h=l.create();l.ortho(h,0,s,-s,0,0,1),l.translate(h,h,[0,-s,0]);var f=t.useProgram("hillshadePrepare");i.uniformMatrix4fv(f.uniforms.u_matrix,!1,h),i.uniform1f(f.uniforms.u_zoom,e.tileID.overscaledZ),i.uniform2fv(f.uniforms.u_dimension,[2*n,2*n]),i.uniform1i(f.uniforms.u_image,1);var d=t.rasterBoundsBuffer;t.rasterBoundsVAO.bind(r,f,d,[]),i.drawArrays(i.TRIANGLE_STRIP,0,d.length),e.needsHillshadePrepare=!1}}var o=t("../geo/coordinate"),a=t("./texture"),s=t("../data/extent"),l=t("@mapbox/gl-matrix").mat4,u=t("../gl/stencil_mode"),c=t("../gl/depth_mode");e.exports=function(t,e,r,o){if("offscreen"===t.renderPass||"translucent"===t.renderPass){var a=t.context;a.setDepthMode(t.depthModeForSublayer(0,c.ReadOnly)),a.setStencilMode(u.disabled),a.setColorMode(t.colorModeForRenderPass());for(var s=0,l=o;s<l.length;s+=1){var p=l[s],h=e.getTile(p);h.needsHillshadePrepare&&"offscreen"===t.renderPass?n(t,h):"translucent"===t.renderPass&&i(t,h,r)}a.viewport.set([0,0,t.width,t.height])}}},{"../data/extent":53,"../geo/coordinate":61,"../gl/depth_mode":67,"../gl/stencil_mode":70,"./texture":93,"@mapbox/gl-matrix":2}],82:[function(t,e,r){"use strict";function i(t,e,r,i,a,s,l,u,c){var p,h,f,d,m=e.context,y=m.gl,_=a.paint.get("line-dasharray"),g=a.paint.get("line-pattern");if(u||c){var v=1/o(r,1,e.transform.tileZoom);if(_){p=e.lineAtlas.getDash(_.from,"round"===a.layout.get("line-cap")),h=e.lineAtlas.getDash(_.to,"round"===a.layout.get("line-cap"));var x=p.width*_.fromScale,b=h.width*_.toScale;y.uniform2f(t.uniforms.u_patternscale_a,v/x,-p.height/2),y.uniform2f(t.uniforms.u_patternscale_b,v/b,-h.height/2),y.uniform1f(t.uniforms.u_sdfgamma,e.lineAtlas.width/(256*Math.min(x,b)*n.devicePixelRatio)/2)}else if(g){if(f=e.imageManager.getPattern(g.from),d=e.imageManager.getPattern(g.to),!f||!d)return;y.uniform2f(t.uniforms.u_pattern_size_a,f.displaySize[0]*g.fromScale/v,d.displaySize[1]),y.uniform2f(t.uniforms.u_pattern_size_b,d.displaySize[0]*g.toScale/v,d.displaySize[1]);var w=e.imageManager.getPixelSize(),S=w.width,A=w.height;y.uniform2fv(t.uniforms.u_texsize,[S,A])}y.uniform2f(t.uniforms.u_gl_units_to_pixels,1/e.transform.pixelsToGLUnits[0],1/e.transform.pixelsToGLUnits[1])}u&&(_?(y.uniform1i(t.uniforms.u_image,0),m.activeTexture.set(y.TEXTURE0),e.lineAtlas.bind(m),y.uniform1f(t.uniforms.u_tex_y_a,p.y),y.uniform1f(t.uniforms.u_tex_y_b,h.y),y.uniform1f(t.uniforms.u_mix,_.t)):g&&(y.uniform1i(t.uniforms.u_image,0),m.activeTexture.set(y.TEXTURE0),e.imageManager.bind(m),y.uniform2fv(t.uniforms.u_pattern_tl_a,f.tl),y.uniform2fv(t.uniforms.u_pattern_br_a,f.br),y.uniform2fv(t.uniforms.u_pattern_tl_b,d.tl),y.uniform2fv(t.uniforms.u_pattern_br_b,d.br),y.uniform1f(t.uniforms.u_fade,g.t))),m.setStencilMode(e.stencilModeForClipping(s));var T=e.translatePosMatrix(s.posMatrix,r,a.paint.get("line-translate"),a.paint.get("line-translate-anchor"));y.uniformMatrix4fv(t.uniforms.u_matrix,!1,T),y.uniform1f(t.uniforms.u_ratio,1/o(r,1,e.transform.zoom)),t.draw(m,y.TRIANGLES,a.id,i.layoutVertexBuffer,i.indexBuffer,i.segments,l)}var n=t("../util/browser"),o=t("../source/pixels_to_tile_units"),a=t("../gl/depth_mode");e.exports=function(t,e,r,n){if("translucent"===t.renderPass&&0!==r.paint.get("line-opacity").constantOr(1)){var o=t.context;o.setDepthMode(t.depthModeForSublayer(0,a.ReadOnly)),o.setColorMode(t.colorModeForRenderPass());for(var s,l=r.paint.get("line-dasharray")?"lineSDF":r.paint.get("line-pattern")?"linePattern":"line",u=!0,c=0,p=n;c<p.length;c+=1){var h=p[c],f=e.getTile(h),d=f.getBucket(r);if(d){var m=d.programConfigurations.get(r.id),y=t.context.program.get(),_=t.useProgram(l,m),g=u||_.program!==y,v=s!==f.tileID.overscaledZ;g&&m.setUniforms(t.context,_,r.paint,{zoom:t.transform.zoom}),i(_,t,f,d,r,h,m,g,v),s=f.tileID.overscaledZ,u=!1}}}}},{"../gl/depth_mode":67,"../source/pixels_to_tile_units":104,"../util/browser":252}],83:[function(t,e,r){"use strict";function i(t,e,r,i,o){var s=i.paint.get("raster-fade-duration");if(0<s){var l=a.now(),u=(l-t.timeAdded)/s,c=e?(l-e.timeAdded)/s:-1,p=r.getSource(),h=o.coveringZoomLevel({tileSize:p.tileSize,roundZoom:p.roundZoom}),f=!e||Math.abs(e.tileID.overscaledZ-h)>Math.abs(t.tileID.overscaledZ-h),d=f&&t.refreshedUponExpiration?1:n.clamp(f?u:1-c,0,1);return t.refreshedUponExpiration&&1<=u&&(t.refreshedUponExpiration=!1),e?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}var n=t("../util/util"),o=t("../source/image_source"),a=t("../util/browser"),s=t("../gl/stencil_mode"),l=t("../gl/depth_mode");e.exports=function(t,e,r,n){if("translucent"===t.renderPass&&0!==r.paint.get("raster-opacity")){var a=t.context,u=a.gl,c=e.getSource(),p=t.useProgram("raster");a.setStencilMode(s.disabled),a.setColorMode(t.colorModeForRenderPass()),u.uniform1f(p.uniforms.u_brightness_low,r.paint.get("raster-brightness-min")),u.uniform1f(p.uniforms.u_brightness_high,r.paint.get("raster-brightness-max")),u.uniform1f(p.uniforms.u_saturation_factor,function(t){return 0<t?1-1/(1.001-t):-t}(r.paint.get("raster-saturation"))),u.uniform1f(p.uniforms.u_contrast_factor,function(t){return 0<t?1/(1-t):1+t}(r.paint.get("raster-contrast"))),u.uniform3fv(p.uniforms.u_spin_weights,function(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]}(r.paint.get("raster-hue-rotate"))),u.uniform1f(p.uniforms.u_buffer_scale,1),u.uniform1i(p.uniforms.u_image0,0),u.uniform1i(p.uniforms.u_image1,1);for(var h=n.length&&n[0].overscaledZ,f=0,d=n;f<d.length;f+=1){var m=d[f];a.setDepthMode(t.depthModeForSublayer(m.overscaledZ-h,1===r.paint.get("raster-opacity")?l.ReadWrite:l.ReadOnly,u.LESS));var y=e.getTile(m),_=t.transform.calculatePosMatrix(m.toUnwrapped(),!0);y.registerFadeDuration(r.paint.get("raster-fade-duration")),u.uniformMatrix4fv(p.uniforms.u_matrix,!1,_);var g=e.findLoadedParent(m,0,{}),v=i(y,g,e,r,t.transform),x=void 0,b=void 0;if(a.activeTexture.set(u.TEXTURE0),y.texture.bind(u.LINEAR,u.CLAMP_TO_EDGE,u.LINEAR_MIPMAP_NEAREST),a.activeTexture.set(u.TEXTURE1),g?(g.texture.bind(u.LINEAR,u.CLAMP_TO_EDGE,u.LINEAR_MIPMAP_NEAREST),x=Math.pow(2,g.tileID.overscaledZ-y.tileID.overscaledZ),b=[y.tileID.canonical.x*x%1,y.tileID.canonical.y*x%1]):y.texture.bind(u.LINEAR,u.CLAMP_TO_EDGE,u.LINEAR_MIPMAP_NEAREST),u.uniform2fv(p.uniforms.u_tl_parent,b||[0,0]),u.uniform1f(p.uniforms.u_scale_parent,x||1),u.uniform1f(p.uniforms.u_fade_t,v.mix),u.uniform1f(p.uniforms.u_opacity,v.opacity*r.paint.get("raster-opacity")),c instanceof o){var w=c.boundsBuffer;c.boundsVAO.bind(a,p,w,[]),u.drawArrays(u.TRIANGLE_STRIP,0,w.length)}else if(y.maskedBoundsBuffer&&y.maskedIndexBuffer&&y.segments)p.draw(a,u.TRIANGLES,r.id,y.maskedBoundsBuffer,y.maskedIndexBuffer,y.segments);else{var S=t.rasterBoundsBuffer;t.rasterBoundsVAO.bind(a,p,S,[]),u.drawArrays(u.TRIANGLE_STRIP,0,S.length)}}}}},{"../gl/depth_mode":67,"../gl/stencil_mode":70,"../source/image_source":102,"../util/browser":252,"../util/util":275}],84:[function(t,e,r){"use strict";function i(t,e,r,i,a,s,c,h,f,m){var y=t.context,_=y.gl,g=t.transform,v="map"===h,x="map"===f,b=v&&"line"===r.layout.get("symbol-placement"),w=v&&!x&&!b,S=x;y.setDepthMode(S?t.depthModeForSublayer(0,d.ReadOnly):d.disabled);for(var A,T=0,z=i;T<z.length;T+=1){var E=z[T],k=e.getTile(E),C=k.getBucket(r);if(C){var I=a?C.text:C.icon;if(I&&I.segments.get().length){var M=I.programConfigurations.get(r.id),P=a||C.sdfIcons,L=a?C.textSizeData:C.iconSizeData;if(A||(A=t.useProgram(P?"symbolSDF":"symbolIcon",M),M.setUniforms(t.context,A,r.paint,{zoom:t.transform.zoom}),n(A,t,r,a,w,x,L)),y.activeTexture.set(_.TEXTURE0),_.uniform1i(A.uniforms.u_texture,0),a)k.glyphAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),_.uniform2fv(A.uniforms.u_texsize,k.glyphAtlasTexture.size);else{var D=1!==r.layout.get("icon-size").constantOr(0)||C.iconsNeedLinear,B=x||0!==g.pitch;k.iconAtlasTexture.bind(P||t.options.rotating||t.options.zooming||D||B?_.LINEAR:_.NEAREST,_.CLAMP_TO_EDGE),_.uniform2fv(A.uniforms.u_texsize,k.iconAtlasTexture.size)}_.uniformMatrix4fv(A.uniforms.u_matrix,!1,t.translatePosMatrix(E.posMatrix,k,s,c));var R=l(k,1,t.transform.zoom),O=u.getLabelPlaneMatrix(E.posMatrix,x,v,t.transform,R),F=u.getGlCoordMatrix(E.posMatrix,x,v,t.transform,R);_.uniformMatrix4fv(A.uniforms.u_gl_coord_matrix,!1,t.translatePosMatrix(F,k,s,c,!0)),b?(_.uniformMatrix4fv(A.uniforms.u_label_plane_matrix,!1,p),u.updateLineLabels(C,E.posMatrix,t,a,O,F,x,m)):_.uniformMatrix4fv(A.uniforms.u_label_plane_matrix,!1,O),_.uniform1f(A.uniforms.u_fade_change,t.options.fadeDuration?t.symbolFadeChange:1),o(A,M,t,r,k,I,a,P,x)}}}}function n(t,e,r,i,n,o,a){var s=e.context.gl,l=e.transform;s.uniform1i(t.uniforms.u_pitch_with_map,o?1:0),s.uniform1f(t.uniforms.u_is_text,i?1:0),s.uniform1f(t.uniforms.u_pitch,l.pitch/360*2*Math.PI);var u="constant"===a.functionType||"source"===a.functionType,p="constant"===a.functionType||"camera"===a.functionType;s.uniform1i(t.uniforms.u_is_size_zoom_constant,u?1:0),s.uniform1i(t.uniforms.u_is_size_feature_constant,p?1:0),s.uniform1f(t.uniforms.u_camera_to_center_distance,l.cameraToCenterDistance);var f=c.evaluateSizeForZoom(a,l.zoom,h.properties[i?"text-size":"icon-size"]);void 0!==f.uSizeT&&s.uniform1f(t.uniforms.u_size_t,f.uSizeT),void 0!==f.uSize&&s.uniform1f(t.uniforms.u_size,f.uSize),s.uniform1f(t.uniforms.u_aspect_ratio,l.width/l.height),s.uniform1i(t.uniforms.u_rotate_symbol,n?1:0)}function o(t,e,r,i,n,o,s,l,u){var c=r.context,p=c.gl,h=r.transform;if(l){var f=0!==i.paint.get(s?"text-halo-width":"icon-halo-width").constantOr(1),d=u?Math.cos(h._pitch)*h.cameraToCenterDistance:1;p.uniform1f(t.uniforms.u_gamma_scale,d),f&&(p.uniform1f(t.uniforms.u_is_halo,1),a(o,i,c,t)),p.uniform1f(t.uniforms.u_is_halo,0)}a(o,i,c,t)}function a(t,e,r,i){i.draw(r,r.gl.TRIANGLES,e.id,t.layoutVertexBuffer,t.indexBuffer,t.segments,t.programConfigurations.get(e.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}var s=t("./draw_collision_debug"),l=t("../source/pixels_to_tile_units"),u=t("../symbol/projection"),c=t("../symbol/symbol_size"),p=t("@mapbox/gl-matrix").mat4.identity(new Float32Array(16)),h=t("../style/style_layer/symbol_style_layer_properties").layout,f=t("../gl/stencil_mode"),d=t("../gl/depth_mode");e.exports=function(t,e,r,n){if("translucent"===t.renderPass){var o=t.context;o.setStencilMode(f.disabled),o.setColorMode(t.colorModeForRenderPass()),0!==r.paint.get("icon-opacity").constantOr(1)&&i(t,e,r,n,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright")),0!==r.paint.get("text-opacity").constantOr(1)&&i(t,e,r,n,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright")),e.map.showCollisionBoxes&&s(t,e,r,n)}}},{"../gl/depth_mode":67,"../gl/stencil_mode":70,"../source/pixels_to_tile_units":104,"../style/style_layer/symbol_style_layer_properties":209,"../symbol/projection":224,"../symbol/symbol_size":228,"./draw_collision_debug":76,"@mapbox/gl-matrix":2}],85:[function(t,e,r){"use strict";var i=t("@mapbox/shelf-pack"),n=t("../util/image").AlphaImage;e.exports={makeGlyphAtlas:function(t){var e=new n({width:0,height:0}),r={},a=new i(0,0,{autoResize:!0});for(var s in t){var l=t[s],u=r[s]={};for(var c in l){var p=l[+c];if(p&&0!==p.bitmap.width&&0!==p.bitmap.height){var h=a.packOne(p.bitmap.width+2,p.bitmap.height+2);e.resize({width:a.w,height:a.h}),n.copy(p.bitmap,e,{x:0,y:0},{x:h.x+1,y:h.y+1},p.bitmap),u[c]={rect:h,metrics:p.metrics}}}}return a.shrink(),e.resize({width:a.w,height:a.h}),{image:e,positions:r}}}},{"../util/image":263,"@mapbox/shelf-pack":5}],86:[function(t,e,r){"use strict";var i=t("../style/load_glyph_range"),n=t("@mapbox/tiny-sdf"),o=t("../util/is_char_in_unicode_block"),a=t("../util/util").asyncAll,s=t("../util/image").AlphaImage,l=function(t,e){this.requestTransform=t,this.localIdeographFontFamily=e,this.entries={}};l.prototype.setURL=function(t){this.url=t},l.prototype.getGlyphs=function(t,e){var r=this,n=[];for(var o in t)for(var s=0,l=t[o];s<l.length;s+=1){var u=l[s];n.push({stack:o,id:u})}a(n,function(t,e){var n=t.stack,o=t.id,a=r.entries[n];a||(a=r.entries[n]={glyphs:{},requests:{}});var s=a.glyphs[o];if(void 0===s)if(s=r._tinySDF(a,n,o))e(null,{stack:n,id:o,glyph:s});else{var l=Math.floor(o/256);if(65535<256*l)e(new Error("glyphs > 65535 not supported"));else{var u=a.requests[l];u||(u=a.requests[l]=[],i(n,l,r.url,r.requestTransform,function(t,e){if(e)for(var r in e)a.glyphs[+r]=e[+r];for(var i=0,n=u;i<n.length;i+=1)(0,n[i])(t,e);delete a.requests[l]})),u.push(function(t,r){t?e(t):r&&e(null,{stack:n,id:o,glyph:r[o]||null})})}}else e(null,{stack:n,id:o,glyph:s})},function(t,r){if(t)e(t);else if(r){for(var i={},n=0,o=r;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}}e(null,i)}})},l.prototype._tinySDF=function(t,e,r){var i=this.localIdeographFontFamily;if(i&&(o["CJK Unified Ideographs"](r)||o["Hangul Syllables"](r))){var a=t.tinySDF;if(!a){var l="400";/bold/i.test(e)?l="900":/medium/i.test(e)?l="500":/light/i.test(e)&&(l="200"),a=t.tinySDF=new n(24,3,8,.25,i,l)}return{id:r,bitmap:new s({width:30,height:30},a.draw(String.fromCharCode(r))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},e.exports=l},{"../style/load_glyph_range":184,"../util/image":263,"../util/is_char_in_unicode_block":265,"../util/util":275,"@mapbox/tiny-sdf":6}],87:[function(t,e,r){"use strict";function i(t,e){var r=e.pixelRatio,i={x:t.x+a,y:t.y+a,w:t.w-2*a,h:t.h-2*a};return{pixelRatio:r,textureRect:i,tl:[i.x,i.y],br:[i.x+i.w,i.y+i.h],displaySize:[i.w/r,i.h/r]}}var n=t("@mapbox/shelf-pack"),o=t("../util/image").RGBAImage,a=1;e.exports={imagePosition:i,makeImageAtlas:function(t){var e=new o({width:0,height:0}),r={},s=new n(0,0,{autoResize:!0});for(var l in t){var u=t[l],c=s.packOne(u.data.width+2*a,u.data.height+2*a);e.resize({width:s.w,height:s.h}),o.copy(u.data,e,{x:0,y:0},{x:c.x+a,y:c.y+a},u.data),r[l]=i(c,u)}return s.shrink(),e.resize({width:s.w,height:s.h}),{image:e,positions:r}}}},{"../util/image":263,"@mapbox/shelf-pack":5}],88:[function(t,e,r){"use strict";var i=t("@mapbox/shelf-pack"),n=t("../util/image").RGBAImage,o=t("./image_atlas").imagePosition,a=t("./texture"),s=function(){this.images={},this.loaded=!1,this.requestors=[],this.shelfPack=new i(64,64,{autoResize:!0}),this.patterns={},this.atlasImage=new n({width:64,height:64}),this.dirty=!0};s.prototype.isLoaded=function(){return this.loaded},s.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t)){for(var e=0,r=this.requestors;e<r.length;e+=1){var i=r[e],n=i.ids,o=i.callback;this._notify(n,o)}this.requestors=[]}},s.prototype.getImage=function(t){return this.images[t]},s.prototype.addImage=function(t,e){this.images[t]=e},s.prototype.removeImage=function(t){delete this.images[t];var e=this.patterns[t];e&&(this.shelfPack.unref(e.bin),delete this.patterns[t])},s.prototype.getImages=function(t,e){var r=!0;if(!this.isLoaded())for(var i=0,n=t;i<n.length;i+=1){var o=n[i];this.images[o]||(r=!1)}this.isLoaded()||r?this._notify(t,e):this.requestors.push({ids:t,callback:e})},s.prototype._notify=function(t,e){for(var r={},i=0,n=t;i<n.length;i+=1){var o=n[i],a=this.images[o];a&&(r[o]={data:a.data.clone(),pixelRatio:a.pixelRatio,sdf:a.sdf})}e(null,r)},s.prototype.getPixelSize=function(){return{width:this.shelfPack.w,height:this.shelfPack.h}},s.prototype.getPattern=function(t){var e=this.patterns[t];if(e)return e.position;var r=this.getImage(t);if(!r)return null;var i=r.data.width+2,a=r.data.height+2,s=this.shelfPack.packOne(i,a);if(!s)return null;this.atlasImage.resize(this.getPixelSize());var l=r.data,u=this.atlasImage,c=s.x+1,p=s.y+1,h=l.width,f=l.height;n.copy(l,u,{x:0,y:0},{x:c,y:p},{width:h,height:f}),n.copy(l,u,{x:0,y:f-1},{x:c,y:p-1},{width:h,height:1}),n.copy(l,u,{x:0,y:0},{x:c,y:p+f},{width:h,height:1}),n.copy(l,u,{x:h-1,y:0},{x:c-1,y:p},{width:1,height:f}),n.copy(l,u,{x:0,y:0},{x:c+h,y:p},{width:1,height:f}),this.dirty=!0;var d=o(s,r);return this.patterns[t]={bin:s,position:d},d},s.prototype.bind=function(t){var e=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new a(t,this.atlasImage,e.RGBA),this.atlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE)},e.exports=s},{"../util/image":263,"./image_atlas":87,"./texture":93,"@mapbox/shelf-pack":5}],89:[function(t,e,r){"use strict";var i=t("../util/util"),n=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}};n.prototype.getDash=function(t,e){var r=t.join(",")+String(e);return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},n.prototype.addDash=function(t,e){var r=this,n=e?7:0,o=2*n+1;if(this.nextRow+o>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var a=0,s=0;s<t.length;s++)a+=t[s];for(var l=this.width/a,u=l/2,c=t.length%2==1,p=-n;p<=n;p++)for(var h=r.nextRow+n+p,f=r.width*h,d=c?-t[t.length-1]:0,m=t[0],y=1,_=0;_<this.width;_++){for(;m<_/l;)d=m,m+=t[y],c&&y===t.length-1&&(m+=t[0]),y++;var g=Math.abs(_-d*l),v=Math.abs(_-m*l),x=Math.min(g,v),b=y%2==1,w=void 0;if(e){var S=n?p/n*(u+1):0;if(b){var A=u-Math.abs(S);w=Math.sqrt(x*x+A*A)}else w=u-Math.sqrt(x*x+S*S)}else w=(b?1:-1)*x;r.data[3+4*(f+_)]=Math.max(0,Math.min(255,w+128))}var T={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:a};return this.nextRow+=o,this.dirty=!0,T},n.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.RGBA,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.RGBA,this.width,this.height,0,e.RGBA,e.UNSIGNED_BYTE,this.data))},e.exports=n},{"../util/util":275}],90:[function(t,e,r){"use strict";var i=t("../util/browser"),n=t("@mapbox/gl-matrix").mat4,o=t("../source/source_cache"),a=t("../data/extent"),s=t("../source/pixels_to_tile_units"),l=t("../util/util"),u=t("./vertex_array_object"),c=t("../data/array_types"),p=c.RasterBoundsArray,h=c.PosArray,f=t("../data/raster_bounds_attributes"),d=t("../data/pos_attributes"),m=t("../data/program_configuration").ProgramConfiguration,y=t("../symbol/cross_tile_symbol_index"),_=t("../shaders"),g=t("./program"),v=t("../gl/context"),x=t("../gl/depth_mode"),b=t("../gl/stencil_mode"),w=t("../gl/color_mode"),S=(t("./texture"),t("./tile_mask")),A=t("../style-spec/util/color"),T={symbol:t("./draw_symbol"),circle:t("./draw_circle"),heatmap:t("./draw_heatmap"),line:t("./draw_line"),fill:t("./draw_fill"),"fill-extrusion":t("./draw_fill_extrusion"),hillshade:t("./draw_hillshade"),raster:t("./draw_raster"),background:t("./draw_background"),debug:t("./draw_debug")},z=function(t,e){this.context=new v(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=o.maxUnderzooming+o.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.depthRboNeedsClear=!0,this.emptyProgramConfiguration=new m,this.crossTileSymbolIndex=new y};z.prototype.resize=function(t,e){var r=this.context.gl;if(this.width=t*i.devicePixelRatio,this.height=e*i.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,o=this.style._order;n<o.length;n+=1){var a=o[n];this.style._layers[a].resize()}this.depthRbo&&(r.deleteRenderbuffer(this.depthRbo),this.depthRbo=null)},z.prototype.setup=function(){var t=this.context,e=new h;e.emplaceBack(0,0),e.emplaceBack(a,0),e.emplaceBack(0,a),e.emplaceBack(a,a),this.tileExtentBuffer=t.createVertexBuffer(e,d.members),this.tileExtentVAO=new u,this.tileExtentPatternVAO=new u;var r=new h;r.emplaceBack(0,0),r.emplaceBack(a,0),r.emplaceBack(a,a),r.emplaceBack(0,a),r.emplaceBack(0,0),this.debugBuffer=t.createVertexBuffer(r,d.members),this.debugVAO=new u;var i=new p;i.emplaceBack(0,0,0,0),i.emplaceBack(a,0,a,0),i.emplaceBack(0,a,0,a),i.emplaceBack(a,a,a,a),this.rasterBoundsBuffer=t.createVertexBuffer(i,f.members),this.rasterBoundsVAO=new u;var n=new h;n.emplaceBack(0,0),n.emplaceBack(1,0),n.emplaceBack(0,1),n.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(n,d.members),this.viewportVAO=new u},z.prototype.clearStencil=function(){var t=this.context,e=t.gl;t.setColorMode(w.disabled),t.setDepthMode(x.disabled),t.setStencilMode(new b({func:e.ALWAYS,mask:0},0,255,e.ZERO,e.ZERO,e.ZERO));var r=n.create();n.ortho(r,0,this.width,this.height,0,0,1),n.scale(r,r,[e.drawingBufferWidth,e.drawingBufferHeight,0]);var i=this.useProgram("clippingMask");e.uniformMatrix4fv(i.uniforms.u_matrix,!1,r),this.viewportVAO.bind(t,i,this.viewportBuffer,[]),e.drawArrays(e.TRIANGLE_STRIP,0,4)},z.prototype._renderTileClippingMasks=function(t){var e=this,r=this.context,i=r.gl;r.setColorMode(w.disabled),r.setDepthMode(x.disabled);var n=1;this._tileClippingMaskIDs={};for(var o=0,a=t;o<a.length;o+=1){var s=a[o],l=e._tileClippingMaskIDs[s.key]=n++;r.setStencilMode(new b({func:i.ALWAYS,mask:0},l,255,i.KEEP,i.KEEP,i.REPLACE));var u=e.useProgram("clippingMask");i.uniformMatrix4fv(u.uniforms.u_matrix,!1,s.posMatrix),e.tileExtentVAO.bind(e.context,u,e.tileExtentBuffer,[]),i.drawArrays(i.TRIANGLE_STRIP,0,e.tileExtentBuffer.length)}},z.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new b({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},z.prototype.colorModeForRenderPass=function(){var t=this.context.gl;return this._showOverdrawInspector?new w([t.CONSTANT_COLOR,t.ONE],new A(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?w.unblended:w.alphaBlended},z.prototype.depthModeForSublayer=function(t,e,r){var i=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon,n=i-1+this.depthRange;return new x(r||this.context.gl.LEQUAL,e,[n,i])},z.prototype.render=function(t,e){var r=this;for(var n in this.style=t,this.options=e,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(i.now()),t.sourceCaches){var o=r.style.sourceCaches[n];o.used&&o.prepare(r.context)}var a=this.style._order,s=l.filterObject(this.style.sourceCaches,function(t){return"raster"===t.getSource().type||"raster-dem"===t.getSource().type});for(var u in s)!function(t){var e=s[u],i=e.getVisibleCoordinates().map(function(t){return e.getTile(t)});S(i,r.context)}();this.renderPass="offscreen";var c,p=[];this.depthRboNeedsClear=!0;for(var h=0;h<a.length;h++){var f=r.style._layers[a[h]];f.hasOffscreenPass()&&!f.isHidden(r.transform.zoom)&&(f.source!==(c&&c.id)&&(p=[],(c=r.style.sourceCaches[f.source])&&(p=c.getVisibleCoordinates()).reverse()),p.length&&r.renderLayer(r,c,f,p))}this.context.bindFramebuffer.set(null),this.context.clear({color:e.showOverdrawInspector?A.black:A.transparent,depth:1}),this._showOverdrawInspector=e.showOverdrawInspector,this.depthRange=(t._order.length+2)*this.numSublayers*this.depthEpsilon,this.renderPass="opaque";var d,m=[];for(this.currentLayer=a.length-1,this.currentLayer;0<=this.currentLayer;this.currentLayer--){var y=r.style._layers[a[r.currentLayer]];y.source!==(d&&d.id)&&(m=[],(d=r.style.sourceCaches[y.source])&&(r.clearStencil(),m=d.getVisibleCoordinates(),d.getSource().isTileClipped&&r._renderTileClippingMasks(m))),r.renderLayer(r,d,y,m)}this.renderPass="translucent";var _,g=[];for(this.currentLayer=0,this.currentLayer;this.currentLayer<a.length;this.currentLayer++){var v=r.style._layers[a[r.currentLayer]];v.source!==(_&&_.id)&&(g=[],(_=r.style.sourceCaches[v.source])&&(r.clearStencil(),g=_.getVisibleCoordinates(),_.getSource().isTileClipped&&r._renderTileClippingMasks(g)),g.reverse()),r.renderLayer(r,_,v,g)}if(this.options.showTileBoundaries){var x=this.style.sourceCaches[Object.keys(this.style.sourceCaches)[0]];x&&T.debug(this,x,x.getVisibleCoordinates())}},z.prototype.setupOffscreenDepthRenderbuffer=function(){var t=this.context;this.depthRbo||(this.depthRbo=t.createRenderbuffer(t.gl.DEPTH_COMPONENT16,this.width,this.height))},z.prototype.renderLayer=function(t,e,r,i){r.isHidden(this.transform.zoom)||("background"===r.type||i.length)&&(this.id=r.id,T[r.type](t,e,r,i))},z.prototype.translatePosMatrix=function(t,e,r,i,o){if(!r[0]&&!r[1])return t;var a=o?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(a){var l=Math.sin(a),u=Math.cos(a);r=[r[0]*u-r[1]*l,r[0]*l+r[1]*u]}var c=[o?r[0]:s(e,r[0],this.transform.zoom),o?r[1]:s(e,r[1],this.transform.zoom),0],p=new Float32Array(16);return n.translate(p,t,c),p},z.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},z.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&0<e.length?e.pop():null},z.prototype._createProgramCached=function(t,e){this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new g(this.context,_[t],e,this._showOverdrawInspector)),this.cache[r]},z.prototype.useProgram=function(t,e){var r=this._createProgramCached(t,e||this.emptyProgramConfiguration);return this.context.program.set(r.program),r},e.exports=z},{"../data/array_types":39,"../data/extent":53,"../data/pos_attributes":57,"../data/program_configuration":58,"../data/raster_bounds_attributes":59,"../gl/color_mode":65,"../gl/context":66,"../gl/depth_mode":67,"../gl/stencil_mode":70,"../shaders":97,"../source/pixels_to_tile_units":104,"../source/source_cache":111,"../style-spec/util/color":153,"../symbol/cross_tile_symbol_index":218,"../util/browser":252,"../util/util":275,"./draw_background":74,"./draw_circle":75,"./draw_debug":77,"./draw_fill":78,"./draw_fill_extrusion":79,"./draw_heatmap":80,"./draw_hillshade":81,"./draw_line":82,"./draw_raster":83,"./draw_symbol":84,"./program":92,"./texture":93,"./tile_mask":94,"./vertex_array_object":95,"@mapbox/gl-matrix":2}],91:[function(t,e,r){"use strict";var i=t("../source/pixels_to_tile_units");r.isPatternMissing=function(t,e){if(!t)return!1;var r=e.imageManager.getPattern(t.from),i=e.imageManager.getPattern(t.to);return!r||!i},r.prepare=function(t,e,r){var i=e.context,n=i.gl,o=e.imageManager.getPattern(t.from),a=e.imageManager.getPattern(t.to);n.uniform1i(r.uniforms.u_image,0),n.uniform2fv(r.uniforms.u_pattern_tl_a,o.tl),n.uniform2fv(r.uniforms.u_pattern_br_a,o.br),n.uniform2fv(r.uniforms.u_pattern_tl_b,a.tl),n.uniform2fv(r.uniforms.u_pattern_br_b,a.br);var s=e.imageManager.getPixelSize(),l=s.width,u=s.height;n.uniform2fv(r.uniforms.u_texsize,[l,u]),n.uniform1f(r.uniforms.u_mix,t.t),n.uniform2fv(r.uniforms.u_pattern_size_a,o.displaySize),n.uniform2fv(r.uniforms.u_pattern_size_b,a.displaySize),n.uniform1f(r.uniforms.u_scale_a,t.fromScale),n.uniform1f(r.uniforms.u_scale_b,t.toScale),i.activeTexture.set(n.TEXTURE0),e.imageManager.bind(e.context)},r.setTile=function(t,e,r){var n=e.context.gl;n.uniform1f(r.uniforms.u_tile_units_to_pixels,1/i(t,1,e.transform.tileZoom));var o=Math.pow(2,t.tileID.overscaledZ),a=t.tileSize*Math.pow(2,e.transform.tileZoom)/o,s=a*(t.tileID.canonical.x+t.tileID.wrap*o),l=a*t.tileID.canonical.y;n.uniform2f(r.uniforms.u_pixel_coord_upper,s>>16,l>>16),n.uniform2f(r.uniforms.u_pixel_coord_lower,65535&s,65535&l)}},{"../source/pixels_to_tile_units":104}],92:[function(t,e,r){"use strict";var i=t("../util/browser"),n=t("../shaders"),o=(t("../data/program_configuration").ProgramConfiguration,t("./vertex_array_object")),a=(t("../gl/context"),function(t,e,r,o){var a=this,s=t.gl;this.program=s.createProgram();var l=r.defines().concat("#define DEVICE_PIXEL_RATIO "+i.devicePixelRatio.toFixed(1));o&&l.push("#define OVERDRAW_INSPECTOR;");var u=l.concat(n.prelude.fragmentSource,e.fragmentSource).join("\n"),c=l.concat(n.prelude.vertexSource,e.vertexSource).join("\n"),p=s.createShader(s.FRAGMENT_SHADER);s.shaderSource(p,u),s.compileShader(p),s.attachShader(this.program,p);var h=s.createShader(s.VERTEX_SHADER);s.shaderSource(h,c),s.compileShader(h),s.attachShader(this.program,h);for(var f=r.layoutAttributes||[],d=0;d<f.length;d++)s.bindAttribLocation(a.program,d,f[d].name);s.linkProgram(this.program),this.numAttributes=s.getProgramParameter(this.program,s.ACTIVE_ATTRIBUTES),this.attributes={},this.uniforms={};for(var m=0;m<this.numAttributes;m++){var y=s.getActiveAttrib(a.program,m);y&&(a.attributes[y.name]=s.getAttribLocation(a.program,y.name))}for(var _=s.getProgramParameter(this.program,s.ACTIVE_UNIFORMS),g=0;g<_;g++){var v=s.getActiveUniform(a.program,g);v&&(a.uniforms[v.name]=s.getUniformLocation(a.program,v.name))}});a.prototype.draw=function(t,e,r,i,n,a,s,l,u){for(var c,p=t.gl,h=(c={},c[p.LINES]=2,c[p.TRIANGLES]=3,c)[e],f=0,d=a.get();f<d.length;f+=1){var m=d[f],y=m.vaos||(m.vaos={});(y[r]||(y[r]=new o)).bind(t,this,i,s?s.getPaintVertexBuffers():[],n,m.vertexOffset,l,u),p.drawElements(e,m.primitiveLength*h,p.UNSIGNED_SHORT,m.primitiveOffset*h*2)}},e.exports=a},{"../data/program_configuration":58,"../gl/context":66,"../shaders":97,"../util/browser":252,"./vertex_array_object":95}],93:[function(t,e,r){"use strict";var i=t("../util/window"),n=i.HTMLImageElement,o=i.HTMLCanvasElement,a=i.HTMLVideoElement,s=i.ImageData,l=function(t,e,r,i){this.context=t;var n=e.width,o=e.height;this.size=[n,o],this.format=r,this.texture=t.gl.createTexture(),this.update(e,i)};l.prototype.update=function(t,e){var r=t.width,i=t.height;this.size=[r,i];var l=this.context,u=l.gl;u.bindTexture(u.TEXTURE_2D,this.texture),l.pixelStoreUnpack.set(1),this.format===u.RGBA&&!1!==e&&l.pixelStoreUnpackPremultiplyAlpha.set(!0),t instanceof n||t instanceof o||t instanceof a||t instanceof s?u.texImage2D(u.TEXTURE_2D,0,this.format,this.format,u.UNSIGNED_BYTE,t):u.texImage2D(u.TEXTURE_2D,0,this.format,r,i,0,this.format,u.UNSIGNED_BYTE,t.data)},l.prototype.bind=function(t,e,r){var i=this.context.gl;i.bindTexture(i.TEXTURE_2D,this.texture),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)},l.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null},e.exports=l},{"../util/window":254}],94:[function(t,e,r){"use strict";function i(t,e,r,n,o){for(var s=0;s<r.length;s++){var l=r[s];if(n.isLessThan(l.tileID))break;if(e.key===l.tileID.key)return;if(l.tileID.isChildOf(e)){for(var u=e.children(1/0),c=0;c<u.length;c++)i(t,u[c],r.slice(s),n,o);return}}var p=e.overscaledZ-t.overscaledZ,h=new a(p,e.canonical.x-(t.canonical.x<<p),e.canonical.y-(t.canonical.y<<p));o[h.key]=o[h.key]||h}var n=t("../source/tile_id"),o=n.OverscaledTileID,a=n.CanonicalTileID;e.exports=function(t,e){for(var r=t.sort(function(t,e){return t.tileID.isLessThan(e.tileID)?-1:e.tileID.isLessThan(t.tileID)?1:0}),n=0;n<r.length;n++){var a={},s=r[n],l=r.slice(n+1);i(s.tileID.wrapped(),s.tileID,l,new o(0,s.tileID.wrap+1,0,0,0),a),s.setMask(a,e)}}},{"../source/tile_id":114}],95:[function(t,e,r){"use strict";var i=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};i.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);var c=!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==r||l||this.boundIndexBuffer!==n||this.boundVertexOffset!==o||this.boundDynamicVertexBuffer!==a||this.boundDynamicVertexBuffer2!==s;!t.extVertexArrayObject||c?this.freshBind(e,r,i,n,o,a,s):(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),n&&n.dynamicDraw&&n.bind(),s&&s.bind())},i.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 p=l;p<s;p++)c.disableVertexAttribArray(p)}e.enableAttributes(c,t);for(var h=0,f=r;h<f.length;h+=1)f[h].enableAttributes(c,t);o&&o.enableAttributes(c,t),a&&a.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,n);for(var d=0,m=r;d<m.length;d+=1){var y=m[d];y.bind(),y.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},i.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)},e.exports=i},{}],96:[function(t,e,r){"use strict";var i=t("../util/util");r.packUint8ToFloat=function(t,e){return 256*(t=i.clamp(Math.floor(t),0,255))+i.clamp(Math.floor(e),0,255)}},{"../util/util":275}],97:[function(t,e,r){"use strict";var i={prelude:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n\n// Unpack a pair of values that have been packed into a single float.\n// The packed values are assumed to be 8-bit unsigned integers, and are\n// packed like so:\n// packedValue = floor(input[0]) * 256 + input[1],\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\n\nvec2 unpack_opacity(const float packedOpacity) {\n int intOpacity = int(packedOpacity) / 2;\n return vec2(float(intOpacity) / 127.0, mod(packedOpacity, 2.0));\n}\n\n// To minimize the number of attributes needed, we encode a 4-component\n// color into a pair of floats (i.e. a vec2) as follows:\n// [ floor(color.r * 255) * 256 + color.g * 255,\n// floor(color.b * 255) * 256 + color.g * 255 ]\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\n\n// Unpack a pair of paint values and interpolate between them.\nfloat unpack_mix_vec2(const vec2 packedValue, const float t) {\n return mix(packedValue[0], packedValue[1], t);\n}\n\n// Unpack a pair of paint values and interpolate between them.\nvec4 unpack_mix_vec4(const vec4 packedColors, const float t) {\n vec4 minColor = decode_color(vec2(packedColors[0], packedColors[1]));\n vec4 maxColor = decode_color(vec2(packedColors[2], packedColors[3]));\n return mix(minColor, maxColor, t);\n}\n\n// The offset depends on how many pixels are between the world origin and the edge of the tile:\n// vec2 offset = mod(pixel_coord, size)\n//\n// At high zoom levels there are a ton of pixels between the world origin and the edge of the tile.\n// The glsl spec only guarantees 16 bits of precision for highp floats. We need more than that.\n//\n// The pixel_coord is passed in as two 16 bit values:\n// pixel_coord_upper = floor(pixel_coord / 2^16)\n// pixel_coord_lower = mod(pixel_coord, 2^16)\n//\n// The offset is calculated in a series of steps that should preserve this precision:\nvec2 get_pattern_pos(const vec2 pixel_coord_upper, const vec2 pixel_coord_lower,\n const vec2 pattern_size, const float tile_units_to_pixels, const vec2 pos) {\n\n vec2 offset = mod(mod(mod(pixel_coord_upper, pattern_size) * 256.0, pattern_size) * 256.0 + pixel_coord_lower, pattern_size);\n return (tile_units_to_pixels * pos + offset) / pattern_size;\n}\n"},background:{fragmentSource:"uniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main() {\n gl_FragColor = u_color * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},backgroundPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n 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);\n 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);\n}\n"},circle:{fragmentSource:"#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\n\nvarying vec3 v_data;\n\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\n\n vec2 extrude = v_data.xy;\n float extrude_length = length(extrude);\n\n lowp float antialiasblur = v_data.z;\n float antialiased_blur = -max(blur, antialiasblur);\n\n float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0);\n\n float color_t = stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n extrude_length - radius / (radius + stroke_width)\n );\n\n gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform bool u_scale_with_map;\nuniform bool u_pitch_with_map;\nuniform vec2 u_extrude_scale;\nuniform highp float u_camera_to_center_distance;\n\nattribute vec2 a_pos;\n\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\n\nvarying vec3 v_data;\n\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\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n vec2 extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n vec2 circle_center = floor(a_pos * 0.5);\n if (u_pitch_with_map) {\n vec2 corner_position = circle_center;\n if (u_scale_with_map) {\n corner_position += extrude * (radius + stroke_width) * u_extrude_scale;\n } else {\n // Pitching the circle with the map effectively scales it with the map\n // To counteract the effect for pitch-scale: viewport, we rescale the\n // whole circle based on the pitch scaling effect at its central point\n vec4 projected_center = u_matrix * vec4(circle_center, 0, 1);\n corner_position += extrude * (radius + stroke_width) * u_extrude_scale * (projected_center.w / u_camera_to_center_distance);\n }\n\n gl_Position = u_matrix * vec4(corner_position, 0, 1);\n } else {\n gl_Position = u_matrix * vec4(circle_center, 0, 1);\n\n if (u_scale_with_map) {\n gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * u_camera_to_center_distance;\n } else {\n gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * gl_Position.w;\n }\n }\n\n // This is a minimum blur distance that serves as a faux-antialiasing for\n // the circle. since blur is a ratio of the circle's size and the intent is\n // to keep the blur at roughly 1px, the two are inversely related.\n lowp float antialiasblur = 1.0 / DEVICE_PIXEL_RATIO / (radius + stroke_width);\n\n v_data = vec3(extrude.x, extrude.y, antialiasblur);\n}\n"},clippingMask:{fragmentSource:"void main() {\n gl_FragColor = vec4(1.0);\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},heatmap:{fragmentSource:"#pragma mapbox: define highp float weight\n\nuniform highp float u_intensity;\nvarying vec2 v_extrude;\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main() {\n #pragma mapbox: initialize highp float weight\n\n // Kernel density estimation with a Gaussian kernel of size 5x5\n float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude);\n float val = weight * u_intensity * GAUSS_COEF * exp(d);\n\n gl_FragColor = vec4(val, 1.0, 1.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\n\nuniform mat4 u_matrix;\nuniform float u_extrude_scale;\nuniform float u_opacity;\nuniform float u_intensity;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_extrude;\n\n// Effective \"0\" in the kernel density texture to adjust the kernel size to;\n// this empirically chosen number minimizes artifacts on overlapping kernels\n// for typical heatmap cases (assuming clustered source)\nconst highp float ZERO = 1.0 / 255.0 / 16.0;\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main(void) {\n #pragma mapbox: initialize highp float weight\n #pragma mapbox: initialize mediump float radius\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n vec2 unscaled_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n // This 'extrude' comes in ranging from [-1, -1], to [1, 1]. We'll use\n // it to produce the vertices of a square mesh framing the point feature\n // we're adding to the kernel density texture. We'll also pass it as\n // a varying, so that the fragment shader can determine the distance of\n // each fragment from the point feature.\n // Before we do so, we need to scale it up sufficiently so that the\n // kernel falls effectively to zero at the edge of the mesh.\n // That is, we want to know S such that\n // weight * u_intensity * GAUSS_COEF * exp(-0.5 * 3.0^2 * S^2) == ZERO\n // Which solves to:\n // S = sqrt(-2.0 * log(ZERO / (weight * u_intensity * GAUSS_COEF))) / 3.0\n float S = sqrt(-2.0 * log(ZERO / weight / u_intensity / GAUSS_COEF)) / 3.0;\n\n // Pass the varying in units of radius\n v_extrude = S * unscaled_extrude;\n\n // Scale by radius and the zoom-based scale factor to produce actual\n // mesh position\n vec2 extrude = v_extrude * radius * u_extrude_scale;\n\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n vec4 pos = vec4(floor(a_pos * 0.5) + extrude, 0, 1);\n\n gl_Position = u_matrix * pos;\n}\n"},heatmapTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform sampler2D u_color_ramp;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n float t = texture2D(u_image, v_pos).r;\n vec4 color = texture2D(u_color_ramp, vec2(t, 0.5));\n gl_FragColor = color * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n"},collisionBox:{fragmentSource:"\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n\n float alpha = 0.5;\n\n // Red = collision, hide label\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n // Blue = no collision, label is showing\n if (v_placed > 0.5) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n gl_FragColor *= .1;\n }\n}",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n gl_Position.xy += a_extrude * u_extrude_scale * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n}\n"},collisionCircle:{fragmentSource:"\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n float alpha = 0.5;\n\n // Red = collision, hide label\n vec4 color = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n // Blue = no collision, label is showing\n if (v_placed > 0.5) {\n color = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n color *= .2;\n }\n\n float extrude_scale_length = length(v_extrude_scale);\n float extrude_length = length(v_extrude) * extrude_scale_length;\n float stroke_width = 15.0 * extrude_scale_length;\n float radius = v_radius * extrude_scale_length;\n\n float distance_to_edge = abs(extrude_length - radius);\n float opacity_t = smoothstep(-stroke_width, 0.0, -distance_to_edge);\n\n gl_FragColor = opacity_t * color;\n}\n",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\n\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n\n highp float padding_factor = 1.2; // Pad the vertices slightly to make room for anti-alias blur\n gl_Position.xy += a_extrude * u_extrude_scale * padding_factor * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n v_radius = abs(a_extrude.y); // We don't pitch the circles, so both units of the extrusion vector are equal in magnitude to the radius\n\n v_extrude = a_extrude * padding_factor;\n v_extrude_scale = u_extrude_scale * u_camera_to_center_distance * collision_perspective_ratio;\n}\n"},debug:{fragmentSource:"uniform highp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillOutlinePattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n\n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n 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);\n 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);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n 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);\n 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);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n gl_FragColor = v_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n vec3 normal = a_normal_ed.xyz;\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is tinted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n vec4 mixedColor = mix(color1, color2, u_mix);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\nuniform float u_height_factor;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\nvarying float v_directional;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec3 normal = a_normal_ed.xyz;\n float edgedistance = a_normal_ed.w;\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = normal.x == 1.0 && normal.y == 0.0 && normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(edgedistance, z * u_height_factor); // extrusion side\n\n 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, pos);\n 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, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_image, v_pos) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n"},hillshadePrepare:{fragmentSource:"#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D u_image;\nvarying vec2 v_pos;\nuniform vec2 u_dimension;\nuniform float u_zoom;\n\nfloat getElevation(vec2 coord, float bias) {\n // Convert encoded elevation value to meters\n vec4 data = texture2D(u_image, coord) * 255.0;\n return (data.r + data.g * 256.0 + data.b * 256.0 * 256.0) / 4.0;\n}\n\nvoid main() {\n vec2 epsilon = 1.0 / u_dimension;\n\n // queried pixels:\n // +-----------+\n // | | | |\n // | a | b | c |\n // | | | |\n // +-----------+\n // | | | |\n // | d | e | f |\n // | | | |\n // +-----------+\n // | | | |\n // | g | h | i |\n // | | | |\n // +-----------+\n\n float a = getElevation(v_pos + vec2(-epsilon.x, -epsilon.y), 0.0);\n float b = getElevation(v_pos + vec2(0, -epsilon.y), 0.0);\n float c = getElevation(v_pos + vec2(epsilon.x, -epsilon.y), 0.0);\n float d = getElevation(v_pos + vec2(-epsilon.x, 0), 0.0);\n float e = getElevation(v_pos, 0.0);\n float f = getElevation(v_pos + vec2(epsilon.x, 0), 0.0);\n float g = getElevation(v_pos + vec2(-epsilon.x, epsilon.y), 0.0);\n float h = getElevation(v_pos + vec2(0, epsilon.y), 0.0);\n float i = getElevation(v_pos + vec2(epsilon.x, epsilon.y), 0.0);\n\n // here we divide the x and y slopes by 8 * pixel size\n // where pixel size (aka meters/pixel) is:\n // circumference of the world / (pixels per tile * number of tiles)\n // which is equivalent to: 8 * 40075016.6855785 / (512 * pow(2, u_zoom))\n // which can be reduced to: pow(2, 19.25619978527 - u_zoom)\n // we want to vertically exaggerate the hillshading though, because otherwise\n // it is barely noticeable at low zooms. to do this, we multiply this by some\n // scale factor pow(2, (u_zoom - 14) * a) where a is an arbitrary value and 14 is the\n // maxzoom of the tile source. here we use a=0.3 which works out to the\n // expression below. see nickidlugash's awesome breakdown for more info\n // https://github.com/mapbox/mapbox-gl-js/pull/5286#discussion_r148419556\n float exaggeration = u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\n\n vec2 deriv = vec2(\n (c + f + f + i) - (a + d + d + g),\n (g + h + h + i) - (a + b + b + c)\n ) / pow(2.0, (u_zoom - 14.0) * exaggeration + 19.2562 - u_zoom);\n\n gl_FragColor = clamp(vec4(\n deriv.x / 2.0 + 0.5,\n deriv.y / 2.0 + 0.5,\n 1.0,\n 1.0), 0.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (a_texture_pos / 8192.0) / 2.0 + 0.25;\n}\n"},hillshade:{fragmentSource:"uniform sampler2D u_image;\nvarying vec2 v_pos;\n\nuniform vec2 u_latrange;\nuniform vec2 u_light;\nuniform vec4 u_shadow;\nuniform vec4 u_highlight;\nuniform vec4 u_accent;\n\n#define PI 3.141592653589793\n\nvoid main() {\n vec4 pixel = texture2D(u_image, v_pos);\n\n vec2 deriv = ((pixel.rg * 2.0) - 1.0);\n\n // We divide the slope by a scale factor based on the cosin of the pixel's approximate latitude\n // to account for mercator projection distortion. see #4807 for details\n float scaleFactor = cos(radians((u_latrange[0] - u_latrange[1]) * (1.0 - v_pos.y) + u_latrange[1]));\n // We also multiply the slope by an arbitrary z-factor of 1.25\n float slope = atan(1.25 * length(deriv) / scaleFactor);\n float aspect = deriv.x != 0.0 ? atan(deriv.y, -deriv.x) : PI / 2.0 * (deriv.y > 0.0 ? 1.0 : -1.0);\n\n float intensity = u_light.x;\n // We add PI to make this property match the global light object, which adds PI/2 to the light's azimuthal\n // position property to account for 0deg corresponding to north/the top of the viewport in the style spec\n // and the original shader was written to accept (-illuminationDirection - 90) as the azimuthal.\n float azimuth = u_light.y + PI;\n\n // We scale the slope exponentially based on intensity, using a calculation similar to\n // the exponential interpolation function in the style spec:\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/expression/definitions/interpolate.js#L217-L228\n // so that higher intensity values create more opaque hillshading.\n float base = 1.875 - intensity * 1.75;\n float maxValue = 0.5 * PI;\n float scaledSlope = intensity != 0.5 ? ((pow(base, slope) - 1.0) / (pow(base, maxValue) - 1.0)) * maxValue : slope;\n\n // The accent color is calculated with the cosine of the slope while the shade color is calculated with the sine\n // so that the accent color's rate of change eases in while the shade color's eases out.\n float accent = cos(scaledSlope);\n // We multiply both the accent and shade color by a clamped intensity value\n // so that intensities >= 0.5 do not additionally affect the color values\n // while intensity values < 0.5 make the overall color more transparent.\n vec4 accent_color = (1.0 - accent) * u_accent * clamp(intensity * 2.0, 0.0, 1.0);\n float shade = abs(mod((aspect + azimuth) / PI + 0.5, 2.0) - 1.0);\n vec4 shade_color = mix(u_shadow, u_highlight, shade) * sin(scaledSlope) * clamp(intensity * 2.0, 0.0, 1.0);\n gl_FragColor = accent_color * (1.0 - shade_color.a) + shade_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = a_texture_pos / 8192.0;\n}\n"},line:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\n\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\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\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\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\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\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\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\n\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\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma / floorwidth, 0.5 + u_sdfgamma / floorwidth, sdfdist);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\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\n\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\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist =outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x / floorwidth, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x / floorwidth, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform float u_fade_t;\nuniform float u_opacity;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n if (color0.a > 0.0) {\n color0.rgb = color0.rgb / color0.a;\n }\n if (color1.a > 0.0) {\n color1.rgb = color1.rgb / color1.a;\n }\n vec4 color = mix(color0, color1, u_fade_t);\n color.a *= u_opacity;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb) * color.a, color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n // We are using Int16 for texture position coordinates to give us enough precision for\n // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer\n // as an arbitrarily high number to preserve adequate precision when rendering.\n // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,\n // so math for modifying either is consistent.\n v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},symbolIcon:{fragmentSource:"uniform sampler2D u_texture;\n\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n lowp float alpha = opacity * v_fade_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform float u_fade_change;\n\n#pragma mapbox: define lowp float opacity\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n\n float size;\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // See comments in symbol_sdf.vertex\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = 0.5 + 0.5 * distance_ratio;\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // See comments in symbol_sdf.vertex\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 64.0 * fontScale), 0.0, 1.0);\n\n v_tex = a_tex / u_texsize;\n vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n v_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n}\n"},symbolSDF:{fragmentSource:"#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO\n\nuniform bool u_is_halo;\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\n\nuniform sampler2D u_texture;\nuniform highp float u_gamma_scale;\nuniform bool u_is_text;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\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\n\n vec2 tex = v_data0.xy;\n float gamma_scale = v_data1.x;\n float size = v_data1.y;\n float fade_opacity = v_data1[2];\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n lowp vec4 color = fill_color;\n highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale);\n lowp float buff = (256.0 - 64.0) / 256.0;\n if (u_is_halo) {\n color = halo_color;\n gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale);\n buff = (6.0 - halo_width / fontScale) / SDF_PX;\n }\n\n lowp float dist = texture2D(u_texture, tex).a;\n highp float gamma_scaled = gamma * gamma_scale;\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n gl_FragColor = color * (alpha * opacity * fade_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\n// contents of a_size vary based on the type of property value\n// used for {text,icon}-size.\n// For constants, a_size is disabled.\n// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature.\n// For composite functions:\n// [ text-size(lowerZoomStop, feature),\n// text-size(upperZoomStop, feature) ]\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\n\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\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_camera_to_center_distance;\nuniform float u_fade_change;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\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\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n float size;\n\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // If the label is pitched with the map, layout is done in pitched space,\n // which makes labels in the distance smaller relative to viewport space.\n // We counteract part of that effect by multiplying by the perspective ratio.\n // If the label isn't pitched with the map, we do layout in viewport space,\n // which makes labels in the distance larger relative to the features around\n // them. We counteract part of that effect by dividing by the perspective ratio.\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = 0.5 + 0.5 * distance_ratio;\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units\n // To figure out that angle in projected space, we draw a short horizontal line in tile\n // space, project it, and measure its angle in projected space.\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 64.0 * fontScale), 0.0, 1.0);\n float gamma_scale = gl_Position.w;\n\n vec2 tex = a_tex / u_texsize;\n vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n float interpolated_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n\n v_data0 = vec2(tex.x, tex.y);\n v_data1 = vec3(gamma_scale, size, interpolated_fade_opacity);\n}\n"}},n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,o=function(t){var e=i[t],r={};e.fragmentSource=e.fragmentSource.replace(n,function(t,e,i,n,o){return r[o]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nvarying "+i+" "+n+" "+o+";\n#else\nuniform "+i+" "+n+" u_"+o+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+o+"\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n"}),e.vertexSource=e.vertexSource.replace(n,function(t,e,i,n,o){var a="float"===n?"vec2":"vec4";return r[o]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float a_"+o+"_t;\nattribute "+i+" "+a+" a_"+o+";\nvarying "+i+" "+n+" "+o+";\n#else\nuniform "+i+" "+n+" u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = unpack_mix_"+a+"(a_"+o+", a_"+o+"_t);\n#else\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float a_"+o+"_t;\nattribute "+i+" "+a+" a_"+o+";\n#else\nuniform "+i+" "+n+" u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+i+" "+n+" "+o+" = unpack_mix_"+a+"(a_"+o+", a_"+o+"_t);\n#else\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n"})};for(var a in i)o(a);e.exports=i},{}],98:[function(t,e,r){"use strict";var i=t("./image_source"),n=t("../util/window"),o=t("../data/raster_bounds_attributes"),a=t("../render/vertex_array_object"),s=t("../render/texture"),l=function(t){function e(e,r,i,n){t.call(this,e,r,i,n),this.options=r,this.animate=void 0===r.animate||r.animate}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.load=function(){this.canvas=this.canvas||n.document.getElementById(this.options.canvas),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire("error",new Error("Canvas dimensions cannot be less than or equal to zero.")):(this.play=function(){this._playing=!0,this.map._rerender()},this.pause=function(){this._playing=!1},this._finishLoading())},e.prototype.getCanvas=function(){return this.canvas},e.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},e.prototype.onRemove=function(){this.pause()},e.prototype.prepare=function(){var t=this,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,o.members)),this.boundsVAO||(this.boundsVAO=new a),this.texture?e?this.texture.update(this.canvas):this._playing&&(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.canvas)):(this.texture=new s(r,this.canvas,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),t.tiles){var l=t.tiles[n];"loaded"!==l.state&&(l.state="loaded",l.texture=t.texture)}}},e.prototype.serialize=function(){return{type:"canvas",canvas:this.canvas,coordinates:this.coordinates}},e.prototype.hasTransition=function(){return this._playing},e.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},e}(i);e.exports=l},{"../data/raster_bounds_attributes":59,"../render/texture":93,"../render/vertex_array_object":95,"../util/window":254,"./image_source":102}],99:[function(t,e,r){"use strict";var i=t("../util/evented"),n=t("../util/util"),o=t("../util/window"),a=t("../data/extent"),s=t("../util/ajax").ResourceType,l=t("../util/browser"),u=function(t){function e(e,r,i,o){t.call(this),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this.dispatcher=i,this.setEventedParent(o),this._data=r.data,this._options=n.extend({},r),this._collectResourceTiming=r.collectResourceTiming,this._resourceTiming=[],void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type);var s=a/this.tileSize;this.workerOptions=n.extend({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*s,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*s,extent:a,maxZoom:this.maxzoom},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?Math.min(r.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:a,radius:(r.clusterRadius||50)*s,log:!1}},r.workerOptions)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.load=function(){var t=this;this.fire("dataloading",{dataType:"source"}),this._updateWorkerData(function(e){if(e)t.fire("error",{error:e});else{var r={dataType:"source",sourceDataType:"metadata"};t._collectResourceTiming&&t._resourceTiming&&0<t._resourceTiming.length&&(r.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire("data",r)}})},e.prototype.onAdd=function(t){this.map=t,this.load()},e.prototype.setData=function(t){var e=this;return this._data=t,this.fire("dataloading",{dataType:"source"}),this._updateWorkerData(function(t){if(t)return e.fire("error",{error:t});var r={dataType:"source",sourceDataType:"content"};e._collectResourceTiming&&e._resourceTiming&&0<e._resourceTiming.length&&(r.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire("data",r)}),this},e.prototype._updateWorkerData=function(t){var e=this,r=n.extend({},this.workerOptions),i=this._data;"string"==typeof i?(r.request=this.map._transformRequest(function(t){var e=o.document.createElement("a");return e.href=t,e.href}(i),s.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(i),this.workerID=this.dispatcher.send(this.type+".loadData",r,function(r,i){e._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[e.id]&&(e._resourceTiming=i.resourceTiming[e.id].slice(0)),t(r)},this.workerID)},e.prototype.loadTile=function(t,e){var r=this,i=void 0===t.workerID||"expired"===t.state?"loadTile":"reloadTile",n={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:l.devicePixelRatio,overscaling:t.tileID.overscaleFactor(),showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send(i,n,function(n,o){return t.unloadVectorData(),t.aborted?e(null):n?e(n):(t.loadVectorData(o,r.map.painter,"reloadTile"===i),e(null))},this.workerID)},e.prototype.abortTile=function(t){t.aborted=!0},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},e.prototype.onRemove=function(){this.dispatcher.broadcast("removeSource",{type:this.type,source:this.id})},e.prototype.serialize=function(){return n.extend({},this._options,{type:this.type,data:this._data})},e.prototype.hasTransition=function(){return!1},e}(i);e.exports=u},{"../data/extent":53,"../util/ajax":251,"../util/browser":252,"../util/evented":260,"../util/util":275,"../util/window":254}],100:[function(t,e,r){"use strict";function i(t,e){var r=t.source,i=t.tileID.canonical;if(!this._geoJSONIndexes[r])return e(null,null);var n=this._geoJSONIndexes[r].getTile(i.z,i.x,i.y);if(!n)return e(null,null);var o=new s(n.features),a=l(o);0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),e(null,{vectorTile:o,rawData:a.buffer})}var n=t("../util/ajax"),o=t("../util/performance"),a=t("geojson-rewind"),s=t("./geojson_wrapper"),l=t("vt-pbf"),u=t("supercluster"),c=t("geojson-vt"),p=function(t){function e(e,r,n){t.call(this,e,r,i),n&&(this.loadGeoJSON=n),this._geoJSONIndexes={}}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.loadData=function(t,e){var r=this;this.loadGeoJSON(t,function(i,n){if(i||!n)return e(i);if("object"!=typeof n)return e(new Error("Input data is not a valid GeoJSON object."));a(n,!0);try{r._geoJSONIndexes[t.source]=t.cluster?u(t.superclusterOptions).load(n.features):c(n,t.geojsonVtOptions)}catch(i){return e(i)}r.loaded[t.source]={};var s={};if(t.request&&t.request.collectResourceTiming){var l=o.getEntriesByName(t.request.url);l&&(s.resourceTiming={},s.resourceTiming[t.source]=JSON.parse(JSON.stringify(l)))}e(null,s)})},e.prototype.reloadTile=function(e,r){var i=this.loaded[e.source],n=e.uid;return i&&i[n]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},e.prototype.loadGeoJSON=function(t,e){if(t.request)n.getJSON(t.request,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},e.prototype.removeSource=function(t,e){this._geoJSONIndexes[t.source]&&delete this._geoJSONIndexes[t.source],e()},e}(t("./vector_tile_worker_source"));e.exports=p},{"../util/ajax":251,"../util/performance":268,"./geojson_wrapper":101,"./vector_tile_worker_source":116,"geojson-rewind":15,"geojson-vt":19,supercluster:32,"vt-pbf":34}],101:[function(t,e,r){"use strict";var i=t("@mapbox/point-geometry"),n=t("@mapbox/vector-tile").VectorTileFeature.prototype.toGeoJSON,o=t("../data/extent"),a=function(t){this._feature=t,this.extent=o,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};a.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],e=0,r=this._feature.geometry;e<r.length;e+=1){var n=r[e];t.push([new i(n[0],n[1])])}return t}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 p=c[u];l.push(new i(p[0],p[1]))}o.push(l)}return o},a.prototype.toGeoJSON=function(t,e,r){return n.call(this,t,e,r)};var s=function(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=o,this.length=t.length,this._features=t};s.prototype.feature=function(t){return new a(this._features[t])},e.exports=s},{"../data/extent":53,"@mapbox/point-geometry":4,"@mapbox/vector-tile":8}],102:[function(t,e,r){"use strict";var i=t("../util/util"),n=t("./tile_id").CanonicalTileID,o=t("../geo/lng_lat"),a=t("@mapbox/point-geometry"),s=t("../util/evented"),l=t("../util/ajax"),u=t("../util/browser"),c=t("../data/extent"),p=t("../data/array_types").RasterBoundsArray,h=t("../data/raster_bounds_attributes"),f=t("../render/vertex_array_object"),d=t("../render/texture"),m=function(t){function e(e,r,i,n){t.call(this),this.id=e,this.dispatcher=i,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this.setEventedParent(n),this.options=r}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.load=function(){var t=this;this.fire("dataloading",{dataType:"source"}),this.url=this.options.url,l.getImage(this.map._transformRequest(this.url,l.ResourceType.Image),function(e,r){e?t.fire("error",{error:e}):r&&(t.image=u.getImageData(r),t._finishLoading())})},e.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire("data",{dataType:"source",sourceDataType:"metadata"}))},e.prototype.onAdd=function(t){this.map=t,this.load()},e.prototype.setCoordinates=function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),s=this.centerCoord=i.getCoordinatesCenter(r);s.column=Math.floor(s.column),s.row=Math.floor(s.row),this.tileID=new n(s.zoom,s.column,s.row),this.minzoom=this.maxzoom=s.zoom;var l=r.map(function(t){var e=t.zoomTo(s.zoom);return new a(Math.round((e.column-s.column)*c),Math.round((e.row-s.row)*c))});return this._boundsArray=new p,this._boundsArray.emplaceBack(l[0].x,l[0].y,0,0),this._boundsArray.emplaceBack(l[1].x,l[1].y,c,0),this._boundsArray.emplaceBack(l[3].x,l[3].y,0,c),this._boundsArray.emplaceBack(l[2].x,l[2].y,c,c),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire("data",{dataType:"source",sourceDataType:"content"}),this},e.prototype.prepare=function(){var t=this;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,h.members)),this.boundsVAO||(this.boundsVAO=new f),this.texture||(this.texture=new d(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),t.tiles){var n=t.tiles[i];"loaded"!==n.state&&(n.state="loaded",n.texture=t.texture)}}},e.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t).buckets={}:t.state="errored",e(null)},e.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},e.prototype.hasTransition=function(){return!1},e}(s);e.exports=m},{"../data/array_types":39,"../data/extent":53,"../data/raster_bounds_attributes":59,"../geo/lng_lat":62,"../render/texture":93,"../render/vertex_array_object":95,"../util/ajax":251,"../util/browser":252,"../util/evented":260,"../util/util":275,"./tile_id":114,"@mapbox/point-geometry":4}],103:[function(t,e,r){"use strict";var i=t("../util/util"),n=t("../util/ajax"),o=t("../util/browser"),a=t("../util/mapbox").normalizeSourceURL;e.exports=function(t,e,r){var s=function(t,e){if(t)return r(t);if(e){var n=i.pick(e,["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds"]);e.vector_layers&&(n.vectorLayers=e.vector_layers,n.vectorLayerIds=n.vectorLayers.map(function(t){return t.id})),r(null,n)}};t.url?n.getJSON(e(a(t.url),n.ResourceType.Source),s):o.frame(function(){return s(null,t)})}},{"../util/ajax":251,"../util/browser":252,"../util/mapbox":267,"../util/util":275}],104:[function(t,e,r){"use strict";var i=t("../data/extent");e.exports=function(t,e,r){return e*(i/(t.tileSize*Math.pow(2,r-t.tileID.overscaledZ)))}},{"../data/extent":53}],105:[function(t,e,r){"use strict";function i(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}r.rendered=function(t,e,r,n,o,a,s){var l=t.tilesIn(r);l.sort(i);for(var u=[],c=0,p=l;c<p.length;c+=1){var h=p[c];u.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(e,h.queryGeometry,h.scale,n,a,t.id,s)})}return 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],p=l[u]=l[u]||{},h=e[u]=e[u]||[],f=0,d=c;f<d.length;f+=1){var m=d[f];p[m.featureIndex]||(p[m.featureIndex]=!0,h.push(m.feature))}}return e}(u)},r.source=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}},{}],106:[function(t,e,r){"use strict";var i=t("../util/ajax"),n=t("../util/util"),o=(t("../util/evented"),t("../util/mapbox").normalizeTileURL),a=t("../util/browser"),s=t("./tile_id").OverscaledTileID,l=function(t){function e(e,r,i,o){t.call(this,e,r,i,o),this.type="raster-dem",this.maxzoom=22,this._options=n.extend({},r)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds}},e.prototype.loadTile=function(t,e){var r=o(t.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);t.request=i.getImage(this.map._transformRequest(r,i.ResourceType.Tile),function(r,i){if(delete t.request,t.aborted)t.state="unloaded",e(null);else if(r)t.state="errored",e(r);else if(i){this.map._refreshExpiredTiles&&t.setExpiryData(i),delete i.cacheControl,delete i.expires;var n=a.getImageData(i),o={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:n};t.workerID&&"expired"!==t.state||(t.workerID=this.dispatcher.send("loadDEMTile",o,function(r,i){r&&(t.state="errored",e(r)),i&&(t.dem=i,t.needsHillshadePrepare=!0,t.state="loaded",e(null))}.bind(this)))}}.bind(this)),t.neighboringTiles=this._getNeighboringTiles(t.tileID)},e.prototype._getNeighboringTiles=function(t){var e=t.canonical,r=Math.pow(2,e.z),i=(e.x-1+r)%r,n=0===e.x?t.wrap-1:t.wrap,o=(e.x+1+r)%r,a=e.x+1===r?t.wrap+1:t.wrap,l={};return l[new s(t.overscaledZ,n,e.z,i,e.y).key]={backfilled:!1},l[new s(t.overscaledZ,a,e.z,o,e.y).key]={backfilled:!1},0<e.y&&(l[new s(t.overscaledZ,n,e.z,i,e.y-1).key]={backfilled:!1},l[new s(t.overscaledZ,t.wrap,e.z,e.x,e.y-1).key]={backfilled:!1},l[new s(t.overscaledZ,a,e.z,o,e.y-1).key]={backfilled:!1}),e.y+1<r&&(l[new s(t.overscaledZ,n,e.z,i,e.y+1).key]={backfilled:!1},l[new s(t.overscaledZ,t.wrap,e.z,e.x,e.y+1).key]={backfilled:!1},l[new s(t.overscaledZ,a,e.z,o,e.y+1).key]={backfilled:!1}),l},e.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",this.dispatcher.send("removeDEMTile",{uid:t.uid,source:this.id},void 0,t.workerID)},e}(t("./raster_tile_source"));e.exports=l},{"../util/ajax":251,"../util/browser":252,"../util/evented":260,"../util/mapbox":267,"../util/util":275,"./raster_tile_source":108,"./tile_id":114}],107:[function(t,e,r){"use strict";var i=t("../data/dem_data").DEMData,n=function(){this.loading={},this.loaded={}};n.prototype.loadTile=function(t,e){var r=t.source,n=t.uid;this.loading[r]||(this.loading[r]={});var o=new i(n);(this.loading[r][n]=o).loadFromImage(t.rawImageData),delete this.loading[r][n],this.loaded[r]=this.loaded[r]||{},e(null,this.loaded[r][n]=o)},n.prototype.removeTile=function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},e.exports=n},{"../data/dem_data":52}],108:[function(t,e,r){"use strict";var i=t("../util/util"),n=t("../util/ajax"),o=t("../util/evented"),a=t("./load_tilejson"),s=t("../util/mapbox").normalizeTileURL,l=t("./tile_bounds"),u=t("../render/texture"),c=function(t){function e(e,r,n,o){t.call(this),this.id=e,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=i.extend({},r),i.extend(this,i.pick(r,["url","scheme","tileSize"]))}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.load=function(){var t=this;this.fire("dataloading",{dataType:"source"}),a(this._options,this.map._transformRequest,function(e,r){e?t.fire("error",e):r&&(i.extend(t,r),r.bounds&&(t.tileBounds=new l(r.bounds,t.minzoom,t.maxzoom)),t.fire("data",{dataType:"source",sourceDataType:"metadata"}),t.fire("data",{dataType:"source",sourceDataType:"content"}))})},e.prototype.onAdd=function(t){this.map=t,this.load()},e.prototype.serialize=function(){return i.extend({},this._options)},e.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},e.prototype.loadTile=function(t,e){var r=this,i=s(t.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);t.request=n.getImage(this.map._transformRequest(i,n.ResourceType.Tile),function(i,n){if(delete t.request,t.aborted)t.state="unloaded",e(null);else if(i)t.state="errored",e(i);else if(n){r.map._refreshExpiredTiles&&t.setExpiryData(n),delete n.cacheControl,delete n.expires;var o=r.map.painter.context,a=o.gl;t.texture=r.map.painter.getTileTexture(n.width),t.texture?(t.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),a.texSubImage2D(a.TEXTURE_2D,0,0,0,a.RGBA,a.UNSIGNED_BYTE,n)):(t.texture=new u(o,n,a.RGBA),t.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),o.extTextureFilterAnisotropic&&a.texParameterf(a.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax)),a.generateMipmap(a.TEXTURE_2D),t.state="loaded",e(null)}})},e.prototype.abortTile=function(t,e){t.request&&(t.request.abort(),delete t.request),e()},e.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},e.prototype.hasTransition=function(){return!1},e}(o);e.exports=c},{"../render/texture":93,"../util/ajax":251,"../util/evented":260,"../util/mapbox":267,"../util/util":275,"./load_tilejson":103,"./tile_bounds":113}],109:[function(t,e,r){"use strict";var i=t("../util/ajax"),n=t("../util/evented"),o=t("../util/window"),a=!1,s=null;e.exports.evented=new n,e.exports.registerForPluginAvailability=function(t){return s?t({pluginBlobURL:s,errorCallback:e.exports.errorCallback}):e.exports.evented.once("pluginAvailable",t),t},e.exports.createBlobURL=function(t){return o.URL.createObjectURL(new o.Blob([t.data],{type:"text/javascript"}))},e.exports.clearRTLTextPlugin=function(){a=!1,s=null},e.exports.setRTLTextPlugin=function(t,r){if(a)throw new Error("setRTLTextPlugin cannot be called multiple times.");a=!0,e.exports.errorCallback=r,i.getArrayBuffer({url:t},function(t,i){t?r(t):i&&(s=e.exports.createBlobURL(i),e.exports.evented.fire("pluginAvailable",{pluginBlobURL:s,errorCallback:r}))})},e.exports.applyArabicShaping=null,e.exports.processBidirectionalText=null},{"../util/ajax":251,"../util/evented":260,"../util/window":254}],110:[function(t,e,r){"use strict";var i=t("../util/util"),n={vector:t("../source/vector_tile_source"),raster:t("../source/raster_tile_source"),"raster-dem":t("../source/raster_dem_tile_source"),geojson:t("../source/geojson_source"),video:t("../source/video_source"),image:t("../source/image_source"),canvas:t("../source/canvas_source")};r.create=function(t,e,r,o){var a=new n[e.type](t,e,r,o);if(a.id!==t)throw new Error("Expected Source id to be "+t+" instead of "+a.id);return i.bindAll(["load","abort","unload","serialize","prepare"],a),a},r.getType=function(t){return n[t]},r.setType=function(t,e){n[t]=e}},{"../source/canvas_source":98,"../source/geojson_source":99,"../source/image_source":102,"../source/raster_dem_tile_source":106,"../source/raster_tile_source":108,"../source/vector_tile_source":115,"../source/video_source":117,"../util/util":275}],111:[function(t,e,r){"use strict";function i(t,e){var r=e.zoomTo(t.canonical.z);return new h((r.column-(t.canonical.x+t.wrap*Math.pow(2,t.canonical.z)))*p,(r.row-t.canonical.y)*p)}function n(t){return"raster"===t||"image"===t||"video"===t}var o=t("./source").create,a=t("./tile"),s=t("../util/evented"),l=t("../util/lru_cache"),u=t("../geo/coordinate"),c=t("../util/util"),p=t("../data/extent"),h=(t("../gl/context"),t("@mapbox/point-geometry")),f=t("../util/browser"),d=t("./tile_id").OverscaledTileID,m=function(t){function e(e,r,i){var n=this;t.call(this),this.id=e,this.dispatcher=i,this.on("data",function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(n._sourceLoaded=!0),n._sourceLoaded&&!n._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(n.reload(),n.transform&&n.update(n.transform))}),this.on("error",function(){n._sourceErrored=!0}),this._source=o(e,r,i,this),this._tiles={},this._cache=new l(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._isIdRenderable=this._isIdRenderable.bind(this),this._coveredTiles={}}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},e.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},e.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},e.prototype.getSource=function(){return this._source},e.prototype.pause=function(){this._paused=!0},e.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)}},e.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},e.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,function(){})},e.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,function(){})},e.prototype.serialize=function(){return this._source.serialize()},e.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._tiles)this._tiles[e].upload(t)},e.prototype.getIds=function(){var t=this;return Object.keys(this._tiles).map(Number).sort(function(e,r){var i=t._tiles[e].tileID,n=t._tiles[r].tileID,o=new h(i.canonical.x,i.canonical.y).rotate(t.transform.angle),a=new h(n.canonical.x,n.canonical.y).rotate(t.transform.angle);return i.overscaledZ-n.overscaledZ||a.y-o.y||a.x-o.x})},e.prototype.getRenderableIds=function(){return this.getIds().filter(this._isIdRenderable)},e.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0,{});return!!e&&this._isIdRenderable(e.tileID.key)},e.prototype._isIdRenderable=function(t){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]},e.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._resetCache(),this._tiles)this._reloadTile(t,"reloading")},e.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)))},e.prototype._tileLoaded=function(t,e,r,i){if(i)return t.state="errored",void(404!==i.status?this._source.fire("error",{tile:t,error:i}):this.update(this.transform));t.timeAdded=f.now(),"expired"===r&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(e,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._source.fire("data",{dataType:"source",tile:t,coord:t.tileID}),this.map&&(this.map.painter.tileExtentVAO.vao=null)},e.prototype._backfillDEM=function(t){function e(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||1<Math.abs(i)||(1<Math.abs(r)&&(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)))}for(var r=this.getRenderableIds(),i=0;i<r.length;i++){var n=r[i];if(t.neighboringTiles&&t.neighboringTiles[n]){var o=this.getTileByID(n);e(t,o),e(o,t)}}},e.prototype.getTile=function(t){return this.getTileByID(t.key)},e.prototype.getTileByID=function(t){return this._tiles[t]},e.prototype.getZoom=function(t){return t.zoom+t.scaleZoom(t.tileSize/this._source.tileSize)},e.prototype._findLoadedChildren=function(t,e,r){var i=this,n=!1;for(var o in i._tiles){var a=i._tiles[o];if(!(r[o]||!a.hasData()||a.tileID.overscaledZ<=t.overscaledZ||a.tileID.overscaledZ>e)){var s=Math.pow(2,a.tileID.canonical.z-t.canonical.z);if(Math.floor(a.tileID.canonical.x/s)===t.canonical.x&&Math.floor(a.tileID.canonical.y/s)===t.canonical.y)for(r[o]=a.tileID,n=!0;a&&a.tileID.overscaledZ-1>t.overscaledZ;){var l=a.tileID.scaledTo(a.tileID.overscaledZ-1);if(!l)break;(a=i._tiles[l.key])&&a.hasData()&&(delete r[o],r[l.key]=l)}}}return n},e.prototype.findLoadedParent=function(t,e,r){for(var i=this,n=t.overscaledZ-1;e<=n;n--){var o=t.scaledTo(n);if(!o)return;var a=String(o.key),s=i._tiles[a];if(s&&s.hasData())return r[a]=o,s;if(i._cache.has(a))return r[a]=o,i._cache.get(a)}},e.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(i)},e.prototype.update=function(t){var r=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(t),this._coveredTiles={},this.used?this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(t){return new d(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)}):(i=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter(function(t){return r._source.hasTile(t)}))):i=[];var o,a=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(a-e.maxOverzooming,this._source.minzoom),l=Math.max(a+e.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(i,a),p={};if(n(this._source.type))for(var h=Object.keys(u),m=0;m<h.length;m++){var y=h[m],_=u[y],g=r._tiles[y];if(g&&(void 0===g.fadeEndTime||g.fadeEndTime>=f.now())){r._findLoadedChildren(_,l,u)&&(u[y]=_);var v=r.findLoadedParent(_,s,p);v&&r._addTile(v.tileID)}}for(o in p)u[o]||(r._coveredTiles[o]=!0);for(o in p)u[o]=p[o];for(var x=c.keysDifference(this._tiles,u),b=0;b<x.length;b++)r._removeTile(x[b])}},e.prototype._updateRetainedTiles=function(t,r){for(var i=this,n={},o={},a=Math.max(r-e.maxOverzooming,this._source.minzoom),s=Math.max(r+e.maxUnderzooming,this._source.minzoom),l=0;l<t.length;l++){var u=t[l],c=i._addTile(u),p=!1;if(c.hasData())n[u.key]=u;else{p=c.wasRequested(),n[u.key]=u;var h=!0;if(r+1>i._source.maxzoom){var f=u.children(i._source.maxzoom)[0],d=i.getTile(f);d&&d.hasData()?n[f.key]=f:h=!1}else{i._findLoadedChildren(u,s,n);for(var m=u.children(i._source.maxzoom),y=0;y<m.length;y++)if(!n[m[y].key]){h=!1;break}}if(!h)for(var _=u.overscaledZ-1;a<=_;--_){var g=u.scaledTo(_);if(o[g.key])break;if(o[g.key]=!0,!(c=i.getTile(g))&&p&&(c=i._addTile(g)),c&&(n[g.key]=g,p=c.wasRequested(),c.hasData()))break}}}return n},e.prototype._addTile=function(t){var e=this._tiles[t.key];if(e)return e;(e=this._cache.getAndRemove(t.key))&&this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,e));var r=Boolean(e);return r||(e=new a(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(e,this._tileLoaded.bind(this,e,t.key,e.state))),e?(e.uses++,this._tiles[t.key]=e,r||this._source.fire("dataloading",{tile:e,coord:e.tileID,dataType:"source"}),e):null},e.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))},e.prototype._setCacheInvalidationTimer=function(t,e){var r=this;t in this._cacheTimers&&(clearTimeout(this._cacheTimers[t]),delete this._cacheTimers[t]);var i=e.getExpiryTimeout();i&&(this._cacheTimers[t]=setTimeout(function(){r._cache.remove(t),delete r._cacheTimers[t]},i))},e.prototype._removeTile=function(t){var e=this._tiles[t];if(e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),!(0<e.uses)))if(e.hasData()){e.tileID=e.tileID.wrapped();var r=e.tileID.key;this._cache.add(r,e),this._setCacheInvalidationTimer(r,e)}else e.aborted=!0,this._abortTile(e),this._unloadTile(e)},e.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._resetCache()},e.prototype._resetCache=function(){for(var t in this._cacheTimers)clearTimeout(this._cacheTimers[t]);this._cacheTimers={},this._cache.reset()},e.prototype.tilesIn=function(t){for(var e=[],r=this.getIds(),n=1/0,o=1/0,a=-1/0,s=-1/0,l=t[0].zoom,c=0;c<t.length;c++){var h=t[c];n=Math.min(n,h.column),o=Math.min(o,h.row),a=Math.max(a,h.column),s=Math.max(s,h.row)}for(var f=0;f<r.length;f++){var d=this._tiles[r[f]],m=d.tileID,y=[i(m,new u(n,o,l)),i(m,new u(a,s,l))];if(y[0].x<p&&y[0].y<p&&0<=y[1].x&&0<=y[1].y){for(var _=[],g=0;g<t.length;g++)_.push(i(m,t[g]));e.push({tile:d,tileID:m,queryGeometry:[_],scale:Math.pow(2,this.transform.zoom-d.tileID.overscaledZ)})}}return e},e.prototype.getVisibleCoordinates=function(){for(var t=this,e=this.getRenderableIds().map(function(e){return t._tiles[e].tileID}),r=0,i=e;r<i.length;r+=1){var n=i[r];n.posMatrix=t.transform.calculatePosMatrix(n.toUnwrapped())}return e},e.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(n(this._source.type))for(var t in this._tiles){var e=this._tiles[t];if(void 0!==e.fadeEndTime&&e.fadeEndTime>=f.now())return!0}return!1},e}(s);m.maxOverzooming=10,m.maxUnderzooming=3,e.exports=m},{"../data/extent":53,"../geo/coordinate":61,"../gl/context":66,"../util/browser":252,"../util/evented":260,"../util/lru_cache":266,"../util/util":275,"./source":110,"./tile":112,"./tile_id":114,"@mapbox/point-geometry":4}],112:[function(t,e,r){"use strict";var i=t("../util/util"),n=t("../data/bucket").deserialize,o=(t("../data/feature_index"),t("@mapbox/vector-tile")),a=t("pbf"),s=t("../util/vectortile_to_geojson"),l=t("../style-spec/feature_filter"),u=(t("../symbol/collision_index"),t("../data/bucket/symbol_bucket")),c=t("../data/array_types"),p=c.RasterBoundsArray,h=c.CollisionBoxArray,f=t("../data/raster_bounds_attributes"),d=t("../data/extent"),m=t("@mapbox/point-geometry"),y=t("../render/texture"),_=t("../data/segment").SegmentVector,g=t("../data/index_array_type").TriangleIndexArray,v=t("../util/browser"),x=function(t,e){this.tileID=t,this.uid=i.uniqueId(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.expiredRequestCount=0,this.state="loading"};x.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<v.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},x.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},x.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){if(t.rawTileData&&(this.rawTileData=t.rawTileData),this.collisionBoxArray=t.collisionBoxArray,this.featureIndex=t.featureIndex,this.featureIndex.rawTileData=this.rawTileData,this.buckets=n(t.buckets,e.style),r)for(var i in this.buckets){var o=this.buckets[i];o instanceof u&&(o.justReloaded=!0)}t.iconAtlasImage&&(this.iconAtlasImage=t.iconAtlasImage),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new h},x.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.iconAtlasTexture&&this.iconAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.collisionBoxArray=null,this.featureIndex=null,this.state="unloaded"},x.prototype.unloadDEMData=function(){this.dem=null,this.neighboringTiles=null,this.state="unloaded"},x.prototype.getBucket=function(t){return this.buckets[t.id]},x.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploaded||(r.upload(t),r.uploaded=!0)}var i=t.gl;this.iconAtlasImage&&(this.iconAtlasTexture=new y(t,this.iconAtlasImage,i.RGBA),this.iconAtlasImage=null),this.glyphAtlasImage&&(this.glyphAtlasTexture=new y(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null)},x.prototype.queryRenderedFeatures=function(t,e,r,i,n,o,a){if(!this.featureIndex||!this.collisionBoxArray)return{};var s=0,l={};for(var c in t){var p=this.getBucket(t[c]);p&&(s=Math.max(s,t[c].queryRadius(p)),p instanceof u&&void 0!==p.bucketInstanceId&&(l[p.bucketInstanceId]=!0))}return this.featureIndex.query({queryGeometry:e,scale:r,tileSize:this.tileSize,bearing:n,params:i,additionalRadius:s,collisionBoxArray:this.collisionBoxArray,sourceID:o,collisionIndex:a,bucketInstanceIds:l},t)},x.prototype.querySourceFeatures=function(t,e){if(this.rawTileData){this.vtLayers||(this.vtLayers=new o.VectorTile(new a(this.rawTileData)).layers);var r=e?e.sourceLayer:"",i=this.vtLayers._geojsonTileLayer||this.vtLayers[r];if(i)for(var n=l(e&&e.filter),u={z:this.tileID.overscaledZ,x:this.tileID.canonical.x,y:this.tileID.canonical.y},c=0;c<i.length;c++){var p=i.feature(c);if(n({zoom:this.tileID.overscaledZ},p)){var h=new s(p,u.z,u.x,u.y);h.tile=u,t.push(h)}}}},x.prototype.clearMask=function(){this.segments&&(this.segments.destroy(),delete this.segments),this.maskedBoundsBuffer&&(this.maskedBoundsBuffer.destroy(),delete this.maskedBoundsBuffer),this.maskedIndexBuffer&&(this.maskedIndexBuffer.destroy(),delete this.maskedIndexBuffer)},x.prototype.setMask=function(t,e){if(!i.deepEqual(this.mask,t)&&(this.mask=t,this.clearMask(),!i.deepEqual(t,{0:!0}))){var r=new p,n=new g;this.segments=new _,this.segments.prepareSegment(0,r,n);for(var o=Object.keys(t),a=0;a<o.length;a++){var s=t[o[a]],l=d>>s.z,u=new m(s.x*l,s.y*l),c=new m(u.x+l,u.y+l),h=this.segments.prepareSegment(4,r,n);r.emplaceBack(u.x,u.y,u.x,u.y),r.emplaceBack(c.x,u.y,c.x,u.y),r.emplaceBack(u.x,c.y,u.x,c.y),r.emplaceBack(c.x,c.y,c.x,c.y);var y=h.vertexLength;n.emplaceBack(y,y+1,y+2),n.emplaceBack(y+1,y+2,y+3),h.vertexLength+=4,h.primitiveLength+=2}this.maskedBoundsBuffer=e.createVertexBuffer(r,f.members),this.maskedIndexBuffer=e.createIndexBuffer(n)}},x.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},x.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=i.parseCacheControl(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 n=Date.now(),o=!1;if(this.expirationTime>n)o=!1;else if(e)if(this.expirationTime<e)o=!0;else{var a=this.expirationTime-e;a?this.expirationTime=n+Math.max(a,3e4):o=!0}else o=!0;o?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},x.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)},e.exports=x},{"../data/array_types":39,"../data/bucket":40,"../data/bucket/symbol_bucket":51,"../data/extent":53,"../data/feature_index":54,"../data/index_array_type":55,"../data/raster_bounds_attributes":59,"../data/segment":60,"../render/texture":93,"../style-spec/feature_filter":148,"../symbol/collision_index":217,"../util/browser":252,"../util/util":275,"../util/vectortile_to_geojson":276,"@mapbox/point-geometry":4,"@mapbox/vector-tile":8,pbf:30}],113:[function(t,e,r){"use strict";var i=t("../geo/lng_lat_bounds"),n=t("../util/util").clamp,o=function(t,e,r){this.bounds=i.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=r||24};o.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]},o.prototype.contains=function(t){var e=Math.floor(this.lngX(this.bounds.getWest(),t.z)),r=Math.floor(this.latY(this.bounds.getNorth(),t.z)),i=Math.ceil(this.lngX(this.bounds.getEast(),t.z)),n=Math.ceil(this.latY(this.bounds.getSouth(),t.z));return t.x>=e&&t.x<i&&t.y>=r&&t.y<n},o.prototype.lngX=function(t,e){return(t+180)*(Math.pow(2,e)/360)},o.prototype.latY=function(t,e){var r=n(Math.sin(Math.PI/180*t),-.9999,.9999),i=Math.pow(2,e)/(2*Math.PI);return Math.pow(2,e-1)+.5*Math.log((1+r)/(1-r))*-i},e.exports=o},{"../geo/lng_lat_bounds":63,"../util/util":275}],114:[function(t,e,r){"use strict";function i(t,e,r,i){(t*=2)<0&&(t=-1*t-1);var n=1<<e;return 32*(n*n*t+n*i+r)+e}var n=t("@mapbox/whoots-js"),o=t("../util/web_worker_transfer").register,a=t("../geo/coordinate"),s=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=i(0,t,e,r)};s.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},s.prototype.url=function(t,e){var r=n.getTileBBox(this.x,this.y,this.z),i=function(t,e,r){for(var i,n="",o=t;0<o;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}",i).replace("{bbox-epsg-3857}",r)};var l=function(t,e){this.wrap=t,this.canonical=e,this.key=i(t,e.z,e.x,e.y)},u=function(t,e,r,n,o){this.overscaledZ=t,this.wrap=e,this.canonical=new s(r,+n,+o),this.key=i(e,t,n,o)};u.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new u(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new u(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},u.prototype.isChildOf=function(t){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},u.prototype.children=function(t){if(this.overscaledZ>=t)return[new u(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 u(e,this.wrap,e,r,i),new u(e,this.wrap,e,r+1,i),new u(e,this.wrap,e,r,i+1),new u(e,this.wrap,e,r+1,i+1)]},u.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))},u.prototype.wrapped=function(){return new u(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},u.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},u.prototype.toUnwrapped=function(){return new l(this.wrap,this.canonical)},u.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},u.prototype.toCoordinate=function(){return new a(this.canonical.x+Math.pow(2,this.wrap),this.canonical.y,this.canonical.z)},o("CanonicalTileID",s),o("OverscaledTileID",u,{omit:["posMatrix"]}),e.exports={CanonicalTileID:s,OverscaledTileID:u,UnwrappedTileID:l}},{"../geo/coordinate":61,"../util/web_worker_transfer":278,"@mapbox/whoots-js":12}],115:[function(t,e,r){"use strict";var i=t("../util/evented"),n=t("../util/util"),o=t("./load_tilejson"),a=t("../util/mapbox").normalizeTileURL,s=t("./tile_bounds"),l=t("../util/ajax").ResourceType,u=t("../util/browser"),c=function(t){function e(e,r,i,o){if(t.call(this),this.id=e,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,n.extend(this,n.pick(r,["url","scheme","tileSize"])),this._options=n.extend({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(o)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.load=function(){var t=this;this.fire("dataloading",{dataType:"source"}),o(this._options,this.map._transformRequest,function(e,r){e?t.fire("error",e):r&&(n.extend(t,r),r.bounds&&(t.tileBounds=new s(r.bounds,t.minzoom,t.maxzoom)),t.fire("data",{dataType:"source",sourceDataType:"metadata"}),t.fire("data",{dataType:"source",sourceDataType:"content"}))})},e.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},e.prototype.onAdd=function(t){this.map=t,this.load()},e.prototype.serialize=function(){return n.extend({},this._options)},e.prototype.loadTile=function(t,e){function r(r,i){return t.aborted?e(null):r?e(r):(i&&i.resourceTiming&&(t.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&t.setExpiryData(i),t.loadVectorData(i,this.map.painter),e(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}var i=t.tileID.overscaleFactor(),n=a(t.tileID.canonical.url(this.tiles,this.scheme),this.url),o={request:this.map._transformRequest(n,l.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*i,type:this.type,source:this.id,pixelRatio:u.devicePixelRatio,overscaling:i,showCollisionBoxes:this.map.showCollisionBoxes};o.request.collectResourceTiming=this._collectResourceTiming,void 0===t.workerID||"expired"===t.state?t.workerID=this.dispatcher.send("loadTile",o,r.bind(this)):"loading"===t.state?t.reloadCallback=e:this.dispatcher.send("reloadTile",o,r.bind(this),t.workerID)},e.prototype.abortTile=function(t){this.dispatcher.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID)},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID)},e.prototype.hasTransition=function(){return!1},e}(i);e.exports=c},{"../util/ajax":251,"../util/browser":252,"../util/evented":260,"../util/mapbox":267,"../util/util":275,"./load_tilejson":103,"./tile_bounds":113}],116:[function(t,e,r){"use strict";function i(t,e){var r=n.getArrayBuffer(t.request,function(t,r){t?e(t):r&&e(null,{vectorTile:new o.VectorTile(new a(r.data)),rawData:r.data,cacheControl:r.cacheControl,expires:r.expires})});return function(){r.abort(),e()}}var n=t("../util/ajax"),o=t("@mapbox/vector-tile"),a=t("pbf"),s=t("./worker_tile"),l=t("../util/util"),u=t("../util/performance"),c=function(t,e,r){this.actor=t,this.layerIndex=e,this.loadVectorData=r||i,this.loading={},this.loaded={}};c.prototype.loadTile=function(t,e){var r=this,i=t.source,n=t.uid;this.loading[i]||(this.loading[i]={});var o=this.loading[i][n]=new s(t);o.abort=this.loadVectorData(t,function(a,s){if(delete r.loading[i][n],a||!s)return e(a);var c=s.rawData,p={};s.expires&&(p.expires=s.expires),s.cacheControl&&(p.cacheControl=s.cacheControl);var h={};if(t.request&&t.request.collectResourceTiming){var f=u.getEntriesByName(t.request.url);f&&(h.resourceTiming=JSON.parse(JSON.stringify(f)))}o.vectorTile=s.vectorTile,o.parse(s.vectorTile,r.layerIndex,r.actor,function(t,r){if(t||!r)return e(t);e(null,l.extend({rawTileData:c.slice(0)},r,p,h))}),r.loaded[i]=r.loaded[i]||{},r.loaded[i][n]=o})},c.prototype.reloadTile=function(t,e){var r=this.loaded[t.source],i=t.uid,n=this;if(r&&r[i]){var o=r[i];o.showCollisionBoxes=t.showCollisionBoxes,"parsing"===o.status?o.reloadCallback=e:"done"===o.status&&o.parse(o.vectorTile,this.layerIndex,this.actor,function(t,r){if(this.reloadCallback){var i=this.reloadCallback;delete this.reloadCallback,this.parse(this.vectorTile,n.layerIndex,n.actor,i)}e(t,r)}.bind(o))}},c.prototype.abortTile=function(t,e){var r=this.loading[t.source],i=t.uid;r&&r[i]&&r[i].abort&&(r[i].abort(),delete r[i]),e()},c.prototype.removeTile=function(t,e){var r=this.loaded[t.source],i=t.uid;r&&r[i]&&delete r[i],e()},e.exports=c},{"../util/ajax":251,"../util/performance":268,"../util/util":275,"./worker_tile":119,"@mapbox/vector-tile":8,pbf:30}],117:[function(t,e,r){"use strict";var i=t("../util/ajax"),n=t("./image_source"),o=t("../data/raster_bounds_attributes"),a=t("../render/vertex_array_object"),s=t("../render/texture"),l=function(t){function e(e,r,i,n){t.call(this,e,r,i,n),this.roundZoom=!0,this.type="video",this.options=r}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.load=function(){var t=this,e=this.options;this.urls=e.urls,i.getVideo(e.urls,function(e,r){e?t.fire("error",{error:e}):r&&(t.video=r,t.video.loop=!0,t.video.addEventListener("playing",function(){t.map._rerender()}),t.map&&t.video.play(),t._finishLoading())})},e.prototype.getVideo=function(){return this.video},e.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},e.prototype.prepare=function(){var t=this;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,o.members)),this.boundsVAO||(this.boundsVAO=new a),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 s(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),t.tiles){var n=t.tiles[i];"loaded"!==n.state&&(n.state="loaded",n.texture=t.texture)}}},e.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},e.prototype.hasTransition=function(){return this.video&&!this.video.paused},e}(n);e.exports=l},{"../data/raster_bounds_attributes":59,"../render/texture":93,"../render/vertex_array_object":95,"../util/ajax":251,"./image_source":102}],118:[function(t,e,r){"use strict";var i=t("../util/actor"),n=t("../style/style_layer_index"),o=t("./vector_tile_worker_source"),a=t("./raster_dem_tile_worker_source"),s=t("./geojson_worker_source"),l=t("./rtl_text_plugin"),u=function(t){var e=this;this.self=t,this.actor=new i(t,this),this.layerIndexes={},this.workerSourceTypes={vector:o,geojson:s},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,r){if(e.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');e.workerSourceTypes[t]=r},this.self.registerRTLTextPlugin=function(t){if(l.applyArabicShaping||l.processBidirectionalText)throw new Error("RTL text plugin already registered.");l.applyArabicShaping=t.applyArabicShaping,l.processBidirectionalText=t.processBidirectionalText}};u.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},u.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},u.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type).loadTile(e,r)},u.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t).loadTile(e,r)},u.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type).reloadTile(e,r)},u.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type).abortTile(e,r)},u.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type).removeTile(e,r)},u.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t).removeTile(e)},u.prototype.removeSource=function(t,e,r){var i=this.getWorkerSource(t,e.type);void 0!==i.removeSource?i.removeSource(e,r):r()},u.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t)}},u.prototype.loadRTLTextPlugin=function(t,e,r){try{l.applyArabicShaping||l.processBidirectionalText||(this.self.importScripts(e),l.applyArabicShaping&&l.processBidirectionalText||r(new Error("RTL Text Plugin failed to import scripts from "+e)))}catch(t){r(t)}},u.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e},u.prototype.getWorkerSource=function(t,e){var r=this;if(this.workerSources[t]||(this.workerSources[t]={}),!this.workerSources[t][e]){var i={send:function(e,i,n){r.actor.send(e,i,n,t)}};this.workerSources[t][e]=new this.workerSourceTypes[e](i,this.getLayerIndex(t))}return this.workerSources[t][e]},u.prototype.getDEMWorkerSource=function(t){return this.demWorkerSources[t]||(this.demWorkerSources[t]=new a),this.demWorkerSources[t]},e.exports=function(t){return new u(t)}},{"../style/style_layer_index":210,"../util/actor":250,"./geojson_worker_source":100,"./raster_dem_tile_worker_source":107,"./rtl_text_plugin":109,"./vector_tile_worker_source":116}],119:[function(t,e,r){"use strict";function i(t,e){for(var r=new h(e),i=0,n=t;i<n.length;i+=1)n[i].recalculate(r)}var n=t("../data/feature_index"),o=t("../symbol/symbol_layout").performSymbolLayout,a=t("../data/array_types").CollisionBoxArray,s=t("../util/dictionary_coder"),l=t("../data/bucket/symbol_bucket"),u=t("../util/util"),c=t("../render/image_atlas").makeImageAtlas,p=t("../render/glyph_atlas").makeGlyphAtlas,h=t("../style/evaluation_parameters"),f=t("./tile_id").OverscaledTileID,d=function(t){this.tileID=new f(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=t.overscaling,this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming};d.prototype.parse=function(t,e,r,h){function f(){if(I)return h(I);if(M&&P){var t=p(M),e=c(P);for(var r in _){var n=_[r];n instanceof l&&(i(n.layers,this.zoom),o(n,M,t.positions,P,e.positions,this.showCollisionBoxes))}this.status="done",h(null,{buckets:u.values(_).filter(function(t){return!t.isEmpty()}),featureIndex:y,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,iconAtlasImage:e.image})}}var d=this;this.status="parsing",this.data=t,this.collisionBoxArray=new a;var m=new s(Object.keys(t.layers).sort()),y=new n(this.tileID,this.overscaling);y.bucketLayerIDs=[];var _={},g={featureIndex:y,iconDependencies:{},glyphDependencies:{}},v=e.familiesBySource[this.source];for(var x in v){var b=t.layers[x];if(b){1===b.version&&u.warnOnce('Vector tile source "'+d.source+'" layer "'+x+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var w=m.encode(x),S=[],A=0;A<b.length;A++){var T=b.feature(A);S.push({feature:T,index:A,sourceLayerIndex:w})}for(var z=0,E=v[x];z<E.length;z+=1){var k=E[z],C=k[0];C.minzoom&&d.zoom<Math.floor(C.minzoom)||C.maxzoom&&d.zoom>=C.maxzoom||"none"===C.visibility||(i(k,d.zoom),(_[C.id]=C.createBucket({index:y.bucketLayerIDs.length,layers:k,zoom:d.zoom,pixelRatio:d.pixelRatio,overscaling:d.overscaling,collisionBoxArray:d.collisionBoxArray})).populate(S,g),y.bucketLayerIDs.push(k.map(function(t){return t.id})))}}}var I,M,P,L=u.mapObject(g.glyphDependencies,function(t){return Object.keys(t).map(Number)});Object.keys(L).length?r.send("getGlyphs",{uid:this.uid,stacks:L},function(t,e){I||(I=t,M=e,f.call(d))}):M={};var D=Object.keys(g.iconDependencies);D.length?r.send("getImages",{icons:D},function(t,e){I||(I=t,P=e,f.call(d))}):P={},f.call(this)},e.exports=d},{"../data/array_types":39,"../data/bucket/symbol_bucket":51,"../data/feature_index":54,"../render/glyph_atlas":85,"../render/image_atlas":87,"../style/evaluation_parameters":182,"../symbol/symbol_layout":227,"../util/dictionary_coder":257,"../util/util":275,"./tile_id":114}],120:[function(t,e,r){"use strict";function i(t,e){var r={};for(var i in t)"ref"!==i&&(r[i]=t[i]);return n.forEach(function(t){t in e&&(r[t]=e[t])}),r}var n=t("./util/ref_properties");e.exports=function(t){t=t.slice();for(var e=Object.create(null),r=0;r<t.length;r++)e[t[r].id]=t[r];for(var n=0;n<t.length;n++)"ref"in t[n]&&(t[n]=i(t[n],e[t[n].ref]));return t}},{"./util/ref_properties":159}],121:[function(t,e,r){"use strict";function i(t,e,r){r.push({command:p.addSource,args:[t,e[t]]})}function n(t,e,r){e.push({command:p.removeSource,args:[t]}),r[t]=!0}function o(t,e,r,o){n(t,r,o),i(t,e,r)}function a(t,e,r){var i;for(i in t[r])if(t[r].hasOwnProperty(i)&&"data"!==i&&!c(t[r][i],e[r][i]))return!1;for(i in e[r])if(e[r].hasOwnProperty(i)&&"data"!==i&&!c(t[r][i],e[r][i]))return!1;return!0}function s(t,e,r,i,n,o){var a;for(a in e=e||{},t=t||{})t.hasOwnProperty(a)&&(c(t[a],e[a])||r.push({command:o,args:[i,a,e[a],n]}));for(a in e)e.hasOwnProperty(a)&&!t.hasOwnProperty(a)&&(c(t[a],e[a])||r.push({command:o,args:[i,a,e[a],n]}))}function l(t){return t.id}function u(t,e){return t[e.id]=e,t}var c=t("./util/deep_equal"),p={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"};e.exports=function(t,e){if(!t)return[{command:p.setStyle,args:[e]}];var r=[];try{if(!c(t.version,e.version))return[{command:p.setStyle,args:[e]}];c(t.center,e.center)||r.push({command:p.setCenter,args:[e.center]}),c(t.zoom,e.zoom)||r.push({command:p.setZoom,args:[e.zoom]}),c(t.bearing,e.bearing)||r.push({command:p.setBearing,args:[e.bearing]}),c(t.pitch,e.pitch)||r.push({command:p.setPitch,args:[e.pitch]}),c(t.sprite,e.sprite)||r.push({command:p.setSprite,args:[e.sprite]}),c(t.glyphs,e.glyphs)||r.push({command:p.setGlyphs,args:[e.glyphs]}),c(t.transition,e.transition)||r.push({command:p.setTransition,args:[e.transition]}),c(t.light,e.light)||r.push({command:p.setLight,args:[e.light]});var h={},f=[];!function(t,e,r,s){var l;for(l in e=e||{},t=t||{})t.hasOwnProperty(l)&&(e.hasOwnProperty(l)||n(l,r,s));for(l in e)e.hasOwnProperty(l)&&(t.hasOwnProperty(l)?c(t[l],e[l])||("geojson"===t[l].type&&"geojson"===e[l].type&&a(t,e,l)?r.push({command:p.setGeoJSONSourceData,args:[l,e[l].data]}):o(l,e,r,s)):i(l,e,r))}(t.sources,e.sources,f,h);var d=[];t.layers&&t.layers.forEach(function(t){h[t.source]?r.push({command:p.removeLayer,args:[t.id]}):d.push(t)}),r=r.concat(f),function(t,e,r){e=e||[];var i,n,o,a,h,f,d,m=(t=t||[]).map(l),y=e.map(l),_=t.reduce(u,{}),g=e.reduce(u,{}),v=m.slice(),x=Object.create(null);for(n=i=0;i<m.length;i++)o=m[i],g.hasOwnProperty(o)?n++:(r.push({command:p.removeLayer,args:[o]}),v.splice(v.indexOf(o,n),1));for(n=i=0;i<y.length;i++)o=y[y.length-1-i],v[v.length-1-i]!==o&&(_.hasOwnProperty(o)?(r.push({command:p.removeLayer,args:[o]}),v.splice(v.lastIndexOf(o,v.length-n),1)):n++,f=v[v.length-i],r.push({command:p.addLayer,args:[g[o],f]}),v.splice(v.length-i,0,o),x[o]=!0);for(i=0;i<y.length;i++)if(a=_[o=y[i]],h=g[o],!x[o]&&!c(a,h))if(c(a.source,h.source)&&c(a["source-layer"],h["source-layer"])&&c(a.type,h.type)){for(d in s(a.layout,h.layout,r,o,null,p.setLayoutProperty),s(a.paint,h.paint,r,o,null,p.setPaintProperty),c(a.filter,h.filter)||r.push({command:p.setFilter,args:[o,h.filter]}),c(a.minzoom,h.minzoom)&&c(a.maxzoom,h.maxzoom)||r.push({command:p.setLayerZoomRange,args:[o,h.minzoom,h.maxzoom]}),a)a.hasOwnProperty(d)&&"layout"!==d&&"paint"!==d&&"filter"!==d&&"metadata"!==d&&"minzoom"!==d&&"maxzoom"!==d&&(0===d.indexOf("paint.")?s(a[d],h[d],r,o,d.slice(6),p.setPaintProperty):c(a[d],h[d])||r.push({command:p.setLayerProperty,args:[o,d,h[d]]}));for(d in h)h.hasOwnProperty(d)&&!a.hasOwnProperty(d)&&"layout"!==d&&"paint"!==d&&"filter"!==d&&"metadata"!==d&&"minzoom"!==d&&"maxzoom"!==d&&(0===d.indexOf("paint.")?s(a[d],h[d],r,o,d.slice(6),p.setPaintProperty):c(a[d],h[d])||r.push({command:p.setLayerProperty,args:[o,d,h[d]]}))}else r.push({command:p.removeLayer,args:[o]}),f=v[v.lastIndexOf(o)+1],r.push({command:p.addLayer,args:[h,f]})}(d,e.layers,r)}catch(t){console.warn("Unable to compute style diff:",t),r=[{command:p.setStyle,args:[e]}]}return r},e.exports.operations=p},{"./util/deep_equal":155}],122:[function(t,e,r){"use strict";e.exports=function(t,e,r){this.message=(t?t+": ":"")+r,null!=e&&e.__line__&&(this.line=e.__line__)}},{}],123:[function(t,e,r){"use strict";var i=t("./types").toString,n=t("./parsing_context"),o=(t("./evaluation_context"),function(t,e,r,i){this.name=t,this.type=e,this._evaluate=r,this.args=i});o.prototype.evaluate=function(t){return this._evaluate(t,this.args)},o.prototype.eachChild=function(t){this.args.forEach(t)},o.prototype.possibleOutputs=function(){return[void 0]},o.parse=function(t,e){var r=t[0],a=o.definitions[r];if(!a)return e.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var s=Array.isArray(a)?a[0]:a.type,l=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,u=l.filter(function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1}),c=[],p=1;p<t.length;p++){var h=t[p],f=void 0;if(1===u.length){var d=u[0][0];f=Array.isArray(d)?d[p-1]:d.type}var m=e.parse(h,1+c.length,f);if(!m)return null;c.push(m)}for(var y=null,_=0,g=u;_<g.length;_+=1){var v=g[_],x=v[0],b=v[1];if(y=new n(e.registry,e.path,null,e.scope),Array.isArray(x)&&x.length!==c.length)y.error("Expected "+x.length+" arguments, but found "+c.length+" instead.");else{for(var w=0;w<c.length;w++){var S=Array.isArray(x)?x[w]:x.type,A=c[w];y.concat(w+1).checkSubtype(S,A.type)}if(0===y.errors.length)return new o(r,s,b,c)}}if(1===u.length)e.errors.push.apply(e.errors,y.errors);else{var T=(u.length?u:l).map(function(t){return function(t){return Array.isArray(t)?"("+t.map(i).join(", ")+")":"("+i(t.type)+"...)"}(t[0])}).join(" | "),z=c.map(function(t){return i(t.type)}).join(", ");e.error("Expected arguments of type "+T+", but found ("+z+") instead.")}return null},o.register=function(t,e){for(var r in o.definitions=e)t[r]=o},e.exports={CompoundExpression:o,varargs:function(t){return{type:t}}}},{"./evaluation_context":138,"./parsing_context":141,"./types":146}],124:[function(t,e,r){"use strict";var i=t("../types"),n=i.toString,o=i.array,a=i.ValueType,s=i.StringType,l=i.NumberType,u=i.BooleanType,c=i.checkSubtype,p=t("../values").typeOf,h=t("../runtime_error"),f={string:s,number:l,boolean:u},d=function(t,e){this.type=t,this.input=e};d.parse=function(t,e){if(t.length<2||4<t.length)return e.error("Expected 1, 2, or 3 arguments, but found "+(t.length-1)+" instead.");var r,i;if(2<t.length){var n=t[1];if("string"!=typeof n||!(n in f))return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=f[n]}else r=a;if(3<t.length){if("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);i=t[2]}var s=o(r,i),l=e.parse(t[t.length-1],t.length-1,a);return l?new d(s,l):null},d.prototype.evaluate=function(t){var e=this.input.evaluate(t);if(c(this.type,p(e)))throw new h("Expected value to be of type "+n(this.type)+", but found "+n(p(e))+" instead.");return e},d.prototype.eachChild=function(t){t(this.input)},d.prototype.possibleOutputs=function(){return this.input.possibleOutputs()},e.exports=d},{"../runtime_error":143,"../types":146,"../values":147}],125:[function(t,e,r){"use strict";var i=t("../types"),n=i.ObjectType,o=i.ValueType,a=i.StringType,s=i.NumberType,l=i.BooleanType,u=t("../runtime_error"),c=t("../types"),p=c.checkSubtype,h=c.toString,f=t("../values").typeOf,d={string:a,number:s,boolean:l,object:n},m=function(t,e){this.type=t,this.args=e};m.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");for(var r=t[0],i=d[r],n=[],a=1;a<t.length;a++){var s=e.parse(t[a],a,o);if(!s)return null;n.push(s)}return new m(i,n)},m.prototype.evaluate=function(t){for(var e=this,r=0;r<this.args.length;r++){var i=e.args[r].evaluate(t);if(!p(e.type,f(i)))return i;if(r===e.args.length-1)throw new u("Expected value to be of type "+h(e.type)+", but found "+h(f(i))+" instead.")}return null},m.prototype.eachChild=function(t){this.args.forEach(t)},m.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}));var t},e.exports=m},{"../runtime_error":143,"../types":146,"../values":147}],126:[function(t,e,r){"use strict";var i=t("../types"),n=i.array,o=i.ValueType,a=i.NumberType,s=t("../runtime_error"),l=function(t,e,r){this.type=t,this.index=e,this.input=r};l.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,a),i=e.parse(t[2],2,n(e.expectedType||o));if(!r||!i)return null;var s=i.type;return new l(s.itemType,r,i)},l.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0||e>=r.length)throw new s("Array index out of bounds: "+e+" > "+r.length+".");if(e!==Math.floor(e))throw new s("Array index must be an integer, but found "+e+" instead.");return r[e]},l.prototype.eachChild=function(t){t(this.index),t(this.input)},l.prototype.possibleOutputs=function(){return[void 0]},e.exports=l},{"../runtime_error":143,"../types":146}],127:[function(t,e,r){"use strict";var i=t("../types").BooleanType,n=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};n.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 o=[],a=1;a<t.length-1;a+=2){var s=e.parse(t[a],a,i);if(!s)return null;var l=e.parse(t[a+1],a+1,r);if(!l)return null;o.push([s,l]),r=r||l.type}var u=e.parse(t[t.length-1],t.length-1,r);return u?new n(r,o,u):null},n.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[0],o=i[1];if(n.evaluate(t))return o.evaluate(t)}return this.otherwise.evaluate(t)},n.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[0],o=i[1];t(n),t(o)}t(this.otherwise)},n.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.branches.map(function(t){return t[0],t[1].possibleOutputs()})).concat(this.otherwise.possibleOutputs());var t},e.exports=n},{"../types":146}],128:[function(t,e,r){"use strict";var i=t("../types"),n=i.checkSubtype,o=i.ValueType,a=function(t,e){this.type=t,this.args=e};a.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 s=[],l=0,u=t.slice(1);l<u.length;l+=1){var c=u[l],p=e.parse(c,1+s.length,r,void 0,{omitTypeAnnotations:!0});if(!p)return null;r=r||p.type,s.push(p)}return i&&s.some(function(t){return n(i,t.type)})?new a(o,s):new a(r,s)},a.prototype.evaluate=function(t){for(var e=null,r=0,i=this.args;r<i.length&&null===(e=i[r].evaluate(t));r+=1);return e},a.prototype.eachChild=function(t){this.args.forEach(t)},a.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}));var t},e.exports=a},{"../types":146}],129:[function(t,e,r){"use strict";var i=t("../types"),n=i.ColorType,o=i.ValueType,a=i.NumberType,s=t("../values"),l=s.Color,u=s.validateRGBA,c=t("../runtime_error"),p={"to-number":a,"to-color":n},h=function(t,e){this.type=t,this.args=e};h.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");for(var r=t[0],i=p[r],n=[],a=1;a<t.length;a++){var s=e.parse(t[a],a,o);if(!s)return null;n.push(s)}return new h(i,n)},h.prototype.evaluate=function(t){if("color"===this.type.kind){for(var e,r,i=0,n=this.args;i<n.length;i+=1)if(r=null,"string"==typeof(e=n[i].evaluate(t))){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||4<e.length?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":u(e[0],e[1],e[2],e[3])))return new l(e[0]/255,e[1]/255,e[2]/255,e[3]);throw new c(r||"Could not parse color from value '"+("string"==typeof e?e:JSON.stringify(e))+"'")}for(var a=null,s=0,p=this.args;s<p.length;s+=1)if(null!==(a=p[s].evaluate(t))){var h=Number(a);if(!isNaN(h))return h}throw new c("Could not convert "+JSON.stringify(a)+" to number.")},h.prototype.eachChild=function(t){this.args.forEach(t)},h.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}));var t},e.exports=h},{"../runtime_error":143,"../types":146,"../values":147}],130:[function(t,e,r){"use strict";function i(t){return"string"===t.kind||"number"===t.kind||"boolean"===t.kind||"null"===t.kind}function n(t){return function(){function e(t,e){this.type=s,this.lhs=t,this.rhs=e}return e.parse=function(t,r){if(3!==t.length)return r.error("Expected two arguments.");var n=r.parse(t[1],1,a);if(!n)return null;var o=r.parse(t[2],2,a);return o?i(n.type)||i(o.type)?n.type.kind!==o.type.kind&&"value"!==n.type.kind&&"value"!==o.type.kind?r.error("Cannot compare "+l(n.type)+" and "+l(o.type)+"."):new e(n,o):r.error("Expected at least one argument to be a string, number, boolean, or null, but found ("+l(n.type)+", "+l(o.type)+") instead."):null},e.prototype.evaluate=function(e){return t(this.lhs.evaluate(e),this.rhs.evaluate(e))},e.prototype.eachChild=function(t){t(this.lhs),t(this.rhs)},e.prototype.possibleOutputs=function(){return[!0,!1]},e}()}var o=t("../types"),a=o.ValueType,s=o.BooleanType,l=t("../types").toString;e.exports={Equals:n(function(t,e){return t===e}),NotEquals:n(function(t,e){return t!==e})}},{"../types":146}],131:[function(t,e,r){"use strict";function i(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=A(r,i,n,a);if(s)throw new k(s);return new S(r/255*a,i/255*a,n/255*a,a)}function n(t,e){return t in e}function o(t,e){var r=e[t];return void 0===r?null:r}function a(t,e){return e[0].evaluate(t).length}function s(t,e){var r=e[0],i=e[1];return r.evaluate(t)<i.evaluate(t)}function l(t,e){var r=e[0],i=e[1];return r.evaluate(t)>i.evaluate(t)}function u(t,e){var r=e[0],i=e[1];return r.evaluate(t)<=i.evaluate(t)}function c(t,e){var r=e[0],i=e[1];return r.evaluate(t)>=i.evaluate(t)}var p=t("../types"),h=p.NumberType,f=p.StringType,d=p.BooleanType,m=p.ColorType,y=p.ObjectType,_=p.ValueType,g=p.ErrorType,v=p.array,x=p.toString,b=t("../values"),w=b.typeOf,S=b.Color,A=b.validateRGBA,T=t("../compound_expression"),z=T.CompoundExpression,E=T.varargs,k=t("../runtime_error"),C=t("./let"),I=t("./var"),M=t("./literal"),P=t("./assertion"),L=t("./array"),D=t("./coercion"),B=t("./at"),R=t("./match"),O=t("./case"),F=t("./step"),V=t("./interpolate"),j=t("./coalesce"),N=t("./equals"),U={"==":N.Equals,"!=":N.NotEquals,array:L,at:B,boolean:P,case:O,coalesce:j,interpolate:V,let:C,literal:M,match:R,number:P,object:P,step:F,string:P,"to-color":D,"to-number":D,var:I};z.register(U,{error:[g,[f],function(t,e){var r=e[0];throw new k(r.evaluate(t))}],typeof:[f,[_],function(t,e){var r=e[0];return x(w(r.evaluate(t)))}],"to-string":[f,[_],function(t,e){var r=e[0],i=typeof(r=r.evaluate(t));return null===r||"string"===i||"number"===i||"boolean"===i?String(r):r instanceof S?r.toString():JSON.stringify(r)}],"to-boolean":[d,[_],function(t,e){var r=e[0];return Boolean(r.evaluate(t))}],"to-rgba":[v(h,4),[m],function(t,e){var r=e[0].evaluate(t),i=r.r,n=r.g,o=r.b,a=r.a;return[255*i/a,255*n/a,255*o/a,a]}],rgb:[m,[h,h,h],i],rgba:[m,[h,h,h,h],i],length:{type:h,overloads:[[[f],a],[[v(_)],a]]},has:{type:d,overloads:[[[f],function(t,e){return n(e[0].evaluate(t),t.properties())}],[[f,y],function(t,e){var r=e[0],i=e[1];return n(r.evaluate(t),i.evaluate(t))}]]},get:{type:_,overloads:[[[f],function(t,e){return o(e[0].evaluate(t),t.properties())}],[[f,y],function(t,e){var r=e[0],i=e[1];return o(r.evaluate(t),i.evaluate(t))}]]},properties:[y,[],function(t){return t.properties()}],"geometry-type":[f,[],function(t){return t.geometryType()}],id:[_,[],function(t){return t.id()}],zoom:[h,[],function(t){return t.globals.zoom}],"heatmap-density":[h,[],function(t){return t.globals.heatmapDensity||0}],"+":[h,E(h),function(t,e){for(var r=0,i=0,n=e;i<n.length;i+=1)r+=n[i].evaluate(t);return r}],"*":[h,E(h),function(t,e){for(var r=1,i=0,n=e;i<n.length;i+=1)r*=n[i].evaluate(t);return r}],"-":{type:h,overloads:[[[h,h],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)-i.evaluate(t)}],[[h],function(t,e){return-e[0].evaluate(t)}]]},"/":[h,[h,h],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)/i.evaluate(t)}],"%":[h,[h,h],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)%i.evaluate(t)}],ln2:[h,[],function(){return Math.LN2}],pi:[h,[],function(){return Math.PI}],e:[h,[],function(){return Math.E}],"^":[h,[h,h],function(t,e){var r=e[0],i=e[1];return Math.pow(r.evaluate(t),i.evaluate(t))}],sqrt:[h,[h],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[h,[h],function(t,e){var r=e[0];return Math.log10(r.evaluate(t))}],ln:[h,[h],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[h,[h],function(t,e){var r=e[0];return Math.log2(r.evaluate(t))}],sin:[h,[h],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[h,[h],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[h,[h],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[h,[h],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[h,[h],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[h,[h],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[h,E(h),function(t,e){return Math.min.apply(Math,e.map(function(e){return e.evaluate(t)}))}],max:[h,E(h),function(t,e){return Math.max.apply(Math,e.map(function(e){return e.evaluate(t)}))}],"filter-==":[d,[f,_],function(t,e){var r=e[0],i=e[1];return t.properties()[r.value]===i.value}],"filter-id-==":[d,[_],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[d,[f],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[d,[f,_],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-<":[d,[_],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i<n}],"filter->":[d,[f,_],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&o<n}],"filter-id->":[d,[_],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&n<i}],"filter-<=":[d,[f,_],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-<=":[d,[_],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i<=n}],"filter->=":[d,[f,_],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&o<=n}],"filter-id->=":[d,[_],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&n<=i}],"filter-has":[d,[_],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[d,[],function(t){return null!==t.id()}],"filter-type-in":[d,[v(f)],function(t,e){return 0<=e[0].value.indexOf(t.geometryType())}],"filter-id-in":[d,[v(_)],function(t,e){return 0<=e[0].value.indexOf(t.id())}],"filter-in-small":[d,[f,v(_)],function(t,e){var r=e[0];return 0<=e[1].value.indexOf(t.properties()[r.value])}],"filter-in-large":[d,[f,v(_)],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)}],">":{type:d,overloads:[[[h,h],l],[[f,f],l]]},"<":{type:d,overloads:[[[h,h],s],[[f,f],s]]},">=":{type:d,overloads:[[[h,h],c],[[f,f],c]]},"<=":{type:d,overloads:[[[h,h],u],[[f,f],u]]},all:{type:d,overloads:[[[d,d],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)&&i.evaluate(t)}],[E(d),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:d,overloads:[[[d,d],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)||i.evaluate(t)}],[E(d),function(t,e){for(var r=0,i=e;r<i.length;r+=1)if(i[r].evaluate(t))return!0;return!1}]]},"!":[d,[d],function(t,e){return!e[0].evaluate(t)}],upcase:[f,[f],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[f,[f],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[f,E(f),function(t,e){return e.map(function(e){return e.evaluate(t)}).join("")}]}),e.exports=U},{"../compound_expression":123,"../runtime_error":143,"../types":146,"../values":147,"./array":124,"./assertion":125,"./at":126,"./case":127,"./coalesce":128,"./coercion":129,"./equals":130,"./interpolate":132,"./let":133,"./literal":134,"./match":135,"./step":136,"./var":137}],132:[function(t,e,r){"use strict";function i(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)}var n=t("@mapbox/unitbezier"),o=t("../../util/interpolate"),a=t("../types"),s=a.toString,l=a.NumberType,u=t("../stops").findStopLessThanOrEqualTo,c=function(t,e,r,i){this.type=t,this.interpolation=e,this.input=r,this.labels=[],this.outputs=[];for(var n=0,o=i;n<o.length;n+=1){var a=o[n],s=a[0],l=a[1];this.labels.push(s),this.outputs.push(l)}};c.interpolationFactor=function(t,e,r,o){var a=0;if("exponential"===t.name)a=i(e,t.base,r,o);else if("linear"===t.name)a=i(e,1,r,o);else if("cubic-bezier"===t.name){var s=t.controlPoints;a=new n(s[0],s[1],s[2],s[3]).solve(i(e,1,r,o))}return a},c.parse=function(t,e){var r=t[1],i=t[2],n=t.slice(3);if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){var o=r[1];if("number"!=typeof o)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:o}}else{if("cubic-bezier"!==r[0])return e.error("Unknown interpolation type "+String(r[0]),1,0);var a=r.slice(1);if(4!==a.length||a.some(function(t){return"number"!=typeof t||t<0||1<t}))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:a}}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(!(i=e.parse(i,2,l)))return null;var u=[],p=null;e.expectedType&&"value"!==e.expectedType.kind&&(p=e.expectedType);for(var h=0;h<n.length;h+=2){var f=n[h],d=n[h+1],m=h+3,y=h+4;if("number"!=typeof f)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',m);if(u.length&&u[u.length-1][0]>=f)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',m);var _=e.parse(d,y,p);if(!_)return null;p=p||_.type,u.push([f,_])}return"number"===p.kind||"color"===p.kind||"array"===p.kind&&"number"===p.itemType.kind&&"number"==typeof p.N?new c(p,r,i,u):e.error("Type "+s(p)+" is not interpolatable.")},c.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 a=u(e,i),s=e[a],l=e[a+1],p=c.interpolationFactor(this.interpolation,i,s,l),h=r[a].evaluate(t),f=r[a+1].evaluate(t);return o[this.type.kind.toLowerCase()](h,f,p)},c.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},c.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()}));var t},e.exports=c},{"../../util/interpolate":158,"../stops":145,"../types":146,"@mapbox/unitbezier":7}],133:[function(t,e,r){"use strict";var i=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};i.prototype.evaluate=function(t){t.pushScope(this.bindings);var e=this.result.evaluate(t);return t.popScope(),e},i.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},i.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=[],n=1;n<t.length-1;n+=2){var o=t[n];if("string"!=typeof o)return e.error("Expected string, but found "+typeof o+" instead.",n);if(/[^a-zA-Z0-9_]/.test(o))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var a=e.parse(t[n+1],n+1);if(!a)return null;r.push([o,a])}var s=e.parse(t[t.length-1],t.length-1,void 0,r);return s?new i(r,s):null},i.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},e.exports=i},{}],134:[function(t,e,r){"use strict";var i=t("../values"),n=i.isValue,o=i.typeOf,a=function(t,e){this.type=t,this.value=e};a.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!n(t[1]))return e.error("invalid value");var r=t[1],i=o(r),s=e.expectedType;return"array"!==i.kind||0!==i.N||!s||"array"!==s.kind||"number"==typeof s.N&&0!==s.N||(i=s),new a(i,r)},a.prototype.evaluate=function(){return this.value},a.prototype.eachChild=function(){},a.prototype.possibleOutputs=function(){return[this.value]},e.exports=a},{"../values":147}],135:[function(t,e,r){"use strict";var i=t("../values").typeOf,n=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};n.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,o;e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType);for(var a={},s=[],l=2;l<t.length-1;l+=2){var u=t[l],c=t[l+1];Array.isArray(u)||(u=[u]);var p=e.concat(l);if(0===u.length)return p.error("Expected at least one branch label.");for(var h=0,f=u;h<f.length;h+=1){var d=f[h];if("number"!=typeof d&&"string"!=typeof d)return p.error("Branch labels must be numbers or strings.");if("number"==typeof d&&Math.abs(d)>Number.MAX_SAFE_INTEGER)return p.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return p.error("Numeric branch labels must be integer values.");if(r){if(p.checkSubtype(r,i(d)))return null}else r=i(d);if(void 0!==a[String(d)])return p.error("Branch labels must be unique.");a[String(d)]=s.length}var m=e.parse(c,l,o);if(!m)return null;o=o||m.type,s.push(m)}var y=e.parse(t[1],1,r);if(!y)return null;var _=e.parse(t[t.length-1],t.length-1,o);return _?new n(r,o,y,a,s,_):null},n.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},n.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},n.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()})).concat(this.otherwise.possibleOutputs());var t},e.exports=n},{"../values":147}],136:[function(t,e,r){"use strict";var i=t("../types").NumberType,n=t("../stops").findStopLessThanOrEqualTo,o=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[0],s=o[1];this.labels.push(a),this.outputs.push(s)}};o.parse=function(t,e){var r=t[1],n=t.slice(2);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(!(r=e.parse(r,1,i)))return null;var a=[],s=null;e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType),n.unshift(-1/0);for(var l=0;l<n.length;l+=2){var u=n[l],c=n[l+1],p=l+1,h=l+2;if("number"!=typeof u)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(a.length&&a[a.length-1][0]>=u)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',p);var f=e.parse(c,h,s);if(!f)return null;s=s||f.type,a.push([u,f])}return new o(s,r,a)},o.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 o=e.length;return i>=e[o-1]?r[o-1].evaluate(t):r[n(e,i)].evaluate(t)},o.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},o.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()}));var t},e.exports=o},{"../stops":145,"../types":146}],137:[function(t,e,r){"use strict";var i=function(t,e){this.type=e,this.name=t};i.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 i(r,e.scope.get(r).type):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},i.prototype.evaluate=function(t){return t.scope.get(this.name).evaluate(t)},i.prototype.eachChild=function(){},i.prototype.possibleOutputs=function(){return[void 0]},e.exports=i},{}],138:[function(t,e,r){"use strict";var i=t("./scope"),n=t("./values").Color,o=["Unknown","Point","LineString","Polygon"],a=function(){this.scope=new i,this._parseColorCache={}};a.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},a.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?o[this.feature.type]:this.feature.type:null},a.prototype.properties=function(){return this.feature&&this.feature.properties||{}},a.prototype.pushScope=function(t){this.scope=this.scope.concat(t)},a.prototype.popScope=function(){this.scope=this.scope.parent},a.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=n.parse(t)),e},e.exports=a},{"./scope":144,"./values":147}],139:[function(t,e,r){"use strict";function i(t){return Array.isArray(t)&&0<t.length&&"string"==typeof t[0]&&t[0]in m}function n(t,e,r){void 0===r&&(r={});var i=new l(m,[],function(t){var e={color:M,string:P,number:L,enum:P,boolean:D};return"array"===t.type?R(e[t.value]||B,t.length):e[t.type]||null}(e)),n=i.parse(t);return n?v(!1===r.handleErrors?new b(n):new w(n,e)):x(i.errors)}function o(t,e,r){if(void 0===r&&(r={}),"error"===(t=n(t,e,r)).result)return t;var i=t.value.expression,o=y.isFeatureConstant(i);if(!o&&!e["property-function"])return x([new s("","property expressions not supported")]);var a=y.isGlobalPropertyConstant(i,["zoom"]);if(!a&&!1===e["zoom-function"])return x([new s("","zoom expressions not supported")]);var l=function t(e){var r=null;if(e instanceof d)r=t(e.result);else if(e instanceof f)for(var i=0,n=e.args;i<n.length;i+=1){var o=n[i];if(r=t(o))break}else(e instanceof p||e instanceof h)&&e.input instanceof c&&"zoom"===e.input.name&&(r=e);return r instanceof s||e.eachChild(function(e){var i=t(e);i instanceof s?r=i:!r&&i?r=new s("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&i&&r!==i&&(r=new s("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r}(i);return l||a?l instanceof s?x([l]):l instanceof h&&"piecewise-constant"===e.function?x([new s("",'"interpolate" expressions cannot be used with this property')]):v(l?new A(o?"camera":"composite",t.value,l):new S(o?"constant":"source",t.value)):x([new s("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}var a=t("../util/extend"),s=t("./parsing_error"),l=t("./parsing_context"),u=t("./evaluation_context"),c=t("./compound_expression").CompoundExpression,p=t("./definitions/step"),h=t("./definitions/interpolate"),f=t("./definitions/coalesce"),d=t("./definitions/let"),m=t("./definitions"),y=t("./is_constant"),_=t("./runtime_error"),g=t("../util/result"),v=g.success,x=g.error,b=function(t){this.expression=t};b.prototype.evaluate=function(t,e){return this._evaluator||(this._evaluator=new u),this._evaluator.globals=t,this._evaluator.feature=e,this.expression.evaluate(this._evaluator)};var w=function(t){function e(e,r){t.call(this,e),this._warningHistory={},this._defaultValue=function(t){return"color"===t.type&&z(t.default)?new k(0,0,0,0):"color"===t.type?k.parse(t.default)||null:void 0===t.default?null:t.default}(r),"enum"===r.type&&(this._enumValues=r.values)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.evaluate=function(t,e){this._evaluator||(this._evaluator=new u),this._evaluator.globals=t,this._evaluator.feature=e;try{var r=this.expression.evaluate(this._evaluator);if(null==r)return this._defaultValue;if(this._enumValues&&!(r in this._enumValues))throw new _("Expected value to be one of "+Object.keys(this._enumValues).map(function(t){return JSON.stringify(t)}).join(", ")+", but found "+JSON.stringify(r)+" instead.");return r}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}},e}(b),S=function(t,e){this.kind=t,this._styleExpression=e};S.prototype.evaluate=function(t,e){return this._styleExpression.evaluate(t,e)};var A=function(t,e,r){this.kind=t,this.zoomStops=r.labels,this._styleExpression=e,r instanceof h&&(this._interpolationType=r.interpolation)};A.prototype.evaluate=function(t,e){return this._styleExpression.evaluate(t,e)},A.prototype.interpolationFactor=function(t,e,r){return this._interpolationType?h.interpolationFactor(this._interpolationType,t,e,r):0};var T=t("../function"),z=T.isFunction,E=T.createFunction,k=t("./values").Color,C=function(t,e){this._parameters=t,this._specification=e,a(this,E(this._parameters,this._specification))};C.deserialize=function(t){return new C(t._parameters,t._specification)},C.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}},e.exports={StyleExpression:b,StyleExpressionWithErrorHandling:w,isExpression:i,createExpression:n,createPropertyExpression:o,normalizePropertyExpression:function(t,e){if(z(t))return new C(t,e);if(i(t)){var r=o(t,e);if("error"===r.result)throw new Error(r.value.map(function(t){return t.key+": "+t.message}).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=k.parse(t)),{kind:"constant",evaluate:function(){return n}}},ZoomConstantExpression:S,ZoomDependentExpression:A,StylePropertyFunction:C};var I=t("./types"),M=I.ColorType,P=I.StringType,L=I.NumberType,D=I.BooleanType,B=I.ValueType,R=I.array},{"../function":149,"../util/extend":156,"../util/result":160,"./compound_expression":123,"./definitions":131,"./definitions/coalesce":128,"./definitions/interpolate":132,"./definitions/let":133,"./definitions/step":136,"./evaluation_context":138,"./is_constant":140,"./parsing_context":141,"./parsing_error":142,"./runtime_error":143,"./types":146,"./values":147}],140:[function(t,e,r){"use strict";var i=t("./compound_expression").CompoundExpression;e.exports={isFeatureConstant:function t(e){if(e instanceof i){if("get"===e.name&&1===e.args.length)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}var r=!0;return e.eachChild(function(e){r&&!t(e)&&(r=!1)}),r},isGlobalPropertyConstant:function t(e,r){if(e instanceof i&&0<=r.indexOf(e.name))return!1;var n=!0;return e.eachChild(function(e){n&&!t(e,r)&&(n=!1)}),n}}},{"./compound_expression":123}],141:[function(t,e,r){"use strict";var i=t("./scope"),n=t("./types").checkSubtype,o=t("./parsing_error"),a=t("./definitions/literal"),s=t("./definitions/assertion"),l=t("./definitions/array"),u=t("./definitions/coercion"),c=function(t,e,r,n,o){void 0===e&&(e=[]),void 0===n&&(n=new i),void 0===o&&(o=[]),this.registry=t,this.path=e,this.key=e.map(function(t){return"["+t+"]"}).join(""),this.scope=n,this.errors=o,this.expectedType=r};c.prototype.parse=function(e,r,i,n,o){void 0===o&&(o={});var c=this;if(r&&(c=c.concat(r,i,n)),null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return c.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var p=e[0];if("string"!=typeof p)return c.error("Expression name must be a string, but found "+typeof p+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var h=c.registry[p];if(h){var f=h.parse(e,c);if(!f)return null;if(c.expectedType){var d=c.expectedType,m=f.type;if("string"!==d.kind&&"number"!==d.kind&&"boolean"!==d.kind||"value"!==m.kind)if("array"===d.kind&&"value"===m.kind)o.omitTypeAnnotations||(f=new l(d,f));else if("color"!==d.kind||"value"!==m.kind&&"string"!==m.kind){if(c.checkSubtype(c.expectedType,f.type))return null}else o.omitTypeAnnotations||(f=new u(d,[f]));else o.omitTypeAnnotations||(f=new s(d,[f]))}if(!(f instanceof a)&&function(e){var r=t("./compound_expression").CompoundExpression,i=t("./is_constant"),n=i.isGlobalPropertyConstant,o=i.isFeatureConstant;if(e instanceof t("./definitions/var"))return!1;if(e instanceof r&&"error"===e.name)return!1;var s=!0;return e.eachChild(function(t){t instanceof a||(s=!1)}),!!s&&o(e)&&n(e,["zoom","heatmap-density"])}(f)){var y=new(t("./evaluation_context"));try{f=new a(f.type,f.evaluate(y))}catch(e){return c.error(e.message),null}}return f}return c.error('Unknown expression "'+p+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===e?c.error("'undefined' value invalid. Use null instead."):"object"==typeof e?c.error('Bare objects invalid. Use ["literal", {...}] instead.'):c.error("Expected an array, but found "+typeof e+" instead.")},c.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 c(this.registry,i,e||null,n,this.errors)},c.prototype.error=function(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];var i=""+this.key+e.map(function(t){return"["+t+"]"}).join("");this.errors.push(new o(i,t))},c.prototype.checkSubtype=function(t,e){var r=n(t,e);return r&&this.error(r),r},e.exports=c},{"./compound_expression":123,"./definitions/array":124,"./definitions/assertion":125,"./definitions/coercion":129,"./definitions/literal":134,"./definitions/var":137,"./evaluation_context":138,"./is_constant":140,"./parsing_error":142,"./scope":144,"./types":146}],142:[function(t,e,r){"use strict";var i=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}(Error);e.exports=i},{}],143:[function(t,e,r){"use strict";var i=function(t){this.name="ExpressionEvaluationError",this.message=t};i.prototype.toJSON=function(){return this.message},e.exports=i},{}],144:[function(t,e,r){"use strict";var i=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],o=n[0],a=n[1];this.bindings[o]=a}};i.prototype.concat=function(t){return new i(this,t)},i.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.")},i.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)},e.exports=i},{}],145:[function(t,e,r){"use strict";var i=t("./runtime_error");e.exports={findStopLessThanOrEqualTo:function(t,e){for(var r,n,o=0,a=t.length-1,s=0;o<=a;){if(r=t[s=Math.floor((o+a)/2)],n=t[s+1],e===r||r<e&&e<n)return s;if(r<e)o=s+1;else{if(!(e<r))throw new i("Input is not a number.");a=s-1}}return Math.max(s-1,0)}}},{"./runtime_error":143}],146:[function(t,e,r){"use strict";function i(t,e){return{kind:"array",itemType:t,N:e}}function n(t){if("array"===t.kind){var e=n(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var o={kind:"null"},a={kind:"number"},s={kind:"string"},l={kind:"boolean"},u={kind:"color"},c={kind:"object"},p={kind:"value"},h=[o,a,s,l,u,c,i(p)];e.exports={NullType:o,NumberType:a,StringType:s,BooleanType:l,ColorType:u,ObjectType:c,ValueType:p,array:i,ErrorType:{kind:"error"},toString:n,checkSubtype:function t(e,r){if("error"===r.kind)return null;if("array"===e.kind){if("array"===r.kind&&!t(e.itemType,r.itemType)&&("number"!=typeof e.N||e.N===r.N))return null}else{if(e.kind===r.kind)return null;if("value"===e.kind)for(var i=0,o=h;i<o.length;i+=1)if(!t(o[i],r))return null}return"Expected "+n(e)+" but found "+n(r)+" instead."}}},{}],147:[function(t,e,r){"use strict";var i=t("../util/color"),n=t("./types"),o=n.NullType,a=n.NumberType,s=n.StringType,l=n.BooleanType,u=n.ColorType,c=n.ObjectType,p=n.ValueType,h=n.array;e.exports={Color:i,validateRGBA:function(t,e,r,i){return"number"==typeof t&&0<=t&&t<=255&&"number"==typeof e&&0<=e&&e<=255&&"number"==typeof r&&0<=r&&r<=255?void 0===i||"number"==typeof i&&0<=i&&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."},isValue:function t(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof i)return!0;if(Array.isArray(e)){for(var r=0,n=e;r<n.length;r+=1)if(!t(n[r]))return!1;return!0}if("object"==typeof e){for(var o in e)if(!t(e[o]))return!1;return!0}return!1},typeOf:function t(e){if(null===e)return o;if("string"==typeof e)return s;if("boolean"==typeof e)return l;if("number"==typeof e)return a;if(e instanceof i)return u;if(Array.isArray(e)){for(var r,n=e.length,f=0,d=e;f<d.length;f+=1){var m=t(d[f]);if(r){if(r===m)continue;r=p;break}r=m}return h(r||p,n)}return c}}},{"../util/color":153,"./types":146}],148:[function(t,e,r){"use strict";function i(t){if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return 2<=t.length&&"$id"!==t[1]&&"$type"!==t[1];case"in":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 n=r[e];if(!i(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}function n(t,e){return t<e?-1:e<t?1:0}function o(t){if(!t)return!0;var e=t[0];return t.length<=1?"any"!==e:"=="===e?a(t[1],t[2],"=="):"!="===e?u(a(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?a(t[1],t[2],e):"any"===e?function(t){return["any"].concat(t.map(o))}(t.slice(1)):"all"===e?["all"].concat(t.slice(1).map(o)):"none"===e?["all"].concat(t.slice(1).map(o).map(u)):"in"===e?s(t[1],t.slice(2)):"!in"===e?u(s(t[1],t.slice(2))):"has"===e?l(t[1]):"!has"!==e||u(l(t[1]))}function a(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 s(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 200<e.length&&!e.some(function(t){return typeof t!=typeof e[0]})?["filter-in-large",t,["literal",e.sort(n)]]:["filter-in-small",t,["literal",e]]}}function l(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function u(t){return["!",t]}var c=t("../expression").createExpression;e.exports=function(t){if(!t)return function(){return!0};i(t)||(t=o(t));var e=c(t,p);if("error"===e.result)throw new Error(e.value.map(function(t){return t.key+": "+t.message}).join(", "));return function(t,r){return e.value.evaluate(t,r)}},e.exports.isExpressionFilter=i;var p={type:"boolean",default:!1,function:!0,"property-function":!0,"zoom-function":!0}},{"../expression":139}],149:[function(t,e,r){"use strict";function i(t){return t}function n(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function o(t,e,r,i,o){return n(typeof r===o?i[r]:void 0,t.default,e.default)}function a(t,e,r){if("number"!==f(r))return n(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 o=u(t.stops,r);return t.stops[o][1]}function s(t,e,r){var o=void 0!==t.base?t.base:1;if("number"!==f(r))return n(t.default,e.default);var a=t.stops.length;if(1===a)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[a-1][0])return t.stops[a-1][1];var s=u(t.stops,r),l=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,o,t.stops[s][0],t.stops[s+1][0]),p=t.stops[s][1],h=t.stops[s+1][1],m=d[e.type]||i;if(t.colorSpace&&"rgb"!==t.colorSpace){var y=c[t.colorSpace];m=function(t,e){return y.reverse(y.interpolate(y.forward(t),y.forward(e),l))}}return"function"==typeof p.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=p.evaluate.apply(void 0,t),i=h.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return m(r,i,l)}}:m(p,h,l)}function l(t,e,r){return"color"===e.type?r=p.parse(r):f(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),n(r,t.default,e.default)}function u(t,e){for(var r,i,n=0,o=t.length-1,a=0;n<=o;){if(r=t[a=Math.floor((n+o)/2)][0],i=t[a+1][0],e===r||r<e&&e<i)return a;r<e?n=a+1:e<r&&(o=a-1)}return Math.max(a-1,0)}var c=t("../util/color_spaces"),p=t("../util/color"),h=t("../util/extend"),f=t("../util/get_type"),d=t("../util/interpolate"),m=t("../expression/definitions/interpolate");e.exports={createFunction:function t(e,r){var i,u,f,d="color"===r.type,y=e.stops&&"object"==typeof e.stops[0][0],_=y||void 0!==e.property,g=y||!_,v=e.type||("interpolated"===r.function?"exponential":"interval");if(d&&((e=h({},e)).stops&&(e.stops=e.stops.map(function(t){return[t[0],p.parse(t[1])]})),e.default?e.default=p.parse(e.default):e.default=p.parse(r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!c[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===v)i=s;else if("interval"===v)i=a;else if("categorical"===v){i=o,u=Object.create(null);for(var x=0,b=e.stops;x<b.length;x+=1){var w=b[x];u[w[0]]=w[1]}f=typeof e.stops[0][0]}else{if("identity"!==v)throw new Error('Unknown function type "'+v+'"');i=l}if(y){for(var S={},A=[],T=0;T<e.stops.length;T++){var z=e.stops[T],E=z[0].zoom;void 0===S[E]&&(S[E]={zoom:E,type:e.type,property:e.property,default:e.default,stops:[]},A.push(E)),S[E].stops.push([z[0].value,z[1]])}for(var k=[],C=0,I=A;C<I.length;C+=1){var M=I[C];k.push([S[M].zoom,t(S[M],r)])}return{kind:"composite",interpolationFactor:m.interpolationFactor.bind(void 0,{name:"linear"}),zoomStops:k.map(function(t){return t[0]}),evaluate:function(t,i){var n=t.zoom;return s({stops:k,base:e.base},r,n).evaluate(n,i)}}}return g?{kind:"camera",interpolationFactor:"exponential"===v?m.interpolationFactor.bind(void 0,{name:"exponential",base:void 0!==e.base?e.base:1}):function(){return 0},zoomStops:e.stops.map(function(t){return t[0]}),evaluate:function(t){var n=t.zoom;return i(e,r,n,u,f)}}:{kind:"source",evaluate:function(t,o){var a=o&&o.properties?o.properties[e.property]:void 0;return void 0===a?n(e.default,r.default):i(e,r,a,u,f)}}},isFunction:function(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}}},{"../expression/definitions/interpolate":132,"../util/color":153,"../util/color_spaces":154,"../util/extend":156,"../util/get_type":157,"../util/interpolate":158}],150:[function(t,e,r){"use strict";function i(t){var e=typeof t;if("number"===e||"boolean"===e||"string"===e||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var r="[",n=0,o=t;n<o.length;n+=1)r+=i(o[n])+",";return r+"]"}for(var a=Object.keys(t).sort(),s="{",l=0;l<a.length;l++)s+=JSON.stringify(a[l])+":"+i(t[a[l]])+",";return s+"}"}function n(t){for(var e="",r=0,n=o;r<n.length;r+=1)e+="/"+i(t[n[r]]);return e}var o=t("./util/ref_properties");e.exports=function(t){for(var e={},r=0;r<t.length;r++){var i=n(t[r]),o=e[i];o||(o=e[i]=[]),o.push(t[r])}var a=[];for(var s in e)a.push(e[s]);return a}},{"./util/ref_properties":159}],151:[function(t,e,r){"use strict";e.exports=t("./v8.json")},{"./v8.json":152}],152:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},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_canvas"],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.0511,180,85.0511]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{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.0511,180,85.0511]},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"},"*":{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.0511,180,85.0511]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"}},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"}}},source_canvas:{type:{required:!0,type:"enum",values:{canvas:{}}},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}},animate:{type:"boolean",default:"true"},canvas:{type:"string",required:!0}},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"}},layout_fill:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_circle:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{butt:{},round:{},square:{}},default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{bevel:{},round:{},miter:{}},default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{point:{},line:{}},default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"factor of the original icon size",requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"]},"icon-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"ems",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{left:{},center:{},right:{}},default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},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:22,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{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"},"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"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"+":{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"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},transition:!1,"zoom-function":!0,"property-function":!1,function:"piecewise-constant"},position:{type:"array",default:[1.15,210,30],length:3,value:"number",transition:!0,function:"interpolated","zoom-function":!0,"property-function":!1},color:{type:"color",default:"#ffffff",function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0},intensity:{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},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",function:"piecewise-constant","zoom-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!1,default:1,minimum:0,maximum:1,transition:!0},"fill-extrusion-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-extrusion-pattern"}]},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-extrusion-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"]},"fill-extrusion-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"fill-extrusion-height":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0},"fill-extrusion-base":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"]}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map"},"circle-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"viewport"},"circle-stroke-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-stroke-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"heatmap-weight":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!1},"heatmap-intensity":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0},"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"],function:"interpolated","zoom-function":!1,"property-function":!1,transition:!1},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!1,units:"milliseconds"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,function:"interpolated","zoom-function":!0,transition:!1},"hillshade-illumination-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"viewport"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"hillshade-shadow-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",function:"interpolated","zoom-function":!0,transition:!0},"hillshade-accent-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],153:[function(t,e,r){"use strict";var i=t("csscolorparser").parseCSSColor,n=function(t,e,r,i){void 0===i&&(i=1),this.r=t,this.g=e,this.b=r,this.a=i};n.parse=function(t){if(t){if(t instanceof n)return t;if("string"==typeof t){var e=i(t);if(e)return new n(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},n.prototype.toString=function(){var t=this;return"rgba("+[this.r,this.g,this.b].map(function(e){return Math.round(255*e/t.a)}).concat(this.a).join(",")+")"},n.black=new n(0,0,0,1),n.white=new n(1,1,1,1),n.transparent=new n(0,0,0,0),e.exports=n},{csscolorparser:13}],154:[function(t,e,r){"use strict";function i(t){return _<t?Math.pow(t,1/3):t/y+d}function n(t){return m<t?t*t*t:y*(t-d)}function o(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function a(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function s(t){var e=a(t.r),r=a(t.g),n=a(t.b),o=i((.4124564*e+.3575761*r+.1804375*n)/p),s=i((.2126729*e+.7151522*r+.072175*n)/h);return{l:116*s-16,a:500*(o-s),b:200*(s-i((.0193339*e+.119192*r+.9503041*n)/f)),alpha:t.a}}function l(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=h*n(e),r=p*n(r),i=f*n(i),new u(o(3.2404542*r-1.5371385*e-.4985314*i),o(-.969266*r+1.8760108*e+.041556*i),o(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}var u=t("./color"),c=t("./interpolate").number,p=.95047,h=1,f=1.08883,d=4/29,m=6/29,y=3*m*m,_=m*m*m,g=Math.PI/180,v=180/Math.PI;e.exports={lab:{forward:s,reverse:l,interpolate:function(t,e,r){return{l:c(t.l,e.l,r),a:c(t.a,e.a,r),b:c(t.b,e.b,r),alpha:c(t.alpha,e.alpha,r)}}},hcl:{forward:function(t){var e=s(t),r=e.l,i=e.a,n=e.b,o=Math.atan2(n,i)*v;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*g,r=t.c;return l({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:function(t,e,r){var i=e-t;return t+r*(180<i||i<-180?i-360*Math.round(i/360):i)}(t.h,e.h,r),c:c(t.c,e.c,r),l:c(t.l,e.l,r),alpha:c(t.alpha,e.alpha,r)}}}}},{"./color":153,"./interpolate":158}],155:[function(t,e,r){"use strict";e.exports=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}},{}],156:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=arguments.length-1;0<r--;)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}},{}],157:[function(t,e,r){"use strict";e.exports=function(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}},{}],158:[function(t,e,r){"use strict";function i(t,e,r){return t*(1-r)+e*r}var n=t("./color");e.exports={number:i,color:function(t,e,r){return new n(i(t.r,e.r,r),i(t.g,e.g,r),i(t.b,e.b,r),i(t.a,e.a,r))},array:function(t,e,r){return t.map(function(t,n){return i(t,e[n],r)})}}},{"./color":153}],159:[function(t,e,r){"use strict";e.exports=["type","source","source-layer","minzoom","maxzoom","filter","layout"]},{}],160:[function(t,e,r){"use strict";e.exports={success:function(t){return{result:"success",value:t}},error:function(t){return{result:"error",value:t}}}},{}],161:[function(t,e,r){"use strict";function i(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}e.exports=i,e.exports.deep=function t(e){return Array.isArray(e)?e.map(t):i(e)}},{}],162:[function(t,e,r){"use strict";var i=t("../util/extend"),n=t("../util/unbundle_jsonlint"),o=t("../expression").isExpression,a=t("../function").isFunction;e.exports=function(e){var r=t("./validate_function"),s=t("./validate_expression"),l=t("./validate_object"),u={"*":function(){return[]},array:t("./validate_array"),boolean:t("./validate_boolean"),number:t("./validate_number"),color:t("./validate_color"),constants:t("./validate_constants"),enum:t("./validate_enum"),filter:t("./validate_filter"),function:t("./validate_function"),layer:t("./validate_layer"),object:t("./validate_object"),source:t("./validate_source"),light:t("./validate_light"),string:t("./validate_string")},c=e.value,p=e.valueSpec,h=e.styleSpec;return p.function&&a(n(c))?r(e):p.function&&o(n.deep(c))?s(e):p.type&&u[p.type]?u[p.type](e):l(i({},e,{valueSpec:p.type?h[p.type]:p}))}},{"../expression":139,"../function":149,"../util/extend":156,"../util/unbundle_jsonlint":161,"./validate_array":163,"./validate_boolean":164,"./validate_color":165,"./validate_constants":166,"./validate_enum":167,"./validate_expression":168,"./validate_filter":169,"./validate_function":170,"./validate_layer":172,"./validate_light":174,"./validate_number":175,"./validate_object":176,"./validate_source":179,"./validate_string":180}],163:[function(t,e,r){"use strict";var i=t("../util/get_type"),n=t("./validate"),o=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,a=t.style,s=t.styleSpec,l=t.key,u=t.arrayElementValidator||n;if("array"!==i(e))return[new o(l,e,"array expected, "+i(e)+" found")];if(r.length&&e.length!==r.length)return[new o(l,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new o(l,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var c={type:r.value};s.$version<7&&(c.function=r.function),"object"===i(r.value)&&(c=r.value);for(var p=[],h=0;h<e.length;h++)p=p.concat(u({array:e,arrayIndex:h,value:e[h],valueSpec:c,style:a,styleSpec:s,key:l+"["+h+"]"}));return p}},{"../error/validation_error":122,"../util/get_type":157,"./validate":162}],164:[function(t,e,r){"use strict";var i=t("../util/get_type"),n=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,o=i(e);return"boolean"!==o?[new n(r,e,"boolean expected, "+o+" found")]:[]}},{"../error/validation_error":122,"../util/get_type":157}],165:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../util/get_type"),o=t("csscolorparser").parseCSSColor;e.exports=function(t){var e=t.key,r=t.value,a=n(r);return"string"!==a?[new i(e,r,"color expected, "+a+" found")]:null===o(r)?[new i(e,r,'color expected, "'+r+'" found')]:[]}},{"../error/validation_error":122,"../util/get_type":157,csscolorparser:13}],166:[function(t,e,r){"use strict";var i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.value;return r?[new i(e,r,"constants have been deprecated as of v8")]:[]}},{"../error/validation_error":122}],167:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,a=[];return Array.isArray(o.values)?-1===o.values.indexOf(n(r))&&a.push(new i(e,r,"expected one of ["+o.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(o.values).indexOf(n(r))&&a.push(new i(e,r,"expected one of ["+Object.keys(o.values).join(", ")+"], "+JSON.stringify(r)+" found")),a}},{"../error/validation_error":122,"../util/unbundle_jsonlint":161}],168:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../expression"),o=n.createExpression,a=n.createPropertyExpression,s=t("../util/unbundle_jsonlint");e.exports=function(t){var e=("property"===t.expressionContext?a:o)(s.deep(t.value),t.valueSpec);return"error"===e.result?e.value.map(function(e){return new i(""+t.key+e.key,t.value,e.message)}):"property"===t.expressionContext&&"text-font"===t.propertyKey&&-1!==e.value._styleExpression.expression.possibleOutputs().indexOf(void 0)?[new i(t.key,t.value,'Invalid data expression for "text-font". Output values must be contained as literals within the expression.')]:[]}},{"../error/validation_error":122,"../expression":139,"../util/unbundle_jsonlint":161}],169:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("./validate_expression"),o=t("./validate_enum"),a=t("../util/get_type"),s=t("../util/unbundle_jsonlint"),l=t("../util/extend"),u=t("../feature_filter").isExpressionFilter;e.exports=function(t){return u(s.deep(t.value))?n(l({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==a(r))return[new i(n,r,"array expected, "+a(r)+" found")];var l,u=e.styleSpec,c=[];if(r.length<1)return[new i(n,r,"filter array must have at least 1 element")];switch(c=c.concat(o({key:n+"[0]",value:r[0],valueSpec:u.filter_operator,style:e.style,styleSpec:e.styleSpec})),s(r[0])){case"<":case"<=":case">":case">=":2<=r.length&&"$type"===s(r[1])&&c.push(new i(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&c.push(new i(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":2<=r.length&&"string"!==(l=a(r[1]))&&c.push(new i(n+"[1]",r[1],"string expected, "+l+" found"));for(var p=2;p<r.length;p++)l=a(r[p]),"$type"===s(r[1])?c=c.concat(o({key:n+"["+p+"]",value:r[p],valueSpec:u.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==l&&"number"!==l&&"boolean"!==l&&c.push(new i(n+"["+p+"]",r[p],"string, number, or boolean expected, "+l+" found"));break;case"any":case"all":case"none":for(var h=1;h<r.length;h++)c=c.concat(t({key:n+"["+h+"]",value:r[h],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":l=a(r[1]),2!==r.length?c.push(new i(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==l&&c.push(new i(n+"[1]",r[1],"string expected, "+l+" found"))}return c}(t)}},{"../error/validation_error":122,"../feature_filter":148,"../util/extend":156,"../util/get_type":157,"../util/unbundle_jsonlint":161,"./validate_enum":167,"./validate_expression":168}],170:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../util/get_type"),o=t("./validate"),a=t("./validate_object"),s=t("./validate_array"),l=t("./validate_number"),u=t("../util/unbundle_jsonlint");e.exports=function(t){function e(t){var e=[],s=t.value,c=t.key;if("array"!==n(s))return[new i(c,s,"array expected, "+n(s)+" found")];if(2!==s.length)return[new i(c,s,"array length 2 expected, length "+s.length+" found")];if(g){if("object"!==n(s[0]))return[new i(c,s,"object expected, "+n(s[0])+" found")];if(void 0===s[0].zoom)return[new i(c,s,"object stop key must have zoom")];if(void 0===s[0].value)return[new i(c,s,"object stop key must have value")];if(h&&h>u(s[0].zoom))return[new i(c,s[0].zoom,"stop zoom values must appear in ascending order")];u(s[0].zoom)!==h&&(h=u(s[0].zoom),p=void 0,m={}),e=e.concat(a({key:c+"[0]",value:s[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:l,value:r}}))}else e=e.concat(r({key:c+"[0]",value:s[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},s));return e.concat(o({key:c+"[1]",value:s[1],valueSpec:f,style:t.style,styleSpec:t.styleSpec}))}function r(t,e){var r=n(t.value),o=u(t.value),a=null!==t.value?t.value:e;if(c){if(r!==c)return[new i(t.key,a,r+" stop domain type must match previous stop domain type "+c)]}else c=r;if("number"!==r&&"string"!==r&&"boolean"!==r)return[new i(t.key,a,"stop domain value must be a number, string, or boolean")];if("number"!==r&&"categorical"!==d){var s="number expected, "+r+" found";return f["property-function"]&&void 0===d&&(s+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new i(t.key,a,s)]}return"categorical"!==d||"number"!==r||isFinite(o)&&Math.floor(o)===o?"categorical"!==d&&"number"===r&&void 0!==p&&o<p?[new i(t.key,a,"stop domain values must appear in ascending order")]:(p=o,"categorical"===d&&o in m?[new i(t.key,a,"stop domain values must be unique")]:(m[o]=!0,[])):[new i(t.key,a,"integer expected, found "+o)]}var c,p,h,f=t.valueSpec,d=u(t.value.type),m={},y="categorical"!==d&&void 0===t.value.property,_=!y,g="array"===n(t.value.stops)&&"array"===n(t.value.stops[0])&&"object"===n(t.value.stops[0][0]),v=a({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===d)return[new i(t.key,t.value,'identity function may not have a "stops" property')];var r=[],o=t.value;return r=r.concat(s({key:t.key,value:o,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:e})),"array"===n(o)&&0===o.length&&r.push(new i(t.key,o,"array must have at least one stop")),r},default:function(t){return o({key:t.key,value:t.value,valueSpec:f,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===d&&y&&v.push(new i(t.key,t.value,'missing required property "property"')),"identity"===d||t.value.stops||v.push(new i(t.key,t.value,'missing required property "stops"')),"exponential"===d&&"piecewise-constant"===t.valueSpec.function&&v.push(new i(t.key,t.value,"exponential functions not supported")),8<=t.styleSpec.$version&&(_&&!t.valueSpec["property-function"]?v.push(new i(t.key,t.value,"property functions not supported")):y&&!t.valueSpec["zoom-function"]&&"heatmap-color"!==t.objectKey&&v.push(new i(t.key,t.value,"zoom functions not supported"))),"categorical"!==d&&!g||void 0!==t.value.property||v.push(new i(t.key,t.value,'"property" property is required')),v}},{"../error/validation_error":122,"../util/get_type":157,"../util/unbundle_jsonlint":161,"./validate":162,"./validate_array":163,"./validate_number":175,"./validate_object":176}],171:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,o=n(t);return o.length||(-1===e.indexOf("{fontstack}")&&o.push(new i(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&o.push(new i(r,e,'"glyphs" url must include a "{range}" token'))),o}},{"../error/validation_error":122,"./validate_string":180}],172:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),u=t("./validate"),c=t("../util/extend");e.exports=function(t){var e=[],r=t.value,p=t.key,h=t.style,f=t.styleSpec;r.type||r.ref||e.push(new i(p,r,'either "type" or "ref" is required'));var d,m=n(r.type),y=n(r.ref);if(r.id)for(var _=n(r.id),g=0;g<t.arrayIndex;g++){var v=h.layers[g];n(v.id)===_&&e.push(new i(p,r.id,'duplicate layer id "'+r.id+'", previously used at line '+v.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach(function(t){t in r&&e.push(new i(p,r[t],'"'+t+'" is prohibited for ref layers'))}),h.layers.forEach(function(t){n(t.id)===y&&(d=t)}),d?d.ref?e.push(new i(p,r.ref,"ref cannot reference another ref layer")):m=n(d.type):e.push(new i(p,r.ref,'ref layer "'+y+'" not found'));else if("background"!==m)if(r.source){var x=h.sources&&h.sources[r.source],b=x&&n(x.type);x?"vector"===b&&"raster"===m?e.push(new i(p,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===b&&"raster"!==m?e.push(new i(p,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==b||r["source-layer"]?"raster-dem"===b&&"hillshade"!==m&&e.push(new i(p,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):e.push(new i(p,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new i(p,r.source,'source "'+r.source+'" not found'))}else e.push(new i(p,r,'missing required property "source"'));return e=e.concat(o({key:p,value:r,valueSpec:f.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return u({key:p+".type",value:r.type,valueSpec:f.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:a,layout:function(t){return o({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return l(c({layerType:m},t))}}})},paint:function(t){return o({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return s(c({layerType:m},t))}}})}}}))}},{"../error/validation_error":122,"../util/extend":156,"../util/unbundle_jsonlint":161,"./validate":162,"./validate_filter":169,"./validate_layout_property":173,"./validate_object":176,"./validate_paint_property":177}],173:[function(t,e,r){"use strict";var i=t("./validate_property");e.exports=function(t){return i(t,"layout")}},{"./validate_property":178}],174:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../util/get_type"),o=t("./validate");e.exports=function(t){var e=t.value,r=t.styleSpec,a=r.light,s=t.style,l=[],u=n(e);if(void 0===e)return l;if("object"!==u)return l.concat([new i("light",e,"object expected, "+u+" found")]);for(var c in e){var p=c.match(/^(.*)-transition$/);l=p&&a[p[1]]&&a[p[1]].transition?l.concat(o({key:c,value:e[c],valueSpec:r.transition,style:s,styleSpec:r})):a[c]?l.concat(o({key:c,value:e[c],valueSpec:a[c],style:s,styleSpec:r})):l.concat([new i(c,e[c],'unknown property "'+c+'"')])}return l}},{"../error/validation_error":122,"../util/get_type":157,"./validate":162}],175:[function(t,e,r){"use strict";var i=t("../util/get_type"),n=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,a=i(r);return"number"!==a?[new n(e,r,"number expected, "+a+" found")]:"minimum"in o&&r<o.minimum?[new n(e,r,r+" is less than the minimum value "+o.minimum)]:"maximum"in o&&r>o.maximum?[new n(e,r,r+" is greater than the maximum value "+o.maximum)]:[]}},{"../error/validation_error":122,"../util/get_type":157}],176:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../util/get_type"),o=t("./validate");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec||{},s=t.objectElementValidators||{},l=t.style,u=t.styleSpec,c=[],p=n(r);if("object"!==p)return[new i(e,r,"object expected, "+p+" found")];for(var h in r){var f=h.split(".")[0],d=a[f]||a["*"],m=void 0;if(s[f])m=s[f];else if(a[f])m=o;else if(s["*"])m=s["*"];else{if(!a["*"]){c.push(new i(e,r[h],'unknown property "'+h+'"'));continue}m=o}c=c.concat(m({key:(e?e+".":e)+h,value:r[h],valueSpec:d,style:l,styleSpec:u,object:r,objectKey:h},r))}for(var y in a)s[y]||a[y].required&&void 0===a[y].default&&void 0===r[y]&&c.push(new i(e,r,'missing required property "'+y+'"'));return c}},{"../error/validation_error":122,"../util/get_type":157,"./validate":162}],177:[function(t,e,r){"use strict";var i=t("./validate_property");e.exports=function(t){return i(t,"paint")}},{"./validate_property":178}],178:[function(t,e,r){"use strict";var i=t("./validate"),n=t("../error/validation_error"),o=t("../util/get_type"),a=t("../function").isFunction,s=t("../util/unbundle_jsonlint");e.exports=function(t,e){var r=t.key,l=t.style,u=t.styleSpec,c=t.value,p=t.objectKey,h=u[e+"_"+t.layerType];if(!h)return[];var f=p.match(/^(.*)-transition$/);if("paint"===e&&f&&h[f[1]]&&h[f[1]].transition)return i({key:r,value:c,valueSpec:u.transition,style:l,styleSpec:u});var d,m=t.valueSpec||h[p];if(!m)return[new n(r,c,'unknown property "'+p+'"')];if("string"===o(c)&&m["property-function"]&&!m.tokens&&(d=/^{([^}]+)}$/.exec(c)))return[new n(r,c,'"'+p+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(d[1])+" }`.")];var y=[];return"symbol"===t.layerType&&("text-field"===p&&l&&!l.glyphs&&y.push(new n(r,c,'use of "text-field" requires a style "glyphs" property')),"text-font"===p&&a(s.deep(c))&&"identity"===s(c.type)&&y.push(new n(r,c,'"text-font" does not support identity functions'))),y.concat(i({key:t.key,value:c,valueSpec:m,style:l,styleSpec:u,expressionContext:"property",propertyKey:p}))}},{"../error/validation_error":122,"../function":149,"../util/get_type":157,"../util/unbundle_jsonlint":161,"./validate":162}],179:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new i(r,e,'"type" is required')];var u=n(e.type),c=[];switch(u){case"vector":case"raster":case"raster-dem":if(c=c.concat(o({key:r,value:e,valueSpec:s["source_"+u.replace("-","_")],style:t.style,styleSpec:s})),"url"in e)for(var p in e)["type","url","tileSize"].indexOf(p)<0&&c.push(new i(r+"."+p,e[p],'a source with a "url" property may not include a "'+p+'" property'));return c;case"geojson":return o({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return o({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return o({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});case"canvas":return o({key:r,value:e,valueSpec:s.source_canvas,style:l,styleSpec:s});default:return a({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image","canvas"]},style:l,styleSpec:s})}}},{"../error/validation_error":122,"../util/unbundle_jsonlint":161,"./validate_enum":167,"./validate_object":176}],180:[function(t,e,r){"use strict";var i=t("../util/get_type"),n=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,o=i(e);return"string"!==o?[new n(r,e,"string expected, "+o+" found")]:[]}},{"../error/validation_error":122,"../util/get_type":157}],181:[function(t,e,r){"use strict";function i(t,e){e=e||l;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:u,"*":function(){return[]}}})),t.constants&&(r=r.concat(a({key:"constants",value:t.constants,style:t,styleSpec:e}))),n(r)}function n(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function o(t){return function(){return n(t.apply(this,arguments))}}var a=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("./reference/latest"),u=t("./validate/validate_glyphs_url");i.source=o(t("./validate/validate_source")),i.light=o(t("./validate/validate_light")),i.layer=o(t("./validate/validate_layer")),i.filter=o(t("./validate/validate_filter")),i.paintProperty=o(t("./validate/validate_paint_property")),i.layoutProperty=o(t("./validate/validate_layout_property")),e.exports=i},{"./reference/latest":151,"./validate/validate":162,"./validate/validate_constants":166,"./validate/validate_filter":169,"./validate/validate_glyphs_url":171,"./validate/validate_layer":172,"./validate/validate_layout_property":173,"./validate/validate_light":174,"./validate/validate_paint_property":177,"./validate/validate_source":179}],182:[function(t,e,r){"use strict";var i=t("./zoom_history"),n=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 i,this.transition={})};n.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},e.exports=n},{"./zoom_history":212}],183:[function(t,e,r){"use strict";var i=t("../style-spec/reference/latest"),n=t("../util/util"),o=t("../util/evented"),a=t("./validate_style"),s=t("../util/util").sphericalToCartesian,l=(t("../style-spec/util/color"),t("../style-spec/util/interpolate")),u=t("./properties"),c=u.Properties,p=u.Transitionable,h=(u.Transitioning,u.PossiblyEvaluated,u.DataConstantProperty),f=function(){this.specification=i.light.position};f.prototype.possiblyEvaluate=function(t,e){return s(t.expression.evaluate(e))},f.prototype.interpolate=function(t,e,r){return{x:l.number(t.x,e.x,r),y:l.number(t.y,e.y,r),z:l.number(t.z,e.z,r)}};var d=new c({anchor:new h(i.light.anchor),position:new f,color:new h(i.light.color),intensity:new h(i.light.intensity)}),m=function(t){function e(e){t.call(this),this._transitionable=new p(d),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.getLight=function(){return this._transitionable.serialize()},e.prototype.setLight=function(t){if(!this._validate(a.light,t))for(var e in t){var r=t[e];n.endsWith(e,"-transition")?this._transitionable.setTransition(e.slice(0,-"-transition".length),r):this._transitionable.setValue(e,r)}},e.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},e.prototype.hasTransition=function(){return this._transitioning.hasTransition()},e.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},e.prototype._validate=function(t,e){return a.emitErrors(this,t.call(a,n.extend({value:e,style:{glyphs:!0,sprite:!0},styleSpec:i})))},e}(o);e.exports=m},{"../style-spec/reference/latest":151,"../style-spec/util/color":153,"../style-spec/util/interpolate":158,"../util/evented":260,"../util/util":275,"./properties":188,"./validate_style":211}],184:[function(t,e,r){"use strict";var i=t("../util/mapbox").normalizeGlyphsURL,n=t("../util/ajax"),o=t("./parse_glyph_pbf");e.exports=function(t,e,r,a,s){var l=256*e,u=l+255,c=a(i(r).replace("{fontstack}",t).replace("{range}",l+"-"+u),n.ResourceType.Glyphs);n.getArrayBuffer(c,function(t,e){if(t)s(t);else if(e){for(var r={},i=0,n=o(e.data);i<n.length;i+=1){var a=n[i];r[a.id]=a}s(null,r)}})}},{"../util/ajax":251,"../util/mapbox":267,"./parse_glyph_pbf":186}],185:[function(t,e,r){"use strict";var i=t("../util/ajax"),n=t("../util/browser"),o=t("../util/mapbox").normalizeSpriteURL,a=t("../util/image").RGBAImage;e.exports=function(t,e,r){function s(){if(c)r(c);else if(l&&u){var t=n.getImageData(u),e={};for(var i in l){var o=l[i],s=o.width,p=o.height,h=o.x,f=o.y,d=o.sdf,m=o.pixelRatio,y=new a({width:s,height:p});a.copy(t,y,{x:h,y:f},{x:0,y:0},{width:s,height:p}),e[i]={data:y,pixelRatio:m,sdf:d}}r(null,e)}}var l,u,c,p=1<n.devicePixelRatio?"@2x":"";i.getJSON(e(o(t,p,".json"),i.ResourceType.SpriteJSON),function(t,e){c||(c=t,l=e,s())}),i.getImage(e(o(t,p,".png"),i.ResourceType.SpriteImage),function(t,e){c||(c=t,u=e,s())})}},{"../util/ajax":251,"../util/browser":252,"../util/image":263,"../util/mapbox":267}],186:[function(t,e,r){"use strict";function i(t,e,r){1===t&&r.readMessage(n,e)}function n(t,e,r){if(3===t){var i=r.readMessage(o,{}),n=i.id,s=i.bitmap,u=i.width,c=i.height,p=i.left,h=i.top,f=i.advance;e.push({id:n,bitmap:new a({width:u+2*l,height:c+2*l},s),metrics:{width:u,height:c,left:p,top:h,advance:f}})}}function o(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())}var a=t("../util/image").AlphaImage,s=t("pbf"),l=3;e.exports=function(t){return new s(t).readFields(i,[])},e.exports.GLYPH_PBF_BORDER=l},{"../util/image":263,pbf:30}],187:[function(t,e,r){"use strict";var i=t("../util/browser"),n=t("../symbol/placement"),o=function(){this._currentTileIndex=0,this._seenCrossTileIDs={}};o.prototype.continuePlacement=function(t,e,r,i,n){for(var o=this;this._currentTileIndex<t.length;){var a=t[o._currentTileIndex];if(e.placeLayerTile(i,a,r,o._seenCrossTileIDs),o._currentTileIndex++,n())return!0}};var a=function(t,e,r,i,o){this.placement=new n(t,o),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=i,this._done=!1};a.prototype.isDone=function(){return this._done},a.prototype.continuePlacement=function(t,e,r){for(var n=this,a=i.now(),s=function(){var t=i.now()-a;return!n._forceFullPlacement&&2<t};0<=this._currentPlacementIndex;){var l=e[t[n._currentPlacementIndex]],u=n.placement.collisionIndex.transform.zoom;if("symbol"===l.type&&(!l.minzoom||l.minzoom<=u)&&(!l.maxzoom||l.maxzoom>u)){if(n._inProgressLayer||(n._inProgressLayer=new o),n._inProgressLayer.continuePlacement(r[l.source],n.placement,n._showCollisionBoxes,l,s))return;delete n._inProgressLayer}n._currentPlacementIndex--}this._done=!0},a.prototype.commit=function(t,e){return this.placement.commit(t,e),this.placement},e.exports=a},{"../symbol/placement":223,"../util/browser":252}],188:[function(t,e,r){"use strict";var i=t("../util/util"),n=i.clone,o=i.extend,a=i.easeCubicInOut,s=t("../style-spec/util/interpolate"),l=t("../style-spec/expression").normalizePropertyExpression,u=(t("../style-spec/util/color"),t("../util/web_worker_transfer").register),c=function(t,e){this.property=t,this.value=e,this.expression=l(void 0===e?t.specification.default:e,t.specification)};c.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},c.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};var p=function(t){this.property=t,this.value=new c(t,void 0)};p.prototype.transitioned=function(t,e){return new f(this.property,this.value,e,o({},t.transition,this.transition),t.now)},p.prototype.untransitioned=function(){return new f(this.property,this.value,null,{},0)};var h=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};h.prototype.getValue=function(t){return n(this._values[t].value.value)},h.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new p(this._values[t].property)),this._values[t].value=new c(this._values[t].property,null===e?void 0:n(e))},h.prototype.getTransition=function(t){return n(this._values[t].transition)},h.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new p(this._values[t].property)),this._values[t].transition=n(e)||void 0},h.prototype.serialize=function(){for(var t=this,e={},r=0,i=Object.keys(t._values);r<i.length;r+=1){var n=i[r],o=t.getValue(n);void 0!==o&&(e[n]=o);var a=t.getTransition(n);void 0!==a&&(e[n+"-transition"]=a)}return e},h.prototype.transitioned=function(t,e){for(var r=new d(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},h.prototype.untransitioned=function(){for(var t=new d(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 f=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)};f.prototype.possiblyEvaluate=function(t){var e=t.now||0,r=this.value.possiblyEvaluate(t),i=this.prior;if(i){if(e>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(e<this.begin)return i.possiblyEvaluate(t);var n=(e-this.begin)/(this.end-this.begin);return this.property.interpolate(i.possiblyEvaluate(t),r,a(n))}return r};var d=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};d.prototype.possiblyEvaluate=function(t){for(var e=new _(this._properties),r=0,i=Object.keys(this._values);r<i.length;r+=1){var n=i[r];e._values[n]=this._values[n].possiblyEvaluate(t)}return e},d.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1){var r=e[t];if(this._values[r].prior)return!0}return!1};var m=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};m.prototype.getValue=function(t){return n(this._values[t].value)},m.prototype.setValue=function(t,e){this._values[t]=new c(this._values[t].property,null===e?void 0:n(e))},m.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},m.prototype.possiblyEvaluate=function(t){for(var e=new _(this._properties),r=0,i=Object.keys(this._values);r<i.length;r+=1){var n=i[r];e._values[n]=this._values[n].possiblyEvaluate(t)}return e};var y=function(t,e,r){this.property=t,this.value=e,this.globals=r};y.prototype.isConstant=function(){return"constant"===this.value.kind},y.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},y.prototype.evaluate=function(t){return this.property.evaluate(this.value,this.globals,t)};var _=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};_.prototype.get=function(t){return this._values[t]};var g=function(t){this.specification=t};g.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},g.prototype.interpolate=function(t,e,r){var i=s[this.specification.type];return i?i(t,e,r):t};var v=function(t){this.specification=t};v.prototype.possiblyEvaluate=function(t,e){return"constant"===t.expression.kind||"camera"===t.expression.kind?new y(this,{kind:"constant",value:t.expression.evaluate(e)},e):new y(this,t.expression,e)},v.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){var i=s[this.specification.type];return i?new y(this,{kind:"constant",value:i(t.value.value,e.value.value,r)},t.globals):t}},v.prototype.evaluate=function(t,e,r){return"constant"===t.kind?t.value:t.evaluate(e,r)};var x=function(t){this.specification=t};x.prototype.possiblyEvaluate=function(t,e){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e)}},x.prototype._calculate=function(t,e,r,i){var n=i.zoom,o=n-Math.floor(n),a=i.crossFadingFactor();return n>i.zoomHistory.lastIntegerZoom?{from:t,to:e,fromScale:2,toScale:1,t:o+(1-o)*a}:{from:r,to:e,fromScale:.5,toScale:1,t:1-(1-a)*o}},x.prototype.interpolate=function(t){return t};var b=function(t){this.specification=t};b.prototype.possiblyEvaluate=function(){},b.prototype.interpolate=function(){},u("DataDrivenProperty",v),u("DataConstantProperty",g),u("CrossFadedProperty",x),u("HeatmapColorProperty",b),e.exports={PropertyValue:c,Transitionable:h,Transitioning:d,Layout:m,PossiblyEvaluatedPropertyValue:y,PossiblyEvaluated:_,DataConstantProperty:g,DataDrivenProperty:v,CrossFadedProperty:x,HeatmapColorProperty:b,Properties:function(t){var e=this;for(var r in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},t){var i=t[r],n=e.defaultPropertyValues[r]=new c(i,void 0),o=e.defaultTransitionablePropertyValues[r]=new p(i);e.defaultTransitioningPropertyValues[r]=o.untransitioned(),e.defaultPossiblyEvaluatedValues[r]=n.possiblyEvaluate({})}}}},{"../style-spec/expression":139,"../style-spec/util/color":153,"../style-spec/util/interpolate":158,"../util/util":275,"../util/web_worker_transfer":278}],189:[function(t,e,r){"use strict";var i=t("@mapbox/point-geometry");e.exports={getMaximumPaintValue:function(t,e,r){var i=e.paint.get(t).value;return"constant"===i.kind?i.value:r.programConfigurations.get(e.id).binders[t].statistics.max},translateDistance:function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])},translate:function(t,e,r,n,o){if(!e[0]&&!e[1])return t;var a=i.convert(e);"viewport"===r&&a._rotate(-n);for(var s=[],l=0;l<t.length;l++){for(var u=t[l],c=[],p=0;p<u.length;p++)c.push(u[p].sub(a._mult(o)));s.push(c)}return s}}},{"@mapbox/point-geometry":4}],190:[function(t,e,r){"use strict";var i=t("../util/evented"),n=t("./style_layer"),o=t("./load_sprite"),a=t("../render/image_manager"),s=t("../render/glyph_manager"),l=t("./light"),u=t("../render/line_atlas"),c=t("../util/util"),p=t("../util/ajax"),h=t("../util/mapbox"),f=t("../util/browser"),d=t("../util/dispatcher"),m=t("./validate_style"),y=t("../source/source").getType,_=t("../source/source").setType,g=t("../source/query_features"),v=t("../source/source_cache"),x=(t("../source/geojson_source"),t("../style-spec/reference/latest")),b=t("../util/global_worker_pool"),w=t("../style-spec/deref"),S=t("../style-spec/diff"),A=t("../source/rtl_text_plugin"),T=t("./pauseable_placement"),z=t("./zoom_history"),E=t("../symbol/cross_tile_symbol_index"),k=c.pick(S.operations,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),C=c.pick(S.operations,["setCenter","setZoom","setBearing","setPitch"]),I=function(t){function e(e,r){var i=this;void 0===r&&(r={}),t.call(this),this.map=e,this.dispatcher=new d(b(),this),this.imageManager=new a,this.glyphManager=new s(e._transformRequest,r.localIdeographFontFamily),this.lineAtlas=new u(256,512),this.crossTileSymbolIndex=new E,this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new z,this._loaded=!1,this._resetUpdates();var n=this;this._rtlTextPluginCallback=A.registerForPluginAvailability(function(t){for(var e in n.dispatcher.broadcast("loadRTLTextPlugin",t.pluginBlobURL,t.errorCallback),n.sourceCaches)n.sourceCaches[e].reload()}),this.on("data",function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=i.sourceCaches[t.sourceId];if(e){var r=e.getSource();if(r&&r.vectorLayerIds)for(var n in i._layers){var o=i._layers[n];o.source===r.id&&i._validateLayer(o)}}}})}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.loadURL=function(t,e){var r=this;void 0===e&&(e={}),this.fire("dataloading",{dataType:"style"});var i="boolean"==typeof e.validate?e.validate:!h.isMapboxURL(t);t=h.normalizeStyleURL(t,e.accessToken);var n=this.map._transformRequest(t,p.ResourceType.Style);p.getJSON(n,function(t,e){t?r.fire("error",{error:t}):e&&r._load(e,i)})},e.prototype.loadJSON=function(t,e){var r=this;void 0===e&&(e={}),this.fire("dataloading",{dataType:"style"}),f.frame(function(){r._load(t,!1!==e.validate)})},e.prototype._load=function(t,e){var r=this;if(!e||!m.emitErrors(this,m(t))){for(var i in this._loaded=!0,(this.stylesheet=t).sources)r.addSource(i,t.sources[i],{validate:!1});t.sprite?o(t.sprite,this.map._transformRequest,function(t,e){if(t)r.fire("error",t);else if(e)for(var i in e)r.imageManager.addImage(i,e[i]);r.imageManager.setLoaded(!0),r.fire("data",{dataType:"style"})}):this.imageManager.setLoaded(!0),this.glyphManager.setURL(t.glyphs);var a=w(this.stylesheet.layers);this._order=a.map(function(t){return t.id}),this._layers={};for(var s=0,u=a;s<u.length;s+=1){var c=u[s];(c=n.create(c)).setEventedParent(r,{layer:{id:c.id}}),r._layers[c.id]=c}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new l(this.stylesheet.light),this.fire("data",{dataType:"style"}),this.fire("style.load")}},e.prototype._validateLayer=function(t){var e=this.sourceCaches[t.source];if(e){var r=t.sourceLayer;if(r){var i=e.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(r))&&this.fire("error",{error:new Error('Source layer "'+r+'" does not exist on source "'+i.id+'" as specified by style layer "'+t.id+'"')})}}},e.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()},e.prototype._serializeLayers=function(t){var e=this;return t.map(function(t){return e._layers[t].serialize()})},e.prototype.hasTransitions=function(){var t=this;if(this.light&&this.light.hasTransition())return!0;for(var e in t.sourceCaches)if(t.sourceCaches[e].hasTransition())return!0;for(var r in t._layers)if(t._layers[r].hasTransition())return!0;return!1},e.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},e.prototype.update=function(t){var e=this;if(this._loaded){if(this._changed){var r=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var n in(r.length||i.length)&&this._updateWorkerLayers(r,i),e._updatedSources){var o=e._updatedSources[n];"reload"===o?e._reloadSource(n):"clear"===o&&e._clearSource(n)}for(var a in e._updatedPaintProps)e._layers[a].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates(),this.fire("data",{dataType:"style"})}for(var s in e.sourceCaches)e.sourceCaches[s].used=!1;for(var l=0,u=e._order;l<u.length;l+=1){var c=u[l],p=e._layers[c];p.recalculate(t),!p.isHidden(t.zoom)&&p.source&&(e.sourceCaches[p.source].used=!0)}this.light.recalculate(t),this.z=t.zoom}},e.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},e.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={}},e.prototype.setState=function(t){var e=this;if(this._checkLoaded(),m.emitErrors(this,m(t)))return!1;(t=c.clone(t)).layers=w(t.layers);var r=S(this.serialize(),t).filter(function(t){return!(t.command in C)});if(0===r.length)return!1;var i=r.filter(function(t){return!(t.command in k)});if(0<i.length)throw new Error("Unimplemented: "+i.map(function(t){return t.command}).join(", ")+".");return r.forEach(function(t){"setTransition"!==t.command&&e[t.command].apply(e,t.args)}),this.stylesheet=t,!0},e.prototype.addImage=function(t,e){if(this.getImage(t))return this.fire("error",{error:new Error("An image with this name already exists.")});this.imageManager.addImage(t,e),this.fire("data",{dataType:"style"})},e.prototype.getImage=function(t){return this.imageManager.getImage(t)},e.prototype.removeImage=function(t){if(!this.getImage(t))return this.fire("error",{error:new Error("No image with this name exists.")});this.imageManager.removeImage(t),this.fire("data",{dataType:"style"})},e.prototype.addSource=function(t,e,r){var i=this;if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!e.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(e).join(", ")+".");if(!(0<=["vector","raster","geojson","video","image","canvas"].indexOf(e.type)&&this._validate(m.source,"sources."+t,e,null,r))){this.map&&this.map._collectResourceTiming&&(e.collectResourceTiming=!0);var n=this.sourceCaches[t]=new v(t,e,this.dispatcher);n.style=this,n.setEventedParent(this,function(){return{isSourceLoaded:i.loaded(),source:n.serialize(),sourceId:t}}),n.onAdd(this.map),this._changed=!0}},e.prototype.removeSource=function(t){var e=this;if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(var r in e._layers)if(e._layers[r].source===t)return e.fire("error",{error:new Error('Source "'+t+'" cannot be removed while layer "'+r+'" is using it.')});var i=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],i.fire("data",{sourceDataType:"metadata",dataType:"source",sourceId:t}),i.setEventedParent(null),i.clearTiles(),i.onRemove&&i.onRemove(this.map),this._changed=!0},e.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},e.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},e.prototype.addLayer=function(t,e,r){this._checkLoaded();var i=t.id;if("object"==typeof t.source&&(this.addSource(i,t.source),t=c.clone(t),t=c.extend(t,{source:i})),!this._validate(m.layer,"layers."+i,t,{arrayIndex:-1},r)){var o=n.create(t);this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}});var a=e?this._order.indexOf(e):this._order.length;if(e&&-1===a)return void this.fire("error",{error:new Error('Layer with id "'+e+'" does not exist on this map.')});if(this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o,this._removedLayers[i]&&o.source){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o)}},e.prototype.moveLayer=function(t,e){if(this._checkLoaded(),this._changed=!0,this._layers[t]){var r=this._order.indexOf(t);this._order.splice(r,1);var i=e?this._order.indexOf(e):this._order.length;e&&-1===i?this.fire("error",{error:new Error('Layer with id "'+e+'" does not exist on this map.')}):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}else this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")})},e.prototype.removeLayer=function(t){this._checkLoaded();var e=this._layers[t];if(e){e.setEventedParent(null);var r=this._order.indexOf(t);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=e,delete this._layers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t]}else this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")})},e.prototype.getLayer=function(t){return this._layers[t]},e.prototype.setLayerZoomRange=function(t,e,r){this._checkLoaded();var i=this.getLayer(t);i?i.minzoom===e&&i.maxzoom===r||(null!=e&&(i.minzoom=e),null!=r&&(i.maxzoom=r),this._updateLayer(i)):this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")})},e.prototype.setFilter=function(t,e){this._checkLoaded();var r=this.getLayer(t);if(r)return c.deepEqual(r.filter,e)?void 0:null==e?(r.filter=void 0,void this._updateLayer(r)):void(this._validate(m.filter,"layers."+r.id+".filter",e)||(r.filter=c.clone(e),this._updateLayer(r)));this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")})},e.prototype.getFilter=function(t){return c.clone(this.getLayer(t).filter)},e.prototype.setLayoutProperty=function(t,e,r){this._checkLoaded();var i=this.getLayer(t);i?c.deepEqual(i.getLayoutProperty(e),r)||(i.setLayoutProperty(e,r),this._updateLayer(i)):this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")})},e.prototype.getLayoutProperty=function(t,e){return this.getLayer(t).getLayoutProperty(e)},e.prototype.setPaintProperty=function(t,e,r){this._checkLoaded();var i=this.getLayer(t);if(i){if(!c.deepEqual(i.getPaintProperty(e),r)){var n=i._transitionablePaint._values[e].value.isDataDriven();i.setPaintProperty(e,r),(i._transitionablePaint._values[e].value.isDataDriven()||n)&&this._updateLayer(i),this._changed=!0,this._updatedPaintProps[t]=!0}}else this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")})},e.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},e.prototype.getTransition=function(){return c.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},e.prototype.serialize=function(){var t=this;return c.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:c.mapObject(this.sourceCaches,function(t){return t.serialize()}),layers:this._order.map(function(e){return t._layers[e].serialize()})},function(t){return void 0!==t})},e.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},e.prototype._flattenRenderedFeatures=function(t){for(var e=[],r=this._order.length-1;0<=r;r--)for(var i=this._order[r],n=0,o=t;n<o.length;n+=1){var a=o[n][i];if(a)for(var s=0,l=a;s<l.length;s+=1){var u=l[s];e.push(u)}}return e},e.prototype.queryRenderedFeatures=function(t,e,r,i){var n=this;e&&e.filter&&this._validate(m.filter,"queryRenderedFeatures.filter",e.filter);var o={};if(e&&e.layers){if(!Array.isArray(e.layers))return this.fire("error",{error:"parameters.layers must be an Array."}),[];for(var a=0,s=e.layers;a<s.length;a+=1){var l=s[a],u=n._layers[l];if(!u)return n.fire("error",{error:"The layer '"+l+"' does not exist in the map's style and cannot be queried for features."}),[];o[u.source]=!0}}var c=[];for(var p in n.sourceCaches)if(!e.layers||o[p]){var h=g.rendered(n.sourceCaches[p],n._layers,t,e,r,i,n.placement?n.placement.collisionIndex:null);c.push(h)}return this._flattenRenderedFeatures(c)},e.prototype.querySourceFeatures=function(t,e){e&&e.filter&&this._validate(m.filter,"querySourceFeatures.filter",e.filter);var r=this.sourceCaches[t];return r?g.source(r,e):[]},e.prototype.addSourceType=function(t,e,r){return y(t)?r(new Error('A source type called "'+t+'" already exists.')):(_(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},r):r(null,null))},e.prototype.getLight=function(){return this.light.getLight()},e.prototype.setLight=function(t){this._checkLoaded();var e=this.light.getLight(),r=!1;for(var i in t)if(!c.deepEqual(t[i],e[i])){r=!0;break}if(r){var n={now:f.now(),transition:c.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t),this.light.updateTransitions(n)}},e.prototype._validate=function(t,e,r,i,n){return(!n||!1!==n.validate)&&m.emitErrors(this,t.call(m,c.extend({key:e,style:this.serialize(),value:r,styleSpec:x},i)))},e.prototype._remove=function(){for(var t in A.evented.off("pluginAvailable",this._rtlTextPluginCallback),this.sourceCaches)this.sourceCaches[t].clearTiles();this.dispatcher.remove()},e.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},e.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},e.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},e.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},e.prototype._updatePlacement=function(t,e,r){for(var i=this,n=!1,o=!1,a={},s=0,l=i._order;s<l.length;s+=1){var u=l[s],c=i._layers[u];if("symbol"===c.type){if(!a[c.source]){var p=i.sourceCaches[c.source];a[c.source]=p.getRenderableIds().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 h=i.crossTileSymbolIndex.addLayer(c,a[c.source]);n=n||h}}this.crossTileSymbolIndex.pruneUnusedLayers(this._order);var d=this._layerOrderChanged;if((d||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(f.now()))&&(this.pauseablePlacement=new T(t,this._order,d,e,r),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,a),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(this.placement,f.now()),o=!0),n&&this.pauseablePlacement.placement.setStale()),o||n)for(var m=0,y=i._order;m<y.length;m+=1){var _=y[m],g=i._layers[_];"symbol"===g.type&&i.placement.updateLayerOpacities(g,a[g.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(f.now())},e.prototype.getImages=function(t,e,r){this.imageManager.getImages(e.icons,r)},e.prototype.getGlyphs=function(t,e,r){this.glyphManager.getGlyphs(e.stacks,r)},e}(i);e.exports=I},{"../render/glyph_manager":86,"../render/image_manager":88,"../render/line_atlas":89,"../source/geojson_source":99,"../source/query_features":105,"../source/rtl_text_plugin":109,"../source/source":110,"../source/source_cache":111,"../style-spec/deref":120,"../style-spec/diff":121,"../style-spec/reference/latest":151,"../symbol/cross_tile_symbol_index":218,"../util/ajax":251,"../util/browser":252,"../util/dispatcher":258,"../util/evented":260,"../util/global_worker_pool":262,"../util/mapbox":267,"../util/util":275,"./light":183,"./load_sprite":185,"./pauseable_placement":187,"./style_layer":191,"./validate_style":211,"./zoom_history":212}],191:[function(t,e,r){"use strict";var i=t("../util/util"),n=t("../style-spec/reference/latest"),o=t("./validate_style"),a=t("../util/evented"),s=t("./properties"),l=s.Layout,u=s.Transitionable,c=(s.Transitioning,s.Properties,function(t){function e(e,r){for(var i in t.call(this),this.id=e.id,this.metadata=e.metadata,this.type=e.type,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,this.visibility="visible","background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),this._featureFilter=function(){return!0},r.layout&&(this._unevaluatedLayout=new l(r.layout)),this._transitionablePaint=new u(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()}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(null!=e){var i="layers."+this.id+".layout."+t;if(this._validate(o.layoutProperty,i,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility="none"===e?e:"visible"},e.prototype.getPaintProperty=function(t){return i.endsWith(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(o.paintProperty,n,t,e,r))return}i.endsWith(t,"-transition")?this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0):this._transitionablePaint.setValue(t,e)},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){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t)},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"none"===this.visibility&&(t.layout=t.layout||{},t.layout.visibility="none"),i.filterObject(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,a){return(!a||!1!==a.validate)&&o.emitErrors(this,t.call(o,{key:e,layerType:this.type,objectKey:r,value:i,styleSpec:n,style:{glyphs:!0,sprite:!0}}))},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e}(a));e.exports=c;var p={circle:t("./style_layer/circle_style_layer"),heatmap:t("./style_layer/heatmap_style_layer"),hillshade:t("./style_layer/hillshade_style_layer"),fill:t("./style_layer/fill_style_layer"),"fill-extrusion":t("./style_layer/fill_extrusion_style_layer"),line:t("./style_layer/line_style_layer"),symbol:t("./style_layer/symbol_style_layer"),background:t("./style_layer/background_style_layer"),raster:t("./style_layer/raster_style_layer")};c.create=function(t){return new p[t.type](t)}},{"../style-spec/reference/latest":151,"../util/evented":260,"../util/util":275,"./properties":188,"./style_layer/background_style_layer":192,"./style_layer/circle_style_layer":194,"./style_layer/fill_extrusion_style_layer":196,"./style_layer/fill_style_layer":198,"./style_layer/heatmap_style_layer":200,"./style_layer/hillshade_style_layer":202,"./style_layer/line_style_layer":204,"./style_layer/raster_style_layer":206,"./style_layer/symbol_style_layer":208,"./validate_style":211}],192:[function(t,e,r){"use strict";var i=t("../style_layer"),n=t("./background_style_layer_properties"),o=t("../properties"),a=(o.Transitionable,o.Transitioning,o.PossiblyEvaluated,function(t){function e(e){t.call(this,e,n)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(i));e.exports=a},{"../properties":188,"../style_layer":191,"./background_style_layer_properties":193}],193:[function(t,e,r){"use strict";var i=t("../../style-spec/reference/latest"),n=t("../properties"),o=n.Properties,a=n.DataConstantProperty,s=(n.DataDrivenProperty,n.CrossFadedProperty),l=(n.HeatmapColorProperty,new o({"background-color":new a(i.paint_background["background-color"]),"background-pattern":new s(i.paint_background["background-pattern"]),"background-opacity":new a(i.paint_background["background-opacity"])}));e.exports={paint:l}},{"../../style-spec/reference/latest":151,"../properties":188}],194:[function(t,e,r){"use strict";var i=t("../style_layer"),n=t("../../data/bucket/circle_bucket"),o=t("../../util/intersection_tests").multiPolygonIntersectsBufferedMultiPoint,a=t("../query_utils"),s=a.getMaximumPaintValue,l=a.translateDistance,u=a.translate,c=t("./circle_style_layer_properties"),p=t("../properties"),h=(p.Transitionable,p.Transitioning,p.PossiblyEvaluated,function(t){function e(e){t.call(this,e,c)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.createBucket=function(t){return new n(t)},e.prototype.queryRadius=function(t){var e=t;return s("circle-radius",this,e)+s("circle-stroke-width",this,e)+l(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,a){var s=u(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),n,a),l=this.paint.get("circle-radius").evaluate(e)*a,c=this.paint.get("circle-stroke-width").evaluate(e)*a;return o(s,r,l+c)},e}(i));e.exports=h},{"../../data/bucket/circle_bucket":42,"../../util/intersection_tests":264,"../properties":188,"../query_utils":189,"../style_layer":191,"./circle_style_layer_properties":195}],195:[function(t,e,r){"use strict";var i=t("../../style-spec/reference/latest"),n=t("../properties"),o=n.Properties,a=n.DataConstantProperty,s=n.DataDrivenProperty,l=(n.CrossFadedProperty,n.HeatmapColorProperty,new o({"circle-radius":new s(i.paint_circle["circle-radius"]),"circle-color":new s(i.paint_circle["circle-color"]),"circle-blur":new s(i.paint_circle["circle-blur"]),"circle-opacity":new s(i.paint_circle["circle-opacity"]),"circle-translate":new a(i.paint_circle["circle-translate"]),"circle-translate-anchor":new a(i.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new a(i.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new a(i.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new s(i.paint_circle["circle-stroke-width"]),"circle-stroke-color":new s(i.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new s(i.paint_circle["circle-stroke-opacity"])}));e.exports={paint:l}},{"../../style-spec/reference/latest":151,"../properties":188}],196:[function(t,e,r){"use strict";var i=t("../style_layer"),n=t("../../data/bucket/fill_extrusion_bucket"),o=t("../../util/intersection_tests").multiPolygonIntersectsMultiPolygon,a=t("../query_utils"),s=a.translateDistance,l=a.translate,u=t("./fill_extrusion_style_layer_properties"),c=t("../properties"),p=(c.Transitionable,c.Transitioning,c.PossiblyEvaluated,function(t){function e(e){t.call(this,e,u)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.createBucket=function(t){return new n(t)},e.prototype.queryRadius=function(){return s(this.paint.get("fill-extrusion-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,a){var s=l(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),n,a);return o(s,r)},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("fill-extrusion-opacity")&&"none"!==this.visibility},e.prototype.resize=function(){this.viewportFrame&&(this.viewportFrame.destroy(),this.viewportFrame=null)},e}(i));e.exports=p},{"../../data/bucket/fill_extrusion_bucket":46,"../../util/intersection_tests":264,"../properties":188,"../query_utils":189,"../style_layer":191,"./fill_extrusion_style_layer_properties":197}],197:[function(t,e,r){"use strict";var i=t("../../style-spec/reference/latest"),n=t("../properties"),o=n.Properties,a=n.DataConstantProperty,s=n.DataDrivenProperty,l=n.CrossFadedProperty,u=(n.HeatmapColorProperty,new o({"fill-extrusion-opacity":new a(i["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new s(i["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new a(i["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new a(i["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new l(i["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new s(i["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new s(i["paint_fill-extrusion"]["fill-extrusion-base"])}));e.exports={paint:u}},{"../../style-spec/reference/latest":151,"../properties":188}],198:[function(t,e,r){"use strict";var i=t("../style_layer"),n=t("../../data/bucket/fill_bucket"),o=t("../../util/intersection_tests").multiPolygonIntersectsMultiPolygon,a=t("../query_utils"),s=a.translateDistance,l=a.translate,u=t("./fill_style_layer_properties"),c=t("../properties"),p=(c.Transitionable,c.Transitioning,c.PossiblyEvaluated,function(t){function e(e){t.call(this,e,u)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.recalculate=function(t){this.paint=this._transitioningPaint.possiblyEvaluate(t),void 0===this._transitionablePaint.getValue("fill-outline-color")&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new n(t)},e.prototype.queryRadius=function(){return s(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,a){var s=l(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),n,a);return o(s,r)},e}(i));e.exports=p},{"../../data/bucket/fill_bucket":44,"../../util/intersection_tests":264,"../properties":188,"../query_utils":189,"../style_layer":191,"./fill_style_layer_properties":199}],199:[function(t,e,r){"use strict";var i=t("../../style-spec/reference/latest"),n=t("../properties"),o=n.Properties,a=n.DataConstantProperty,s=n.DataDrivenProperty,l=n.CrossFadedProperty,u=(n.HeatmapColorProperty,new o({"fill-antialias":new a(i.paint_fill["fill-antialias"]),"fill-opacity":new s(i.paint_fill["fill-opacity"]),"fill-color":new s(i.paint_fill["fill-color"]),"fill-outline-color":new s(i.paint_fill["fill-outline-color"]),"fill-translate":new a(i.paint_fill["fill-translate"]),"fill-translate-anchor":new a(i.paint_fill["fill-translate-anchor"]),"fill-pattern":new l(i.paint_fill["fill-pattern"])}));e.exports={paint:u}},{"../../style-spec/reference/latest":151,"../properties":188}],200:[function(t,e,r){"use strict";var i=t("../style_layer"),n=t("../../data/bucket/heatmap_bucket"),o=t("../../util/image").RGBAImage,a=t("./heatmap_style_layer_properties"),s=t("../properties"),l=(s.Transitionable,s.Transitioning,s.PossiblyEvaluated,function(t){function e(e){t.call(this,e,a),this._updateColorRamp()}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.createBucket=function(t){return new n(t)},e.prototype.setPaintProperty=function(e,r,i){t.prototype.setPaintProperty.call(this,e,r,i),"heatmap-color"===e&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){for(var t=this._transitionablePaint._values["heatmap-color"].value.expression,e=new Uint8Array(1024),r=e.length,i=4;i<r;i+=4){var n=t.evaluate({heatmapDensity:i/r});e[i+0]=Math.floor(255*n.r/n.a),e[i+1]=Math.floor(255*n.g/n.a),e[i+2]=Math.floor(255*n.b/n.a),e[i+3]=Math.floor(255*n.a)}this.colorRamp=new o({width:256,height:1},e),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}(i));e.exports=l},{"../../data/bucket/heatmap_bucket":47,"../../util/image":263,"../properties":188,"../style_layer":191,"./heatmap_style_layer_properties":201}],201:[function(t,e,r){"use strict";var i=t("../../style-spec/reference/latest"),n=t("../properties"),o=n.Properties,a=n.DataConstantProperty,s=n.DataDrivenProperty,l=(n.CrossFadedProperty,n.HeatmapColorProperty),u=new o({"heatmap-radius":new s(i.paint_heatmap["heatmap-radius"]),"heatmap-weight":new s(i.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new a(i.paint_heatmap["heatmap-intensity"]),"heatmap-color":new l(i.paint_heatmap["heatmap-color"]),"heatmap-opacity":new a(i.paint_heatmap["heatmap-opacity"])});e.exports={paint:u}},{"../../style-spec/reference/latest":151,"../properties":188}],202:[function(t,e,r){"use strict";var i=t("../style_layer"),n=t("./hillshade_style_layer_properties"),o=t("../properties"),a=(o.Transitionable,o.Transitioning,o.PossiblyEvaluated,function(t){function e(e){t.call(this,e,n)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(i));e.exports=a},{"../properties":188,"../style_layer":191,"./hillshade_style_layer_properties":203}],203:[function(t,e,r){"use strict";var i=t("../../style-spec/reference/latest"),n=t("../properties"),o=n.Properties,a=n.DataConstantProperty,s=(n.DataDrivenProperty,n.CrossFadedProperty,n.HeatmapColorProperty,new o({"hillshade-illumination-direction":new a(i.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new a(i.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new a(i.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new a(i.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new a(i.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new a(i.paint_hillshade["hillshade-accent-color"])}));e.exports={paint:s}},{"../../style-spec/reference/latest":151,"../properties":188}],204:[function(t,e,r){"use strict";function i(t,e){return 0<e?e+2*t:t}var n=t("@mapbox/point-geometry"),o=t("../style_layer"),a=t("../../data/bucket/line_bucket"),s=t("../../util/intersection_tests").multiPolygonIntersectsBufferedMultiLine,l=t("../query_utils"),u=l.getMaximumPaintValue,c=l.translateDistance,p=l.translate,h=t("./line_style_layer_properties"),f=t("../../util/util").extend,d=t("../evaluation_parameters"),m=t("../properties"),y=(m.Transitionable,m.Transitioning,m.Layout,m.PossiblyEvaluated,new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.possiblyEvaluate=function(e,r){return r=new d(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){return r=f({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,i)},e}(m.DataDrivenProperty))(h.paint.properties["line-width"].specification));y.useIntegerZoom=!0;var _=function(t){function e(e){t.call(this,e,h)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=y.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new a(t)},e.prototype.queryRadius=function(t){var e=t,r=i(u("line-width",this,e),u("line-gap-width",this,e)),n=u("line-offset",this,e);return r/2+Math.abs(n)+c(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,o,a,l){var u=p(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a,l),c=l/2*i(this.paint.get("line-width").evaluate(e),this.paint.get("line-gap-width").evaluate(e)),h=this.paint.get("line-offset").evaluate(e);return h&&(r=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-1],c=a[l],p=a[l+1],h=0===l?i:c.sub(u)._unit()._perp(),f=l===a.length-1?i:p.sub(c)._unit()._perp(),d=h._add(f)._unit(),m=d.x*f.x+d.y*f.y;d._mult(1/m),s.push(d._mult(e)._add(c))}r.push(s)}return r}(r,h*l)),s(u,r,c)},e}(o);e.exports=_},{"../../data/bucket/line_bucket":49,"../../util/intersection_tests":264,"../../util/util":275,"../evaluation_parameters":182,"../properties":188,"../query_utils":189,"../style_layer":191,"./line_style_layer_properties":205,"@mapbox/point-geometry":4}],205:[function(t,e,r){"use strict";var i=t("../../style-spec/reference/latest"),n=t("../properties"),o=n.Properties,a=n.DataConstantProperty,s=n.DataDrivenProperty,l=n.CrossFadedProperty,u=(n.HeatmapColorProperty,new o({"line-cap":new a(i.layout_line["line-cap"]),"line-join":new s(i.layout_line["line-join"]),"line-miter-limit":new a(i.layout_line["line-miter-limit"]),"line-round-limit":new a(i.layout_line["line-round-limit"])})),c=new o({"line-opacity":new s(i.paint_line["line-opacity"]),"line-color":new s(i.paint_line["line-color"]),"line-translate":new a(i.paint_line["line-translate"]),"line-translate-anchor":new a(i.paint_line["line-translate-anchor"]),"line-width":new s(i.paint_line["line-width"]),"line-gap-width":new s(i.paint_line["line-gap-width"]),"line-offset":new s(i.paint_line["line-offset"]),"line-blur":new s(i.paint_line["line-blur"]),"line-dasharray":new l(i.paint_line["line-dasharray"]),"line-pattern":new l(i.paint_line["line-pattern"])});e.exports={paint:c,layout:u}},{"../../style-spec/reference/latest":151,"../properties":188}],206:[function(t,e,r){"use strict";var i=t("../style_layer"),n=t("./raster_style_layer_properties"),o=t("../properties"),a=(o.Transitionable,o.Transitioning,o.PossiblyEvaluated,function(t){function e(e){t.call(this,e,n)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(i));e.exports=a},{"../properties":188,"../style_layer":191,"./raster_style_layer_properties":207}],207:[function(t,e,r){"use strict";var i=t("../../style-spec/reference/latest"),n=t("../properties"),o=n.Properties,a=n.DataConstantProperty,s=(n.DataDrivenProperty,n.CrossFadedProperty,n.HeatmapColorProperty,new o({"raster-opacity":new a(i.paint_raster["raster-opacity"]),"raster-hue-rotate":new a(i.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new a(i.paint_raster["raster-brightness-min"]),"raster-brightness-max":new a(i.paint_raster["raster-brightness-max"]),"raster-saturation":new a(i.paint_raster["raster-saturation"]),"raster-contrast":new a(i.paint_raster["raster-contrast"]),"raster-fade-duration":new a(i.paint_raster["raster-fade-duration"])}));e.exports={paint:s}},{"../../style-spec/reference/latest":151,"../properties":188}],208:[function(t,e,r){"use strict";var i=t("../style_layer"),n=t("../../data/bucket/symbol_bucket"),o=t("../../util/token"),a=t("../../style-spec/expression").isExpression,s=t("./symbol_style_layer_properties"),l=t("../properties"),u=(l.Transitionable,l.Transitioning,l.Layout,l.PossiblyEvaluated,function(t){function e(e){t.call(this,e,s)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),"auto"===this.layout.get("icon-rotation-alignment")&&("line"===this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("line"===this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="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"))},e.prototype.getValueAndResolveTokens=function(t,e){var r=this.layout.get(t).evaluate(e),i=this._unevaluatedLayout._values[t];return i.isDataDriven()||a(i.value)?r:o(e.properties,r)},e.prototype.createBucket=function(t){return new n(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e}(i));e.exports=u},{"../../data/bucket/symbol_bucket":51,"../../style-spec/expression":139,"../../util/token":274,"../properties":188,"../style_layer":191,"./symbol_style_layer_properties":209}],209:[function(t,e,r){"use strict";var i=t("../../style-spec/reference/latest"),n=t("../properties"),o=n.Properties,a=n.DataConstantProperty,s=n.DataDrivenProperty,l=(n.CrossFadedProperty,n.HeatmapColorProperty,new o({"symbol-placement":new a(i.layout_symbol["symbol-placement"]),"symbol-spacing":new a(i.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new a(i.layout_symbol["symbol-avoid-edges"]),"icon-allow-overlap":new a(i.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new a(i.layout_symbol["icon-ignore-placement"]),"icon-optional":new a(i.layout_symbol["icon-optional"]),"icon-rotation-alignment":new a(i.layout_symbol["icon-rotation-alignment"]),"icon-size":new s(i.layout_symbol["icon-size"]),"icon-text-fit":new a(i.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new a(i.layout_symbol["icon-text-fit-padding"]),"icon-image":new s(i.layout_symbol["icon-image"]),"icon-rotate":new s(i.layout_symbol["icon-rotate"]),"icon-padding":new a(i.layout_symbol["icon-padding"]),"icon-keep-upright":new a(i.layout_symbol["icon-keep-upright"]),"icon-offset":new s(i.layout_symbol["icon-offset"]),"icon-anchor":new s(i.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new a(i.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new a(i.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new a(i.layout_symbol["text-rotation-alignment"]),"text-field":new s(i.layout_symbol["text-field"]),"text-font":new s(i.layout_symbol["text-font"]),"text-size":new s(i.layout_symbol["text-size"]),"text-max-width":new s(i.layout_symbol["text-max-width"]),"text-line-height":new a(i.layout_symbol["text-line-height"]),"text-letter-spacing":new s(i.layout_symbol["text-letter-spacing"]),"text-justify":new s(i.layout_symbol["text-justify"]),"text-anchor":new s(i.layout_symbol["text-anchor"]),"text-max-angle":new a(i.layout_symbol["text-max-angle"]),"text-rotate":new s(i.layout_symbol["text-rotate"]),"text-padding":new a(i.layout_symbol["text-padding"]),"text-keep-upright":new a(i.layout_symbol["text-keep-upright"]),"text-transform":new s(i.layout_symbol["text-transform"]),"text-offset":new s(i.layout_symbol["text-offset"]),"text-allow-overlap":new a(i.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new a(i.layout_symbol["text-ignore-placement"]),"text-optional":new a(i.layout_symbol["text-optional"])})),u=new o({"icon-opacity":new s(i.paint_symbol["icon-opacity"]),"icon-color":new s(i.paint_symbol["icon-color"]),"icon-halo-color":new s(i.paint_symbol["icon-halo-color"]),"icon-halo-width":new s(i.paint_symbol["icon-halo-width"]),"icon-halo-blur":new s(i.paint_symbol["icon-halo-blur"]),"icon-translate":new a(i.paint_symbol["icon-translate"]),"icon-translate-anchor":new a(i.paint_symbol["icon-translate-anchor"]),"text-opacity":new s(i.paint_symbol["text-opacity"]),"text-color":new s(i.paint_symbol["text-color"]),"text-halo-color":new s(i.paint_symbol["text-halo-color"]),"text-halo-width":new s(i.paint_symbol["text-halo-width"]),"text-halo-blur":new s(i.paint_symbol["text-halo-blur"]),"text-translate":new a(i.paint_symbol["text-translate"]),"text-translate-anchor":new a(i.paint_symbol["text-translate-anchor"])});e.exports={paint:u,layout:l}},{"../../style-spec/reference/latest":151,"../properties":188}],210:[function(t,e,r){"use strict";var i=t("./style_layer"),n=t("../util/util"),o=t("../style-spec/feature_filter"),a=t("../style-spec/group_by_layout"),s=function(t){t&&this.replace(t)};s.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},s.prototype.update=function(t,e){for(var r=this,s=0,l=t;s<l.length;s+=1){var u=l[s];r._layerConfigs[u.id]=u;var c=r._layers[u.id]=i.create(u);c._featureFilter=o(c.filter)}for(var p=0,h=e;p<h.length;p+=1){var f=h[p];delete r._layerConfigs[f],delete r._layers[f]}this.familiesBySource={};for(var d=0,m=a(n.values(this._layerConfigs));d<m.length;d+=1){var y=m[d].map(function(t){return r._layers[t.id]}),_=y[0];if("none"!==_.visibility){var g=_.source||"",v=r.familiesBySource[g];v||(v=r.familiesBySource[g]={});var x=_.sourceLayer||"_geojsonTileLayer",b=v[x];b||(b=v[x]=[]),b.push(y)}}},e.exports=s},{"../style-spec/feature_filter":148,"../style-spec/group_by_layout":150,"../util/util":275,"./style_layer":191}],211:[function(t,e,r){"use strict";e.exports=t("../style-spec/validate_style.min"),e.exports.emitErrors=function(t,e){if(e&&e.length){for(var r=0,i=e;r<i.length;r+=1){var n=i[r].message;t.fire("error",{error:new Error(n)})}return!0}return!1}},{"../style-spec/validate_style.min":181}],212:[function(t,e,r){"use strict";var i=function(){this.first=!0};i.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))},e.exports=i},{}],213:[function(t,e,r){"use strict";var i=t("@mapbox/point-geometry"),n=t("../util/web_worker_transfer").register,o=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).prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(i);n("Anchor",o),e.exports=o},{"../util/web_worker_transfer":278,"@mapbox/point-geometry":4}],214:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,n){if(void 0===e.segment)return!0;for(var o=e,a=e.segment+1,s=0;-r/2<s;){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-1],p=t[a],h=t[a+1];if(!h)return!1;var f=c.angleTo(p)-p.angleTo(h);for(f=Math.abs((f+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:f}),u+=f;s-l[0].distance>i;)u-=l.shift().angleDelta;if(n<u)return!1;a++,s+=p.dist(h)}return!0}},{}],215:[function(t,e,r){"use strict";var i=t("@mapbox/point-geometry");e.exports=function(t,e,r,n,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 p=l[c],h=l[c+1];p.x<e&&h.x<e||(p.x<e?p=new i(e,p.y+(h.y-p.y)*((e-p.x)/(h.x-p.x)))._round():h.x<e&&(h=new i(e,p.y+(h.y-p.y)*((e-p.x)/(h.x-p.x)))._round()),p.y<r&&h.y<r||(p.y<r?p=new i(p.x+(h.x-p.x)*((r-p.y)/(h.y-p.y)),r)._round():h.y<r&&(h=new i(p.x+(h.x-p.x)*((r-p.y)/(h.y-p.y)),r)._round()),p.x>=n&&h.x>=n||(p.x>=n?p=new i(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round():h.x>=n&&(h=new i(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round()),p.y>=o&&h.y>=o||(p.y>=o?p=new i(p.x+(h.x-p.x)*((o-p.y)/(h.y-p.y)),o)._round():h.y>=o&&(h=new i(p.x+(h.x-p.x)*((o-p.y)/(h.y-p.y)),o)._round()),u&&p.equals(u[u.length-1])||(u=[p],a.push(u)),u.push(h)))))}return a}},{"@mapbox/point-geometry":4}],216:[function(t,e,r){"use strict";var i=function(t,e,r,i,n,o,a,s,l,u,c){var p=a.top*s-l,h=a.bottom*s+l,f=a.left*s-l,d=a.right*s+l;if(this.boxStartIndex=t.length,u){var m=h-p,y=d-f;0<m&&(m=Math.max(10*s,m),this._addLineCollisionCircles(t,e,r,r.segment,y,m,i,n,o,c))}else t.emplaceBack(r.x,r.y,f,p,d,h,i,n,o,0,0);this.boxEndIndex=t.length};i.prototype._addLineCollisionCircles=function(t,e,r,i,n,o,a,s,l,u){var c=o/2,p=Math.floor(n/c),h=1+.4*Math.log(u)/Math.LN2,f=Math.floor(p*h/2),d=-o/2,m=r,y=i+1,_=d,g=-n/2,v=g-n/4;do{if(--y<0){if(g<_)return;y=0;break}_-=e[y].dist(m),m=e[y]}while(v<_);for(var x=e[y].dist(e[y+1]),b=-f;b<p+f;b++){var w=b*c,S=g+w;if(w<0&&(S+=w),n<w&&(S+=w-n),!(S<_)){for(;_+x<S;){if(_+=x,++y+1>=e.length)return;x=e[y].dist(e[y+1])}var A=S-_,T=e[y],z=e[y+1].sub(T)._unit()._mult(A)._add(T)._round(),E=Math.abs(S-d)<c?0:.8*(S-d);t.emplaceBack(z.x,z.y,-o/2,-o/2,o/2,o/2,a,s,l,o/2,E)}}},e.exports=i},{}],217:[function(t,e,r){"use strict";function i(t,e,r){t[e+4]=r?1:0}var n=t("@mapbox/point-geometry"),o=t("../util/intersection_tests"),a=t("./grid_index"),s=(t("@mapbox/gl-matrix").mat4,t("../symbol/projection")),l=function(t,e,r){void 0===e&&(e=new a(t.width+200,t.height+200,25)),void 0===r&&(r=new a(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};l.prototype.placeCollisionBox=function(t,e,r,i){var n=this.projectAndGetPerspectiveRatio(i,t.anchorPointX,t.anchorPointY),o=r*n.perspectiveRatio,a=t.x1*o+n.point.x,s=t.y1*o+n.point.y,l=t.x2*o+n.point.x,u=t.y2*o+n.point.y;return!e&&this.grid.hitTest(a,s,l,u)?{box:[],offscreen:!1}:{box:[a,s,l,u],offscreen:this.isOffscreen(a,s,l,u)}},l.prototype.approximateTileDistance=function(t,e,r,i,n){var o=n?1:i/this.pitchfactor,a=t.lastSegmentViewportDistance*r;return t.prevTileDistance+a+(o-1)*a*Math.abs(Math.sin(e))},l.prototype.placeCollisionCircles=function(t,e,r,o,a,l,u,c,p,h,f,d,m){var y=this,_=[],g=this.projectAnchor(h,l.anchorX,l.anchorY),v=p/24,x=l.lineOffsetX*p,b=l.lineOffsetY*p,w=new n(l.anchorX,l.anchorY),S=s.project(w,f).point,A=s.placeFirstAndLastGlyph(v,c,x,b,!1,S,w,l,u,f,{},!0),T=!1,z=!0,E=g.perspectiveRatio*o,k=1/(o*r),C=0,I=0;A&&(C=this.approximateTileDistance(A.first.tileDistance,A.first.angle,k,g.cameraDistance,m),I=this.approximateTileDistance(A.last.tileDistance,A.last.angle,k,g.cameraDistance,m));for(var M=0;M<t.length;M+=5){var P=t[M],L=t[M+1],D=t[M+2],B=t[M+3];if(!A||B<-C||I<B)i(t,M,!1);else{var R=y.projectPoint(h,P,L),O=D*E;if(0<_.length){var F=R.x-_[_.length-4],V=R.y-_[_.length-3];if(F*F+V*V<O*O*2&&M+8<t.length){var j=t[M+8];if(-C<j&&j<I){i(t,M,!1);continue}}}var N=M/5;if(_.push(R.x,R.y,O,N),i(t,M,!0),z=z&&y.isOffscreen(R.x-O,R.y-O,R.x+O,R.y+O),!e&&y.grid.hitTestCircle(R.x,R.y,O)){if(!d)return{circles:[],offscreen:!1};T=!0}}}return{circles:T?[]:_,offscreen:z}},l.prototype.queryRenderedSymbols=function(t,e,r,i,a,s){var l={},u=[];if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return u;for(var c=this.transform.calculatePosMatrix(e.toUnwrapped()),p=[],h=1/0,f=1/0,d=-1/0,m=-1/0,y=0;y<t.length;y++)for(var _=t[y],g=0;g<_.length;g++){var v=this.projectPoint(c,_[g].x,_[g].y);h=Math.min(h,v.x),f=Math.min(f,v.y),d=Math.max(d,v.x),m=Math.max(m,v.y),p.push(v)}for(var x=e.key,b=[],w=this.grid.query(h,f,d,m),S=0;S<w.length;S++)w[S].sourceID===a&&w[S].tileID===x&&s[w[S].bucketInstanceId]&&b.push(w[S].boxIndex);for(var A=this.ignoredGrid.query(h,f,d,m),T=0;T<A.length;T++)A[T].sourceID===a&&A[T].tileID===x&&s[A[T].bucketInstanceId]&&b.push(A[T].boxIndex);for(var z=0;z<b.length;z++){var E=i.get(b[z]),k=E.sourceLayerIndex,C=E.featureIndex,I=E.bucketIndex;if(void 0===l[k]&&(l[k]={}),void 0===l[k][C]&&(l[k][C]={}),!l[k][C][I]){var M=this.projectAndGetPerspectiveRatio(c,E.anchorPointX,E.anchorPointY),P=r*M.perspectiveRatio,L=E.x1*P+M.point.x,D=E.y1*P+M.point.y,B=E.x2*P+M.point.x,R=E.y2*P+M.point.y,O=[new n(L,D),new n(B,D),new n(B,R),new n(L,R)];o.polygonIntersectsPolygon(p,O)&&(l[k][C][I]=!0,u.push(b[z]))}}return u},l.prototype.insertCollisionBox=function(t,e,r,i,n,o){var a={tileID:r,sourceID:i,bucketInstanceId:n,boxIndex:o};(e?this.ignoredGrid:this.grid).insert(a,t[0],t[1],t[2],t[3])},l.prototype.insertCollisionCircles=function(t,e,r,i,n,o){for(var a=e?this.ignoredGrid:this.grid,s=0;s<t.length;s+=4){var l={tileID:r,sourceID:i,bucketInstanceId:n,boxIndex:o+t[s+3]};a.insertCircle(l,t[s],t[s+1],t[s+2])}},l.prototype.projectAnchor=function(t,e,r){var i=[e,r,0,1];return s.xyTransformMat4(i,i,t),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5,cameraDistance:i[3]}},l.prototype.projectPoint=function(t,e,r){var i=[e,r,0,1];return s.xyTransformMat4(i,i,t),new n((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100)},l.prototype.projectAndGetPerspectiveRatio=function(t,e,r){var i=[e,r,0,1];return s.xyTransformMat4(i,i,t),{point:new n((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},l.prototype.isOffscreen=function(t,e,r,i){return r<100||t>=this.screenRightBoundary||i<100||e>this.screenBottomBoundary},e.exports=l},{"../symbol/projection":224,"../util/intersection_tests":264,"./grid_index":220,"@mapbox/gl-matrix":2,"@mapbox/point-geometry":4}],218:[function(t,e,r){"use strict";var i=t("../data/extent"),n=512/i/2,o=function(t,e,r){var i=this;this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0,o=e;n<o.length;n+=1){var a=o[n],s=a.key;i.indexedSymbolInstances[s]||(i.indexedSymbolInstances[s]=[]),i.indexedSymbolInstances[s].push({crossTileID:a.crossTileID,coord:i.getScaledCoordinates(a,t)})}};o.prototype.getScaledCoordinates=function(t,e){var r=e.canonical.z-this.tileID.canonical.z,o=n/Math.pow(2,r),a=t.anchor;return{x:Math.floor((e.canonical.x*i+a.x)*o),y:Math.floor((e.canonical.y*i+a.y)*o)}},o.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,o=t;n<o.length;n+=1){var a=o[n];if(!a.crossTileID){var s=this.indexedSymbolInstances[a.key];if(s)for(var l=this.getScaledCoordinates(a,e),u=0,c=s;u<c.length;u+=1){var p=c[u];if(Math.abs(p.coord.x-l.x)<=i&&Math.abs(p.coord.y-l.y)<=i&&!r[p.crossTileID]){r[p.crossTileID]=!0,a.crossTileID=p.crossTileID;break}}}}};var a=function(){this.maxCrossTileID=0};a.prototype.generate=function(){return++this.maxCrossTileID};var s=function(){this.indexes={},this.usedCrossTileIDs={}};s.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,n=e.symbolInstances;i<n.length;i+=1)n[i].crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var a=this.usedCrossTileIDs[t.overscaledZ];for(var s in this.indexes){var l=this.indexes[s];if(Number(s)>t.overscaledZ)for(var u in l){var c=l[u];c.tileID.isChildOf(t)&&c.findMatches(e.symbolInstances,t,a)}else{var p=l[t.scaledTo(Number(s)).key];p&&p.findMatches(e.symbolInstances,t,a)}}for(var h=0,f=e.symbolInstances;h<f.length;h+=1){var d=f[h];d.crossTileID||(d.crossTileID=r.generate(),a[d.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new o(t,e.symbolInstances,e.bucketInstanceId),!0},s.prototype.removeBucketCrossTileIDs=function(t,e){for(var r in e.indexedSymbolInstances)for(var i=0,n=e.indexedSymbolInstances[r];i<n.length;i+=1){var o=n[i];delete this.usedCrossTileIDs[t][o.crossTileID]}},s.prototype.removeStaleBuckets=function(t){var e=this,r=!1;for(var i in e.indexes){var n=e.indexes[i];for(var o in n)t[n[o].bucketInstanceId]||(e.removeBucketCrossTileIDs(i,n[o]),delete n[o],r=!0)}return r};var l=function(){this.layerIndexes={},this.crossTileIDs=new a,this.maxBucketInstanceId=0};l.prototype.addLayer=function(t,e){var r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new s);for(var i=!1,n={},o=0,a=e;o<a.length;o+=1){var l=a[o],u=l.getBucket(t);u&&(u.bucketInstanceId||(u.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(l.tileID,u,this.crossTileIDs)&&(i=!0),n[u.bucketInstanceId]=!0)}return r.removeStaleBuckets(n)&&(i=!0),i},l.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]},e.exports=l},{"../data/extent":53}],219:[function(t,e,r){"use strict";var i=t("../style-spec/util/interpolate").number,n=t("../symbol/anchor"),o=t("./check_max_angle");e.exports=function(t,e,r,a,s,l,u,c,p){var h=a?.6*l*u:0,f=Math.max(a?a.right-a.left:0,s?s.right-s.left:0),d=0===t[0].x||t[0].x===p||0===t[0].y||t[0].y===p;return e-f*u<e/4&&(e=f*u+e/4),function t(e,r,a,s,l,u,c,p,h){for(var f=u/2,d=0,m=0;m<e.length-1;m++)d+=e[m].dist(e[m+1]);for(var y=0,_=r-a,g=[],v=0;v<e.length-1;v++){for(var x=e[v],b=e[v+1],w=x.dist(b),S=b.angleTo(x);_+a<y+w;){var A=((_+=a)-y)/w,T=i(x.x,b.x,A),z=i(x.y,b.y,A);if(0<=T&&T<h&&0<=z&&z<h&&0<=_-f&&_+f<=d){var E=new n(T,z,S,v);E._round(),s&&!o(e,E,u,s,l)||g.push(E)}}y+=w}return p||g.length||c||(g=t(e,y/2,a,s,l,u,c,!0,h)),g}(t,d?e/2*c%e:(f/2+2*l)*u*c%e,e,h,r,f*u,d,!1,p)}},{"../style-spec/util/interpolate":158,"../symbol/anchor":213,"./check_max_angle":214}],220:[function(t,e,r){"use strict";var i=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};i.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},i.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)},i.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)},i.prototype._insertBoxCell=function(t,e,r,i,n,o){this.boxCells[n].push(o)},i.prototype._insertCircleCell=function(t,e,r,i,n,o){this.circleCells[n].push(o)},i.prototype._query=function(t,e,r,i,n){if(r<0||t>this.width||i<0||e>this.height)return!n&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=i)o=Array.prototype.slice.call(this.boxKeys).concat(this.circleKeys);else{var a={hitTest:n,seenUids:{box:{},circle:{}}};this._forEachCell(t,e,r,i,this._queryCell,o,a)}return n?0<o.length:o},i.prototype._queryCircle=function(t,e,r,i){var n=t-r,o=t+r,a=e-r,s=e+r;if(o<0||n>this.width||s<0||a>this.height)return!i&&[];var l=[],u={hitTest:i,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(n,a,o,s,this._queryCellCircle,l,u),i?0<l.length:l},i.prototype.query=function(t,e,r,i){return this._query(t,e,r,i,!1)},i.prototype.hitTest=function(t,e,r,i){return this._query(t,e,r,i,!0)},i.prototype.hitTestCircle=function(t,e,r){return this._queryCircle(t,e,r,!0)},i.prototype._queryCell=function(t,e,r,i,n,o,a){var s=this,l=a.seenUids,u=this.boxCells[n];if(null!==u)for(var c=this.bboxes,p=0,h=u;p<h.length;p+=1){var f=h[p];if(!l.box[f]){l.box[f]=!0;var d=4*f;if(t<=c[d+2]&&e<=c[d+3]&&r>=c[d+0]&&i>=c[d+1]){if(a.hitTest)return o.push(!0),!0;o.push(s.boxKeys[f])}}}var m=this.circleCells[n];if(null!==m)for(var y=this.circles,_=0,g=m;_<g.length;_+=1){var v=g[_];if(!l.circle[v]){l.circle[v]=!0;var x=3*v;if(s._circleAndRectCollide(y[x],y[x+1],y[x+2],t,e,r,i)){if(a.hitTest)return o.push(!0),!0;o.push(s.circleKeys[v])}}}},i.prototype._queryCellCircle=function(t,e,r,i,n,o,a){var s=a.circle,l=a.seenUids,u=this.boxCells[n];if(null!==u)for(var c=this.bboxes,p=0,h=u;p<h.length;p+=1){var f=h[p];if(!l.box[f]){l.box[f]=!0;var d=4*f;if(this._circleAndRectCollide(s.x,s.y,s.radius,c[d+0],c[d+1],c[d+2],c[d+3]))return o.push(!0),!0}}var m=this.circleCells[n];if(null!==m)for(var y=this.circles,_=0,g=m;_<g.length;_+=1){var v=g[_];if(!l.circle[v]){l.circle[v]=!0;var x=3*v;if(this._circlesCollide(y[x],y[x+1],y[x+2],s.x,s.y,s.radius))return o.push(!0),!0}}},i.prototype._forEachCell=function(t,e,r,i,n,o,a){for(var s=this._convertToXCellCoord(t),l=this._convertToYCellCoord(e),u=this._convertToXCellCoord(r),c=this._convertToYCellCoord(i),p=s;p<=u;p++)for(var h=l;h<=c;h++){var f=this.xCellCount*h+p;if(n.call(this,t,e,r,i,f,o,a))return}},i.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},i.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},i.prototype._circlesCollide=function(t,e,r,i,n,o){var a=i-t,s=n-e,l=r+o;return a*a+s*s<l*l},i.prototype._circleAndRectCollide=function(t,e,r,i,n,o,a){var s=(o-i)/2,l=Math.abs(t-(i+s));if(s+r<l)return!1;var u=(a-n)/2,c=Math.abs(e-(n+u));if(u+r<c)return!1;if(l<=s||c<=u)return!0;var p=l-s,h=c-u;return p*p+h*h<=r*r},e.exports=i},{}],221:[function(t,e,r){"use strict";e.exports=function(t){function e(e){s.push(t[e]),l++}function r(t,e,r){var i=a[t];return delete a[t],a[e]=i,s[i].geometry[0].pop(),s[i].geometry[0]=s[i].geometry[0].concat(r[0]),i}function i(t,e,r){var i=o[e];return delete o[e],o[t]=i,s[i].geometry[0].shift(),s[i].geometry[0]=r[0].concat(s[i].geometry[0]),i}function n(t,e,r){var i=r?e[0][e[0].length-1]:e[0][0];return t+":"+i.x+":"+i.y}for(var o={},a={},s=[],l=0,u=0;u<t.length;u++){var c=t[u],p=c.geometry,h=c.text;if(h){var f=n(h,p),d=n(h,p,!0);if(f in a&&d in o&&a[f]!==o[d]){var m=i(f,d,p),y=r(f,d,s[m].geometry);delete o[f],delete a[d],a[n(h,s[y].geometry,!0)]=y,s[m].geometry=null}else f in a?r(f,d,p):d in o?i(f,d,p):(e(u),o[f]=l-1,a[d]=l-1)}else e(u)}return s.filter(function(t){return t.geometry})}},{}],222:[function(t,e,r){"use strict";var i=t("../util/web_worker_transfer").register,n=function(){this.opacity=0,this.targetOpacity=0,this.time=0};n.prototype.clone=function(){var t=new n;return t.opacity=this.opacity,t.targetOpacity=this.targetOpacity,t.time=this.time,t},i("OpacityState",n),e.exports=n},{"../util/web_worker_transfer":278}],223:[function(t,e,r){"use strict";function i(t,e,r){t.emplaceBack(e?1:0,r?1:0),t.emplaceBack(e?1:0,r?1:0),t.emplaceBack(e?1:0,r?1:0),t.emplaceBack(e?1:0,r?1:0)}function n(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*m+e*y+r*_+e*g+r*v+e*x+r*b+e}var o=t("./collision_index"),a=t("../data/extent"),s=t("./symbol_size"),l=t("./projection"),u=t("../style/style_layer/symbol_style_layer_properties").layout,c=t("../source/pixels_to_tile_units"),p=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};p.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var h=function(t,e,r,i,n){this.text=new p(t?t.text:null,e,r,n),this.icon=new p(t?t.icon:null,e,i,n)};h.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var f=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},d=function(t,e){this.transform=t.clone(),this.collisionIndex=new o(this.transform),this.placements={},this.opacities={},this.stale=!1,this.fadeDuration=e};d.prototype.placeLayerTile=function(t,e,r,i){var n=e.getBucket(t);if(n){var o=n.layers[0].layout,s=Math.pow(2,this.transform.zoom-e.tileID.overscaledZ),u=e.tileSize/a,p=this.transform.calculatePosMatrix(e.tileID.toUnwrapped()),h=l.getLabelPlaneMatrix(p,"map"===o.get("text-pitch-alignment"),"map"===o.get("text-rotation-alignment"),this.transform,c(e,1,this.transform.zoom)),f=l.getLabelPlaneMatrix(p,"map"===o.get("icon-pitch-alignment"),"map"===o.get("icon-rotation-alignment"),this.transform,c(e,1,this.transform.zoom));this.placeLayerBucket(n,p,h,f,s,u,r,i,e.collisionBoxArray,e.tileID.key,t.source)}},d.prototype.placeLayerBucket=function(t,e,r,i,n,o,a,l,c,p,h){for(var d=this,m=t.layers[0].layout,y=s.evaluateSizeForZoom(t.textSizeData,this.transform.zoom,u.properties["text-size"]),_=!t.hasTextData()||m.get("text-optional"),g=!t.hasIconData()||m.get("icon-optional"),v=0,x=t.symbolInstances;v<x.length;v+=1){var b=x[v];if(!l[b.crossTileID]){var w=!1,S=!1,A=!0,T=null,z=null,E=null;b.collisionArrays||(b.collisionArrays=t.deserializeCollisionBoxes(c,b.textBoxStartIndex,b.textBoxEndIndex,b.iconBoxStartIndex,b.iconBoxEndIndex)),b.collisionArrays.textBox&&(w=0<(T=d.collisionIndex.placeCollisionBox(b.collisionArrays.textBox,m.get("text-allow-overlap"),o,e)).box.length,A=A&&T.offscreen);var k=b.collisionArrays.textCircles;if(k){var C=t.text.placedSymbolArray.get(b.placedTextSymbolIndices[0]),I=s.evaluateSizeForFeature(t.textSizeData,y,C);z=d.collisionIndex.placeCollisionCircles(k,m.get("text-allow-overlap"),n,o,b.key,C,t.lineVertexArray,t.glyphOffsetArray,I,e,r,a,"map"===m.get("text-pitch-alignment")),w=m.get("text-allow-overlap")||0<z.circles.length,A=A&&z.offscreen}b.collisionArrays.iconBox&&(S=0<(E=d.collisionIndex.placeCollisionBox(b.collisionArrays.iconBox,m.get("icon-allow-overlap"),o,e)).box.length,A=A&&E.offscreen),_||g?g?_||(S=S&&w):w=S&&w:S=w=S&&w,w&&T&&d.collisionIndex.insertCollisionBox(T.box,m.get("text-ignore-placement"),p,h,t.bucketInstanceId,b.textBoxStartIndex),S&&E&&d.collisionIndex.insertCollisionBox(E.box,m.get("icon-ignore-placement"),p,h,t.bucketInstanceId,b.iconBoxStartIndex),w&&z&&d.collisionIndex.insertCollisionCircles(z.circles,m.get("text-ignore-placement"),p,h,t.bucketInstanceId,b.textBoxStartIndex),d.placements[b.crossTileID]=new f(w,S,A||t.justReloaded),l[b.crossTileID]=!0}}t.justReloaded=!1},d.prototype.commit=function(t,e){var r=this;this.commitTime=e;var i=!1,n=t&&0!==this.fadeDuration?(this.commitTime-t.commitTime)/this.fadeDuration:1,o=t?t.opacities:{};for(var a in r.placements){var s=r.placements[a],l=o[a];l?(r.opacities[a]=new h(l,n,s.text,s.icon),i=i||s.text!==l.text.placed||s.icon!==l.icon.placed):(r.opacities[a]=new h(null,n,s.text,s.icon,s.skipFade),i=i||s.text||s.icon)}for(var u in o){var c=o[u];if(!r.opacities[u]){var p=new h(c,n,!1,!1);p.isHidden()||(r.opacities[u]=p,i=i||c.text.placed||c.icon.placed)}}i?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)},d.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&&this.updateBucketOpacities(a,r,o.collisionBoxArray)}},d.prototype.updateBucketOpacities=function(t,e,r){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasCollisionBoxData()&&t.collisionBox.collisionVertexArray.clear(),t.hasCollisionCircleData()&&t.collisionCircle.collisionVertexArray.clear();for(var o=t.layers[0].layout,a=new h(null,0,o.get("text-allow-overlap"),o.get("icon-allow-overlap"),!0),s=0;s<t.symbolInstances.length;s++){var l=t.symbolInstances[s],u=e[l.crossTileID],c=this.opacities[l.crossTileID];c?u&&(c=a):(c=a,this.opacities[l.crossTileID]=c),e[l.crossTileID]=!0;var p=0<l.numGlyphVertices||0<l.numVerticalGlyphVertices,f=0<l.numIconVertices;if(p){for(var d=n(c.text),m=(l.numGlyphVertices+l.numVerticalGlyphVertices)/4,y=0;y<m;y++)t.text.opacityVertexArray.emplaceBack(d);for(var _=0,g=l.placedTextSymbolIndices;_<g.length;_+=1){var v=g[_];t.text.placedSymbolArray.get(v).hidden=c.text.isHidden()}}if(f){for(var x=n(c.icon),b=0;b<l.numIconVertices/4;b++)t.icon.opacityVertexArray.emplaceBack(x);t.icon.placedSymbolArray.get(s).hidden=c.icon.isHidden()}l.collisionArrays||(l.collisionArrays=t.deserializeCollisionBoxes(r,l.textBoxStartIndex,l.textBoxEndIndex,l.iconBoxStartIndex,l.iconBoxEndIndex));var w=l.collisionArrays;if(w){w.textBox&&t.hasCollisionBoxData()&&i(t.collisionBox.collisionVertexArray,c.text.placed,!1),w.iconBox&&t.hasCollisionBoxData()&&i(t.collisionBox.collisionVertexArray,c.icon.placed,!1);var S=w.textCircles;if(S&&t.hasCollisionCircleData())for(var A=0;A<S.length;A+=5){var T=u||0===S[A+4];i(t.collisionCircle.collisionVertexArray,c.text.placed,T)}}}t.sortFeatures(this.transform.angle),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasCollisionBoxData()&&t.collisionBox.collisionVertexBuffer&&t.collisionBox.collisionVertexBuffer.updateData(t.collisionBox.collisionVertexArray),t.hasCollisionCircleData()&&t.collisionCircle.collisionVertexBuffer&&t.collisionCircle.collisionVertexBuffer.updateData(t.collisionCircle.collisionVertexArray)},d.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration},d.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},d.prototype.stillRecent=function(t){return"undefined"!==this.commitTime&&this.commitTime+this.fadeDuration>t},d.prototype.setStale=function(){this.stale=!0};var m=Math.pow(2,25),y=Math.pow(2,24),_=Math.pow(2,17),g=Math.pow(2,16),v=Math.pow(2,9),x=Math.pow(2,8),b=Math.pow(2,1);e.exports=d},{"../data/extent":53,"../source/pixels_to_tile_units":104,"../style/style_layer/symbol_style_layer_properties":209,"./collision_index":217,"./projection":224,"./symbol_size":228}],224:[function(t,e,r){"use strict";function i(t,e){var r=[t.x,t.y,0,1];p(r,r,e);var i=r[3];return{point:new h(r[0]/i,r[1]/i),signedDistanceFromCamera:i}}function n(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 o(t,e,r,i,n,o,a,s,l,c,p,h){var f=s.glyphStartIndex+s.numGlyphs,d=s.lineStartIndex,m=s.lineStartIndex+s.lineLength,y=e.getoffsetX(s.glyphStartIndex),_=e.getoffsetX(f-1),g=u(t*y,r,i,n,o,a,s.segment,d,m,l,c,p,h);if(!g)return null;var v=u(t*_,r,i,n,o,a,s.segment,d,m,l,c,p,h);return v?{first:g,last:v}:null}function a(t,e,r,i){return t===v.horizontal&&Math.abs(r.y-e.y)>Math.abs(r.x-e.x)*i?{useVertical:!0}:(t===v.vertical?e.y<r.y:e.x>r.x)?{needsFlipping:!0}:null}function s(t,e,r,n,s,c,p,f,d,m,y,g,v,x){var b,w=e/24,S=t.lineOffsetX*e,A=t.lineOffsetY*e;if(1<t.numGlyphs){var T=t.glyphStartIndex+t.numGlyphs,z=t.lineStartIndex,E=t.lineStartIndex+t.lineLength,k=o(w,f,S,A,r,y,g,t,d,c,v,!1);if(!k)return{notEnoughRoom:!0};var C=i(k.first.point,p).point,I=i(k.last.point,p).point;if(n&&!r){var M=a(t.writingMode,C,I,x);if(M)return M}b=[k.first];for(var P=t.glyphStartIndex+1;P<T-1;P++)b.push(u(w*f.getoffsetX(P),S,A,r,y,g,t.segment,z,E,d,c,v,!1));b.push(k.last)}else{if(n&&!r){var L=i(g,s).point,D=t.lineStartIndex+t.segment+1,B=new h(d.getx(D),d.gety(D)),R=i(B,s),O=0<R.signedDistanceFromCamera?R.point:l(g,B,L,1,s),F=a(t.writingMode,L,O,x);if(F)return F}var V=u(w*f.getoffsetX(t.glyphStartIndex),S,A,r,y,g,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,d,c,v,!1);if(!V)return{notEnoughRoom:!0};b=[V]}for(var j=0,N=b;j<N.length;j+=1){var U=N[j];_(m,U.point,U.angle)}return{}}function l(t,e,r,n,o){var a=i(t.add(t.sub(e)._unit()),o).point,s=r.sub(a);return r.add(s._mult(n/s.mag()))}function u(t,e,r,n,o,a,s,u,c,p,f,d,m){var y=n?t-e:t+e,_=0<y?1:-1,g=0;n&&(_*=-1,g=Math.PI),_<0&&(g+=Math.PI);for(var v=0<_?u+s:u+s+1,x=v,b=o,w=o,S=0,A=0,T=Math.abs(y);S+A<=T;){if((v+=_)<u||c<=v)return null;if(w=b,void 0===(b=d[v])){var z=new h(p.getx(v),p.gety(v)),E=i(z,f);if(0<E.signedDistanceFromCamera)b=d[v]=E.point;else{var k=v-_;b=l(0===S?a:new h(p.getx(k),p.gety(k)),z,w,T-S+1,f)}}S+=A,A=w.dist(b)}var C=(T-S)/A,I=b.sub(w),M=I.mult(C)._add(w);return M._add(I._unit()._perp()._mult(r*_)),{point:M,angle:g+Math.atan2(b.y-w.y,b.x-w.x),tileDistance:m?{prevTileDistance:v-_===x?0:p.gettileUnitDistanceFromAnchor(v-_),lastSegmentViewportDistance:T-S}:null}}function c(t,e){for(var r=0;r<t;r++){var i=e.length;e.resize(i+4),e.float32.set(x,3*i)}}function p(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 h=t("@mapbox/point-geometry"),f=t("@mapbox/gl-matrix"),d=f.mat4,m=f.vec4,y=t("./symbol_size"),_=t("../data/bucket/symbol_bucket").addDynamicAttributes,g=t("../style/style_layer/symbol_style_layer_properties").layout,v=t("../symbol/shaping").WritingMode;e.exports={updateLineLabels:function(t,e,r,o,a,l,u,p){var f=o?t.textSizeData:t.iconSizeData,d=y.evaluateSizeForZoom(f,r.transform.zoom,g.properties[o?"text-size":"icon-size"]),_=[256/r.width*2+1,256/r.height*2+1],x=o?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;x.clear();for(var b=t.lineVertexArray,w=o?t.text.placedSymbolArray:t.icon.placedSymbolArray,S=r.transform.width/r.transform.height,A=!1,T=0;T<w.length;T++){var z=w.get(T);if(z.hidden||z.writingMode===v.vertical&&!A)c(z.numGlyphs,x);else{A=!1;var E=[z.anchorX,z.anchorY,0,1];if(m.transformMat4(E,E,e),n(E,_)){var k=.5+E[3]/r.transform.cameraToCenterDistance*.5,C=y.evaluateSizeForFeature(f,d,z),I=u?C*k:C/k,M=new h(z.anchorX,z.anchorY),P=i(M,a).point,L={},D=s(z,I,!1,p,e,a,l,t.glyphOffsetArray,b,x,P,M,L,S);A=D.useVertical,(D.notEnoughRoom||A||D.needsFlipping&&s(z,I,!0,p,e,a,l,t.glyphOffsetArray,b,x,P,M,L,S).notEnoughRoom)&&c(z.numGlyphs,x)}else c(z.numGlyphs,x)}}o?t.text.dynamicLayoutVertexBuffer.updateData(x):t.icon.dynamicLayoutVertexBuffer.updateData(x)},getLabelPlaneMatrix:function(t,e,r,i,n){var o=d.identity(new Float32Array(16));return e?(d.identity(o),d.scale(o,o,[1/n,1/n,1]),r||d.rotateZ(o,o,i.angle)):(d.scale(o,o,[i.width/2,-i.height/2,1]),d.translate(o,o,[1,-1,0]),d.multiply(o,o,t)),o},getGlCoordMatrix:function(t,e,r,i,n){var o=d.identity(new Float32Array(16));return e?(d.multiply(o,o,t),d.scale(o,o,[n,n,1]),r||d.rotateZ(o,o,-i.angle)):(d.scale(o,o,[1,-1,1]),d.translate(o,o,[-1,-1,0]),d.scale(o,o,[2/i.width,2/i.height,1])),o},project:i,placeFirstAndLastGlyph:o,xyTransformMat4:p};var x=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0])},{"../data/bucket/symbol_bucket":51,"../style/style_layer/symbol_style_layer_properties":209,"../symbol/shaping":226,"./symbol_size":228,"@mapbox/gl-matrix":2,"@mapbox/point-geometry":4}],225:[function(t,e,r){"use strict";var i=t("@mapbox/point-geometry"),n=t("../style/parse_glyph_pbf").GLYPH_PBF_BORDER;e.exports={getIconQuads:function(t,e,r,n,o,a,s){var l,u,c,p,h=e.image,f=r.layout,d=e.top-1/h.pixelRatio,m=e.left-1/h.pixelRatio,y=e.bottom+1/h.pixelRatio,_=e.right+1/h.pixelRatio;if("none"!==f.get("icon-text-fit")&&o){var g=_-m,v=y-d,x=f.get("text-size").evaluate(s)/24,b=o.left*x,w=o.right*x,S=o.top*x,A=w-b,T=o.bottom*x-S,z=f.get("icon-text-fit-padding")[0],E=f.get("icon-text-fit-padding")[1],k=f.get("icon-text-fit-padding")[2],C=f.get("icon-text-fit-padding")[3],I="width"===f.get("icon-text-fit")?.5*(T-v):0,M="height"===f.get("icon-text-fit")?.5*(A-g):0,P="width"===f.get("icon-text-fit")||"both"===f.get("icon-text-fit")?A:g,L="height"===f.get("icon-text-fit")||"both"===f.get("icon-text-fit")?T:v;l=new i(b+M-C,S+I-z),u=new i(b+M+E+P,S+I-z),c=new i(b+M+E+P,S+I+k+L),p=new i(b+M-C,S+I+k+L)}else l=new i(m,d),u=new i(_,d),c=new i(_,y),p=new i(m,y);var D=r.layout.get("icon-rotate").evaluate(s)*Math.PI/180;if(D){var B=Math.sin(D),R=Math.cos(D),O=[R,-B,B,R];l._matMult(O),u._matMult(O),p._matMult(O),c._matMult(O)}return[{tl:l,tr:u,bl:p,br:c,tex:{x:h.textureRect.x-1,y:h.textureRect.y-1,w:h.textureRect.w+2,h:h.textureRect.h+2},writingMode:void 0,glyphOffset:[0,0]}]},getGlyphQuads:function(t,e,r,o,a,s,l){for(var u=r.layout.get("text-rotate").evaluate(s)*Math.PI/180,c=r.layout.get("text-offset").evaluate(s).map(function(t){return 24*t}),p=e.positionedGlyphs,h=[],f=0;f<p.length;f++){var d=p[f],m=l[d.glyph];if(m){var y=m.rect;if(y){var _=n+1,g=m.metrics.advance/2,v=o?[d.x+g,d.y]:[0,0],x=o?[0,0]:[d.x+g+c[0],d.y+c[1]],b=m.metrics.left-_-g+x[0],w=-m.metrics.top-_+x[1],S=b+y.w,A=w+y.h,T=new i(b,w),z=new i(S,w),E=new i(b,A),k=new i(S,A);if(o&&d.vertical){var C=new i(-g,g),I=-Math.PI/2,M=new i(5,0);T._rotateAround(I,C)._add(M),z._rotateAround(I,C)._add(M),E._rotateAround(I,C)._add(M),k._rotateAround(I,C)._add(M)}if(u){var P=Math.sin(u),L=Math.cos(u),D=[L,-P,P,L];T._matMult(D),z._matMult(D),E._matMult(D),k._matMult(D)}h.push({tl:T,tr:z,bl:E,br:k,tex:y,writingMode:e.writingMode,glyphOffset:v})}}}return h}}},{"../style/parse_glyph_pbf":186,"@mapbox/point-geometry":4}],226:[function(t,e,r){"use strict";function i(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 n(t,e){var r=0;return 10===t&&(r-=1e4),40!==t&&65288!==t||(r+=50),41!==e&&65289!==e||(r+=50),r}function o(t,e,r,n,o,a){for(var s=null,l=i(e,r,o,a),u=0,c=n;u<c.length;u+=1){var p=c[u],h=i(e-p.x,r,o,a)+p.badness;h<=l&&(s=p,l=h)}return{index:t,x:e,priorBreak:s,badness:l}}function a(t,e,r,i){if(!r)return[];if(!t)return[];for(var a=[],s=function(t,e,r,i){for(var n=0,o=0;o<t.length;o++){var a=i[t.charCodeAt(o)];a&&(n+=a.metrics.advance+e)}return n/Math.max(1,Math.ceil(n/r))}(t,e,r,i),l=0,c=0;c<t.length;c++){var p=t.charCodeAt(c),h=i[p];h&&!f[p]&&(l+=h.metrics.advance+e),c<t.length-1&&(d[p]||u.charAllowsIdeographicBreaking(p))&&a.push(o(c+1,l,s,a,n(p,t.charCodeAt(c+1)),!1))}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(o(t.length,l,s,a,0,!0))}function s(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 l(t,e,r,i,n){if(n){var o=e[t[i].glyph];if(o)for(var a=o.metrics.advance,s=(t[i].x+a)*n,l=r;l<=i;l++)t[l].x-=s}}var u=t("../util/script_detection"),c=t("../util/verticalize_punctuation"),p=t("../source/rtl_text_plugin"),h={horizontal:1,vertical:2,horizontalOnly:3};e.exports={shapeText:function(t,e,r,i,n,o,f,d,m,y){var _=t.trim();y===h.vertical&&(_=c(_));var g=[],v={positionedGlyphs:g,text:_,top:d[1],bottom:d[1],left:d[0],right:d[0],writingMode:y},x=p.processBidirectionalText;return function(t,e,r,i,n,o,a,c,p){for(var f=0,d=-17,m=0,y=t.positionedGlyphs,_="right"===o?1:"left"===o?0:.5,g=0,v=r;g<v.length;g+=1){var x=v[g];if((x=x.trim()).length){for(var b=y.length,w=0;w<x.length;w++){var S=x.charCodeAt(w),A=e[S];A&&(u.charHasUprightVerticalOrientation(S)&&a!==h.horizontal?(y.push({glyph:S,x:f,y:0,vertical:!0}),f+=p+c):(y.push({glyph:S,x:f,y:d,vertical:!1}),f+=A.metrics.advance+c))}if(y.length!==b){var T=f-c;m=Math.max(T,m),l(y,e,b,y.length-1,_)}f=0,d+=i}else d+=i}var z=s(n),E=z.horizontalAlign,k=z.verticalAlign;!function(t,e,r,i,n,o,a){for(var s=(e-r)*n,l=(-i*a+.5)*o,u=0;u<t.length;u++)t[u].x+=s,t[u].y+=l}(y,_,E,k,m,i,r.length);var C=r.length*i;t.top+=-k*C,t.bottom=t.top+C,t.left+=-E*m,t.right=t.left+m}(v,e,x?x(_,a(_,f,r,e)):function(t,e){for(var r=[],i=0,n=0,o=e;n<o.length;n+=1){var a=o[n];r.push(t.substring(i,a)),i=a}return i<t.length&&r.push(t.substring(i,t.length)),r}(_,a(_,f,r,e)),i,n,o,y,f,m),!!g.length&&v},shapeIcon:function(t,e,r){var i=s(r),n=i.horizontalAlign,o=i.verticalAlign,a=e[0],l=e[1],u=a-t.displaySize[0]*n,c=u+t.displaySize[0],p=l-t.displaySize[1]*o;return{image:t,top:p,bottom:p+t.displaySize[1],left:u,right:c}},WritingMode:h};var f={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},d={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0}},{"../source/rtl_text_plugin":109,"../util/script_detection":269,"../util/verticalize_punctuation":277}],227:[function(t,e,r){"use strict";function i(t,e,r,i,c,p){var h=p.layoutTextSize.evaluate(e),d=p.layoutIconSize.evaluate(e),m=p.textMaxSize.evaluate(e);void 0===m&&(m=h);var v=t.layers[0].layout,A=v.get("text-offset").evaluate(e),T=v.get("icon-offset").evaluate(e),z=h/24,E=t.tilePixelRatio*z,k=t.tilePixelRatio*m/24,C=t.tilePixelRatio*d,I=t.tilePixelRatio*v.get("symbol-spacing"),M=v.get("text-padding")*t.tilePixelRatio,P=v.get("icon-padding")*t.tilePixelRatio,L=v.get("text-max-angle")/180*Math.PI,D="map"===v.get("text-rotation-alignment")&&"line"===v.get("symbol-placement"),B="map"===v.get("icon-rotation-alignment")&&"line"===v.get("symbol-placement"),R=I/2,O=function(o,a){a.x<0||a.x>=w||a.y<0||a.y>=w||t.symbolInstances.push(function(t,e,r,i,o,a,s,l,c,p,h,d,m,v,x,b,w,A,T,z,E,k){var C,I,M=t.addToLineVertexArray(e,r),P=0,L=0,D=0,B=i.horizontal?i.horizontal.text:"",R=[];i.horizontal&&(C=new _(s,r,e,l,c,p,i.horizontal,h,d,m,t.overscaling),L+=n(t,e,i.horizontal,a,m,T,z,v,M,i.vertical?f.horizontal:f.horizontalOnly,R,E,k),i.vertical&&(D+=n(t,e,i.vertical,a,m,T,z,v,M,f.vertical,R,E,k)));var O=C?C.boxStartIndex:t.collisionBoxArray.length,F=C?C.boxEndIndex:t.collisionBoxArray.length;if(o){var V=y(e,o,a,w,i.horizontal,T,z);I=new _(s,r,e,l,c,p,o,x,b,!1,t.overscaling),P=4*V.length;var j=t.iconSizeData,N=null;"source"===j.functionType?N=[10*a.layout.get("icon-size").evaluate(z)]:"composite"===j.functionType&&(N=[10*k.compositeIconSizes[0].evaluate(z),10*k.compositeIconSizes[1].evaluate(z)]),t.addSymbols(t.icon,V,N,A,w,z,!1,e,M.lineStartIndex,M.lineLength)}var U=I?I.boxStartIndex:t.collisionBoxArray.length,q=I?I.boxEndIndex:t.collisionBoxArray.length;return t.glyphOffsetArray.length>=S.MAX_GLYPHS&&g.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),{key:B,textBoxStartIndex:O,textBoxEndIndex:F,iconBoxStartIndex:U,iconBoxEndIndex:q,textOffset:v,iconOffset:A,anchor:e,line:r,featureIndex:l,feature:z,numGlyphVertices:L,numVerticalGlyphVertices:D,numIconVertices:P,textOpacityState:new u,iconOpacityState:new u,isDuplicate:!1,placedTextSymbolIndices:R,crossTileID:0}}(t,a,o,r,i,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,E,M,D,A,C,P,B,T,{zoom:t.zoom},e,c,p))};if("line"===v.get("symbol-placement"))for(var F=0,V=l(e.geometry,0,0,w,w);F<V.length;F+=1)for(var j=V[F],N=0,U=s(j,I,L,r.vertical||r.horizontal,i,24,k,t.overscaling,w);N<U.length;N+=1){var q=U[N],Z=r.horizontal;Z&&o(t,Z.text,R,q)||O(j,q)}else if("Polygon"===e.type)for(var G=0,W=b(e.geometry,0);G<W.length;G+=1){var X=W[G],H=x(X,16);O(X[0],new a(H.x,H.y,0))}else if("LineString"===e.type)for(var K=0,Y=e.geometry;K<Y.length;K+=1){var J=Y[K];O(J,new a(J[0].x,J[0].y,0))}else if("Point"===e.type)for(var $=0,Q=e.geometry;$<Q.length;$+=1)for(var tt=0,et=Q[$];tt<et.length;tt+=1){var rt=et[tt];O([rt],new a(rt.x,rt.y,0))}}function n(t,e,r,i,n,o,a,s,l,u,c,p,h){var f=m(e,r,i,n,o,a,p),d=t.textSizeData,y=null;return"source"===d.functionType?y=[10*i.layout.get("text-size").evaluate(a)]:"composite"===d.functionType&&(y=[10*h.compositeTextSizes[0].evaluate(a),10*h.compositeTextSizes[1].evaluate(a)]),t.addSymbols(t.text,f,y,s,n,a,u,e,l.lineStartIndex,l.lineLength),c.push(t.text.placedSymbolArray.length-1),4*f.length}function o(t,e,r,i){var n=t.compareText;if(e in n){for(var o=n[e],a=o.length-1;0<=a;a--)if(i.dist(o[a])<r)return!0}else n[e]=[];return n[e].push(i),!1}var a=t("./anchor"),s=t("./get_anchors"),l=t("./clip_line"),u=t("./opacity_state"),c=t("./shaping"),p=c.shapeText,h=c.shapeIcon,f=c.WritingMode,d=t("./quads"),m=d.getGlyphQuads,y=d.getIconQuads,_=t("./collision_feature"),g=t("../util/util"),v=t("../util/script_detection"),x=t("../util/find_pole_of_inaccessibility"),b=t("../util/classify_rings"),w=t("../data/extent"),S=t("../data/bucket/symbol_bucket"),A=t("../style/evaluation_parameters");t("@mapbox/point-geometry"),e.exports={performSymbolLayout:function(t,e,r,n,o,a){t.createArrays(),t.symbolInstances=[];var s=512*t.overscaling;t.tilePixelRatio=w/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,c={};if("composite"===t.textSizeData.functionType){var d=t.textSizeData.zoomRange,m=d.min,y=d.max;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new A(m)),u["text-size"].possiblyEvaluate(new A(y))]}if("composite"===t.iconSizeData.functionType){var _=t.iconSizeData.zoomRange,x=_.min,b=_.max;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new A(x)),u["icon-size"].possiblyEvaluate(new A(b))]}c.layoutTextSize=u["text-size"].possiblyEvaluate(new A(t.zoom+1)),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new A(t.zoom+1)),c.textMaxSize=u["text-size"].possiblyEvaluate(new A(18));for(var S=24*l.get("text-line-height"),T="map"===l.get("text-rotation-alignment")&&"line"===l.get("symbol-placement"),z=l.get("text-keep-upright"),E=0,k=t.features;E<k.length;E+=1){var C=k[E],I=l.get("text-font").evaluate(C).join(","),M=e[I]||{},P=r[I]||{},L={},D=C.text;if(D){var B=v.allowsVerticalWritingMode(D),R=l.get("text-offset").evaluate(C).map(function(t){return 24*t}),O=24*l.get("text-letter-spacing").evaluate(C),F=v.allowsLetterSpacing(D)?O:0,V=l.get("text-anchor").evaluate(C),j=l.get("text-justify").evaluate(C),N="line"!==l.get("symbol-placement")?24*l.get("text-max-width").evaluate(C):0;L.horizontal=p(D,M,N,S,V,j,F,R,24,f.horizontal),B&&T&&z&&(L.vertical=p(D,M,N,S,V,j,F,R,24,f.vertical))}var U=void 0;if(C.icon){var q=n[C.icon];q&&(U=h(o[C.icon],l.get("icon-offset").evaluate(C),l.get("icon-anchor").evaluate(C)),void 0===t.sdfIcons?t.sdfIcons=q.sdf:t.sdfIcons!==q.sdf&&g.warnOnce("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),q.pixelRatio!==t.pixelRatio?t.iconsNeedLinear=!0:0!==l.get("icon-rotate").constantOr(1)&&(t.iconsNeedLinear=!0))}(L.horizontal||U)&&i(t,C,L,U,P,c)}a&&t.generateCollisionDebugBuffers()}}},{"../data/bucket/symbol_bucket":51,"../data/extent":53,"../style/evaluation_parameters":182,"../util/classify_rings":255,"../util/find_pole_of_inaccessibility":261,"../util/script_detection":269,"../util/util":275,"./anchor":213,"./clip_line":215,"./collision_feature":216,"./get_anchors":219,"./opacity_state":222,"./quads":225,"./shaping":226,"@mapbox/point-geometry":4}],228:[function(t,e,r){"use strict";var i=t("../style-spec/expression").normalizePropertyExpression,n=t("../style-spec/util/interpolate"),o=t("../util/util");e.exports={getSizeData:function(t,e){var r=e.expression;if("constant"===r.kind)return{functionType:"constant",layoutSize:r.evaluate({zoom:t+1})};if("source"===r.kind)return{functionType:"source"};for(var i=r.zoomStops,n=0;n<i.length&&i[n]<=t;)n++;for(var o=n=Math.max(0,n-1);o<i.length&&i[o]<t+1;)o++;o=Math.min(i.length-1,o);var a={min:i[n],max:i[o]};return"composite"===r.kind?{functionType:"composite",zoomRange:a,propertyValue:e.value}:{functionType:"camera",layoutSize:r.evaluate({zoom:t+1}),zoomRange:a,sizeRange:{min:r.evaluate({zoom:a.min}),max:r.evaluate({zoom:a.max})},propertyValue:e.value}},evaluateSizeForFeature:function(t,e,r){var i=e;return"source"===t.functionType?r.lowerSize/10:"composite"===t.functionType?n.number(r.lowerSize/10,r.upperSize/10,i.uSizeT):i.uSize},evaluateSizeForZoom:function(t,e,r){if("constant"===t.functionType)return{uSizeT:0,uSize:t.layoutSize};if("source"===t.functionType)return{uSizeT:0,uSize:0};if("camera"===t.functionType){var n=t.propertyValue,a=t.zoomRange,s=t.sizeRange,l=i(n,r.specification),u=o.clamp(l.interpolationFactor(e,a.min,a.max),0,1);return{uSizeT:0,uSize:s.min+u*(s.max-s.min)}}var c=t.propertyValue,p=t.zoomRange,h=i(c,r.specification);return{uSizeT:o.clamp(h.interpolationFactor(e,p.min,p.max),0,1),uSize:0}}}},{"../style-spec/expression":139,"../style-spec/util/interpolate":158,"../util/util":275}],229:[function(t,e,r){"use strict";var i=t("../source/rtl_text_plugin");e.exports=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r);return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),i.applyArabicShaping&&(t=i.applyArabicShaping(t)),t}},{"../source/rtl_text_plugin":109}],230:[function(t,e,r){"use strict";var i=t("@mapbox/point-geometry"),n=t("../util/dom"),o=t("../util/window"),a=!!o.navigator.platform&&/iPad|iPhone|iPod/.test(o.navigator.platform),s={scrollZoom:t("./handler/scroll_zoom"),boxZoom:t("./handler/box_zoom"),dragRotate:t("./handler/drag_rotate"),dragPan:t("./handler/drag_pan"),keyboard:t("./handler/keyboard"),doubleClickZoom:t("./handler/dblclick_zoom"),touchZoomRotate:t("./handler/touch_zoom_rotate")};e.exports=function(t,e){function r(){f=null}function o(e,r){var i=n.mousePos(u,r);return t.fire(e,{lngLat:t.unproject(i),point:i,originalEvent:r})}function l(e,r){var o=n.touchPos(u,r),a=o.reduce(function(t,e,r,i){return t.add(e.div(i.length))},new i(0,0));return t.fire(e,{lngLat:t.unproject(a),point:a,lngLats:o.map(function(e){return t.unproject(e)},this),points:o,originalEvent:r})}var u=t.getCanvasContainer(),c=null,p=!1,h=null,f=null;for(var d in s)t[d]=new s[d](t,e),e.interactive&&e[d]&&t[d].enable(e[d]);n.addEventListener(u,"mouseout",function(t){o("mouseout",t)}),n.addEventListener(u,"mousedown",function(e){t.doubleClickZoom.isActive()||t.stop(),h=n.mousePos(u,e),o("mousedown",e),p=!0}),n.addEventListener(u,"mouseup",function(e){var r=t.dragRotate&&t.dragRotate.isActive();c&&!r&&o("contextmenu",c),c=null,p=!1,o("mouseup",e)}),n.addEventListener(u,"mousemove",function(e){if(!(t.dragPan&&t.dragPan.isActive()||t.dragRotate&&t.dragRotate.isActive())){for(var r=e.toElement||e.target;r&&r!==u;)r=r.parentNode;r===u&&o("mousemove",e)}}),n.addEventListener(u,"mouseover",function(t){for(var e=t.toElement||t.target;e&&e!==u;)e=e.parentNode;e===u&&o("mouseover",t)}),n.addEventListener(u,"touchstart",function(e){t.stop(),l("touchstart",e),!e.touches||1<e.touches.length||(f?(clearTimeout(f),f=null,o("dblclick",e)):f=setTimeout(r,300))},{passive:!0}),n.addEventListener(u,"touchmove",function(t){l("touchmove",t)},{passive:!a}),n.addEventListener(u,"touchend",function(t){l("touchend",t)}),n.addEventListener(u,"touchcancel",function(t){l("touchcancel",t)}),n.addEventListener(u,"click",function(t){n.mousePos(u,t).equals(h)&&o("click",t)}),n.addEventListener(u,"dblclick",function(t){o("dblclick",t),t.preventDefault()}),n.addEventListener(u,"contextmenu",function(e){var r=t.dragRotate&&t.dragRotate.isActive();p||r?p&&(c=e):o("contextmenu",e),e.preventDefault()})}},{"../util/dom":259,"../util/window":254,"./handler/box_zoom":239,"./handler/dblclick_zoom":240,"./handler/drag_pan":241,"./handler/drag_rotate":242,"./handler/keyboard":243,"./handler/scroll_zoom":244,"./handler/touch_zoom_rotate":245,"@mapbox/point-geometry":4}],231:[function(t,e,r){"use strict";var i=t("../util/util"),n=t("../style-spec/util/interpolate").number,o=t("../util/browser"),a=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("@mapbox/point-geometry"),u=function(t){function e(e,r){t.call(this),this.moving=!1,this.transform=e,this._bearingSnap=r.bearingSnap}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.getCenter=function(){return this.transform.center},e.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},e.prototype.panBy=function(t,e,r){return t=l.convert(t).mult(-1),this.panTo(this.transform.center,i.extend({offset:t},e),r)},e.prototype.panTo=function(t,e,r){return this.easeTo(i.extend({center:t},e),r)},e.prototype.getZoom=function(){return this.transform.zoom},e.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},e.prototype.zoomTo=function(t,e,r){return this.easeTo(i.extend({zoom:t},e),r)},e.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},e.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},e.prototype.getBearing=function(){return this.transform.bearing},e.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},e.prototype.rotateTo=function(t,e,r){return this.easeTo(i.extend({bearing:t},e),r)},e.prototype.resetNorth=function(t,e){return this.rotateTo(0,i.extend({duration:1e3},t),e),this},e.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},e.prototype.getPitch=function(){return this.transform.pitch},e.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},e.prototype.fitBounds=function(t,e,r){if("number"==typeof(e=i.extend({padding:{top:0,bottom:0,right:0,left:0},offset:[0,0],maxZoom:this.transform.maxZoom},e)).padding){var n=e.padding;e.padding={top:n,bottom:n,right:n,left:n}}if(!i.deepEqual(Object.keys(e.padding).sort(function(t,e){return t<e?-1:e<t?1:0}),["bottom","left","right","top"]))return i.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'"),this;t=s.convert(t);var o=[(e.padding.left-e.padding.right)/2,(e.padding.top-e.padding.bottom)/2],a=Math.min(e.padding.right,e.padding.left),u=Math.min(e.padding.top,e.padding.bottom);e.offset=[e.offset[0]+o[0],e.offset[1]+o[1]];var c=l.convert(e.offset),p=this.transform,h=p.project(t.getNorthWest()),f=p.project(t.getSouthEast()),d=f.sub(h),m=(p.width-2*a-2*Math.abs(c.x))/d.x,y=(p.height-2*u-2*Math.abs(c.y))/d.y;return y<0||m<0?(i.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset."),this):(e.center=p.unproject(h.add(f).div(2)),e.zoom=Math.min(p.scaleZoom(p.scale*Math.min(m,y)),e.maxZoom),e.bearing=0,e.linear?this.easeTo(e,r):this.flyTo(e,r))},e.prototype.jumpTo=function(t,e){this.stop();var r=this.transform,i=!1,n=!1,o=!1;return"zoom"in t&&r.zoom!==+t.zoom&&(i=!0,r.zoom=+t.zoom),void 0!==t.center&&(r.center=a.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(n=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(o=!0,r.pitch=+t.pitch),this.fire("movestart",e).fire("move",e),i&&this.fire("zoomstart",e).fire("zoom",e).fire("zoomend",e),n&&this.fire("rotate",e),o&&this.fire("pitchstart",e).fire("pitch",e).fire("pitchend",e),this.fire("moveend",e)},e.prototype.easeTo=function(t,e){var r=this;this.stop(),!1===(t=i.extend({offset:[0,0],duration:500,easing:i.ease},t)).animate&&(t.duration=0);var o=this.transform,s=this.getZoom(),u=this.getBearing(),c=this.getPitch(),p="zoom"in t?+t.zoom:s,h="bearing"in t?this._normalizeBearing(t.bearing,u):u,f="pitch"in t?+t.pitch:c,d=o.centerPoint.add(l.convert(t.offset)),m=o.pointLocation(d),y=a.convert(t.center||m);this._normalizeCenter(y);var _,g,v=o.project(m),x=o.project(y).sub(v),b=o.zoomScale(p-s);return t.around&&(_=a.convert(t.around),g=o.locationPoint(_)),this.zooming=p!==s,this.rotating=u!==h,this.pitching=f!==c,this._prepareEase(e,t.noMoveStart),clearTimeout(this._onEaseEnd),this._ease(function(t){if(r.zooming&&(o.zoom=n(s,p,t)),r.rotating&&(o.bearing=n(u,h,t)),r.pitching&&(o.pitch=n(c,f,t)),_)o.setLocationAtPoint(_,g);else{var i=o.zoomScale(o.zoom-s),a=s<p?Math.min(2,b):Math.max(.5,b),l=Math.pow(a,1-t),m=o.unproject(v.add(x.mult(t*l)).mult(i));o.setLocationAtPoint(o.renderWorldCopies?m.wrap():m,d)}r._fireMoveEvents(e)},function(){t.delayEndEvents?r._onEaseEnd=setTimeout(function(){return r._afterEase(e)},t.delayEndEvents):r._afterEase(e)},t),this},e.prototype._prepareEase=function(t,e){this.moving=!0,e||this.fire("movestart",t),this.zooming&&this.fire("zoomstart",t),this.pitching&&this.fire("pitchstart",t)},e.prototype._fireMoveEvents=function(t){this.fire("move",t),this.zooming&&this.fire("zoom",t),this.rotating&&this.fire("rotate",t),this.pitching&&this.fire("pitch",t)},e.prototype._afterEase=function(t){var e=this.zooming,r=this.pitching;this.moving=!1,this.zooming=!1,this.rotating=!1,this.pitching=!1,e&&this.fire("zoomend",t),r&&this.fire("pitchend",t),this.fire("moveend",t)},e.prototype.flyTo=function(t,e){function r(t){var e=(T*T-A*A+(t?-1:1)*C*C*z*z)/(2*(t?T:A)*C*z);return Math.log(Math.sqrt(e*e+1)-e)}function o(t){return(Math.exp(t)-Math.exp(-t))/2}function s(t){return(Math.exp(t)+Math.exp(-t))/2}var u=this;this.stop(),t=i.extend({offset:[0,0],speed:1.2,curve:1.42,easing:i.ease},t);var c=this.transform,p=this.getZoom(),h=this.getBearing(),f=this.getPitch(),d="zoom"in t?i.clamp(+t.zoom,c.minZoom,c.maxZoom):p,m="bearing"in t?this._normalizeBearing(t.bearing,h):h,y="pitch"in t?+t.pitch:f,_=c.zoomScale(d-p),g=c.centerPoint.add(l.convert(t.offset)),v=c.pointLocation(g),x=a.convert(t.center||v);this._normalizeCenter(x);var b=c.project(v),w=c.project(x).sub(b),S=t.curve,A=Math.max(c.width,c.height),T=A/_,z=w.mag();if("minZoom"in t){var E=i.clamp(Math.min(t.minZoom,p,d),c.minZoom,c.maxZoom),k=A/c.zoomScale(E-p);S=Math.sqrt(k/z*2)}var C=S*S,I=r(0),M=function(t){return s(I)/s(I+S*t)},P=function(t){return A*((s(I)*function(t){return o(t)/s(t)}(I+S*t)-o(I))/C)/z},L=(r(1)-I)/S;if(Math.abs(z)<1e-6||!isFinite(L)){if(Math.abs(A-T)<1e-6)return this.easeTo(t,e);var D=T<A?-1:1;L=Math.abs(Math.log(T/A))/S,P=function(){return 0},M=function(t){return Math.exp(D*S*t)}}if("duration"in t)t.duration=+t.duration;else{var B="screenSpeed"in t?+t.screenSpeed/S:+t.speed;t.duration=1e3*L/B}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this.zooming=!0,this.rotating=h!==m,this.pitching=y!==f,this._prepareEase(e,!1),this._ease(function(t){var r=t*L,i=1/M(r);c.zoom=p+c.scaleZoom(i),u.rotating&&(c.bearing=n(h,m,t)),u.pitching&&(c.pitch=n(f,y,t));var o=c.unproject(b.add(w.mult(P(r))).mult(i));c.setLocationAtPoint(c.renderWorldCopies?o.wrap():o,g),u._fireMoveEvents(e)},function(){return u._afterEase(e)},t),this},e.prototype.isEasing=function(){return!!this._isEasing},e.prototype.isMoving=function(){return this.moving},e.prototype.stop=function(){return this._onFrame&&this._finishAnimation(),this},e.prototype._ease=function(t,e,r){var i=this;!1===r.animate||0===r.duration?(t(1),e()):(this._easeStart=o.now(),this._isEasing=!0,this._easeOptions=r,this._startAnimation(function(e){var r=Math.min((o.now()-i._easeStart)/i._easeOptions.duration,1);t(i._easeOptions.easing(r)),1===r&&i.stop()},function(){i._isEasing=!1,e()}))},e.prototype._updateCamera=function(){this._onFrame&&this._onFrame(this.transform)},e.prototype._startAnimation=function(t,e){return void 0===e&&(e=function(){}),this.stop(),this._onFrame=t,this._finishFn=e,this._update(),this},e.prototype._finishAnimation=function(){delete this._onFrame;var t=this._finishFn;delete this._finishFn,t.call(this)},e.prototype._normalizeBearing=function(t,e){t=i.wrap(t,-180,180);var r=Math.abs(t-e);return Math.abs(t-360-e)<r&&(t-=360),Math.abs(t+360-e)<r&&(t+=360),t},e.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var r=t.lng-e.center.lng;t.lng+=180<r?-360:r<-180?360:0}},e}(t("../util/evented"));e.exports=u},{"../geo/lng_lat":62,"../geo/lng_lat_bounds":63,"../style-spec/util/interpolate":158,"../util/browser":252,"../util/evented":260,"../util/util":275,"@mapbox/point-geometry":4}],232:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/config"),a=function(t){this.options=t,n.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};a.prototype.getDefaultPosition=function(){return"bottom-right"},a.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),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},a.prototype.onRemove=function(){i.remove(this._container),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0},a.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var e=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:o.ACCESS_TOKEN}];if(t){var r=e.reduce(function(t,r,i){return r.value&&(t+=r.key+"="+r.value+(i<e.length-1?"&":"")),t},"?");t.href="https://www.mapbox.com/feedback/"+r+(this._map._hash?this._map._hash.getHashString(!0):"")}},a.prototype._updateData=function(t){t&&"metadata"===t.sourceDataType&&(this._updateAttributions(),this._updateEditLink())},a.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(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].getSource();n.attribution&&t.indexOf(n.attribution)<0&&t.push(n.attribution)}t.sort(function(t,e){return t.length-e.length}),(t=t.filter(function(e,r){for(var i=r+1;i<t.length;i++)if(0<=t[i].indexOf(e))return!1;return!0})).length?(this._container.innerHTML=t.join(" | "),this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null}},a.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")},e.exports=a},{"../../util/config":256,"../../util/dom":259,"../../util/util":275}],233:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/window"),a=function(){this._fullscreen=!1,n.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in o.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in o.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in o.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in o.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl"};a.prototype.onAdd=function(t){return this._map=t,this._mapContainer=this._map.getContainer(),this._container=i.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._container.style.display="none",n.warnOnce("This device does not support fullscreen mode.")),this._container},a.prototype.onRemove=function(){i.remove(this._container),this._map=null,o.document.removeEventListener(this._fullscreenchange,this._changeIcon)},a.prototype._checkFullscreenSupport=function(){return!!(o.document.fullscreenEnabled||o.document.mozFullScreenEnabled||o.document.msFullscreenEnabled||o.document.webkitFullscreenEnabled)},a.prototype._setupUI=function(){var t=this._fullscreenButton=i.create("button",this._className+"-icon "+this._className+"-fullscreen",this._container);t.setAttribute("aria-label","Toggle fullscreen"),t.type="button",this._fullscreenButton.addEventListener("click",this._onClickFullscreen),o.document.addEventListener(this._fullscreenchange,this._changeIcon)},a.prototype._isFullscreen=function(){return this._fullscreen},a.prototype._changeIcon=function(){(o.document.fullscreenElement||o.document.mozFullScreenElement||o.document.webkitFullscreenElement||o.document.msFullscreenElement)===this._mapContainer!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"))},a.prototype._onClickFullscreen=function(){this._isFullscreen()?o.document.exitFullscreen?o.document.exitFullscreen():o.document.mozCancelFullScreen?o.document.mozCancelFullScreen():o.document.msExitFullscreen?o.document.msExitFullscreen():o.document.webkitCancelFullScreen&&o.document.webkitCancelFullScreen():this._mapContainer.requestFullscreen?this._mapContainer.requestFullscreen():this._mapContainer.mozRequestFullScreen?this._mapContainer.mozRequestFullScreen():this._mapContainer.msRequestFullscreen?this._mapContainer.msRequestFullscreen():this._mapContainer.webkitRequestFullscreen&&this._mapContainer.webkitRequestFullscreen()},e.exports=a},{"../../util/dom":259,"../../util/util":275,"../../util/window":254}],234:[function(t,e,r){"use strict";var i,n=t("../../util/evented"),o=t("../../util/dom"),a=t("../../util/window"),s=t("../../util/util"),l=t("../../geo/lng_lat"),u=t("../marker"),c={positionOptions:{enableHighAccuracy:!1,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0},p=function(t){function e(e){t.call(this),this.options=s.extend({},c,e),s.bindAll(["_onSuccess","_onError","_finish","_setupUI","_updateCamera","_updateMarker","_onClickGeolocate"],this)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.onAdd=function(t){return this._map=t,this._container=o.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),function(t){void 0!==i?t(i):void 0!==a.navigator.permissions?a.navigator.permissions.query({name:"geolocation"}).then(function(e){i="denied"!==e.state,t(i)}):(i=!!a.navigator.geolocation,t(i))}(this._setupUI),this._container},e.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(a.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker.remove(),o.remove(this._container),this._map=void 0},e.prototype._onSuccess=function(t){if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("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(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire("geolocate",t),this._finish()},e.prototype._updateCamera=function(t){var e=new l(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy;this._map.fitBounds(e.toBounds(r),this.options.fitBoundsOptions,{geolocateSource:!0})},e.prototype._updateMarker=function(t){t?this._userLocationDotMarker.setLngLat([t.coords.longitude,t.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove()},e.prototype._onError=function(t){if(this.options.trackUserLocation)if(1===t.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"),void 0!==this._geolocationWatchID&&this._clearWatch();else switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire("error",t),this._finish()},e.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},e.prototype._setupUI=function(t){var e=this;!1!==t&&(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=o.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new u(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),this.options.trackUserLocation&&this._map.on("movestart",function(t){t.geolocateSource||"ACTIVE_LOCK"!==e._watchState||(e._watchState="BACKGROUND",e._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),e._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),e.fire("trackuserlocationend"))}))},e.prototype._onClickGeolocate=function(){if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire("trackuserlocationstart");break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":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("trackuserlocationend");break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire("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")}"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._geolocationWatchID=a.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions))}else a.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4)},e.prototype._clearWatch=function(){a.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)},e}(n);e.exports=p},{"../../geo/lng_lat":62,"../../util/dom":259,"../../util/evented":260,"../../util/util":275,"../../util/window":254,"../marker":248}],235:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=function(){n.bindAll(["_updateLogo"],this)};o.prototype.onAdd=function(t){this._map=t,this._container=i.create("div","mapboxgl-ctrl");var e=i.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.href="https://www.mapbox.com/",e.setAttribute("aria-label","Mapbox logo"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._container},o.prototype.onRemove=function(){i.remove(this._container),this._map.off("sourcedata",this._updateLogo)},o.prototype.getDefaultPosition=function(){return"bottom-left"},o.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},o.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}},e.exports=o},{"../../util/dom":259,"../../util/util":275}],236:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../handler/drag_rotate"),a={showCompass:!0,showZoom:!0},s=function(t){var e=this;this.options=n.extend({},a,t),this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this.options.showZoom&&(this._zoomInButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-in","Zoom In",function(){return e._map.zoomIn()}),this._zoomOutButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-out","Zoom Out",function(){return e._map.zoomOut()})),this.options.showCompass&&(n.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-compass","Reset North",function(){return e._map.resetNorth()}),this._compassArrow=i.create("span","mapboxgl-ctrl-compass-arrow",this._compass))};s.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},s.prototype.onAdd=function(t){return this._map=t,this.options.showCompass&&(this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new o(t,{button:"left",element:this._compass}),this._handler.enable()),this._container},s.prototype.onRemove=function(){i.remove(this._container),this.options.showCompass&&(this._map.off("rotate",this._rotateCompassArrow),this._handler.disable(),delete this._handler),delete this._map},s.prototype._createButton=function(t,e,r){var n=i.create("button",t,this._container);return n.type="button",n.setAttribute("aria-label",e),n.addEventListener("click",r),n},e.exports=s},{"../../util/dom":259,"../../util/util":275,"../handler/drag_rotate":242}],237:[function(t,e,r){"use strict";function n(t,e,r,i){var n=function(t){var e=Math.pow(10,(""+Math.floor(t)).length-1),r=t/e;return e*(10<=r?10:5<=r?5:3<=r?3:2<=r?2:1)}(r),o=n/r;"m"===i&&1e3<=n&&(n/=1e3,i="km"),t.style.width=e*o+"px",t.innerHTML=n+i}var o=t("../../util/dom"),a=t("../../util/util"),s=function(t){this.options=t,a.bindAll(["_onMove"],this)};s.prototype.getDefaultPosition=function(){return"bottom-left"},s.prototype._onMove=function(){!function(t,e,r){var i=r&&r.maxWidth||100,o=t._container.clientHeight/2,a=function(t,e){var r=Math.PI/180,i=t.lat*r,n=e.lat*r,o=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-t.lng)*r);return 6371e3*Math.acos(Math.min(o,1))}(t.unproject([0,o]),t.unproject([i,o]));if(r&&"imperial"===r.unit){var s=3.2808*a;5280<s?n(e,i,s/5280,"mi"):n(e,i,s,"ft")}else r&&"nautical"===r.unit?n(e,i,a/1852,"nm"):n(e,i,a,"m")}(this._map,this._container,this.options)},s.prototype.onAdd=function(t){return this._map=t,this._container=o.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},s.prototype.onRemove=function(){o.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},e.exports=s},{"../../util/dom":259,"../../util/util":275}],238:[function(t,e,r){},{}],239:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../geo/lng_lat_bounds"),o=t("../../util/util"),a=t("../../util/window"),s=function(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindAll(["_onMouseDown","_onMouseMove","_onMouseUp","_onKeyDown"],this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.isActive=function(){return!!this._active},s.prototype.enable=function(){this.isEnabled()||(this._map.dragPan&&this._map.dragPan.disable(),this._el.addEventListener("mousedown",this._onMouseDown,!1),this._map.dragPan&&this._map.dragPan.enable(),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},s.prototype._onMouseDown=function(t){t.shiftKey&&0===t.button&&(a.document.addEventListener("mousemove",this._onMouseMove,!1),a.document.addEventListener("keydown",this._onKeyDown,!1),a.document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},s.prototype._onMouseMove=function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),o=Math.max(e.x,r.x),a=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+a+"px)"),this._box.style.width=o-n+"px",this._box.style.height=s-a+"px"},s.prototype._onMouseUp=function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),o=(new n).extend(this._map.unproject(e)).extend(this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(o,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:o})}},s.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},s.prototype._finish=function(){this._active=!1,a.document.removeEventListener("mousemove",this._onMouseMove,!1),a.document.removeEventListener("keydown",this._onKeyDown,!1),a.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(i.remove(this._box),this._box=null),i.enableDrag()},s.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},e.exports=s},{"../../geo/lng_lat_bounds":63,"../../util/dom":259,"../../util/util":275,"../../util/window":254}],240:[function(t,e,r){"use strict";var i=t("../../util/util"),n=function(t){this._map=t,i.bindAll(["_onDblClick","_onZoomEnd"],this)};n.prototype.isEnabled=function(){return!!this._enabled},n.prototype.isActive=function(){return!!this._active},n.prototype.enable=function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},n.prototype.disable=function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},n.prototype._onDblClick=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},n.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)},e.exports=n},{"../../util/util":275}],241:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/window"),a=t("../../util/browser"),s=n.bezier(0,0,.3,1),l=function(t){this._map=t,this._el=t.getCanvasContainer(),n.bindAll(["_onDown","_onMove","_onUp","_onTouchEnd","_onMouseUp","_onDragFrame","_onDragFinished"],this)};l.prototype.isEnabled=function(){return!!this._enabled},l.prototype.isActive=function(){return!!this._active},l.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),i.addEventListener(this._el,"mousedown",this._onDown),i.addEventListener(this._el,"touchstart",this._onDown,{passive:!1}),this._enabled=!0)},l.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-drag-pan"),i.removeEventListener(this._el,"mousedown",this._onDown),i.removeEventListener(this._el,"touchstart",this._onDown,{passive:!1}),this._enabled=!1)},l.prototype._onDown=function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(i.addEventListener(o.document,"touchmove",this._onMove,{passive:!1}),i.addEventListener(o.document,"touchend",this._onTouchEnd)):(i.addEventListener(o.document,"mousemove",this._onMove),i.addEventListener(o.document,"mouseup",this._onMouseUp)),i.addEventListener(o,"blur",this._onMouseUp),this._active=!1,this._previousPos=i.mousePos(this._el,t),this._inertia=[[a.now(),this._previousPos]])},l.prototype._onMove=function(t){if(!this._ignoreEvent(t)){(this._lastMoveEvent=t).preventDefault();var e=i.mousePos(this._el,t);if(this._drainInertiaBuffer(),this._inertia.push([a.now(),e]),!this._previousPos)return void(this._previousPos=e);this._pos=e,this.isActive()||(this._active=!0,this._map.moving=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t),this._map._startAnimation(this._onDragFrame,this._onDragFinished)),this._map._update()}},l.prototype._onDragFrame=function(t){var e=this._lastMoveEvent;e&&(t.setLocationAtPoint(t.pointLocation(this._previousPos),this._pos),this._fireEvent("drag",e),this._fireEvent("move",e),this._previousPos=this._pos,delete this._lastMoveEvent)},l.prototype._onDragFinished=function(t){var e=this;if(this.isActive()){this._active=!1,delete this._lastMoveEvent,delete this._previousPos,delete this._pos,this._fireEvent("dragend",t),this._drainInertiaBuffer();var r=function(){e._map.moving=!1,e._fireEvent("moveend",t)},i=this._inertia;if(i.length<2)return void r();var n=i[i.length-1],o=i[0],a=n[1].sub(o[1]),l=(n[0]-o[0])/1e3;if(0===l||n[1].equals(o[1]))return void r();var u=a.mult(.3/l),c=u.mag();1400<c&&(c=1400,u._unit()._mult(c));var p=c/750,h=u.mult(-p/2);this._map.panBy(h,{duration:1e3*p,easing:s,noMoveStart:!0},{originalEvent:t})}},l.prototype._onUp=function(t){this._onDragFinished(t)},l.prototype._onMouseUp=function(t){this._ignoreEvent(t)||(this._onUp(t),i.removeEventListener(o.document,"mousemove",this._onMove),i.removeEventListener(o.document,"mouseup",this._onMouseUp),i.removeEventListener(o,"blur",this._onMouseUp))},l.prototype._onTouchEnd=function(t){this._ignoreEvent(t)||(this._onUp(t),i.removeEventListener(o.document,"touchmove",this._onMove,{passive:!1}),i.removeEventListener(o.document,"touchend",this._onTouchEnd))},l.prototype._fireEvent=function(t,e){return this._map.fire(t,e?{originalEvent:e}:{})},l.prototype._ignoreEvent=function(t){var e=this._map;return!(!e.boxZoom||!e.boxZoom.isActive())||!(!e.dragRotate||!e.dragRotate.isActive())||(t.touches?1<t.touches.length:!!t.ctrlKey||"mousemove"!==t.type&&t.button&&0!==t.button)},l.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=a.now();0<t.length&&160<e-t[0][0];)t.shift()},e.exports=l},{"../../util/browser":252,"../../util/dom":259,"../../util/util":275,"../../util/window":254}],242:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/window"),a=t("../../util/browser"),s=n.bezier(0,0,.25,1),l=function(t,e){this._map=t,this._el=e.element||t.getCanvasContainer(),this._button=e.button||"right",this._bearingSnap=e.bearingSnap||0,this._pitchWithRotate=!1!==e.pitchWithRotate,n.bindAll(["_onDown","_onMove","_onUp","_onDragFrame","_onDragFinished"],this)};l.prototype.isEnabled=function(){return!!this._enabled},l.prototype.isActive=function(){return!!this._active},l.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},l.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},l.prototype._onDown=function(t){if(!(this._map.boxZoom&&this._map.boxZoom.isActive()||this._map.dragPan&&this._map.dragPan.isActive()||this.isActive())){if("right"===this._button){var e=t.ctrlKey?0:2,r=t.button;if(void 0!==o.InstallTrigger&&2===t.button&&t.ctrlKey&&0<=o.navigator.platform.toUpperCase().indexOf("MAC")&&(r=0),r!==e)return}else if(t.ctrlKey||0!==t.button)return;i.disableDrag(),o.document.addEventListener("mousemove",this._onMove,{capture:!0}),o.document.addEventListener("mouseup",this._onUp),o.addEventListener("blur",this._onUp),this._active=!1,this._inertia=[[a.now(),this._map.getBearing()]],this._previousPos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint,t.preventDefault()}},l.prototype._onMove=function(t){this._lastMoveEvent=t;var e=i.mousePos(this._el,t);this._previousPos?(this._pos=e,this.isActive()||(this._active=!0,this._map.moving=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t),this._map._startAnimation(this._onDragFrame,this._onDragFinished)),this._map._update()):this._previousPos=e},l.prototype._onUp=function(t){o.document.removeEventListener("mousemove",this._onMove,{capture:!0}),o.document.removeEventListener("mouseup",this._onUp),o.removeEventListener("blur",this._onUp),i.enableDrag(),this._onDragFinished(t)},l.prototype._onDragFrame=function(t){var e=this._lastMoveEvent;if(e){var r=this._previousPos,i=this._pos,n=.8*(r.x-i.x),o=-.5*(r.y-i.y),s=t.bearing-n,l=t.pitch-o,u=this._inertia,c=u[u.length-1];this._drainInertiaBuffer(),u.push([a.now(),this._map._normalizeBearing(s,c[1])]),t.bearing=s,this._pitchWithRotate&&(this._fireEvent("pitch",e),t.pitch=l),this._fireEvent("rotate",e),this._fireEvent("move",e),delete this._lastMoveEvent,this._previousPos=this._pos}},l.prototype._onDragFinished=function(t){var e=this;if(this.isActive()){this._active=!1,delete this._lastMoveEvent,delete this._previousPos,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,i=r.getBearing(),n=this._inertia,o=function(){Math.abs(i)<e._bearingSnap?r.resetNorth({noMoveStart:!0},{originalEvent:t}):(e._map.moving=!1,e._fireEvent("moveend",t)),e._pitchWithRotate&&e._fireEvent("pitchend",t)};if(n.length<2)return void o();var a=n[0],l=n[n.length-1],u=n[n.length-2],c=r._normalizeBearing(i,u[1]),p=l[1]-a[1],h=p<0?-1:1,f=(l[0]-a[0])/1e3;if(0===p||0===f)return void o();var d=Math.abs(p*(.25/f));180<d&&(d=180);var m=d/180;c+=h*d*(m/2),Math.abs(r._normalizeBearing(c,0))<this._bearingSnap&&(c=r._normalizeBearing(0,c)),r.rotateTo(c,{duration:1e3*m,easing:s,noMoveStart:!0},{originalEvent:t})}},l.prototype._fireEvent=function(t,e){return this._map.fire(t,e?{originalEvent:e}:{})},l.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=a.now();0<t.length&&160<e-t[0][0];)t.shift()},e.exports=l},{"../../util/browser":252,"../../util/dom":259,"../../util/util":275,"../../util/window":254}],243:[function(t,e,r){"use strict";function i(t){return t*(2-t)}var n=t("../../util/util"),o=function(t){this._map=t,this._el=t.getCanvasContainer(),n.bindAll(["_onKeyDown"],this)};o.prototype.isEnabled=function(){return!!this._enabled},o.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},o.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},o.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,n=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(a=1,t.preventDefault());break;default:return}var s=this._map,l=s.getZoom(),u={duration:300,delayEndEvents:500,easing:i,zoom:e?Math.round(l)+e*(t.shiftKey?2:1):l,bearing:s.getBearing()+15*r,pitch:s.getPitch()+10*n,offset:[100*-o,100*-a],center:s.getCenter()};s.easeTo(u,{originalEvent:t})}},e.exports=o},{"../../util/util":275}],244:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/browser"),a=t("../../util/window"),s=t("../../style-spec/util/interpolate").number,l=t("../../geo/lng_lat"),u=a.navigator.userAgent.toLowerCase(),c=-1!==u.indexOf("firefox"),p=-1!==u.indexOf("safari")&&-1===u.indexOf("chrom"),h=function(t){this._map=t,this._el=t.getCanvasContainer(),this._delta=0,n.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};h.prototype.isEnabled=function(){return!!this._enabled},h.prototype.isActive=function(){return!!this._active},h.prototype.enable=function(t){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},h.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},h.prototype._onWheel=function(t){var e=0;"wheel"===t.type?(e=t.deltaY,c&&t.deltaMode===a.WheelEvent.DOM_DELTA_PIXEL&&(e/=o.devicePixelRatio),t.deltaMode===a.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,p&&(e/=3));var r=o.now(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==e&&e%4.000244140625==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":400<i?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,this.isActive()||this._start(t)),t.preventDefault()},h.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},h.prototype._start=function(t){if(this._delta){this._active=!0,this._map.moving=!0,this._map.zooming=!0,this._map.fire("movestart",{originalEvent:t}),this._map.fire("zoomstart",{originalEvent:t}),clearTimeout(this._finishTimeout);var e=i.mousePos(this._el,t);this._around=l.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(e)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._map._startAnimation(this._onScrollFrame,this._onScrollFinished)}},h.prototype._onScrollFrame=function(t){if(this.isActive()){if(0!==this._delta){var e="wheel"===this._type&&4.000244140625<Math.abs(this._delta)?1/450:.01,r=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==r&&(r=1/r);var i="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(i*r))),"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}if("wheel"===this._type){var n=Math.min((o.now()-this._lastWheelEventTime)/200,1),a=this._easing(n);t.zoom=s(this._startZoom,this._targetZoom,a),1===n&&this._map.stop()}else t.zoom=this._targetZoom,this._map.stop();t.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire("move",{originalEvent:this._lastWheelEvent}),this._map.fire("zoom",{originalEvent:this._lastWheelEvent})}},h.prototype._onScrollFinished=function(){var t=this;this.isActive()&&(this._active=!1,this._finishTimeout=setTimeout(function(){t._map.moving=!1,t._map.zooming=!1,t._map.fire("zoomend"),t._map.fire("moveend"),delete t._targetZoom},200))},h.prototype._smoothOutEasing=function(t){var e=n.ease;if(this._prevEase){var r=this._prevEase,i=(o.now()-r.start)/r.duration,a=r.easing(i+.01)-r.easing(i),s=.27/Math.sqrt(a*a+1e-4)*.01,l=Math.sqrt(.0729-s*s);e=n.bezier(s,l,.25,1)}return this._prevEase={start:o.now(),duration:t,easing:e},e},e.exports=h},{"../../geo/lng_lat":62,"../../style-spec/util/interpolate":158,"../../util/browser":252,"../../util/dom":259,"../../util/util":275,"../../util/window":254}],245:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/window"),a=t("../../util/browser"),s=n.bezier(0,0,.15,1),l=function(t){this._map=t,this._el=t.getCanvasContainer(),n.bindAll(["_onStart","_onMove","_onEnd"],this)};l.prototype.isEnabled=function(){return!!this._enabled},l.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),i.addEventListener(this._el,"touchstart",this._onStart,{passive:!1}),this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},l.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),i.removeEventListener(this._el,"touchstart",this._onStart,{passive:!1}),this._enabled=!1)},l.prototype.disableRotation=function(){this._rotationDisabled=!0},l.prototype.enableRotation=function(){this._rotationDisabled=!1},l.prototype._onStart=function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],i.addEventListener(o.document,"touchmove",this._onMove,{passive:!1}),i.addEventListener(o.document,"touchend",this._onEnd)}},l.prototype._onMove=function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),o=e.sub(r),s=o.mag()/this._startVec.mag(),l=this._rotationDisabled?0:180*o.angleWith(this._startVec)/Math.PI,u=this._map;if(this._gestureIntent){var c={duration:0,around:u.unproject(n)};"rotate"===this._gestureIntent&&(c.bearing=this._startBearing+l),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(c.zoom=u.transform.scaleZoom(this._startScale*s)),u.stop(),this._drainInertiaBuffer(),this._inertia.push([a.now(),s,n]),u.easeTo(c,{originalEvent:t})}else{var p=.15<Math.abs(1-s);10<Math.abs(l)?this._gestureIntent="rotate":p&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=o,this._startScale=u.transform.scale,this._startBearing=u.transform.bearing)}t.preventDefault()}},l.prototype._onEnd=function(t){i.removeEventListener(o.document,"touchmove",this._onMove,{passive:!1}),i.removeEventListener(o.document,"touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)r.snapToNorth({},{originalEvent:t});else{var n=e[e.length-1],a=e[0],l=r.transform.scaleZoom(this._startScale*n[1]),u=r.transform.scaleZoom(this._startScale*a[1]),c=l-u,p=(n[0]-a[0])/1e3,h=n[2];if(0!==p&&l!==u){var f=.15*c/p;2.5<Math.abs(f)&&(f=0<f?2.5:-2.5);var d=1e3*Math.abs(f/(12*.15)),m=l+f*d/2e3;m<0&&(m=0),r.easeTo({zoom:m,duration:d,easing:s,around:this._aroundCenter?r.getCenter():r.unproject(h)},{originalEvent:t})}else r.snapToNorth({},{originalEvent:t})}},l.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=a.now();2<t.length&&160<e-t[0][0];)t.shift()},e.exports=l},{"../../util/browser":252,"../../util/dom":259,"../../util/util":275,"../../util/window":254}],246:[function(t,e,r){"use strict";var i=t("../util/util"),n=t("../util/window"),o=t("../util/throttle"),a=function(){i.bindAll(["_onHashChange","_updateHash"],this),this._updateHash=o(this._updateHashUnthrottled.bind(this),300)};a.prototype.addTo=function(t){return this._map=t,n.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},a.prototype.remove=function(){return n.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},a.prototype.getHashString=function(t){var e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,i=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,i),o=Math.round(e.lng*n)/n,a=Math.round(e.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch(),u="";return u+=t?"#/"+o+"/"+a+"/"+r:"#"+r+"/"+a+"/"+o,(s||l)&&(u+="/"+Math.round(10*s)/10),l&&(u+="/"+Math.round(l)),u},a.prototype._onHashChange=function(){var t=n.location.hash.replace("#","").split("/");return 3<=t.length&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0),pitch:+(t[4]||0)}),!0)},a.prototype._updateHashUnthrottled=function(){var t=this.getHashString();n.history.replaceState("","",t)},e.exports=a},{"../util/throttle":272,"../util/util":275,"../util/window":254}],247:[function(t,e,r){"use strict";function i(t){t.parentNode&&t.parentNode.removeChild(t)}var n=t("../util/util"),o=t("../util/browser"),a=t("../util/window"),s=t("../util/window"),l=s.HTMLImageElement,u=s.HTMLElement,c=t("../util/dom"),p=t("../util/ajax"),h=t("../style/style"),f=t("../style/evaluation_parameters"),d=t("../render/painter"),m=t("../geo/transform"),y=t("./hash"),_=t("./bind_handlers"),g=t("./camera"),v=t("../geo/lng_lat"),x=t("../geo/lng_lat_bounds"),b=t("@mapbox/point-geometry"),w=t("./control/attribution_control"),S=t("./control/logo_control"),A=t("@mapbox/mapbox-gl-supported"),T=t("../util/image").RGBAImage;t("./events");var z={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:22,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,transformRequest:null,fadeDuration:300},E=function(t){function e(e){if(null!=(e=n.extend({},z,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than minZoom");var r=new m(e.minZoom,e.maxZoom,e.renderWorldCopies);t.call(this,r,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming;var i=e.transformRequest;if(this._transformRequest=i?function(t,e){return i(t,e)||{url:t}}:function(t){return{url:t}},"string"==typeof e.container){var o=a.document.getElementById(e.container);if(!o)throw new Error("Container '"+e.container+"' not found.");this._container=o}else{if(!(e.container instanceof u))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}e.maxBounds&&this.setMaxBounds(e.maxBounds),n.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored","_update","_render","_onData","_onDataLoading"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),void 0!==a&&(a.addEventListener("online",this._onWindowOnline,!1),a.addEventListener("resize",this._onWindowResize,!1)),_(this,e),this._hash=e.hash&&(new y).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),this.resize(),e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new w),this.addControl(new S,e.logoPosition),this.on("style.load",function(){this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",this._onData),this.on("dataloading",this._onDataLoading)}t&&(e.__proto__=t);var r={showTileBoundaries:{},showCollisionBoxes:{},showOverdrawInspector:{},repaint:{},vertices:{}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.addControl=function(t,e){void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right");var r=t.onAdd(this),i=this._controlPositions[e];return-1!==e.indexOf("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this},e.prototype.removeControl=function(t){return t.onRemove(this),this},e.prototype.resize=function(){var t=this._containerDimensions(),e=t[0],r=t[1];return this._resizeCanvas(e,r),this.transform.resize(e,r),this.painter.resize(e,r),this.fire("movestart").fire("move").fire("resize").fire("moveend")},e.prototype.getBounds=function(){var t=new x(this.transform.pointLocation(new b(0,this.transform.height)),this.transform.pointLocation(new b(this.transform.width,0)));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new b(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new b(0,this.transform.size.y)))),t},e.prototype.getMaxBounds=function(){return this.transform.latRange&&2===this.transform.latRange.length&&this.transform.lngRange&&2===this.transform.lngRange.length?new x([this.transform.lngRange[0],this.transform.latRange[0]],[this.transform.lngRange[1],this.transform.latRange[1]]):null},e.prototype.setMaxBounds=function(t){if(t){var e=x.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!=t||(this.transform.lngRange=null,this.transform.latRange=null,this._update());return this},e.prototype.setMinZoom=function(t){if(0<=(t=null==t?0:t)&&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 0 and the current maxZoom, inclusive")},e.prototype.getMinZoom=function(){return this.transform.minZoom},e.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")},e.prototype.getMaxZoom=function(){return this.transform.maxZoom},e.prototype.project=function(t){return this.transform.locationPoint(v.convert(t))},e.prototype.unproject=function(t){return this.transform.pointLocation(b.convert(t))},e.prototype.on=function(e,r,i){var o=this;if(void 0===i)return t.prototype.on.call(this,e,r);var a=function(){if("mouseenter"===e||"mouseover"===e){var t=!1;return{layer:r,listener:i,delegates:{mousemove:function(a){var s=o.getLayer(r)?o.queryRenderedFeatures(a.point,{layers:[r]}):[];s.length?t||(t=!0,i.call(o,n.extend({features:s},a,{type:e}))):t=!1},mouseout:function(){t=!1}}}}if("mouseleave"===e||"mouseout"===e){var a=!1;return{layer:r,listener:i,delegates:{mousemove:function(t){(o.getLayer(r)?o.queryRenderedFeatures(t.point,{layers:[r]}):[]).length?a=!0:a&&(a=!1,i.call(o,n.extend({},t,{type:e})))},mouseout:function(t){a&&(a=!1,i.call(o,n.extend({},t,{type:e})))}}}}var s;return{layer:r,listener:i,delegates:(s={},s[e]=function(t){var e=o.getLayer(r)?o.queryRenderedFeatures(t.point,{layers:[r]}):[];e.length&&i.call(o,n.extend({features:e},t))},s)}}();for(var s in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(a),a.delegates)o.on(s,a.delegates[s]);return this},e.prototype.off=function(e,r,i){if(void 0===i)return t.prototype.off.call(this,e,r);if(this._delegatedListeners&&this._delegatedListeners[e])for(var n=this._delegatedListeners[e],o=0;o<n.length;o++){var a=n[o];if(a.layer===r&&a.listener===i){for(var s in a.delegates)this.off(s,a.delegates[s]);return n.splice(o,1),this}}return this},e.prototype.queryRenderedFeatures=function(t,e){return 2===arguments.length?(t=t,e=e):1===arguments.length&&function(t){return t instanceof b||Array.isArray(t)}(t)?(t=t,e={}):1===arguments.length?e=t=void 0:(t=void 0,e={}),this.style?this.style.queryRenderedFeatures(this._makeQueryGeometry(t),e,this.transform.zoom,this.transform.angle):[]},e.prototype._makeQueryGeometry=function(t){var e,r=this;if(void 0===t&&(t=[b.convert([0,0]),b.convert([this.transform.width,this.transform.height])]),t instanceof b||"number"==typeof t[0])e=[b.convert(t)];else{var i=[b.convert(t[0]),b.convert(t[1])];e=[i[0],new b(i[1].x,i[0].y),i[1],new b(i[0].x,i[1].y),i[0]]}return e.map(function(t){return r.transform.pointCoordinate(t)})},e.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},e.prototype.setStyle=function(t,e){if((!e||!1!==e.diff&&!e.localIdeographFontFamily)&&this.style&&t&&"object"==typeof t)try{return this.style.setState(t)&&this._update(!0),this}catch(t){n.warnOnce("Unable to perform style diff: "+(t.message||t.error||t)+". Rebuilding the style from scratch.")}return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new h(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t)):delete this.style,this},e.prototype.getStyle=function(){if(this.style)return this.style.serialize()},e.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():n.warnOnce("There is no style added to the map.")},e.prototype.addSource=function(t,e){return this.style.addSource(t,e),this._update(!0),this},e.prototype.isSourceLoaded=function(t){var e=this.style&&this.style.sourceCaches[t];return void 0===e?void this.fire("error",{error:new Error("There is no source with ID '"+t+"'")}):e.loaded()},e.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},e.prototype.addSourceType=function(t,e,r){return this.style.addSourceType(t,e,r)},e.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0),this},e.prototype.getSource=function(t){return this.style.getSource(t)},e.prototype.addImage=function(t,e,r){void 0===r&&(r={});var i=r.pixelRatio;void 0===i&&(i=1);var n=r.sdf;if(void 0===n&&(n=!1),e instanceof l){var a=o.getImageData(e),s=a.width,u=a.height,c=a.data;this.style.addImage(t,{data:new T({width:s,height:u},c),pixelRatio:i,sdf:n})}else{if(void 0===e.width||void 0===e.height)return this.fire("error",{error:new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")});var p=e.width,h=e.height,f=e.data;this.style.addImage(t,{data:new T({width:p,height:h},f.slice(0)),pixelRatio:i,sdf:n})}},e.prototype.hasImage=function(t){return t?!!this.style.getImage(t):(this.fire("error",{error:new Error("Missing required image id")}),!1)},e.prototype.removeImage=function(t){this.style.removeImage(t)},e.prototype.loadImage=function(t,e){p.getImage(this._transformRequest(t,p.ResourceType.Image),e)},e.prototype.addLayer=function(t,e){return this.style.addLayer(t,e),this._update(!0),this},e.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0),this},e.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0),this},e.prototype.getLayer=function(t){return this.style.getLayer(t)},e.prototype.setFilter=function(t,e){return this.style.setFilter(t,e),this._update(!0),this},e.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},e.prototype.getFilter=function(t){return this.style.getFilter(t)},e.prototype.setPaintProperty=function(t,e,r){return this.style.setPaintProperty(t,e,r),this._update(!0),this},e.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},e.prototype.setLayoutProperty=function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},e.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},e.prototype.setLight=function(t){return this.style.setLight(t),this._update(!0),this},e.prototype.getLight=function(){return this.style.getLight()},e.prototype.getContainer=function(){return this._container},e.prototype.getCanvasContainer=function(){return this._canvasContainer},e.prototype.getCanvas=function(){return this._canvas},e.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),[t,e]},e.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSContainer=c.create("div","mapboxgl-missing-css",t)).innerHTML="Missing Mapbox GL JS CSS";var e=this._canvasContainer=c.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=c.create("canvas","mapboxgl-canvas",e),this._canvas.style.position="absolute",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 r=this._containerDimensions();this._resizeCanvas(r[0],r[1]);var i=this._controlContainer=c.create("div","mapboxgl-control-container",t),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=c.create("div","mapboxgl-ctrl-"+t,i)})},e.prototype._resizeCanvas=function(t,e){var r=a.devicePixelRatio||1;this._canvas.width=r*t,this._canvas.height=r*e,this._canvas.style.width=t+"px",this._canvas.style.height=e+"px"},e.prototype._setupPainter=function(){var t=n.extend({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer},A.webGLContextAttributes),e=this._canvas.getContext("webgl",t)||this._canvas.getContext("experimental-webgl",t);e?this.painter=new d(e,this.transform):this.fire("error",{error:new Error("Failed to initialize WebGL")})},e.prototype._contextLost=function(t){t.preventDefault(),this._frameId&&(o.cancelFrame(this._frameId),this._frameId=null),this.fire("webglcontextlost",{originalEvent:t})},e.prototype._contextRestored=function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},e.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},e.prototype._update=function(t){this.style&&(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender())},e.prototype._render=function(){this._updateCamera();var t=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var e=this.transform.zoom,r=o.now();this.style.zoomHistory.update(e,r);var i=new f(e,{now:r,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),n=i.crossFadingFactor();1===n&&n===this._crossFadingFactor||(t=!0,this._crossFadingFactor=n),this.style.update(i)}return 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.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.rotating,zooming:this.zooming,fadeDuration:this._fadeDuration}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this.style&&(this.style.hasTransitions()||t)&&(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty||this._placementDirty)&&this._rerender(),this},e.prototype.remove=function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this._frameId=null,this.setStyle(null),void 0!==a&&(a.removeEventListener("resize",this._onWindowResize,!1),a.removeEventListener("online",this._onWindowOnline,!1));var t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),i(this._canvasContainer),i(this._controlContainer),i(this._missingCSSContainer),this._container.classList.remove("mapboxgl-map"),this.fire("remove")},e.prototype._rerender=function(){var t=this;this.style&&!this._frameId&&(this._frameId=o.frame(function(){t._frameId=null,t._render()}))},e.prototype._onWindowOnline=function(){this._update()},e.prototype._onWindowResize=function(){this._trackResize&&this.stop().resize()._update()},r.showTileBoundaries.get=function(){return!!this._showTileBoundaries},r.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},r.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},r.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&((this._showCollisionBoxes=t)?this.style._generateCollisionBoxes():this._update())},r.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},r.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},r.repaint.get=function(){return!!this._repaint},r.repaint.set=function(t){this._repaint=t,this._update()},r.vertices.get=function(){return!!this._vertices},r.vertices.set=function(t){this._vertices=t,this._update()},e.prototype._onData=function(t){this._update("style"===t.dataType),this.fire(t.dataType+"data",t)},e.prototype._onDataLoading=function(t){this.fire(t.dataType+"dataloading",t)},Object.defineProperties(e.prototype,r),e}(g);e.exports=E},{"../geo/lng_lat":62,"../geo/lng_lat_bounds":63,"../geo/transform":64,"../render/painter":90,"../style/evaluation_parameters":182,"../style/style":190,"../util/ajax":251,"../util/browser":252,"../util/dom":259,"../util/image":263,"../util/util":275,"../util/window":254,"./bind_handlers":230,"./camera":231,"./control/attribution_control":232,"./control/logo_control":235,"./events":238,"./hash":246,"@mapbox/mapbox-gl-supported":3,"@mapbox/point-geometry":4}],248:[function(t,e,r){"use strict";var i=t("../util/dom"),n=t("../geo/lng_lat"),o=t("@mapbox/point-geometry"),a=t("../util/smart_wrap"),s=t("../util/util").bindAll,l=function(t,e){if(s(["_update","_onMapClick"],this),!t){t=i.create("div");var r=i.createNS("http://www.w3.org/2000/svg","svg");r.setAttributeNS(null,"height","41px"),r.setAttributeNS(null,"width","27px"),r.setAttributeNS(null,"viewBox","0 0 27 41");var n=i.createNS("http://www.w3.org/2000/svg","g");n.setAttributeNS(null,"stroke","none"),n.setAttributeNS(null,"stroke-width","1"),n.setAttributeNS(null,"fill","none"),n.setAttributeNS(null,"fill-rule","evenodd");var a=i.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"fill-rule","nonzero");var l=i.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var u=0,c=[{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"}];u<c.length;u+=1){var p=c[u],h=i.createNS("http://www.w3.org/2000/svg","ellipse");h.setAttributeNS(null,"opacity","0.04"),h.setAttributeNS(null,"cx","10.5"),h.setAttributeNS(null,"cy","5.80029008"),h.setAttributeNS(null,"rx",p.rx),h.setAttributeNS(null,"ry",p.ry),l.appendChild(h)}var f=i.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"fill","#3FB1CE");var d=i.createNS("http://www.w3.org/2000/svg","path");d.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(d);var m=i.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"fill","#000000");var y=i.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"),m.appendChild(y);var _=i.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(6.0, 7.0)"),_.setAttributeNS(null,"fill","#FFFFFF");var g=i.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(8.0, 8.0)");var v=i.createNS("http://www.w3.org/2000/svg","circle");v.setAttributeNS(null,"fill","#000000"),v.setAttributeNS(null,"opacity","0.25"),v.setAttributeNS(null,"cx","5.5"),v.setAttributeNS(null,"cy","5.5"),v.setAttributeNS(null,"r","5.4999962");var x=i.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"),g.appendChild(v),g.appendChild(x),a.appendChild(l),a.appendChild(f),a.appendChild(m),a.appendChild(_),a.appendChild(g),r.appendChild(a),t.appendChild(r);var b=[0,-14];e&&e.offset||(e?e.offset=b:e={offset:b})}this._offset=o.convert(e&&e.offset||[0,0]),t.classList.add("mapboxgl-marker"),this._element=t,this._popup=null};l.prototype.addTo=function(t){return this.remove(),(this._map=t).getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this._update(),this._map.on("click",this._onMapClick),this},l.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),delete this._map),i.remove(this._element),this._popup&&this._popup.remove(),this},l.prototype.getLngLat=function(){return this._lngLat},l.prototype.setLngLat=function(t){return this._lngLat=n.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},l.prototype.getElement=function(){return this._element},l.prototype.setPopup=function(t){return this._popup&&(this._popup.remove(),this._popup=null),t&&("offset"in t.options||(t.options.offset=this._offset),this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat)),this},l.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},l.prototype.getPopup=function(){return this._popup},l.prototype.togglePopup=function(){var t=this._popup;return t&&(t.isOpen()?t.remove():t.addTo(this._map)),this},l.prototype._update=function(t){this._map&&(this._map.transform.renderWorldCopies&&(this._lngLat=a(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset),t&&"moveend"!==t.type||(this._pos=this._pos.round()),i.setTransform(this._element,"translate(-50%, -50%) translate("+this._pos.x+"px, "+this._pos.y+"px)"))},l.prototype.getOffset=function(){return this._offset},l.prototype.setOffset=function(t){return this._offset=o.convert(t),this._update(),this},e.exports=l},{"../geo/lng_lat":62,"../util/dom":259,"../util/smart_wrap":270,"../util/util":275,"@mapbox/point-geometry":4}],249:[function(t,e,r){"use strict";var i=t("../util/util"),n=t("../util/evented"),o=t("../util/dom"),a=t("../geo/lng_lat"),s=t("@mapbox/point-geometry"),l=t("../util/window"),u=t("../util/smart_wrap"),c={closeButton:!0,closeOnClick:!0},p=function(t){function e(e){t.call(this),this.options=i.extend(Object.create(c),e),i.bindAll(["_update","_onClickClose"],this)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.addTo=function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},e.prototype.isOpen=function(){return!!this._map},e.prototype.remove=function(){return this._content&&o.remove(this._content),this._container&&(o.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},e.prototype.getLngLat=function(){return this._lngLat},e.prototype.setLngLat=function(t){return this._lngLat=a.convert(t),this._pos=null,this._update(),this},e.prototype.setText=function(t){return this.setDOMContent(l.document.createTextNode(t))},e.prototype.setHTML=function(t){var e,r=l.document.createDocumentFragment(),i=l.document.createElement("body");for(i.innerHTML=t;e=i.firstChild;)r.appendChild(e);return this.setDOMContent(r)},e.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},e.prototype._createContent=function(){this._content&&o.remove(this._content),this._content=o.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=o.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._onClickClose))},e.prototype._update=function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content)),this._map.transform.renderWorldCopies&&(this._lngLat=u(this._lngLat,this._pos,this._map.transform));var t=this._pos=this._map.project(this._lngLat),e=this.options.anchor,r=function t(e){if(e){if("number"==typeof e){var r=Math.round(Math.sqrt(.5*Math.pow(e,2)));return{top:new s(0,e),"top-left":new s(r,r),"top-right":new s(-r,r),bottom:new s(0,-e),"bottom-left":new s(r,-r),"bottom-right":new s(-r,-r),left:new s(e,0),right:new s(-e,0)}}if(e instanceof s||Array.isArray(e)){var i=s.convert(e);return{top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{top:s.convert(e.top||[0,0]),"top-left":s.convert(e["top-left"]||[0,0]),"top-right":s.convert(e["top-right"]||[0,0]),bottom:s.convert(e.bottom||[0,0]),"bottom-left":s.convert(e["bottom-left"]||[0,0]),"bottom-right":s.convert(e["bottom-right"]||[0,0]),left:s.convert(e.left||[0,0]),right:s.convert(e.right||[0,0])}}return t(new s(0,0))}(this.options.offset);if(!e){var i=this._container.offsetWidth,n=this._container.offsetHeight;e=t.y+r.bottom.y<n?["top"]:t.y>this._map.transform.height-n?["bottom"]:[],t.x<i/2?e.push("left"):t.x>this._map.transform.width-i/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var a=t.add(r[e]).round(),l={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%)"},c=this._container.classList;for(var p in l)c.remove("mapboxgl-popup-anchor-"+p);c.add("mapboxgl-popup-anchor-"+e),o.setTransform(this._container,l[e]+" translate("+a.x+"px,"+a.y+"px)")}},e.prototype._onClickClose=function(){this.remove()},e}(n);e.exports=p},{"../geo/lng_lat":62,"../util/dom":259,"../util/evented":260,"../util/smart_wrap":270,"../util/util":275,"../util/window":254,"@mapbox/point-geometry":4}],250:[function(t,e,r){"use strict";var i=t("./util"),n=t("./web_worker_transfer"),o=n.serialize,a=n.deserialize,s=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,i.bindAll(["receive"],this),this.target.addEventListener("message",this.receive,!1)};s.prototype.send=function(t,e,r,i){var n=r?this.mapId+":"+this.callbackID++:null;r&&(this.callbacks[n]=r);var a=[];this.target.postMessage({targetMapId:i,sourceMapId:this.mapId,type:t,id:String(n),data:o(e,a)},a)},s.prototype.receive=function(t){var e,r=this,i=t.data,n=i.id;if(!i.targetMapId||this.mapId===i.targetMapId){var s=function(t,e){var i=[];r.target.postMessage({sourceMapId:r.mapId,type:"<response>",id:String(n),error:t?String(t):null,data:o(e,i)},i)};if("<response>"===i.type)e=this.callbacks[i.id],delete this.callbacks[i.id],e&&i.error?e(new Error(i.error)):e&&e(null,a(i.data));else if(void 0!==i.id&&this.parent[i.type])this.parent[i.type](i.sourceMapId,a(i.data),s);else if(void 0!==i.id&&this.parent.getWorkerSource){var l=i.type.split(".");this.parent.getWorkerSource(i.sourceMapId,l[0])[l[1]](a(i.data),s)}else this.parent[i.type](a(i.data))}},s.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)},e.exports=s},{"./util":275,"./web_worker_transfer":278}],251:[function(t,e,r){"use strict";function i(t){var e=new o.XMLHttpRequest;for(var r in e.open("GET",t.url,!0),t.headers)e.setRequestHeader(r,t.headers[r]);return e.withCredentials="include"===t.credentials,e}function n(t){var e=o.document.createElement("a");return e.href=t,e.protocol===o.document.location.protocol&&e.host===o.document.location.host}var o=t("./window"),a={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};r.ResourceType=a,"function"==typeof Object.freeze&&Object.freeze(a);var s=function(t){function e(e,r){t.call(this,e),this.status=r}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(Error);r.getJSON=function(t,e){var r=i(t);return r.setRequestHeader("Accept","application/json"),r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if(200<=r.status&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new s(r.statusText,r.status))},r.send(),r},r.getArrayBuffer=function(t,e){var r=i(t);return r.responseType="arraybuffer",r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){var t=r.response;if(0===t.byteLength&&200===r.status)return e(new Error("http status 200 returned without content."));200<=r.status&&r.status<300&&r.response?e(null,{data:t,cacheControl:r.getResponseHeader("Cache-Control"),expires:r.getResponseHeader("Expires")}):e(new s(r.statusText,r.status))},r.send(),r},r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)e(t);else if(r){var i=new o.Image,n=o.URL||o.webkitURL;i.onload=function(){e(null,i),n.revokeObjectURL(i.src)};var a=new o.Blob([new Uint8Array(r.data)],{type:"image/png"});i.cacheControl=r.cacheControl,i.expires=r.expires,i.src=r.data.byteLength?n.createObjectURL(a):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}})},r.getVideo=function(t,e){var r=o.document.createElement("video");r.onloadstart=function(){e(null,r)};for(var i=0;i<t.length;i++){var a=o.document.createElement("source");n(t[i])||(r.crossOrigin="Anonymous"),a.src=t[i],r.appendChild(a)}return r}},{"./window":254}],252:[function(t,e,r){"use strict";var i=t("./window"),n=i.performance&&i.performance.now?i.performance.now.bind(i.performance):Date.now.bind(Date),o=i.requestAnimationFrame||i.mozRequestAnimationFrame||i.webkitRequestAnimationFrame||i.msRequestAnimationFrame,a=i.cancelAnimationFrame||i.mozCancelAnimationFrame||i.webkitCancelAnimationFrame||i.msCancelAnimationFrame;e.exports={now:n,frame:function(t){return o(t)},cancelFrame:function(t){return a(t)},getImageData:function(t){var e=i.document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(0,0,t.width,t.height)},hardwareConcurrency:i.navigator.hardwareConcurrency||4,get devicePixelRatio(){return i.devicePixelRatio},supportsWebp:!1};var s=i.document.createElement("img");s.onload=function(){e.exports.supportsWebp=!0},s.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="},{"./window":254}],253:[function(t,e,r){"use strict";var i=t("webworkify"),n=t("../window"),o=n.URL.createObjectURL(new i(t("../../source/worker"),{bare:!0}));e.exports=function(){return new n.Worker(o)}},{"../../source/worker":118,"../window":254,webworkify:36}],254:[function(t,e,r){"use strict";e.exports=self},{}],255:[function(t,e,r){"use strict";function i(t,e){return e.area-t.area}var n=t("quickselect"),o=t("./util").calculateSignedArea;e.exports=function(t,e){var r=t.length;if(r<=1)return[t];for(var a,s,l=[],u=0;u<r;u++){var c=o(t[u]);0!==c&&(t[u].area=Math.abs(c),void 0===s&&(s=c<0),s===c<0?(a&&l.push(a),a=[t[u]]):a.push(t[u]))}if(a&&l.push(a),1<e)for(var p=0;p<l.length;p++)l[p].length<=e||(n(l[p],e,1,l[p].length-1,i),l[p]=l[p].slice(0,e));return l}},{"./util":275,quickselect:31}],256:[function(t,e,r){"use strict";e.exports={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null}},{}],257:[function(t,e,r){"use strict";var i=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}};i.prototype.encode=function(t){return this._stringToNumber[t]},i.prototype.decode=function(t){return this._numberToString[t]},e.exports=i},{}],258:[function(t,e,r){"use strict";var i=t("./util"),n=t("./actor"),o=function(t,e){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=i.uniqueId();for(var r=this.workerPool.acquire(this.id),o=0;o<r.length;o++){var a=r[o],s=new n(a,e,this.id);s.name="Worker "+o,this.actors.push(s)}};o.prototype.broadcast=function(t,e,r){r=r||function(){},i.asyncAll(this.actors,function(r,i){r.send(t,e,i)},r)},o.prototype.send=function(t,e,r,i){return("number"!=typeof i||isNaN(i))&&(i=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[i].send(t,e,r),i},o.prototype.remove=function(){this.actors.forEach(function(t){t.remove()}),this.actors=[],this.workerPool.release(this.id)},e.exports=o},{"./actor":250,"./util":275}],259:[function(t,e,r){"use strict";function i(t){for(var e=0;e<t.length;e++)if(t[e]in s)return t[e];return t[0]}var n=t("@mapbox/point-geometry"),o=t("./window");r.create=function(t,e,r){var i=o.document.createElement(t);return e&&(i.className=e),r&&r.appendChild(i),i},r.createNS=function(t,e){return o.document.createElementNS(t,e)};var a,s=o.document.documentElement.style,l=i(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){l&&(a=s[l],s[l]="none")},r.enableDrag=function(){l&&(s[l]=a)};var u=i(["transform","WebkitTransform"]),c=!(r.setTransform=function(t,e){t.style[u]=e});try{var p=Object.defineProperty({},"passive",{get:function(){c=!0}});o.addEventListener("test",p,p),o.removeEventListener("test",p,p)}catch(t){c=!1}r.addEventListener=function(t,e,r,i){void 0===i&&(i={}),"passive"in i&&c?t.addEventListener(e,r,i):t.addEventListener(e,r,i.capture)},r.removeEventListener=function(t,e,r,i){void 0===i&&(i={}),"passive"in i&&c?t.removeEventListener(e,r,i):t.removeEventListener(e,r,i.capture)};var h=function(t){t.preventDefault(),t.stopPropagation(),o.removeEventListener("click",h,!0)};r.suppressClick=function(){o.addEventListener("click",h,!0),o.setTimeout(function(){o.removeEventListener("click",h,!0)},0)},r.mousePos=function(t,e){var r=t.getBoundingClientRect();return e=e.touches?e.touches[0]:e,new n(e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop)},r.touchPos=function(t,e){for(var r=t.getBoundingClientRect(),i=[],o="touchend"===e.type?e.changedTouches:e.touches,a=0;a<o.length;a++)i.push(new n(o[a].clientX-r.left-t.clientLeft,o[a].clientY-r.top-t.clientTop));return i},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)}},{"./window":254,"@mapbox/point-geometry":4}],260:[function(t,e,r){"use strict";function i(t,e,r){r[t]=r[t]||[],r[t].push(e)}function n(t,e,r){if(r&&r[t]){var i=r[t].indexOf(e);-1!==i&&r[t].splice(i,1)}}var o=t("./util"),a=function(){};a.prototype.on=function(t,e){return this._listeners=this._listeners||{},i(t,e,this._listeners),this},a.prototype.off=function(t,e){return n(t,e,this._listeners),n(t,e,this._oneTimeListeners),this},a.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},i(t,e,this._oneTimeListeners),this},a.prototype.fire=function(t,e){var r=this;if(this.listens(t)){e=o.extend({},e,{type:t,target:this});for(var i=0,a=this._listeners&&this._listeners[t]?this._listeners[t].slice():[];i<a.length;i+=1)a[i].call(r,e);for(var s=0,l=this._oneTimeListeners&&this._oneTimeListeners[t]?this._oneTimeListeners[t].slice():[];s<l.length;s+=1){var u=l[s];n(t,u,r._oneTimeListeners),u.call(r,e)}this._eventedParent&&this._eventedParent.fire(t,o.extend({},e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData))}else o.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event");return this},a.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&0<this._listeners[t].length||this._oneTimeListeners&&this._oneTimeListeners[t]&&0<this._oneTimeListeners[t].length||this._eventedParent&&this._eventedParent.listens(t)},a.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this},e.exports=a},{"./util":275}],261:[function(t,e,r){"use strict";function i(t,e){return e.max-t.max}function n(t,e,r,i){this.p=new a(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,l=o.length,u=l-1;a<l;u=a++){var c=o[a],p=o[u];c.y>t.y!=p.y>t.y&&t.x<(p.x-c.x)*(t.y-c.y)/(p.y-c.y)+c.x&&(r=!r),i=Math.min(i,s(t,c,p))}return(r?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}var o=t("tinyqueue"),a=t("@mapbox/point-geometry"),s=t("./intersection_tests").distToSegmentSquared;e.exports=function(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var s=1/0,l=1/0,u=-1/0,c=-1/0,p=t[0],h=0;h<p.length;h++){var f=p[h];(!h||f.x<s)&&(s=f.x),(!h||f.y<l)&&(l=f.y),(!h||f.x>u)&&(u=f.x),(!h||f.y>c)&&(c=f.y)}var d=u-s,m=c-l,y=Math.min(d,m),_=y/2,g=new o(null,i);if(0===y)return new a(s,l);for(var v=s;v<u;v+=y)for(var x=l;x<c;x+=y)g.push(new n(v+_,x+_,_,t));for(var b=function(t){for(var e=0,r=0,i=0,o=t[0],a=0,s=o.length,l=s-1;a<s;l=a++){var u=o[a],c=o[l],p=u.x*c.y-c.x*u.y;r+=(u.x+c.x)*p,i+=(u.y+c.y)*p,e+=3*p}return new n(r/e,i/e,0,t)}(t),w=g.length;g.length;){var S=g.pop();(S.d>b.d||!b.d)&&(b=S,r&&console.log("found best %d after %d probes",Math.round(1e4*S.d)/1e4,w)),S.max-b.d<=e||(_=S.h/2,g.push(new n(S.p.x-_,S.p.y-_,_,t)),g.push(new n(S.p.x+_,S.p.y-_,_,t)),g.push(new n(S.p.x-_,S.p.y+_,_,t)),g.push(new n(S.p.x+_,S.p.y+_,_,t)),w+=4)}return r&&(console.log("num probes: "+w),console.log("best distance: "+b.d)),b.p}},{"./intersection_tests":264,"@mapbox/point-geometry":4,tinyqueue:33}],262:[function(t,e,r){"use strict";var i,n=t("./worker_pool");e.exports=function(){return i||(i=new n),i}},{"./worker_pool":279}],263:[function(t,e,r){"use strict";function i(t,e,r,i){var n=e.width,o=e.height;if(i){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}function n(t,e,r){var n=e.width,a=e.height;if(n!==t.width||a!==t.height){var s=i({},{width:n,height:a},r);o(t,s,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,a)},r),t.width=n,t.height=a,t.data=s.data}}function o(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,p=0;p<n.width*o;p++)s[c+p]=a[u+p];return e}var a=t("./web_worker_transfer").register,s=function(t,e){i(this,t,1,e)};s.prototype.resize=function(t){n(this,t,1)},s.prototype.clone=function(){return new s({width:this.width,height:this.height},new Uint8Array(this.data))},s.copy=function(t,e,r,i,n){o(t,e,r,i,n,1)};var l=function(t,e){i(this,t,4,e)};l.prototype.resize=function(t){n(this,t,4)},l.prototype.clone=function(){return new l({width:this.width,height:this.height},new Uint8Array(this.data))},l.copy=function(t,e,r,i,n){o(t,e,r,i,n,4)},a("AlphaImage",s),a("RGBAImage",l),e.exports={AlphaImage:s,RGBAImage:l}},{"./web_worker_transfer":278}],264:[function(t,e,r){"use strict";function i(t,e,r){if(1<t.length){if(n(t,e))return!0;for(var i=0;i<e.length;i++)if(a(e[i],t,r))return!0}for(var o=0;o<t.length;o++)if(a(t[o],e,r))return!0;return!1}function n(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],a=0;a<e.length-1;a++)if(o(i,n,e[a],e[a+1]))return!0;return!1}function o(t,e,r,i){return c(t,r,i)!==c(e,r,i)&&c(t,e,r)!==c(t,e,i)}function a(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(s(t,e[n-1],e[n])<i)return!0;return!1}function s(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 n<0?t.distSqr(e):1<n?t.distSqr(r):t.distSqr(r.sub(e)._mult(n)._add(e))}function l(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],n=r[l],i.y>e.y!=n.y>e.y&&e.x<(n.x-i.x)*(e.y-i.y)/(n.y-i.y)+i.x&&(o=!o);return o}function u(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}var c=t("./util").isCounterClockwise;e.exports={multiPolygonIntersectsBufferedMultiPoint:function(t,e,r){for(var i=0;i<t.length;i++)for(var n=t[i],o=0;o<e.length;o++)for(var s=e[o],l=0;l<s.length;l++){var c=s[l];if(u(n,c))return!0;if(a(c,n,r))return!0}return!1},multiPolygonIntersectsMultiPolygon:function(t,e){if(1===t.length&&1===t[0].length)return l(e,t[0][0]);for(var r=0;r<e.length;r++)for(var i=e[r],o=0;o<i.length;o++)if(l(t,i[o]))return!0;for(var a=0;a<t.length;a++){for(var s=t[a],u=0;u<s.length;u++)if(l(e,s[u]))return!0;for(var c=0;c<e.length;c++)if(n(s,e[c]))return!0}return!1},multiPolygonIntersectsBufferedMultiLine:function(t,e,r){for(var n=0;n<e.length;n++)for(var o=e[n],a=0;a<t.length;a++){var s=t[a];if(3<=s.length)for(var l=0;l<o.length;l++)if(u(s,o[l]))return!0;if(i(s,o,r))return!0}return!1},polygonIntersectsPolygon:function(t,e){for(var r=0;r<t.length;r++)if(u(e,t[r]))return!0;for(var i=0;i<e.length;i++)if(u(t,e[i]))return!0;return!!n(t,e)},distToSegmentSquared:s}},{"./util":275}],265:[function(t,e,r){"use strict";e.exports={"Latin-1 Supplement":function(t){return 128<=t&&t<=255},Arabic:function(t){return 1536<=t&&t<=1791},"Arabic Supplement":function(t){return 1872<=t&&t<=1919},"Arabic Extended-A":function(t){return 2208<=t&&t<=2303},"Hangul Jamo":function(t){return 4352<=t&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return 5120<=t&&t<=5759},"Unified Canadian Aboriginal Syllabics Extended":function(t){return 6320<=t&&t<=6399},"General Punctuation":function(t){return 8192<=t&&t<=8303},"Letterlike Symbols":function(t){return 8448<=t&&t<=8527},"Number Forms":function(t){return 8528<=t&&t<=8591},"Miscellaneous Technical":function(t){return 8960<=t&&t<=9215},"Control Pictures":function(t){return 9216<=t&&t<=9279},"Optical Character Recognition":function(t){return 9280<=t&&t<=9311},"Enclosed Alphanumerics":function(t){return 9312<=t&&t<=9471},"Geometric Shapes":function(t){return 9632<=t&&t<=9727},"Miscellaneous Symbols":function(t){return 9728<=t&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return 11008<=t&&t<=11263},"CJK Radicals Supplement":function(t){return 11904<=t&&t<=12031},"Kangxi Radicals":function(t){return 12032<=t&&t<=12255},"Ideographic Description Characters":function(t){return 12272<=t&&t<=12287},"CJK Symbols and Punctuation":function(t){return 12288<=t&&t<=12351},Hiragana:function(t){return 12352<=t&&t<=12447},Katakana:function(t){return 12448<=t&&t<=12543},Bopomofo:function(t){return 12544<=t&&t<=12591},"Hangul Compatibility Jamo":function(t){return 12592<=t&&t<=12687},Kanbun:function(t){return 12688<=t&&t<=12703},"Bopomofo Extended":function(t){return 12704<=t&&t<=12735},"CJK Strokes":function(t){return 12736<=t&&t<=12783},"Katakana Phonetic Extensions":function(t){return 12784<=t&&t<=12799},"Enclosed CJK Letters and Months":function(t){return 12800<=t&&t<=13055},"CJK Compatibility":function(t){return 13056<=t&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return 13312<=t&&t<=19903},"Yijing Hexagram Symbols":function(t){return 19904<=t&&t<=19967},"CJK Unified Ideographs":function(t){return 19968<=t&&t<=40959},"Yi Syllables":function(t){return 40960<=t&&t<=42127},"Yi Radicals":function(t){return 42128<=t&&t<=42191},"Hangul Jamo Extended-A":function(t){return 43360<=t&&t<=43391},"Hangul Syllables":function(t){return 44032<=t&&t<=55215},"Hangul Jamo Extended-B":function(t){return 55216<=t&&t<=55295},"Private Use Area":function(t){return 57344<=t&&t<=63743},"CJK Compatibility Ideographs":function(t){return 63744<=t&&t<=64255},"Arabic Presentation Forms-A":function(t){return 64336<=t&&t<=65023},"Vertical Forms":function(t){return 65040<=t&&t<=65055},"CJK Compatibility Forms":function(t){return 65072<=t&&t<=65103},"Small Form Variants":function(t){return 65104<=t&&t<=65135},"Arabic Presentation Forms-B":function(t){return 65136<=t&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return 65280<=t&&t<=65519}}},{}],266:[function(t,e,r){"use strict";var i=function(t,e){this.max=t,this.onRemove=e,this.reset()};i.prototype.reset=function(){var t=this;for(var e in t.data)t.onRemove(t.data[e]);return this.data={},this.order=[],this},i.prototype.add=function(t,e){if(this.has(t))this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t);else if(this.data[t]=e,this.order.push(t),this.order.length>this.max){var r=this.getAndRemove(this.order[0]);r&&this.onRemove(r)}return this},i.prototype.has=function(t){return t in this.data},i.prototype.keys=function(){return this.order},i.prototype.getAndRemove=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},i.prototype.get=function(t){return this.has(t)?this.data[t]:null},i.prototype.remove=function(t){if(!this.has(t))return this;var e=this.data[t];return delete this.data[t],this.onRemove(e),this.order.splice(this.order.indexOf(t),1),this},i.prototype.setMaxSize=function(t){var e=this;for(this.max=t;this.order.length>this.max;){var r=e.getAndRemove(e.order[0]);r&&e.onRemove(r)}return this},e.exports=i},{}],267:[function(t,e,r){"use strict";function i(t,e){var r=o(s.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"/"!==r.path&&(t.path=""+r.path+t.path),!s.REQUIRE_ACCESS_TOKEN)return a(t);if(!(e=e||s.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+u);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+u);return t.params.push("access_token="+e),a(t)}function n(t){return 0===t.indexOf("mapbox:")}function o(t){var e=t.match(p);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 a(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}var s=t("./config"),l=t("./browser"),u="See https://www.mapbox.com/api-documentation/#access-tokens";r.isMapboxURL=n,r.normalizeStyleURL=function(t,e){if(!n(t))return t;var r=o(t);return r.path="/styles/v1"+r.path,i(r,e)},r.normalizeGlyphsURL=function(t,e){if(!n(t))return t;var r=o(t);return r.path="/fonts/v1"+r.path,i(r,e)},r.normalizeSourceURL=function(t,e){if(!n(t))return t;var r=o(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),i(r,e)},r.normalizeSpriteURL=function(t,e,r,s){var l=o(t);return n(t)?(l.path="/styles/v1"+l.path+"/sprite"+e+r,i(l,s)):(l.path+=""+e+r,a(l))};var c=/(\.(png|jpg)\d*)(?=$)/;r.normalizeTileURL=function(t,e,r){if(!e||!n(e))return t;var i=o(t),u=2<=l.devicePixelRatio||512===r?"@2x":"",p=l.supportsWebp?".webp":"$1";return i.path=i.path.replace(c,""+u+p),function(t){for(var e=0;e<t.length;e++)0===t[e].indexOf("access_token=tk.")&&(t[e]="access_token="+(s.ACCESS_TOKEN||""))}(i.params),a(i)};var p=/^(\w+):\/\/([^\/?]*)(\/[^?]+)?\??(.+)?/},{"./browser":252,"./config":256}],268:[function(t,e,r){"use strict";e.exports={getEntriesByName:function(t){return!(!performance||!performance.getEntriesByName)&&performance.getEntriesByName(t)}}},{}],269:[function(t,e,r){"use strict";var i=t("./is_char_in_unicode_block");e.exports.allowsIdeographicBreaking=function(t){for(var e=0,i=t;e<i.length;e+=1){var n=i[e];if(!r.charAllowsIdeographicBreaking(n.charCodeAt(0)))return!1}return!0},e.exports.allowsVerticalWritingMode=function(t){for(var e=0,i=t;e<i.length;e+=1){var n=i[e];if(r.charHasUprightVerticalOrientation(n.charCodeAt(0)))return!0}return!1},e.exports.allowsLetterSpacing=function(t){for(var e=0,i=t;e<i.length;e+=1){var n=i[e];if(!r.charAllowsLetterSpacing(n.charCodeAt(0)))return!1}return!0},e.exports.charAllowsLetterSpacing=function(t){return!(i.Arabic(t)||i["Arabic Supplement"](t)||i["Arabic Extended-A"](t)||i["Arabic Presentation Forms-A"](t)||i["Arabic Presentation Forms-B"](t))},e.exports.charAllowsIdeographicBreaking=function(t){return!(t<11904||!(i["Bopomofo Extended"](t)||i.Bopomofo(t)||i["CJK Compatibility Forms"](t)||i["CJK Compatibility Ideographs"](t)||i["CJK Compatibility"](t)||i["CJK Radicals Supplement"](t)||i["CJK Strokes"](t)||i["CJK Symbols and Punctuation"](t)||i["CJK Unified Ideographs Extension A"](t)||i["CJK Unified Ideographs"](t)||i["Enclosed CJK Letters and Months"](t)||i["Halfwidth and Fullwidth Forms"](t)||i.Hiragana(t)||i["Ideographic Description Characters"](t)||i["Kangxi Radicals"](t)||i["Katakana Phonetic Extensions"](t)||i.Katakana(t)||i["Vertical Forms"](t)||i["Yi Radicals"](t)||i["Yi Syllables"](t)))},r.charHasUprightVerticalOrientation=function(t){return!(746!==t&&747!==t&&(t<4352||!(i["Bopomofo Extended"](t)||i.Bopomofo(t)||i["CJK Compatibility Forms"](t)&&!(65097<=t&&t<=65103)||i["CJK Compatibility Ideographs"](t)||i["CJK Compatibility"](t)||i["CJK Radicals Supplement"](t)||i["CJK Strokes"](t)||!(!i["CJK Symbols and Punctuation"](t)||12296<=t&&t<=12305||12308<=t&&t<=12319||12336===t)||i["CJK Unified Ideographs Extension A"](t)||i["CJK Unified Ideographs"](t)||i["Enclosed CJK Letters and Months"](t)||i["Hangul Compatibility Jamo"](t)||i["Hangul Jamo Extended-A"](t)||i["Hangul Jamo Extended-B"](t)||i["Hangul Jamo"](t)||i["Hangul Syllables"](t)||i.Hiragana(t)||i["Ideographic Description Characters"](t)||i.Kanbun(t)||i["Kangxi Radicals"](t)||i["Katakana Phonetic Extensions"](t)||i.Katakana(t)&&12540!==t||!(!i["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||65306<=t&&t<=65310||65339===t||65341===t||65343===t||65371<=t&&t<=65503||65507===t||65512<=t&&t<=65519)||!(!i["Small Form Variants"](t)||65112<=t&&t<=65118||65123<=t&&t<=65126)||i["Unified Canadian Aboriginal Syllabics"](t)||i["Unified Canadian Aboriginal Syllabics Extended"](t)||i["Vertical Forms"](t)||i["Yijing Hexagram Symbols"](t)||i["Yi Syllables"](t)||i["Yi Radicals"](t))))},r.charHasNeutralVerticalOrientation=function(t){return!!(i["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||i["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)||i["Letterlike Symbols"](t)||i["Number Forms"](t)||i["Miscellaneous Technical"](t)&&(8960<=t&&t<=8967||8972<=t&&t<=8991||8996<=t&&t<=9e3||9003===t||9085<=t&&t<=9114||9150<=t&&t<=9165||9167===t||9169<=t&&t<=9179||9186<=t&&t<=9215)||i["Control Pictures"](t)&&9251!==t||i["Optical Character Recognition"](t)||i["Enclosed Alphanumerics"](t)||i["Geometric Shapes"](t)||i["Miscellaneous Symbols"](t)&&!(9754<=t&&t<=9759)||i["Miscellaneous Symbols and Arrows"](t)&&(11026<=t&&t<=11055||11088<=t&&t<=11097||11192<=t&&t<=11243)||i["CJK Symbols and Punctuation"](t)||i.Katakana(t)||i["Private Use Area"](t)||i["CJK Compatibility Forms"](t)||i["Small Form Variants"](t)||i["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||9984<=t&&t<=10087||10102<=t&&t<=10131||65532===t||65533===t)},r.charHasRotatedVerticalOrientation=function(t){return!(r.charHasUprightVerticalOrientation(t)||r.charHasNeutralVerticalOrientation(t))}},{"./is_char_in_unicode_block":265}],270:[function(t,e,r){"use strict";var i=t("../geo/lng_lat");e.exports=function(t,e,r){if(t=new i(t.lng,t.lat),e){var n=new i(t.lng-360,t.lat),o=new i(t.lng+360,t.lat),a=r.locationPoint(t).distSqr(e);r.locationPoint(n).distSqr(e)<a?t=n:r.locationPoint(o).distSqr(e)<a&&(t=o)}for(;180<Math.abs(t.lng-r.center.lng);){var s=r.locationPoint(t);if(0<=s.x&&0<=s.y&&s.x<=r.width&&s.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}},{"../geo/lng_lat":62}],271:[function(t,e,r){"use strict";function i(t,e){return Math.ceil(t/e)*e}var n={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},o=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};o.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},o.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},o.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},o.prototype.clear=function(){this.length=0},o.prototype.resize=function(t){this.reserve(t),this.length=t},o.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)}},o.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")},e.exports.StructArray=o,e.exports.Struct=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},e.exports.viewTypes=n,e.exports.createLayout=function(t,e){void 0===e&&(e=1);var r=0,o=0;return{members:t.map(function(t){var a=function(t){return n[t].BYTES_PER_ELEMENT}(t.type),s=r=i(r,Math.max(e,a)),l=t.components||1;return o=Math.max(o,a),r+=a*l,{name:t.name,type:t.type,components:l,offset:s}}),size:i(r,Math.max(o,e)),alignment:e}}},{}],272:[function(t,e,r){"use strict";e.exports=function(t,e){var r=!1,i=0,n=function(){i=0,r&&(t(),i=setTimeout(n,e),r=!1)};return function(){return r=!0,i||n(),i}}},{}],273:[function(t,e,r){"use strict";function i(t,e){if(t.row>e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function n(t,e,r,i,n){var o=Math.max(r,Math.floor(e.y0)),a=Math.min(i,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx<e.x1:t.x1-e.dy/t.dy*t.dx<e.x0){var s=t;t=e,e=s}for(var l=t.dx/t.dy,u=e.dx/e.dy,c=0<t.dx,p=e.dx<0,h=o;h<a;h++){var f=l*Math.max(0,Math.min(t.dy,h+c-t.y0))+t.x0,d=u*Math.max(0,Math.min(e.dy,h+p-e.y0))+e.x0;n(Math.floor(d),Math.ceil(f),h)}}function o(t,e,r,o,a,s){var l,u=i(t,e),c=i(e,r),p=i(r,t);u.dy>c.dy&&(l=u,u=c,c=l),u.dy>p.dy&&(l=u,u=p,p=l),c.dy>p.dy&&(l=c,c=p,p=l),u.dy&&n(p,u,o,a,s),c.dy&&n(p,c,o,a,s)}t("../geo/coordinate");var a=t("../source/tile_id").OverscaledTileID;e.exports=function(t,e,r,i){function n(e,n,o){var u,c,p;if(0<=o&&o<=s)for(u=e;u<n;u++)0!==(c=Math.floor(u/s))&&!0!==i||(p=new a(r,c,t,(u%s+s)%s,o),l[p.key]=p)}void 0===i&&(i=!0);var s=1<<t,l={};return o(e[0],e[1],e[2],0,s,n),o(e[2],e[3],e[0],0,s,n),Object.keys(l).map(function(t){return l[t]})}},{"../geo/coordinate":61,"../source/tile_id":114}],274:[function(t,e,r){"use strict";e.exports=function(t,e){return e.replace(/{([^{}]+)}/g,function(e,r){return r in t?String(t[r]):""})}},{}],275:[function(t,e,r){"use strict";var i=t("@mapbox/unitbezier"),n=t("../geo/coordinate");t("@mapbox/point-geometry"),r.easeCubicInOut=function(t){if(t<=0)return 0;if(1<=t)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,n){var o=new i(t,e,r,n);return function(t){return o.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n},r.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)})})},r.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},r.keysDifference=function(t,e){var r=[];for(var i in t)i in e||r.push(i);return r},r.extend=function(t){for(var e=[],r=arguments.length-1;0<r--;)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},r.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};var o=1;r.uniqueId=function(){return o++},r.bindAll=function(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})},r.getCoordinatesCenter=function(t){for(var e=1/0,r=1/0,i=-1/0,o=-1/0,a=0;a<t.length;a++)e=Math.min(e,t[a].column),r=Math.min(r,t[a].row),i=Math.max(i,t[a].column),o=Math.max(o,t[a].row);var s=i-e,l=o-r,u=Math.max(s,l),c=Math.max(0,Math.floor(-Math.log(u)/Math.LN2));return new n((e+i)/2,(r+o)/2,0).zoomTo(c)},r.endsWith=function(t,e){return-1!==t.indexOf(e,t.length-e.length)},r.mapObject=function(t,e,r){var i={};for(var n in t)i[n]=e.call(r||this,t[n],n,t);return i},r.filterObject=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},r.deepEqual=t("../style-spec/util/deep_equal"),r.clone=function(t){return Array.isArray(t)?t.map(r.clone):"object"==typeof t&&t?r.mapObject(t,r.clone):t},r.arraysIntersect=function(t,e){for(var r=0;r<t.length;r++)if(0<=e.indexOf(t[r]))return!0;return!1};var a={};r.warnOnce=function(t){a[t]||("undefined"!=typeof console&&console.warn(t),a[t]=!0)},r.isCounterClockwise=function(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)},r.calculateSignedArea=function(t){for(var e=0,r=0,i=t.length,n=i-1,o=void 0,a=void 0;r<i;n=r++)o=t[r],e+=((a=t[n]).x-o.x)*(o.y+a.y);return e},r.isClosedPolygon=function(t){if(t.length<4)return!1;var e=t[0],i=t[t.length-1];return!(0<Math.abs(e.x-i.x)||0<Math.abs(e.y-i.y))&&.01<Math.abs(r.calculateSignedArea(t))},r.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)}},r.parseCacheControl=function(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}},{"../geo/coordinate":61,"../style-spec/util/deep_equal":155,"@mapbox/point-geometry":4,"@mapbox/unitbezier":7}],276:[function(t,e,r){"use strict";var i=function(t,e,r,i){this.type="Feature",(this._vectorTileFeature=t)._z=e,t._x=r,t._y=i,this.properties=t.properties,null!=t.id&&(this.id=t.id)},n={geometry:{}};n.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},n.geometry.set=function(t){this._geometry=t},i.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(i.prototype,n),e.exports=i},{}],277:[function(t,e,r){"use strict";var i=t("./script_detection");e.exports=function(t){for(var r="",n=0;n<t.length;n++){var o=t.charCodeAt(n+1)||null,a=t.charCodeAt(n-1)||null;o&&i.charHasRotatedVerticalOrientation(o)&&!e.exports.lookup[t[n+1]]||a&&i.charHasRotatedVerticalOrientation(a)&&!e.exports.lookup[t[n-1]]||!e.exports.lookup[t[n]]?r+=t[n]:r+=e.exports.lookup[t[n]]}return r},e.exports.lookup={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"}},{"./script_detection":269}],278:[function(t,e,r){"use strict";function i(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),m[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}var n=t("grid-index"),o=t("../style-spec/util/color"),a=t("../style-spec/expression"),s=a.StylePropertyFunction,l=a.StyleExpression,u=a.StyleExpressionWithErrorHandling,c=a.ZoomDependentExpression,p=a.ZoomConstantExpression,h=t("../style-spec/expression/compound_expression").CompoundExpression,f=t("../style-spec/expression/definitions"),d=t("./window").ImageData,m={};for(var y in i("Object",Object),n.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),r},n.deserialize=function(t){return new n(t)},i("Grid",n),i("Color",o),i("StylePropertyFunction",s),i("StyleExpression",l,{omit:["_evaluator"]}),i("StyleExpressionWithErrorHandling",u,{omit:["_evaluator"]}),i("ZoomDependentExpression",c),i("ZoomConstantExpression",p),i("CompoundExpression",h,{omit:["_evaluate"]}),f)f[y]._classRegistryKey||i("Expression_"+y,f[y]);e.exports={register:i,serialize:function t(e,r){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(e instanceof ArrayBuffer)return r&&r.push(e),e;if(ArrayBuffer.isView(e)){var i=e;return r&&r.push(i.buffer),i}if(e instanceof d)return r&&r.push(e.data.buffer),e;if(Array.isArray(e)){for(var n=[],o=0,a=e;o<a.length;o+=1){var s=a[o];n.push(t(s,r))}return n}if("object"==typeof e){var l=e.constructor,u=l._classRegistryKey;if(!u)throw new Error("can't serialize object of unregistered class");var c={};if(l.serialize)c._serialized=l.serialize(e,r);else for(var p in e)if(e.hasOwnProperty(p)&&!(0<=m[u].omit.indexOf(p))){var h=e[p];c[p]=0<=m[u].shallow.indexOf(p)?h:t(h,r)}return{name:u,properties:c}}throw new Error("can't serialize object of type "+typeof e)},deserialize:function t(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||e instanceof d)return e;if(Array.isArray(e))return e.map(function(e){return t(e)});if("object"==typeof e){var r=e,i=r.name,n=r.properties;if(!i)throw new Error("can't deserialize object of anonymous class");var o=m[i].klass;if(!o)throw new Error("can't deserialize unregistered class "+i);if(o.deserialize)return o.deserialize(n._serialized);for(var a=Object.create(o.prototype),s=0,l=Object.keys(n);s<l.length;s+=1){var u=l[s];a[u]=0<=m[i].shallow.indexOf(u)?n[u]:t(n[u])}return a}throw new Error("can't deserialize object of type "+typeof e)}}},{"../style-spec/expression":139,"../style-spec/expression/compound_expression":123,"../style-spec/expression/definitions":131,"../style-spec/util/color":153,"./window":254,"grid-index":24}],279:[function(t,e,r){"use strict";var i=t("./web_worker"),n=function(){this.active={}};n.prototype.acquire=function(e){if(!this.workers){var r=t("../").workerCount;for(this.workers=[];this.workers.length<r;)this.workers.push(new i)}return this.active[e]=!0,this.workers.slice()},n.prototype.release=function(t){delete this.active[t],0===Object.keys(this.active).length&&(this.workers.forEach(function(t){t.terminate()}),this.workers=null)},e.exports=n},{"../":73,"./web_worker":253}]},{},[73])(73)})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,s=t.dataset.latitude,l=t.dataset.longitude,u=t.dataset.name,p=t.dataset.marker;if(""==p&&(p="circle"),e=null==u?{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[l,s]},properties:{title:"Current Location",icon:"circle-stroked",uri:"current-location"}}]}:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[l,s]},properties:{title:u,icon:p}}]},null!=a){var h=!0,f=!1,d=void 0;try{for(var m,y=a[Symbol.iterator]();!(h=(m=y.next()).done);h=!0){var _=m.value,g=(0,n.default)(_.location).longitude,v=(0,n.default)(_.location).latitude;e.features.push({type:"Feature",geometry:{type:"Point",coordinates:[g,v]},properties:{title:_.name,icon:"circle",uri:_.slug}})}}catch(t){f=!0,d=t}finally{try{h||null==y.return||y.return()}finally{if(f)throw d}}}null!=r&&(l=r.coords.longitude,s=r.coords.latitude);var x=new i.default.Map({container:t,style:"mapbox://styles/mapbox/streets-v9",center:[l,s],zoom:15});if(null==r&&x.scrollZoom.disable(),x.addControl(new i.default.NavigationControl),t.appendChild(c(x)),x.on("load",function(){x.addLayer({id:"points",type:"symbol",source:{type:"geojson",data:e},layout:{"icon-image":"{icon}-15","text-field":"{title}","text-offset":[0,1]}})}),null!=r&&x.on("click",function(t){var e=x.queryRenderedFeatures(t.point,{layer:["points"]});e.length&&(x.flyTo({center:e[0].geometry.coordinates}),(0,o.default)(e[0].properties.uri))}),e.features&&1<e.features.length){var b=new i.default.LngLatBounds,w=!0,S=!1,A=void 0;try{for(var T,z=e.features[Symbol.iterator]();!(w=(T=z.next()).done);w=!0){var E=T.value;b.extend(E.geometry.coordinates)}}catch(t){S=!0,A=t}finally{try{w||null==z.return||z.return()}finally{if(S)throw A}}x.fitBounds(b,{padding:65})}return x};var i=a(r(2)),n=a(r(1)),o=a(r(0));function a(t){return t&&t.__esModule?t:{default:t}}i.default.accessToken="pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiY2l2cDhjYW04MDAwcjJ0cG1uZnhqcm82ayJ9.qA2zeVA-nsoMh9IFrd5KQw";var l=function(t){var e=t._container.parentNode.querySelector(".u-url").getAttribute("href");return e.substr(e.lastIndexOf("/")+1)},u=function(t,e,r){var i=3<arguments.length&&void 0!==arguments[3]&&arguments[3],n=document.createElement("div"),o=document.createElement("input"),a=r+l(t);o.setAttribute("id",a),o.setAttribute("type","radio"),o.setAttribute("name","map"+l(t)),o.setAttribute("value",r),1==i&&o.setAttribute("checked","checked"),o.addEventListener("click",function(){var e=t.getSource("points");t.setStyle("mapbox://styles/mapbox/"+r+"-v9"),t.on("style.load",function(){t.addLayer({id:"points",type:"symbol",source:{type:"geojson",data:e._data},layout:{"icon-image":"{icon}-15","text-field":"{title}","text-offset":[0,1]}})})});var u=document.createElement("label");u.setAttribute("for",r+l(t)),u.appendChild(document.createTextNode(r.split("-").map(function(t){var e=function(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(t),r=e[0],i=e.slice(1);return r.toUpperCase()+i.join("").toLowerCase()}).join(" "))),n.appendChild(o),n.appendChild(u),e.appendChild(n)},c=function(t){var e=document.createElement("fieldset"),r=document.createElement("legend"),i=document.createTextNode("Map Style");return r.appendChild(i),e.appendChild(r),e.classList.add("map-menu"),u(t,e,"streets",!0),u(t,e,"satellite-streets"),e}},,,,,function(t,e,r){"use strict";var i,n=(i=r(3))&&i.__esModule?i:{default:i},o=document.querySelectorAll(".map"),a=!0,s=!1,l=void 0;try{for(var u,c=o[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var p=u.value;(0,n.default)(p)}}catch(t){s=!0,l=t}finally{try{a||null==c.return||c.return()}finally{if(s)throw l}}}]);
|
||
//# sourceMappingURL=maps.js.map
|