=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function xe(e,t){var r,n=(180+e[0])/360,o=(r=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),i=Math.pow(2,t.z);return[Math.round(n*i*8192),Math.round(o*i*8192)]}function ke(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function Se(e,t){for(var r,n,o,i,a,s,l,u=!1,c=0,p=t.length;c0&&p<0||c<0&&p>0}function Te(e,t,r){for(var n=0,o=r;nr[2]){var o=.5*n,i=e[0]-r[0]>o?-n:r[0]-e[0]>o?n:0;0===i&&(i=e[0]-r[2]>o?-n:r[2]-e[0]>o?n:0),e[0]+=i}be(t,e)}function Me(e,t,r,n){for(var o=8192*Math.pow(2,n.z),i=[8192*n.x,8192*n.y],a=[],s=0,l=e;s=0)return!1;var r=!0;return e.eachChild((function(e){r&&!Ne(e,t)&&(r=!1)})),r}Pe.parse=function(e,t){if(2!==e.length)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(oe(e[1])){var r=e[1];if("FeatureCollection"===r.type)for(var n=0;nt))throw new le("Input is not a number.");a=s-1}return 0}Le.prototype.parse=function(e,t,r,n,o){return void 0===o&&(o={}),t?this.concat(t,r,n)._parse(e,o):this._parse(e,o)},Le.prototype._parse=function(e,t){function r(e,t,r){return"assert"===r?new ce(t,[e]):"coerce"===r?new fe(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=e[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var o=this.registry[n];if(o){var i=o.parse(e,this);if(!i)return null;if(this.expectedType){var a=this.expectedType,s=i.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else i=r(i,a,t.typeAnnotation||"coerce");else i=r(i,a,t.typeAnnotation||"assert")}if(!(i instanceof se)&&"resolvedImage"!==i.type.kind&&function e(t){if(t instanceof Fe)return e(t.boundExpression);if(t instanceof ge&&"error"===t.name)return!1;if(t instanceof ve)return!1;if(t instanceof Pe)return!1;var r=t instanceof fe||t instanceof ce,n=!0;if(t.eachChild((function(t){n=r?n&&e(t):n&&t instanceof se})),!n)return!1;return Re(t)&&Ne(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(i)){var l=new me;try{i=new se(i.type,i.evaluate(l))}catch(e){return this.error(e.message),null}}return i}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof e+" instead.")},Le.prototype.concat=function(e,t,r){var n="number"==typeof e?this.path.concat(e):this.path,o=r?this.scope.concat(r):this.scope;return new Le(this.registry,n,t||null,o,this.errors)},Le.prototype.error=function(e){for(var t=arguments,r=[],n=arguments.length-1;n-- >0;)r[n]=t[n+1];var o=""+this.key+r.map((function(e){return"["+e+"]"})).join("");this.errors.push(new I(o,e))},Le.prototype.checkSubtype=function(e,t){var r=Y(e,t);return r&&this.error(r),r};var Ue=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var n=0,o=r;n=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=t.parse(s,u,o);if(!c)return null;o=o||c.type,n.push([a,c])}return new Ue(o,r,n)},Ue.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var o=t.length;return n>=t[o-1]?r[o-1].evaluate(e):r[De(t,n)].evaluate(e)},Ue.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var Be=Ge;function Ge(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=n,this.p2x=r,this.p2y=n}function Je(e,t,r){return e*(1-r)+t*r}Ge.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},Ge.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},Ge.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},Ge.prototype.solveCurveX=function(e,t){var r,n,o,i,a;for(void 0===t&&(t=1e-6),o=e,a=0;a<8;a++){if(i=this.sampleCurveX(o)-e,Math.abs(i)(n=1))return n;for(;ri?r=o:n=o,o=.5*(n-r)+r}return o},Ge.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var Ve=Object.freeze({__proto__:null,number:Je,color:function(e,t,r){return new X(Je(e.r,t.r,r),Je(e.g,t.g,r),Je(e.b,t.b,r),Je(e.a,t.a,r))},array:function(e,t,r){return e.map((function(e,n){return Je(e,t[n],r)}))}}),We=6/29,$e=3*We*We,Ye=Math.PI/180,He=180/Math.PI;function Ke(e){return e>.008856451679035631?Math.pow(e,1/3):e/$e+4/29}function Ze(e){return e>We?e*e*e:$e*(e-4/29)}function Xe(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Qe(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function et(e){var t=Qe(e.r),r=Qe(e.g),n=Qe(e.b),o=Ke((.4124564*t+.3575761*r+.1804375*n)/.95047),i=Ke((.2126729*t+.7151522*r+.072175*n)/1);return{l:116*i-16,a:500*(o-i),b:200*(i-Ke((.0193339*t+.119192*r+.9503041*n)/1.08883)),alpha:e.a}}function tt(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=1*Ze(t),r=.95047*Ze(r),n=1.08883*Ze(n),new X(Xe(3.2404542*r-1.5371385*t-.4985314*n),Xe(-.969266*r+1.8760108*t+.041556*n),Xe(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function rt(e,t,r){var n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var nt={forward:et,reverse:tt,interpolate:function(e,t,r){return{l:Je(e.l,t.l,r),a:Je(e.a,t.a,r),b:Je(e.b,t.b,r),alpha:Je(e.alpha,t.alpha,r)}}},ot={forward:function(e){var t=et(e),r=t.l,n=t.a,o=t.b,i=Math.atan2(o,n)*He;return{h:i<0?i+360:i,c:Math.sqrt(n*n+o*o),l:r,alpha:e.a}},reverse:function(e){var t=e.h*Ye,r=e.c;return tt({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:rt(e.h,t.h,r),c:Je(e.c,t.c,r),l:Je(e.l,t.l,r),alpha:Je(e.alpha,t.alpha,r)}}},it=Object.freeze({__proto__:null,lab:nt,hcl:ot}),at=function(e,t,r,n,o){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var i=0,a=o;i1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(o=t.parse(o,2,q)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=L:t.expectedType&&"value"!==t.expectedType.kind&&(u=t.expectedType);for(var c=0;c=p)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',h);var y=t.parse(d,f,u);if(!y)return null;u=u||y.type,l.push([p,y])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new at(u,r,n,o,l):t.error("Type "+W(u)+" is not interpolatable.")},at.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);var i=De(t,n),a=t[i],s=t[i+1],l=at.interpolationFactor(this.interpolation,n,a,s),u=r[i].evaluate(e),c=r[i+1].evaluate(e);return"interpolate"===this.operator?Ve[this.type.kind.toLowerCase()](u,c,l):"interpolate-hcl"===this.operator?ot.reverse(ot.interpolate(ot.forward(u),ot.forward(c),l)):nt.reverse(nt.interpolate(nt.forward(u),nt.forward(c),l))},at.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t=r.length)throw new le("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new le("Array index must be an integer, but found "+t+" instead.");return r[t]},ct.prototype.eachChild=function(e){e(this.index),e(this.input)},ct.prototype.outputDefined=function(){return!1},ct.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var pt=function(e,t){this.type=F,this.needle=e,this.haystack=t};pt.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,U),n=t.parse(e[2],2,U);return r&&n?H(r.type,[F,N,q,R,U])?new pt(r,n):t.error("Expected first argument to be of type boolean, string, number or null, but found "+W(r.type)+" instead"):null},pt.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!K(t,["boolean","string","number","null"]))throw new le("Expected first argument to be of type boolean, string, number or null, but found "+W(ie(t))+" instead.");if(!K(r,["string","array"]))throw new le("Expected second argument to be of type array or string, but found "+W(ie(r))+" instead.");return r.indexOf(t)>=0},pt.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},pt.prototype.outputDefined=function(){return!0},pt.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var dt=function(e,t,r){this.type=q,this.needle=e,this.haystack=t,this.fromIndex=r};dt.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,U),n=t.parse(e[2],2,U);if(!r||!n)return null;if(!H(r.type,[F,N,q,R,U]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+W(r.type)+" instead");if(4===e.length){var o=t.parse(e[3],3,q);return o?new dt(r,n,o):null}return new dt(r,n)},dt.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!K(t,["boolean","string","number","null"]))throw new le("Expected first argument to be of type boolean, string, number or null, but found "+W(ie(t))+" instead.");if(!K(r,["string","array"]))throw new le("Expected second argument to be of type array or string, but found "+W(ie(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)},dt.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},dt.prototype.outputDefined=function(){return!1},dt.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var ht=function(e,t,r,n,o,i){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=o,this.otherwise=i};ht.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var o={},i=[],a=2;aNumber.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,ie(d)))return null}else r=ie(d);if(void 0!==o[String(d)])return u.error("Branch labels must be unique.");o[String(d)]=i.length}var h=t.parse(l,a,n);if(!h)return null;n=n||h.type,i.push(h)}var f=t.parse(e[1],1,U);if(!f)return null;var y=t.parse(e[e.length-1],e.length-1,n);return y?"value"!==f.type.kind&&t.concat(1).checkSubtype(r,f.type)?null:new ht(r,n,f,o,i,y):null},ht.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(ie(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},ht.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},ht.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},ht.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],n={},o=0,i=Object.keys(this.cases).sort();o=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,U),n=t.parse(e[2],2,q);if(!r||!n)return null;if(!H(r.type,[V(U),N,U]))return t.error("Expected first argument to be of type array or string, but found "+W(r.type)+" instead");if(4===e.length){var o=t.parse(e[3],3,q);return o?new yt(r.type,r,n,o):null}return new yt(r.type,r,n)},yt.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!K(t,["string","array"]))throw new le("Expected first argument to be of type array or string, but found "+W(ie(t))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)},yt.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},yt.prototype.outputDefined=function(){return!1},yt.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var bt=vt("==",(function(e,t,r){return t===r}),gt),wt=vt("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!gt(0,t,r,n)})),xt=vt("<",(function(e,t,r){return t",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),St=vt("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),jt=vt(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0})),_t=function(e,t,r,n,o){this.type=N,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=o};_t.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,q);if(!r)return null;var n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");var o=null;if(n.locale&&!(o=t.parse(n.locale,1,N)))return null;var i=null;if(n.currency&&!(i=t.parse(n.currency,1,N)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=t.parse(n["min-fraction-digits"],1,q)))return null;var s=null;return n["max-fraction-digits"]&&!(s=t.parse(n["max-fraction-digits"],1,q))?null:new _t(r,o,i,a,s)},_t.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},_t.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},_t.prototype.outputDefined=function(){return!1},_t.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Tt=function(e){this.type=q,this.input=e};Tt.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error("Expected argument of type string or array, but found "+W(r.type)+" instead."):new Tt(r):null},Tt.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new le("Expected value to be of type string or array, but found "+W(ie(t))+" instead.")},Tt.prototype.eachChild=function(e){e(this.input)},Tt.prototype.outputDefined=function(){return!1},Tt.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var At={"==":bt,"!=":wt,">":kt,"<":xt,">=":jt,"<=":St,array:ce,at:ct,boolean:ce,case:ft,coalesce:lt,collator:ve,format:pe,image:de,in:pt,"index-of":dt,interpolate:at,"interpolate-hcl":at,"interpolate-lab":at,length:Tt,let:ut,literal:se,match:ht,number:ce,"number-format":_t,object:ce,slice:yt,step:Ue,string:ce,"to-boolean":fe,"to-color":fe,"to-number":fe,"to-string":fe,var:Fe,within:Pe};function zt(e,t){var r=t[0],n=t[1],o=t[2],i=t[3];r=r.evaluate(e),n=n.evaluate(e),o=o.evaluate(e);var a=i?i.evaluate(e):1,s=ne(r,n,o,a);if(s)throw new le(s);return new X(r/255*a,n/255*a,o/255*a,a)}function Ot(e,t){return e in t}function Et(e,t){var r=t[e];return void 0===r?null:r}function Ct(e){return{type:e}}function Mt(e){return{result:"success",value:e}}function It(e){return{result:"error",value:e}}function Pt(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function Rt(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function qt(e){return!!e.expression&&e.expression.interpolated}function Nt(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Ft(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Lt(e){return e}function Dt(e,t){var r,n,o,i="color"===t.type,a=e.stops&&"object"==typeof e.stops[0][0],s=a||void 0!==e.property,l=a||!s,u=e.type||(qt(t)?"exponential":"interval");if(i&&((e=M({},e)).stops&&(e.stops=e.stops.map((function(e){return[e[0],X.parse(e[1])]}))),e.default?e.default=X.parse(e.default):e.default=X.parse(t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!it[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===u)r=Jt;else if("interval"===u)r=Gt;else if("categorical"===u){r=Bt,n=Object.create(null);for(var c=0,p=e.stops;c=e.stops[n-1][0])return e.stops[n-1][1];var o=De(e.stops.map((function(e){return e[0]})),r);return e.stops[o][1]}function Jt(e,t,r){var n=void 0!==e.base?e.base:1;if("number"!==Nt(r))return Ut(e.default,t.default);var o=e.stops.length;if(1===o)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[o-1][0])return e.stops[o-1][1];var i=De(e.stops.map((function(e){return e[0]})),r),a=function(e,t,r,n){var o=n-r,i=e-r;return 0===o?0:1===t?i/o:(Math.pow(t,i)-1)/(Math.pow(t,o)-1)}(r,n,e.stops[i][0],e.stops[i+1][0]),s=e.stops[i][1],l=e.stops[i+1][1],u=Ve[t.type]||Lt;if(e.colorSpace&&"rgb"!==e.colorSpace){var c=it[e.colorSpace];u=function(e,t){return c.reverse(c.interpolate(c.forward(e),c.forward(t),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var e=arguments,t=[],r=arguments.length;r--;)t[r]=e[r];var n=s.evaluate.apply(void 0,t),o=l.evaluate.apply(void 0,t);if(void 0!==n&&void 0!==o)return u(n,o,a)}}:u(s,l,a)}function Vt(e,t,r){return"color"===t.type?r=X.parse(r):"formatted"===t.type?r=te.fromString(r.toString()):"resolvedImage"===t.type?r=re.fromString(r.toString()):Nt(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),Ut(r,e.default,t.default)}ge.register(At,{error:[{kind:"error"},[N],function(e,t){var r=t[0];throw new le(r.evaluate(e))}],typeof:[N,[U],function(e,t){return W(ie(t[0].evaluate(e)))}],"to-rgba":[V(q,4),[L],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[L,[q,q,q],zt],rgba:[L,[q,q,q,q],zt],has:{type:F,overloads:[[[N],function(e,t){return Ot(t[0].evaluate(e),e.properties())}],[[N,D],function(e,t){var r=t[0],n=t[1];return Ot(r.evaluate(e),n.evaluate(e))}]]},get:{type:U,overloads:[[[N],function(e,t){return Et(t[0].evaluate(e),e.properties())}],[[N,D],function(e,t){var r=t[0],n=t[1];return Et(r.evaluate(e),n.evaluate(e))}]]},"feature-state":[U,[N],function(e,t){return Et(t[0].evaluate(e),e.featureState||{})}],properties:[D,[],function(e){return e.properties()}],"geometry-type":[N,[],function(e){return e.geometryType()}],id:[U,[],function(e){return e.id()}],zoom:[q,[],function(e){return e.globals.zoom}],"heatmap-density":[q,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[q,[],function(e){return e.globals.lineProgress||0}],accumulated:[U,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[q,Ct(q),function(e,t){for(var r=0,n=0,o=t;n":[F,[N,U],function(e,t){var r=t[0],n=t[1],o=e.properties()[r.value],i=n.value;return typeof o==typeof i&&o>i}],"filter-id->":[F,[U],function(e,t){var r=t[0],n=e.id(),o=r.value;return typeof n==typeof o&&n>o}],"filter-<=":[F,[N,U],function(e,t){var r=t[0],n=t[1],o=e.properties()[r.value],i=n.value;return typeof o==typeof i&&o<=i}],"filter-id-<=":[F,[U],function(e,t){var r=t[0],n=e.id(),o=r.value;return typeof n==typeof o&&n<=o}],"filter->=":[F,[N,U],function(e,t){var r=t[0],n=t[1],o=e.properties()[r.value],i=n.value;return typeof o==typeof i&&o>=i}],"filter-id->=":[F,[U],function(e,t){var r=t[0],n=e.id(),o=r.value;return typeof n==typeof o&&n>=o}],"filter-has":[F,[U],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[F,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[F,[V(N)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[F,[V(U)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[F,[N,V(U)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[F,[N,V(U)],function(e,t){var r=t[0],n=t[1];return function(e,t,r,n){for(;r<=n;){var o=r+n>>1;if(t[o]===e)return!0;t[o]>e?n=o-1:r=o+1}return!1}(e.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:F,overloads:[[[F,F],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)&&n.evaluate(e)}],[Ct(F),function(e,t){for(var r=0,n=t;r0&&"string"==typeof e[0]&&e[0]in At}function Yt(e,t){var r=new Le(At,[],t?function(e){var t={color:L,string:N,number:q,enum:N,boolean:F,formatted:G,resolvedImage:J};if("array"===e.type)return V(t[e.value]||U,e.length);return t[e.type]}(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?Mt(new Wt(n,t)):It(r.errors)}Wt.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,o,i){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=i,this.expression.evaluate(this._evaluator)},Wt.prototype.evaluate=function(e,t,r,n,o,i){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=i||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new le("Expected value to be one of "+Object.keys(this._enumValues).map((function(e){return JSON.stringify(e)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}};var Ht=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!qe(t.expression)};Ht.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,o,i){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,i)},Ht.prototype.evaluate=function(e,t,r,n,o,i){return this._styleExpression.evaluate(e,t,r,n,o,i)};var Kt=function(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!qe(t.expression),this.interpolationType=n};function Zt(e,t){if("error"===(e=Yt(e,t)).result)return e;var r=e.value.expression,n=Re(r);if(!n&&!Pt(t))return It([new I("","data expressions not supported")]);var o=Ne(r,["zoom"]);if(!o&&!Rt(t))return It([new I("","zoom expressions not supported")]);var i=function e(t){var r=null;if(t instanceof ut)r=e(t.result);else if(t instanceof lt)for(var n=0,o=t.args;n3&&t===e[e.length-2]||(n&&2===e.length||e.push(t),e.push(r))}function ar(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function sr(e){for(var t=["concat"],r=/{([^{}]+)}/g,n=0,o=r.exec(e);null!==o;o=r.exec(e)){var i=e.slice(n,r.lastIndex-o[0].length);n=r.lastIndex,i.length>0&&t.push(i),t.push(["get",o[1]])}if(1===t.length)return e;if(n=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);tt?1:0}function dr(e){if(!e)return!0;var t,r=e[0];return e.length<=1?"any"!==r:"=="===r?hr(e[1],e[2],"=="):"!="===r?mr(hr(e[1],e[2],"==")):"<"===r||">"===r||"<="===r||">="===r?hr(e[1],e[2],r):"any"===r?(t=e.slice(1),["any"].concat(t.map(dr))):"all"===r?["all"].concat(e.slice(1).map(dr)):"none"===r?["all"].concat(e.slice(1).map(dr).map(mr)):"in"===r?fr(e[1],e.slice(2)):"!in"===r?mr(fr(e[1],e.slice(2))):"has"===r?yr(e[1]):"!has"===r?mr(yr(e[1])):"within"!==r||e}function hr(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function fr(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(e){return typeof e!=typeof t[0]}))?["filter-in-large",e,["literal",t.sort(pr)]]:["filter-in-small",e,["literal",t]]}}function yr(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function mr(e){return["!",e]}var gr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function vr(e,t){var r={};for(var n in e)"ref"!==n&&(r[n]=e[n]);return gr.forEach((function(e){e in t&&(r[e]=t[e])})),r}function br(e){e=e.slice();for(var t=Object.create(null),r=0;rn.maximum?[new wr(t,r,r+" is greater than the maximum value "+n.maximum)]:[]}function zr(e){var t,r,n,o=e.valueSpec,i=Sr(e.value.type),a={},s="categorical"!==i&&void 0===e.value.property,l=!s,u="array"===Nt(e.value.stops)&&"array"===Nt(e.value.stops[0])&&"object"===Nt(e.value.stops[0][0]),c=_r({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===i)return[new wr(e.key,e.value,'identity function may not have a "stops" property')];var t=[],r=e.value;t=t.concat(Tr({key:e.key,value:r,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:p})),"array"===Nt(r)&&0===r.length&&t.push(new wr(e.key,r,"array must have at least one stop"));return t},default:function(e){return Ur({key:e.key,value:e.value,valueSpec:o,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===i&&s&&c.push(new wr(e.key,e.value,'missing required property "property"')),"identity"===i||e.value.stops||c.push(new wr(e.key,e.value,'missing required property "stops"')),"exponential"===i&&e.valueSpec.expression&&!qt(e.valueSpec)&&c.push(new wr(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Pt(e.valueSpec)?c.push(new wr(e.key,e.value,"property functions not supported")):s&&!Rt(e.valueSpec)&&c.push(new wr(e.key,e.value,"zoom functions not supported"))),"categorical"!==i&&!u||void 0!==e.value.property||c.push(new wr(e.key,e.value,'"property" property is required')),c;function p(e){var t=[],i=e.value,s=e.key;if("array"!==Nt(i))return[new wr(s,i,"array expected, "+Nt(i)+" found")];if(2!==i.length)return[new wr(s,i,"array length 2 expected, length "+i.length+" found")];if(u){if("object"!==Nt(i[0]))return[new wr(s,i,"object expected, "+Nt(i[0])+" found")];if(void 0===i[0].zoom)return[new wr(s,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new wr(s,i,"object stop key must have value")];if(n&&n>Sr(i[0].zoom))return[new wr(s,i[0].zoom,"stop zoom values must appear in ascending order")];Sr(i[0].zoom)!==n&&(n=Sr(i[0].zoom),r=void 0,a={}),t=t.concat(_r({key:s+"[0]",value:i[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:Ar,value:d}}))}else t=t.concat(d({key:s+"[0]",value:i[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},i));return $t(jr(i[1]))?t.concat([new wr(s+"[1]",i[1],"expressions are not allowed in function stops.")]):t.concat(Ur({key:s+"[1]",value:i[1],valueSpec:o,style:e.style,styleSpec:e.styleSpec}))}function d(e,n){var s=Nt(e.value),l=Sr(e.value),u=null!==e.value?e.value:n;if(t){if(s!==t)return[new wr(e.key,u,s+" stop domain type must match previous stop domain type "+t)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new wr(e.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==i){var c="number expected, "+s+" found";return Pt(o)&&void 0===i&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new wr(e.key,u,c)]}return"categorical"!==i||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===s&&void 0!==r&&l":case">=":r.length>=2&&"$type"===Sr(r[1])&&a.push(new wr(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new wr(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(o=Nt(r[1]))&&a.push(new wr(n+"[1]",r[1],"string expected, "+o+" found"));for(var s=2;su&&_.push("'"+this.terminals_[k]+"'");A=d.showPosition?"Parse error on line "+(s+1)+":\n"+d.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(s+1)+": Unexpected "+(v==c?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(A,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:y,expected:_})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(w[0]){case 1:r.push(v),n.push(d.yytext),o.push(d.yylloc),r.push(w[1]),v=null,l=d.yyleng,a=d.yytext,s=d.yylineno,y=d.yylloc;break;case 2:if(S=this.productions_[w[1]][1],T.$=n[n.length-S],T._$={first_line:o[o.length-(S||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(S||1)].first_column,last_column:o[o.length-1].last_column},m&&(T._$.range=[o[o.length-(S||1)].range[0],o[o.length-1].range[1]]),void 0!==(x=this.performAction.apply(T,[a,l,s,h.yy,w[1],n,o].concat(p))))return x;S&&(r=r.slice(0,-1*S*2),n=n.slice(0,-1*S),o=o.slice(0,-1*S)),r.push(this.productions_[w[1]][0]),n.push(T.$),o.push(T._$),j=i[r[r.length-2]][r[r.length-1]],r.push(j);break;case 3:return!0}}return!0}},d={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var o=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[o[0],o[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,o;if(this.options.backtrack_lexer&&(o={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(o.yylloc.range=this.yylloc.range.slice(0))),(n=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in o)this[i]=o[i];return!1}return!1},next:function(){if(this.done)return this.EOF;var e,t,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),i=0;it[0].length)){if(t=r,n=i,this.options.backtrack_lexer){if(!1!==(e=this.test_match(r,o[i])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,o[n]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(e,t,r,n){switch(r){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function h(){this.yy={}}return p.lexer=d,h.prototype=p,p.Parser=h,new h}();void 0!==a&&(t.parser=r,t.Parser=r.Parser,t.parse=function(){return r.parse.apply(r,arguments)})}));Wr.parser,Wr.Parser,Wr.parse;function $r(e){if(e instanceof String||"string"==typeof e||e instanceof n)try{return Wr.parse(e.toString())}catch(e){throw new xr(e)}return e}function Yr(e,t){void 0===t&&(t=o);var r=e;try{r=$r(r)}catch(e){return[e]}return Gr(r,t)}var Hr={StyleExpression:Wt,isExpression:$t,isExpressionFilter:lr,createExpression:Yt,createPropertyExpression:Zt,normalizePropertyExpression:function(e,t){if(Ft(e))return new Xt(e,t);if($t(e)){var r=Zt(e,t);if("error"===r.result)throw new Error(r.value.map((function(e){return e.key+": "+e.message})).join(", "));return r.value}var n=e;return"string"==typeof e&&"color"===t.type&&(n=X.parse(e)),{kind:"constant",evaluate:function(){return n}}},ZoomConstantExpression:Ht,ZoomDependentExpression:Kt,StylePropertyFunction:Xt},Kr={convertFunction:er,createFunction:Dt,isFunction:Ft};Yr.parsed=Yr,Yr.latest=Yr}).call(this,r(15),r(24).Buffer)},function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t){e.exports=r},function(e,t){e.exports=n},function(e,t){var r={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},n=/(italic|oblique)$/i,o={};e.exports=function(e,t,i){var a=o[e];if(!a){Array.isArray(e)||(e=[e]);for(var s=400,l="normal",u=[],c=0,p=e.length;c
+ * @license MIT
+ */
+var n=r(25),o=r(26),i=r(27);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function f(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(n)return D(e).length;t=(""+t).toLowerCase(),n=!0}}function y(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return z(this,t,r);case"base64":return _(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,o);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,o){var i,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var c=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var p=!0,d=0;do&&(n=o):n=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function _(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o239?4:u>223?3:u>191?2:1;if(o+p<=r)switch(p){case 1:u<128&&(c=u);break;case 2:128==(192&(i=e[o+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(l=(15&u)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,p=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=p}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},l.prototype.compare=function(e,t,r,n,o){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(i,a),u=this.slice(n,o),c=e.slice(t,r),p=0;po)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return x(this,e,t,r);case"latin1":case"binary":return k(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;on)&&(r=n);for(var o="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,r,n,o,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function I(e,t,r,n){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-r,2);o>>8*(n?o:1-o)}function P(e,t,r,n){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-r,4);o>>8*(n?o:3-o)&255}function R(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function q(e,t,r,n,i){return i||R(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,i){return i||R(e,0,r,8),o.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(o*=256);)n+=this[e+--t]*o;return n},l.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var n=this[e],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||M(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);M(this,e,t,r,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);M(this,e,t,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return q(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return q(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--o)e[o+t]=this[o+r];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function U(e){return n.toByteArray(function(e){if((e=function(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function B(e,t,r,n){for(var o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}}).call(this,r(15))},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=u(e),a=n[0],s=n[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),c=0,p=s>0?a-4:a;for(r=0;r>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===s&&(t=o[e.charCodeAt(r)]<<2|o[e.charCodeAt(r+1)]>>4,l[c++]=255&t);1===s&&(t=o[e.charCodeAt(r)]<<10|o[e.charCodeAt(r+1)]<<4|o[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=0,s=r-o;as?s:a+16383));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var o,i,a=[],s=t;s>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,l=(1<>1,c=-7,p=r?o-1:0,d=r?-1:1,h=e[t+p];for(p+=d,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+e[t+p],p+=d,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+e[t+p],p+=d,c-=8);if(0===i)i=1-u;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=u}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,l,u=8*i-o-1,c=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,f=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+p>=1?d/l:d*Math.pow(2,1-p))*l>=2&&(a++,l/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(t*l-1)*Math.pow(2,o),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&s,h+=f,s/=256,o-=8);for(a=a<0;e[r+h]=255&a,h+=f,a/=256,u-=8);e[r+h-f]|=128*y}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";r.r(t);var n=r(5),o=r.n(n),i=r(1),a=r.n(i),s=r(2),l=r.n(s),u=r(3),c=r.n(u),p=r(7),d=r.n(p),h=r(16),f=r.n(h),y=r(17),m=r.n(y),g="Point";var v=0;var b,w=(b=function(e,t){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});!function(e){function t(t){var r=this,n="Assertion failed. See https://openlayers.org/en/"+("v"+"6.4.3".split("-")[0])+"/doc/errors/#"+t+" for details.";return(r=e.call(this,n)||this).code=t,r.name="AssertionError",r.message=n,r}w(t,e)}(Error);new Array(6);function x(e,t,r,n,o,i,a,s){var l=Math.sin(i),u=Math.cos(i);return e[0]=n*u,e[1]=o*l,e[2]=-n*l,e[3]=o*u,e[4]=a*n*u-s*n*l+t,e[5]=a*o*l+s*o*u+r,e}function k(e,t,r,n,o){return o?(o[0]=e,o[1]=t,o[2]=r,o[3]=n,o):[e,t,r,n]}function S(e){return k(1/0,1/0,-1/0,-1/0,e)}function j(e,t,r,n,o){return function(e,t,r,n,o){for(;rt?1:ei&&(u-s)*(i-l)-(o-s)*(c-l)>0&&a++:c<=i&&(u-s)*(i-l)-(o-s)*(c-l)<0&&a--,s=u,l=c}return 0!==a}function C(e,t,r,n,o,i){if(0===r.length)return!1;if(!E(e,t,r[0],n,o,i))return!1;for(var a=1,s=r.length;aw&&C(e,t,r,n,u=(c+p)/2,f)&&(b=u,w=x),c=p}return isNaN(b)&&(b=o[i]),a?(a.push(b,f,w),a):[b,f,w]}var I={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},P={};P[I.DEGREES]=2*Math.PI*6370997/360,P[I.FEET]=.3048,P[I.METERS]=1,P[I.USFEET]=1200/3937;var R=I,q=function(){function e(e){this.code_=e.code,this.units_=e.units,this.extent_=void 0!==e.extent?e.extent:null,this.worldExtent_=void 0!==e.worldExtent?e.worldExtent:null,this.axisOrientation_=void 0!==e.axisOrientation?e.axisOrientation:"enu",this.global_=void 0!==e.global&&e.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}return e.prototype.canWrapX=function(){return this.canWrapX_},e.prototype.getCode=function(){return this.code_},e.prototype.getExtent=function(){return this.extent_},e.prototype.getUnits=function(){return this.units_},e.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||P[this.units_]},e.prototype.getWorldExtent=function(){return this.worldExtent_},e.prototype.getAxisOrientation=function(){return this.axisOrientation_},e.prototype.isGlobal=function(){return this.global_},e.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!(!e||!this.extent_)},e.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},e.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},e.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!(!this.global_||!e)},e.prototype.setWorldExtent=function(e){this.worldExtent_=e},e.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},e.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},e}();var N="cosh"in Math?Math.cosh:function(e){var t=Math.exp(e);return(t+1/t)/2};"log2"in Math&&Math.log2;function F(e,t,r){return e+r*(t-e)}var L=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),D=6378137*Math.PI,U=[-D,-D,D,D],B=[-180,-85,180,85],G=function(e){function t(t){return e.call(this,{code:t,units:R.METERS,extent:U,global:!0,worldExtent:B,getPointResolution:function(e,t){return e/N(t[1]/6378137)}})||this}return L(t,e),t}(q),J=[new G("EPSG:3857"),new G("EPSG:102100"),new G("EPSG:102113"),new G("EPSG:900913"),new G("urn:ogc:def:crs:EPSG:6.18:3:3857"),new G("urn:ogc:def:crs:EPSG::3857"),new G("http://www.opengis.net/gml/srs/epsg.xml#3857")];function V(e,t,r){var n=e.length,o=r>1?r:2,i=t;void 0===i&&(i=o>2?e.slice():new Array(n));for(var a=D,s=0;sa?l=a:l<-a&&(l=-a),i[s+1]=l}return i}function W(e,t,r){var n=e.length,o=r>1?r:2,i=t;void 0===i&&(i=o>2?e.slice():new Array(n));for(var a=0;a>1)],t))<0?a=n+1:(s=n,l=!o);return l?a:~a}(h,g);v<0?(l=(g-h[-v-2])/(h[-v-1]-h[-v-2]),s=t+(-v-2)*n):s=t+v*n}var b=a>1?a:2,w=i||new Array(b);for(f=0;f0)},t.prototype.removeEventListener=function(e,t){var r=this.listeners_&&this.listeners_[e];if(r){var n=r.indexOf(t);-1!==n&&(this.pendingRemovals_&&e in this.pendingRemovals_?(r[n]=je,++this.pendingRemovals_[e]):(r.splice(n,1),0===r.length&&delete this.listeners_[e]))}},t}(Se),Ae=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();var ze=function(e){function t(){var t=e.call(this)||this;return t.revision_=0,t}return Ae(t,e),t.prototype.changed=function(){++this.revision_,this.dispatchEvent(be)},t.prototype.getRevision=function(){return this.revision_},t.prototype.on=function(e,t){if(Array.isArray(e)){for(var r=e.length,n=new Array(r),o=0;o=.05){for(var r="",n=e.split("\n"),o=et.slice(0,Math.round(t/.1)),i=0,a=n.length;i0&&(r+="\n"),r+=n[i].split("").join(o);return r}return e}function rt(){return Qe||(Qe=Xe(1,1).getContext("2d")),Qe}function nt(e,t){return rt().measureText(e).width+(e.length-1)*t}var ot={};function it(e,t,r,n){if(-1!==e.indexOf("\n")){for(var o=e.split("\n"),i=[],a=0,s=o.length;a1){var p=rt();p.font=t;for(var d=p.measureText("M").width*r,h="",f=[],y=0,m=c.length;y1;++b){var x=f[b];if(nt(x,n)<.35*d){var k=b>0?nt(f[b-1],n):1/0,S=b.7*d&&nt(A,n)<.6*d){var z=T.split(" "),O=z.pop();nt(O,n)<.2*d&&(f[j]=z.join(" "),f[j+1]=O+" "+A),_-=1}}u=f.join("\n")}else u=e;u=tt(u,n),ot[l]=u}return u}Ue&&me(Ue,we,(function(){ot={}}));var at,st,lt=ye.e.isFunction,ut=ye.e.convertFunction,ct=ye.c.isExpression,pt=ye.c.createPropertyExpression,dt={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},ht={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},ft={},yt={zoom:0},mt={};function gt(e,t,r,n,o){var i=e.id;mt[i]||(mt[i]={});var a=mt[i];if(!a[r]){var s=(e[t]||ft)[r],l=ye.f[t+"_"+e.type][r];void 0===s&&(s=l.default);var u=ct(s);if(!u&<(s)&&(s=ut(s,l),u=!0),u){var c=function(e,t){var r=pt(e,t);if("error"===r.result)throw new Error(r.value.map((function(e){return e.key+": "+e.message})).join(", "));return r.value}(s,l);a[r]=c.evaluate.bind(c)}else"color"==l.type&&(s=ye.a.parse(s)),a[r]=function(){return s}}return yt.zoom=n,a[r](yt,o)}var vt={};function bt(e,t,r,n){return e in vt||(vt[e]=Object(ye.d)(t).filter),yt.zoom=n,vt[e](yt,r)}function wt(e,t){if(e){if(0===e.a||0===t)return;var r=e.a;return t=void 0===t?1:t,"rgba("+Math.round(255*e.r/r)+","+Math.round(255*e.g/r)+","+Math.round(255*e.b/r)+","+r*t+")"}return e}var xt=/^([^]*)\{(.*)\}([^]*)$/;function kt(e,t){var r;do{if(r=e.match(xt)){var n=t[r[2]]||"";e=r[1]+n+r[3]}}while(r);return e}var St,jt=function(e,t,r,n,i,s,u){if(void 0===n&&(n=Ze),"string"==typeof t&&(t=JSON.parse(t)),8!=t.version)throw new Error("glStyle version 8 required.");var p,h;if(s)if("undefined"!=typeof Image){var y=new Image;y.crossOrigin="anonymous",y.onload=function(){p=y,h=[y.width,y.height],e.changed(),y.onload=null},y.src=s}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var g=self;g.postMessage({action:"loadImage",src:s}),g.addEventListener("message",(function(e){"imageLoaded"===e.data.action&&e.data.src===s&&(p=e.data.image,h=[p.width,p.height])}))}for(var v,b=Object(ye.b)(t.layers),w={},x=[],k=0,S=b.length;k=j.maxzoom)){var z=j.filter;if(!z||bt(_,z,v,y)){var O=void 0,R=void 0,q=void 0,N=void 0,F=void 0,L=void 0,D=S.index;if(3==g&&"fill"==j.type)if(R=gt(j,"paint","fill-opacity",y,v),"fill-pattern"in A){var U=gt(j,"paint","fill-pattern",y,v);if(U){var B="string"==typeof U?kt(U,r):U.toString();if(p&&i&&i[B]){++b,(L=P[b])&&L.getFill()&&!L.getStroke()&&!L.getText()||(L=P[b]=new a.a({fill:new l.a})),q=L.getFill(),L.setZIndex(D);var G=B+"."+R,J=I[G];if(!J){var V=i[B],W=Xe(V.width,V.height),$=W.getContext("2d");$.globalAlpha=R,$.drawImage(p,V.x,V.y,V.width,V.height,0,0,V.width,V.height),J=$.createPattern(W,"repeat"),I[G]=J}q.setColor(J)}}}else(O=wt(gt(j,"paint","fill-color",y,v),R))&&("fill-outline-color"in A&&(F=wt(gt(j,"paint","fill-outline-color",y,v),R)),F||(F=O),++b,(L=P[b])&&L.getFill()&&L.getStroke()&&!L.getText()||(L=P[b]=new a.a({fill:new l.a,stroke:new c.a})),(q=L.getFill()).setColor(O),(N=L.getStroke()).setColor(F),N.setWidth(1),L.setZIndex(D));if(1!=g&&"line"==j.type){O=!("line-pattern"in A)&&"line-color"in A?wt(gt(j,"paint","line-color",y,v),gt(j,"paint","line-opacity",y,v)):void 0;var Y=gt(j,"paint","line-width",y,v);O&&Y>0&&(++b,(L=P[b])&&L.getStroke()&&!L.getFill()&&!L.getText()||(L=P[b]=new a.a({stroke:new c.a})),(N=L.getStroke()).setLineCap(gt(j,"layout","line-cap",y,v)),N.setLineJoin(gt(j,"layout","line-join",y,v)),N.setMiterLimit(gt(j,"layout","line-miter-limit",y,v)),N.setColor(O),N.setWidth(Y),N.setLineDash(A["line-dasharray"]?gt(j,"paint","line-dasharray",y,v).map((function(e){return e*Y})):null),L.setZIndex(D))}var H=!1,K=null,Z=0,X=void 0,Q=void 0,ee=void 0;if((1==g||2==g)&&"icon-image"in T){var te=gt(j,"layout","icon-image",y,v);if(te){X="string"==typeof te?kt(te,r):te.toString();var re=void 0;if(p&&i&&i[X]){var ne=gt(j,"layout","icon-rotation-alignment",y,v);if(2==g){var oe=e.getGeometry();if(oe.getFlatMidpoint||oe.getFlatMidpoints){var ie=oe.getExtent();if(Math.sqrt(Math.max(Math.pow((ie[2]-ie[0])/t,2),Math.pow((ie[3]-ie[1])/t,2)))>150){var ae="MultiLineString"===oe.getType()?oe.getFlatMidpoints():oe.getFlatMidpoint();if(st||(st=new fe("Point",at=[NaN,NaN],[],{},null)),re=st,at[0]=ae[0],at[1]=ae[1],"line"===gt(j,"layout","symbol-placement",y,v)&&"map"===ne)for(var se=oe.getStride(),le=oe.getFlatCoordinates(),ue=0,ce=le.length-se;ue=me&&ae[0]<=ve&&ae[1]>=ge&&ae[1]<=be){Z=Math.atan2(de-ye,he-pe);break}}}}}if(2!==g||re){++b,(L=P[b])&&L.getImage()&&!L.getFill()&&!L.getStroke()||(L=P[b]=new a.a),L.setGeometry(re);var we=gt(j,"layout","icon-size",y,v),xe=void 0!==A["icon-color"]?gt(j,"paint","icon-color",y,v):null,ke=X+"."+we;if(null!==xe&&(ke+="."+xe),!(Q=M[ke])){var Se=i[X];if(null!==xe){var je=Xe(Se.width,Se.height),_e=je.getContext("2d");_e.drawImage(p,Se.x,Se.y,Se.width,Se.height,0,0,Se.width,Se.height);for(var Te=_e.getImageData(0,0,je.width,je.height),Ae=0,ze=Te.data.length;Ae0?new c.a({width:Ie,color:Ce}):void 0,fill:Me?new l.a({color:Me}):void 0})),L.setImage(Q),K=L.getText(),L.setText(void 0),L.setGeometry(void 0),L.setZIndex(D),H=!0}var Re=void 0;if("text-field"in T)Re=kt(gt(j,"layout","text-field",y,v).toString(),r).trim(),R=gt(j,"paint","text-opacity",y,v);if(Re&&R&&!ee){H||(++b,(L=P[b])&&L.getText()&&!L.getFill()&&!L.getStroke()||(L=P[b]=new a.a),L.setImage(void 0),L.setGeometry(void 0)),L.getText()||L.setText(K||new f.a({padding:[2,2,2,2]})),K=L.getText();var qe=Math.round(gt(j,"layout","text-size",y,v)),Ne=gt(j,"layout","text-font",y,v),Fe=gt(j,"layout","text-line-height",y,v),Le=o()(u?u(Ne):Ne,qe,Fe),De=T["text-transform"];"uppercase"==De?Re=Re.toUpperCase():"lowercase"==De&&(Re=Re.toLowerCase());var Ue=gt(j,"layout","text-max-width",y,v),Be=gt(j,"layout","text-letter-spacing",y,v),Ge=2==g?tt(Re,Be):it(Re,Le,Ue,Be);K.setText(Ge),K.setFont(Le),K.setRotation(Ke(gt(j,"layout","text-rotate",y,v)));var Je=gt(j,"layout","text-anchor",y,v),Ve=H||1==g?"point":gt(j,"layout","symbol-placement",y,v);K.setPlacement(Ve);var We=gt(j,"paint","text-halo-width",y,v),$e=gt(j,"layout","text-offset",y,v),Ye=gt(j,"paint","text-translate",y,v),He=0,Ze=0;if("point"==Ve){var Qe="center";-1!==Je.indexOf("left")?(Qe="left",Ze=We):-1!==Je.indexOf("right")&&(Qe="right",Ze=-We),K.setTextAlign(Qe);var et=gt(j,"layout","text-rotation-alignment",y,v);K.setRotateWithView("map"==et)}else K.setMaxAngle(Ke(gt(j,"layout","text-max-angle",y,v))*Re.length/Ge.length),K.setTextAlign(),K.setRotateWithView(!1);var rt="middle";0==Je.indexOf("bottom")?(rt="bottom",He=-We-.5*(Fe-1)*qe):0==Je.indexOf("top")&&(rt="top",He=We+.5*(Fe-1)*qe),K.setTextBaseline(rt),K.setOffsetX($e[0]*qe+Ze+Ye[0]),K.setOffsetY($e[1]*qe+He+Ye[1]),C.setColor(wt(gt(j,"paint","text-color",y,v),R)),K.setFill(C);var nt=wt(gt(j,"paint","text-halo-color",y,v),R);if(nt){E.setColor(nt),We*=2;var ot=.5*qe;E.setWidth(We<=ot?We:ot),K.setStroke(E)}else K.setStroke(void 0);var lt=gt(j,"layout","text-padding",y,v),ut=K.getPadding();lt!==ut[0]&&(ut[0]=ut[1]=ut[2]=ut[3]=lt),L.setZIndex(D)}}}}return b>-1?(P.length=b+1,P):void 0}};return e.setStyle(R),e.set("mapbox-source",v),e.set("mapbox-layers",x),R},_t=r(18),Tt=r.n(_t),At=r(6),zt=r(19),Ot=r(8),Et=r.n(Ot),Ct=r(9),Mt=r.n(Ct),It=r(20),Pt=r.n(It),Rt=r(21),qt=r.n(Rt),Nt=r(22),Ft=r.n(Nt),Lt=r(4),Dt=r(23),Ut=r.n(Dt),Bt=r(10),Gt=r.n(Bt),Jt=r(11),Vt=r.n(Jt),Wt=r(12),$t=r.n(Wt),Yt=r(13),Ht=r.n(Yt),Kt=r(14),Zt=r.n(Kt),Xt={},Qt=/font-family: ?([^;]*);/,er=/("|')/g;function tr(e){if(!St){St={};for(var t=document.styleSheets,r=0,n=t.length;r2?n[2]:""):e+r}function lr(e,t,r,n,o){return new Promise((function(i,a){if("object"!=typeof t&&(t=JSON.parse(t)),8!=t.version)return a(new Error("glStyle version 8 required."));if(!(e instanceof Gt.a||e instanceof Vt.a))return a(new Error("Can only apply to VectorLayer or VectorTileLayer"));var s,l,u;function c(){u||t.sprite&&!s?u?(e.setStyle(u),i()):a(new Error("Something went wrong trying to apply style.")):(u=jt(e,t,r,o,s,l,or),e.getStyle()?i():a(new Error("Nothing to show for source ["+r+"]")))}if(t.sprite){var p=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",d=sr(t.sprite,n,p+".json");fetch(d,{credentials:"same-origin"}).then((function(e){return e.ok||""===p?e:(d=sr(t.sprite,n,".json"),fetch(d,{credentials:"same-origin"}))})).then((function(e){if(e.ok)return e.json();a(new Error("Problem fetching sprite from "+d+": "+e.statusText))})).then((function(e){if(void 0===e||0===Object.keys(e).length)return a(new Error("No sprites found."));s=e,l=sr(t.sprite,n,p+".png"),c()})).catch((function(e){a(new Error("Sprites cannot be loaded: "+d+": "+e.message))}))}else c()}))}var ur={};function cr(e,t){var r={type:t.type};function n(){var n=e.getTargetElement();if(n){var o=t.layout||{},i=t.paint||{};r.paint=i,r.id="olms-bg-"+i["background-opacity"]+i["background-color"];var a=e.getView().getZoom();if(void 0!==i["background-color"]){var s=gt(r,"paint","background-color",a,ur);n.style.background=ye.a.parse(s).toString()}void 0!==i["background-opacity"]&&(n.style.opacity=gt(r,"paint","background-opacity",a,ur)),"none"==o.visibility&&(n.style.backgroundColor="",n.style.opacity="")}}e.getTargetElement()&&n(),e.on(["change:resolution","change:target"],n)}function pr(e,t){var r;return e.some((function(e){if(e.id==t)return r=e.source,!0})),r}function dr(e){var t=e.bounds;if(t){var r=Object(At.fromLonLat)([t[0],t[1]]),n=Object(At.fromLonLat)([t[2],t[3]]);return[r[0],r[1],n[0],n[1]]}}function hr(e,t,r){e=He({},e);var n=new Vt.a({declutter:!0,visible:!1}),o=JSON.stringify(e),i=Xt[o];i||(i=Xt[o]=new $t.a({url:e.tiles?void 0:r,tileJSON:e.tiles?e:void 0}));var a=i.on("change",(function(){var t=i.getState();if("ready"===t){var r=i.getTileJSON(),o=Array.isArray(r.tiles)?r.tiles:[r.tiles];if(e.url)for(var s=0,l=o.length;s2?s[2]:""),a=new Promise((function(a,s){fetch(t,{credentials:"same-origin"}).then((function(e){return e.json()})).then((function(l){var u=document.createElement("A");u.href=t;var c=u.href;i=u.pathname.split("/").slice(0,-1).join("/")+"/",o=c.substr(0,c.indexOf(i)),vr(l,e,n,o,i,r).then((function(){a(e)})).catch(s)})).catch((function(e){s(new Error("Could not load "+t+": "+e.message))}))}))}else a=new Promise((function(r,n){vr(t,e).then((function(){r(e)})).catch(n)}));return a}function wr(e,t,r,n,o){for(var i=24,a=0,s=r.layers,l=0,u=s.length;l0||c>0)&&e.setMaxResolution(Math.min(Ze[i],u.getResolution(c))+1e-9),a<24&&e.setMinResolution(Ze[a]+1e-9)}}o instanceof Ht.a||o instanceof Zt.a?lr(e,r,t,n).then((function(){e.setVisible(!0),s()}),(function(e){l(e)})):s()}else l(new Error("Error accessing data for source "+e.get("mapbox-source")))};e.set("mapbox-layers",t),-1===o.getLayers().getArray().indexOf(e)&&o.addLayer(e),e.getSource()?u():e.once("change:source",u)}))}He(br,{apply:function(e,t){return("string"==typeof e||e instanceof HTMLElement)&&(e=new Mt.a({target:e})),setTimeout((function(){br(e,t)}),0),e},applyBackground:function(e,t){t.layers.some((function(t){if("background"==t.type)return cr(e,t),!0}))},applyStyle:lr,stylefunction:jt});t.default=br}]).default}));
+//# sourceMappingURL=olms.js.map
\ No newline at end of file