/*! For license information please see ol.js.LICENSE.txt */ !function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.ol=n():t.ol=n()}(self,(function(){return function(){var t,n={226:function(t,n){n.read=function(t,n,i,r,e){var o,s,a=8*e-r-1,u=(1<>1,h=-7,f=i?e-1:0,l=i?-1:1,v=t[n+f];for(f+=l,o=v&(1<<-h)-1,v>>=-h,h+=a;h>0;o=256*o+t[n+f],f+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=256*s+t[n+f],f+=l,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(v?-1:1);s+=Math.pow(2,r),o-=c}return(v?-1:1)*s*Math.pow(2,o-r)},n.write=function(t,n,i,r,e,o){var s,a,u,c=8*o-e-1,h=(1<>1,l=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,v=r?0:o-1,d=r?1:-1,p=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(a=isNaN(n)?1:0,s=h):(s=Math.floor(Math.log(n)/Math.LN2),n*(u=Math.pow(2,-s))<1&&(s--,u*=2),(n+=s+f>=1?l/u:l*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=h?(a=0,s=h):s+f>=1?(a=(n*u-1)*Math.pow(2,e),s+=f):(a=n*Math.pow(2,f-1)*Math.pow(2,e),s=0));e>=8;t[i+v]=255&a,v+=d,a/=256,e-=8);for(s=s<0;t[i+v]=255&s,v+=d,s/=256,c-=8);t[i+v-d]|=128*p}},875:function(t,n,i){"use strict";function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function e(t,n){for(var i=0;ithis[a])return j(this,this[p].get(t)),!1;var o=this[p].get(t).value;return this[l]&&(this[v]||this[l](t,o.value)),o.now=r,o.maxAge=i,o.value=n,this[u]+=e-o.length,o.length=e,this.get(t),x(this),!0}var s=new S(t,n,e,r,i);return s.length>this[a]?(this[l]&&this[l](t,n),!1):(this[u]+=s.length,this[d].unshift(s),this[p].set(t,this[d].head),x(this),!0)}},{key:"has",value:function(t){if(!this[p].has(t))return!1;var n=this[p].get(t).value;return!g(this,n)}},{key:"get",value:function(t){return b(this,t,!0)}},{key:"peek",value:function(t){return b(this,t,!1)}},{key:"pop",value:function(){var t=this[d].tail;return t?(j(this,t),t.value):null}},{key:"del",value:function(t){j(this,this[p].get(t))}},{key:"load",value:function(t){this.reset();for(var n=Date.now(),i=t.length-1;i>=0;i--){var r=t[i],e=r.e||0;if(0===e)this.set(r.k,r.v);else{var o=e-n;o>0&&this.set(r.k,r.v,o)}}}},{key:"prune",value:function(){var t=this;this[p].forEach((function(n,i){return b(t,i,!1)}))}}]),t}(),b=function(t,n,i){var r=t[p].get(n);if(r){var e=r.value;if(g(t,e)){if(j(t,r),!t[h])return}else i&&(t[y]&&(r.value.now=Date.now()),t[d].unshiftNode(r));return e.value}},g=function(t,n){if(!n||!n.maxAge&&!t[f])return!1;var i=Date.now()-n.now;return n.maxAge?i>n.maxAge:t[f]&&i>t[f]},x=function(t){if(t[u]>t[a])for(var n=t[d].tail;t[u]>t[a]&&null!==n;){var i=n.prev;j(t,n),n=i}},j=function(t,n){if(n){var i=n.value;t[l]&&t[l](i.key,i.value),t[u]-=i.length,t[p].delete(i.key),t[d].removeNode(n)}},S=o((function t(n,i,e,o,s){r(this,t),this.key=n,this.value=i,this.length=e,this.now=o,this.maxAge=s||0})),k=function(t,n,i,r){var e=i.value;g(t,e)&&(j(t,i),t[h]||(e=void 0)),e&&n.call(r,e.value,e.key,t)};t.exports=w},63:function(t){var n={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},i=" ",r=/(italic|oblique)$/i,e={};t.exports=function(t,o,s){var a=e[t];if(!a){Array.isArray(t)||(t=[t]);for(var u=400,c="normal",h=[],f=0,l=t.length;f1?v[v.length-2].toLowerCase():"";if(d==p||d==p.replace("-","")||y+"-"+d==p){u=n[p],v.pop(),y&&p.startsWith(y)&&v.pop();break}}"number"==typeof d&&(u=d);var m=v.join(i).replace("Klokantech Noto Sans","Noto Sans");-1!==m.indexOf(i)&&(m='"'+m+'"'),h.push(m)}a=e[t]=[c,u,h]}return a[0]+i+a[1]+i+o+"px"+(s?"/"+s:"")+i+a[2]}},98:function(t,n,i){"use strict";t.exports=e;var r=i(226);function e(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}e.Varint=0,e.Fixed64=1,e.Bytes=2,e.Fixed32=5;var o=4294967296,s=1/o,a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function u(t){return t.type===e.Bytes?t.readVarint()+t.pos:t.pos+1}function c(t,n,i){return i?4294967296*n+(t>>>0):4294967296*(n>>>0)+(t>>>0)}function h(t,n,i){var r=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(7*Math.LN2));i.realloc(r);for(var e=i.pos-1;e>=t;e--)i.buf[e+r]=i.buf[e]}function f(t,n){for(var i=0;i>>8,t[i+2]=n>>>16,t[i+3]=n>>>24}function j(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+(t[n+3]<<24)}e.prototype={destroy:function(){this.buf=null},readFields:function(t,n,i){for(i=i||this.length;this.pos>3,o=this.pos;this.type=7&r,t(e,n,this),this.pos===o&&this.skip(r)}return n},readMessage:function(t,n){return this.readFields(t,n,this.readVarint()+this.pos)},readFixed32:function(){var t=g(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=j(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=g(this.buf,this.pos)+g(this.buf,this.pos+4)*o;return this.pos+=8,t},readSFixed64:function(){var t=g(this.buf,this.pos)+j(this.buf,this.pos+4)*o;return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var n,i,r=this.buf;return n=127&(i=r[this.pos++]),i<128?n:(n|=(127&(i=r[this.pos++]))<<7,i<128?n:(n|=(127&(i=r[this.pos++]))<<14,i<128?n:(n|=(127&(i=r[this.pos++]))<<21,i<128?n:function(t,n,i){var r,e,o=i.buf;if(e=o[i.pos++],r=(112&e)>>4,e<128)return c(t,r,n);if(e=o[i.pos++],r|=(127&e)<<3,e<128)return c(t,r,n);if(e=o[i.pos++],r|=(127&e)<<10,e<128)return c(t,r,n);if(e=o[i.pos++],r|=(127&e)<<17,e<128)return c(t,r,n);if(e=o[i.pos++],r|=(127&e)<<24,e<128)return c(t,r,n);if(e=o[i.pos++],r|=(1&e)<<31,e<128)return c(t,r,n);throw new Error("Expected varint not more than 10 bytes")}(n|=(15&(i=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,n=this.pos;return this.pos=t,t-n>=12&&a?function(t,n,i){return a.decode(t.subarray(n,i))}(this.buf,n,t):function(t,n,i){var r="",e=n;for(;e239?4:u>223?3:u>191?2:1;if(e+h>i)break;1===h?u<128&&(c=u):2===h?128==(192&(o=t[e+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===h?(o=t[e+1],s=t[e+2],128==(192&o)&&128==(192&s)&&((c=(15&u)<<12|(63&o)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===h&&(o=t[e+1],s=t[e+2],a=t[e+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,h=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),e+=h}return r}(this.buf,n,t)},readBytes:function(){var t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n},readPackedVarint:function(t,n){if(this.type!==e.Bytes)return t.push(this.readVarint(n));var i=u(this);for(t=t||[];this.pos127;);else if(n===e.Bytes)this.pos=this.readVarint()+this.pos;else if(n===e.Fixed32)this.pos+=4;else{if(n!==e.Fixed64)throw new Error("Unimplemented type: "+n);this.pos+=8}},writeTag:function(t,n){this.writeVarint(t<<3|n)},realloc:function(t){for(var n=this.length||16;n268435455||t<0?function(t,n){var i,r;t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),function(t,n,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,n),function(t,n){var i=(7&t)<<4;if(n.buf[n.pos++]|=i|((t>>>=3)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;n.buf[n.pos++]=127&t}(r,n)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var n=this.pos;this.pos=function(t,n,i){for(var r,e,o=0;o55295&&r<57344){if(!e){r>56319||o+1===n.length?(t[i++]=239,t[i++]=191,t[i++]=189):e=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,e=r;continue}r=e-55296<<10|r-56320|65536,e=null}else e&&(t[i++]=239,t[i++]=191,t[i++]=189,e=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-n;i>=128&&h(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var n=t.length;this.writeVarint(n),this.realloc(n);for(var i=0;i=128&&h(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,n,i){this.writeTag(t,e.Bytes),this.writeRawMessage(n,i)},writePackedVarint:function(t,n){n.length&&this.writeMessage(t,f,n)},writePackedSVarint:function(t,n){n.length&&this.writeMessage(t,l,n)},writePackedBoolean:function(t,n){n.length&&this.writeMessage(t,p,n)},writePackedFloat:function(t,n){n.length&&this.writeMessage(t,v,n)},writePackedDouble:function(t,n){n.length&&this.writeMessage(t,d,n)},writePackedFixed32:function(t,n){n.length&&this.writeMessage(t,y,n)},writePackedSFixed32:function(t,n){n.length&&this.writeMessage(t,m,n)},writePackedFixed64:function(t,n){n.length&&this.writeMessage(t,w,n)},writePackedSFixed64:function(t,n){n.length&&this.writeMessage(t,b,n)},writeBytesField:function(t,n){this.writeTag(t,e.Bytes),this.writeBytes(n)},writeFixed32Field:function(t,n){this.writeTag(t,e.Fixed32),this.writeFixed32(n)},writeSFixed32Field:function(t,n){this.writeTag(t,e.Fixed32),this.writeSFixed32(n)},writeFixed64Field:function(t,n){this.writeTag(t,e.Fixed64),this.writeFixed64(n)},writeSFixed64Field:function(t,n){this.writeTag(t,e.Fixed64),this.writeSFixed64(n)},writeVarintField:function(t,n){this.writeTag(t,e.Varint),this.writeVarint(n)},writeSVarintField:function(t,n){this.writeTag(t,e.Varint),this.writeSVarint(n)},writeStringField:function(t,n){this.writeTag(t,e.Bytes),this.writeString(n)},writeFloatField:function(t,n){this.writeTag(t,e.Fixed32),this.writeFloat(n)},writeDoubleField:function(t,n){this.writeTag(t,e.Fixed64),this.writeDouble(n)},writeBooleanField:function(t,n){this.writeVarintField(t,Boolean(n))}}},72:function(t,n,i){var r,e,o;function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}o=function(){"use strict";function t(t,r,e,o,s){!function t(i,r,e,o,s){for(;o>e;){if(o-e>600){var a=o-e+1,u=r-e+1,c=Math.log(a),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(a-h)/a)*(u-a/2<0?-1:1);t(i,r,Math.max(e,Math.floor(r-u*h/a+f)),Math.min(o,Math.floor(r+(a-u)*h/a+f)),s)}var l=i[r],v=e,d=o;for(n(i,e,r),s(i[o],l)>0&&n(i,e,o);v0;)d--}0===s(i[e],l)?n(i,e,d):n(i,++d,o),d<=r&&(e=d+1),r<=d&&(o=d-1)}}(t,r,e||0,o||t.length-1,s||i)}function n(t,n,i){var r=t[n];t[n]=t[i],t[i]=r}function i(t,n){return tn?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function e(t,n,i){if(!i)return n.indexOf(t);for(var r=0;r=t.minX&&n.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function p(n,i,r,e,o){for(var s=[i,r];s.length;)if(!((r=s.pop())-(i=s.pop())<=e)){var a=i+Math.ceil((r-i)/e/2)*e;t(n,a,i,r,o),s.push(i,a,a,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var n=this.data,i=[];if(!v(t,n))return i;for(var r=this.toBBox,e=[];n;){for(var o=0;o=0&&e[n].children.length>this._maxEntries;)this._split(e,n),n--;this._adjustParentBBoxes(r,e,n)},r.prototype._split=function(t,n){var i=t[n],r=i.children.length,e=this._minEntries;this._chooseSplitAxis(i,e,r);var s=this._chooseSplitIndex(i,e,r),a=d(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)},r.prototype._splitRoot=function(t,n){this.data=d([t,n]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,i){for(var r,e,o,a,u,c,f,l=1/0,v=1/0,d=n;d<=i-n;d++){var p=s(t,0,d,this.toBBox),y=s(t,d,i,this.toBBox),m=(e=p,o=y,a=Math.max(e.minX,o.minX),u=Math.max(e.minY,o.minY),c=Math.min(e.maxX,o.maxX),f=Math.min(e.maxY,o.maxY),Math.max(0,c-a)*Math.max(0,f-u)),w=h(p)+h(y);m=n;v--){var d=t.children[v];a(u,t.leaf?e(d):d),c+=f(u)}return c},r.prototype._adjustParentBBoxes=function(t,n,i){for(var r=i;r>=0;r--)a(n[r],t)},r.prototype._condense=function(t){for(var n=t.length-1,i=void 0;n>=0;n--)0===t[n].children.length?n>0?(i=t[n-1].children).splice(i.indexOf(t[n]),1):this.clear():o(t[n],this.toBBox)},r},"object"==s(n)?t.exports=o():void 0===(e="function"==typeof(r=o)?r.call(n,i,n,t):r)||(t.exports=e)},760:function(t,n,i){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var e=function(t){"use strict";var n,i=Object.prototype,e=i.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,n,i){return Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{c({},"")}catch(t){c=function(t,n,i){return t[n]=i}}function h(t,n,i,r){var e=n&&n.prototype instanceof m?n:m,o=Object.create(e.prototype),s=new E(r||[]);return o._invoke=function(t,n,i){var r=l;return function(e,o){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===e)throw o;return C()}for(i.method=e,i.arg=o;;){var s=i.delegate;if(s){var a=_(s,i);if(a){if(a===y)continue;return a}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===l)throw r=p,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=d;var u=f(t,n,i);if("normal"===u.type){if(r=i.done?p:v,u.arg===y)continue;return{value:u.arg,done:i.done}}"throw"===u.type&&(r=p,i.method="throw",i.arg=u.arg)}}}(t,i,s),o}function f(t,n,i){try{return{type:"normal",arg:t.call(n,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var l="suspendedStart",v="suspendedYield",d="executing",p="completed",y={};function m(){}function w(){}function b(){}var g={};c(g,s,(function(){return this}));var x=Object.getPrototypeOf,j=x&&x(x(A([])));j&&j!==i&&e.call(j,s)&&(g=j);var S=b.prototype=m.prototype=Object.create(g);function k(t){["next","throw","return"].forEach((function(n){c(t,n,(function(t){return this._invoke(n,t)}))}))}function M(t,n){function i(o,s,a,u){var c=f(t[o],t,s);if("throw"!==c.type){var h=c.arg,l=h.value;return l&&"object"===r(l)&&e.call(l,"__await")?n.resolve(l.__await).then((function(t){i("next",t,a,u)}),(function(t){i("throw",t,a,u)})):n.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return i("throw",t,a,u)}))}u(c.arg)}var o;this._invoke=function(t,r){function e(){return new n((function(n,e){i(t,r,n,e)}))}return o=o?o.then(e,e):e()}}function _(t,i){var r=t.iterator[i.method];if(r===n){if(i.delegate=null,"throw"===i.method){if(t.iterator.return&&(i.method="return",i.arg=n,_(t,i),"throw"===i.method))return y;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var e=f(r,t.iterator,i.arg);if("throw"===e.type)return i.method="throw",i.arg=e.arg,i.delegate=null,y;var o=e.arg;return o?o.done?(i[t.resultName]=o.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=n),i.delegate=null,y):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function O(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function T(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function A(t){if(t){var i=t[s];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function i(){for(;++r=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var u=e.call(s,"catchLoc"),c=e.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&e.call(r,"finallyLoc")&&this.prev=0;--n){var i=this.tryEntries[n];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),T(i),y}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var e=r.arg;T(i)}return e}}throw new Error("illegal catch attempt")},delegateYield:function(t,i,r){return this.delegate={iterator:A(t),resultName:i,nextLoc:r},"next"===this.method&&(this.arg=n),y}},t}("object"===r(t=i.nmd(t))?t.exports:{});try{regeneratorRuntime=e}catch(t){"object"===("undefined"==typeof globalThis?"undefined":r(globalThis))?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},338:function(t){(function(){var n;t.exports={icon:"icons/google.svg",name:"google",title:"Google Fonts",link:"google.com/fonts",getNames:function(){return n},getLink:function(t){return"https://fonts.google.com/specimen/"+t.replace(/( )/g,"+")},normalizeName:function(t){return t}},n=["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alegreya Sans","Alegreya Sans SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Amiri","Amita","Anaheim","Andada","Andika","Angkor","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Arya","Asap","Asar","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Battambang","Baumans","Bayon","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Biryani","Bitter","Black Ops One","Bokor","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambay","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Catamaran","Caudex","Caveat","Caveat Brush","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Chenla","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Chonburi","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Content","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dangrek","Dawning of a New Day","Days One","Dekko","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Dhurjati","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Eczar","Ek Mukta","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Exo 2","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Fasthand","Fauna One","Federant","Federo","Felipa","Fenix","Finger Paint","Fira Mono","Fira Sans","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Freehand","Fresca","Frijole","Fruktur","Fugaz One","GFS Didot","GFS Neohellenic","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gidugu","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Gurajada","Habibi","Halant","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Hanuman","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Hind","Hind Siliguri","Hind Vadodara","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Inknut Antiqua","Irish Grover","Istok Web","Italiana","Italianno","Itim","Jacques Francois","Jacques Francois Shadow","Jaldi","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kadwa","Kalam","Kameron","Kantumruy","Karla","Karma","Kaushan Script","Kavoon","Kdam Thmor","Keania One","Kelly Slab","Kenia","Khand","Khmer","Khula","Kite One","Knewave","Kotta One","Koulen","Kranky","Kreon","Kristi","Krona One","Kurale","La Belle Aurore","Laila","Lakki Reddy","Lancelot","Lateef","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Lily Script One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Mallanna","Mandali","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Martel","Martel Sans","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modak","Modern Antiqua","Molengo","Molle","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Moul","Moulpali","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","NTR","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Nokora","Norican","Nosifer","Nothing You Could Do","Noticia Text","Noto Sans","Noto Serif","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Odor Mean Chey","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Palanquin","Palanquin Dark","Paprika","Parisienne","Passero One","Passion One","Pathway Gothic One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peddana","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Poppins","Port Lligat Sans","Port Lligat Slab","Pragati Narrow","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Rajdhani","Raleway","Raleway Dots","Ramabhadra","Ramaraja","Rambla","Rammetto One","Ranchers","Rancho","Ranga","Rationale","Ravi Prakash","Redressed","Reenie Beanie","Revalia","Rhodium Libre","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Rozha One","Rubik","Rubik Mono One","Rubik One","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sahitya","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarala","Sarina","Sarpanch","Satisfy","Scada","Scheherazade","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Siemreap","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slabo 13px","Slabo 27px","Slackey","Smokum","Smythe","Sniglet","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Source Serif Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Sree Krushnadevaraya","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sumana","Sunshiney","Supermercado One","Sura","Suranna","Suravaram","Suwannaphum","Swanky and Moo Moo","Syncopate","Tangerine","Taprom","Tauri","Teko","Telex","Tenali Ramakrishna","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tillana","Timmana","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vesper Libre","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Work Sans","Yanone Kaffeesatz","Yantramanav","Yellowtail","Yeseva One","Yesteryear","Zeyada"]}).call(this)},617:function(t,n,i){var r=i(279);t.exports=function(t,n,i){var e=i&&i.debug||!1,o=i&&i.startIndex||0;e&&console.log("starting findTagByName with",n," and ",i);var s=r(t,"<".concat(n,"[ >]"),o);if(e&&console.log("start:",s),-1!==s){var a=t.slice(s+n.length),u=r(a,"[ /]"+n+">",0),c=-1===u;c&&(u=r(a,"[ /]>",0));var h=s+n.length+u+1+(c?0:n.length)+1;if(e&&console.log("end:",h),-1!==h){var f=t.slice(s,h);return{inner:c?null:f.slice(f.indexOf(">")+1,f.lastIndexOf("<")),outer:f,start:s,end:h}}}}},51:function(t,n,i){var r=i(617);t.exports=function(t,n,i){for(var e,o=[],s=i&&i.debug||!1,a=i&&i.startIndex||0;e=r(t,n,{debug:s,startIndex:a});)a=e.end,o.push(e);return s&&console.log("findTagsByName found",o.length,"tags"),o}},802:function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t,i,r){var e=r&&r.debug||!1;e&&console.log("getting "+i+" in "+t);var o="object"===n(t)?t.outer:t,s="".concat(i,'\\="([^"]*)"');e&&console.log("pattern:",s);var a=new RegExp(s).exec(o);if(e&&console.log("match:",a),a)return a[1]}},279:function(t){t.exports=function(t,n,i){var r=new RegExp(n).exec(t.slice(i));return r?i+r.index:-1}},518:function(t){"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this.head;case 1:if(!n){t.next=7;break}return t.next=4,n.value;case 4:n=n.next,t.next=1;break;case 7:case"end":return t.stop()}}),t,this)}))}},692:function(t,n,i){"use strict";function r(t){var n=this;if(n instanceof r||(n=new r),n.tail=null,n.head=null,n.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){n.push(t)}));else if(arguments.length>0)for(var i=0,e=arguments.length;i1)i=n;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,i=this.head.value}for(var e=0;null!==r;e++)i=t(i,r.value,e),r=r.next;return i},r.prototype.reduceReverse=function(t,n){var i,r=this.tail;if(arguments.length>1)i=n;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,i=this.tail.value}for(var e=this.length-1;null!==r;e--)i=t(i,r.value,e),r=r.prev;return i},r.prototype.toArray=function(){for(var t=new Array(this.length),n=0,i=this.head;null!==i;n++)t[n]=i.value,i=i.next;return t},r.prototype.toArrayReverse=function(){for(var t=new Array(this.length),n=0,i=this.tail;null!==i;n++)t[n]=i.value,i=i.prev;return t},r.prototype.slice=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var i=new r;if(nthis.length&&(n=this.length);for(var e=0,o=this.head;null!==o&&ethis.length&&(n=this.length);for(var e=this.length,o=this.tail;null!==o&&e>n;e--)o=o.prev;for(;null!==o&&e>t;e--,o=o.prev)i.push(o.value);return i},r.prototype.splice=function(t,n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,r=this.head;null!==r&&i>1)],n))<0?s=r+1:(a=r,u=!e);return u?s:~s}function p(t,n){return t>n?1:t=0}function m(t,n,i){var r=t.length;if(t[0]<=n)return 0;if(n<=t[r-1])return r-1;var e=void 0;if(i>0){for(e=1;e0?e-1:e:t[e-1]-n>>0,e=0;e0||i&&0===o)}))}function k(){return!0}function M(){return!1}function _(){}function O(t){var n,i,r,e=!1;return function(){var o=Array.prototype.slice.call(arguments);return e&&this===r&&x(o,i)||(e=!0,r=this,i=o,n=t.apply(this,arguments)),n}}function T(t){return function(){var n;try{n=t()}catch(t){return Promise.reject(t)}return n instanceof Promise?n:Promise.resolve(n)}()}var E="function"==typeof Object.assign?Object.assign:function(t,n){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),r=1,e=arguments.length;r0)},n.prototype.removeEventListener=function(t,n){var i=this.O&&this.O[t];if(i){var r=i.indexOf(n);-1!==r&&(this.S&&t in this.S?(i[r]=_,++this.S[t]):(i.splice(r,1),0===i.length&&delete this.O[t]))}},n}(v),N="change",z="error",F="clear",L="contextmenu",G="click",D="dblclick",U="dragenter",q="dragover",B="drop",W="keydown",V="keypress",X="load",H="resize",J="touchmove",K="wheel";function Y(t,n,i,r,e){if(r&&r!==t&&(i=i.bind(r)),e){var o=i;i=function(){t.removeEventListener(n,i),o.apply(this,arguments)}}var s={target:t,type:n,listener:i};return t.addEventListener(n,i),s}function Z(t,n,i,r){return Y(t,n,i,r,!0)}function $(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),A(t))}var Q=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),tt=function(t){function n(){var n=t.call(this)||this;return n.on=n.onInternal,n.once=n.onceInternal,n.un=n.unInternal,n.T=0,n}return Q(n,t),n.prototype.changed=function(){++this.T,this.dispatchEvent(N)},n.prototype.getRevision=function(){return this.T},n.prototype.onInternal=function(t,n){if(Array.isArray(t)){for(var i=t.length,r=new Array(i),e=0;e0;)this.pop()},n.prototype.extend=function(t){for(var n=0,i=t.length;nt)throw new Error("Tile load sequence violation");this.state=t,this.changed()},n.prototype.load=function(){r()},n.prototype.getAlpha=function(t,n){if(!this.D)return 1;var i=this.U[t];if(i){if(-1===i)return 1}else i=n,this.U[t]=i;var r=n-i+1e3/60;return r>=this.D?1:mt(r/this.D)},n.prototype.inTransition=function(t){return!!this.D&&-1!==this.U[t]},n.prototype.endTransition=function(t){this.D&&(this.U[t]=-1)},n}(I),St=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),kt=function(t){function n(n){var i=this,r=lt;return(i=t.call(this,n.tileCoord,r,{transition:n.transition,interpolate:n.interpolate})||this).q=n.loader,i.B=null,i.W=null,i}return St(n,t),n.prototype.getData=function(){return this.B},n.prototype.getError=function(){return this.W},n.prototype.load=function(){this.state=vt,this.changed();var t=this;this.q().then((function(n){t.B=n,t.state=dt,t.changed()})).catch((function(n){t.W=n,t.state=pt,t.changed()}))},n}(jt);function Mt(t,n){if(!t)throw new c(n)}var _t=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Ot(t){return"function"==typeof t?t:(Array.isArray(t)?n=t:(Mt("function"==typeof t.getZIndex,41),n=[t]),function(){return n});var n}var Tt=function(t){function n(n){var i=t.call(this)||this;if(i.on,i.once,i.un,i.V=void 0,i.H="geometry",i.K=null,i.tt=void 0,i.nt=null,i.addChangeListener(i.H,i.it),n)if("function"==typeof n.getSimplifiedGeometry){var r=n;i.setGeometry(r)}else{var e=n;i.setProperties(e)}return i}return _t(n,t),n.prototype.clone=function(){var t=new n(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var r=this.getStyle();return r&&t.setStyle(r),t},n.prototype.getGeometry=function(){return this.get(this.H)},n.prototype.getId=function(){return this.V},n.prototype.getGeometryName=function(){return this.H},n.prototype.getStyle=function(){return this.K},n.prototype.getStyleFunction=function(){return this.tt},n.prototype.rt=function(){this.changed()},n.prototype.it=function(){this.nt&&($(this.nt),this.nt=null);var t=this.getGeometry();t&&(this.nt=Y(t,N,this.rt,this)),this.changed()},n.prototype.setGeometry=function(t){this.set(this.H,t)},n.prototype.setStyle=function(t){this.K=t,this.tt=t?Ot(t):void 0,this.changed()},n.prototype.setId=function(t){this.V=t,this.changed()},n.prototype.setGeometryName=function(t){this.removeChangeListener(this.H,this.it),this.H=t,this.addChangeListener(this.H,this.it),this.it()},n}(ot),Et="XY",At="XYZ",Ct="XYM",Rt="XYZM",Pt={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},It={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Nt={9001:It.METERS,9002:It.FEET,9003:It.USFEET,9101:It.RADIANS,9102:It.DEGREES};function zt(t){return Nt[t]}var Ft={};Ft[It.RADIANS]=6370997/(2*Math.PI),Ft[It.DEGREES]=2*Math.PI*6370997/360,Ft[It.FEET]=.3048,Ft[It.METERS]=1,Ft[It.USFEET]=1200/3937;var Lt,Gt=It,Dt="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Ut=-1!==Dt.indexOf("firefox"),qt=-1!==Dt.indexOf("safari")&&-1==Dt.indexOf("chrom"),Bt=qt&&!!(Dt.indexOf("version/15.4")>=0||Dt.match(/cpu (os|iphone os) 15_4 like mac os x/)),Wt=-1!==Dt.indexOf("webkit")&&-1==Dt.indexOf("edge"),Vt=-1!==Dt.indexOf("macintosh"),Xt="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,Ht="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,Jt="undefined"!=typeof Image&&Image.prototype.decode,Kt=function(){var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,n),window.removeEventListener("_",null,n)}catch(t){}return t}(),Yt=new Array(6);function Zt(){return[1,0,0,1,0,0]}function $t(t){return tn(t,1,0,0,1,0,0)}function Qt(t,n){var i=t[0],r=t[1],e=t[2],o=t[3],s=t[4],a=t[5],u=n[0],c=n[1],h=n[2],f=n[3],l=n[4],v=n[5];return t[0]=i*u+e*c,t[1]=r*u+o*c,t[2]=i*h+e*f,t[3]=r*h+o*f,t[4]=i*l+e*v+s,t[5]=r*l+o*v+a,t}function tn(t,n,i,r,e,o,s){return t[0]=n,t[1]=i,t[2]=r,t[3]=e,t[4]=o,t[5]=s,t}function nn(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t}function rn(t,n){var i=n[0],r=n[1];return n[0]=t[0]*i+t[2]*r+t[4],n[1]=t[1]*i+t[3]*r+t[5],n}function en(t,n){var i=Math.cos(n),r=Math.sin(n);return Qt(t,tn(Yt,i,r,-r,i,0,0))}function on(t,n,i){return Qt(t,tn(Yt,n,0,0,i,0,0))}function sn(t,n,i){return tn(t,n,0,0,i,0,0)}function an(t,n,i){return Qt(t,tn(Yt,1,0,0,1,n,i))}function un(t,n,i,r,e,o,s,a){var u=Math.sin(o),c=Math.cos(o);return t[0]=r*c,t[1]=e*u,t[2]=-r*u,t[3]=e*c,t[4]=s*r*c-a*r*u+n,t[5]=s*e*u+a*e*c+i,t}function cn(t,n){var i=hn(n);Mt(0!==i,32);var r=n[0],e=n[1],o=n[2],s=n[3],a=n[4],u=n[5];return t[0]=s/i,t[1]=-e/i,t[2]=-o/i,t[3]=r/i,t[4]=(o*u-s*a)/i,t[5]=-(r*u-e*a)/i,t}function hn(t){return t[0]*t[3]-t[1]*t[2]}function fn(t){var n="matrix("+t.join(", ")+")";if(Ht)return n;var i=Lt||(Lt=document.createElement("div"));return i.style.transform=n,i.style.transform}var ln="bottom-left",vn="bottom-right",dn="top-left",pn="top-right",yn=0,mn=1,wn=2,bn=4,gn=8,xn=16;function jn(t){for(var n=An(),i=0,r=t.length;ie&&(u|=bn),ao&&(u|=wn),u===yn&&(u=mn),u}function An(){return[1/0,1/0,-1/0,-1/0]}function Cn(t,n,i,r,e){return e?(e[0]=t,e[1]=n,e[2]=i,e[3]=r,e):[t,n,i,r]}function Rn(t){return Cn(1/0,1/0,-1/0,-1/0,t)}function Pn(t,n){var i=t[0],r=t[1];return Cn(i,r,i,r,n)}function In(t,n,i,r,e){return Dn(Rn(e),t,n,i,r)}function Nn(t,n){return t[0]==n[0]&&t[2]==n[2]&&t[1]==n[1]&&t[3]==n[3]}function zn(t,n,i){return Math.abs(t[0]-n[0])t[2]&&(t[2]=n[2]),n[1]t[3]&&(t[3]=n[3]),t}function Ln(t,n){n[0]t[2]&&(t[2]=n[0]),n[1]t[3]&&(t[3]=n[1])}function Gn(t,n){for(var i=0,r=n.length;in[0]?r[0]=t[0]:r[0]=n[0],t[1]>n[1]?r[1]=t[1]:r[1]=n[1],t[2]=n[0]&&t[1]<=n[3]&&t[3]>=n[1]}function ii(t){return t[2]=s&&p<=u),r||!(o&bn)||e&bn||(r=(y=v-(l-u)*d)>=a&&y<=c),r||!(o&gn)||e&gn||(r=(p=l-(v-a)/d)>=s&&p<=u),r||!(o&xn)||e&xn||(r=(y=v-(l-s)*d)>=a&&y<=c)}return r}function si(t,n,i,r){var e=[];if(r>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a=i[2])){var e=ti(i),o=Math.floor((r[0]-i[0])/e)*e;t[0]-=o,t[2]-=o}return t}var ui=function(){function t(t){this.et=t.code,this.ot=t.units,this.st=void 0!==t.extent?t.extent:null,this.ut=void 0!==t.worldExtent?t.worldExtent:null,this.ct=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.ht=void 0!==t.global&&t.global,this.ft=!(!this.ht||!this.st),this.lt=t.getPointResolution,this.vt=null,this.dt=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.ft},t.prototype.getCode=function(){return this.et},t.prototype.getExtent=function(){return this.st},t.prototype.getUnits=function(){return this.ot},t.prototype.getMetersPerUnit=function(){return this.dt||Ft[this.ot]},t.prototype.getWorldExtent=function(){return this.ut},t.prototype.getAxisOrientation=function(){return this.ct},t.prototype.isGlobal=function(){return this.ht},t.prototype.setGlobal=function(t){this.ht=t,this.ft=!(!t||!this.st)},t.prototype.getDefaultTileGrid=function(){return this.vt},t.prototype.setDefaultTileGrid=function(t){this.vt=t},t.prototype.setExtent=function(t){this.st=t,this.ft=!(!this.ht||!t)},t.prototype.setWorldExtent=function(t){this.ut=t},t.prototype.setGetPointResolution=function(t){this.lt=t},t.prototype.getPointResolutionFunc=function(){return this.lt},t}();function ci(t,n,i){return Math.min(Math.max(t,n),i)}var hi="cosh"in Math?Math.cosh:function(t){var n=Math.exp(t);return(n+1/n)/2},fi="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function li(t,n,i,r,e,o){var s=e-i,a=o-r;if(0!==s||0!==a){var u=((t-i)*s+(n-r)*a)/(s*s+a*a);u>1?(i=e,r=o):u>0&&(i+=s*u,r+=a*u)}return vi(t,n,i,r)}function vi(t,n,i,r){var e=i-t,o=r-n;return e*e+o*o}function di(t){for(var n=t.length,i=0;ie&&(e=s,r=o)}if(0===e)return null;var a=t[r];t[r]=t[i],t[i]=a;for(var u=i+1;u=0;l--){f[l]=t[l][n]/t[l][l];for(var v=l-1;v>=0;v--)t[v][n]-=t[v][l]*f[l]}return f}function pi(t){return 180*t/Math.PI}function yi(t){return t*Math.PI/180}function mi(t,n){var i=t%n;return i*n<0?i+n:i}function wi(t,n,i){return t+i*(n-t)}function bi(t,n){var i=Math.pow(10,n);return Math.round(t*i)/i}function gi(t,n){return Math.round(bi(t,n))}function xi(t,n){return Math.floor(bi(t,n))}function ji(t,n){return Math.ceil(bi(t,n))}var Si=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ki=6378137,Mi=Math.PI*ki,_i=[-Mi,-Mi,Mi,Mi],Oi=[-180,-85,180,85],Ti=ki*Math.log(Math.tan(Math.PI/2)),Ei=function(t){function n(n){return t.call(this,{code:n,units:Gt.METERS,extent:_i,global:!0,worldExtent:Oi,getPointResolution:function(t,n){return t/hi(n[1]/ki)}})||this}return Si(n,t),n}(ui),Ai=[new Ei("EPSG:3857"),new Ei("EPSG:102100"),new Ei("EPSG:102113"),new Ei("EPSG:900913"),new Ei("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ei("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ci(t,n,i){var r=t.length,e=i>1?i:2,o=n;void 0===o&&(o=e>2?t.slice():new Array(r));for(var s=0;sTi?a=Ti:a<-Ti&&(a=-Ti),o[s+1]=a}return o}function Ri(t,n,i){var r=t.length,e=i>1?i:2,o=n;void 0===o&&(o=e>2?t.slice():new Array(r));for(var s=0;sn?r:new Array(1+n-e).join("0")+r}function Ji(t,n){for(var i=(""+t).split("."),r=(""+n).split("."),e=0;es)return 1;if(s>o)return-1}return 0}function Ki(t,n){return t[0]+=+n[0],t[1]+=+n[1],t}function Yi(t,n){var i=n.getRadius(),r=n.getCenter(),e=r[0],o=r[1],s=t[0]-e,a=t[1]-o;0===s&&0===a&&(s=1);var u=Math.sqrt(s*s+a*a);return[e+i*s/u,o+i*a/u]}function Zi(t,n){var i,r,e=t[0],o=t[1],s=n[0],a=n[1],u=s[0],c=s[1],h=a[0],f=a[1],l=h-u,v=f-c,d=0===l&&0===v?0:(l*(e-u)+v*(o-c))/(l*l+v*v||0);return d<=0?(i=u,r=c):d>=1?(i=h,r=f):(i=u+d*l,r=c+d*v),[i,r]}function $i(t,n,i){var r=mi(n+180,360)-180,e=Math.abs(3600*r),o=i||0,s=Math.pow(10,o),a=Math.floor(e/3600),u=Math.floor((e-3600*a)/60),c=e-3600*a-60*u;return(c=Math.ceil(c*s)/s)>=60&&(c=0,u+=1),u>=60&&(u=0,a+=1),a+"° "+Hi(u,2)+"′ "+Hi(c,2,o)+"″"+(0==r?"":" "+t.charAt(r<0?1:0))}function Qi(t,n,i){return t?n.replace("{x}",t[0].toFixed(i)).replace("{y}",t[1].toFixed(i)):""}function tr(t,n){for(var i=!0,r=t.length-1;r>=0;--r)if(t[r]!=n[r]){i=!1;break}return i}function nr(t,n){var i=Math.cos(n),r=Math.sin(n),e=t[0]*i-t[1]*r,o=t[1]*i+t[0]*r;return t[0]=e,t[1]=o,t}function ir(t,n){return t[0]*=n,t[1]*=n,t}function rr(t,n){var i=t[0]-n[0],r=t[1]-n[1];return i*i+r*r}function er(t,n){return Math.sqrt(rr(t,n))}function or(t,n){return rr(t,Zi(t,n))}function sr(t,n){return Qi(t,"{x}, {y}",n)}function ar(t,n){if(n.canWrapX()){var i=ti(n.getExtent()),r=ur(t,n,i);r&&(t[0]-=r*i)}return t}function ur(t,n,i){var r=n.getExtent(),e=0;if(n.canWrapX()&&(t[0]r[2])){var o=i||ti(r);e=Math.floor((t[0]-r[0])/o)}return e}var cr=6371008.8;function hr(t,n,i){var r=i||cr,e=yi(t[1]),o=yi(n[1]),s=(o-e)/2,a=yi(n[0]-t[0])/2,u=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(e)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))}function fr(t,n){for(var i=0,r=0,e=t.length;r=2;--c)s[a+c]=n[a+c]}return s}}function _r(t,n,i,r){var e=gr(t),o=gr(n);Vi(e,o,Mr(i)),Vi(o,e,Mr(r))}function Or(t,n){return pr(),Cr(t,"EPSG:4326",void 0!==n?n:"EPSG:3857")}function Tr(t,n){if(t===n)return!0;var i=t.getUnits()===n.getUnits();return(t.getCode()===n.getCode()||Er(t,n)===yr)&&i}function Er(t,n){var i=Xi(t.getCode(),n.getCode());return i||(i=mr),i}function Ar(t,n){return Er(gr(t),gr(n))}function Cr(t,n,i){return Ar(n,i)(t,void 0,t.length)}function Rr(t,n,i,r){return si(t,Ar(n,i),void 0,r)}var Pr=null;function Ir(t){Pr=gr(t)}function Nr(){return Pr}function zr(t,n){return Pr?Cr(t,n,Pr):t}function Fr(t,n){return Pr?Cr(t,Pr,n):(dr&&!tr(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(dr=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t)}function Lr(t,n){return Pr?Rr(t,n,Pr):t}function Gr(t,n){return Pr?Rr(t,Pr,n):t}function Dr(t,n){if(!Pr)return t;var i=gr(n).getUnits(),r=Pr.getUnits();return i&&r?t*Ft[i]/Ft[r]:t}function Ur(t,n){if(!Pr)return t;var i=gr(n).getUnits(),r=Pr.getUnits();return i&&r?t*Ft[r]/Ft[i]:t}function qr(t,n,i){return function(r){var e,o,s=r[0],a=r[1];if(t.canWrapX()){var u=t.getExtent(),c=ti(u);(o=ur(r,t,c))&&(s-=o*c),s=ci(s,u[0],u[2]),a=ci(a,u[1],u[3]),e=i([s,a])}else e=i(r);return o&&n.canWrapX()&&(e[0]+=o*ti(n.getExtent())),e}}function Br(){jr(Ai),jr(Li),Sr(Li,Ai,Ci,Ri)}function Wr(t,n,i,r,e,o){for(var s=o||[],a=0,u=n;u1)a=i;else{if(l>0){for(var v=0;ve&&(e=c),o=a,s=u}return e}function re(t,n,i,r,e){for(var o=0,s=i.length;o0;){for(var f=c.pop(),l=c.pop(),v=0,d=t[l],p=t[l+1],y=t[f],m=t[f+1],w=l+r;wv&&(h=w,v=b)}v>e&&(u[(h-n)/r]=1,l+re&&(o[s++]=c,o[s++]=h,a=c,u=h);return c==a&&h==u||(o[s++]=c,o[s++]=h),s}function pe(t,n){return n*Math.round(t/n)}function ye(t,n,i,r,e,o,s){if(n==i)return s;var a,u,c=pe(t[n],e),h=pe(t[n+1],e);n+=r,o[s++]=c,o[s++]=h;do{if(a=pe(t[n],e),u=pe(t[n+1],e),(n+=r)==i)return o[s++]=a,o[s++]=u,s}while(a==c&&u==h);for(;n0&&p>v)&&(d<0&&y0&&y>d)?(a=f,u=l):(o[s++]=a,o[s++]=u,c=a,h=u,a=f,u=l)}}return o[s++]=a,o[s++]=u,s}function me(t,n,i,r,e,o,s,a){for(var u=0,c=i.length;uo&&(c-a)*(o-u)-(e-a)*(h-u)>0&&s++:h<=o&&(c-a)*(o-u)-(e-a)*(h-u)<0&&s--,a=c,u=h}return 0!==s}function Ce(t,n,i,r,e,o){if(0===i.length)return!1;if(!Ae(t,n,i[0],r,e,o))return!1;for(var s=1,a=i.length;sx&&Ce(t,n,i,r,c=(h+f)/2,d)&&(g=c,x=j),h=f}return isNaN(g)&&(g=e[o]),s?(s.push(g,d,x),s):[g,d,x]}function Ie(t,n,i,r,e){for(var o=[],s=0,a=i.length;s=e[0]&&o[2]<=e[2]||(o[1]>=e[1]&&o[3]<=e[3]||Ne(t,n,i,r,(function(t,n){return oi(e,t,n)})))))}function Fe(t,n,i,r,e){for(var o=0,s=i.length;o0}function Be(t,n,i,r,e){for(var o=void 0!==e&&e,s=0,a=i.length;s0&&this.Jt[i+2]>t;)i-=3;var r=this.Jt[n+2]-this.Jt[i+2];if(r<1e3/60)return!1;var e=this.Jt[n]-this.Jt[i],o=this.Jt[n+1]-this.Jt[i+1];return this.Kt=Math.atan2(o,e),this.Yt=Math.sqrt(e*e+o*o)/r,this.Yt>this.Xt},t.prototype.getDistance=function(){return(this.Xt-this.Yt)/this.Vt},t.prototype.getAngle=function(){return this.Kt},t}(),Fo=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Lo=/^([a-z]*)$|^hsla?\(.*\)$/i;function Go(t){return"string"==typeof t?t:Wo(t)}function Do(t){var n=document.createElement("div");if(n.style.color=t,""!==n.style.color){document.body.appendChild(n);var i=getComputedStyle(n).color;return document.body.removeChild(n),i}return""}var Uo=function(){var t={},n=0;return function(i){var r;if(t.hasOwnProperty(i))r=t[i];else{if(n>=1024){var e=0;for(var o in t)0==(3&e++)&&(delete t[o],--n)}r=function(t){var n,i,r,e,o;Lo.exec(t)&&(t=Do(t));if(Fo.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var u=4===s||8===s;n=parseInt(t.substr(1+0*a,a),16),i=parseInt(t.substr(1+1*a,a),16),r=parseInt(t.substr(1+2*a,a),16),e=u?parseInt(t.substr(1+3*a,a),16):255,1==a&&(n=(n<<4)+n,i=(i<<4)+i,r=(r<<4)+r,u&&(e=(e<<4)+e)),o=[n,i,r,e/255]}else 0==t.indexOf("rgba(")?Bo(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Bo(o)):Mt(!1,14);return o}(i),t[i]=r,++n}return r}}();function qo(t){return Array.isArray(t)?t:Uo(t)}function Bo(t){return t[0]=ci(t[0]+.5|0,0,255),t[1]=ci(t[1]+.5|0,0,255),t[2]=ci(t[2]+.5|0,0,255),t[3]=ci(t[3],0,1),t}function Wo(t){var n=t[0];n!=(0|n)&&(n=n+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+n+","+i+","+r+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}function Vo(t){return Lo.test(t)&&(t=Do(t)),Fo.test(t)||0===t.indexOf("rgba(")||0===t.indexOf("rgb(")}var Xo=function(){function t(){this.Zt={},this.$t=0,this.Qt=32}return t.prototype.clear=function(){this.Zt={},this.$t=0},t.prototype.canExpireCache=function(){return this.$t>this.Qt},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var n in this.Zt){var i=this.Zt[n];0!=(3&t++)||i.hasListener()||(delete this.Zt[n],--this.$t)}}},t.prototype.get=function(t,n,i){var r=Ho(t,n,i);return r in this.Zt?this.Zt[r]:null},t.prototype.set=function(t,n,i,r){var e=Ho(t,n,i);this.Zt[e]=r,++this.$t},t.prototype.setSize=function(t){this.Qt=t,this.expire()},t}();function Ho(t,n,i){return n+":"+t+":"+(i?Go(i):"null")}var Jo=Xo,Ko=new Xo,Yo="opacity",Zo="visible",$o="extent",Qo="zIndex",ts="maxResolution",ns="minResolution",is="maxZoom",rs="minZoom",es="source",os="map";function ss(t){return(ss="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var as=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),us=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un,i.tn=n.background;var r=E({},n);return"object"===ss(n.properties)&&(delete r.properties,E(r,n.properties)),r[Yo]=void 0!==n.opacity?n.opacity:1,Mt("number"==typeof r[Yo],64),r[Zo]=void 0===n.visible||n.visible,r[Qo]=n.zIndex,r[ts]=void 0!==n.maxResolution?n.maxResolution:1/0,r[ns]=void 0!==n.minResolution?n.minResolution:0,r[rs]=void 0!==n.minZoom?n.minZoom:-1/0,r[is]=void 0!==n.maxZoom?n.maxZoom:1/0,i.nn=void 0!==r.className?r.className:"ol-layer",delete r.className,i.setProperties(r),i.rn=null,i}return as(n,t),n.prototype.getBackground=function(){return this.tn},n.prototype.getClassName=function(){return this.nn},n.prototype.getLayerState=function(t){var n=this.rn||{layer:this,managed:void 0===t||t},i=this.getZIndex();return n.opacity=ci(Math.round(100*this.getOpacity())/100,0,1),n.visible=this.getVisible(),n.extent=this.getExtent(),n.zIndex=void 0!==i||n.managed?i:1/0,n.maxResolution=this.getMaxResolution(),n.minResolution=Math.max(this.getMinResolution(),0),n.minZoom=this.getMinZoom(),n.maxZoom=this.getMaxZoom(),this.rn=n,n},n.prototype.getLayersArray=function(t){return r()},n.prototype.getLayerStatesArray=function(t){return r()},n.prototype.getExtent=function(){return this.get($o)},n.prototype.getMaxResolution=function(){return this.get(ts)},n.prototype.getMinResolution=function(){return this.get(ns)},n.prototype.getMinZoom=function(){return this.get(rs)},n.prototype.getMaxZoom=function(){return this.get(is)},n.prototype.getOpacity=function(){return this.get(Yo)},n.prototype.getSourceState=function(){return r()},n.prototype.getVisible=function(){return this.get(Zo)},n.prototype.getZIndex=function(){return this.get(Qo)},n.prototype.setBackground=function(t){this.tn=t,this.changed()},n.prototype.setExtent=function(t){this.set($o,t)},n.prototype.setMaxResolution=function(t){this.set(ts,t)},n.prototype.setMinResolution=function(t){this.set(ns,t)},n.prototype.setMaxZoom=function(t){this.set(is,t)},n.prototype.setMinZoom=function(t){this.set(rs,t)},n.prototype.setOpacity=function(t){Mt("number"==typeof t,64),this.set(Yo,t)},n.prototype.setVisible=function(t){this.set(Zo,t)},n.prototype.setZIndex=function(t){this.set(Qo,t)},n.prototype.disposeInternal=function(){this.rn&&(this.rn.layer=null,this.rn=null),t.prototype.disposeInternal.call(this)},n}(ot),cs="prerender",hs="postrender",fs="precompose",ls="postcompose",vs="rendercomplete",ds="undefined",ps="loading",ys="ready",ms="error",ws=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function bs(t,n){if(!t.visible)return!1;var i=n.resolution;if(i=t.maxResolution)return!1;var r=n.zoom;return r>t.minZoom&&r<=t.maxZoom}var gs=function(t){function n(n){var i=this,r=E({},n);delete r.source,(i=t.call(this,r)||this).on,i.once,i.un,i.en=null,i.sn=null,i.an=null,i.cn=null,i.rendered=!1,n.render&&(i.render=n.render),n.map&&i.setMap(n.map),i.addChangeListener(es,i.hn);var e=n.source?n.source:null;return i.setSource(e),i}return ws(n,t),n.prototype.getLayersArray=function(t){var n=t||[];return n.push(this),n},n.prototype.getLayerStatesArray=function(t){var n=t||[];return n.push(this.getLayerState()),n},n.prototype.getSource=function(){return this.get(es)||null},n.prototype.getRenderSource=function(){return this.getSource()},n.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():ds},n.prototype.fn=function(){this.changed()},n.prototype.hn=function(){this.an&&($(this.an),this.an=null);var t=this.getSource();t&&(this.an=Y(t,N,this.fn,this)),this.changed()},n.prototype.getFeatures=function(t){return this.cn?this.cn.getFeatures(t):new Promise((function(t){return t([])}))},n.prototype.getData=function(t){return this.cn&&this.rendered?this.cn.getData(t):null},n.prototype.render=function(t,n){var i=this.getRenderer();if(i.prepareFrame(t))return this.rendered=!0,i.renderFrame(t,n)},n.prototype.unrender=function(){this.rendered=!1},n.prototype.setMapInternal=function(t){t||this.unrender(),this.set(os,t)},n.prototype.getMapInternal=function(){return this.get(os)},n.prototype.setMap=function(t){this.en&&($(this.en),this.en=null),t||this.changed(),this.sn&&($(this.sn),this.sn=null),t&&(this.en=Y(t,fs,(function(t){var n=t.frameState.layerStatesArray,i=this.getLayerState(!1);Mt(!n.some((function(t){return t.layer===i.layer})),67),n.push(i)}),this),this.sn=Y(this,N,t.render,t),this.changed())},n.prototype.setSource=function(t){this.set(es,t)},n.prototype.getRenderer=function(){return this.cn||(this.cn=this.createRenderer()),this.cn},n.prototype.hasRenderer=function(){return!!this.cn},n.prototype.createRenderer=function(){return null},n.prototype.disposeInternal=function(){this.cn&&(this.cn.dispose(),delete this.cn),this.setSource(null),t.prototype.disposeInternal.call(this)},n}(us),xs=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function js(t,n){Ko.expire()}var Ss=function(t){function n(n){var i=t.call(this)||this;return i.vn=n,i}return xs(n,t),n.prototype.dispatchRenderEvent=function(t,n){r()},n.prototype.calculateMatrices2D=function(t){var n=t.viewState,i=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;un(i,t.size[0]/2,t.size[1]/2,1/n.resolution,-1/n.resolution,-n.rotation,-n.center[0],-n.center[1]),cn(r,i)},n.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e,o,s,a){var u,c=n.viewState;function h(t,n,i,r){return e.call(o,n,t?i:null,r)}var f=c.projection,l=ar(t.slice(),f),v=[[0,0]];if(f.canWrapX()&&r){var d=ti(f.getExtent());v.push([-d,0],[d,0])}for(var p=n.layerStatesArray,y=p.length,m=[],w=[],b=0;b=0;--g){var x=p[g],j=x.layer;if(j.hasRenderer()&&bs(x,c)&&s.call(a,j)){var S=j.getRenderer(),k=j.getSource();if(S&&k){var M=k.getWrapX()?l:t,_=h.bind(null,x.managed);w[0]=M[0]+v[b][0],w[1]=M[1]+v[b][1],u=S.forEachFeatureAtCoordinate(w,n,i,_,m)}if(u)return u}}if(0!==m.length){var O=1/m.length;return m.forEach((function(t,n){return t.distanceSq+=n*O})),m.sort((function(t,n){return t.distanceSq-n.distanceSq})),m.some((function(t){return u=t.callback(t.feature,t.layer,t.geometry)})),u}},n.prototype.forEachLayerAtPixel=function(t,n,i,e,o){return r()},n.prototype.hasFeatureAtCoordinate=function(t,n,i,r,e,o){return void 0!==this.forEachFeatureAtCoordinate(t,n,i,r,k,this,e,o)},n.prototype.getMap=function(){return this.vn},n.prototype.renderFrame=function(t){r()},n.prototype.scheduleExpireIconCache=function(t){Ko.canExpireCache()&&t.postRenderFunctions.push(js)},n}(v),ks=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ms=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.inversePixelTransform=i,o.frameState=r,o.context=e,o}return ks(n,t),n}(f),_s="ol-hidden",Os="ol-selectable",Ts="ol-unselectable",Es="ol-unsupported",As="ol-control",Cs="ol-collapsed",Rs=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),Ps=["style","variant","weight","size","lineHeight","family"],Is=function(t){var n=t.match(Rs);if(!n)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,e=Ps.length;r=0;--o)r[o].renderDeclutter(t);Po(this.pn,this.yn),this.dispatchRenderEvent(ls,t),this.mn||(this.pn.style.display="",this.mn=!0),this.scheduleExpireIconCache(t)}else this.mn&&(this.pn.style.display="none",this.mn=!1)},n.prototype.forEachLayerAtPixel=function(t,n,i,r,e){for(var o=n.viewState,s=n.layerStatesArray,a=s.length-1;a>=0;--a){var u=s[a],c=u.layer;if(c.hasRenderer()&&bs(u,o)&&e(c)){var h=c.getRenderer().getDataAtPixel(t,n,i);if(h){var f=r(c,h);if(f)return f}}}},n}(Ss),aa=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ua=function(t){function n(n,i){var r=t.call(this,n)||this;return r.layer=i,r}return aa(n,t),n}(f),ca="layers",ha=function(t){function n(n){var i=this,r=n||{},e=E({},r);delete e.layers;var o=r.layers;return(i=t.call(this,e)||this).on,i.once,i.un,i.wn=[],i.bn={},i.addChangeListener(ca,i.gn),o?Array.isArray(o)?o=new ft(o.slice(),{unique:!0}):Mt("function"==typeof o.getArray,43):o=new ft(void 0,{unique:!0}),i.setLayers(o),i}return aa(n,t),n.prototype.xn=function(){this.changed()},n.prototype.gn=function(){this.wn.forEach($),this.wn.length=0;var t=this.getLayers();for(var n in this.wn.push(Y(t,st,this.jn,this),Y(t,at,this.Sn,this)),this.bn)this.bn[n].forEach($);A(this.bn);for(var i=t.getArray(),r=0,e=i.length;rthis.Pn||Math.abs(t.clientY-this.In.clientY)>this.Pn},n.prototype.disposeInternal=function(){this.Dn&&($(this.Dn),this.Dn=null),this.pn.removeEventListener(J,this.qn),this.Fn&&($(this.Fn),this.Fn=null),this.Rn.forEach($),this.Rn.length=0,this.pn=null,t.prototype.disposeInternal.call(this)},n}(I),ja="postrender",Sa="movestart",ka="moveend",Ma="loadstart",_a="loadend",Oa="layergroup",Ta="size",Ea="target",Aa="view",Ca=1/0,Ra=function(){function t(t,n){this.Yn=t,this.Zn=n,this.$n=[],this.Qn=[],this.ti={}}return t.prototype.clear=function(){this.$n.length=0,this.Qn.length=0,A(this.ti)},t.prototype.dequeue=function(){var t=this.$n,n=this.Qn,i=t[0];1==t.length?(t.length=0,n.length=0):(t[0]=t.pop(),n[0]=n.pop(),this.ni(0));var r=this.Zn(i);return delete this.ti[r],i},t.prototype.enqueue=function(t){Mt(!(this.Zn(t)in this.ti),31);var n=this.Yn(t);return n!=Ca&&(this.$n.push(t),this.Qn.push(n),this.ti[this.Zn(t)]=!0,this.ii(0,this.$n.length-1),!0)},t.prototype.getCount=function(){return this.$n.length},t.prototype.ri=function(t){return 2*t+1},t.prototype.ei=function(t){return 2*t+2},t.prototype.oi=function(t){return t-1>>1},t.prototype.si=function(){var t;for(t=(this.$n.length>>1)-1;t>=0;t--)this.ni(t)},t.prototype.isEmpty=function(){return 0===this.$n.length},t.prototype.isKeyQueued=function(t){return t in this.ti},t.prototype.isQueued=function(t){return this.isKeyQueued(this.Zn(t))},t.prototype.ni=function(t){for(var n=this.$n,i=this.Qn,r=n.length,e=n[t],o=i[t],s=t;t>1;){var a=this.ri(t),u=this.ei(t),c=ut;){var s=this.oi(n);if(!(r[s]>o))break;i[n]=i[s],r[n]=r[s],n=s}i[n]=e,r[n]=o},t.prototype.reprioritize=function(){var t,n,i,r=this.Yn,e=this.$n,o=this.Qn,s=0,a=e.length;for(n=0;n0;)r=(i=this.dequeue()[0]).getKey(),i.getState()!==lt||r in this.hi||(this.hi[r]=!0,++this.ci,++e,i.load())},n}(Ra);function Na(t,n,i,r,e){if(!t||!(i in t.wantedTiles))return Ca;if(!t.wantedTiles[i][n.getKey()])return Ca;var o=t.viewState.center,s=r[0]-o[0],a=r[1]-o[1];return 65536*Math.log(e)+Math.sqrt(s*s+a*a)/e}var za=0,Fa=1,La={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},Ga=256;function Da(t,n,i){return function(r,e,o,s,a){if(r){if(!e&&!n)return r;var u=n?0:o[0]*e,c=n?0:o[1]*e,h=a?a[0]:0,f=a?a[1]:0,l=t[0]+u/2+h,v=t[2]-u/2+h,d=t[1]+c/2+f,p=t[3]-c/2+f;l>v&&(v=l=(v+l)/2),d>p&&(p=d=(p+d)/2);var y=ci(r[0],l,v),m=ci(r[1],d,p);if(s&&i&&e){var w=30*e;y+=-w*Math.log(1+Math.max(0,l-r[0])/w)+w*Math.log(1+Math.max(0,r[0]-v)/w),m+=-w*Math.log(1+Math.max(0,d-r[1])/w)+w*Math.log(1+Math.max(0,r[1]-p)/w)}return[y,m]}}}function Ua(t){return t}function qa(t,n,i,r){var e=ti(n)/i[0],o=Yn(n)/i[1];return r?Math.min(t,Math.max(e,o)):Math.min(t,Math.min(e,o))}function Ba(t,n,i){var r=Math.min(t,n);return r*=Math.log(1+50*Math.max(0,t/n-1))/50+1,i&&(r=Math.max(r,i),r/=Math.log(1+50*Math.max(0,i/t-1))/50+1),ci(r,i/2,2*n)}function Wa(t,n,i,r){return function(e,o,s,a){if(void 0!==e){var u=t[0],c=t[t.length-1],h=i?qa(u,i,s,r):u;if(a)return void 0===n||n?Ba(e,h,c):ci(e,c,h);var f=Math.min(h,e),l=Math.floor(m(t,f,o));return t[l]>h&&l1&&"function"==typeof arguments[i-1]&&(n=arguments[i-1],--i);for(var r=0;r0},n.prototype.getInteracting=function(){return this.fi[Fa]>0},n.prototype.cancelAnimations=function(){var t;this.setHint(za,-this.fi[za]);for(var n=0,i=this.li.length;n=0;--i){for(var r=this.li[i],e=!0,o=0,s=r.length;o0?u/a.duration:1;c>=1?(a.complete=!0,c=1):e=!1;var h=a.easing(c);if(a.sourceCenter){var f=a.sourceCenter[0],l=a.sourceCenter[1],v=a.targetCenter[0],d=a.targetCenter[1];this.gi=a.targetCenter;var p=f+h*(v-f),y=l+h*(d-l);this.mi=[p,y]}if(a.sourceResolution&&a.targetResolution){var m=1===h?a.targetResolution:a.sourceResolution+h*(a.targetResolution-a.sourceResolution);if(a.anchor){var w=this.Ii(this.getRotation()),b=this.Ci.resolution(m,0,w,!0);this.mi=this.calculateCenterZoom(b,a.anchor)}this.xi=a.targetResolution,this.wi=m,this.Ni(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var g=1===h?mi(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+h*(a.targetRotation-a.sourceRotation);if(a.anchor){var x=this.Ci.rotation(g,!0);this.mi=this.calculateCenterRotate(x,a.anchor)}this.ji=a.targetRotation,this.bi=g}if(this.Ni(!0),n=!0,!a.complete)break}}if(e){this.li[i]=null,this.setHint(za,-1),this.gi=null,this.xi=NaN,this.ji=NaN;var j=r[0].callback;j&&$a(j,!0)}}this.li=this.li.filter(Boolean),n&&void 0===this.vi&&(this.vi=requestAnimationFrame(this.Pi.bind(this)))}},n.prototype.calculateCenterRotate=function(t,n){var i,r=this.getCenterInternal();return void 0!==r&&(nr(i=[r[0]-n[0],r[1]-n[1]],t-this.getRotation()),Ki(i,n)),i},n.prototype.calculateCenterZoom=function(t,n){var i,r=this.getCenterInternal(),e=this.getResolution();void 0!==r&&void 0!==e&&(i=[n[0]-t*(n[0]-r[0])/e,n[1]-t*(n[1]-r[1])/e]);return i},n.prototype.Ii=function(t){var n=this.yi;if(t){var i=n[0],r=n[1];return[Math.abs(i*Math.cos(t))+Math.abs(r*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(r*Math.cos(t))]}return n},n.prototype.setViewportSize=function(t){this.yi=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},n.prototype.getCenter=function(){var t=this.getCenterInternal();return t?zr(t,this.getProjection()):t},n.prototype.getCenterInternal=function(){return this.get(La.CENTER)},n.prototype.getConstraints=function(){return this.Ci},n.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},n.prototype.getHints=function(t){return void 0!==t?(t[0]=this.fi[0],t[1]=this.fi[1],t):this.fi.slice()},n.prototype.calculateExtent=function(t){return Lr(this.calculateExtentInternal(t),this.getProjection())},n.prototype.calculateExtentInternal=function(t){var n=t||this.zi(),i=this.getCenterInternal();Mt(i,1);var r=this.getResolution();Mt(void 0!==r,2);var e=this.getRotation();return Mt(void 0!==e,3),Kn(i,r,e,n)},n.prototype.getMaxResolution=function(){return this.Mi},n.prototype.getMinResolution=function(){return this._i},n.prototype.getMaxZoom=function(){return this.getZoomForResolution(this._i)},n.prototype.setMaxZoom=function(t){this.ki(this.Ri({maxZoom:t}))},n.prototype.getMinZoom=function(){return this.getZoomForResolution(this.Mi)},n.prototype.setMinZoom=function(t){this.ki(this.Ri({minZoom:t}))},n.prototype.setConstrainResolution=function(t){this.ki(this.Ri({constrainResolution:t}))},n.prototype.getProjection=function(){return this.di},n.prototype.getResolution=function(){return this.get(La.RESOLUTION)},n.prototype.getResolutions=function(){return this.Ti},n.prototype.getResolutionForExtent=function(t,n){return this.getResolutionForExtentInternal(Gr(t,this.getProjection()),n)},n.prototype.getResolutionForExtentInternal=function(t,n){var i=n||this.zi(),r=ti(t)/i[0],e=Yn(t)/i[1];return Math.max(r,e)},n.prototype.getResolutionForValueFunction=function(t){var n=t||2,i=this.getConstrainedResolution(this.Mi),r=this._i,e=Math.log(i/r)/Math.log(n);return function(t){return i/Math.pow(n,t*e)}},n.prototype.getRotation=function(){return this.get(La.ROTATION)},n.prototype.getValueForResolutionFunction=function(t){var n=Math.log(t||2),i=this.getConstrainedResolution(this.Mi),r=this._i,e=Math.log(i/r)/n;return function(t){return Math.log(i/t)/n/e}},n.prototype.zi=function(t){var n=this.Ii(t),i=this.Ei;return i&&(n=[n[0]-i[1]-i[3],n[1]-i[0]-i[2]]),n},n.prototype.getState=function(){var t=this.getProjection(),n=this.getResolution(),i=this.getRotation(),r=this.getCenterInternal(),e=this.Ei;if(e){var o=this.zi();r=ru(r,this.Ii(),[o[0]/2+e[3],o[1]/2+e[0]],n,i)}return{center:r.slice(0),projection:void 0!==t?t:null,resolution:n,nextCenter:this.gi,nextResolution:this.xi,nextRotation:this.ji,rotation:i,zoom:this.getZoom()}},n.prototype.getZoom=function(){var t,n=this.getResolution();return void 0!==n&&(t=this.getZoomForResolution(n)),t},n.prototype.getZoomForResolution=function(t){var n,i,r=this.Ai||0;if(this.Ti){var e=m(this.Ti,t,1);r=e,n=this.Ti[e],i=e==this.Ti.length-1?2:n/this.Ti[e+1]}else n=this.Mi,i=this.Oi;return r+Math.log(n/t)/Math.log(i)},n.prototype.getResolutionForZoom=function(t){if(this.Ti){if(this.Ti.length<=1)return 0;var n=ci(Math.floor(t),0,this.Ti.length-2),i=this.Ti[n]/this.Ti[n+1];return this.Ti[n]/Math.pow(i,ci(t-n,0,1))}return this.Mi/Math.pow(this.Oi,t-this.Ai)},n.prototype.fit=function(t,n){var i;if(Mt(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))Mt(!ii(t),25),i=$e(r=Gr(t,this.getProjection()));else if(t.getType()===Pt.CIRCLE){var r;(i=$e(r=Gr(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),Hn(r))}else{var e=Nr();i=e?t.clone().transform(e,this.getProjection()):t}this.fitInternal(i,n)},n.prototype.rotatedExtentForGeometry=function(t){for(var n=this.getRotation(),i=Math.cos(n),r=Math.sin(-n),e=t.getFlatCoordinates(),o=t.getStride(),s=1/0,a=1/0,u=-1/0,c=-1/0,h=0,f=e.length;h0&&t[1]>0}function au(t,n,i){return void 0===i&&(i=[0,0]),i[0]=t[0]*n+.5|0,i[1]=t[1]*n+.5|0,i}function uu(t,n){return Array.isArray(t)?t:(void 0===n?n=[t,t]:(n[0]=t,n[1]=t),n)}var cu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function hu(t){t instanceof gs?t.setMapInternal(null):t instanceof ha&&t.getLayers().forEach(hu)}function fu(t,n){if(t instanceof gs)t.setMapInternal(n);else if(t instanceof ha)for(var i=t.getLayers().getArray(),r=0,e=i.length;r=0;a--){var u=s[a];if(u.getMap()===this&&u.getActive()&&this.getTargetElement())if(!u.handleEvent(t)||t.propagationStopped)break}}},n.prototype.handlePostRender=function(){var t=this.Ji,n=this.cr;if(!n.isEmpty()){var i=this.Di,r=i;if(t){var e=t.viewHints;if(e[za]||e[Fa]){var o=Date.now()-t.time>8;i=o?0:8,r=o?0:2}}n.getTilesLoading()0;if(this.mn!=i&&(this.element.style.display=i?"":"none",this.mn=i),!x(n,this.Pr)){Ro(this.Sr);for(var r=0,e=n.length;r0&&n%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.Lr,easing:wt}):t.setRotation(0))}},n.prototype.render=function(t){var n=t.frameState;if(n){var i=n.viewState.rotation;if(i!=this.Dr){var r="rotate("+i+"rad)";if(this.Gr){var e=this.element.classList.contains(_s);e||0!==i?e&&0!==i&&this.element.classList.remove(_s):this.element.classList.add(_s)}this.Ar.style.transform=r}this.Dr=i}},n}(du),bu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gu=function(t){function n(n){var i=this,r=n||{};i=t.call(this,{element:document.createElement("div"),target:r.target})||this;var e=void 0!==r.className?r.className:"ol-zoom",o=void 0!==r.delta?r.delta:1,s=void 0!==r.zoomInClassName?r.zoomInClassName:e+"-in",a=void 0!==r.zoomOutClassName?r.zoomOutClassName:e+"-out",u=void 0!==r.zoomInLabel?r.zoomInLabel:"+",c=void 0!==r.zoomOutLabel?r.zoomOutLabel:"–",h=void 0!==r.zoomInTipLabel?r.zoomInTipLabel:"Zoom in",f=void 0!==r.zoomOutTipLabel?r.zoomOutTipLabel:"Zoom out",l=document.createElement("button");l.className=s,l.setAttribute("type","button"),l.title=h,l.appendChild("string"==typeof u?document.createTextNode(u):u),l.addEventListener(G,i.Rr.bind(i,o),!1);var v=document.createElement("button");v.className=a,v.setAttribute("type","button"),v.title=f,v.appendChild("string"==typeof c?document.createTextNode(c):c),v.addEventListener(G,i.Rr.bind(i,-o),!1);var d=e+" "+"ol-unselectable "+As,p=i.element;return p.className=d,p.appendChild(l),p.appendChild(v),i.Lr=void 0!==r.duration?r.duration:250,i}return bu(n,t),n.prototype.Rr=function(t,n){n.preventDefault(),this.qr(t)},n.prototype.qr=function(t){var n=this.getMap().getView();if(n){var i=n.getZoom();if(void 0!==i){var r=n.getConstrainedZoom(i+t);this.Lr>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:r,duration:this.Lr,easing:wt})):n.setZoom(r)}}},n}(du);function xu(t){var n=t||{},i=new ft;return(void 0===n.zoom||n.zoom)&&i.push(new gu(n.zoomOptions)),(void 0===n.rotate||n.rotate)&&i.push(new wu(n.rotateOptions)),(void 0===n.attribution||n.attribution)&&i.push(new yu(n.attributionOptions)),i}var ju="active",Su=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function ku(t,n,i){var r=t.getCenterInternal();if(r){var e=[r[0]+n[0],r[1]+n[1]];t.animateInternal({duration:void 0!==i?i:250,easing:gt,center:t.getConstrainedCenter(e)})}}function Mu(t,n,i,r){var e=t.getZoom();if(void 0!==e){var o=t.getConstrainedZoom(e+n),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:i,duration:void 0!==r?r:250,easing:wt})}}var _u=function(t){function n(n){var i=t.call(this)||this;return i.on,i.once,i.un,n&&n.handleEvent&&(i.handleEvent=n.handleEvent),i.vn=null,i.setActive(!0),i}return Su(n,t),n.prototype.getActive=function(){return this.get(ju)},n.prototype.getMap=function(){return this.vn},n.prototype.handleEvent=function(t){return!0},n.prototype.setActive=function(t){this.set(ju,t)},n.prototype.setMap=function(t){this.vn=t},n}(ot),Ou=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tu=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Br=r.delta?r.delta:1,i.Lr=void 0!==r.duration?r.duration:250,i}return Ou(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==pa.DBLCLICK){var i=t.originalEvent,r=t.map,e=t.coordinate,o=i.shiftKey?-this.Br:this.Br;Mu(r.getView(),o,e,this.Lr),i.preventDefault(),n=!0}return!n},n}(_u),Eu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Au(t){for(var n=t.length,i=0,r=0,e=0;e0}}else if(t.type==pa.POINTERDOWN){var r=this.handleDownEvent(t);this.handlingDownUpSequence=r,n=this.stopDown(r)}else t.type==pa.POINTERMOVE&&this.handleMoveEvent(t);return!n},n.prototype.handleMoveEvent=function(t){},n.prototype.handleUpEvent=function(t){return!1},n.prototype.stopDown=function(t){return t},n.prototype.Vr=function(t){if(function(t){var n=t.type;return n===pa.POINTERDOWN||n===pa.POINTERDRAG||n===pa.POINTERUP}(t)){var n=t.originalEvent,i=n.pointerId.toString();t.type==pa.POINTERUP?delete this.Wr[i]:(t.type==pa.POINTERDOWN||i in this.Wr)&&(this.Wr[i]=n),this.targetPointers=C(this.Wr)}},n}(_u);function Ru(t){var n=arguments;return function(t){for(var i=!0,r=0,e=n.length;r0&&this.Kr(t)){var n=t.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.Xr&&this.Xr.begin(),this.Yr=this.targetPointers.length>1,!0}return!1},n}(Cu),Ju=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ku=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,{stopDown:M})||this).Kr=r.condition?r.condition:Iu,i.Zr=void 0,i.Lr=void 0!==r.duration?r.duration:250,i}return Ju(n,t),n.prototype.handleDragEvent=function(t){if(Wu(t)){var n=t.map,i=n.getView();if(i.getConstraints().rotation!==Ha){var r=n.getSize(),e=t.pixel,o=Math.atan2(r[1]/2-e[1],e[0]-r[0]/2);if(void 0!==this.Zr){var s=o-this.Zr;i.adjustRotationInternal(-s)}this.Zr=o}}},n.prototype.handleUpEvent=function(t){return!Wu(t)||(t.map.getView().endInteraction(this.Lr),!1)},n.prototype.handleDownEvent=function(t){return!!Wu(t)&&(!(!Lu(t)||!this.Kr(t))&&(t.map.getView().beginInteraction(),this.Zr=void 0,!0))},n}(Cu),Yu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Zu=function(t){function n(n){var i=t.call(this)||this;return i.$r=null,i.pn=document.createElement("div"),i.pn.style.position="absolute",i.pn.style.pointerEvents="auto",i.pn.className="ol-box "+n,i.vn=null,i.Qr=null,i.te=null,i}return Yu(n,t),n.prototype.disposeInternal=function(){this.setMap(null)},n.prototype.ne=function(){var t=this.Qr,n=this.te,i="px",r=this.pn.style;r.left=Math.min(t[0],n[0])+i,r.top=Math.min(t[1],n[1])+i,r.width=Math.abs(n[0]-t[0])+i,r.height=Math.abs(n[1]-t[1])+i},n.prototype.setMap=function(t){if(this.vn){this.vn.getOverlayContainer().removeChild(this.pn);var n=this.pn.style;n.left="inherit",n.top="inherit",n.width="inherit",n.height="inherit"}this.vn=t,this.vn&&this.vn.getOverlayContainer().appendChild(this.pn)},n.prototype.setPixels=function(t,n){this.Qr=t,this.te=n,this.createOrUpdateGeometry(),this.ne()},n.prototype.createOrUpdateGeometry=function(){var t=this.Qr,n=this.te,i=[t,[t[0],n[1]],n,[n[0],t[1]]].map(this.vn.getCoordinateFromPixelInternal,this.vn);i[4]=i[0].slice(),this.$r?this.$r.setCoordinates([i]):this.$r=new Ye([i])},n.prototype.getGeometry=function(){return this.$r},n}(v),$u=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qu="boxstart",tc="boxdrag",nc="boxend",ic="boxcancel",rc=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.coordinate=i,e.mapBrowserEvent=r,e}return $u(n,t),n}(f),ec=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r=n||{};return i.ie=new Zu(r.className||"ol-dragbox"),i.re=void 0!==r.minArea?r.minArea:64,r.onBoxEnd&&(i.onBoxEnd=r.onBoxEnd),i.Qr=null,i.Kr=r.condition?r.condition:Lu,i.ee=r.boxEndCondition?r.boxEndCondition:i.defaultBoxEndCondition,i}return $u(n,t),n.prototype.defaultBoxEndCondition=function(t,n,i){var r=i[0]-n[0],e=i[1]-n[1];return r*r+e*e>=this.re},n.prototype.getGeometry=function(){return this.ie.getGeometry()},n.prototype.handleDragEvent=function(t){this.ie.setPixels(this.Qr,t.pixel),this.dispatchEvent(new rc(tc,t.coordinate,t))},n.prototype.handleUpEvent=function(t){this.ie.setMap(null);var n=this.ee(t,this.Qr,t.pixel);return n&&this.onBoxEnd(t),this.dispatchEvent(new rc(n?nc:ic,t.coordinate,t)),!1},n.prototype.handleDownEvent=function(t){return!!this.Kr(t)&&(this.Qr=t.pixel,this.ie.setMap(t.map),this.ie.setPixels(this.Qr,this.Qr),this.dispatchEvent(new rc(Qu,t.coordinate,t)),!0)},n.prototype.onBoxEnd=function(t){},n}(Cu),oc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sc=function(t){function n(n){var i=this,r=n||{},e=r.condition?r.condition:qu;return(i=t.call(this,{condition:e,className:r.className||"ol-dragzoom",minArea:r.minArea})||this).Lr=void 0!==r.duration?r.duration:200,i.oe=void 0!==r.out&&r.out,i}return oc(n,t),n.prototype.onBoxEnd=function(t){var n=this.getMap().getView(),i=this.getGeometry();if(this.oe){var r=n.rotatedExtentForGeometry(i),e=n.getResolutionForExtentInternal(r),o=n.getResolution()/e;(i=i.clone()).scale(o*o)}n.fitInternal(i,{duration:this.Lr,easing:wt})},n}(ec),ac=37,uc=38,cc=39,hc=40,fc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lc=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.se=function(t){return Uu(t)&&Bu(t)},i.Kr=void 0!==r.condition?r.condition:i.se,i.Lr=void 0!==r.duration?r.duration:100,i.ae=void 0!==r.pixelDelta?r.pixelDelta:128,i}return fc(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==W){var i=t.originalEvent,r=i.keyCode;if(this.Kr(t)&&(r==hc||r==ac||r==cc||r==uc)){var e=t.map.getView(),o=e.getResolution()*this.ae,s=0,a=0;r==hc?a=-o:r==ac?s=-o:r==cc?s=o:a=o;var u=[s,a];nr(u,e.getRotation()),ku(e,u,this.Lr),i.preventDefault(),n=!0}}return!n},n}(_u),vc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),dc=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Kr=r.condition?r.condition:Bu,i.Br=r.delta?r.delta:1,i.Lr=void 0!==r.duration?r.duration:100,i}return vc(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==W||t.type==V){var i=t.originalEvent,r=i.charCode;if(this.Kr(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var e=t.map,o=r=="+".charCodeAt(0)?this.Br:-this.Br;Mu(e.getView(),o,void 0,this.Lr),i.preventDefault(),n=!0}}return!n},n}(_u),pc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yc="trackpad",mc="wheel",wc=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,r)||this).ue=0,i.ce=0,i.wt=void 0!==r.maxDelta?r.maxDelta:1,i.Lr=void 0!==r.duration?r.duration:250,i.he=void 0!==r.timeout?r.timeout:80,i.fe=void 0===r.useAnchor||r.useAnchor,i.le=void 0!==r.constrainResolution&&r.constrainResolution;var e=r.condition?r.condition:Fu;return i.Kr=r.onFocusOnly?Ru(zu,e):e,i.ve=null,i.de=void 0,i.pe,i.ye=void 0,i.me=400,i.we,i.be=300,i}return pc(n,t),n.prototype.ge=function(){this.we=void 0,this.getMap().getView().endInteraction(void 0,this.ce?this.ce>0?1:-1:0,this.ve)},n.prototype.handleEvent=function(t){if(!this.Kr(t))return!0;if(t.type!==K)return!0;var n,i=t.map,r=t.originalEvent;if(r.preventDefault(),this.fe&&(this.ve=t.coordinate),t.type==K&&(n=r.deltaY,Ut&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(n/=Xt),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(n*=40)),0===n)return!1;this.ce=n;var e=Date.now();void 0===this.de&&(this.de=e),(!this.ye||e-this.de>this.me)&&(this.ye=Math.abs(n)<4?yc:mc);var o=i.getView();if(this.ye===yc&&!o.getConstrainResolution()&&!this.le)return this.we?clearTimeout(this.we):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.we=setTimeout(this.ge.bind(this),this.he),o.adjustZoom(-n/this.be,this.ve),this.de=e,!1;this.ue+=n;var s=Math.max(this.he-(e-this.de),0);return clearTimeout(this.pe),this.pe=setTimeout(this.xe.bind(this,i),s),!1},n.prototype.xe=function(t){var n=t.getView();n.getAnimating()&&n.cancelAnimations();var i=-ci(this.ue,-this.wt*this.be,this.wt*this.be)/this.be;(n.getConstrainResolution()||this.le)&&(i=i?i>0?1:-1:0),Mu(n,i,this.ve,this.Lr),this.ye=void 0,this.ue=0,this.ve=null,this.de=void 0,this.pe=void 0},n.prototype.setMouseAnchor=function(t){this.fe=t,t||(this.ve=null)},n}(_u),bc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gc=function(t){function n(n){var i=this,r=n||{},e=r;return e.stopDown||(e.stopDown=M),(i=t.call(this,e)||this).je=null,i.Zr=void 0,i.Se=!1,i.ke=0,i.Me=void 0!==r.threshold?r.threshold:.3,i.Lr=void 0!==r.duration?r.duration:250,i}return bc(n,t),n.prototype.handleDragEvent=function(t){var n=0,i=this.targetPointers[0],r=this.targetPointers[1],e=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(void 0!==this.Zr){var o=e-this.Zr;this.ke+=o,!this.Se&&Math.abs(this.ke)>this.Me&&(this.Se=!0),n=o}this.Zr=e;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==Ha){var u=s.getViewport().getBoundingClientRect(),c=Au(this.targetPointers);c[0]-=u.left,c[1]-=u.top,this.je=s.getCoordinateFromPixelInternal(c),this.Se&&(s.render(),a.adjustRotationInternal(n,this.je))}},n.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.Lr),!1)},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var n=t.map;return this.je=null,this.Zr=void 0,this.Se=!1,this.ke=0,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1},n}(Cu),xc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),jc=function(t){function n(n){var i=this,r=n||{},e=r;return e.stopDown||(e.stopDown=M),(i=t.call(this,e)||this).je=null,i.Lr=void 0!==r.duration?r.duration:400,i._e=void 0,i.Oe=1,i}return xc(n,t),n.prototype.handleDragEvent=function(t){var n=1,i=this.targetPointers[0],r=this.targetPointers[1],e=i.clientX-r.clientX,o=i.clientY-r.clientY,s=Math.sqrt(e*e+o*o);void 0!==this._e&&(n=this._e/s),this._e=s;var a=t.map,u=a.getView();1!=n&&(this.Oe=n);var c=a.getViewport().getBoundingClientRect(),h=Au(this.targetPointers);h[0]-=c.left,h[1]-=c.top,this.je=a.getCoordinateFromPixelInternal(h),a.render(),u.adjustResolutionInternal(n,this.je)},n.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var n=t.map.getView(),i=this.Oe>1?1:-1;return n.endInteraction(this.Lr,i),!1}return!0},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var n=t.map;return this.je=null,this._e=void 0,this.Oe=1,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1},n}(Cu);function Sc(t){var n=t||{},i=new ft,r=new zo(-.005,.05,100);return(void 0===n.altShiftDragRotate||n.altShiftDragRotate)&&i.push(new Ku),(void 0===n.doubleClickZoom||n.doubleClickZoom)&&i.push(new Tu({delta:n.zoomDelta,duration:n.zoomDuration})),(void 0===n.dragPan||n.dragPan)&&i.push(new Hu({onFocusOnly:n.onFocusOnly,kinetic:r})),(void 0===n.pinchRotate||n.pinchRotate)&&i.push(new gc),(void 0===n.pinchZoom||n.pinchZoom)&&i.push(new jc({duration:n.zoomDuration})),(void 0===n.keyboard||n.keyboard)&&(i.push(new lc),i.push(new dc({delta:n.zoomDelta,duration:n.zoomDuration}))),(void 0===n.mouseWheelZoom||n.mouseWheelZoom)&&i.push(new wc({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(void 0===n.shiftDragZoom||n.shiftDragZoom)&&i.push(new sc({duration:n.zoomDuration})),i}var kc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mc=function(t){function n(n){return(n=E({},n)).controls||(n.controls=xu()),n.interactions||(n.interactions=Sc({onFocusOnly:!0})),t.call(this,n)||this}return kc(n,t),n.prototype.createRenderer=function(){return new sa(this)},n}(lu),_c="bottom-left",Oc="bottom-center",Tc="bottom-right",Ec="center-left",Ac="center-center",Cc="center-right",Rc="top-left",Pc="top-center",Ic="top-right";function Nc(t){return(Nc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var zc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fc="element",Lc="map",Gc="offset",Dc="position",Uc="positioning",qc=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un,i.options=n,i.id=n.id,i.insertFirst=void 0===n.insertFirst||n.insertFirst,i.stopEvent=void 0===n.stopEvent||n.stopEvent,i.element=document.createElement("div"),i.element.className=void 0!==n.className?n.className:"ol-overlay-container ol-selectable",i.element.style.position="absolute",i.element.style.pointerEvents="auto";var r=n.autoPan;return r&&"object"!==Nc(r)&&(r={animation:n.autoPanAnimation,margin:n.autoPanMargin}),i.autoPan=r||!1,i.rendered={_t:"",visible:!0},i.mapPostrenderListenerKey=null,i.addChangeListener(Fc,i.handleElementChanged),i.addChangeListener(Lc,i.handleMapChanged),i.addChangeListener(Gc,i.handleOffsetChanged),i.addChangeListener(Dc,i.handlePositionChanged),i.addChangeListener(Uc,i.handlePositioningChanged),void 0!==n.element&&i.setElement(n.element),i.setOffset(void 0!==n.offset?n.offset:[0,0]),i.setPositioning(void 0!==n.positioning?n.positioning:Rc),void 0!==n.position&&i.setPosition(n.position),i}return zc(n,t),n.prototype.getElement=function(){return this.get(Fc)},n.prototype.getId=function(){return this.id},n.prototype.getMap=function(){return this.get(Lc)||null},n.prototype.getOffset=function(){return this.get(Gc)},n.prototype.getPosition=function(){return this.get(Dc)},n.prototype.getPositioning=function(){return this.get(Uc)},n.prototype.handleElementChanged=function(){Ro(this.element);var t=this.getElement();t&&this.element.appendChild(t)},n.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(Co(this.element),$(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=Y(t,ja,this.render,this),this.updatePixelPosition();var n=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?n.insertBefore(this.element,n.childNodes[0]||null):n.appendChild(this.element),this.performAutoPan()}},n.prototype.render=function(){this.updatePixelPosition()},n.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},n.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},n.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},n.prototype.setElement=function(t){this.set(Fc,t)},n.prototype.setMap=function(t){this.set(Lc,t)},n.prototype.setOffset=function(t){this.set(Gc,t)},n.prototype.setPosition=function(t){this.set(Dc,t)},n.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},n.prototype.panIntoView=function(t){var n=this.getMap();if(n&&n.getTargetElement()&&this.get(Dc)){var i=this.getRect(n.getTargetElement(),n.getSize()),r=this.getElement(),e=this.getRect(r,[To(r),Eo(r)]),o=t||{},s=void 0===o.margin?20:o.margin;if(!On(i,e)){var a=e[0]-i[0],u=i[2]-e[2],c=e[1]-i[1],h=i[3]-e[3],f=[0,0];if(a<0?f[0]=a-s:u<0&&(f[0]=Math.abs(u)+s),c<0?f[1]=c-s:h<0&&(f[1]=Math.abs(h)+s),0!==f[0]||0!==f[1]){var l=n.getView().getCenterInternal(),v=n.getPixelFromCoordinateInternal(l);if(!v)return;var d=[v[0]+f[0],v[1]+f[1]],p=o.animation||{};n.getView().animateInternal({center:n.getCoordinateFromPixelInternal(d),duration:p.duration,easing:p.easing})}}}},n.prototype.getRect=function(t,n){var i=t.getBoundingClientRect(),r=i.left+window.pageXOffset,e=i.top+window.pageYOffset;return[r,e,r+n[0],e+n[1]]},n.prototype.setPositioning=function(t){this.set(Uc,t)},n.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},n.prototype.updatePixelPosition=function(){var t=this.getMap(),n=this.getPosition();if(t&&t.isRendered()&&n){var i=t.getPixelFromCoordinate(n),r=t.getSize();this.updateRenderedPosition(i,r)}else this.setVisible(!1)},n.prototype.updateRenderedPosition=function(t,n){var i=this.element.style,r=this.getOffset(),e=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+r[0])+"px",s=Math.round(t[1]+r[1])+"px",a="0%",u="0%";e==Tc||e==Cc||e==Ic?a="-100%":e!=Oc&&e!=Ac&&e!=Pc||(a="-50%"),e==_c||e==Oc||e==Tc?u="-100%":e!=Ec&&e!=Ac&&e!=Cc||(u="-50%");var c="translate(".concat(a,", ").concat(u,") translate(").concat(o,", ").concat(s,")");this.rendered._t!=c&&(this.rendered._t=c,i.transform=c,i.msTransform=c)},n.prototype.getOptions=function(){return this.options},n}(ot),Bc=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.Te=0,this.Ee={},this.Ae=null,this.Ce=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.Te=0,this.Ee={},this.Ae=null,this.Ce=null},t.prototype.containsKey=function(t){return this.Ee.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var n=this.Ae;n;)t(n.Re,n.Pe,this),n=n.newer},t.prototype.get=function(t,n){var i=this.Ee[t];return Mt(void 0!==i,15),i===this.Ce||(i===this.Ae?(this.Ae=this.Ae.newer,this.Ae.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.Ce,this.Ce.newer=i,this.Ce=i),i.Re},t.prototype.remove=function(t){var n=this.Ee[t];return Mt(void 0!==n,15),n===this.Ce?(this.Ce=n.older,this.Ce&&(this.Ce.newer=null)):n===this.Ae?(this.Ae=n.newer,this.Ae&&(this.Ae.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.Ee[t],--this.Te,n.Re},t.prototype.getCount=function(){return this.Te},t.prototype.getKeys=function(){var t,n=new Array(this.Te),i=0;for(t=this.Ce;t;t=t.older)n[i++]=t.Pe;return n},t.prototype.getValues=function(){var t,n=new Array(this.Te),i=0;for(t=this.Ce;t;t=t.older)n[i++]=t.Re;return n},t.prototype.peekLast=function(){return this.Ae.Re},t.prototype.peekLastKey=function(){return this.Ae.Pe},t.prototype.peekFirstKey=function(){return this.Ce.Pe},t.prototype.pop=function(){var t=this.Ae;return delete this.Ee[t.Pe],t.newer&&(t.newer.older=null),this.Ae=t.newer,this.Ae||(this.Ce=null),--this.Te,t.Re},t.prototype.replace=function(t,n){this.get(t),this.Ee[t].Re=n},t.prototype.set=function(t,n){Mt(!(t in this.Ee),16);var i={Pe:t,newer:null,older:this.Ce,Re:n};this.Ce?this.Ce.newer=i:this.Ae=i,this.Ce=i,this.Ee[t]=i,++this.Te},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function Wc(t,n,i,r){return void 0!==r?(r[0]=t,r[1]=n,r[2]=i,r):[t,n,i]}function Vc(t,n,i){return t+"/"+n+"/"+i}function Xc(t){return Vc(t[0],t[1],t[2])}function Hc(t){var n=t.substring(t.lastIndexOf("/")+1,t.length).split(",").map(Number);return Vc(n[0],n[1],n[2])}function Jc(t){return t.split("/").map(Number)}function Kc(t){return(t[1]<i||i>n.getMaxZoom())return!1;var o=n.getFullTileRange(i);return!o||o.containsXY(r,e)}var Zc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$c=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Zc(n,t),n.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},n.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=Jc(this.peekFirstKey())[0];this.forEach(function(n){n.tileCoord[0]!==t&&(this.remove(Xc(n.tileCoord)),n.release())}.bind(this))}},n}(Bc),Qc=function(){function t(t,n,i,r){this.minX=t,this.maxX=n,this.minY=i,this.maxY=r}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,n){return this.minX<=t&&t<=this.maxX&&this.minY<=n&&n<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function th(t,n,i,r,e){return void 0!==e?(e.minX=t,e.maxX=n,e.minY=i,e.maxY=r,e):new Qc(t,n,i,r)}var nh=Qc,ih=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rh=[],eh=function(t){function n(n,i,r,e){var o=t.call(this,n,i,{transition:0})||this;return o.Ne={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.hitDetectionImageData={},o.ze={},o.sourceTiles=[],o.errorTileKeys={},o.wantedResolution,o.getSourceTiles=e.bind(void 0,o),o.wrappedTileCoord=r,o}return ih(n,t),n.prototype.getContext=function(t){var n=o(t);return n in this.Ne||(this.Ne[n]=Oo(1,1,rh)),this.Ne[n]},n.prototype.hasContext=function(t){return o(t)in this.Ne},n.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},n.prototype.getReplayState=function(t){var n=o(t);return n in this.ze||(this.ze[n]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.ze[n]},n.prototype.load=function(){this.getSourceTiles()},n.prototype.release=function(){for(var n in this.Ne)rh.push(this.Ne[n].canvas),delete this.Ne[n];t.prototype.release.call(this)},n}(jt),oh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sh=function(t){function n(n,i,r,e,o,s){var a=t.call(this,n,i,s)||this;return a.extent=null,a.Fe=e,a.Le=null,a.q,a.projection=null,a.resolution,a.Wt=o,a.Ge=r,a.key=r,a}return oh(n,t),n.prototype.getFormat=function(){return this.Fe},n.prototype.getFeatures=function(){return this.Le},n.prototype.load=function(){this.state==lt&&(this.setState(vt),this.Wt(this,this.Ge),this.q&&this.q(this.extent,this.resolution,this.projection))},n.prototype.onLoad=function(t,n){this.setFeatures(t)},n.prototype.onError=function(){this.setState(pt)},n.prototype.setFeatures=function(t){this.Le=t,this.setState(dt)},n.prototype.setLoader=function(t){this.q=t},n}(jt);function ah(t){return Array.isArray(t)?Wo(t):t}var uh="arraybuffer",ch="json",hh="text",fh="xml",lh=!1;function vh(t,n,i,r,e,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(i,r,e):t,!0),n.getType()==uh&&(a.responseType="arraybuffer"),a.withCredentials=lh,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var r=n.getType(),u=void 0;r==ch||r==hh?u=a.responseText:r==fh?(u=a.responseXML)||(u=(new DOMParser).parseFromString(a.responseText,"application/xml")):r==uh&&(u=a.response),u?o(n.readFeatures(u,{extent:i,featureProjection:e}),n.readProjection(u)):s()}else s()},a.onerror=s,a.send()}function dh(t,n){return function(i,r,e,o,s){var a=this;vh(t,n,i,r,e,(function(t,n){a.addFeatures(t),void 0!==o&&o(t)}),s||_)}}function ph(t,n){return[[-1/0,-1/0,1/0,1/0]]}var yh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function mh(t,n,i,r){var e=document.createElement("script"),s="olc_"+o(n);function a(){delete window[s],e.parentNode.removeChild(e)}e.async=!0,e.src=t+(-1==t.indexOf("?")?"?":"&")+(r||"callback")+"="+s;var u=setTimeout((function(){a(),i&&i()}),1e4);window[s]=function(t){clearTimeout(u),a(),n(t)},document.getElementsByTagName("head")[0].appendChild(e)}var wh,bh=function(t){function n(n){var i=this,r="Unexpected response status: "+n.status;return(i=t.call(this,r)||this).name="ResponseError",i.response=n,i}return yh(n,t),n}(Error),gh=function(t){function n(n){var i=t.call(this,"Failed to issue request")||this;return i.name="ClientError",i.client=n,i}return yh(n,t),n}(Error);function xh(t){return new Promise((function(n,i){var r=new XMLHttpRequest;r.addEventListener("load",(function(t){var r=t.target;if(!r.status||r.status>=200&&r.status<300){var e=void 0;try{e=JSON.parse(r.responseText)}catch(t){var o="Error parsing response text as JSON: "+t.message;return void i(new Error(o))}n(e)}else i(new bh(r))})),r.addEventListener("error",(function(t){i(new gh(t.target))})),r.open("GET",t),r.setRequestHeader("Accept","application/json"),r.send()}))}function jh(t,n){return n.indexOf("://")>=0?n:new URL(n,t).href}var Sh=function(){function t(){}return t.prototype.drawCustom=function(t,n,i,r){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,n){},t.prototype.drawFeature=function(t,n){},t.prototype.drawGeometryCollection=function(t,n){},t.prototype.drawLineString=function(t,n){},t.prototype.drawMultiLineString=function(t,n){},t.prototype.drawMultiPoint=function(t,n){},t.prototype.drawMultiPolygon=function(t,n){},t.prototype.drawPoint=function(t,n){},t.prototype.drawPolygon=function(t,n){},t.prototype.drawText=function(t,n){},t.prototype.setFillStrokeStyle=function(t,n){},t.prototype.setImageStyle=function(t,n){},t.prototype.setTextStyle=function(t,n){},t}(),kh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mh=function(t){function n(n,i,r,e,o,s,a){var u=t.call(this)||this;return u.Ne=n,u.Rt=i,u.st=r,u._t=e,u.De=o,u.Ue=s,u.qe=a,u.Be=null,u.We=null,u.Ve=null,u.Xe=null,u.He=null,u.Nt=null,u.Je=0,u.Ke=0,u.Ye=0,u.Ze=0,u.$e=0,u.Qe=0,u.no=!1,u.io=0,u.ro=[0,0],u.eo=0,u.oo="",u.so=0,u.ao=0,u.uo=!1,u.co=0,u.ho=[0,0],u.fo=null,u.lo=null,u.vo=null,u.do=[],u.po=[1,0,0,1,0,0],u}return kh(n,t),n.prototype.yo=function(t,n,i,r){if(this.Nt){var e=Wr(t,n,i,r,this._t,this.do),o=this.Ne,s=this.po,a=o.globalAlpha;1!=this.Ze&&(o.globalAlpha=a*this.Ze);var u=this.io;this.no&&(u+=this.De);for(var c=0,h=e.length;c2||Math.abs(t[4*n+3]-191.25)>2}function Wh(t,n,i,r){var e=Cr(i,n,t),o=xr(n,r,i),s=n.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var u=t.getExtent();if(!u||_n(u,e)){var c=xr(t,o,e)/o;isFinite(c)&&c>0&&(o/=c)}return o}function Vh(t,n,i,r){var e=Hn(i),o=Wh(t,n,e,r);return(!isFinite(o)||o<=0)&&Bn(i,(function(i){return o=Wh(t,n,i,r),isFinite(o)&&o>0})),o}function Xh(t,n,i,r,e,o,s,a,u,c,h,f){var l=Oo(Math.round(i*t),Math.round(i*n));if(f||E(l,Dh),0===u.length)return l.canvas;function v(t){return Math.round(t*i)/i}l.scale(i,i),l.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];u.forEach((function(t,n,i){Fn(d,t.extent)}));var p=ti(d),y=Yn(d),m=Oo(Math.round(i*p/r),Math.round(i*y/r));f||E(m,Dh);var w=i/r;u.forEach((function(t,n,i){var r=t.extent[0]-d[0],e=-(t.extent[3]-d[3]),o=ti(t.extent),s=Yn(t.extent);t.image.width>0&&t.image.height>0&&m.drawImage(t.image,c,c,t.image.width-2*c,t.image.height-2*c,r*w,e*w,o*w,s*w)}));var b=$n(s);return a.getTriangles().forEach((function(t,n,e){var s=t.source,a=t.target,u=s[0][0],c=s[0][1],h=s[1][0],p=s[1][1],y=s[2][0],w=s[2][1],g=v((a[0][0]-b[0])/o),x=v(-(a[0][1]-b[1])/o),j=v((a[1][0]-b[0])/o),S=v(-(a[1][1]-b[1])/o),k=v((a[2][0]-b[0])/o),M=v(-(a[2][1]-b[1])/o),_=u,O=c;u=0,c=0;var T=di([[h-=_,p-=O,0,0,j-g],[y-=_,w-=O,0,0,k-g],[0,0,h,p,S-x],[0,0,y,w,M-x]]);if(T){if(l.save(),l.beginPath(),function(){if(void 0===Gh){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",qh(t,4,5,4,0),qh(t,4,5,0,5);var n=t.getImageData(0,0,3,3).data;Gh=Bh(n,0)||Bh(n,4)||Bh(n,8)}return Gh}()||!f){l.moveTo(j,S);for(var E=g-j,A=x-S,C=0;C<4;C++)l.lineTo(j+v((C+1)*E/4),S+v(C*A/3)),3!=C&&l.lineTo(j+v((C+1)*E/4),S+v((C+1)*A/3));l.lineTo(k,M)}else l.moveTo(j,S),l.lineTo(g,x),l.lineTo(k,M);l.clip(),l.transform(T[0],T[2],T[1],T[3],g,x),l.translate(d[0]-_,d[3]-O),l.scale(r/i,-r/i),l.drawImage(m.canvas,0,0),l.restore()}})),h&&(l.save(),l.globalCompositeOperation="source-over",l.strokeStyle="black",l.lineWidth=1,a.getTriangles().forEach((function(t,n,i){var r=t.target,e=(r[0][0]-b[0])/o,s=-(r[0][1]-b[1])/o,a=(r[1][0]-b[0])/o,u=-(r[1][1]-b[1])/o,c=(r[2][0]-b[0])/o,h=-(r[2][1]-b[1])/o;l.beginPath(),l.moveTo(a,u),l.lineTo(e,s),l.lineTo(c,h),l.closePath(),l.stroke()})),l.restore()),l.canvas}var Hh=[0,0,0],Jh=function(){function t(t){var n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.Ti=t.resolutions,Mt(S(this.Ti,(function(t,n){return n-t}),!0),17),!t.origins)for(var i=0,r=this.Ti.length-1;i=this.minZoom;){if(n(a,2===this.Oi?th(e=Math.floor(e/2),e,o=Math.floor(o/2),o,i):this.getTileRangeForExtentAndZ(s,a,i)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.st},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.ko?this.ko:this.Mo[t]},t.prototype.getResolution=function(t){return this.Ti[t]},t.prototype.getResolutions=function(){return this.Ti},t.prototype.getTileCoordChildTileRange=function(t,n,i){if(t[0]this.maxZoom||n0?r:Math.max(s/a[0],o/a[1]),c=e+1,h=new Array(c),f=0;f0))){var i=yf(n.canvas).getExtension("WEBGL_lose_context");i&&i.loseContext(),delete ol[t]}}(this.Jo),delete this.Io,delete this.Ut},n.prototype.prepareDraw=function(t,n){var i=this.getGL(),r=this.getCanvas(),e=t.size,o=t.pixelRatio;r.width=e[0]*o,r.height=e[1]*o,r.style.width=e[0]+"px",r.style.height=e[1]+"px",i.useProgram(this.Zo);for(var s=this.es.length-1;s>=0;s--)this.es[s].init(t);i.bindTexture(i.TEXTURE_2D,null),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,n?i.ZERO:i.ONE_MINUS_SRC_ALPHA),i.useProgram(this.Zo),this.applyFrameState(t),this.applyUniforms(t)},n.prototype.prepareDrawToRenderTarget=function(t,n,i){var r=this.getGL(),e=n.getSize();r.bindFramebuffer(r.FRAMEBUFFER,n.getFramebuffer()),r.viewport(0,0,e[0],e[1]),r.bindTexture(r.TEXTURE_2D,n.getTexture()),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,i?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.Zo),this.applyFrameState(t),this.applyUniforms(t)},n.prototype.drawElements=function(t,n){var i=this.getGL();this.getExtension("OES_element_index_uint");var r=i.UNSIGNED_INT,e=n-t,o=4*t;i.drawElements(i.TRIANGLES,e,r,o)},n.prototype.finalizeDraw=function(t,n,i){for(var r=0,e=this.es.length;rthis.fs[0]||n>=this.fs[1])return ll[0]=0,ll[1]=0,ll[2]=0,ll[3]=0,ll;this.readAll();var i=Math.floor(t)+(this.fs[1]-Math.floor(n)-1)*this.fs[0];return ll[0]=this.B[4*i],ll[1]=this.B[4*i+1],ll[2]=this.B[4*i+2],ll[3]=this.B[4*i+3],ll},t.prototype.getTexture=function(){return this.us},t.prototype.getFramebuffer=function(){return this.hs},t.prototype.vs=function(){var t=this.fs,n=this.cs.getGL();this.us=this.cs.createTexture(t,null,this.us),n.bindFramebuffer(n.FRAMEBUFFER,this.hs),n.viewport(0,0,t[0],t[1]),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,this.us,0),this.B=new Uint8Array(t[0]*t[1]*4)},t}(),dl=!0,pl=function(){function t(t,n,i,r,e,o){this.ds=t,this.ps=n;var s={},a=Ar(this.ps,this.ds);this.ys=function(t){var n=t[0]+"/"+t[1];return s[n]||(s[n]=a(t)),s[n]},this.ws=r,this.bs=e*e,this.gs=[],this.xs=!1,this.Ss=this.ds.canWrapX()&&!!r&&!!this.ds.getExtent()&&ti(r)==ti(this.ds.getExtent()),this.ks=this.ds.getExtent()?ti(this.ds.getExtent()):null,this.Ms=this.ps.getExtent()?ti(this.ps.getExtent()):null;var u=$n(i),c=Qn(i),h=Xn(i),f=Vn(i),l=this.ys(u),v=this.ys(c),d=this.ys(h),p=this.ys(f),y=10+(o?Math.max(0,Math.ceil(fi(Wn(i)/(o*o*256*256)))):0);if(this._s(u,c,h,f,l,v,d,p,y),this.xs){var m=1/0;this.gs.forEach((function(t,n,i){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])})),this.gs.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.ks/2){var n=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];n[0][0]-m>this.ks/2&&(n[0][0]-=this.ks),n[1][0]-m>this.ks/2&&(n[1][0]-=this.ks),n[2][0]-m>this.ks/2&&(n[2][0]-=this.ks);var i=Math.min(n[0][0],n[1][0],n[2][0]);Math.max(n[0][0],n[1][0],n[2][0])-i.5&&h<1,v=!1;if(u>0){if(this.ps.isGlobal()&&this.Ms)v=ti(jn([t,n,i,r]))/this.Ms>.25||v;!l&&this.ds.isGlobal()&&h&&(v=h>.25||v)}if(!(!v&&this.ws&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3]))||ni(c,this.ws)){var d=0;if(!(v||isFinite(e[0])&&isFinite(e[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(u>0)v=!0;else if(1!=(d=(isFinite(e[0])&&isFinite(e[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(u>0){if(!v){var p=[(t[0]+i[0])/2,(t[1]+i[1])/2],y=this.ys(p),m=void 0;if(l)m=(mi(e[0],f)+mi(s[0],f))/2-mi(y[0],f);else m=(e[0]+s[0])/2-y[0];var w=(e[1]+s[1])/2-y[1];v=m*m+w*w>this.bs}if(v){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var b=[(n[0]+i[0])/2,(n[1]+i[1])/2],g=this.ys(b),x=[(r[0]+t[0])/2,(r[1]+t[1])/2],j=this.ys(x);this._s(t,n,b,x,e,o,g,j,u-1),this._s(x,b,i,r,j,g,s,a,u-1)}else{var S=[(t[0]+n[0])/2,(t[1]+n[1])/2],k=this.ys(S),M=[(i[0]+r[0])/2,(i[1]+r[1])/2],_=this.ys(M);this._s(t,S,M,r,e,k,_,a,u-1),this._s(S,n,i,M,k,o,s,_,u-1)}return}}if(l){if(!this.Ss)return;this.xs=!0}0==(11&d)&&this.Os(t,i,r,e,s,a),0==(14&d)&&this.Os(t,i,n,e,s,o),d&&(0==(13&d)&&this.Os(n,r,t,o,a,e),0==(7&d)&&this.Os(n,r,i,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.gs.forEach((function(n,i,r){var e=n.source;Ln(t,e[0]),Ln(t,e[1]),Ln(t,e[2])})),t},t.prototype.getTriangles=function(){return this.gs},t}(),yl=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ml=function(t){function n(n,i,r,e,o,s,a,u,c,h,f,l){var v=t.call(this,o,lt,{interpolate:!!l})||this;v.Ts=void 0!==f&&f,v.Rt=a,v.Es=u,v.Ut=null,v.As=i,v.Cs=e,v.Rs=s||o,v.Ps=[],v.Is=null,v.Ns=0;var d=e.getTileCoordExtent(v.Rs),p=v.Cs.getExtent(),y=v.As.getExtent(),m=p?Zn(d,p):d;if(0===Wn(m))return v.state=yt,v;var w=n.getExtent();w&&(y=y?Zn(y,w):w);var b=e.getResolution(v.Rs[0]),g=Vh(n,r,m,b);if(!isFinite(g)||g<=0)return v.state=yt,v;var x=void 0!==h?h:.5;if(v.zs=new pl(n,r,m,y,g*x,b),0===v.zs.getTriangles().length)return v.state=yt,v;v.Ns=i.getZForResolution(g);var j=v.zs.calculateSourceExtent();if(y&&(n.canWrapX()?(j[1]=ci(j[1],y[1],y[3]),j[3]=ci(j[3],y[1],y[3])):j=Zn(j,y)),Wn(j)){for(var S=i.getTileRangeForExtentAndZ(j,v.Ns),k=S.minX;k<=S.maxX;k++)for(var M=S.minY;M<=S.maxY;M++){var _=c(v.Ns,k,M,a);_&&v.Ps.push(_)}0===v.Ps.length&&(v.state=yt)}else v.state=yt;return v}return yl(n,t),n.prototype.getImage=function(){return this.Ut},n.prototype.Fs=function(){var t=[];if(this.Ps.forEach(function(n,i,r){n&&n.getState()==dt&&t.push({extent:this.As.getTileCoordExtent(n.tileCoord),image:n.getImage()})}.bind(this)),this.Ps.length=0,0===t.length)this.state=pt;else{var n=this.Rs[0],i=this.Cs.getTileSize(n),r="number"==typeof i?i:i[0],e="number"==typeof i?i:i[1],o=this.Cs.getResolution(n),s=this.As.getResolution(this.Ns),a=this.Cs.getTileCoordExtent(this.Rs);this.Ut=Xh(r,e,this.Rt,s,this.As.getExtent(),o,a,this.zs,t,this.Es,this.Ts,this.interpolate),this.state=dt}this.changed()},n.prototype.load=function(){if(this.state==lt){this.state=vt,this.changed();var t=0;this.Is=[],this.Ps.forEach(function(n,i,r){var e=n.getState();if(e==lt||e==vt){t++;var o=Y(n,N,(function(i){var r=n.getState();r!=dt&&r!=pt&&r!=yt||($(o),0===--t&&(this.Ls(),this.Fs()))}),this);this.Is.push(o)}}.bind(this)),0===t?setTimeout(this.Fs.bind(this),0):this.Ps.forEach((function(t,n,i){t.getState()==lt&&t.load()}))}},n.prototype.Ls=function(){this.Is.forEach($),this.Is=null},n}(jt),wl=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function bl(t,n,i){var r=i?t.LINEAR:t.NEAREST;t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r)}function gl(t,n,i,r,e,o){var s,a,u=t.getGL();i instanceof Float32Array?(s=u.FLOAT,t.getExtension("OES_texture_float"),a=null!==t.getExtension("OES_texture_float_linear")):(s=u.UNSIGNED_BYTE,a=!0);bl(u,n,o&&a);var c,h=i.byteLength/r[1],f=1;switch(h%8==0?f=8:h%4==0?f=4:h%2==0&&(f=2),e){case 1:c=u.LUMINANCE;break;case 2:c=u.LUMINANCE_ALPHA;break;case 3:c=u.RGB;break;case 4:c=u.RGBA;break;default:throw new Error("Unsupported number of bands: ".concat(e))}var l=u.getParameter(u.UNPACK_ALIGNMENT);u.pixelStorei(u.UNPACK_ALIGNMENT,f),u.texImage2D(u.TEXTURE_2D,0,c,r[0],r[1],0,c,s,i),u.pixelStorei(u.UNPACK_ALIGNMENT,l)}var xl=null;var jl=function(t){function n(n){var i=t.call(this)||this;i.tile,i.textures=[],i.hr=i.hr.bind(i),i.size=uu(n.grid.getTileSize(n.tile.tileCoord[0])),i.Gs=n.tilePixelRatio||1,i.Es=n.gutter||0,i.bandCount=NaN,i.cs=n.helper;var r=new Vf(hf,lf);return r.fromArray([0,1,1,1,1,0,0,0]),i.cs.flushBufferData(r),i.coords=r,i.setTile(n.tile),i}return wl(n,t),n.prototype.setTile=function(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(N,this.hr),this.tile=t,this.textures.length=0,this.loaded=t.getState()===dt,this.loaded)this.Ds();else{if(t instanceof No){var n=t.getImage();n instanceof Image&&!n.crossOrigin&&(n.crossOrigin="anonymous")}t.addEventListener(N,this.hr)}},n.prototype.Ds=function(){var t=this.cs,n=t.getGL(),i=this.tile;if(i instanceof No||i instanceof ml){var r=i.getImage();if(0!==this.Es){var e=this.Gs*this.Es,o=Math.round(r.width-2*e),s=Math.round(r.height-2*e),a=Oo(o,s);i.interpolate||E(a,Dh),a.drawImage(r,e,e,o,s,0,0,o,s),r=a.canvas}var u=n.createTexture();return this.textures.push(u),this.bandCount=4,void function(t,n,i,r){bl(t,n,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i)}(n,u,r,i.interpolate)}var c=[this.size[0]*this.Gs,this.size[1]*this.Gs],h=i.getData(),f=h instanceof Float32Array,l=c[0]*c[1],v=f?Float32Array:Uint8Array,d=v.BYTES_PER_ELEMENT,p=h.byteLength/c[1];this.bandCount=Math.floor(p/d/c[0]);var y=Math.ceil(this.bandCount/4);if(1===y){u=n.createTexture();return this.textures.push(u),void gl(t,u,h,c,this.bandCount,i.interpolate)}for(var m=new Array(y),w=0;w=d;--p)for(var y=u.getTileRangeForExtentAndZ(n,p,this.Ys),m=u.getResolution(p),w=y.minX;w<=y.maxX;++w)for(var b=y.minY;b<=y.maxY;++b){var g=Wc(p,w,b,this.Zs),x=ql(a,g),j=void 0,S=void 0;if(v.containsKey(x)&&(S=(j=v.get(x)).tile),!j||j.tile.key!==a.getKey())if(S=a.getTile(p,w,b,t.pixelRatio,e.projection),j)if(this.oa(S))j.setTile(S);else{var k=S.getInterimTile();j.setTile(k)}else j=new jl({tile:S,grid:u,helper:this.helper,tilePixelRatio:c,gutter:h}),v.set(x,j);Dl(r,j,p);var M=S.getKey();l[M]=!0,S.getState()===lt&&(t.tileQueue.isKeyQueued(M)||t.tileQueue.enqueue([S,f,u.getTileCoordCenter(g),m]))}},n.prototype.renderFrame=function(t){this.Ji=t,this.renderComplete=!0;var n=this.helper.getGL();this.preRender(n,t);var i=t.viewState,r=this.getLayer().getRenderSource(),e=r.getTileGridForProjection(i.projection),s=Ul(t,t.extent),a=e.getZForResolution(i.resolution,r.zDirection),u={};if(t.nextExtent){var c=e.getZForResolution(i.nextResolution,r.zDirection),h=Ul(t,t.nextExtent);this.enqueueTiles(t,h,c,u)}this.enqueueTiles(t,s,a,u);for(var f={},l=o(this),v=t.time,d=!1,y=u[a],m=0,w=y.length;m=g;--x){if(this.sa(e,b,x,u))break}}this.helper.useProgram(this.Qs),this.helper.prepareDraw(t,!d);for(var j=Object.keys(u).map(Number).sort(p),S=i.center[0],k=i.center[1],M=0,_=j.length;M<_;++M){var O=j[M],T=e.getResolution(O),E=uu(e.getTileSize(O),this.$s),A=e.getOrigin(O),C=(S-A[0])/(E[0]*T),R=(A[1]-k)/(E[1]*T),P=i.resolution/T,I=Gl(O),N=u[O];for(m=0,w=N.length;m=a.getMinZoom();--h){var f=a.getTileCoordForCoordAndZ(r,h),l=ql(s,f);if(c.containsKey(l)){var v=c.get(l);if(v.loaded){var d=a.getOrigin(h),p=uu(a.getTileSize(h)),y=a.getResolution(h),m=(r[0]-d[0])/y-f[1]*p[0],w=(d[1]-r[1])/y-f[2]*p[1];return v.getPixelData(m,w)}}}return null},n.prototype.sa=function(t,n,i,r){var e=t.getTileRangeForTileCoordAndZ(n,i,this.Ys);if(!e)return!1;for(var o=!0,s=this.ra,a=this.getLayer().getRenderSource(),u=e.minX;u<=e.maxX;++u)for(var c=e.minY;c<=e.maxY;++c){var h=ql(a,[i,u,c]),f=!1;if(s.containsKey(h)){var l=s.get(h);l.loaded&&(Dl(r,l,i),f=!0)}f||(o=!1)}return o},n.prototype.removeHelper=function(){if(this.helper){var n=this.ra;n.forEach((function(t){return t.dispose()})),n.clear()}t.prototype.removeHelper.call(this)},n.prototype.disposeInternal=function(){var n=this.helper;n&&(n.getGL().deleteProgram(this.Qs),delete this.Qs,n.deleteBuffer(this.ia));t.prototype.disposeInternal.call(this),delete this.ia,delete this.ra,delete this.Ji},n}(Pl),Wl=1,Vl=2,Xl=4,Hl=8,Jl=16,Kl=31,Yl=0,Zl={};function $l(t){if("number"==typeof t)return Wl;if("boolean"==typeof t)return Hl;if("string"==typeof t)return Vo(t)?Xl|Vl:Vl;if(!Array.isArray(t))throw new Error("Unhandled value type: ".concat(JSON.stringify(t)));var n=t;if(n.every((function(t){return"number"==typeof t})))return 3===n.length||4===n.length?Xl|Jl:Jl;if("string"!=typeof n[0])throw new Error("Expected an expression operator but received: ".concat(JSON.stringify(n)));var i=Zl[n[0]];if(void 0===i)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(n)));return i.getReturnType(n.slice(1))}function Ql(t){return fi(t)%1==0}function tv(t){var n=t.toString();return-1===n.indexOf(".")?n+".0":n}function nv(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec".concat(t.length,"(").concat(t.map(tv).join(", "),")")}function iv(t){var n=qo(t).slice();return n.length<4&&n.push(1),nv(n.map((function(t,n){return n<3?t/255:t})))}function rv(t,n){return void 0===t.stringLiteralsMap[n]&&(t.stringLiteralsMap[n]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[n]}function ev(t,n){return tv(rv(t,n))}function ov(t,n,i){if(Array.isArray(n)&&"string"==typeof n[0]){var r=Zl[n[0]];if(void 0===r)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(n)));return r.toGlsl(t,n.slice(1),i)}var e=$l(n);if((e&Wl)>0)return tv(n);if((e&Hl)>0)return n.toString();if((e&Vl)>0&&(void 0===i||i==Vl))return ev(t,n.toString());if((e&Xl)>0&&(void 0===i||i==Xl))return iv(n);if((e&Jl)>0)return nv(n);throw new Error("Unexpected expression ".concat(n," (expected type ").concat(i,")"))}function sv(t){if(!($l(t)&Wl))throw new Error("A numeric value was expected, got ".concat(JSON.stringify(t)," instead"))}function av(t){for(var n=0;nn)throw new Error("At most ".concat(n," arguments were expected, got ").concat(t.length," instead"))}function vv(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got ".concat(t," instead"))}function dv(t,n){if(!Ql(n))throw new Error("Could not infer only one type from the following expression: ".concat(JSON.stringify(t)))}function pv(t){return"u_var_"+t}Zl.get={getReturnType:function(t){return Kl},toGlsl:function(t,n){hv(n,1),uv(n[0]);var i=n[0].toString();return-1===t.attributes.indexOf(i)&&t.attributes.push(i),(t.inFragmentShader?"v_":"a_")+i}},Zl.var={getReturnType:function(t){return Kl},toGlsl:function(t,n){hv(n,1),uv(n[0]);var i=n[0].toString();return-1===t.variables.indexOf(i)&&t.variables.push(i),pv(i)}};var yv="u_paletteTextures";Zl.palette={getReturnType:function(t){return Xl},toGlsl:function(t,n){hv(n,2),sv(n[0]);var i=ov(t,n[0]),r=n[1];if(!Array.isArray(r))throw new Error("The second argument of palette must be an array");for(var e=r.length,o=new Uint8Array(4*e),s=0;s"]={getReturnType:function(t){return Hl},toGlsl:function(t,n){return hv(n,2),av(n),"(".concat(ov(t,n[0])," > ").concat(ov(t,n[1]),")")}},Zl[">="]={getReturnType:function(t){return Hl},toGlsl:function(t,n){return hv(n,2),av(n),"(".concat(ov(t,n[0])," >= ").concat(ov(t,n[1]),")")}},Zl["<"]={getReturnType:function(t){return Hl},toGlsl:function(t,n){return hv(n,2),av(n),"(".concat(ov(t,n[0])," < ").concat(ov(t,n[1]),")")}},Zl["<="]={getReturnType:function(t){return Hl},toGlsl:function(t,n){return hv(n,2),av(n),"(".concat(ov(t,n[0])," <= ").concat(ov(t,n[1]),")")}},Zl["=="]=wv("=="),Zl["!="]=wv("!="),Zl["!"]={getReturnType:function(t){return Hl},toGlsl:function(t,n){return hv(n,1),cv(n[0]),"(!".concat(ov(t,n[0]),")")}},Zl.all=bv("&&"),Zl.any=bv("||"),Zl.between={getReturnType:function(t){return Hl},toGlsl:function(t,n){hv(n,3),av(n);var i=ov(t,n[1]),r=ov(t,n[2]),e=ov(t,n[0]);return"(".concat(e," >= ").concat(i," && ").concat(e," <= ").concat(r,")")}},Zl.array={getReturnType:function(t){return Jl},toGlsl:function(t,n){fv(n,2),lv(n,4),av(n);var i=n.map((function(n){return ov(t,n,Wl)}));return"vec".concat(n.length,"(").concat(i.join(", "),")")}},Zl.color={getReturnType:function(t){return Xl},toGlsl:function(t,n){fv(n,3),lv(n,4),av(n);var i=n;3===n.length&&i.push(1);var r=n.map((function(n,i){return ov(t,n,Wl)+(i<3?" / 255.0":"")}));return"vec".concat(n.length,"(").concat(r.join(", "),")")}},Zl.interpolate={getReturnType:function(t){for(var n=Xl|Wl,i=3;i=1;u-=2){var c=ov(t,n[u]),h=ov(t,n[u+1],e);a="(".concat(o," == ").concat(c," ? ").concat(h," : ").concat(a||s,")")}return a}},Zl.case={getReturnType:function(t){for(var n=Kl,i=1;i=0;o-=2){var u=ov(t,n[o]),c=ov(t,n[o+1],e);a="(".concat(u," ? ").concat(c," : ").concat(a||s,")")}return a}};var gv=function(){function t(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}return t.prototype.addUniform=function(t){return this.uniforms.push(t),this},t.prototype.addAttribute=function(t){return this.attributes.push(t),this},t.prototype.addVarying=function(t,n,i){return this.varyings.push({name:t,type:n,expression:i}),this},t.prototype.setSizeExpression=function(t){return this.sizeExpression=t,this},t.prototype.setRotationExpression=function(t){return this.rotationExpression=t,this},t.prototype.setSymbolOffsetExpression=function(t){return this.offsetExpression=t,this},t.prototype.setColorExpression=function(t){return this.colorExpression=t,this},t.prototype.setTextureCoordinateExpression=function(t){return this.texCoordExpression=t,this},t.prototype.setFragmentDiscardExpression=function(t){return this.discardExpression=t,this},t.prototype.setSymbolRotateWithView=function(t){return this.rotateWithView=t,this},t.prototype.getSizeExpression=function(){return this.sizeExpression},t.prototype.getOffsetExpression=function(){return this.offsetExpression},t.prototype.getColorExpression=function(){return this.colorExpression},t.prototype.getTextureCoordinateExpression=function(){return this.texCoordExpression},t.prototype.getFragmentDiscardExpression=function(){return this.discardExpression},t.prototype.getSymbolVertexShader=function(t){var n=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix",i=this.attributes,r=this.varyings;return t&&(i=i.concat("vec4 a_hitColor"),r=r.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nattribute vec2 a_position;\nattribute float a_index;\n").concat(i.map((function(t){return"attribute "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(r.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n mat4 offsetMatrix = ").concat(n,";\n vec2 halfSize = ").concat(this.sizeExpression," * 0.5;\n vec2 offset = ").concat(this.offsetExpression,";\n float angle = ").concat(this.rotationExpression,";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = ").concat(this.texCoordExpression,";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n").concat(r.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n"),"\n}")},t.prototype.getSymbolFragmentShader=function(t){var n=t?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"",i=this.varyings;return t&&(i=i.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(i.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n if (").concat(this.discardExpression,") { discard; }\n gl_FragColor = ").concat(this.colorExpression,";\n gl_FragColor.rgb *= gl_FragColor.a;\n").concat(n,"\n}")},t}();function xv(t){var n=t.symbol,i=void 0!==n.size?n.size:1,r=n.color||"white",e=n.textureCoord||[0,0,1,1],o=n.offset||[0,0],s=void 0!==n.opacity?n.opacity:1,a=void 0!==n.rotation?n.rotation:0,u={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{},functions:{}},c=ov(u,i,Jl|Wl),h=ov(u,o,Jl),f=ov(u,e,Jl),l=ov(u,a,Wl),v={inFragmentShader:!0,variables:u.variables,attributes:[],stringLiteralsMap:u.stringLiteralsMap,functions:{}},d=ov(v,r,Xl),p=ov(v,s,Wl),y="1.0",m="vec2(".concat(ov(v,i,Jl|Wl),").x");switch(n.symbolType){case"square":case"image":break;case"circle":y="(1.0-smoothstep(1.-4./".concat(m,",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))");break;case"triangle":var w="(v_quadCoord*2.-1.)",b="(atan(".concat(w,".x,").concat(w,".y))");y="(1.0-smoothstep(.5-3./".concat(m,",.5,cos(floor(.5+").concat(b,"/2.094395102)*2.094395102-").concat(b,")*length(").concat(w,")))");break;default:throw new Error("Unexpected symbol type: "+n.symbolType)}var g=(new gv).setSizeExpression("vec2(".concat(c,")")).setRotationExpression(l).setSymbolOffsetExpression(h).setTextureCoordinateExpression(f).setSymbolRotateWithView(!!n.rotateWithView).setColorExpression("vec4(".concat(d,".rgb, ").concat(d,".a * ").concat(p," * ").concat(y,")"));if(t.filter){var x=ov(v,t.filter,Hl);g.setFragmentDiscardExpression("!".concat(x))}var j={};if(v.variables.forEach((function(n){var i=pv(n);g.addUniform("float ".concat(i)),j[i]=function(){if(!t.variables||void 0===t.variables[n])throw new Error("The following variable is missing from the style: ".concat(n));var i=t.variables[n];return"string"==typeof i&&(i=rv(u,i)),void 0!==i?i:-9999999}})),"image"===n.symbolType&&n.src){var S=new Image;S.crossOrigin=void 0===n.crossOrigin?"anonymous":n.crossOrigin,S.src=n.src,g.addUniform("sampler2D u_texture").setColorExpression(g.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),j.u_texture=S}return v.attributes.forEach((function(t){-1===u.attributes.indexOf(t)&&u.attributes.push(t),g.addVarying("v_".concat(t),"float","a_".concat(t))})),u.attributes.forEach((function(t){g.addAttribute("float a_".concat(t))})),{builder:g,attributes:u.attributes.map((function(t){return{name:t,callback:function(n,i){var r=i[t];return"string"==typeof r&&(r=rv(u,r)),void 0!==r?r:-9999999}}})),uniforms:j}}var jv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Sv=function(t){function n(n){var i=t.call(this,{extent:n.extent,origin:n.origin,origins:n.origins,resolutions:n.resolutions,tileSize:n.tileSize,tileSizes:n.tileSizes,sizes:n.sizes})||this;return i.aa=n.matrixIds,i}return jv(n,t),n.prototype.getMatrixId=function(t){return this.aa[t]},n.prototype.getMatrixIds=function(){return this.aa},n}(Jh),kv=Sv;function Mv(t,n,i){var r=[],e=[],o=[],s=[],a=[],u=void 0!==i?i:[],c=gr(t.SupportedCRS),h=c.getMetersPerUnit(),f="ne"==c.getAxisOrientation().substr(0,2);return t.TileMatrix.sort((function(t,n){return n.ScaleDenominator-t.ScaleDenominator})),t.TileMatrix.forEach((function(n){if(!(u.length>0)||g(u,(function(i){return n.Identifier==i.TileMatrix||-1===n.Identifier.indexOf(":")&&t.Identifier+":"+n.Identifier===i.TileMatrix}))){e.push(n.Identifier);var i=28e-5*n.ScaleDenominator/h,c=n.TileWidth,l=n.TileHeight;f?o.push([n.TopLeftCorner[1],n.TopLeftCorner[0]]):o.push(n.TopLeftCorner),r.push(i),s.push(c==l?c:[c,l]),a.push([n.MatrixWidth,n.MatrixHeight])}})),new Sv({extent:n,origins:o,resolutions:r,matrixIds:e,tileSizes:s,sizes:a})}var _v=function(){function t(t){this.ua=t.opacity,this.ca=t.rotateWithView,this.Dr=t.rotation,this.ha=t.scale,this.fa=uu(t.scale),this.la=t.displacement}return t.prototype.clone=function(){var n=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(n)?n.slice():n,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.ua},t.prototype.getRotateWithView=function(){return this.ca},t.prototype.getRotation=function(){return this.Dr},t.prototype.getScale=function(){return this.ha},t.prototype.getScaleArray=function(){return this.fa},t.prototype.getDisplacement=function(){return this.la},t.prototype.getAnchor=function(){return r()},t.prototype.getImage=function(t){return r()},t.prototype.getHitDetectionImage=function(){return r()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return r()},t.prototype.getImageSize=function(){return r()},t.prototype.getOrigin=function(){return r()},t.prototype.getSize=function(){return r()},t.prototype.setDisplacement=function(t){this.la=t},t.prototype.setOpacity=function(t){this.ua=t},t.prototype.setRotateWithView=function(t){this.ca=t},t.prototype.setRotation=function(t){this.Dr=t},t.prototype.setScale=function(t){this.ha=t,this.fa=uu(t)},t.prototype.listenImageChange=function(t){r()},t.prototype.load=function(){r()},t.prototype.unlistenImageChange=function(t){r()},t}(),Ov=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tv=function(t){function n(n){var i=this,r=void 0!==n.rotateWithView&&n.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:r,rotation:void 0!==n.rotation?n.rotation:0,scale:void 0!==n.scale?n.scale:1,displacement:void 0!==n.displacement?n.displacement:[0,0]})||this).Ut=void 0,i.va=null,i.da=void 0!==n.fill?n.fill:null,i.ko=[0,0],i.Jt=n.points,i.pa=void 0!==n.radius?n.radius:n.radius1,i.ya=n.radius2,i.Kt=void 0!==n.angle?n.angle:0,i.ma=void 0!==n.stroke?n.stroke:null,i.fs=null,i.wa=null,i.render(),i}return Ov(n,t),n.prototype.clone=function(){var t=this.getScale(),i=new n({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},n.prototype.getAnchor=function(){var t=this.fs;if(!t)return null;var n=this.getDisplacement();return[t[0]/2-n[0],t[1]/2+n[1]]},n.prototype.getAngle=function(){return this.Kt},n.prototype.getFill=function(){return this.da},n.prototype.getHitDetectionImage=function(){return this.va||this.ba(this.wa),this.va},n.prototype.getImage=function(t){var n=this.Ut[t];if(!n){var i=this.wa,r=Oo(i.size*t,i.size*t);this.ga(i,r,t),n=r.canvas,this.Ut[t]=n}return n},n.prototype.getPixelRatio=function(t){return t},n.prototype.getImageSize=function(){return this.fs},n.prototype.getImageState=function(){return bo},n.prototype.getOrigin=function(){return this.ko},n.prototype.getPoints=function(){return this.Jt},n.prototype.getRadius=function(){return this.pa},n.prototype.getRadius2=function(){return this.ya},n.prototype.getSize=function(){return this.fs},n.prototype.getStroke=function(){return this.ma},n.prototype.listenImageChange=function(t){},n.prototype.load=function(){},n.prototype.unlistenImageChange=function(t){},n.prototype.xa=function(t,n,i){if(0===n||this.Jt===1/0||"bevel"!==t&&"miter"!==t)return n;var r=this.pa,e=void 0===this.ya?r:this.ya;if(r0,6);var f=void 0!==r.src?mo:bo;return i.ka=void 0!==r.color?qo(r.color):null,i.za=Uv(c,h,void 0!==i.Na?i.Na:null,i.Bt,f,i.ka),i.Fa=void 0!==r.offset?r.offset:[0,0],i.La=void 0!==r.offsetOrigin?r.offsetOrigin:zv,i.ko=null,i.fs=void 0!==r.size?r.size:null,i}return Bv(n,t),n.prototype.clone=function(){var t=this.getScale();return new n({anchor:this.je.slice(),anchorOrigin:this.Ra,anchorXUnits:this.Pa,anchorYUnits:this.Ia,color:this.ka&&this.ka.slice?this.ka.slice():this.ka||void 0,crossOrigin:this.Bt,imgSize:this.Na,offset:this.Fa.slice(),offsetOrigin:this.La,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.fs?this.fs.slice():void 0,src:this.getSrc()})},n.prototype.getAnchor=function(){var t=this.Ca;if(!t){t=this.je;var n=this.getSize();if(this.Pa==Rv||this.Ia==Rv){if(!n)return null;t=this.je.slice(),this.Pa==Rv&&(t[0]*=n[0]),this.Ia==Rv&&(t[1]*=n[1])}if(this.Ra!=zv){if(!n)return null;t===this.je&&(t=this.je.slice()),this.Ra!=Fv&&this.Ra!=Nv||(t[0]=-t[0]+n[0]),this.Ra!=Iv&&this.Ra!=Nv||(t[1]=-t[1]+n[1])}this.Ca=t}var i=this.getDisplacement();return[t[0]-i[0],t[1]+i[1]]},n.prototype.setAnchor=function(t){this.je=t,this.Ca=null},n.prototype.getColor=function(){return this.ka},n.prototype.getImage=function(t){return this.za.getImage(t)},n.prototype.getPixelRatio=function(t){return this.za.getPixelRatio(t)},n.prototype.getImageSize=function(){return this.za.getSize()},n.prototype.getImageState=function(){return this.za.getImageState()},n.prototype.getHitDetectionImage=function(){return this.za.getHitDetectionImage()},n.prototype.getOrigin=function(){if(this.ko)return this.ko;var t=this.Fa;if(this.La!=zv){var n=this.getSize(),i=this.za.getSize();if(!n||!i)return null;t=t.slice(),this.La!=Fv&&this.La!=Nv||(t[0]=i[0]-n[0]-t[0]),this.La!=Iv&&this.La!=Nv||(t[1]=i[1]-n[1]-t[1])}return this.ko=t,this.ko},n.prototype.getSrc=function(){return this.za.getSrc()},n.prototype.getSize=function(){return this.fs?this.fs:this.za.getSize()},n.prototype.listenImageChange=function(t){this.za.addEventListener(N,t)},n.prototype.load=function(){this.za.load()},n.prototype.unlistenImageChange=function(t){this.za.removeEventListener(N,t)},n}(_v),Vv=function(){function t(t){var n=t||{};this.ka=void 0!==n.color?n.color:null,this.Ga=n.lineCap,this.Da=void 0!==n.lineDash?n.lineDash:null,this.Ua=n.lineDashOffset,this.qa=n.lineJoin,this.Ba=n.miterLimit,this.Wa=n.width}return t.prototype.clone=function(){var n=this.getColor();return new t({color:Array.isArray(n)?n.slice():n||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.ka},t.prototype.getLineCap=function(){return this.Ga},t.prototype.getLineDash=function(){return this.Da},t.prototype.getLineDashOffset=function(){return this.Ua},t.prototype.getLineJoin=function(){return this.qa},t.prototype.getMiterLimit=function(){return this.Ba},t.prototype.getWidth=function(){return this.Wa},t.prototype.setColor=function(t){this.ka=t},t.prototype.setLineCap=function(t){this.Ga=t},t.prototype.setLineDash=function(t){this.Da=t},t.prototype.setLineDashOffset=function(t){this.Ua=t},t.prototype.setLineJoin=function(t){this.qa=t},t.prototype.setMiterLimit=function(t){this.Ba=t},t.prototype.setWidth=function(t){this.Wa=t},t}();function Xv(t){return(Xv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Hv=function(){function t(t){var n=t||{};this.$r=null,this.Va=$v,void 0!==n.geometry&&this.setGeometry(n.geometry),this.da=void 0!==n.fill?n.fill:null,this.Nt=void 0!==n.image?n.image:null,this.cn=void 0!==n.renderer?n.renderer:null,this.Xa=void 0!==n.hitDetectionRenderer?n.hitDetectionRenderer:null,this.ma=void 0!==n.stroke?n.stroke:null,this.oo=void 0!==n.text?n.text:null,this.Ha=n.zIndex}return t.prototype.clone=function(){var n=this.getGeometry();return n&&"object"===Xv(n)&&(n=n.clone()),new t({geometry:n,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.cn},t.prototype.setRenderer=function(t){this.cn=t},t.prototype.setHitDetectionRenderer=function(t){this.Xa=t},t.prototype.getHitDetectionRenderer=function(){return this.Xa},t.prototype.getGeometry=function(){return this.$r},t.prototype.getGeometryFunction=function(){return this.Va},t.prototype.getFill=function(){return this.da},t.prototype.setFill=function(t){this.da=t},t.prototype.getImage=function(){return this.Nt},t.prototype.setImage=function(t){this.Nt=t},t.prototype.getStroke=function(){return this.ma},t.prototype.setStroke=function(t){this.ma=t},t.prototype.getText=function(){return this.oo},t.prototype.setText=function(t){this.oo=t},t.prototype.getZIndex=function(){return this.Ha},t.prototype.setGeometry=function(t){"function"==typeof t?this.Va=t:"string"==typeof t?this.Va=function(n){return n.get(t)}:t?void 0!==t&&(this.Va=function(){return t}):this.Va=$v,this.$r=t},t.prototype.setZIndex=function(t){this.Ha=t},t}();function Jv(t){var n;if("function"==typeof t)n=t;else{var i;if(Array.isArray(t))i=t;else Mt("function"==typeof t.getZIndex,41),i=[t];n=function(){return i}}return n}var Kv=null;function Yv(t,n){if(!Kv){var i=new Cv({color:"rgba(255,255,255,0.4)"}),r=new Vv({color:"#3399CC",width:1.25});Kv=[new Hv({image:new Av({fill:i,stroke:r,radius:5}),fill:i,stroke:r})]}return Kv}function Zv(){var t={},n=[255,255,255,1],i=[0,153,255,1];return t[Pt.POLYGON]=[new Hv({fill:new Cv({color:[255,255,255,.5]})})],t[Pt.MULTI_POLYGON]=t[Pt.POLYGON],t[Pt.LINE_STRING]=[new Hv({stroke:new Vv({color:n,width:5})}),new Hv({stroke:new Vv({color:i,width:3})})],t[Pt.MULTI_LINE_STRING]=t[Pt.LINE_STRING],t[Pt.CIRCLE]=t[Pt.POLYGON].concat(t[Pt.LINE_STRING]),t[Pt.POINT]=[new Hv({image:new Av({radius:6,fill:new Cv({color:i}),stroke:new Vv({color:n,width:1.5})}),zIndex:1/0})],t[Pt.MULTI_POINT]=t[Pt.POINT],t[Pt.GEOMETRY_COLLECTION]=t[Pt.POLYGON].concat(t[Pt.LINE_STRING],t[Pt.POINT]),t}function $v(t){return t.getGeometry()}var Qv=Hv,td="point",nd="line",id=function(){function t(t){var n=t||{};this.Ja=n.font,this.Dr=n.rotation,this.ca=n.rotateWithView,this.ha=n.scale,this.fa=uu(void 0!==n.scale?n.scale:1),this.oo=n.text,this.Ka=n.textAlign,this.Ya=n.textBaseline,this.da=void 0!==n.fill?n.fill:new Cv({color:"#333"}),this.Za=void 0!==n.maxAngle?n.maxAngle:Math.PI/4,this.$a=void 0!==n.placement?n.placement:td,this.Qa=!!n.overflow,this.ma=void 0!==n.stroke?n.stroke:null,this.tu=void 0!==n.offsetX?n.offsetX:0,this.nu=void 0!==n.offsetY?n.offsetY:0,this.iu=n.backgroundFill?n.backgroundFill:null,this.ru=n.backgroundStroke?n.backgroundStroke:null,this.Ei=void 0===n.padding?null:n.padding}return t.prototype.clone=function(){var n=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(n)?n.slice():n,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},t.prototype.getOverflow=function(){return this.Qa},t.prototype.getFont=function(){return this.Ja},t.prototype.getMaxAngle=function(){return this.Za},t.prototype.getPlacement=function(){return this.$a},t.prototype.getOffsetX=function(){return this.tu},t.prototype.getOffsetY=function(){return this.nu},t.prototype.getFill=function(){return this.da},t.prototype.getRotateWithView=function(){return this.ca},t.prototype.getRotation=function(){return this.Dr},t.prototype.getScale=function(){return this.ha},t.prototype.getScaleArray=function(){return this.fa},t.prototype.getStroke=function(){return this.ma},t.prototype.getText=function(){return this.oo},t.prototype.getTextAlign=function(){return this.Ka},t.prototype.getTextBaseline=function(){return this.Ya},t.prototype.getBackgroundFill=function(){return this.iu},t.prototype.getBackgroundStroke=function(){return this.ru},t.prototype.getPadding=function(){return this.Ei},t.prototype.setOverflow=function(t){this.Qa=t},t.prototype.setFont=function(t){this.Ja=t},t.prototype.setMaxAngle=function(t){this.Za=t},t.prototype.setOffsetX=function(t){this.tu=t},t.prototype.setOffsetY=function(t){this.nu=t},t.prototype.setPlacement=function(t){this.$a=t},t.prototype.setRotateWithView=function(t){this.ca=t},t.prototype.setFill=function(t){this.da=t},t.prototype.setRotation=function(t){this.Dr=t},t.prototype.setScale=function(t){this.ha=t,this.fa=uu(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.ma=t},t.prototype.setText=function(t){this.oo=t},t.prototype.setTextAlign=function(t){this.Ka=t},t.prototype.setTextBaseline=function(t){this.Ya=t},t.prototype.setBackgroundFill=function(t){this.iu=t},t.prototype.setBackgroundStroke=function(t){this.ru=t},t.prototype.setPadding=function(t){this.Ei=t},t}(),rd=function(){function t(t){this.eu,this.ou,this.su,this.au=void 0===t||t,this.uu=0}return t.prototype.insertItem=function(t){var n={prev:void 0,next:void 0,data:t},i=this.su;if(i){var r=i.next;n.prev=i,n.next=r,i.next=n,r&&(r.prev=n),i===this.ou&&(this.ou=n)}else this.eu=n,this.ou=n,this.au&&(n.next=n,n.prev=n);this.su=n,this.uu++},t.prototype.removeItem=function(){var t=this.su;if(t){var n=t.next,i=t.prev;n&&(n.prev=i),i&&(i.next=n),this.su=n||i,this.eu===this.ou?(this.su=void 0,this.eu=void 0,this.ou=void 0):this.eu===t?this.eu=this.su:this.ou===t&&(this.ou=i?this.su.prev:this.su),this.uu--}},t.prototype.firstItem=function(){if(this.su=this.eu,this.su)return this.su.data},t.prototype.lastItem=function(){if(this.su=this.ou,this.su)return this.su.data},t.prototype.nextItem=function(){if(this.su&&this.su.next)return this.su=this.su.next,this.su.data},t.prototype.getNextItem=function(){if(this.su&&this.su.next)return this.su.next.data},t.prototype.prevItem=function(){if(this.su&&this.su.prev)return this.su=this.su.prev,this.su.data},t.prototype.getPrevItem=function(){if(this.su&&this.su.prev)return this.su.prev.data},t.prototype.getCurrItem=function(){if(this.su)return this.su.data},t.prototype.setFirstItem=function(){this.au&&this.su&&(this.eu=this.su,this.ou=this.su.prev)},t.prototype.concat=function(t){if(t.su){if(this.su){var n=this.su.next;this.su.next=t.eu,t.eu.prev=this.su,n.prev=t.ou,t.ou.next=n,this.uu+=t.uu}else this.su=t.su,this.eu=t.eu,this.ou=t.ou,this.uu=t.uu;t.su=void 0,t.eu=void 0,t.ou=void 0,t.uu=0}},t.prototype.getLength=function(){return this.uu},t}(),ed=i(72),od=function(){function t(t){this.cu=new ed(t),this.hu={}}return t.prototype.insert=function(t,n){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:n};this.cu.insert(i),this.hu[o(n)]=i},t.prototype.load=function(t,n){for(var i=new Array(n.length),r=0,e=n.length;ri.highWaterMark&&(i.highWaterMark=t)},n.prototype.useTile=function(t,n,i,r){},n}(fd),dd=function(t){function n(n,i){var r=t.call(this,n)||this;return r.tile=i,r}return ld(n,t),n}(f),pd=vd,yd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),md=function(t){function n(i){var r=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,interpolate:i.interpolate,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return r.wu=r.tileUrlFunction===n.prototype.tileUrlFunction,r.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(r.tileUrlFunction=i.tileUrlFunction),r.urls=null,i.urls?r.setUrls(i.urls):i.url&&r.setUrl(i.url),r.bu={},r}return yd(n,t),n.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},n.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},n.prototype.getUrls=function(){return this.urls},n.prototype.handleTileChange=function(t){var n,i=t.target,r=o(i),e=i.getState();e==vt?(this.bu[r]=!0,n=sd):r in this.bu&&(delete this.bu[r],n=e==pt?ud:e==dt?ad:void 0),null!=n&&this.dispatchEvent(new dd(n,i))},n.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},n.prototype.setTileUrlFunction=function(t,n){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==n?this.setKey(n):this.changed()},n.prototype.setUrl=function(t){var n=af(t);this.urls=n,this.setUrls(n)},n.prototype.setUrls=function(t){this.urls=t;var n=t.join("\n");this.wu?this.setTileUrlFunction(ef(t,this.tileGrid),n):this.setKey(n)},n.prototype.tileUrlFunction=function(t,n,i){},n.prototype.useTile=function(t,n,i){var r=Vc(t,n,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},n}(pd),wd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function bd(t,n){t.getImage().src=n}var gd=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tileLoadFunction:n.tileLoadFunction?n.tileLoadFunction:bd,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:n.wrapX,transition:n.transition,interpolate:r,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this).crossOrigin=void 0!==n.crossOrigin?n.crossOrigin:null,i.tileClass=void 0!==n.tileClass?n.tileClass:No,i.tileCacheForProjection={},i.tileGridForProjection={},i.gu=n.reprojectionErrorThreshold,i.xu=!1,i}return wd(n,t),n.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},n.prototype.expireCache=function(t,n){var i=this.getTileCacheForProjection(t);for(var r in this.tileCache.expireCache(this.tileCache==i?n:{}),this.tileCacheForProjection){var e=this.tileCacheForProjection[r];e.expireCache(e==i?n:{})}},n.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Tr(this.getProjection(),t)?0:this.getGutter()},n.prototype.getGutter=function(){return 0},n.prototype.getKey=function(){var n=t.prototype.getKey.call(this);return this.getInterpolate()||(n+=":disable-interpolation"),n},n.prototype.getOpaque=function(n){return!(this.getProjection()&&n&&!Tr(this.getProjection(),n))&&t.prototype.getOpaque.call(this,n)},n.prototype.getTileGridForProjection=function(t){var n=this.getProjection();if(!this.tileGrid||n&&!Tr(n,t)){var i=o(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Kh(t)),this.tileGridForProjection[i]}return this.tileGrid},n.prototype.getTileCacheForProjection=function(t){var n=this.getProjection();if(!n||Tr(n,t))return this.tileCache;var i=o(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new $c(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},n.prototype.ju=function(t,n,i,r,e,o){var s=[t,n,i],a=this.getTileCoordForTileUrlFunction(s,e),u=a?this.tileUrlFunction(a,r,e):void 0,c=new this.tileClass(s,void 0!==u?lt:yt,void 0!==u?u:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return c.key=o,c.addEventListener(N,this.handleTileChange.bind(this)),c},n.prototype.getTile=function(t,n,i,r,e){var o=this.getProjection();if(o&&e&&!Tr(o,e)){var s=this.getTileCacheForProjection(e),a=[t,n,i],u=void 0,c=Xc(a);s.containsKey(c)&&(u=s.get(c));var h=this.getKey();if(u&&u.key==h)return u;var f=this.getTileGridForProjection(o),l=this.getTileGridForProjection(e),v=this.getTileCoordForTileUrlFunction(a,e),d=new ml(o,f,e,l,a,v,this.getTilePixelRatio(r),this.getGutter(),function(t,n,i,r){return this.getTileInternal(t,n,i,r,o)}.bind(this),this.gu,this.xu,this.getInterpolate());return d.key=h,u?(d.interimTile=u,d.refreshInterimChain(),s.replace(c,d)):s.set(c,d),d}return this.getTileInternal(t,n,i,r,o||e)},n.prototype.getTileInternal=function(t,n,i,r,e){var o=null,s=Vc(t,n,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var u=o;o=this.ju(t,n,i,r,e,a),u.getState()==lt?o.interimTile=u.interimTile:o.interimTile=u,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.ju(t,n,i,r,e,a),this.tileCache.set(s,o);return o},n.prototype.setRenderReprojectionEdges=function(t){if(this.xu!=t){for(var n in this.xu=t,this.tileCacheForProjection)this.tileCacheForProjection[n].clear();this.changed()}},n.prototype.setTileGridForProjection=function(t,n){var i=gr(t);if(i){var r=o(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=n)}},n}(md),xd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function jd(t){var n,i,r=t[0],e=new Array(r),o=1<>=1;return e.join("")}for(var Sd=function(t){function n(n){var i=this,r=void 0!==n.hidpi&&n.hidpi,e=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(e=n.interpolate),(i=t.call(this,{cacheSize:n.cacheSize,crossOrigin:"anonymous",interpolate:e,opaque:!0,projection:gr("EPSG:3857"),reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:ps,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:r?2:1,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).Su=r,i.ku=void 0!==n.culture?n.culture:"en-us",i.Mu=void 0!==n.maxZoom?n.maxZoom:-1,i._u=n.key,i.Ou=n.imagerySet,mh("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+i.Ou+"?uriScheme=https&include=ImageryProviders&key="+i._u+"&c="+i.ku,i.handleImageryMetadataResponse.bind(i),void 0,"jsonp"),i}return xd(n,t),n.prototype.getApiKey=function(){return this._u},n.prototype.getImagerySet=function(){return this.Ou},n.prototype.handleImageryMetadataResponse=function(t){if(200==t.statusCode&&"OK"==t.statusDescription&&"ValidCredentials"==t.authenticationResultCode&&1==t.resourceSets.length&&1==t.resourceSets[0].resources.length){var n=t.resourceSets[0].resources[0],i=-1==this.Mu?n.zoomMax:this.Mu,r=nf(this.getProjection()),e=this.Su?2:1,o=n.imageWidth==n.imageHeight?n.imageWidth/e:[n.imageWidth/e,n.imageHeight/e],s=$h({extent:r,minZoom:n.zoomMin,maxZoom:i,tileSize:o});this.tileGrid=s;var a=this.ku,u=this.Su;if(this.tileUrlFunction=of(n.imageUrlSubdomains.map((function(t){var i=[0,0,0],r=n.imageUrl.replace("{subdomain}",t).replace("{culture}",a);return function(t,n,e){if(t){Wc(t[0],t[1],t[2],i);var o=r;return u&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",jd(i))}}}))),n.imageryProviders){var c=Er(gr("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var i=[],r=t.viewState,e=this.getTileGrid(),o=e.getZForResolution(r.resolution,this.zDirection),s=e.getTileCoordForCoordAndZ(r.center,o)[0];return n.imageryProviders.map((function(n){for(var r=!1,e=n.coverageAreas,o=0,a=e.length;o=u.zoomMin&&s<=u.zoomMax){var h=u.bbox;if(ni(si([h[1],h[0],h[3],h[2]],c),t.extent)){r=!0;break}}}r&&i.push(n.attribution)})),i.push('Terms of Use'),i}.bind(this))}this.setState(ys)}else this.setState(ms)},n}(gd),kd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Md=function(t){function n(n){var i=n||{},r=void 0===i.imageSmoothing||i.imageSmoothing;void 0!==i.interpolate&&(r=i.interpolate);var e=void 0!==i.projection?i.projection:"EPSG:3857",o=void 0!==i.tileGrid?i.tileGrid:$h({extent:nf(e),maxResolution:i.maxResolution,maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});return t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,interpolate:r,opaque:i.opaque,projection:e,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:o,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this}return kd(n,t),n}(gd),_d=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Od=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,maxZoom:void 0!==n.maxZoom?n.maxZoom:18,minZoom:n.minZoom,projection:n.projection,transition:n.transition,wrapX:n.wrapX,zDirection:n.zDirection})||this;return i.Tu=n.account,i.Eu=n.map||"",i.Au=n.config||{},i.Cu={},i.Ru(),i}return _d(n,t),n.prototype.getConfig=function(){return this.Au},n.prototype.updateConfig=function(t){E(this.Au,t),this.Ru()},n.prototype.setConfig=function(t){this.Au=t||{},this.Ru()},n.prototype.Ru=function(){var t=JSON.stringify(this.Au);if(this.Cu[t])this.Pu(this.Cu[t]);else{var n="https://"+this.Tu+".carto.com/api/v1/map";this.Eu&&(n+="/named/"+this.Eu);var i=new XMLHttpRequest;i.addEventListener("load",this.Iu.bind(this,t)),i.addEventListener("error",this.Nu.bind(this)),i.open("POST",n),i.setRequestHeader("Content-type","application/json"),i.send(JSON.stringify(this.Au))}},n.prototype.Iu=function(t,n){var i=n.target;if(!i.status||i.status>=200&&i.status<300){var r=void 0;try{r=JSON.parse(i.responseText)}catch(t){return void this.setState(ms)}this.Pu(r),this.Cu[t]=r,this.setState(ys)}else this.setState(ms)},n.prototype.Nu=function(t){this.setState(ms)},n.prototype.Pu=function(t){var n="https://"+t.cdn_url.https+"/"+this.Tu+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(n)},n}(Md),Td="addfeature",Ed="changefeature",Ad="clear",Cd="removefeature",Rd="featuresloadstart",Pd="featuresloadend",Id="featuresloaderror",Nd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),zd=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.feature=i,e.features=r,e}return Nd(n,t),n}(f),Fd=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{attributions:r.attributions,interpolate:!0,projection:void 0,state:ys,wrapX:void 0===r.wrapX||r.wrapX})||this).on,i.once,i.un,i.q=_,i.Fe=r.format,i.zu=void 0===r.overlaps||r.overlaps,i.Ge=r.url,void 0!==r.loader?i.q=r.loader:void 0!==i.Ge&&(Mt(i.Fe,7),i.q=dh(i.Ge,i.Fe)),i.Fu=void 0!==r.strategy?r.strategy:ph;var e,o,s=void 0===r.useSpatialIndex||r.useSpatialIndex;return i.Lu=s?new od:null,i.Gu=new od,i.Du=0,i.Uu={},i.qu={},i.Bu={},i.Wu={},i.Vu=null,Array.isArray(r.features)?o=r.features:r.features&&(o=(e=r.features).getArray()),s||void 0!==e||(e=new ft(o)),void 0!==o&&i.addFeaturesInternal(o),void 0!==e&&i.Xu(e),i}return Nd(n,t),n.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},n.prototype.addFeatureInternal=function(t){var n=o(t);if(this.Hu(n,t)){this.Ju(n,t);var i=t.getGeometry();if(i){var r=i.getExtent();this.Lu&&this.Lu.insert(r,t)}else this.Uu[n]=t;this.dispatchEvent(new zd(Td,t))}else this.Vu&&this.Vu.remove(t)},n.prototype.Ju=function(t,n){this.Wu[t]=[Y(n,N,this.Ku,this),Y(n,l,this.Ku,this)]},n.prototype.Hu=function(t,n){var i=!0,r=n.getId();return void 0!==r&&(r.toString()in this.qu?i=!1:this.qu[r.toString()]=n),i&&(Mt(!(t in this.Bu),30),this.Bu[t]=n),i},n.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},n.prototype.addFeaturesInternal=function(t){for(var n=[],i=[],r=[],e=0,s=t.length;e0},n.prototype.refresh=function(){this.clear(!0),this.Gu.clear(),t.prototype.refresh.call(this)},n.prototype.removeLoadedExtent=function(t){var n,i=this.Gu;i.forEachInExtent(t,(function(i){if(Nn(i.extent,t))return n=i,!0})),n&&i.remove(n)},n.prototype.removeFeature=function(t){if(t){var n=o(t);n in this.Uu?delete this.Uu[n]:this.Lu&&this.Lu.remove(t),this.removeFeatureInternal(t)&&this.changed()}},n.prototype.removeFeatureInternal=function(t){var n=o(t),i=this.Wu[n];if(i){i.forEach($),delete this.Wu[n];var r=t.getId();return void 0!==r&&delete this.qu[r.toString()],delete this.Bu[n],this.dispatchEvent(new zd(Cd,t)),t}},n.prototype.Yu=function(t){var n=!1;for(var i in this.qu)if(this.qu[i]===t){delete this.qu[i],n=!0;break}return n},n.prototype.setLoader=function(t){this.q=t},n.prototype.setUrl=function(t){Mt(this.Fe,7),this.Ge=t,this.setLoader(dh(t,this.Fe))},n}(fd),Ld=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gd=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,wrapX:n.wrapX})||this;return i.resolution=void 0,i.distance=void 0!==n.distance?n.distance:20,i.minDistance=n.minDistance||0,i.interpolationRatio=0,i.features=[],i.geometryFunction=n.geometryFunction||function(t){var n=t.getGeometry();return Mt(n.getType()==Pt.POINT,10),n},i.Zu=n.createCluster,i.source=null,i.$u=i.refresh.bind(i),i.updateDistance(i.distance,i.minDistance),i.setSource(n.source||null),i}return Ld(n,t),n.prototype.clear=function(n){this.features.length=0,t.prototype.clear.call(this,n)},n.prototype.getDistance=function(){return this.distance},n.prototype.getSource=function(){return this.source},n.prototype.loadFeatures=function(t,n,i){this.source.loadFeatures(t,n,i),n!==this.resolution&&(this.resolution=n,this.refresh())},n.prototype.setDistance=function(t){this.updateDistance(t,this.minDistance)},n.prototype.setMinDistance=function(t){this.updateDistance(this.distance,t)},n.prototype.getMinDistance=function(){return this.minDistance},n.prototype.setSource=function(t){this.source&&this.source.removeEventListener(N,this.$u),this.source=t,t&&t.addEventListener(N,this.$u),this.refresh()},n.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features)},n.prototype.updateDistance=function(t,n){var i=0===t?0:Math.min(n,t)/t,r=t!==this.distance||this.interpolationRatio!==i;this.distance=t,this.minDistance=n,this.interpolationRatio=i,r&&this.refresh()},n.prototype.cluster=function(){if(void 0!==this.resolution&&this.source)for(var t=[1/0,1/0,-1/0,-1/0],n=this.distance*this.resolution,i=this.source.getFeatures(),r={},e=0,s=i.length;e=0;--r){var e=this.geometryFunction(t[r]);e?Ki(i,e.getCoordinates()):t.splice(r,1)}ir(i,1/t.length);var o=Hn(n),s=this.interpolationRatio,a=new Te([i[0]*(1-s)+o[0]*s,i[1]*(1-s)+o[1]*s]);return this.Zu?this.Zu(a,t):new Tt({geometry:a,features:t})},n}(Fd),Dd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ud=function(t){function n(n){var i=this,r=void 0===n.projection?"EPSG:3857":n.projection,e=n.tileGrid;return void 0===e&&r&&(e=$h({extent:nf(r),maxResolution:n.maxResolution,maxZoom:n.maxZoom,minZoom:n.minZoom,tileSize:n.tileSize})),(i=t.call(this,{cacheSize:.1,attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,projection:r,tileGrid:e,opaque:n.opaque,state:n.state,tilePixelRatio:n.tilePixelRatio,wrapX:n.wrapX,transition:n.transition,interpolate:n.interpolate})||this).bu={},i.q=n.loader,i.hr=i.hr.bind(i),i.bandCount=void 0===n.bandCount?4:n.bandCount,i}return Dd(n,t),n.prototype.setLoader=function(t){this.q=t},n.prototype.getTile=function(t,n,i,r,e){var o=Vc(t,n,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=this.q;var a=new kt(E({tileCoord:[t,n,i],loader:function(){return T((function(){return s(t,n,i)}))}},this.tileOptions));return a.key=this.getKey(),a.addEventListener(N,this.hr),this.tileCache.set(o,a),a},n.prototype.hr=function(t){var n,i=t.target,r=o(i),e=i.getState();e==vt?(this.bu[r]=!0,n=sd):r in this.bu&&(delete this.bu[r],n=e==pt?ud:e==dt?ad:void 0),n&&this.dispatchEvent(new dd(n,i))},n}(pd),qd=new ArrayBuffer(4),Bd=new Float32Array(qd),Wd=new Uint32Array(qd),Vd=new Uint32Array(512),Xd=new Uint32Array(512),Hd=0;Hd<256;++Hd){var Jd=Hd-127;Jd<-27?(Vd[Hd]=0,Vd[256|Hd]=32768,Xd[Hd]=24,Xd[256|Hd]=24):Jd<-14?(Vd[Hd]=1024>>-Jd-14,Vd[256|Hd]=1024>>-Jd-14|32768,Xd[Hd]=-Jd-1,Xd[256|Hd]=-Jd-1):Jd<=15?(Vd[Hd]=Jd+15<<10,Vd[256|Hd]=Jd+15<<10|32768,Xd[Hd]=13,Xd[256|Hd]=13):Jd<128?(Vd[Hd]=31744,Vd[256|Hd]=64512,Xd[Hd]=24,Xd[256|Hd]=24):(Vd[Hd]=31744,Vd[256|Hd]=64512,Xd[Hd]=13,Xd[256|Hd]=13)}var Kd=new Uint32Array(2048),Yd=new Uint32Array(64),Zd=new Uint32Array(64);Kd[0]=0;for(var $d=1;$d<1024;++$d){for(var Qd=$d<<13,tp=0;0==(8388608&Qd);)tp-=8388608,Qd<<=1;Qd&=-8388609,tp+=947912704,Kd[$d]=Qd|tp}for(var np=1024;np<2048;++np)Kd[np]=939524096+(np-1024<<13);Yd[0]=0;for(var ip=1;ip<31;++ip)Yd[ip]=ip<<23;Yd[31]=1199570944,Yd[32]=2147483648;for(var rp=33;rp<63;++rp)Yd[rp]=2147483648+(rp-32<<23);Yd[63]=3347054592,Zd[0]=0;for(var ep=1;ep<64;++ep)Zd[ep]=32===ep?0:1024;function op(t){var n=t>>10;return Wd[0]=Kd[Zd[n]+(1023&t)]+Yd[n],Bd[0]}var sp=Reflect.getPrototypeOf(Uint8Array).prototype,ap=Reflect.getOwnPropertyDescriptor(sp,Symbol.toStringTag).get;function up(t){return void 0!==ap.call(t)}var cp=Object.prototype.toString;function hp(t){return!!ArrayBuffer.isView(t)&&(!up(t)&&"[object DataView]"===cp.call(t))}function fp(t,n){if(!hp(t))throw new TypeError("First argument to getFloat16 function must be a DataView");for(var i=arguments.length,r=new Array(i>2?i-2:0),e=2;e>24)/500+s,u=s-(t[e+2]<<24>>24)/200,c=void 0,h=void 0,f=void 0;h=-.9689*(a=.95047*(a*a*a>.008856?a*a*a:(a-16/116)/7.787))+1.8758*(s=1*(s*s*s>.008856?s*s*s:(s-16/116)/7.787))+.0415*(u=1.08883*(u*u*u>.008856?u*u*u:(u-16/116)/7.787)),f=.0557*a+-.204*s+1.057*u,c=(c=3.2406*a+-1.5372*s+-.4986*u)>.0031308?1.055*Math.pow(c,1/2.4)-.055:12.92*c,h=h>.0031308?1.055*Math.pow(h,1/2.4)-.055:12.92*h,f=f>.0031308?1.055*Math.pow(f,1/2.4)-.055:12.92*f,r[o]=255*Math.max(0,Math.min(1,c)),r[o+1]=255*Math.max(0,Math.min(1,h)),r[o+2]=255*Math.max(0,Math.min(1,f))}return r}function xp(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function jp(t){return function(){var n=this,i=arguments;return new Promise((function(r,e){var o=t.apply(n,i);function s(t){xp(o,r,e,s,a,"next",t)}function a(t){xp(o,r,e,s,a,"throw",t)}s(void 0)}))}}var Sp=new Map;function kp(t,n){Array.isArray(t)||(t=[t]),t.forEach((function(t){return Sp.set(t,n)}))}function Mp(t){return _p.apply(this,arguments)}function _p(){return(_p=jp(regeneratorRuntime.mark((function t(n){var i,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=Sp.get(n.Compression)){t.next=3;break}throw new Error("Unknown compression method identifier: ".concat(n.Compression));case 3:return t.next=5,i();case 5:return r=t.sent,t.abrupt("return",new r(n));case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Op(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return new(Object.getPrototypeOf(t).constructor)(n*i*r)}function Tp(t,n,i,r,e){var o=n/r,s=i/e;return t.map((function(t){for(var a=Op(t,r,e),u=0;u5&&void 0!==arguments[5]?arguments[5]:"nearest";switch(o.toLowerCase()){case"nearest":return Tp(t,n,i,r,e);case"bilinear":case"linear":return Ap(t,n,i,r,e);default:throw new Error("Unsupported resampling method: '".concat(o,"'"))}}function Rp(t,n,i,r,e,o){for(var s=n/r,a=i/e,u=Op(t,r,e,o),c=0;c6&&void 0!==arguments[6]?arguments[6]:"nearest";switch(s.toLowerCase()){case"nearest":return Rp(t,n,i,r,e,o);case"bilinear":case"linear":return Pp(t,n,i,r,e,o);default:throw new Error("Unsupported resampling method: '".concat(s,"'"))}}function Np(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var r,e,o=[],s=!0,a=!1;try{for(i=i.call(t);!(s=(r=i.next()).done)&&(o.push(r.value),!n||o.length!==n);s=!0);}catch(t){a=!0,e=t}finally{try{s||null==i.return||i.return()}finally{if(a)throw e}}return o}(t,n)||function(t,n){if(!t)return;if("string"==typeof t)return zp(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return zp(t,n)}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zp(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=new Array(n);i>8-e-g&h;else if(g+e<=16)c[w]=a.getUint16(b)>>16-e-g&h;else if(g+e<=24){var x=a.getUint16(b)<<8|a.getUint8(b+2);c[w]=x>>24-e-g&h}else c[w]=a.getUint32(b)>>32-e-g&h}}return c.buffer}kp([void 0,1],(function(){return i.e(226).then(i.bind(i,966)).then((function(t){return t.default}))})),kp(5,(function(){return i.e(611).then(i.bind(i,611)).then((function(t){return t.default}))})),kp(6,(function(){throw new Error("old style JPEG compression is not supported.")})),kp(7,(function(){return i.e(382).then(i.bind(i,382)).then((function(t){return t.default}))})),kp([8,32946],(function(){return Promise.all([i.e(247),i.e(356)]).then(i.bind(i,356)).then((function(t){return t.default}))})),kp(32773,(function(){return i.e(395).then(i.bind(i,395)).then((function(t){return t.default}))})),kp(34887,(function(){return Promise.all([i.e(247),i.e(54)]).then(i.bind(i,54)).then((function(t){return t.default}))})),kp(50001,(function(){return i.e(629).then(i.bind(i,629)).then((function(t){return t.default}))}));var Wp=function(){function t(n,i,r,e,o,s){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.fileDirectory=n,this.geoKeys=i,this.dataView=r,this.littleEndian=e,this.tiles=o?{}:null,this.isTiled=!n.StripOffsets;var a=n.PlanarConfiguration;if(this.planarConfiguration=void 0===a?1:a,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=s}var n,i,r,e,o,s,a;return n=t,(i=[{key:"getFileDirectory",value:function(){return this.fileDirectory}},{key:"getGeoKeys",value:function(){return this.geoKeys}},{key:"getWidth",value:function(){return this.fileDirectory.ImageWidth}},{key:"getHeight",value:function(){return this.fileDirectory.ImageLength}},{key:"getSamplesPerPixel",value:function(){return void 0!==this.fileDirectory.SamplesPerPixel?this.fileDirectory.SamplesPerPixel:1}},{key:"getTileWidth",value:function(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}},{key:"getTileHeight",value:function(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}},{key:"getBlockWidth",value:function(){return this.getTileWidth()}},{key:"getBlockHeight",value:function(t){return this.isTiled||(t+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-t*this.getTileHeight()}},{key:"getBytesPerPixel",value:function(){for(var t=0,n=0;n=this.fileDirectory.BitsPerSample.length)throw new RangeError("Sample index ".concat(t," is out of range."));return Math.ceil(this.fileDirectory.BitsPerSample[t]/8)}},{key:"getReaderForSample",value:function(t){var n=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,i=this.fileDirectory.BitsPerSample[t];switch(n){case 1:if(i<=8)return DataView.prototype.getUint8;if(i<=16)return DataView.prototype.getUint16;if(i<=32)return DataView.prototype.getUint32;break;case 2:if(i<=8)return DataView.prototype.getInt8;if(i<=16)return DataView.prototype.getInt16;if(i<=32)return DataView.prototype.getInt32;break;case 3:switch(i){case 16:return function(t,n){return fp(this,t,n)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}},{key:"getSampleFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1}},{key:"getBitsPerSample",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.BitsPerSample[t]}},{key:"getArrayForSample",value:function(t,n){return Up(this.getSampleFormat(t),this.getBitsPerSample(t),n)}},{key:"getTileOrStrip",value:(a=Lp(regeneratorRuntime.mark((function t(n,i,r,e,o){var s,a,u,c,h,f,l,v,d=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=Math.ceil(this.getWidth()/this.getTileWidth()),a=Math.ceil(this.getHeight()/this.getTileHeight()),c=this.tiles,1===this.planarConfiguration?u=i*s+n:2===this.planarConfiguration&&(u=r*s*a+i*s+n),this.isTiled?(h=this.fileDirectory.TileOffsets[u],f=this.fileDirectory.TileByteCounts[u]):(h=this.fileDirectory.StripOffsets[u],f=this.fileDirectory.StripByteCounts[u]),t.next=7,this.source.fetch([{offset:h,length:f}],o);case 7:return l=t.sent[0],null!==c&&c[u]?v=c[u]:(v=Lp(regeneratorRuntime.mark((function t(){var n,r,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.decode(d.fileDirectory,l);case 2:return n=t.sent,r=d.getSampleFormat(),o=d.getBitsPerSample(),qp(r,o)&&(n=Bp(n,r,d.planarConfiguration,d.getSamplesPerPixel(),o,d.getTileWidth(),d.getBlockHeight(i))),t.abrupt("return",n);case 7:case"end":return t.stop()}}),t)})))(),null!==c&&(c[u]=v)),t.t0=n,t.t1=i,t.t2=r,t.next=14,v;case 14:return t.t3=t.sent,t.abrupt("return",{x:t.t0,y:t.t1,sample:t.t2,data:t.t3});case 16:case"end":return t.stop()}}),t,this)}))),function(t,n,i,r,e){return a.apply(this,arguments)})},{key:"_readRaster",value:(s=Lp(regeneratorRuntime.mark((function t(n,i,r,e,o,s,a,u,c){var h,f,l,v,d,p,y,m,w,b,g,x,j,S,k,M,_,O,T,E,A=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(h=this.getTileWidth(),f=this.getTileHeight(),l=this.getWidth(),v=this.getHeight(),d=Math.max(Math.floor(n[0]/h),0),p=Math.min(Math.ceil(n[2]/h),Math.ceil(l/h)),y=Math.max(Math.floor(n[1]/f),0),m=Math.min(Math.ceil(n[3]/f),Math.ceil(v/f)),w=n[2]-n[0],b=this.getBytesPerPixel(),g=[],x=[],j=0;j0&&void 0!==O[0]?O[0]:{},i=n.window,r=n.samples,e=void 0===r?[]:r,o=n.interleave,s=n.pool,a=void 0===s?null:s,u=n.width,c=n.height,h=n.resampleMethod,f=n.fillValue,l=n.signal,!((v=i||[0,0,this.getWidth(),this.getHeight()])[0]>v[2]||v[1]>v[3])){t.next=4;break}throw new Error("Invalid subsets");case 4:if(d=v[2]-v[0],p=v[3]-v[1],y=d*p,m=this.getSamplesPerPixel(),e&&e.length){t.next=12;break}for(w=0;w=m)){t.next=16;break}return t.abrupt("return",Promise.reject(new RangeError("Invalid sample index '".concat(e[b],"'."))));case 16:++b,t.next=13;break;case 19:if(o)x=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,j=Math.max.apply(null,this.fileDirectory.BitsPerSample),g=Up(x,j,y*e.length),f&&g.fill(f);else for(g=[],S=0;S0&&void 0!==T[0]?T[0]:{},i=n.window,r=n.interleave,e=void 0===r||r,o=n.pool,s=void 0===o?null:o,a=n.width,u=n.height,c=n.resampleMethod,h=n.enableAlpha,f=void 0!==h&&h,l=n.signal,!((v=i||[0,0,this.getWidth(),this.getHeight()])[0]>v[2]||v[1]>v[3])){t.next=4;break}throw new Error("Invalid subsets");case 4:if((d=this.fileDirectory.PhotometricInterpretation)!==dp.Ie.RGB){t.next=9;break}if(p=[0,1,2],this.fileDirectory.ExtraSamples!==dp.pd.Unspecified&&f)for(p=[],y=0;y0&&void 0!==arguments[0]?arguments[0]:null,n={};if(!this.fileDirectory.GDAL_METADATA)return null;var i=this.fileDirectory.GDAL_METADATA,r=vp(i,"Item");r=null===t?r.filter((function(t){return void 0===lp(t,"sample")})):r.filter((function(n){return Number(lp(n,"sample"))===t}));for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:null,n=this.fileDirectory.ModelPixelScale,i=this.fileDirectory.ModelTransformation;if(n)return[n[0],-n[1],n[2]];if(i)return[i[0],i[5],i[10]];if(t){var r=t.getResolution(),e=Np(r,3),o=e[0],s=e[1],a=e[2];return[o*t.getWidth()/this.getWidth(),s*t.getHeight()/this.getHeight(),a*t.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}},{key:"pixelIsArea",value:function(){return 1===this.geoKeys.GTRasterTypeGeoKey}},{key:"getBoundingBox",value:function(){var t=this.getOrigin(),n=this.getResolution(),i=t[0],r=t[1],e=i+n[0]*this.getWidth(),o=r+n[1]*this.getHeight();return[Math.min(i,e),Math.min(r,o),Math.max(i,e),Math.max(r,o)]}}])&&Gp(n.prototype,i),r&&Gp(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function Vp(t,n){for(var i=0;i0,e=!0,o=0;o<8;o++){var s=this._dataView.getUint8(t+(n?o:7-o));r&&(e?0!==s&&(s=255&~(s-1),e=!1):s=255&~s),i+=s*Math.pow(256,o)}return r&&(i=-i),i}},{key:"getUint8",value:function(t,n){return this._dataView.getUint8(t,n)}},{key:"getInt8",value:function(t,n){return this._dataView.getInt8(t,n)}},{key:"getUint16",value:function(t,n){return this._dataView.getUint16(t,n)}},{key:"getInt16",value:function(t,n){return this._dataView.getInt16(t,n)}},{key:"getUint32",value:function(t,n){return this._dataView.getUint32(t,n)}},{key:"getInt32",value:function(t,n){return this._dataView.getInt32(t,n)}},{key:"getFloat16",value:function(t,n){return fp(this._dataView,t,n)}},{key:"getFloat32",value:function(t,n){return this._dataView.getFloat32(t,n)}},{key:"getFloat64",value:function(t,n){return this._dataView.getFloat64(t,n)}}])&&Vp(n.prototype,i),r&&Vp(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function Hp(t,n){for(var i=0;i=t+n}},{key:"readUint8",value:function(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}},{key:"readInt8",value:function(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}},{key:"readUint16",value:function(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}},{key:"readInt16",value:function(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}},{key:"readUint32",value:function(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}},{key:"readInt32",value:function(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}},{key:"readFloat32",value:function(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}},{key:"readFloat64",value:function(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}},{key:"readUint64",value:function(t){var n,i=this.readUint32(t),r=this.readUint32(t+4);if(this._littleEndian){if(n=i+Math.pow(2,32)*r,!Number.isSafeInteger(n))throw new Error("".concat(n," exceeds MAX_SAFE_INTEGER. ")+"Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return n}if(n=Math.pow(2,32)*i+r,!Number.isSafeInteger(n))throw new Error("".concat(n," exceeds MAX_SAFE_INTEGER. ")+"Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return n}},{key:"readInt64",value:function(t){for(var n=0,i=(128&this._dataView.getUint8(t+(this._littleEndian?7:0)))>0,r=!0,e=0;e<8;e++){var o=this._dataView.getUint8(t+(this._littleEndian?e:7-e));i&&(r?0!==o&&(o=255&~(o-1),r=!1):o=255&~o),n+=o*Math.pow(256,e)}return i&&(n=-n),n}},{key:"readOffset",value:function(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}])&&Hp(n.prototype,i),r&&Hp(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function Kp(t){return $p(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Qp(t)||Zp()}function Yp(t,n){return $p(t)||function(t,n){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var r,e,o=[],s=!0,a=!1;try{for(i=i.call(t);!(s=(r=i.next()).done)&&(o.push(r.value),!n||o.length!==n);s=!0);}catch(t){a=!0,e=t}finally{try{s||null==i.return||i.return()}finally{if(a)throw e}}return o}(t,n)||Qp(t,n)||Zp()}function Zp(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function $p(t){if(Array.isArray(t))return t}function Qp(t,n){if(t){if("string"==typeof t)return ty(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ty(t,n):void 0}}function ty(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=new Array(n);i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}(t);try{for(r.s();!(n=r.n()).done;){var e=Yp(n.value,2),o=e[0],s=e[1];i[o.toLowerCase()]=s}}catch(t){r.e(t)}finally{r.f()}return i}function ry(t){return iy(t.split("\r\n").map((function(t){var n=t.split(":").map((function(t){return t.trim()}));return n[0]=n[0].toLowerCase(),n})))}function ey(t){var n,i,r;if(t){var e=Yp(t.match(/bytes (\d+)-(\d+)\/(\d+)/),4);n=e[1],i=e[2],r=e[3],n=parseInt(n,10),i=parseInt(i,10),r=parseInt(r,10)}return{start:n,end:i,total:r}}function oy(t,n){for(var i=null,r=new TextDecoder("ascii"),e=[],o="--".concat(n),s="".concat(o,"--"),a=0;a<10;++a){r.decode(new Uint8Array(t,a,o.length))===o&&(i=a)}if(null===i)throw new Error("Could not find initial boundary");for(;i1&&void 0!==e[1]?e[1]:void 0,t.abrupt("return",Promise.all(n.map((function(t){return r.fetchSlice(t,i)}))));case 2:case"end":return t.stop()}}),t)}))),function(t){return s.apply(this,arguments)})},{key:"fetchSlice",value:(o=ay(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("fetching of slice ".concat(n," not possible, not implemented"));case 1:case"end":return t.stop()}}),t)}))),function(t){return o.apply(this,arguments)})},{key:"fileSize",get:function(){return null}},{key:"close",value:(e=ay(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)})}])&&uy(n.prototype,i),r&&uy(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(),hy=i(875);function fy(t){return(fy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ly(t,n){for(var i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function Iy(t,n){if(t){if("string"==typeof t)return Ny(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ny(t,n):void 0}}function Ny(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=new Array(n);i2&&void 0!==arguments[2]?arguments[2]:null;qy(this,t),this.offset=n,this.length=i,this.data=r}return Wy(t,[{key:"top",get:function(){return this.offset+this.length}}]),t}(),Xy=Wy((function t(n,i,r){qy(this,t),this.offset=n,this.length=i,this.blockIds=r})),Hy=function(t){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&Ly(t,n)}(r,t);var n,i=Gy(r);function r(t){var n,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=e.blockSize,s=void 0===o?65536:o,a=e.cacheSize,u=void 0===a?100:a;return qy(this,r),(n=i.call(this)).source=t,n.blockSize=s,n.blockCache=new hy({max:u}),n.blockRequests=new Map,n.blockIdsToFetch=new Set,n}return Wy(r,[{key:"fileSize",get:function(){return this.source.fileSize}},{key:"fetch",value:(n=Fy(regeneratorRuntime.mark((function t(n,i){var r,e,o,s,a,u,c,h,f,l,v,d,p,y,m,w,b,g,x,j,S,k,M,_,O,T,E,A,C,R,P,I,N,z,F,L,G,D;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=new Map,e=new Map,o=new Set,s=Py(n);try{for(s.s();!(a=s.n()).done;)for(u=a.value,c=u.offset,h=u.length,f=c+h,null!==(l=this.fileSize)&&(f=Math.min(f,l)),v=Math.floor(c/this.blockSize)*this.blockSize,d=v;d0)){t.next=65;break}this.fetchBlocks(i),A=Py(j),t.prev=44,A.s();case 46:if((C=A.n()).done){t.next=54;break}if(R=C.value,P=this.blockRequests.get(R)){t.next=51;break}throw new Error("Block ".concat(R," is not in the block requests"));case 51:e.set(R,P);case 52:t.next=46;break;case 54:t.next=59;break;case 56:t.prev=56,t.t1=t.catch(44),A.e(t.t1);case 59:return t.prev=59,A.f(),t.finish(59);case 62:return t.next=64,Promise.allSettled(Array.from(e.values()));case 64:x=t.sent;case 65:if(!x.some((function(t){return"rejected"===t.status}))){t.next=69;break}if(!i||!i.aborted){t.next=68;break}throw new Ey("Request was aborted");case 68:throw new Ay(x.filter((function(t){return"rejected"===t.status})).map((function(t){return t.reason})),"Request failed");case 69:I=x.map((function(t){return t.value})),N=new Map(Ty(Array.from(e.keys()),I)),z=Py(r);try{for(z.s();!(F=z.n()).done;)L=Ry(F.value,2),G=L[0],D=L[1],N.set(G,D)}catch(t){z.e(t)}finally{z.f()}return t.abrupt("return",this.readSliceData(n,N));case 74:case"end":return t.stop()}}),t,this,[[9,28,31,34],[44,56,59,62]])}))),function(t,i){return n.apply(this,arguments)})},{key:"fetchBlocks",value:function(t){var n=this;this.blockIdsToFetch.size>0&&function(){for(var i=n.groupBlocks(n.blockIdsToFetch),r=n.source.fetch(i,t),e=function(e){var o,s=Py(i[e].blockIds);try{var a=function(){var i=o.value,s=Fy(regeneratorRuntime.mark((function o(){var s,a,u,c,h,f;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,r;case 3:return o.t0=e,s=o.sent[o.t0],a=i*n.blockSize,u=a-s.offset,c=Math.min(u+n.blockSize,s.data.byteLength),h=s.data.slice(u,c),f=new Vy(a,h.byteLength,h),n.blockCache.set(i,f),o.abrupt("return",f);case 14:throw o.prev=14,o.t1=o.catch(0),"AbortError"===o.t1.name&&(o.t1.signal=t),o.t1;case 18:return o.prev=18,n.blockRequests.delete(i),o.finish(18);case 21:case"end":return o.stop()}}),o,null,[[0,14,18,21]])})))();n.blockRequests.set(i,s)};for(s.s();!(o=s.n()).done;)a()}catch(t){s.e(t)}finally{s.f()}},o=0;o0&&(l=h),v=c.top-r<0?c.length-f:r-c.offset-f;var d=new Uint8Array(c.data,f,v);a.set(d,l)}return s}))}}]),r}(cy);function Jy(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function Ky(t){return function(){var n=this,i=arguments;return new Promise((function(r,e){var o=t.apply(n,i);function s(t){Jy(o,r,e,s,a,"next",t)}function a(t){Jy(o,r,e,s,a,"throw",t)}s(void 0)}))}}function Yy(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Zy(t,n){for(var i=0;i=200&&this.status<=299}},{key:"status",get:function(){throw new Error("not implemented")}},{key:"getHeader",value:function(t){throw new Error("not implemented")}},{key:"getData",value:(n=Ky(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("not implemented");case 1:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})}]),t}(),tm=function(){function t(n){Yy(this,t),this.url=n}var n;return $y(t,[{key:"request",value:(n=Ky(regeneratorRuntime.mark((function t(){var n,i=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw(n=i.length>0&&void 0!==i[0]?i[0]:{}).headers,n.credentials,n.signal,new Error("request is not implemented");case 2:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})}]),t}();function nm(t){return(nm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function im(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function rm(t){return function(){var n=this,i=arguments;return new Promise((function(r,e){var o=t.apply(n,i);function s(t){im(o,r,e,s,a,"next",t)}function a(t){im(o,r,e,s,a,"throw",t)}s(void 0)}))}}function em(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function om(t,n){for(var i=0;i0&&void 0!==s[0]?s[0]:{},i=n.headers,r=n.credentials,e=n.signal,t.next=3,fetch(this.url,{headers:i,credentials:r,signal:e});case 3:return o=t.sent,t.abrupt("return",new lm(o));case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),r}(tm);function dm(t){return(dm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pm(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var r,e,o=[],s=!0,a=!1;try{for(i=i.call(t);!(s=(r=i.next()).done)&&(o.push(r.value),!n||o.length!==n);s=!0);}catch(t){a=!0,e=t}finally{try{s||null==i.return||i.return()}finally{if(a)throw e}}return o}(t,n)||function(t,n){if(!t)return;if("string"==typeof t)return ym(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ym(t,n)}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ym(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=new Array(n);i0&&void 0!==o[0]?o[0]:{},i=n.headers,r=n.signal,t.next=3,this.constructRequest(i,r);case 3:return e=t.sent,t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),r}(tm),Em=i(752),Am=i(640),Cm=i(630);function Rm(t){return(Rm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pm(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),i.push.apply(i,r)}return i}function Im(t){for(var n=1;n0&&void 0!==o[0]?o[0]:{},i=n.headers,r=n.signal,t.next=3,this.constructRequest(i,r);case 3:return e=t.sent,t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),r}(tm);function Jm(t){return(Jm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Km=["headers","credentials","maxRanges","allowFullFile"],Ym=["headers","maxRanges","allowFullFile"],Zm=["headers","maxRanges","allowFullFile"],$m=["forceXHR"];function Qm(t,n){if(null==t)return{};var i,r,e=function(t,n){if(null==t)return{};var i,r,e={},o=Object.keys(t);for(r=0;r=0||(e[i]=t[i]);return e}(t,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}return e}function tw(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),i.push.apply(i,r)}return i}function nw(t){for(var n=1;n=n.length)){t.next=4;break}return t.abrupt("return",this.fetchSlices(n,i));case 4:this.maxRanges>0&&n.length;case 5:return t.abrupt("return",Promise.all(n.map((function(t){return r.fetchSlice(t,i)}))));case 6:case"end":return t.stop()}}),t,this)}))),function(t,n){return s.apply(this,arguments)})},{key:"fetchSlices",value:(o=ew(regeneratorRuntime.mark((function t(n,i){var r,e,o,s,a,u,c,h,f,l,v,d,p=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.client.request({headers:nw(nw({},this.headers),{},{Range:"bytes=".concat(n.map((function(t){var n=t.offset,i=t.length;return"".concat(n,"-").concat(n+i)})).join(","))}),signal:i});case 2:if((r=t.sent).ok){t.next=7;break}throw new Error("Error fetching data.");case 7:if(206!==r.status){t.next=32;break}if(y=r.getHeader("content-type"),m=void 0,m=Kp(y.split(";").map((function(t){return t.trim()}))),e={type:m[0],params:iy(m.slice(1).map((function(t){return t.split("=")})))},o=e.params,"multipart/byteranges"!==e.type){t.next=18;break}return t.t0=oy,t.next=13,r.getData();case 13:return t.t1=t.sent,t.t2=o.boundary,s=(0,t.t0)(t.t1,t.t2),this._fileSize=s[0].fileSize||null,t.abrupt("return",s);case 18:return t.next=20,r.getData();case 20:if(a=t.sent,u=ey(r.getHeader("content-range")),c=u.start,h=u.end,f=u.total,this._fileSize=f||null,l=[{data:a,offset:c,length:h-c}],!(n.length>1)){t.next=29;break}return t.next=27,Promise.all(n.slice(1).map((function(t){return p.fetchSlice(t,i)})));case 27:return v=t.sent,t.abrupt("return",l.concat(v));case 29:return t.abrupt("return",l);case 32:if(this.allowFullFile){t.next=34;break}throw new Error("Server responded with full file");case 34:return t.next=36,r.getData();case 36:return d=t.sent,this._fileSize=d.byteLength,t.abrupt("return",[{data:d,offset:0,length:d.byteLength}]);case 39:case"end":return t.stop()}var y,m}),t,this)}))),function(t,n){return o.apply(this,arguments)})},{key:"fetchSlice",value:(e=ew(regeneratorRuntime.mark((function t(n,i){var r,e,o,s,a,u,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.offset,e=n.length,t.next=3,this.client.request({headers:nw(nw({},this.headers),{},{Range:"bytes=".concat(r,"-").concat(r+e)}),signal:i});case 3:if((o=t.sent).ok){t.next=8;break}throw new Error("Error fetching data.");case 8:if(206!==o.status){t.next=17;break}return t.next=11,o.getData();case 11:return s=t.sent,a=ey(o.getHeader("content-range")),u=a.total,this._fileSize=u||null,t.abrupt("return",{data:s,offset:r,length:e});case 17:if(this.allowFullFile){t.next=19;break}throw new Error("Server responded with full file");case 19:return t.next=21,o.getData();case 21:return c=t.sent,this._fileSize=c.byteLength,t.abrupt("return",{data:c,offset:0,length:c.byteLength});case 24:case"end":return t.stop()}}),t,this)}))),function(t,n){return e.apply(this,arguments)})},{key:"fileSize",get:function(){return this._fileSize}}])&&ow(n.prototype,i),r&&ow(n,r),Object.defineProperty(n,"prototype",{writable:!1}),u}(cy);function fw(t,n){var i=n.blockSize,r=n.cacheSize;return null===i?t:new Hy(t,i,r)}function lw(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.headers,r=void 0===i?{}:i,e=n.credentials,o=n.maxRanges,s=void 0===o?0:o,a=n.allowFullFile,u=void 0!==a&&a,c=Qm(n,Km),h=new vm(t,e),f=new hw(h,r,s,u);return fw(f,c)}function vw(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.headers,r=void 0===i?{}:i,e=n.maxRanges,o=void 0===e?0:e,s=n.allowFullFile,a=void 0!==s&&s,u=Qm(n,Ym),c=new Tm(t),h=new hw(c,r,o,a);return fw(h,u)}function dw(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.headers,r=void 0===i?{}:i,e=n.maxRanges,o=void 0===e?0:e,s=n.allowFullFile,a=void 0!==s&&s,u=Qm(n,Zm),c=new Hm(t),h=new hw(c,r,o,a);return fw(h,u)}function pw(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.forceXHR,r=void 0!==i&&i,e=Qm(n,$m);return"function"!=typeof fetch||r?"undefined"!=typeof XMLHttpRequest?vw(t,e):dw(t,e):lw(t,e)}function yw(t){return(yw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mw(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),i.push.apply(i,r)}return i}function ww(t){for(var n=1;nt.length)&&(n=t.length);for(var i=0,r=new Array(n);i0&&void 0!==D[0]?D[0]:{},i=n.window,r=n.width,e=n.height,o=n.resX,s=n.resY,a=n.bbox,t.next=5,this.getImage();case 5:return u=t.sent,c=u,t.next=9,this.getImageCount();case 9:if(h=t.sent,f=u.getBoundingBox(),!i||!a){t.next=13;break}throw new Error('Both "bbox" and "window" passed.');case 13:if(!r&&!e){t.next=24;break}if(i&&(l=u.getOrigin(),v=gw(l,2),d=v[0],p=v[1],y=u.getResolution(),m=gw(y,2),w=m[0],b=m[1],a=[d+i[0]*w,p+i[1]*b,d+i[2]*w,p+i[3]*b]),g=a||f,!r){t.next=20;break}if(!o){t.next=19;break}throw new Error("Both width and resX passed");case 19:o=(g[2]-g[0])/r;case 20:if(!e){t.next=24;break}if(!s){t.next=23;break}throw new Error("Both width and resY passed");case 23:s=(g[3]-g[1])/e;case 24:if(!o&&!s){t.next=48;break}x=[],j=0;case 27:if(!(jE||s&&s>A)){t.next=45;break}return t.abrupt("break",48);case 45:++O,t.next=38;break;case 48:return C=i,a&&(R=u.getOrigin(),P=gw(R,2),I=P[0],N=P[1],z=c.getResolution(u),F=gw(z,2),L=F[0],G=F[1],C=[Math.round((a[0]-I)/L),Math.round((a[1]-N)/G),Math.round((a[2]-I)/L),Math.round((a[3]-N)/G)],C=[Math.min(C[0],C[2]),Math.min(C[1],C[3]),Math.max(C[0],C[2]),Math.max(C[1],C[3])]),t.abrupt("return",c.readRasters(ww(ww({},n),{},{window:C})));case 51:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),t}(),Uw=function(t){kw(c,t);var n,i,r,e,o,s,a,u=Mw(c);function c(t,n,i,r){var e,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return Iw(this,c),(e=u.call(this)).source=t,e.littleEndian=n,e.bigTiff=i,e.firstIFDOffset=r,e.cache=o.cache||!1,e.ifdRequests=[],e.ghostValues=null,e}return Pw(c,[{key:"getSlice",value:(a=Sw(regeneratorRuntime.mark((function t(n,i){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.bigTiff?4048:1024,t.t0=Jp,t.next=4,this.source.fetch([{offset:n,length:void 0!==i?i:r}]);case 4:return t.t1=t.sent[0],t.t2=n,t.t3=this.littleEndian,t.t4=this.bigTiff,t.abrupt("return",new t.t0(t.t1,t.t2,t.t3,t.t4));case 9:case"end":return t.stop()}}),t,this)}))),function(t,n){return a.apply(this,arguments)})},{key:"parseFileDirectoryAt",value:(s=Sw(regeneratorRuntime.mark((function t(n){var i,r,e,o,s,a,u,c,h,f,l,v,d,p,y,m,w,b,g,x;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.bigTiff?20:12,r=this.bigTiff?8:2,t.next=4,this.getSlice(n);case 4:if(e=t.sent,o=this.bigTiff?e.readUint64(n):e.readUint16(n),s=o*i+(this.bigTiff?16:6),e.covers(n,s)){t.next=11;break}return t.next=10,this.getSlice(n,s);case 10:e=t.sent;case 11:a={},u=n+(this.bigTiff?8:2),c=0;case 14:if(!(c0&&void 0!==r[0]?r[0]:0,t.next=3,this.requestIFD(n);case 3:return i=t.sent,t.abrupt("return",new Wp(i.fileDirectory,i.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source));case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getImageCount",value:(r=Sw(regeneratorRuntime.mark((function t(){var n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=0,i=!0;case 2:if(!i){t.next=18;break}return t.prev=3,t.next=6,this.requestIFD(n);case 6:++n,t.next=16;break;case 9:if(t.prev=9,t.t0=t.catch(3),!(t.t0 instanceof Gw)){t.next=15;break}i=!1,t.next=16;break;case 15:throw t.t0;case 16:t.next=2;break;case 18:return t.abrupt("return",n);case 19:case"end":return t.stop()}}),t,this,[[3,9]])}))),function(){return r.apply(this,arguments)})},{key:"getGhostValues",value:(i=Sw(regeneratorRuntime.mark((function t(){var n,i,r,e,o,s,a,u,c=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.bigTiff?16:8,!this.ghostValues){t.next=3;break}return t.abrupt("return",this.ghostValues);case 3:return r=(i="GDAL_STRUCTURAL_METADATA_SIZE=").length+100,t.next=7,this.getSlice(n,r);case 7:if(e=t.sent,i!==Fw(e,dp.sf.ASCII,i.length,n)){t.next=19;break}if(o=Fw(e,dp.sf.ASCII,r,n),s=o.split("\n")[0],!((a=Number(s.split("=")[1].split(" ")[0])+s.length)>r)){t.next=16;break}return t.next=15,this.getSlice(n,a);case 15:e=t.sent;case 16:u=Fw(e,dp.sf.ASCII,a,n),this.ghostValues={},u.split("\n").filter((function(t){return t.length>0})).map((function(t){return t.split("=")})).forEach((function(t){var n=gw(t,2),i=n[0],r=n[1];c.ghostValues[i]=r}));case 19:return t.abrupt("return",this.ghostValues);case 20:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"close",value:function(){return"function"==typeof this.source.close&&this.source.close()}}],[{key:"fromSource",value:(n=Sw(regeneratorRuntime.mark((function t(n,i,r){var e,o,s,a,u,h,f;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.fetch([{offset:0,length:1024}],r);case 2:if(e=t.sent[0],o=new Xp(e),18761!==(s=o.getUint16(0,0))){t.next=9;break}a=!0,t.next=14;break;case 9:if(19789!==s){t.next=13;break}a=!1,t.next=14;break;case 13:throw new TypeError("Invalid byte order value.");case 14:if(42!==(u=o.getUint16(2,a))){t.next=19;break}h=!1,t.next=27;break;case 19:if(43!==u){t.next=26;break}if(h=!0,8===o.getUint16(4,a)){t.next=24;break}throw new Error("Unsupported offset byte-size.");case 24:t.next=27;break;case 26:throw new TypeError("Invalid magic number.");case 27:return f=h?o.getUint64(8,a):o.getUint32(4,a),t.abrupt("return",new c(n,a,h,f,i));case 29:case"end":return t.stop()}}),t)}))),function(t,i,r){return n.apply(this,arguments)})}]),c}(Dw),qw=function(t){kw(o,t);var n,i,r,e=Mw(o);function o(t,n){var i;return Iw(this,o),(i=e.call(this)).mainFile=t,i.overviewFiles=n,i.imageFiles=[t].concat(n),i.fileDirectoriesPerFile=null,i.fileDirectoriesPerFileParsing=null,i.imageCount=null,i}return Pw(o,[{key:"parseFileDirectoriesPerFile",value:(r=Sw(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map((function(t){return t.parseFileDirectoryAt(t.firstIFDOffset)}))),t.next=3,Promise.all(n);case 3:return this.fileDirectoriesPerFile=t.sent,t.abrupt("return",this.fileDirectoriesPerFile);case 5:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"getImage",value:(i=Sw(regeneratorRuntime.mark((function t(){var n,i,r,e,o,s,a,u=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=u.length>0&&void 0!==u[0]?u[0]:0,t.next=3,this.getImageCount();case 3:return t.next=5,this.parseFileDirectoriesPerFile();case 5:i=0,r=0,e=0;case 8:if(!(e1&&void 0!==e[1]?e[1]:{},r=e.length>2?e[2]:void 0,t.abrupt("return",Uw.fromSource(pw(n,i),r));case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ww(){return(Ww=Sw(regeneratorRuntime.mark((function t(n){var i,r,e,o,s,a=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:[],r=a.length>2&&void 0!==a[2]?a[2]:{},e=a.length>3?a[3]:void 0,t.next=5,Uw.fromSource(pw(n,r),e);case 5:return o=t.sent,t.next=8,Promise.all(i.map((function(t){return Uw.fromSource(pw(t,r))})));case 8:return s=t.sent,t.abrupt("return",new qw(o,s));case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Vw(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function Xw(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Hw(t,n){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:Kw,e=arguments.length>1?arguments[1]:void 0;Xw(this,t),this.workers=null,this._awaitingDecoder=null,this.size=r,this.messageId=0,r&&(this._awaitingDecoder=e?Promise.resolve(e):new Promise((function(t){i.e(231).then(i.bind(i,231)).then((function(n){t(n.create)}))})),this._awaitingDecoder.then((function(t){n._awaitingDecoder=null,n.workers=[];for(var i=0;ii*t)throw new Error(r)}function ab(t){return t instanceof Int8Array?-128:t instanceof Int16Array?-32768:t instanceof Int32Array?-2147483648:t instanceof Float32Array?12e-39:0}function ub(t){return t instanceof Int8Array?127:t instanceof Uint8Array||t instanceof Uint8ClampedArray?255:t instanceof Int16Array?32767:t instanceof Uint16Array?65535:t instanceof Int32Array?2147483647:t instanceof Uint32Array?4294967295:t instanceof Float32Array?34e37:255}var cb=function(t){function n(n){var i=t.call(this,{state:ps,tileGrid:null,projection:null,opaque:n.opaque,transition:n.transition,interpolate:!1!==n.interpolate,wrapX:n.wrapX})||this;i.Qu=n.sources;var r=i.Qu.length;i.tc=n.sourceOptions,i.ic=new Array(r),i.rc=new Array(r),i.ec,i.oc,i.sc,i.ac=!1!==n.normalize,i.uc=!1,i.W=null,i.cc=n.convertToRGB?"readRGB":"readRasters",i.setKey(i.Qu.map((function(t){return t.url})).join(","));for(var e=i,o=new Array(r),s=0;sy.length&&(u=e.length-y.length);var S=e[e.length-1]/y[y.length-1];f.rc[c]=S;var k=y.map((function(t){return t*S}));j="Resolution mismatch for source ".concat(c,", got [").concat(k,"] but expected [").concat(e,"]");sb(e.slice(u,e.length),k,.02,j,f.viewRejector)}else e=y,f.rc[c]=1;r?sb(r.slice(u,r.length),p,0,"Tile size mismatch for source ".concat(c),f.viewRejector):r=p,f.ic[c]=h.reverse()},f=this,l=0;l=0;--v){var m=rb(y[v]);if(m){this.projection=m;break}}}this.ec=o,this.oc=s,this.sc=a;t:for(l=0;ll||c>l;)h.push([Math.ceil(u/l),Math.ceil(c/l)]),l+=l;break;case vb:for(var v=u,d=c;v>l||d>l;)h.push([Math.ceil(v/l),Math.ceil(d/l)]),v>>=1,d>>=1;break;default:Mt(!1,53)}h.push([1,1]),h.reverse();for(var p=[a],y=[0],m=1,w=h.length;m1,r=i&&t.imageInfo.profile[1].supports?t.imageInfo.profile[1].supports:[],e=i&&t.imageInfo.profile[1].formats?t.imageInfo.profile[1].formats:[],o=i&&t.imageInfo.profile[1].qualities?t.imageInfo.profile[1].qualities:[];return{url:t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return void 0===t.height?t.width:t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:yb(yb([],n.supports,!0),r,!0),formats:yb(yb([],n.formats,!0),e,!0),qualities:yb(yb([],n.qualities,!0),o,!0)}},kb[bb]=function(t){var n=t.getComplianceLevelSupportedFeatures(),i=void 0===t.imageInfo.extraFormats?n.formats:yb(yb([],n.formats,!0),t.imageInfo.extraFormats,!0),r=void 0!==t.imageInfo.preferredFormats&&Array.isArray(t.imageInfo.preferredFormats)&&t.imageInfo.preferredFormats.length>0?t.imageInfo.preferredFormats.filter((function(t){return y(["jpg","png","gif"],t)})).reduce((function(t,n){return void 0===t&&y(i,n)?n:t}),void 0):void 0;return{url:t.imageInfo.id,sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:void 0===t.imageInfo.extraFeatures?n.supports:yb(yb([],n.supports,!0),t.imageInfo.extraFeatures,!0),formats:i,qualities:void 0===t.imageInfo.extraQualities?n.qualities:yb(yb([],n.qualities,!0),t.imageInfo.extraQualities,!0),preferredFormat:r}};var Mb=function(){function t(t){this.setImageInfo(t)}return t.prototype.setImageInfo=function(t){this.imageInfo="string"==typeof t?JSON.parse(t):t},t.prototype.getImageApiVersion=function(){if(void 0!==this.imageInfo){var t=this.imageInfo["@context"]||"ol-no-context";"string"==typeof t&&(t=[t]);for(var n=0;n0&&"string"==typeof this.imageInfo.profile[0]&&jb.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0]}},t.prototype.getComplianceLevelFromProfile=function(t){var n=this.getComplianceLevelEntryFromProfile(t);if(void 0!==n){var i=n.match(/level[0-2](?:\.json)?$/g);return Array.isArray(i)?i[0].replace(".json",""):void 0}},t.prototype.getComplianceLevelSupportedFeatures=function(){if(void 0!==this.imageInfo){var t=this.getImageApiVersion(),n=this.getComplianceLevelFromProfile(t);return void 0===n?gb.none.none:gb[t][n]}},t.prototype.getTileSourceOptions=function(t){var n=t||{},i=this.getImageApiVersion();if(void 0!==i){var r=void 0===i?void 0:kb[i](this);if(void 0!==r)return{url:r.url,version:i,size:[this.imageInfo.width,this.imageInfo.height],sizes:r.sizes,format:void 0!==n.format&&y(r.formats,n.format)?n.format:void 0!==r.preferredFormat?r.preferredFormat:"jpg",supports:r.supports,quality:n.quality&&y(r.qualities,n.quality)?n.quality:y(r.qualities,"native")?"native":"default",resolutions:Array.isArray(r.resolutions)?r.resolutions.sort((function(t,n){return n-t})):void 0,tileSize:r.tileSize}}},t}(),_b=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Ob(t){return t.toLocaleString("en",{maximumFractionDigits:10})}var Tb=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(e=r.interpolate);var o=r.url||"";o+=o.lastIndexOf("/")===o.length-1||""===o?"":"/";var s=r.version||wb,a=r.sizes||[],u=r.size;Mt(null!=u&&Array.isArray(u)&&2==u.length&&!isNaN(u[0])&&u[0]>0&&!isNaN(u[1])&&u[1]>0,60);var c,h,f,l=u[0],v=u[1],d=r.tileSize,p=r.tilePixelRatio||1,m=r.format||"jpg",w=r.quality||(r.version==mb?"native":"default"),b=r.resolutions||[],g=r.supports||[],x=r.extent||[0,-v,l,0],j=null!=a&&Array.isArray(a)&&a.length>0,S=void 0!==d&&("number"==typeof d&&Number.isInteger(d)&&d>0||Array.isArray(d)&&d.length>0),k=null!=g&&Array.isArray(g)&&(y(g,"regionByPx")||y(g,"regionByPct"))&&(y(g,"sizeByWh")||y(g,"sizeByH")||y(g,"sizeByW")||y(g,"sizeByPct"));if(b.sort((function(t,n){return n-t})),S||k)if(null!=d&&("number"==typeof d&&Number.isInteger(d)&&d>0?(c=d,h=d):Array.isArray(d)&&d.length>0&&((1==d.length||null==d[1]&&Number.isInteger(d[0]))&&(c=d[0],h=d[0]),2==d.length&&(Number.isInteger(d[0])&&Number.isInteger(d[1])?(c=d[0],h=d[1]):null==d[0]&&Number.isInteger(d[1])&&(c=d[1],h=d[1])))),void 0!==c&&void 0!==h||(c=Ga,h=Ga),0==b.length)for(var M=f=Math.max(Math.ceil(Math.log(l/c)/Math.LN2),Math.ceil(Math.log(v/h)/Math.LN2));M>=0;M--)b.push(Math.pow(2,M));else{var _=Math.max.apply(Math,b);f=Math.round(Math.log(_)/Math.LN2)}else if(c=l,h=v,b=[],j){a.sort((function(t,n){return t[0]-n[0]})),f=-1;var O=[];for(M=0;M0&&b[b.length-1]==T?O.push(M):(b.push(T),f++)}if(O.length>0)for(M=0;Mf)){var d=t[1],p=t[2],x=b[u];if(!(void 0===d||void 0===p||void 0===x||d<0||Math.ceil(l/x/c)<=d||p<0||Math.ceil(v/x/h)<=p)){if(k||S){var M=d*c*x,_=p*h*x,O=c*x,T=h*x,E=c,A=h;if(M+O>l&&(O=l-M),_+T>v&&(T=v-_),M+c*x>l&&(E=Math.floor((l-M+x-1)/x)),_+h*x>v&&(A=Math.floor((v-_+x-1)/x)),0==M&&O==l&&0==_&&T==v)r="full";else if(!k||y(g,"regionByPx"))r=M+","+_+","+O+","+T;else if(y(g,"regionByPct")){r="pct:"+Ob(M/l*100)+","+Ob(_/v*100)+","+Ob(O/l*100)+","+Ob(T/v*100)}s!=bb||k&&!y(g,"sizeByWh")?!k||y(g,"sizeByW")?e=E+",":y(g,"sizeByH")?e=","+A:y(g,"sizeByWh")?e=E+","+A:y(g,"sizeByPct")&&(e="pct:"+Ob(100/x)):e=E+","+A}else if(r="full",j){var C=a[u][0],R=a[u][1];e=s==bb?C==l&&R==v?"max":C+","+R:C==l?"full":C+","}else e=s==bb?"max":"full";return o+r+"/"+e+"/0/"+w+"."+m}}},transition:r.transition})||this).zDirection=r.zDirection,i}return _b(n,t),n}(gd),Eb=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ab=function(t){function n(n,i,r,e,o,s,a){var u=this,c=n.getExtent(),h=i.getExtent(),f=h?Zn(r,h):r,l=Wh(n,i,Hn(f),e),v=new pl(n,i,f,c,.5*l,e),d=s(v.calculateSourceExtent(),l,o),p=d?mo:xo,y=d?d.getPixelRatio():1;return(u=t.call(this,r,e,y,p)||this).ps=i,u.ws=c,u.zs=v,u.wi=e,u.vc=r,u.dc=d,u.yc=y,u.pu=a,u.Ut=null,u.mc=null,u}return Eb(n,t),n.prototype.disposeInternal=function(){this.state==wo&&this.wc(),t.prototype.disposeInternal.call(this)},n.prototype.getImage=function(){return this.Ut},n.prototype.getProjection=function(){return this.ps},n.prototype.Fs=function(){var t=this.dc.getState();if(t==bo){var n=ti(this.vc)/this.wi,i=Yn(this.vc)/this.wi;this.Ut=Xh(n,i,this.yc,this.dc.getResolution(),this.ws,this.wi,this.vc,this.zs,[{extent:this.dc.getExtent(),image:this.dc.getImage()}],0,void 0,this.pu)}this.state=t,this.changed()},n.prototype.load=function(){if(this.state==mo){this.state=wo,this.changed();var t=this.dc.getState();t==bo||t==go?this.Fs():(this.mc=Y(this.dc,N,(function(t){var n=this.dc.getState();n!=bo&&n!=go||(this.wc(),this.Fs())}),this),this.dc.load())}},n.prototype.wc=function(){$(this.mc),this.mc=null},n}(yo),Cb=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Rb="imageloadstart",Pb="imageloadend",Ib="imageloaderror",Nb=function(t){function n(n,i){var r=t.call(this,n)||this;return r.image=i,r}return Cb(n,t),n}(f);function zb(t,n){t.getImage().src=n}var Fb=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{attributions:n.attributions,projection:n.projection,state:n.state,interpolate:r})||this).on,i.once,i.un,i.Ti=void 0!==n.resolutions?n.resolutions:null,i.bc=null,i.gc=0,i}return Cb(n,t),n.prototype.getResolutions=function(){return this.Ti},n.prototype.findNearestResolution=function(t){if(this.Ti){var n=m(this.Ti,t,0);t=this.Ti[n]}return t},n.prototype.getImage=function(t,n,i,r){var e=this.getProjection();if(e&&r&&!Tr(e,r)){if(this.bc){if(this.gc==this.getRevision()&&Tr(this.bc.getProjection(),r)&&this.bc.getResolution()==n&&Nn(this.bc.getExtent(),t))return this.bc;this.bc.dispose(),this.bc=null}return this.bc=new Ab(e,r,t,n,i,function(t,n,i){return this.getImageInternal(t,n,i,e)}.bind(this),this.getInterpolate()),this.gc=this.getRevision(),this.bc}return e&&(r=e),this.getImageInternal(t,n,i,r)},n.prototype.getImageInternal=function(t,n,i,e){return r()},n.prototype.handleImageChange=function(t){var n,i=t.target;switch(i.getState()){case wo:this.loading=!0,n=Rb;break;case bo:this.loading=!1,n=Pb;break;case go:this.loading=!1,n=Ib;break;default:return}this.hasListener(n)&&this.dispatchEvent(new Nb(n,i))},n}(fd),Lb=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gb=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,interpolate:e,projection:r.projection,resolutions:r.resolutions})||this).Bt=void 0!==r.crossOrigin?r.crossOrigin:null,i.Su=void 0===r.hidpi||r.hidpi,i.Ge=r.url,i.Ft=void 0!==r.imageLoadFunction?r.imageLoadFunction:zb,i.xc=r.params||{},i.Nt=null,i.jc=[0,0],i.Sc=0,i.kc=void 0!==r.ratio?r.ratio:1.5,i}return Lb(n,t),n.prototype.getParams=function(){return this.xc},n.prototype.getImageInternal=function(t,n,i,r){if(void 0===this.Ge)return null;n=this.findNearestResolution(n),i=this.Su?i:1;var e=this.Nt;if(e&&this.Sc==this.getRevision()&&e.getResolution()==n&&e.getPixelRatio()==i&&On(e.getExtent(),t))return e;var o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};E(o,this.xc);var s=((t=t.slice())[0]+t[2])/2,a=(t[1]+t[3])/2;if(1!=this.kc){var u=this.kc*ti(t)/2,c=this.kc*Yn(t)/2;t[0]=s-u,t[1]=a-c,t[2]=s+u,t[3]=a+c}var h=n/i,f=Math.ceil(ti(t)/h),l=Math.ceil(Yn(t)/h);t[0]=s-h*f/2,t[2]=s+h*f/2,t[1]=a-h*l/2,t[3]=a+h*l/2,this.jc[0]=f,this.jc[1]=l;var v=this.Mc(t,this.jc,i,r,o);return this.Nt=new ko(t,n,i,v,this.Bt,this.Ft),this.Sc=this.getRevision(),this.Nt.addEventListener(N,this.handleImageChange.bind(this)),this.Nt},n.prototype.getImageLoadFunction=function(){return this.Ft},n.prototype.Mc=function(t,n,i,r,e){var o=r.getCode().split(/:(?=\d+$)/).pop();e.SIZE=n[0]+","+n[1],e.BBOX=t.join(","),e.BBOXSR=o,e.IMAGESR=o,e.DPI=Math.round(90*i);var s=this.Ge,a=s.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return a==s&&Mt(!1,50),uf(a,e)},n.prototype.getUrl=function(){return this.Ge},n.prototype.setImageLoadFunction=function(t){this.Nt=null,this.Ft=t,this.changed()},n.prototype.setUrl=function(t){t!=this.Ge&&(this.Ge=t,this.Nt=null,this.changed())},n.prototype.updateParams=function(t){E(this.xc,t),this.Nt=null,this.changed()},n}(Fb),Db=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ub=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,interpolate:e,projection:r.projection,resolutions:r.resolutions,state:r.state})||this)._c=r.canvasFunction,i.Ut=null,i.Sc=0,i.kc=void 0!==r.ratio?r.ratio:1.5,i}return Db(n,t),n.prototype.getImageInternal=function(t,n,i,r){n=this.findNearestResolution(n);var e=this.Ut;if(e&&this.Sc==this.getRevision()&&e.getResolution()==n&&e.getPixelRatio()==i&&On(e.getExtent(),t))return e;ei(t=t.slice(),this.kc);var o=[ti(t)/n*i,Yn(t)/n*i],s=this._c.call(this,t,n,i,o,r);return s&&(e=new _o(t,n,i,s)),this.Ut=e,this.Sc=this.getRevision(),e},n}(Fb),qb=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();var Bb=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{interpolate:r,projection:n.projection,resolutions:n.resolutions})||this).Bt=void 0!==n.crossOrigin?n.crossOrigin:null,i.Oc=void 0!==n.displayDpi?n.displayDpi:96,i.xc=n.params||{},i.Ge=n.url,i.Ft=void 0!==n.imageLoadFunction?n.imageLoadFunction:zb,i.Su=void 0===n.hidpi||n.hidpi,i.dt=void 0!==n.metersPerUnit?n.metersPerUnit:1,i.kc=void 0!==n.ratio?n.ratio:1,i.Tc=void 0!==n.useOverlay&&n.useOverlay,i.Nt=null,i.Sc=0,i}return qb(n,t),n.prototype.getParams=function(){return this.xc},n.prototype.getImageInternal=function(t,n,i,r){n=this.findNearestResolution(n),i=this.Su?i:1;var e=this.Nt;if(e&&this.Sc==this.getRevision()&&e.getResolution()==n&&e.getPixelRatio()==i&&On(e.getExtent(),t))return e;1!=this.kc&&ei(t=t.slice(),this.kc);var o=[ti(t)/n*i,Yn(t)/n*i];if(void 0!==this.Ge){var s=this.getUrl(this.Ge,this.xc,t,o,r);(e=new ko(t,n,i,s,this.Bt,this.Ft)).addEventListener(N,this.handleImageChange.bind(this))}else e=null;return this.Nt=e,this.Sc=this.getRevision(),e},n.prototype.getImageLoadFunction=function(){return this.Ft},n.prototype.updateParams=function(t){E(this.xc,t),this.changed()},n.prototype.getUrl=function(t,n,i,r,e){var o=function(t,n,i,r){var e=ti(t),o=Yn(t),s=n[0],a=n[1],u=.0254/r;return a*e>s*o?e*i/(s*u):o*i/(a*u)}(i,r,this.dt,this.Oc),s=Hn(i),a={OPERATION:this.Tc?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.Oc,SETDISPLAYWIDTH:Math.round(r[0]),SETDISPLAYHEIGHT:Math.round(r[1]),SETVIEWSCALE:o,SETVIEWCENTERX:s[0],SETVIEWCENTERY:s[1]};return E(a,n),uf(t,a)},n.prototype.setImageLoadFunction=function(t){this.Nt=null,this.Ft=t,this.changed()},n}(Fb),Wb=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Vb=function(t){function n(n){var i=this,r=void 0!==n.crossOrigin?n.crossOrigin:null,e=void 0!==n.imageLoadFunction?n.imageLoadFunction:zb,o=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(o=n.interpolate),(i=t.call(this,{attributions:n.attributions,interpolate:o,projection:gr(n.projection)})||this).Ge=n.url,i.Ec=n.imageExtent,i.Nt=new ko(i.Ec,void 0,1,i.Ge,r,e),i.jc=n.imageSize?n.imageSize:null,i.Nt.addEventListener(N,i.handleImageChange.bind(i)),i}return Wb(n,t),n.prototype.getImageExtent=function(){return this.Ec},n.prototype.getImageInternal=function(t,n,i,r){return ni(t,this.Nt.getExtent())?this.Nt:null},n.prototype.getUrl=function(){return this.Ge},n.prototype.handleImageChange=function(n){if(this.Nt.getState()==bo){var i=this.Nt.getExtent(),r=this.Nt.getImage(),e=void 0,o=void 0;this.jc?(e=this.jc[0],o=this.jc[1]):(e=r.width,o=r.height);var s=ti(i),a=Yn(i),u=s/e,c=a/o,h=e,f=o;if(u>c?h=Math.round(s/c):f=Math.round(a/u),h!==e||f!==o){var l=Oo(h,f);this.getInterpolate()||E(l,Dh);var v=l.canvas;l.drawImage(r,0,0,e,o,0,0,v.width,v.height),this.Nt.setImage(v)}}t.prototype.handleImageChange.call(this,n)},n}(Fb),Xb="1.3.0",Hb="carmentaserver",Jb="geoserver",Kb="mapserver",Yb="qgis",Zb=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$b=[101,101],Qb=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,interpolate:e,projection:r.projection,resolutions:r.resolutions})||this).Bt=void 0!==r.crossOrigin?r.crossOrigin:null,i.Ge=r.url,i.Ft=void 0!==r.imageLoadFunction?r.imageLoadFunction:zb,i.xc=r.params||{},i.Ac=!0,i.Cc(),i.Rc=r.serverType,i.Su=void 0===r.hidpi||r.hidpi,i.Nt=null,i.jc=[0,0],i.Sc=0,i.kc=void 0!==r.ratio?r.ratio:1.5,i}return Zb(n,t),n.prototype.getFeatureInfoUrl=function(t,n,i,r){if(void 0!==this.Ge){var e=gr(i),o=this.getProjection();o&&o!==e&&(n=Wh(o,e,t,n),t=Cr(t,e,o));var s=Kn(t,n,0,$b),a={SERVICE:"WMS",VERSION:Xb,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.xc.LAYERS};E(a,this.xc,r);var u=xi((t[0]-s[0])/n,4),c=xi((s[3]-t[1])/n,4);return a[this.Ac?"I":"X"]=u,a[this.Ac?"J":"Y"]=c,this.Mc(s,$b,1,o||e,a)}},n.prototype.getLegendUrl=function(t,n){if(void 0!==this.Ge){var i={SERVICE:"WMS",VERSION:Xb,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===n||void 0===n.LAYER){var r=this.xc.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;i.LAYER=r}if(void 0!==t){var e=this.getProjection()?this.getProjection().getMetersPerUnit():1;i.SCALE=t*e/28e-5}return E(i,n),uf(this.Ge,i)}},n.prototype.getParams=function(){return this.xc},n.prototype.getImageInternal=function(t,n,i,r){if(void 0===this.Ge)return null;n=this.findNearestResolution(n),1==i||this.Su&&void 0!==this.Rc||(i=1);var e=n/i,o=Hn(t),s=Kn(o,e,0,[ji(ti(t)/e,4),ji(Yn(t)/e,4)]),a=Kn(o,e,0,[ji(this.kc*ti(t)/e,4),ji(this.kc*Yn(t)/e,4)]),u=this.Nt;if(u&&this.Sc==this.getRevision()&&u.getResolution()==n&&u.getPixelRatio()==i&&On(u.getExtent(),s))return u;var c={SERVICE:"WMS",VERSION:Xb,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};E(c,this.xc),this.jc[0]=gi(ti(a)/e,4),this.jc[1]=gi(Yn(a)/e,4);var h=this.Mc(a,this.jc,i,r,c);return this.Nt=new ko(a,n,i,h,this.Bt,this.Ft),this.Sc=this.getRevision(),this.Nt.addEventListener(N,this.handleImageChange.bind(this)),this.Nt},n.prototype.getImageLoadFunction=function(){return this.Ft},n.prototype.Mc=function(t,n,i,r,e){if(Mt(void 0!==this.Ge,9),e[this.Ac?"CRS":"SRS"]=r.getCode(),"STYLES"in this.xc||(e.STYLES=""),1!=i)switch(this.Rc){case Jb:var o=90*i+.5|0;"FORMAT_OPTIONS"in e?e.FORMAT_OPTIONS+=";dpi:"+o:e.FORMAT_OPTIONS="dpi:"+o;break;case Kb:e.MAP_RESOLUTION=90*i;break;case Hb:case Yb:e.DPI=90*i;break;default:Mt(!1,8)}e.WIDTH=n[0],e.HEIGHT=n[1];var s,a=r.getAxisOrientation();return s=this.Ac&&"ne"==a.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,e.BBOX=s.join(","),uf(this.Ge,e)},n.prototype.getUrl=function(){return this.Ge},n.prototype.setImageLoadFunction=function(t){this.Nt=null,this.Ft=t,this.changed()},n.prototype.setUrl=function(t){t!=this.Ge&&(this.Ge=t,this.Nt=null,this.changed())},n.prototype.updateParams=function(t){E(this.xc,t),this.Cc(),this.Nt=null,this.changed()},n.prototype.Cc=function(){var t=this.xc.VERSION||Xb;this.Ac=Ji(t,"1.3")>=0},n}(Fb),tg={"image/png":!0,"image/jpeg":!0,"image/gif":!0,"image/webp":!0},ng={"application/vnd.mapbox-vector-tile":!0,"application/geo+json":!0};function ig(t,n){for(var i,r,e=0;el.maxTileCol||c.tileRowl.maxTileRow)return}E(c,T);var v=i.replace(/\{(\w+?)\}/g,(function(t,n){return c[n]}));return jh(A,v)}}}}function og(t){return xh(t.url).then((function(n){return function(t,n){var i,r=n.tileMatrixSetLimits;if("map"===n.dataType)i=ig(n.links,t.mediaType);else{if("vector"!==n.dataType)throw new Error('Expected tileset data type to be "map" or "vector"');i=rg(n.links,t.mediaType,t.supportedMediaTypes)}if(n.tileMatrixSet)return eg(t,n.tileMatrixSet,i,r);var e=n.links.find((function(t){return"http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme"===t.rel}));if(!e)throw new Error("Expected http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme link or tileMatrixSet");var o=e.href;return xh(jh(t.url,o)).then((function(n){return eg(t,n,i,r)}))}(t,n)}))}var sg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ag=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:r,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:ps,tileLoadFunction:n.tileLoadFunction,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition})||this,og({url:n.url,projection:i.getProjection(),mediaType:n.mediaType,context:n.context||null}).then(i.Pc.bind(i)).catch(i.Ic.bind(i)),i}return sg(n,t),n.prototype.Pc=function(t){this.tileGrid=t.grid,this.setTileUrlFunction(t.urlFunction,t.urlTemplate),this.setState(ys)},n.prototype.Ic=function(t){console.error(t),this.setState(ms)},n}(gd),ug=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cg=function(t){function n(n){var i=this,r=n.projection||"EPSG:3857",e=n.extent||nf(r),o=n.tileGrid||$h({extent:e,maxResolution:n.maxResolution,maxZoom:void 0!==n.maxZoom?n.maxZoom:22,minZoom:n.minZoom,tileSize:n.tileSize||512});return(i=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,interpolate:!0,opaque:!1,projection:r,state:n.state,tileGrid:o,tileLoadFunction:n.tileLoadFunction?n.tileLoadFunction:hg,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:void 0===n.zDirection?1:n.zDirection})||this).Fe=n.format?n.format:null,i.sourceTileCache=new $c(i.tileCache.highWaterMark),i.zu=null==n.overlaps||n.overlaps,i.tileClass=n.tileClass?n.tileClass:sh,i.Nc={},i}return ug(n,t),n.prototype.getFeaturesInExtent=function(t){var n=[],i=this.tileCache;if(0===i.getCount())return n;var r=Jc(i.peekFirstKey())[0],e=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===r&&i.getState()===dt)for(var o=i.getSourceTiles(),s=0,a=o.length;s=s.width)return null;var c=Yn(o),h=Math.floor(s.height*((o[3]-r[1])/c));return h<0||h>=s.height?null:this.getImageData(s,u,h)},n.prototype.renderFrame=function(t,n){var i=this.Nt,r=i.getExtent(),e=i.getResolution(),o=i.getPixelRatio(),s=t.layerStatesArray[t.layerIndex],a=t.pixelRatio,u=t.viewState,c=u.center,h=u.resolution,f=t.size,l=a*e/(h*o),v=Math.round(f[0]*a),d=Math.round(f[1]*a),p=u.rotation;if(p){var y=Math.round(Math.sqrt(v*v+d*d));v=y,d=y}un(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,p,-v/2,-d/2),cn(this.inversePixelTransform,this.pixelTransform);var m=fn(this.pixelTransform);this.useContainer(n,m,s.opacity,this.getBackground(t));var w=this.context,b=w.canvas;b.width!=v||b.height!=d?(b.width=v,b.height=d):this.containerReused||w.clearRect(0,0,v,d);var g=!1,x=!0;if(s.extent){var j=Gr(s.extent,u.projection);(g=(x=ni(j,t.extent))&&!On(j,t.extent))&&this.clipUnrotated(w,t,j)}var S=i.getImage(),k=un(this.tempTransform,v/2,d/2,l,l,0,o*(r[0]-c[0])/e,o*(c[1]-r[3])/e);this.renderedResolution=e*a/o;var M=S.width*k[0],_=S.height*k[3];if(this.getLayer().getSource().getInterpolate()||E(w,Dh),this.preRender(w,t),x&&M>=.5&&_>=.5){var O=k[4],T=k[5],A=s.opacity,C=void 0;1!==A&&(C=w.globalAlpha,w.globalAlpha=A),w.drawImage(S,0,0,+S.width,+S.height,Math.round(O),Math.round(T),Math.round(M),Math.round(_)),1!==A&&(w.globalAlpha=C)}return this.postRender(w,t),g&&w.restore(),E(w,Uh),m!==b.style.transform&&(b.style.transform=m),this.container},n}(xg),kg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mg=function(t){function n(n){return t.call(this,n)||this}return kg(n,t),n.prototype.createRenderer=function(){return new Sg(this)},n.prototype.getData=function(n){return t.prototype.getData.call(this,n)},n}(mg),_g="preload",Og="useInterimTilesOnError",Tg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Eg=function(t){function n(n){var i=this,r=n||{},e=E({},r);return delete e.preload,delete e.useInterimTilesOnError,(i=t.call(this,e)||this).on,i.once,i.un,i.setPreload(void 0!==r.preload?r.preload:0),i.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),i}return Tg(n,t),n.prototype.getPreload=function(){return this.get(_g)},n.prototype.setPreload=function(t){this.set(_g,t)},n.prototype.getUseInterimTilesOnError=function(){return this.get(Og)},n.prototype.setUseInterimTilesOnError=function(t){this.set(Og,t)},n.prototype.getData=function(n){return t.prototype.getData.call(this,n)},n}(gs),Ag=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Cg=function(t){function n(n){var i=t.call(this,n)||this;return i.extentChanged=!0,i.zc=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.Fc=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.Lc=new nh(0,0,0,0),i}return Ag(n,t),n.prototype.isDrawableTile=function(t){var n=this.getLayer(),i=t.getState(),r=n.getUseInterimTilesOnError();return i==dt||i==yt||i==pt&&!r},n.prototype.getTile=function(t,n,i,r){var e=r.pixelRatio,o=r.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,n,i,e,o);return a.getState()==pt&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.Fc=!0):a.setState(dt)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},n.prototype.getData=function(t){var n=this.frameState;if(!n)return null;var i=this.getLayer(),r=rn(n.pixelToCoordinateTransform,t.slice()),e=i.getExtent();if(e&&!_n(e,r))return null;for(var o=n.pixelRatio,s=n.viewState.projection,a=n.viewState,u=i.getRenderSource(),c=u.getTileGridForProjection(a.projection),h=u.getTilePixelRatio(n.pixelRatio),f=c.getZForResolution(a.resolution);f>=c.getMinZoom();--f){var l=c.getTileCoordForCoordAndZ(r,f),v=u.getTile(f,l[1],l[2],o,s);if(!(v instanceof No||v instanceof ml))return null;if(v.getState()===dt){var d=c.getOrigin(f),p=uu(c.getTileSize(f)),y=c.getResolution(f),m=Math.floor(h*((r[0]-d[0])/y-l[1]*p[0])),w=Math.floor(h*((d[1]-r[1])/y-l[2]*p[1]));return this.getImageData(v.getImage(),m,w)}}return null},n.prototype.loadedTileCallback=function(n,i,r){return!!this.isDrawableTile(r)&&t.prototype.loadedTileCallback.call(this,n,i,r)},n.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},n.prototype.renderFrame=function(t,n){var i=t.layerStatesArray[t.layerIndex],r=t.viewState,e=r.projection,s=r.resolution,a=r.center,u=r.rotation,c=t.pixelRatio,h=this.getLayer(),f=h.getSource(),l=f.getRevision(),v=f.getTileGridForProjection(e),d=v.getZForResolution(s,f.zDirection),y=v.getResolution(d),m=t.extent,w=i.extent&&Gr(i.extent,e);w&&(m=Zn(m,Gr(i.extent,e)));var b=f.getTilePixelRatio(c),g=Math.round(t.size[0]*b),x=Math.round(t.size[1]*b);if(u){var j=Math.round(Math.sqrt(g*g+x*x));g=j,x=j}var S=y*g/2/b,k=y*x/2/b,M=[a[0]-S,a[1]-k,a[0]+S,a[1]+k],_=v.getTileRangeForExtentAndZ(m,d),O={};O[d]={};var T=this.createLoadedTileFinder(f,e,O),A=this.tmpExtent,C=this.Lc;this.Fc=!1;for(var R=_.minX;R<=_.maxX;++R)for(var P=_.minY;P<=_.maxY;++P){var I=this.getTile(d,R,P,t);if(this.isDrawableTile(I)){var N=o(this);if(I.getState()==dt){O[d][I.tileCoord.toString()]=I;var z=I.inTransition(N);this.Fc||!z&&-1!==this.renderedTiles.indexOf(I)||(this.Fc=!0)}if(1===I.getAlpha(N,t.time))continue}var F=v.getTileCoordChildTileRange(I.tileCoord,C,A),L=!1;F&&(L=T(d+1,F)),L||v.forEachTileCoordParentTileRange(I.tileCoord,T,C,A)}var G=y/s;un(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/b,1/b,u,-g/2,-x/2);var D=fn(this.pixelTransform);this.useContainer(n,D,i.opacity,this.getBackground(t));var U=this.context,q=U.canvas;cn(this.inversePixelTransform,this.pixelTransform),un(this.tempTransform,g/2,x/2,G,G,0,-g/2,-x/2),q.width!=g||q.height!=x?(q.width=g,q.height=x):this.containerReused||U.clearRect(0,0,g,x),w&&this.clipUnrotated(U,t,w),f.getInterpolate()||E(U,Dh),this.preRender(U,t),this.renderedTiles.length=0;var B,W,V,X=Object.keys(O).map(Number);X.sort(p),1!==i.opacity||this.containerReused&&!f.getOpaque(t.viewState.projection)?(B=[],W=[]):X=X.reverse();for(var H=X.length-1;H>=0;--H){var J=X[H],K=f.getTilePixelSize(J,c,e),Y=v.getResolution(J)/y,Z=K[0]*Y*G,$=K[1]*Y*G,Q=v.getTileCoordForCoordAndZ($n(M),J),tt=v.getTileCoordExtent(Q),nt=rn(this.tempTransform,[b*(tt[0]-M[0])/y,b*(M[3]-tt[3])/y]),it=b*f.getGutterForProjection(e),rt=O[J];for(var et in rt){var ot=(I=rt[et]).tileCoord,st=Q[1]-ot[1],at=Math.round(nt[0]-(st-1)*Z),ut=Q[2]-ot[2],ct=Math.round(nt[1]-(ut-1)*$),ht=at-(R=Math.round(nt[0]-st*Z)),ft=ct-(P=Math.round(nt[1]-ut*$)),lt=d===J,vt=!1;if(!(z=lt&&1!==I.getAlpha(o(this),t.time)))if(B){V=[R,P,R+ht,P,R+ht,P+ft,R,P+ft];for(var pt=0,yt=B.length;ptthis._maxQueueLength;)this._queue.shift().callback(null,null)},n.prototype._dispatch=function(){if(!this._running&&0!==this._queue.length){var t=this._queue.shift();this._job=t;var n=t.inputs[0].width,i=t.inputs[0].height,r=t.inputs.map((function(t){return t.data.buffer})),e=this._workers.length;if(this._running=e,1!==e)for(var o=t.inputs[0].data.length,s=4*Math.ceil(o/4/e),a=0;aStamen Design, under CC BY 3.0.',dg],$g={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},Qg={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},tx=function(t){function n(n){var i=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(i=n.interpolate);var r=n.layer.indexOf("-"),e=-1==r?n.layer:n.layer.slice(0,r),o=Qg[e],s=$g[n.layer],a=void 0!==n.url?n.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+n.layer+"/{z}/{x}/{y}."+s.extension;return t.call(this,{attributions:Zg,cacheSize:n.cacheSize,crossOrigin:"anonymous",interpolate:i,maxZoom:null!=n.maxZoom?n.maxZoom:o.maxZoom,minZoom:null!=n.minZoom?n.minZoom:o.minZoom,opaque:s.opaque,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:a,wrapX:n.wrapX,zDirection:n.zDirection})||this}return Yg(n,t),n}(Md),nx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ix=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:e,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,zDirection:r.zDirection})||this).xc=r.params||{},i.Su=void 0===r.hidpi||r.hidpi,i.Ao=[1/0,1/0,-1/0,-1/0],i.setKey(i.Kc()),i}return nx(n,t),n.prototype.Kc=function(){var t=0,n=[];for(var i in this.xc)n[t++]=i+"-"+this.xc[i];return n.join("/")},n.prototype.getParams=function(){return this.xc},n.prototype.Mc=function(t,n,i,r,e,o){var s=this.urls;if(s){var a,u=e.getCode().split(/:(?=\d+$)/).pop();if(o.SIZE=n[0]+","+n[1],o.BBOX=i.join(","),o.BBOXSR=u,o.IMAGESR=u,o.DPI=Math.round(o.DPI?o.DPI*r:90*r),1==s.length)a=s[0];else a=s[mi(Kc(t),s.length)];return uf(a.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),o)}},n.prototype.getTilePixelRatio=function(t){return this.Su?t:1},n.prototype.updateParams=function(t){E(this.xc,t),this.setKey(this.Kc())},n.prototype.tileUrlFunction=function(t,n,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){1==n||this.Su||(n=1);var e=r.getTileCoordExtent(t,this.Ao),o=uu(r.getTileSize(t[0]),this.tmpSize);1!=n&&(o=au(o,n,this.tmpSize));var s={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return E(s,this.xc),this.Mc(t,o,e,n,i,s)}},n}(gd),rx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ex=function(t){function n(n){var i=this,r=n||{};return i=t.call(this,{opaque:!1,projection:r.projection,tileGrid:r.tileGrid,wrapX:void 0===r.wrapX||r.wrapX,zDirection:r.zDirection,url:r.template||"z:{z} x:{x} y:{y}",tileLoadFunction:function(t,n){var r=t.getTileCoord()[0],e=uu(i.tileGrid.getTileSize(r)),o=Oo(e[0],e[1]);o.strokeStyle="grey",o.strokeRect(.5,.5,e[0]+.5,e[1]+.5),o.fillStyle="grey",o.strokeStyle="white",o.textAlign="center",o.textBaseline="middle",o.font="24px sans-serif",o.lineWidth=4,o.strokeText(n,e[0]/2,e[1]/2,e[0]),o.fillText(n,e[0]/2,e[1]/2,e[0]),t.setImage(o.canvas)}})||this}return rx(n,t),n}(Md),ox=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sx=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;if(void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:r,projection:gr("EPSG:3857"),reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:ps,tileLoadFunction:n.tileLoadFunction,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).Yc=null,i.Oo=n.tileSize,n.url)if(n.jsonp)mh(n.url,i.handleTileJSONResponse.bind(i),i.handleTileJSONError.bind(i));else{var e=new XMLHttpRequest;e.addEventListener("load",i.Zc.bind(i)),e.addEventListener("error",i.$c.bind(i)),e.open("GET",n.url),e.send()}else n.tileJSON?i.handleTileJSONResponse(n.tileJSON):Mt(!1,51);return i}return ox(n,t),n.prototype.Zc=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var i=void 0;try{i=JSON.parse(n.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},n.prototype.$c=function(t){this.handleTileJSONError()},n.prototype.getTileJSON=function(){return this.Yc},n.prototype.handleTileJSONResponse=function(t){var n,i=gr("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var e=Er(i,r);n=si(t.bounds,e)}var o=nf(r),s=t.minzoom||0,a=$h({extent:o,maxZoom:t.maxzoom||22,minZoom:s,tileSize:this.Oo});if(this.tileGrid=a,this.tileUrlFunction=ef(t.tiles,a),void 0!==t.attribution&&!this.getAttributions()){var u=void 0!==n?n:o;this.setAttributions((function(n){return ni(u,n.extent)?[t.attribution]:null}))}this.Yc=t,this.setState(ys)},n.prototype.handleTileJSONError=function(){this.setState(ms)},n}(gd),ax=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ux=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(e=r.interpolate);var o=r.params||{},s=!("TRANSPARENT"in o)||o.TRANSPARENT;return(i=t.call(this,{attributions:r.attributions,attributionsCollapsible:r.attributionsCollapsible,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:e,opaque:!s,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileClass:r.tileClass,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,zDirection:r.zDirection})||this).Es=void 0!==r.gutter?r.gutter:0,i.xc=o,i.Ac=!0,i.Rc=r.serverType,i.Su=void 0===r.hidpi||r.hidpi,i.Ao=[1/0,1/0,-1/0,-1/0],i.Cc(),i.setKey(i.Kc()),i}return ax(n,t),n.prototype.getFeatureInfoUrl=function(t,n,i,r){var e=gr(i),o=this.getProjection(),s=this.getTileGrid();s||(s=this.getTileGridForProjection(e));var a=s.getZForResolution(n,this.zDirection),u=s.getTileCoordForCoordAndZ(t,a);if(!(s.getResolutions().length<=u[0])){var c=s.getResolution(u[0]),h=s.getTileCoordExtent(u,this.Ao),f=uu(s.getTileSize(u[0]),this.tmpSize),l=this.Es;0!==l&&(f=ou(f,l,this.tmpSize),h=Sn(h,c*l,h)),o&&o!==e&&(c=Wh(o,e,t,c),h=Rr(h,e,o),t=Cr(t,e,o));var v={SERVICE:"WMS",VERSION:Xb,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.xc.LAYERS};E(v,this.xc,r);var d=Math.floor((t[0]-h[0])/c),p=Math.floor((h[3]-t[1])/c);return v[this.Ac?"I":"X"]=d,v[this.Ac?"J":"Y"]=p,this.Mc(u,f,h,1,o||e,v)}},n.prototype.getLegendUrl=function(t,n){if(void 0!==this.urls[0]){var i={SERVICE:"WMS",VERSION:Xb,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===n||void 0===n.LAYER){var r=this.xc.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;i.LAYER=r}if(void 0!==t){var e=this.getProjection()?this.getProjection().getMetersPerUnit():1;i.SCALE=t*e/28e-5}return E(i,n),uf(this.urls[0],i)}},n.prototype.getGutter=function(){return this.Es},n.prototype.getParams=function(){return this.xc},n.prototype.Mc=function(t,n,i,r,e,o){var s=this.urls;if(s){if(o.WIDTH=n[0],o.HEIGHT=n[1],o[this.Ac?"CRS":"SRS"]=e.getCode(),"STYLES"in this.xc||(o.STYLES=""),1!=r)switch(this.Rc){case Jb:var a=90*r+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+a:o.FORMAT_OPTIONS="dpi:"+a;break;case Kb:o.MAP_RESOLUTION=90*r;break;case Hb:case Yb:o.DPI=90*r;break;default:Mt(!1,52)}var u,c=e.getAxisOrientation(),h=i;if(this.Ac&&"ne"==c.substr(0,2)){var f=void 0;f=i[0],h[0]=i[1],h[1]=f,f=i[2],h[2]=i[3],h[3]=f}if(o.BBOX=h.join(","),1==s.length)u=s[0];else u=s[mi(Kc(t),s.length)];return uf(u,o)}},n.prototype.getTilePixelRatio=function(t){return this.Su&&void 0!==this.Rc?t:1},n.prototype.Kc=function(){var t=0,n=[];for(var i in this.xc)n[t++]=i+"-"+this.xc[i];return n.join("/")},n.prototype.updateParams=function(t){E(this.xc,t),this.Cc(),this.setKey(this.Kc())},n.prototype.Cc=function(){var t=this.xc.VERSION||Xb;this.Ac=Ji(t,"1.3")>=0},n.prototype.tileUrlFunction=function(t,n,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){1==n||this.Su&&void 0!==this.Rc||(n=1);var e=r.getResolution(t[0]),o=r.getTileCoordExtent(t,this.Ao),s=uu(r.getTileSize(t[0]),this.tmpSize),a=this.Es;0!==a&&(s=ou(s,a,this.tmpSize),o=Sn(o,e*a,o)),1!=n&&(s=au(s,n,this.tmpSize));var u={SERVICE:"WMS",VERSION:Xb,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return E(u,this.xc),this.Mc(t,s,o,n,i,u)}},n}(gd),cx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hx=function(t){function n(n,i,r,e,o,s){var a=t.call(this,n,i)||this;return a.Pt=r,a.st=e,a.Qc=o,a.th=null,a.nh=null,a.B=null,a.ih=s,a}return cx(n,t),n.prototype.getImage=function(){return null},n.prototype.getData=function(t){if(!this.th||!this.nh)return null;var n=(t[0]-this.st[0])/(this.st[2]-this.st[0]),i=(t[1]-this.st[1])/(this.st[3]-this.st[1]),r=this.th[Math.floor((1-i)*this.th.length)];if("string"!=typeof r)return null;var e=r.charCodeAt(Math.floor(n*r.length));e>=93&&e--,e>=35&&e--;var o=null;if((e-=32)in this.nh){var s=this.nh[e];o=this.B&&s in this.B?this.B[s]:s}return o},n.prototype.forDataAtCoordinate=function(t,n,i){this.state==yt&&!0===i?(this.state=lt,Z(this,N,(function(i){n(this.getData(t))}),this),this.rh()):!0===i?setTimeout(function(){n(this.getData(t))}.bind(this),0):n(this.getData(t))},n.prototype.getKey=function(){return this.Pt},n.prototype.Ic=function(){this.state=pt,this.changed()},n.prototype.qt=function(t){this.th=t.grid,this.nh=t.keys,this.B=t.data,this.state=dt,this.changed()},n.prototype.rh=function(){if(this.state==lt)if(this.state=vt,this.ih)mh(this.Pt,this.qt.bind(this),this.Ic.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.Zc.bind(this)),t.addEventListener("error",this.$c.bind(this)),t.open("GET",this.Pt),t.send()}},n.prototype.Zc=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var i=void 0;try{i=JSON.parse(n.responseText)}catch(t){return void this.Ic()}this.qt(i)}else this.Ic()},n.prototype.$c=function(t){this.Ic()},n.prototype.load=function(){this.Qc?this.rh():this.setState(yt)},n}(jt),fx=function(t){function n(n){var i=t.call(this,{projection:gr("EPSG:3857"),state:ps,zDirection:n.zDirection})||this;if(i.Qc=void 0===n.preemptive||n.preemptive,i.eh=sf,i.oh=void 0,i.ih=n.jsonp||!1,n.url)if(i.ih)mh(n.url,i.handleTileJSONResponse.bind(i),i.handleTileJSONError.bind(i));else{var r=new XMLHttpRequest;r.addEventListener("load",i.Zc.bind(i)),r.addEventListener("error",i.$c.bind(i)),r.open("GET",n.url),r.send()}else n.tileJSON?i.handleTileJSONResponse(n.tileJSON):Mt(!1,51);return i}return cx(n,t),n.prototype.Zc=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var i=void 0;try{i=JSON.parse(n.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},n.prototype.$c=function(t){this.handleTileJSONError()},n.prototype.getTemplate=function(){return this.oh},n.prototype.forDataAtCoordinateAndResolution=function(t,n,i,r){if(this.tileGrid){var e=this.tileGrid.getZForResolution(n,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(t,e);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(t,i,r)}else!0===r?setTimeout((function(){i(null)}),0):i(null)},n.prototype.handleTileJSONError=function(){this.setState(ms)},n.prototype.handleTileJSONResponse=function(t){var n,i=gr("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var e=Er(i,r);n=si(t.bounds,e)}var o=nf(r),s=t.minzoom||0,a=$h({extent:o,maxZoom:t.maxzoom||22,minZoom:s});this.tileGrid=a,this.oh=t.template;var u=t.grids;if(u){if(this.eh=ef(u,a),void 0!==t.attribution){var c=void 0!==n?n:o;this.setAttributions((function(n){return ni(c,n.extent)?[t.attribution]:null}))}this.setState(ys)}else this.setState(ms)},n.prototype.getTile=function(t,n,i,r,e){var o=Vc(t,n,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=[t,n,i],a=this.getTileCoordForTileUrlFunction(s,e),u=this.eh(a,r,e),c=new hx(s,void 0!==u?lt:yt,void 0!==u?u:"",this.tileGrid.getTileCoordExtent(s),this.Qc,this.ih);return this.tileCache.set(o,c),c},n.prototype.useTile=function(t,n,i){var r=Vc(t,n,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},n}(pd),lx="KVP",vx="REST",dx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),px=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(r=n.interpolate);var e=void 0!==n.requestEncoding?n.requestEncoding:lx,o=n.tileGrid,s=n.urls;return void 0===s&&void 0!==n.url&&(s=af(n.url)),(i=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:r,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileClass:n.tileClass,tileGrid:o,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:n.tilePixelRatio,urls:s,wrapX:void 0!==n.wrapX&&n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).sh=void 0!==n.version?n.version:"1.0.0",i.Fe=void 0!==n.format?n.format:"image/jpeg",i.ah=void 0!==n.dimensions?n.dimensions:{},i.Bs=n.layer,i.uh=n.matrixSet,i.K=n.style,i.hh=e,i.setKey(i.fh()),s&&s.length>0&&(i.tileUrlFunction=of(s.map(i.createFromWMTSTemplate.bind(i)))),i}return dx(n,t),n.prototype.setUrls=function(t){this.urls=t;var n=t.join("\n");this.setTileUrlFunction(of(t.map(this.createFromWMTSTemplate.bind(this))),n)},n.prototype.getDimensions=function(){return this.ah},n.prototype.getFormat=function(){return this.Fe},n.prototype.getLayer=function(){return this.Bs},n.prototype.getMatrixSet=function(){return this.uh},n.prototype.getRequestEncoding=function(){return this.hh},n.prototype.getStyle=function(){return this.K},n.prototype.getVersion=function(){return this.sh},n.prototype.fh=function(){var t=0,n=[];for(var i in this.ah)n[t++]=i+"-"+this.ah[i];return n.join("/")},n.prototype.updateDimensions=function(t){E(this.ah,t),this.setKey(this.fh())},n.prototype.createFromWMTSTemplate=function(t){var n=this.hh,i={layer:this.Bs,style:this.K,tilematrixset:this.uh};n==lx&&E(i,{Service:"WMTS",Request:"GetTile",Version:this.sh,Format:this.Fe}),t=n==lx?uf(t,i):t.replace(/\{(\w+?)\}/g,(function(t,n){return n.toLowerCase()in i?i[n.toLowerCase()]:t}));var r=this.tileGrid,e=this.ah;return function(i,o,s){if(i){var a={TileMatrix:r.getMatrixId(i[0]),TileCol:i[1],TileRow:i[2]};E(a,e);var u=t;return u=n==lx?uf(u,a):u.replace(/\{(\w+?)\}/g,(function(t,n){return a[n]}))}}},n}(gd);var yx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mx="renderOrder",wx=function(t){function n(n){var i=this,r=n||{},e=E({},r);return delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,(i=t.call(this,e)||this).lh=void 0!==r.declutter&&r.declutter,i.dh=void 0!==r.renderBuffer?r.renderBuffer:100,i.K=null,i.tt=void 0,i.setStyle(r.style),i.ph=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,i.yh=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,i}return yx(n,t),n.prototype.getDeclutter=function(){return this.lh},n.prototype.getFeatures=function(n){return t.prototype.getFeatures.call(this,n)},n.prototype.getRenderBuffer=function(){return this.dh},n.prototype.getRenderOrder=function(){return this.get(mx)},n.prototype.getStyle=function(){return this.K},n.prototype.getStyleFunction=function(){return this.tt},n.prototype.getUpdateWhileAnimating=function(){return this.ph},n.prototype.getUpdateWhileInteracting=function(){return this.yh},n.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new ed(9)),this.getRenderer().renderDeclutter(t)},n.prototype.setRenderOrder=function(t){this.set(mx,t)},n.prototype.setStyle=function(t){this.K=void 0!==t?t:Yv,this.tt=null===t?void 0:Jv(this.K),this.changed()},n}(gs);var bx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gx=function(t){function n(n,i){var r=this,e=i.uniforms||{},s=[1,0,0,1,0,0];e[$f]=s,(r=t.call(this,n,{uniforms:e,postProcesses:i.postProcesses})||this).ready=!1,r.mh=-1,r.wh=new Vf(hf,vf),r.bh=new Vf(hf,vf),r.gh=new Vf(ff,vf),r.ta=i.vertexShader,r.na=i.fragmentShader,r.Qs,r.xh=!(!i.hitFragmentShader||!i.hitVertexShader),r.jh=i.hitVertexShader,r.Sh=i.hitFragmentShader,r.kh;var a=i.attributes?i.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:el.FLOAT}})):[];r.attributes=[{name:"a_position",size:2,type:el.FLOAT},{name:"a_index",size:1,type:el.FLOAT}].concat(a),r.hitDetectionAttributes=[{name:"a_position",size:2,type:el.FLOAT},{name:"a_index",size:1,type:el.FLOAT},{name:"a_hitColor",size:4,type:el.FLOAT},{name:"a_featureUid",size:1,type:el.FLOAT}].concat(a),r.customAttributes=i.attributes?i.attributes:[],r.Ki=[1/0,1/0,-1/0,-1/0],r.Mh=s,r._h=[1,0,0,1,0,0],r.Oh=[1,0,0,1,0,0],r.Th=new Float32Array(0),r.Eh=new Float32Array(0),r.Ah,r.Ch=0,r.Rh=function(){var t='var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;rf&&(this.instructions.push([_x.CUSTOM,f,o,t,i,be]),this.hitDetectionInstructions.push([_x.CUSTOM,f,o,t,r||i,be]));break;case Pt.POINT:e=t.getFlatCoordinates(),this.coordinates.push(e[0],e[1]),o=this.coordinates.length,this.instructions.push([_x.CUSTOM,f,o,t,i]),this.hitDetectionInstructions.push([_x.CUSTOM,f,o,t,r||i])}this.endGeometry(n)},n.prototype.beginGeometry=function(t,n){this.Uh=[_x.BEGIN_GEOMETRY,n,0,t],this.instructions.push(this.Uh),this.qh=[_x.BEGIN_GEOMETRY,n,0,t],this.hitDetectionInstructions.push(this.qh)},n.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},n.prototype.reverseHitDetectionInstructions=function(){var t,n=this.hitDetectionInstructions;n.reverse();var i,r,e=n.length,o=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.Bh=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},n.prototype.createFill=function(t){var n=t.fillStyle,i=[_x.SET_FILL_STYLE,n];return"string"!=typeof n&&i.push(!0),i},n.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},n.prototype.createStroke=function(t){return[_x.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},n.prototype.updateFillStyle=function(t,n){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(n.call(this,t)),t.currentFillStyle=i)},n.prototype.updateStrokeStyle=function(t,n){var i=t.strokeStyle,r=t.lineCap,e=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,u=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=r||e!=t.currentLineDash&&!x(t.currentLineDash,e)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=u)&&(void 0!==i&&n.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=r,t.currentLineDash=e,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=u)},n.prototype.endGeometry=function(t){this.Uh[2]=this.instructions.length,this.Uh=null,this.qh[2]=this.hitDetectionInstructions.length,this.qh=null;var n=[_x.END_GEOMETRY,t];this.instructions.push(n),this.hitDetectionInstructions.push(n)},n.prototype.getBufferedMaxExtent=function(){if(!this.Bh&&(this.Bh=kn(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Sn(this.Bh,t,this.Bh)}return this.Bh},n}(Sh),Ex=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ax=function(t){function n(n,i,r,e){var o=t.call(this,n,i,r,e)||this;return o.Ma=null,o.Nt=null,o.Xh=void 0,o.Hh=void 0,o.Jh=void 0,o.Kh=void 0,o.ua=void 0,o.Yh=void 0,o.Zh=void 0,o.ca=void 0,o.Dr=void 0,o.ha=void 0,o.Wa=void 0,o.$h=void 0,o}return Ex(n,t),n.prototype.drawPoint=function(t,n){if(this.Nt){this.beginGeometry(t,n);var i=t.getFlatCoordinates(),r=t.getStride(),e=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([_x.DRAW_IMAGE,e,o,this.Nt,this.Hh*this.Xh,this.Jh*this.Xh,Math.ceil(this.Kh*this.Xh),this.ua,this.Yh,this.Zh,this.ca,this.Dr,[this.ha[0]*this.pixelRatio/this.Xh,this.ha[1]*this.pixelRatio/this.Xh],Math.ceil(this.Wa*this.Xh),this.$h]),this.hitDetectionInstructions.push([_x.DRAW_IMAGE,e,o,this.Ma,this.Hh,this.Jh,this.Kh,this.ua,this.Yh,this.Zh,this.ca,this.Dr,this.ha,this.Wa,this.$h]),this.endGeometry(n)}},n.prototype.drawMultiPoint=function(t,n){if(this.Nt){this.beginGeometry(t,n);var i=t.getFlatCoordinates(),r=t.getStride(),e=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([_x.DRAW_IMAGE,e,o,this.Nt,this.Hh*this.Xh,this.Jh*this.Xh,Math.ceil(this.Kh*this.Xh),this.ua,this.Yh,this.Zh,this.ca,this.Dr,[this.ha[0]*this.pixelRatio/this.Xh,this.ha[1]*this.pixelRatio/this.Xh],Math.ceil(this.Wa*this.Xh),this.$h]),this.hitDetectionInstructions.push([_x.DRAW_IMAGE,e,o,this.Ma,this.Hh,this.Jh,this.Kh,this.ua,this.Yh,this.Zh,this.ca,this.Dr,this.ha,this.Wa,this.$h]),this.endGeometry(n)}},n.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.Hh=void 0,this.Jh=void 0,this.Ma=null,this.Nt=null,this.Xh=void 0,this.Kh=void 0,this.ha=void 0,this.ua=void 0,this.Yh=void 0,this.Zh=void 0,this.ca=void 0,this.Dr=void 0,this.Wa=void 0,t.prototype.finish.call(this)},n.prototype.setImageStyle=function(t,n){var i=t.getAnchor(),r=t.getSize(),e=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.Xh=t.getPixelRatio(this.pixelRatio),this.Hh=i[0],this.Jh=i[1],this.Ma=e,this.Nt=o,this.Kh=r[1],this.ua=t.getOpacity(),this.Yh=s[0]*this.Xh,this.Zh=s[1]*this.Xh,this.ca=t.getRotateWithView(),this.Dr=t.getRotation(),this.ha=t.getScaleArray(),this.Wa=r[0],this.$h=n},n}(Tx),Cx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Rx=function(t){function n(n,i,r,e){return t.call(this,n,i,r,e)||this}return Cx(n,t),n.prototype.Qh=function(t,n,i,r){var e=this.coordinates.length,o=this.appendFlatLineCoordinates(t,n,i,r,!1,!1),s=[_x.MOVE_TO_LINE_TO,e,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},n.prototype.drawLineString=function(t,n){var i=this.state,r=i.strokeStyle,e=i.lineWidth;if(void 0!==r&&void 0!==e){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,n),this.hitDetectionInstructions.push([_x.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Gs,0],kx);var o=t.getFlatCoordinates(),s=t.getStride();this.Qh(o,0,o.length,s),this.hitDetectionInstructions.push(Sx),this.endGeometry(n)}},n.prototype.drawMultiLineString=function(t,n){var i=this.state,r=i.strokeStyle,e=i.lineWidth;if(void 0!==r&&void 0!==e){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,n),this.hitDetectionInstructions.push([_x.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],kx);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),u=0,c=0,h=o.length;ct&&(m>y&&(y=m,d=w,p=o),m=0,w=o-e)),s=a,h=l,f=v),u=b,c=g}return(m+=a)>y?[w,o]:[d,p]}var zx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fx={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Lx=function(t){function n(n,i,r,e){var o=t.call(this,n,i,r,e)||this;return o.if=null,o.oo="",o.so=0,o.ao=0,o.uo=void 0,o.co=0,o.fo=null,o.fillStates={},o.lo=null,o.strokeStates={},o.vo={},o.textStates={},o.rf="",o.ef="",o.af="",o.$h=void 0,o}return zx(n,t),n.prototype.finish=function(){var n=t.prototype.finish.call(this);return n.textStates=this.textStates,n.fillStates=this.fillStates,n.strokeStates=this.strokeStates,n},n.prototype.drawText=function(t,n){var i=this.fo,r=this.lo,e=this.vo;if(""!==this.oo&&e&&(i||r)){var o=this.coordinates,s=o.length,a=t.getType(),u=null,c=t.getStride();if(e.placement!==nd||a!=Pt.LINE_STRING&&a!=Pt.MULTI_LINE_STRING&&a!=Pt.POLYGON&&a!=Pt.MULTI_POLYGON){var h=e.overflow?null:[];switch(a){case Pt.POINT:case Pt.MULTI_POINT:u=t.getFlatCoordinates();break;case Pt.LINE_STRING:u=t.getFlatMidpoint();break;case Pt.CIRCLE:u=t.getCenter();break;case Pt.MULTI_LINE_STRING:u=t.getFlatMidpoints(),c=2;break;case Pt.POLYGON:u=t.getFlatInteriorPoint(),e.overflow||h.push(u[2]/this.resolution),c=3;break;case Pt.MULTI_POLYGON:var f=t.getFlatInteriorPoints();u=[];for(j=0,S=f.length;jT[2]}else M=g>_;var E,A=Math.PI,C=[],R=j+r===n;if(y=0,m=S,l=t[n=j],v=t[n+1],R){w(),E=Math.atan2(v-p,l-d),M&&(E+=E>0?-A:A);var P=(_+g)/2,I=(O+x)/2;return C[0]=[P,I,(k-o)/2,E,e],C}for(var N=0,z=e.length;N0?-A:A),void 0!==E){var L=F-E;if(L+=L>A?-2*A:L<-A?2*A:0,Math.abs(L)>s)return null}E=F;for(var G=N,D=0;N0&&t.push("\n",""),t.push(n,""),t}var $x=function(){function t(t,n,i,r){this.overlaps=i,this.pixelRatio=n,this.resolution=t,this.df,this.instructions=r.instructions,this.coordinates=r.coordinates,this.pf={},this.yf=[1,0,0,1,0,0],this.hitDetectionInstructions=r.hitDetectionInstructions,this.do=null,this.De=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.mf={},this.if={}}return t.prototype.createLabel=function(t,n,i,r){var e=t+n+i+r;if(this.if[e])return this.if[e];var o=r?this.strokeStates[r]:null,s=i?this.fillStates[i]:null,a=this.textStates[n],u=this.pixelRatio,c=[a.scale[0]*u,a.scale[1]*u],h=Array.isArray(t),f=Yx(h?t[0]:t,a.textAlign||Bs),l=r&&o.lineWidth?o.lineWidth:0,v=h?t:t.split("\n").reduce(Zx,[]),d=ra(a,v),p=d.width,y=d.height,m=d.widths,w=d.heights,b=d.lineWidths,g=p+l,x=[],j=(g+2)*c[0],S=(y+l)*c[1],k={width:j<0?Math.floor(j):Math.ceil(j),height:S<0?Math.floor(S):Math.ceil(S),contextInstructions:x};(1==c[0]&&1==c[1]||x.push("scale",c),r)&&(x.push("strokeStyle",o.strokeStyle),x.push("lineWidth",l),x.push("lineCap",o.lineCap),x.push("lineJoin",o.lineJoin),x.push("miterLimit",o.miterLimit),(Ht?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(x.push("setLineDash",[o.lineDash]),x.push("lineDashOffset",o.lineDashOffset)));i&&x.push("fillStyle",s.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");for(var M,_=.5-f,O=f*g+_*l,T=[],E=[],A=0,C=0,R=0,P=0,I=0,N=v.length;It?t-u:e,g=o+c>n?n-c:o,x=v[3]+b*f[0]+v[1],j=v[0]+g*f[1]+v[2],S=m-v[3],k=w-v[0];return(d||0!==h)&&(Wx[0]=S,Hx[0]=S,Wx[1]=k,Vx[1]=k,Vx[0]=S+x,Xx[0]=Vx[0],Xx[1]=k+j,Hx[1]=Xx[1]),0!==h?(rn(y=un([1,0,0,1,0,0],i,r,1,1,h,-i,-r),Wx),rn(y,Vx),rn(y,Xx),rn(y,Hx),Cn(Math.min(Wx[0],Vx[0],Xx[0],Hx[0]),Math.min(Wx[1],Vx[1],Xx[1],Hx[1]),Math.max(Wx[0],Vx[0],Xx[0],Hx[0]),Math.max(Wx[1],Vx[1],Xx[1],Hx[1]),Bx)):Cn(Math.min(S,S+x),Math.min(k,k+j),Math.max(S,S+x),Math.max(k,k+j),Bx),l&&(m=Math.round(m),w=Math.round(w)),{drawImageX:m,drawImageY:w,drawImageW:b,drawImageH:g,originX:u,originY:c,declutterBox:{minX:Bx[0],minY:Bx[1],maxX:Bx[2],maxY:Bx[3],value:p},canvasTransform:y,scale:f}},t.prototype.xf=function(t,n,i,r,e,o,s){var a=!(!o&&!s),u=r.declutterBox,c=t.canvas,h=s?s[2]*r.scale[0]/2:0;return u.minX-h<=c.width/n&&u.maxX+h>=0&&u.minY-h<=c.height/n&&u.maxY+h>=0&&(a&&this.wf(t,Wx,Vx,Xx,Hx,o,s),ea(t,r.canvasTransform,e,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.da=function(t){if(this.df){var n=rn(this.yf,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(n[0]%i,n[1]%i),t.rotate(this.De)}t.fill(),this.df&&t.restore()},t.prototype.bf=function(t,n){t.strokeStyle=n[1],t.lineWidth=n[2],t.lineCap=n[3],t.lineJoin=n[4],t.miterLimit=n[5],t.setLineDash&&(t.lineDashOffset=n[7],t.setLineDash(n[6]))},t.prototype.jf=function(t,n,i,r){var e=this.textStates[n],o=this.createLabel(t,n,r,i),s=this.strokeStates[i],a=this.pixelRatio,u=Yx(Array.isArray(t)?t[0]:t,e.textAlign||Bs),c=Fx[e.textBaseline||Ws],h=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:u*(o.width/a-2*e.scale[0])+2*(.5-u)*h,anchorY:c*o.height/a+2*(.5-c)*h}},t.prototype.Sf=function(t,n,i,r,e,o,s,a){var u;this.do&&x(i,this.yf)?u=this.do:(this.do||(this.do=[]),u=Wr(this.coordinates,0,this.coordinates.length,2,i,this.do),nn(this.yf,i));for(var c,h,f,l,v,d,p,y,m,w,b,g,j,S,k,M,_=0,O=r.length,T=0,E=0,A=0,C=null,R=null,P=this.pf,I=this.De,N=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,z={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:I},F=this.instructions!=r||this.overlaps?0:200;_F&&(this.da(t),E=0),A>F&&(t.stroke(),A=0),E||A||(t.beginPath(),l=NaN,v=NaN),++_;break;case _x.CIRCLE:var G=u[T=L[1]],D=u[T+1],U=u[T+2]-G,q=u[T+3]-D,B=Math.sqrt(U*U+q*q);t.moveTo(G+B,D),t.arc(G,D,B,0,2*Math.PI,!0),++_;break;case _x.CLOSE_PATH:t.closePath(),++_;break;case _x.CUSTOM:T=L[1],c=L[2];var W=L[3],V=L[4],X=6==L.length?L[5]:void 0;z.geometry=W,z.feature=j,_ in P||(P[_]=[]);var H=P[_];X?X(u,T,c,2,H):(H[0]=u[T],H[1]=u[T+1],H.length=2),V(H,z),++_;break;case _x.DRAW_IMAGE:T=L[1],c=L[2],y=L[3],h=L[4],f=L[5];var J=L[6],K=L[7],Y=L[8],Z=L[9],$=L[10],Q=L[11],tt=L[12],nt=L[13],it=L[14];if(!y&&L.length>=19){m=L[18],w=L[19],b=L[20],g=L[21];var rt=this.jf(m,w,b,g);y=rt.label,L[3]=y;var et=L[22];h=(rt.anchorX-et)*this.pixelRatio,L[4]=h;var ot=L[23];f=(rt.anchorY-ot)*this.pixelRatio,L[5]=f,J=y.height,L[6]=J,nt=y.width,L[13]=nt}var st=void 0;L.length>24&&(st=L[24]);var at=void 0,ut=void 0,ct=void 0;L.length>16?(at=L[15],ut=L[16],ct=L[17]):(at=Vs,ut=!1,ct=!1),$&&N?Q+=I:$||N||(Q-=I);for(var ht=0;T0){if(!o||f!==Th&&f!==Ch||-1!==o.indexOf(t)){var c=(l[a]-3)/4,v=r-c%s,d=r-(c/s|0),p=e(t,n,v*v+d*d);if(p)return p}h.clearRect(0,0,s,s);break}}var d,y,m,w,b,g=Object.keys(this.kf).map(Number);for(g.sort(p),d=g.length-1;d>=0;--d){var x=g[d].toString();for(m=this.kf[x],y=Qx.length-1;y>=0;--y)if(void 0!==(w=m[f=Qx[y]])&&(b=w.executeHitDetection(h,a,i,v,c)))return b}},t.prototype.getClipCoords=function(t){var n=this.ff;if(!n)return null;var i=n[0],r=n[1],e=n[2],o=n[3],s=[i,r,i,o,e,o,e,r];return Wr(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return R(this.kf)},t.prototype.execute=function(t,n,i,r,e,o,s){var a=Object.keys(this.kf).map(Number);a.sort(p),this.ff&&(t.save(),this.clip(t,i));var u,c,h,f,l,v,d=o||Qx;for(s&&a.reverse(),u=0,c=a.length;ui)break;var a=r[s];a||(a=[],r[s]=a),a.push(4*((t+e)*n+(t+o))+3),e>0&&a.push(4*((t-e)*n+(t+o))+3),o>0&&(a.push(4*((t+e)*n+(t-o))+3),e>0&&a.push(4*((t-e)*n+(t-o))+3))}for(var u=[],c=(e=0,r.length);ev[2];)m=p*++y,c.push(this.getRenderTransform(r,e,o,ej,h,f,m).slice()),d-=p}this.Rf=oj(i,c,this.Pf,u.getStyleFunction(),a,e,o)}n(sj(t,this.Pf,this.Rf))}.bind(this))},n.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e){var s=this;if(this.Df){var a,u=n.viewState.resolution,c=n.viewState.rotation,h=this.getLayer(),f={},l=function(t,n,i){var s=o(t),a=f[s];if(a){if(!0!==a&&ib[0]&&S[2]>b[2]&&w.push([S[0]-g,S[1],S[2]-g,S[3]])}if(!this.Cf&&this.If==h&&this.Sc==l&&this.Gf==d&&On(this.Nf,y))return x(this.zc,m)||(this.Rf=null,this.zc=m),this.Ff=p,this.replayGroupChanged=!1,!0;this.Df=null,this.Cf=!1;var k,M=new Dx(Nh(h,f),y,h,f);this.getLayer().getDeclutter()&&(k=new Dx(Nh(h,f),y,h,f));var _,O=Nr();if(O){for(var T=0,E=w.length;T0)n([]);else{var m=$n(f.getTileCoordExtent(r.wrappedTileCoord)),w=[(l[0]-m[0])/h,(m[1]-l[1])/h],b=r.getSourceTiles().reduce((function(t,n){return t.concat(n.getFeatures())}),[]),g=r.hitDetectionImageData[s];if(!g&&!this.Af){var x=uu(f.getTileSize(f.getZForResolution(h))),j=this.zf;g=oj(x,[this.getRenderTransform(f.getTileCoordCenter(r.wrappedTileCoord),h,0,ej,x[0]*ej,x[1]*ej,0)],b,e.getStyleFunction(),f.getTileCoordExtent(r.wrappedTileCoord),r.getReplayState(e).renderedResolution,j),r.hitDetectionImageData[s]=g}n(sj(w,b,g))}}.bind(this))},n.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.Vf&&t.changed()},n.prototype.Ef=function(t){this.renderIfReadyAndVisible()},n.prototype.renderDeclutter=function(t){var n=this.context,i=n.globalAlpha;n.globalAlpha=this.getLayer().getOpacity();for(var r=t.viewHints,e=!(r[za]||r[Fa]),s=this.renderedTiles,a=0,u=s.length;a=0;--f)h[f].execute(this.context,1,this.getTileRenderTransform(c,t),t.viewState.rotation,e,void 0,t.declutterTree)}n.globalAlpha=i},n.prototype.getTileRenderTransform=function(t,n){var i=n.pixelRatio,r=n.viewState,e=r.center,o=r.resolution,s=r.rotation,a=n.size,u=Math.round(a[0]*i),c=Math.round(a[1]*i),h=this.getLayer().getSource().getTileGridForProjection(n.viewState.projection),f=t.tileCoord,l=h.getTileCoordExtent(t.wrappedTileCoord),v=h.getTileCoordExtent(f,this.tmpExtent)[0]-l[0];return Qt(on(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(e,o,s,i,u,c,v))},n.prototype.renderFrame=function(n,i){var r=n.viewHints,e=!(r[za]||r[Fa]);t.prototype.renderFrame.call(this,n,i),this.Wf=n.pixelToCoordinateTransform.slice(),this.zf=n.viewState.rotation;var s=this.getLayer(),a=s.getRenderMode(),u=this.context,c=u.globalAlpha;u.globalAlpha=s.getOpacity();for(var h=yj[a],f=n.viewState,l=f.rotation,v=s.getSource(),d=v.getTileGridForProjection(f.projection).getZForResolution(f.resolution,v.zDirection),p=this.renderedTiles,y=[],m=[],w=p.length-1;w>=0;--w){var b=p[w],g=b.executorGroups[o(s)].filter((function(t){return t.hasExecutors(h)}));if(0!==g.length){for(var x=this.getTileRenderTransform(b,n),j=b.tileCoord[0],S=!1,k=g[0].getClipCoords(x),M=0,_=y.length;M<_;++M)if(d!==j&&j1?s:2,x=o||new Array(g);for(p=0;p>1;e1?new Ej(i,Et,e):new Ye(i,Et,r);default:throw new Error("Invalid geometry type:"+n)}}Cj.prototype.getEndss=Cj.prototype.getEnds,Cj.prototype.getFlatCoordinates=Cj.prototype.getOrientedFlatCoordinates;var Pj=Cj;var Ij=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Nj=function(t){function n(n){return t.call(this,n)||this}return Ij(n,t),n.prototype.createRenderer=function(){return new uj(this)},n}(wx);function zj(t,n,i){for(var r,e,o,s,a,u,c=[],h=t(0),f=t(1),l=n(h),v=n(f),d=[f,h],p=[v,l],y=[1,0],m={},w=1e5;--w>0&&y.length>0;)o=y.pop(),h=d.pop(),l=p.pop(),(u=o.toString())in m||(c.push(l[0],l[1]),m[u]=!0),s=y.pop(),f=d.pop(),v=p.pop(),li((e=n(r=t(a=(o+s)/2)))[0],e[1],l[0],l[1],v[0],v[1])this.Ll.length;)a=new Tt,this.Ll.push(a);var c=r.getFeaturesCollection();c.clear();var h,f,l=0;for(h=0,f=this.yl.length;hMath.PI/2);for(var d=Lh(t),p=c;p<=h;++p){var y=this.yl.length+this.ml.length,m=void 0,w=void 0,b=void 0,g=void 0;if(this._l)for(w=0,b=this._l.length;w=a?(t[0]=s[0],t[2]=s[2]):o=!0);var u=[ci(n[0],this.ll,this.hl),ci(n[1],this.vl,this.fl)],c=this.gl(u);isNaN(c[1])&&(c[1]=Math.abs(this.sl)>=Math.abs(this.ul)?this.sl:this.ul);var h,f,l,v,d=ci(c[0],this.cl,this.al),p=ci(c[1],this.ul,this.sl),y=this.pl,m=t;o||(m=[ci(t[0],this.ll,this.hl),ci(t[1],this.vl,this.fl),ci(t[2],this.ll,this.hl),ci(t[3],this.vl,this.fl)]);var w=si(m,this.gl,void 0,8),b=w[3],g=w[2],x=w[1],j=w[0];if(o||(_n(m,this.jl)&&(j=this.cl,x=this.ul),_n(m,this.Sl)&&(g=this.al,x=this.ul),_n(m,this.kl)&&(j=this.cl,b=this.sl),_n(m,this.Ml)&&(g=this.al,b=this.sl),b=ci(b,p,this.sl),g=ci(g,d,this.al),x=ci(x,this.ul,p),j=ci(j,this.cl,d)),v=ci(d=Math.floor(d/e)*e,this.cl,this.al),f=this.Bl(v,x,b,r,t,0),h=0,o)for(;(v-=e)>=j&&h++r[o]&&(e=o,o=1);var s=Math.max(n[1],r[e]),a=Math.min(n[3],r[o]),u=ci(n[1]+Math.abs(n[1]-n[3])*this.Al,s,a),c=[r[e-1]+(r[o-1]-r[e-1])*(u-r[e])/(r[o]-r[e]),u],h=this._l[i].geom;return h.setCoordinates(c),h},n.prototype.getMeridians=function(){return this.yl},n.prototype.Xl=function(t,n,i,r,e){var o=Lj(t,n,i,this.di,r),s=this.ml[e];return s?(s.setFlatCoordinates(Et,o),s.changed()):s=new kj(o,Et),s},n.prototype.Jl=function(t,n,i){var r=t.getFlatCoordinates(),e=0,o=r.length-2;r[e]>r[o]&&(e=o,o=0);var s=Math.max(n[0],r[e]),a=Math.min(n[2],r[o]),u=ci(n[0]+Math.abs(n[0]-n[2])*this.Cl,s,a),c=[u,r[e+1]+(r[o+1]-r[e+1])*(u-r[e])/(r[o]-r[e])],h=this.Ol[i].geom;return h.setCoordinates(c),h},n.prototype.getParallels=function(){return this.ml},n.prototype.Ul=function(t){var n=gr("EPSG:4326"),i=t.getWorldExtent();this.sl=i[3],this.al=i[2],this.ul=i[1],this.cl=i[0];var r=Ar(t,n);if(this.cl=Math.abs(this.ul)?this.sl:this.ul),this.di=t},n}(Nj),Bj=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Wj="blur",Vj="gradient",Xj="radius",Hj=["#00f","#0ff","#0f0","#ff0","#f00"];var Jj=function(t){function n(n){var i=this,r=n||{},e=E({},r);delete e.gradient,delete e.radius,delete e.blur,delete e.weight,(i=t.call(this,e)||this).Yl=null,i.addChangeListener(Vj,i.Zl),i.setGradient(r.gradient?r.gradient:Hj),i.setBlur(void 0!==r.blur?r.blur:15),i.setRadius(void 0!==r.radius?r.radius:8);var o=r.weight?r.weight:"weight";return i.$l="string"==typeof o?function(t){return t.get(o)}:o,i.setRenderOrder(null),i}return Bj(n,t),n.prototype.getBlur=function(){return this.get(Wj)},n.prototype.getGradient=function(){return this.get(Vj)},n.prototype.getRadius=function(){return this.get(Xj)},n.prototype.Zl=function(){this.Yl=function(t){for(var n=1,i=256,r=Oo(n,i),e=r.createLinearGradient(0,0,n,i),o=1/(t.length-1),s=0,a=t.length;s>3)?i.readString():2===t?i.readFloat():3===t?i.readDouble():4===t?i.readVarint64():5===t?i.readVarint():6===t?i.readSVarint():7===t?i.readBoolean():null;n.values.push(r)}}function iS(t,n,i){if(1==t)n.id=i.readVarint();else if(2==t)for(var r=i.readVarint()+i.pos;i.pos>3}s--,1===o||2===o?(a+=t.readSVarint(),u+=t.readSVarint(),1===o&&c>h&&(r.push(c),h=c),i.push(a,u),c+=2):7===o?c>h&&(i.push(i[h],i[h+1]),c+=2):Mt(!1,59)}c>h&&(r.push(c),h=c)},n.prototype.rv=function(t,n,i){var r,e=n.type;if(0===e)return null;var o,s=n.properties;this.nv?(o=s[this.nv],delete s[this.nv]):o=n.id,s[this.tv]=n.layer.name;var a=[],u=[];this.iv(t,n,a,u);var c=function(t,n){var i;1===t?i=1===n?Pt.POINT:Pt.MULTI_POINT:2===t?i=1===n?Pt.LINE_STRING:Pt.MULTI_LINE_STRING:3===t&&(i=Pt.POLYGON);return i}(e,u.length);if(this.Ql===Pj)(r=new this.Ql(c,a,u,s,o)).transform(i.dataProjection);else{var h=void 0;if(c==Pt.POLYGON){var f=He(a,u);h=f.length>1?new Ej(a,Et,f):new Ye(a,Et,u)}else h=c===Pt.POINT?new Te(a,Et):c===Pt.LINE_STRING?new kj(a,Et):c===Pt.POLYGON?new Ye(a,Et,u):c===Pt.MULTI_POINT?new bj(a,Et):c===Pt.MULTI_LINE_STRING?new _j(a,Et,u):null;r=new(0,this.Ql),this.H&&r.setGeometryName(this.H);var l=Yj(h,!1,i);r.setGeometry(l),void 0!==o&&r.setId(o),r.setProperties(s,!0)}return r},n.prototype.getType=function(){return uh},n.prototype.readFeatures=function(t,n){var i=this.qc,r=this.adaptOptions(n),e=gr(r.dataProjection);e.setWorldExtent(r.extent),r.dataProjection=e;var o=new $j(t),s=o.readFields(tS,{}),a=[];for(var u in s)if(!i||-1!=i.indexOf(u)){var c=s[u],h=c?[0,0,c.extent,c.extent]:null;e.setExtent(h);for(var f=0,l=c.length;f=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function PS(t,n){if(t){if("string"==typeof t)return IS(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?IS(t,n):void 0}}function IS(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=new Array(n);i`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols with point placement would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols with point placement would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `image` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Gets the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Gets the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0"}}},accumulated:{doc:"Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the fog. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the fog to the color of the sky. A value of zero leaves a sharp transition from fog to sky. Increasing the value blends the color of fog into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0"}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","sdk-support":{"basic functionality":{js:"2.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}};var FS="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function LS(t){var n={exports:{}};return t(n,n.exports),n.exports}var GS=LS((function(t,n){!function(i){var r=n&&!n.nodeType&&n,e=t&&!t.nodeType&&t,o="object"==NS(FS)&&FS;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var s,a,u=2147483647,c=36,h=/^xn--/,f=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function y(t){throw RangeError(v[t])}function m(t,n){for(var i=t.length,r=[];i--;)r[i]=n(t[i]);return r}function w(t,n){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+m((t=t.replace(l,".")).split("."),n).join(".")}function b(t){for(var n,i,r=[],e=0,o=t.length;e=55296&&n<=56319&&e65535&&(n+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),n+=p(t)})).join("")}function x(t,n){return t+22+75*(t<26)-((0!=n)<<5)}function j(t,n,i){var r=0;for(t=i?d(t/700):t>>1,t+=d(t/n);t>455;r+=c)t=d(t/35);return d(r+36*t/(t+38))}function S(t){var n,i,r,e,o,s,a,h,f,l,v,p=[],m=t.length,w=0,b=128,x=72;for((i=t.lastIndexOf("-"))<0&&(i=0),r=0;r=128&&y("not-basic"),p.push(t.charCodeAt(r));for(e=i>0?i+1:0;e=m&&y("invalid-input"),((h=(v=t.charCodeAt(e++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:c)>=c||h>d((u-w)/s))&&y("overflow"),w+=h*s,!(h<(f=a<=x?1:a>=x+26?26:a-x));a+=c)s>d(u/(l=c-f))&&y("overflow"),s*=l;x=j(w-o,n=p.length+1,0==o),d(w/n)>u-b&&y("overflow"),b+=d(w/n),w%=n,p.splice(w++,0,b)}return g(p)}function k(t){var n,i,r,e,o,s,a,h,f,l,v,m,w,g,S,k=[];for(m=(t=b(t)).length,n=128,i=0,o=72,s=0;s=n&&vd((u-i)/(w=r+1))&&y("overflow"),i+=(a-n)*w,n=a,s=0;su&&y("overflow"),v==n){for(h=i,f=c;!(h<(l=f<=o?1:f>=o+26?26:f-o));f+=c)S=h-l,g=c-l,k.push(p(x(l+S%g,0))),h=d(S/g);k.push(p(x(h,0))),o=j(i,w,r==e),i=0,++r}++i,++n}return k.join("")}if(s={version:"1.3.2",ucs2:{decode:b,encode:g},decode:S,encode:k,toASCII:function(t){return w(t,(function(t){return f.test(t)?"xn--"+k(t):t}))},toUnicode:function(t){return w(t,(function(t){return h.test(t)?S(t.slice(4).toLowerCase()):t}))}},r&&e)if(t.exports==r)e.exports=s;else for(a in s)s.hasOwnProperty(a)&&(r[a]=s[a]);else i.punycode=s}(FS)})),DS=function(t){return"string"==typeof t},US=function(t){return"object"===NS(t)&&null!==t},qS=function(t){return null===t},BS=function(t){return null==t};function WS(t,n){return Object.prototype.hasOwnProperty.call(t,n)}var VS=function(t,n,i,r){n=n||"&",i=i||"=";var e={};if("string"!=typeof t||0===t.length)return e;var o=/\+/g;t=t.split(n);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var u=0;u=0?(c=v.substr(0,d),h=v.substr(d+1)):(c=v,h=""),f=decodeURIComponent(c),l=decodeURIComponent(h),WS(e,f)?Array.isArray(e[f])?e[f].push(l):e[f]=[e[f],l]:e[f]=l}return e},XS=function(t){switch(NS(t)){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},HS=function(t,n,i,r){return n=n||"&",i=i||"=",null===t&&(t=void 0),"object"===NS(t)?Object.keys(t).map((function(r){var e=encodeURIComponent(XS(r))+i;return Array.isArray(t[r])?t[r].map((function(t){return e+encodeURIComponent(XS(t))})).join(n):e+encodeURIComponent(XS(t[r]))})).join(n):r?encodeURIComponent(XS(r))+i+encodeURIComponent(XS(t)):""},JS=LS((function(t,n){n.decode=n.parse=VS,n.encode=n.stringify=HS}));function KS(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var YS=/^([a-z0-9.+-]+:)/i,ZS=/:[0-9]*$/,$S=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,QS=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),tk=["'"].concat(QS),nk=["%","/","?",";","#"].concat(tk),ik=["/","?","#"],rk=/^[+a-z0-9A-Z_-]{0,63}$/,ek=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ok={javascript:!0,"javascript:":!0},sk={javascript:!0,"javascript:":!0},ak={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function uk(t,n,i){if(t&&US(t)&&t instanceof KS)return t;var r=new KS;return r.parse(t,n,i),r}KS.prototype.parse=function(t,n,i){if(!DS(t))throw new TypeError("Parameter 'url' must be a string, not "+NS(t));var r=t.indexOf("?"),e=-1!==r&&r127?g+="x":g+=b[x];if(!g.match(rk)){var S=m.slice(0,d),k=m.slice(d+1),M=b.match(ek);M&&(S.push(M[1]),k.unshift(M[2])),k.length&&(s="/"+k.join(".")+s),this.hostname=S.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=GS.toASCII(this.hostname));var _=this.port?":"+this.port:"",O=this.hostname||"";this.host=O+_,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!ok[c])for(d=0,w=tk.length;d0)&&i.host.split("@"))&&(i.auth=M.shift(),i.host=i.hostname=M.shift());return i.search=t.search,i.query=t.query,qS(i.pathname)&&qS(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!b.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var x=b.slice(-1)[0],j=(i.host||t.host||b.length>1)&&("."===x||".."===x)||""===x,S=0,k=b.length;k>=0;k--)"."===(x=b[k])?b.splice(k,1):".."===x?(b.splice(k,1),S++):S&&(b.splice(k,1),S--);if(!m&&!w)for(;S--;S)b.unshift("..");!m||""===b[0]||b[0]&&"/"===b[0].charAt(0)||b.unshift(""),j&&"/"!==b.join("/").substr(-1)&&b.push("");var M,_=""===b[0]||b[0]&&"/"===b[0].charAt(0);g&&(i.hostname=i.host=_?"":b.length?b.shift():"",(M=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=M.shift(),i.host=i.hostname=M.shift()));return(m=m||i.host&&b.length)&&!_&&b.unshift(""),b.length?i.pathname=b.join("/"):(i.pathname=null,i.path=null),qS(i.pathname)&&qS(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},KS.prototype.parseHost=function(){var t=this.host,n=ZS.exec(t);n&&(":"!==(n=n[0])&&(this.port=n.substr(1)),t=t.substr(0,t.length-n.length)),t&&(this.hostname=t)};function ck(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:[];MS(this,t),this.parent=n,this.bindings={};var r,e=RS(i);try{for(e.s();!(r=e.n()).done;){var o=gS(r.value,2),s=o[0],a=o[1];this.bindings[s]=a}}catch(t){e.e(t)}finally{e.f()}}return kS(t,[{key:"concat",value:function(n){return new t(this,n)}},{key:"get",value:function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error("".concat(t," not found in scope."))}},{key:"has",value:function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}]),t}(),lk={kind:"null"},vk={kind:"number"},dk={kind:"string"},pk={kind:"boolean"},yk={kind:"color"},mk={kind:"object"},wk={kind:"value"},bk={kind:"collator"},gk={kind:"formatted"},xk={kind:"resolvedImage"};function jk(t,n){return{kind:"array",itemType:t,N:n}}function Sk(t){if("array"===t.kind){var n=Sk(t.itemType);return"number"==typeof t.N?"array<".concat(n,", ").concat(t.N,">"):"value"===t.itemType.kind?"array":"array<".concat(n,">")}return t.kind}var kk=[lk,vk,dk,pk,yk,gk,mk,jk(wk),xk];function Mk(t,n){if("error"===n.kind)return null;if("array"===t.kind){if("array"===n.kind&&(0===n.N&&"value"===n.itemType.kind||!Mk(t.itemType,n.itemType))&&("number"!=typeof t.N||t.N===n.N))return null}else{if(t.kind===n.kind)return null;if("value"===t.kind){var i,r=RS(kk);try{for(r.s();!(i=r.n()).done;){if(!Mk(i.value,n))return null}}catch(t){r.e(t)}finally{r.f()}}}return"Expected ".concat(Sk(t)," but found ").concat(Sk(n)," instead.")}function _k(t,n){return n.some((function(n){return n.kind===t.kind}))}function Ok(t,n){return n.some((function(n){return"null"===n?null===t:"array"===n?Array.isArray(t):"object"===n?t&&!Array.isArray(t)&&"object"===NS(t):n===NS(t)}))}var Tk=LS((function(t,n){var i={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function r(t){return(t=Math.round(t))<0?0:t>255?255:t}function e(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?r(parseFloat(t)/100*255):r(parseInt(t))}function s(t){return"%"===t[t.length-1]?e(parseFloat(t)/100):e(parseFloat(t))}function a(t,n,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(n-t)*i*6:2*i<1?n:3*i<2?t+(n-t)*(2/3-i)*6:t}try{n.parseCSSColor=function(t){var n,e=t.replace(/ /g,"").toLowerCase();if(e in i)return i[e].slice();if("#"===e[0])return 4===e.length?(n=parseInt(e.substr(1),16))>=0&&n<=4095?[(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1]:null:7===e.length&&(n=parseInt(e.substr(1),16))>=0&&n<=16777215?[(16711680&n)>>16,(65280&n)>>8,255&n,1]:null;var u=e.indexOf("("),c=e.indexOf(")");if(-1!==u&&c+1===e.length){var h=e.substr(0,u),f=e.substr(u+1,c-(u+1)).split(","),l=1;switch(h){case"rgba":if(4!==f.length)return null;l=s(f.pop());case"rgb":return 3!==f.length?null:[o(f[0]),o(f[1]),o(f[2]),l];case"hsla":if(4!==f.length)return null;l=s(f.pop());case"hsl":if(3!==f.length)return null;var v=(parseFloat(f[0])%360+360)%360/360,d=s(f[1]),p=s(f[2]),y=p<=.5?p*(d+1):p+d-p*d,m=2*p-y;return[r(255*a(m,y,v+1/3)),r(255*a(m,y,v)),r(255*a(m,y,v-1/3)),l];default:return null}}return null}}catch(t){}})),Ek=function(){function t(n,i,r){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;MS(this,t),this.r=n,this.g=i,this.b=r,this.a=e}return kS(t,[{key:"toString",value:function(){var t=gS(this.toArray(),4),n=t[0],i=t[1],r=t[2],e=t[3];return"rgba(".concat(Math.round(n),",").concat(Math.round(i),",").concat(Math.round(r),",").concat(e,")")}},{key:"toArray",value:function(){var t=this.r,n=this.g,i=this.b,r=this.a;return 0===r?[0,0,0,0]:[255*t/r,255*n/r,255*i/r,r]}}],[{key:"parse",value:function(n){if(n){if(n instanceof t)return n;if("string"==typeof n){var i=Tk.parseCSSColor(n);if(i)return new t(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3])}}}}]),t}();Ek.black=new Ek(0,0,0,1),Ek.white=new Ek(1,1,1,1),Ek.transparent=new Ek(0,0,0,0),Ek.red=new Ek(1,0,0,1),Ek.blue=new Ek(0,0,1,1);var Ak=function(){function t(n,i,r){MS(this,t),this.sensitivity=n?i?"variant":"case":i?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}return kS(t,[{key:"compare",value:function(t,n){return this.collator.compare(t,n)}},{key:"resolvedLocale",value:function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}]),t}(),Ck=kS((function t(n,i,r,e,o){MS(this,t),this.text=n,this.image=i,this.scale=r,this.fontStack=e,this.textColor=o})),Rk=function(){function t(n){MS(this,t),this.sections=n}return kS(t,[{key:"isEmpty",value:function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))}},{key:"toString",value:function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")}},{key:"serialize",value:function(){var t,n=["format"],i=RS(this.sections);try{for(i.s();!(t=i.n()).done;){var r=t.value;if(r.image)n.push(["image",r.image.name]);else{n.push(r.text);var e={};r.fontStack&&(e["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(e["font-scale"]=r.scale),r.textColor&&(e["text-color"]=["rgba"].concat(r.textColor.toArray())),n.push(e)}}}catch(t){i.e(t)}finally{i.f()}return n}}],[{key:"fromString",value:function(n){return new t([new Ck(n,null,null,null,null)])}},{key:"factory",value:function(n){return n instanceof t?n:t.fromString(n)}}]),t}(),Pk=function(){function t(n){MS(this,t),this.name=n.name,this.available=n.available}return kS(t,[{key:"toString",value:function(){return this.name}},{key:"serialize",value:function(){return["image",this.name]}}],[{key:"fromString",value:function(n){return n?new t({name:n,available:!1}):null}}]),t}();function Ik(t,n,i,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof n&&n>=0&&n<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value [".concat([t,n,i,r].join(", "),"]: 'a' must be between 0 and 1."):"Invalid rgba value [".concat(("number"==typeof r?[t,n,i,r]:[t,n,i]).join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}function Nk(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof Ek)return!0;if(t instanceof Ak)return!0;if(t instanceof Rk)return!0;if(t instanceof Pk)return!0;if(Array.isArray(t)){var n,i=RS(t);try{for(i.s();!(n=i.n()).done;){if(!Nk(n.value))return!1}}catch(t){i.e(t)}finally{i.f()}return!0}if("object"===NS(t)){for(var r in t)if(!Nk(t[r]))return!1;return!0}return!1}function zk(t){if(null===t)return lk;if("string"==typeof t)return dk;if("boolean"==typeof t)return pk;if("number"==typeof t)return vk;if(t instanceof Ek)return yk;if(t instanceof Ak)return bk;if(t instanceof Rk)return gk;if(t instanceof Pk)return xk;if(Array.isArray(t)){var n,i,r=t.length,e=RS(t);try{for(e.s();!(i=e.n()).done;){var o=zk(i.value);if(n){if(n===o)continue;n=wk;break}n=o}}catch(t){e.e(t)}finally{e.f()}return jk(n||wk,r)}return mk}function Fk(t){var n=NS(t);return null===t?"":"string"===n||"number"===n||"boolean"===n?String(t):t instanceof Ek||t instanceof Rk||t instanceof Pk?t.toString():JSON.stringify(t)}var Lk=function(){function t(n,i){MS(this,t),this.type=n,this.value=i}return kS(t,[{key:"evaluate",value:function(){return this.value}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Ek?["rgba"].concat(this.value.toArray()):this.value instanceof Rk?this.value.serialize():this.value}}],[{key:"parse",value:function(n,i){if(2!==n.length)return i.error("'literal' expression requires exactly one argument, but found ".concat(n.length-1," instead."));if(!Nk(n[1]))return i.error("invalid value");var r=n[1],e=zk(r),o=i.expectedType;return"array"!==e.kind||0!==e.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(e=o),new t(e,r)}}]),t}(),Gk=function(){function t(n){MS(this,t),this.name="ExpressionEvaluationError",this.message=n}return kS(t,[{key:"toJSON",value:function(){return this.message}}]),t}(),Dk={string:dk,number:vk,boolean:pk,object:mk},Uk=function(){function t(n,i){MS(this,t),this.type=n,this.args=i}return kS(t,[{key:"evaluate",value:function(t){for(var n=0;n1)&&n.push(r)}}return n.concat(this.args.map((function(t){return t.serialize()})))}}],[{key:"parse",value:function(n,i){if(n.length<2)return i.error("Expected at least one argument.");var r,e=1,o=n[0];if("array"===o){var s,a;if(n.length>2){var u=n[1];if("string"!=typeof u||!(u in Dk)||"object"===u)return i.error('The item type argument of "array" must be one of string, number, boolean',1);s=Dk[u],e++}else s=wk;if(n.length>3){if(null!==n[2]&&("number"!=typeof n[2]||n[2]<0||n[2]!==Math.floor(n[2])))return i.error('The length argument to "array" must be a positive integer literal',2);a=n[2],e++}r=jk(s,a)}else r=Dk[o];for(var c=[];e-1),i}},{key:"eachChild",value:function(t){t(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["image",this.input.serialize()]}}],[{key:"parse",value:function(n,i){if(2!==n.length)return i.error("Expected two arguments.");var r=i.parse(n[1],1,dk);return r?new t(r):i.error("No image name provided.")}}]),t}(),Wk={"to-boolean":pk,"to-color":yk,"to-number":vk,"to-string":dk},Vk=function(){function t(n,i){MS(this,t),this.type=n,this.args=i}return kS(t,[{key:"evaluate",value:function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){var n,i,r,e=RS(this.args);try{for(e.s();!(r=e.n()).done;){if(n=r.value.evaluate(t),i=null,n instanceof Ek)return n;if("string"==typeof n){var o=t.parseColor(n);if(o)return o}else if(Array.isArray(n)&&!(i=n.length<3||n.length>4?"Invalid rbga value ".concat(JSON.stringify(n),": expected an array containing either three or four numeric values."):Ik(n[0],n[1],n[2],n[3])))return new Ek(n[0]/255,n[1]/255,n[2]/255,n[3])}}catch(t){e.e(t)}finally{e.f()}throw new Gk(i||"Could not parse color from value '".concat("string"==typeof n?n:String(JSON.stringify(n)),"'"))}if("number"===this.type.kind){var s,a=null,u=RS(this.args);try{for(u.s();!(s=u.n()).done;){if(null===(a=s.value.evaluate(t)))return 0;var c=Number(a);if(!isNaN(c))return c}}catch(t){u.e(t)}finally{u.f()}throw new Gk("Could not convert ".concat(JSON.stringify(a)," to number."))}return"formatted"===this.type.kind?Rk.fromString(Fk(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?Pk.fromString(Fk(this.args[0].evaluate(t))):Fk(this.args[0].evaluate(t))}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"outputDefined",value:function(){return this.args.every((function(t){return t.outputDefined()}))}},{key:"serialize",value:function(){if("formatted"===this.type.kind)return new qk([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Bk(this.args[0]).serialize();var t=["to-".concat(this.type.kind)];return this.eachChild((function(n){t.push(n.serialize())})),t}}],[{key:"parse",value:function(n,i){if(n.length<2)return i.error("Expected at least one argument.");var r=n[0];if(("to-boolean"===r||"to-string"===r)&&2!==n.length)return i.error("Expected one argument.");for(var e=Wk[r],o=[],s=1;s=n[2])&&(!(t[1]<=n[1])&&!(t[3]>=n[3])))}function Qk(t,n){var i,r=(180+t[0])/360,e=(i=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360),o=Math.pow(2,n.z);return[Math.round(r*o*Yk),Math.round(e*o*Yk)]}function tM(t,n,i){var r=t[0]-n[0],e=t[1]-n[1],o=t[0]-i[0],s=t[1]-i[1];return r*s-o*e==0&&r*o<=0&&e*s<=0}function nM(t,n,i){return n[1]>t[1]!=i[1]>t[1]&&t[0]<(i[0]-n[0])*(t[1]-n[1])/(i[1]-n[1])+n[0]}function iM(t,n){for(var i=!1,r=0,e=n.length;r0&&f<0||h<0&&f>0}function oM(t,n,i){var r,e,o,s,a,u,c,h,f,l=RS(i);try{for(l.s();!(r=l.n()).done;)for(var v=r.value,d=0;di[2]){var e=.5*r,o=t[0]-i[0]>e?-r:i[0]-t[0]>e?r:0;0===o&&(o=t[0]-i[2]>e?-r:i[2]-t[0]>e?r:0),t[0]+=o}Zk(n,t)}function fM(t,n,i,r){var e,o=Math.pow(2,r.z)*Yk,s=[r.x*Yk,r.y*Yk],a=[],u=RS(t);try{for(u.s();!(e=u.n()).done;){var c,h=RS(e.value);try{for(h.s();!(c=h.n()).done;){var f=c.value,l=[f.x+s[0],f.y+s[1]];hM(l,n,i,o),a.push(l)}}catch(t){h.e(t)}finally{h.f()}}}catch(t){u.e(t)}finally{u.f()}return a}function lM(t,n,i,r){var e,o=Math.pow(2,r.z)*Yk,s=[r.x*Yk,r.y*Yk],a=[],u=RS(t);try{for(u.s();!(e=u.n()).done;){var c,h=e.value,f=[],l=RS(h);try{for(l.s();!(c=l.n()).done;){var v=c.value,d=[v.x+s[0],v.y+s[1]];Zk(n,d),f.push(d)}}catch(t){l.e(t)}finally{l.f()}a.push(f)}}catch(t){u.e(t)}finally{u.f()}if(n[2]-n[0]<=o/2){!function(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}(n);var p,y=RS(a);try{for(y.s();!(p=y.n()).done;){var m,w=RS(p.value);try{for(w.s();!(m=w.n()).done;){hM(m.value,n,i,o)}}catch(t){w.e(t)}finally{w.f()}}}catch(t){y.e(t)}finally{y.f()}}return a}var vM=function(){function t(n,i){MS(this,t),this.type=pk,this.geojson=n,this.geometries=i}return kS(t,[{key:"evaluate",value:function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,n){var i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],e=t.canonicalID();if("Polygon"===n.type){var o=uM(n.coordinates,r,e),s=fM(t.geometry(),i,r,e);if(!$k(i,r))return!1;var a,u=RS(s);try{for(u.s();!(a=u.n()).done;)if(!iM(a.value,o))return!1}catch(t){u.e(t)}finally{u.f()}}if("MultiPolygon"===n.type){var c=cM(n.coordinates,r,e),h=fM(t.geometry(),i,r,e);if(!$k(i,r))return!1;var f,l=RS(h);try{for(l.s();!(f=l.n()).done;)if(!rM(f.value,c))return!1}catch(t){l.e(t)}finally{l.f()}}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,n){var i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],e=t.canonicalID();if("Polygon"===n.type){var o=uM(n.coordinates,r,e),s=lM(t.geometry(),i,r,e);if(!$k(i,r))return!1;var a,u=RS(s);try{for(u.s();!(a=u.n()).done;)if(!sM(a.value,o))return!1}catch(t){u.e(t)}finally{u.f()}}if("MultiPolygon"===n.type){var c=cM(n.coordinates,r,e),h=lM(t.geometry(),i,r,e);if(!$k(i,r))return!1;var f,l=RS(h);try{for(l.s();!(f=l.n()).done;)if(!aM(f.value,c))return!1}catch(t){l.e(t)}finally{l.f()}}return!0}(t,this.geometries)}return!1}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["within",this.geojson]}}],[{key:"parse",value:function(n,i){if(2!==n.length)return i.error("'within' expression requires exactly one argument, but found ".concat(n.length-1," instead."));if(Nk(n[1])){var r=n[1];if("FeatureCollection"===r.type)for(var e=0;e=0)return!1;var i=!0;return t.eachChild((function(t){i&&!yM(t,n)&&(i=!1)})),i}var mM=function(){function t(n,i){MS(this,t),this.type=i.type,this.name=n,this.boundExpression=i}return kS(t,[{key:"evaluate",value:function(t){return this.boundExpression.evaluate(t)}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["var",this.name]}}],[{key:"parse",value:function(n,i){if(2!==n.length||"string"!=typeof n[1])return i.error("'var' expression requires exactly one string literal argument.");var r=n[1];return i.scope.has(r)?new t(r,i.scope.get(r)):i.error('Unknown variable "'.concat(r,'". Make sure "').concat(r,'" has been bound in an enclosing "let" expression before using it.'),1)}}]),t}(),wM=function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new fk,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];MS(this,t),this.registry=n,this.path=i,this.key=i.map((function(t){return"[".concat(t,"]")})).join(""),this.scope=e,this.errors=o,this.expectedType=r}return kS(t,[{key:"parse",value:function(t,n,i,r){var e=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return n?this.concat(n,i,r)._parse(t,e):this._parse(t,e)}},{key:"_parse",value:function(t,n){function i(t,n,i){return"assert"===i?new Uk(n,[t]):"coerce"===i?new Vk(n,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found ".concat(NS(r),' instead. If you wanted a literal array, use ["literal", [...]].'),0),null;var e=this.registry[r];if(e){var o=e.parse(t,this);if(!o)return null;if(this.expectedType){var s=this.expectedType,a=o.type;if("string"!==s.kind&&"number"!==s.kind&&"boolean"!==s.kind&&"object"!==s.kind&&"array"!==s.kind||"value"!==a.kind)if("color"!==s.kind&&"formatted"!==s.kind&&"resolvedImage"!==s.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(s,a))return null}else o=i(o,s,n.typeAnnotation||"coerce");else o=i(o,s,n.typeAnnotation||"assert")}if(!(o instanceof Lk)&&"resolvedImage"!==o.type.kind&&bM(o)){var u=new Hk;try{o=new Lk(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'.concat(r,'". If you wanted a literal array, use ["literal", [...]].'),0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"===NS(t)?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found ".concat(NS(t)," instead."))}},{key:"concat",value:function(n,i,r){var e="number"==typeof n?this.path.concat(n):this.path,o=r?this.scope.concat(r):this.scope;return new t(this.registry,e,i||null,o,this.errors)}},{key:"error",value:function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;rn))throw new Gk("Input is not a number.");s=a-1}return 0}var xM=function(){function t(n,i,r){MS(this,t),this.type=n,this.input=i,this.labels=[],this.outputs=[];var e,o=RS(r);try{for(o.s();!(e=o.n()).done;){var s=gS(e.value,2),a=s[0],u=s[1];this.labels.push(a),this.outputs.push(u)}}catch(t){o.e(t)}finally{o.f()}}return kS(t,[{key:"evaluate",value:function(t){var n=this.labels,i=this.outputs;if(1===n.length)return i[0].evaluate(t);var r=this.input.evaluate(t);if(r<=n[0])return i[0].evaluate(t);var e=n.length;return r>=n[e-1]?i[e-1].evaluate(t):i[gM(n,r)].evaluate(t)}},{key:"eachChild",value:function(t){t(this.input);var n,i=RS(this.outputs);try{for(i.s();!(n=i.n()).done;){t(n.value)}}catch(t){i.e(t)}finally{i.f()}}},{key:"outputDefined",value:function(){return this.outputs.every((function(t){return t.outputDefined()}))}},{key:"serialize",value:function(){for(var t=["step",this.input.serialize()],n=0;n0&&t.push(this.labels[n]),t.push(this.outputs[n].serialize());return t}}],[{key:"parse",value:function(n,i){if(n.length-1<4)return i.error("Expected at least 4 arguments, but found only ".concat(n.length-1,"."));if((n.length-1)%2!=0)return i.error("Expected an even number of arguments.");var r=i.parse(n[1],1,vk);if(!r)return null;var e=[],o=null;i.expectedType&&"value"!==i.expectedType.kind&&(o=i.expectedType);for(var s=1;s=a)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',c);var f=i.parse(u,h,o);if(!f)return null;o=o||f.type,e.push([a,f])}return new t(o,r,e)}}]),t}(),jM=SM;function SM(t,n,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(r-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=i,this.p2y=r}function kM(t,n,i){return t*(1-i)+n*i}SM.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},SM.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},SM.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},SM.prototype.solveCurveX=function(t,n){var i,r,e,o,s;for(void 0===n&&(n=1e-6),e=t,s=0;s<8;s++){if(o=this.sampleCurveX(e)-t,Math.abs(o)(r=1))return r;for(;io?i=e:r=e,e=.5*(r-i)+i}return e},SM.prototype.solve=function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))};var MM=Object.freeze({__proto__:null,number:kM,color:function(t,n,i){return new Ek(kM(t.r,n.r,i),kM(t.g,n.g,i),kM(t.b,n.b,i),kM(t.a,n.a,i))},array:function(t,n,i){return t.map((function(t,r){return kM(t,n[r],i)}))}}),_M=.95047,OM=1.08883,TM=4/29,EM=6/29,AM=3*EM*EM,CM=Math.PI/180,RM=180/Math.PI;function PM(t){return t>.008856451679035631?Math.pow(t,1/3):t/AM+TM}function IM(t){return t>EM?t*t*t:AM*(t-TM)}function NM(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function zM(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function FM(t){var n=zM(t.r),i=zM(t.g),r=zM(t.b),e=PM((.4124564*n+.3575761*i+.1804375*r)/_M),o=PM((.2126729*n+.7151522*i+.072175*r)/1);return{l:116*o-16,a:500*(e-o),b:200*(o-PM((.0193339*n+.119192*i+.9503041*r)/OM)),alpha:t.a}}function LM(t){var n=(t.l+16)/116,i=isNaN(t.a)?n:n+t.a/500,r=isNaN(t.b)?n:n-t.b/200;return n=1*IM(n),i=_M*IM(i),r=OM*IM(r),new Ek(NM(3.2404542*i-1.5371385*n-.4985314*r),NM(-.969266*i+1.8760108*n+.041556*r),NM(.0556434*i-.2040259*n+1.0572252*r),t.alpha)}function GM(t,n,i){var r=n-t;return t+i*(r>180||r<-180?r-360*Math.round(r/360):r)}var DM={forward:FM,reverse:LM,interpolate:function(t,n,i){return{l:kM(t.l,n.l,i),a:kM(t.a,n.a,i),b:kM(t.b,n.b,i),alpha:kM(t.alpha,n.alpha,i)}}},UM={forward:function(t){var n=FM(t),i=n.l,r=n.a,e=n.b,o=Math.atan2(e,r)*RM;return{h:o<0?o+360:o,c:Math.sqrt(r*r+e*e),l:i,alpha:t.a}},reverse:function(t){var n=t.h*CM,i=t.c;return LM({l:t.l,a:Math.cos(n)*i,b:Math.sin(n)*i,alpha:t.alpha})},interpolate:function(t,n,i){return{h:GM(t.h,n.h,i),c:kM(t.c,n.c,i),l:kM(t.l,n.l,i),alpha:kM(t.alpha,n.alpha,i)}}},qM=function(){function t(n,i,r,e,o){MS(this,t),this.type=n,this.operator=i,this.interpolation=r,this.input=e,this.labels=[],this.outputs=[];var s,a=RS(o);try{for(a.s();!(s=a.n()).done;){var u=gS(s.value,2),c=u[0],h=u[1];this.labels.push(c),this.outputs.push(h)}}catch(t){a.e(t)}finally{a.f()}}return kS(t,[{key:"evaluate",value:function(n){var i=this.labels,r=this.outputs;if(1===i.length)return r[0].evaluate(n);var e=this.input.evaluate(n);if(e<=i[0])return r[0].evaluate(n);var o=i.length;if(e>=i[o-1])return r[o-1].evaluate(n);var s=gM(i,e),a=i[s],u=i[s+1],c=t.interpolationFactor(this.interpolation,e,a,u),h=r[s].evaluate(n),f=r[s+1].evaluate(n);return"interpolate"===this.operator?MM[this.type.kind.toLowerCase()](h,f,c):"interpolate-hcl"===this.operator?UM.reverse(UM.interpolate(UM.forward(h),UM.forward(f),c)):DM.reverse(DM.interpolate(DM.forward(h),DM.forward(f),c))}},{key:"eachChild",value:function(t){t(this.input);var n,i=RS(this.outputs);try{for(i.s();!(n=i.n()).done;){t(n.value)}}catch(t){i.e(t)}finally{i.f()}}},{key:"outputDefined",value:function(){return this.outputs.every((function(t){return t.outputDefined()}))}},{key:"serialize",value:function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var n=[this.operator,t,this.input.serialize()],i=0;i1})))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);s={name:"cubic-bezier",controlPoints:h}}if(n.length-1<4)return i.error("Expected at least 4 arguments, but found only ".concat(n.length-1,"."));if((n.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(!(a=i.parse(a,2,vk)))return null;var f=[],l=null;"interpolate-hcl"===o||"interpolate-lab"===o?l=yk:i.expectedType&&"value"!==i.expectedType.kind&&(l=i.expectedType);for(var v=0;v=d)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',y);var w=i.parse(p,m,l);if(!w)return null;l=l||w.type,f.push([d,w])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new t(l,o,s,a,f):i.error("Type ".concat(Sk(l)," is not interpolatable."))}}]),t}();function BM(t,n,i,r){var e=r-i,o=t-i;return 0===e?0:1===n?o/e:(Math.pow(n,o)-1)/(Math.pow(n,e)-1)}var WM=function(){function t(n,i){MS(this,t),this.type=n,this.args=i}return kS(t,[{key:"evaluate",value:function(t){var n,i,r=null,e=0,o=RS(this.args);try{for(o.s();!(i=o.n()).done;){var s=i.value;if(e++,(r=s.evaluate(t))&&r instanceof Pk&&!r.available&&(n||(n=r.name),r=null,e===this.args.length&&(r=n)),null!==r)break}}catch(t){o.e(t)}finally{o.f()}return r}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"outputDefined",value:function(){return this.args.every((function(t){return t.outputDefined()}))}},{key:"serialize",value:function(){var t=["coalesce"];return this.eachChild((function(n){t.push(n.serialize())})),t}}],[{key:"parse",value:function(n,i){if(n.length<2)return i.error("Expectected at least one argument.");var r=null,e=i.expectedType;e&&"value"!==e.kind&&(r=e);var o,s=[],a=RS(n.slice(1));try{for(a.s();!(o=a.n()).done;){var u=o.value,c=i.parse(u,1+s.length,r,void 0,{typeAnnotation:"omit"});if(!c)return null;r=r||c.type,s.push(c)}}catch(t){a.e(t)}finally{a.f()}return new t(e&&s.some((function(t){return Mk(e,t.type)}))?wk:r,s)}}]),t}(),VM=function(){function t(n,i){MS(this,t),this.type=i.type,this.bindings=[].concat(n),this.result=i}return kS(t,[{key:"evaluate",value:function(t){return this.result.evaluate(t)}},{key:"eachChild",value:function(t){var n,i=RS(this.bindings);try{for(i.s();!(n=i.n()).done;){t(n.value[1])}}catch(t){i.e(t)}finally{i.f()}t(this.result)}},{key:"outputDefined",value:function(){return this.result.outputDefined()}},{key:"serialize",value:function(){var t,n=["let"],i=RS(this.bindings);try{for(i.s();!(t=i.n()).done;){var r=gS(t.value,2),e=r[0],o=r[1];n.push(e,o.serialize())}}catch(t){i.e(t)}finally{i.f()}return n.push(this.result.serialize()),n}}],[{key:"parse",value:function(n,i){if(n.length<4)return i.error("Expected at least 3 arguments, but found ".concat(n.length-1," instead."));for(var r=[],e=1;e=i.length)throw new Gk("Array index out of bounds: ".concat(n," > ").concat(i.length-1,"."));if(n!==Math.floor(n))throw new Gk("Array index must be an integer, but found ".concat(n," instead."));return i[n]}},{key:"eachChild",value:function(t){t(this.index),t(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["at",this.index.serialize(),this.input.serialize()]}}],[{key:"parse",value:function(n,i){if(3!==n.length)return i.error("Expected 2 arguments, but found ".concat(n.length-1," instead."));var r=i.parse(n[1],1,vk),e=i.parse(n[2],2,jk(i.expectedType||wk));return r&&e?new t(e.type.itemType,r,e):null}}]),t}(),HM=function(){function t(n,i){MS(this,t),this.type=pk,this.needle=n,this.haystack=i}return kS(t,[{key:"evaluate",value:function(t){var n=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!Ok(n,["boolean","string","number","null"]))throw new Gk("Expected first argument to be of type boolean, string, number or null, but found ".concat(Sk(zk(n))," instead."));if(!Ok(i,["string","array"]))throw new Gk("Expected second argument to be of type array or string, but found ".concat(Sk(zk(i))," instead."));return i.indexOf(n)>=0}},{key:"eachChild",value:function(t){t(this.needle),t(this.haystack)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["in",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(n,i){if(3!==n.length)return i.error("Expected 2 arguments, but found ".concat(n.length-1," instead."));var r=i.parse(n[1],1,wk),e=i.parse(n[2],2,wk);return r&&e?_k(r.type,[pk,dk,vk,lk,wk])?new t(r,e):i.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(Sk(r.type)," instead")):null}}]),t}(),JM=function(){function t(n,i,r){MS(this,t),this.type=vk,this.needle=n,this.haystack=i,this.fromIndex=r}return kS(t,[{key:"evaluate",value:function(t){var n=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Ok(n,["boolean","string","number","null"]))throw new Gk("Expected first argument to be of type boolean, string, number or null, but found ".concat(Sk(zk(n))," instead."));if(!Ok(i,["string","array"]))throw new Gk("Expected second argument to be of type array or string, but found ".concat(Sk(zk(i))," instead."));if(this.fromIndex){var r=this.fromIndex.evaluate(t);return i.indexOf(n,r)}return i.indexOf(n)}},{key:"eachChild",value:function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(n,i){if(n.length<=2||n.length>=5)return i.error("Expected 3 or 4 arguments, but found ".concat(n.length-1," instead."));var r=i.parse(n[1],1,wk),e=i.parse(n[2],2,wk);if(!r||!e)return null;if(!_k(r.type,[pk,dk,vk,lk,wk]))return i.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(Sk(r.type)," instead"));if(4===n.length){var o=i.parse(n[3],3,vk);return o?new t(r,e,o):null}return new t(r,e)}}]),t}(),KM=function(){function t(n,i,r,e,o,s){MS(this,t),this.inputType=n,this.type=i,this.input=r,this.cases=e,this.outputs=o,this.otherwise=s}return kS(t,[{key:"evaluate",value:function(t){var n=this.input.evaluate(t);return(zk(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(t)}},{key:"eachChild",value:function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}},{key:"outputDefined",value:function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var t,n=this,i=["match",this.input.serialize()],r=[],e={},o=RS(Object.keys(this.cases).sort());try{for(o.s();!(t=o.n()).done;){var s=t.value,a=e[this.cases[s]];void 0===a?(e[this.cases[s]]=r.length,r.push([this.cases[s],[s]])):r[a][1].push(s)}}catch(t){o.e(t)}finally{o.f()}for(var u=function(t){return"number"===n.inputType.kind?Number(t):t},c=0,h=r;cNumber.MAX_SAFE_INTEGER)return h.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if("number"==typeof v&&Math.floor(v)!==v)return h.error("Numeric branch labels must be integer values.");if(r){if(h.checkSubtype(r,zk(v)))return null}else r=zk(v);if(void 0!==o[String(v)])return h.error("Branch labels must be unique.");o[String(v)]=s.length}}catch(t){l.e(t)}finally{l.f()}var d=i.parse(c,a,e);if(!d)return null;e=e||d.type,s.push(d)}var p=i.parse(n[1],1,wk);if(!p)return null;var y=i.parse(n[n.length-1],n.length-1,e);return y?"value"!==p.type.kind&&i.concat(1).checkSubtype(r,p.type)?null:new t(r,e,p,o,s,y):null}}]),t}(),YM=function(){function t(n,i,r){MS(this,t),this.type=n,this.branches=i,this.otherwise=r}return kS(t,[{key:"evaluate",value:function(t){var n,i=RS(this.branches);try{for(i.s();!(n=i.n()).done;){var r=gS(n.value,2),e=r[0],o=r[1];if(e.evaluate(t))return o.evaluate(t)}}catch(t){i.e(t)}finally{i.f()}return this.otherwise.evaluate(t)}},{key:"eachChild",value:function(t){var n,i=RS(this.branches);try{for(i.s();!(n=i.n()).done;){var r=gS(n.value,2),e=r[0],o=r[1];t(e),t(o)}}catch(t){i.e(t)}finally{i.f()}t(this.otherwise)}},{key:"outputDefined",value:function(){return this.branches.every((function(t){var n=gS(t,2);n[0];return n[1].outputDefined()}))&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var t=["case"];return this.eachChild((function(n){t.push(n.serialize())})),t}}],[{key:"parse",value:function(n,i){if(n.length<4)return i.error("Expected at least 3 arguments, but found only ".concat(n.length-1,"."));if(n.length%2!=0)return i.error("Expected an odd number of arguments.");var r;i.expectedType&&"value"!==i.expectedType.kind&&(r=i.expectedType);for(var e=[],o=1;o=5)return i.error("Expected 3 or 4 arguments, but found ".concat(n.length-1," instead."));var r=i.parse(n[1],1,wk),e=i.parse(n[2],2,vk);if(!r||!e)return null;if(!_k(r.type,[jk(wk),dk,wk]))return i.error("Expected first argument to be of type array or string, but found ".concat(Sk(r.type)," instead"));if(4===n.length){var o=i.parse(n[3],3,vk);return o?new t(r.type,r,e,o):null}return new t(r.type,r,e)}}]),t}();function $M(t,n){return"=="===t||"!="===t?"boolean"===n.kind||"string"===n.kind||"number"===n.kind||"null"===n.kind||"value"===n.kind:"string"===n.kind||"number"===n.kind||"value"===n.kind}function QM(t,n,i,r){return 0===r.compare(n,i)}function t_(t,n,i){var r="=="!==t&&"!="!==t;return function(){function e(t,n,i){MS(this,e),this.type=pk,this.lhs=t,this.rhs=n,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===n.type.kind}return kS(e,[{key:"evaluate",value:function(e){var o=this.lhs.evaluate(e),s=this.rhs.evaluate(e);if(r&&this.hasUntypedArgument){var a=zk(o),u=zk(s);if(a.kind!==u.kind||"string"!==a.kind&&"number"!==a.kind)throw new Gk('Expected arguments for "'.concat(t,'" to be (string, string) or (number, number), but found (').concat(a.kind,", ").concat(u.kind,") instead."))}if(this.collator&&!r&&this.hasUntypedArgument){var c=zk(o),h=zk(s);if("string"!==c.kind||"string"!==h.kind)return n(e,o,s)}return this.collator?i(e,o,s,this.collator.evaluate(e)):n(e,o,s)}},{key:"eachChild",value:function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){var n=[t];return this.eachChild((function(t){n.push(t.serialize())})),n}}],[{key:"parse",value:function(t,n){if(3!==t.length&&4!==t.length)return n.error("Expected two or three arguments.");var i=t[0],o=n.parse(t[1],1,wk);if(!o)return null;if(!$M(i,o.type))return n.concat(1).error('"'.concat(i,"\" comparisons are not supported for type '").concat(Sk(o.type),"'."));var s=n.parse(t[2],2,wk);if(!s)return null;if(!$M(i,s.type))return n.concat(2).error('"'.concat(i,"\" comparisons are not supported for type '").concat(Sk(s.type),"'."));if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return n.error("Cannot compare types '".concat(Sk(o.type),"' and '").concat(Sk(s.type),"'."));r&&("value"===o.type.kind&&"value"!==s.type.kind?o=new Uk(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new Uk(o.type,[s])));var a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return n.error("Cannot use collator to compare non-string types.");if(!(a=n.parse(t[3],3,bk)))return null}return new e(o,s,a)}}]),e}()}var n_=t_("==",(function(t,n,i){return n===i}),QM),i_=t_("!=",(function(t,n,i){return n!==i}),(function(t,n,i,r){return!QM(0,n,i,r)})),r_=t_("<",(function(t,n,i){return n",(function(t,n,i){return n>i}),(function(t,n,i,r){return r.compare(n,i)>0})),o_=t_("<=",(function(t,n,i){return n<=i}),(function(t,n,i,r){return r.compare(n,i)<=0})),s_=t_(">=",(function(t,n,i){return n>=i}),(function(t,n,i,r){return r.compare(n,i)>=0})),a_=function(){function t(n,i,r,e,o){MS(this,t),this.type=dk,this.number=n,this.locale=i,this.currency=r,this.minFractionDigits=e,this.maxFractionDigits=o}return kS(t,[{key:"evaluate",value:function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}},{key:"eachChild",value:function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}],[{key:"parse",value:function(n,i){if(3!==n.length)return i.error("Expected two arguments.");var r=i.parse(n[1],1,vk);if(!r)return null;var e=n[2];if("object"!==NS(e)||Array.isArray(e))return i.error("NumberFormat options argument must be an object.");var o=null;if(e.locale&&!(o=i.parse(e.locale,1,dk)))return null;var s=null;if(e.currency&&!(s=i.parse(e.currency,1,dk)))return null;var a=null;if(e["min-fraction-digits"]&&!(a=i.parse(e["min-fraction-digits"],1,vk)))return null;var u=null;return e["max-fraction-digits"]&&!(u=i.parse(e["max-fraction-digits"],1,vk))?null:new t(r,o,s,a,u)}}]),t}(),u_={"==":n_,"!=":i_,">":e_,"<":r_,">=":s_,"<=":o_,array:Uk,at:XM,boolean:Uk,case:YM,coalesce:WM,collator:Kk,format:qk,image:Bk,in:HM,"index-of":JM,interpolate:qM,"interpolate-hcl":qM,"interpolate-lab":qM,length:function(){function t(n){MS(this,t),this.type=vk,this.input=n}return kS(t,[{key:"evaluate",value:function(t){var n=this.input.evaluate(t);if("string"==typeof n)return n.length;if(Array.isArray(n))return n.length;throw new Gk("Expected value to be of type string or array, but found ".concat(Sk(zk(n))," instead."))}},{key:"eachChild",value:function(t){t(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t=["length"];return this.eachChild((function(n){t.push(n.serialize())})),t}}],[{key:"parse",value:function(n,i){if(2!==n.length)return i.error("Expected 1 argument, but found ".concat(n.length-1," instead."));var r=i.parse(n[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?i.error("Expected argument of type string or array, but found ".concat(Sk(r.type)," instead.")):new t(r):null}}]),t}(),let:VM,literal:Lk,match:KM,number:Uk,"number-format":a_,object:Uk,slice:ZM,step:xM,string:Uk,"to-boolean":Vk,"to-color":Vk,"to-number":Vk,"to-string":Vk,var:mM,within:vM};function c_(t,n){var i=gS(n,4),r=i[0],e=i[1],o=i[2],s=i[3];r=r.evaluate(t),e=e.evaluate(t),o=o.evaluate(t);var a=s?s.evaluate(t):1,u=Ik(r,e,o,a);if(u)throw new Gk(u);return new Ek(r/255*a,e/255*a,o/255*a,a)}function h_(t,n){return t in n}function f_(t,n){var i=n[t];return void 0===i?null:i}function l_(t){return{type:t}}function v_(t){return{result:"success",value:t}}function d_(t){return{result:"error",value:t}}function p_(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function y_(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function m_(t){return!!t.expression&&t.expression.interpolated}function w_(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":NS(t)}function b_(t){return"object"===NS(t)&&null!==t&&!Array.isArray(t)}Jk.register(u_,{error:[{kind:"error"},[dk],function(t,n){var i=gS(n,1)[0];throw new Gk(i.evaluate(t))}],typeof:[dk,[wk],function(t,n){return Sk(zk(gS(n,1)[0].evaluate(t)))}],"to-rgba":[jk(vk,4),[yk],function(t,n){return gS(n,1)[0].evaluate(t).toArray()}],rgb:[yk,[vk,vk,vk],c_],rgba:[yk,[vk,vk,vk,vk],c_],has:{type:pk,overloads:[[[dk],function(t,n){return h_(gS(n,1)[0].evaluate(t),t.properties())}],[[dk,mk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return h_(r.evaluate(t),e.evaluate(t))}]]},get:{type:wk,overloads:[[[dk],function(t,n){return f_(gS(n,1)[0].evaluate(t),t.properties())}],[[dk,mk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return f_(r.evaluate(t),e.evaluate(t))}]]},"feature-state":[wk,[dk],function(t,n){return f_(gS(n,1)[0].evaluate(t),t.featureState||{})}],properties:[mk,[],function(t){return t.properties()}],"geometry-type":[dk,[],function(t){return t.geometryType()}],id:[wk,[],function(t){return t.id()}],zoom:[vk,[],function(t){return t.globals.zoom}],"heatmap-density":[vk,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[vk,[],function(t){return t.globals.lineProgress||0}],"sky-radial-progress":[vk,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[wk,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[vk,l_(vk),function(t,n){var i,r=0,e=RS(n);try{for(e.s();!(i=e.n()).done;){r+=i.value.evaluate(t)}}catch(t){e.e(t)}finally{e.f()}return r}],"*":[vk,l_(vk),function(t,n){var i,r=1,e=RS(n);try{for(e.s();!(i=e.n()).done;){r*=i.value.evaluate(t)}}catch(t){e.e(t)}finally{e.f()}return r}],"-":{type:vk,overloads:[[[vk,vk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return r.evaluate(t)-e.evaluate(t)}],[[vk],function(t,n){return-gS(n,1)[0].evaluate(t)}]]},"/":[vk,[vk,vk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return r.evaluate(t)/e.evaluate(t)}],"%":[vk,[vk,vk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return r.evaluate(t)%e.evaluate(t)}],ln2:[vk,[],function(){return Math.LN2}],pi:[vk,[],function(){return Math.PI}],e:[vk,[],function(){return Math.E}],"^":[vk,[vk,vk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return Math.pow(r.evaluate(t),e.evaluate(t))}],sqrt:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.sqrt(i.evaluate(t))}],log10:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.log(i.evaluate(t))/Math.LN10}],ln:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.log(i.evaluate(t))}],log2:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.log(i.evaluate(t))/Math.LN2}],sin:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.sin(i.evaluate(t))}],cos:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.cos(i.evaluate(t))}],tan:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.tan(i.evaluate(t))}],asin:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.asin(i.evaluate(t))}],acos:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.acos(i.evaluate(t))}],atan:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.atan(i.evaluate(t))}],min:[vk,l_(vk),function(t,n){return Math.min.apply(Math,wS(n.map((function(n){return n.evaluate(t)}))))}],max:[vk,l_(vk),function(t,n){return Math.max.apply(Math,wS(n.map((function(n){return n.evaluate(t)}))))}],abs:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.abs(i.evaluate(t))}],round:[vk,[vk],function(t,n){var i=gS(n,1)[0].evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.floor(i.evaluate(t))}],ceil:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.ceil(i.evaluate(t))}],"filter-==":[pk,[dk,wk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return t.properties()[r.value]===e.value}],"filter-id-==":[pk,[wk],function(t,n){var i=gS(n,1)[0];return t.id()===i.value}],"filter-type-==":[pk,[dk],function(t,n){var i=gS(n,1)[0];return t.geometryType()===i.value}],"filter-<":[pk,[dk,wk],function(t,n){var i=gS(n,2),r=i[0],e=i[1],o=t.properties()[r.value],s=e.value;return NS(o)===NS(s)&&o":[pk,[dk,wk],function(t,n){var i=gS(n,2),r=i[0],e=i[1],o=t.properties()[r.value],s=e.value;return NS(o)===NS(s)&&o>s}],"filter-id->":[pk,[wk],function(t,n){var i=gS(n,1)[0],r=t.id(),e=i.value;return NS(r)===NS(e)&&r>e}],"filter-<=":[pk,[dk,wk],function(t,n){var i=gS(n,2),r=i[0],e=i[1],o=t.properties()[r.value],s=e.value;return NS(o)===NS(s)&&o<=s}],"filter-id-<=":[pk,[wk],function(t,n){var i=gS(n,1)[0],r=t.id(),e=i.value;return NS(r)===NS(e)&&r<=e}],"filter->=":[pk,[dk,wk],function(t,n){var i=gS(n,2),r=i[0],e=i[1],o=t.properties()[r.value],s=e.value;return NS(o)===NS(s)&&o>=s}],"filter-id->=":[pk,[wk],function(t,n){var i=gS(n,1)[0],r=t.id(),e=i.value;return NS(r)===NS(e)&&r>=e}],"filter-has":[pk,[wk],function(t,n){return gS(n,1)[0].value in t.properties()}],"filter-has-id":[pk,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[pk,[jk(dk)],function(t,n){return gS(n,1)[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[pk,[jk(wk)],function(t,n){return gS(n,1)[0].value.indexOf(t.id())>=0}],"filter-in-small":[pk,[dk,jk(wk)],function(t,n){var i=gS(n,2),r=i[0];return i[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[pk,[dk,jk(wk)],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return function(t,n,i,r){for(;i<=r;){var e=i+r>>1;if(n[e]===t)return!0;n[e]>t?r=e-1:i=e+1}return!1}(t.properties()[r.value],e.value,0,e.value.length-1)}],all:{type:pk,overloads:[[[pk,pk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return r.evaluate(t)&&e.evaluate(t)}],[l_(pk),function(t,n){var i,r=RS(n);try{for(r.s();!(i=r.n()).done;){if(!i.value.evaluate(t))return!1}}catch(t){r.e(t)}finally{r.f()}return!0}]]},any:{type:pk,overloads:[[[pk,pk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return r.evaluate(t)||e.evaluate(t)}],[l_(pk),function(t,n){var i,r=RS(n);try{for(r.s();!(i=r.n()).done;){if(i.value.evaluate(t))return!0}}catch(t){r.e(t)}finally{r.f()}return!1}]]},"!":[pk,[pk],function(t,n){return!gS(n,1)[0].evaluate(t)}],"is-supported-script":[pk,[dk],function(t,n){var i=gS(n,1)[0],r=t.globals&&t.globals.isSupportedScript;return!r||r(i.evaluate(t))}],upcase:[dk,[dk],function(t,n){return gS(n,1)[0].evaluate(t).toUpperCase()}],downcase:[dk,[dk],function(t,n){return gS(n,1)[0].evaluate(t).toLowerCase()}],concat:[dk,l_(wk),function(t,n){return n.map((function(n){return Fk(n.evaluate(t))})).join("")}],"resolved-locale":[dk,[bk],function(t,n){return gS(n,1)[0].evaluate(t).resolvedLocale()}]});var g_=function(){function t(n,i){var r;MS(this,t),this.expression=n,this._warningHistory={},this._evaluator=new Hk,this._defaultValue=i?"color"===(r=i).type&&b_(r.default)?new Ek(0,0,0,0):"color"===r.type?Ek.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=i&&"enum"===i.type?i.values:null}return kS(t,[{key:"evaluateWithoutErrorHandling",value:function(t,n,i,r,e,o){return this._evaluator.globals=t,this._evaluator.feature=n,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=e||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}},{key:"evaluate",value:function(t,n,i,r,e,o){this._evaluator.globals=t,this._evaluator.feature=n||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=e||null,this._evaluator.formattedSection=o||null;try{var s=this.expression.evaluate(this._evaluator);if(null==s||"number"==typeof s&&s!=s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new Gk("Expected value to be one of ".concat(Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", "),", but found ").concat(JSON.stringify(s)," instead."));return s}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}]),t}();function x_(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in u_}function j_(t,n){var i=new wM(u_,[],n?function(t){var n={color:yk,string:dk,number:vk,enum:dk,boolean:pk,formatted:gk,resolvedImage:xk};if("array"===t.type)return jk(n[t.value]||wk,t.length);return n[t.type]}(n):void 0),r=i.parse(t,void 0,void 0,void 0,n&&"string"===n.type?{typeAnnotation:"coerce"}:void 0);return r?v_(new g_(r,n)):d_(i.errors)}var S_=function(){function t(n,i){MS(this,t),this.kind=n,this._styleExpression=i,this.isStateDependent="constant"!==n&&!pM(i.expression)}return kS(t,[{key:"evaluateWithoutErrorHandling",value:function(t,n,i,r,e,o){return this._styleExpression.evaluateWithoutErrorHandling(t,n,i,r,e,o)}},{key:"evaluate",value:function(t,n,i,r,e,o){return this._styleExpression.evaluate(t,n,i,r,e,o)}}]),t}(),k_=function(){function t(n,i,r,e){MS(this,t),this.kind=n,this.zoomStops=r,this._styleExpression=i,this.isStateDependent="camera"!==n&&!pM(i.expression),this.interpolationType=e}return kS(t,[{key:"evaluateWithoutErrorHandling",value:function(t,n,i,r,e,o){return this._styleExpression.evaluateWithoutErrorHandling(t,n,i,r,e,o)}},{key:"evaluate",value:function(t,n,i,r,e,o){return this._styleExpression.evaluate(t,n,i,r,e,o)}},{key:"interpolationFactor",value:function(t,n,i){return this.interpolationType?qM.interpolationFactor(this.interpolationType,t,n,i):0}}]),t}();function M_(t,n){if("error"===(t=j_(t,n)).result)return t;var i=t.value.expression,r=dM(i);if(!r&&!p_(n))return d_([new hk("","data expressions not supported")]);var e=yM(i,["zoom"]);if(!e&&!y_(n))return d_([new hk("","zoom expressions not supported")]);var o=__(i);if(!o&&!e)return d_([new hk("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof hk)return d_([o]);if(o instanceof qM&&!m_(n))return d_([new hk("",'"interpolate" expressions cannot be used with this property')]);if(!o)return v_(new S_(r?"constant":"source",t.value));var s=o instanceof qM?o.interpolation:void 0;return v_(new k_(r?"camera":"composite",t.value,o.labels,s))}function __(t){var n=null;if(t instanceof VM)n=__(t.result);else if(t instanceof WM){var i,r=RS(t.args);try{for(r.s();!(i=r.n()).done;){var e=i.value;if(n=__(e))break}}catch(t){r.e(t)}finally{r.f()}}else(t instanceof xM||t instanceof qM)&&t.input instanceof Jk&&"zoom"===t.input.name&&(n=t);return n instanceof hk||t.eachChild((function(t){var i=__(t);i instanceof hk?n=i:!n&&i?n=new hk("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&i&&n!==i&&(n=new hk("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),n}function O_(t){return"object"===NS(t)?["literal",t]:t}function T_(t,n){var i=t.stops;if(!i)return function(t,n){var i=["get",t.property];if(void 0===t.default)return"string"===n.type?["string",i]:i;if("enum"===n.type)return["match",i,Object.keys(n.values),i,t.default];var r=["color"===n.type?"to-color":n.type,i,O_(t.default)];return"array"===n.type&&r.splice(1,0,n.value,n.length||null),r}(t,n);var r=i&&"object"===NS(i[0][0]),e=r||void 0!==t.property,o=r||!e;return i=i.map((function(t){return!e&&n.tokens&&"string"==typeof t[1]?[t[0],N_(t[1])]:[t[0],O_(t[1])]})),r?function(t,n,i){for(var r={},e={},o=[],s=0;s3&&void 0!==arguments[3]?arguments[3]:["zoom"],o=I_(t,n),s=!1;if("interval"===o)r=["step",e],s=!0;else{if("exponential"!==o)throw new Error('Unknown zoom function type "'.concat(o,'"'));var a=void 0!==t.base?t.base:1;r=[E_(t),1===a?["linear"]:["exponential",a],e]}var u,c=RS(i);try{for(c.s();!(u=c.n()).done;){var h=u.value;P_(r,h[0],h[1],s)}}catch(t){c.e(t)}finally{c.f()}return R_(r),r}(t,n,i):C_(t,n,i)}function E_(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function A_(t,n){var i,r,e=O_((i=t.default,r=n.default,void 0!==i?i:void 0!==r?r:void 0));return void 0===e&&"resolvedImage"===n.type?"":e}function C_(t,n,i){var r=I_(t,n),e=["get",t.property];if("categorical"===r&&"boolean"==typeof i[0][0]){var o,s=["case"],a=RS(i);try{for(a.s();!(o=a.n()).done;){var u=o.value;s.push(["==",e,u[0]],u[1])}}catch(t){a.e(t)}finally{a.f()}return s.push(A_(t,n)),s}if("categorical"===r){var c,h=["match",e],f=RS(i);try{for(f.s();!(c=f.n()).done;){var l=c.value;P_(h,l[0],l[1],!1)}}catch(t){f.e(t)}finally{f.f()}return h.push(A_(t,n)),h}if("interval"===r){var v,d=["step",["number",e]],p=RS(i);try{for(p.s();!(v=p.n()).done;){var y=v.value;P_(d,y[0],y[1],!0)}}catch(t){p.e(t)}finally{p.f()}return R_(d),void 0===t.default?d:["case",["==",["typeof",e],"number"],d,O_(t.default)]}if("exponential"===r){var m,w=void 0!==t.base?t.base:1,b=[E_(t),1===w?["linear"]:["exponential",w],["number",e]],g=RS(i);try{for(g.s();!(m=g.n()).done;){var x=m.value;P_(b,x[0],x[1],!1)}}catch(t){g.e(t)}finally{g.f()}return void 0===t.default?b:["case",["==",["typeof",e],"number"],b,O_(t.default)]}throw new Error("Unknown property function type ".concat(r))}function R_(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function P_(t,n,i,r){t.length>3&&n===t[t.length-2]||(r&&2===t.length||t.push(n),t.push(i))}function I_(t,n){return t.type?t.type:n.expression.interpolated?"exponential":"interval"}function N_(t){for(var n=["concat"],i=/{([^{}]+)}/g,r=0,e=i.exec(t);null!==e;e=i.exec(t)){var o=t.slice(r,i.lastIndex-e[0].length);r=i.lastIndex,o.length>0&&n.push(o),n.push(["get",e[1]])}if(1===n.length)return t;if(r=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":var n,i=RS(t.slice(1));try{for(i.s();!(n=i.n()).done;){var r=n.value;if(!z_(r)&&"boolean"!=typeof r)return!1}}catch(t){i.e(t)}finally{i.f()}return!0;default:return!0}}var F_={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function L_(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};z_(t)||(t=U_(t));var n=j_(t,F_);if("error"===n.result)throw new Error(n.value.map((function(t){return"".concat(t.key,": ").concat(t.message)})).join(", "));return{filter:function(t,i,r){return n.value.evaluate(t,i,{},r)},needGeometry:D_(t)}}function G_(t,n){return tn?1:0}function D_(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var n=1;n"===i||"<="===i||">="===i?q_(t[1],t[2],i):"any"===i?(n=t.slice(1),["any"].concat(n.map(U_))):"all"===i?["all"].concat(t.slice(1).map(U_)):"none"===i?["all"].concat(t.slice(1).map(U_).map(V_)):"in"===i?B_(t[1],t.slice(2)):"!in"===i?V_(B_(t[1],t.slice(2))):"has"===i?W_(t[1]):"!has"===i?V_(W_(t[1])):"within"!==i||t}function q_(t,n,i){switch(t){case"$type":return["filter-type-".concat(i),n];case"$id":return["filter-id-".concat(i),n];default:return["filter-".concat(i),t,n]}}function B_(t,n){if(0===n.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",n]];case"$id":return["filter-id-in",["literal",n]];default:return n.length>200&&!n.some((function(t){return NS(t)!==NS(n[0])}))?["filter-in-large",t,["literal",n.sort(G_)]]:["filter-in-small",t,["literal",n]]}}function W_(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function V_(t){return["!",t]}var X_=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function H_(t,n){var i={};for(var r in t)"ref"!==r&&(i[r]=t[r]);return X_.forEach((function(t){t in n&&(i[t]=n[t])})),i}var J_=kS((function t(n,i,r,e){MS(this,t),this.message=(n?"".concat(n,": "):"")+r,e&&(this.identifier=e),null!=i&&i.hv&&(this.line=i.hv)})),K_=kS((function t(n){MS(this,t),this.error=n,this.message=n.message;var i=n.message.match(/line (\d+)/);this.line=i?parseInt(i[1],10):0}));function Y_(t){var n=t.key,i=t.value;return i?[new J_(n,i,"constants have been deprecated as of v8")]:[]}function Z_(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function $_(t){if(Array.isArray(t))return t.map($_);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var n={};for(var i in t)n[i]=$_(t[i]);return n}return Z_(t)}function Q_(t){var n=t.key,i=t.value,r=t.valueSpec||{},e=t.objectElementValidators||{},o=t.style,s=t.styleSpec,a=[],u=w_(i);if("object"!==u)return[new J_(n,i,"object expected, ".concat(u," found"))];for(var c in i){var h=c.split(".")[0],f=r[h]||r["*"],l=void 0;if(e[h])l=e[h];else if(r[h])l=wO;else if(e["*"])l=e["*"];else{if(!r["*"]){a.push(new J_(n,i[c],'unknown property "'.concat(c,'"')));continue}l=wO}a=a.concat(l({key:(n?"".concat(n,"."):n)+c,value:i[c],valueSpec:f,style:o,styleSpec:s,object:i,objectKey:c},i))}for(var v in r)e[v]||r[v].required&&void 0===r[v].default&&void 0===i[v]&&a.push(new J_(n,i,'missing required property "'.concat(v,'"')));return a}function tO(t){var n=t.value,i=t.valueSpec,r=t.style,e=t.styleSpec,o=t.key,s=t.arrayElementValidator||wO;if("array"!==w_(n))return[new J_(o,n,"array expected, ".concat(w_(n)," found"))];if(i.length&&n.length!==i.length)return[new J_(o,n,"array length ".concat(i.length," expected, length ").concat(n.length," found"))];if(i["min-length"]&&n.lengtha)return[new J_(n,i,"".concat(i," is greater than the maximum value ").concat(a))]}return[]}function iO(t){var n,i,r,e=t.valueSpec,o=Z_(t.value.type),s={},a="categorical"!==o&&void 0===t.value.property,u=!a,c="array"===w_(t.value.stops)&&"array"===w_(t.value.stops[0])&&"object"===w_(t.value.stops[0][0]),h=Q_({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new J_(t.key,t.value,'identity function may not have a "stops" property')];var n=[],i=t.value;n=n.concat(tO({key:t.key,value:i,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:f})),"array"===w_(i)&&0===i.length&&n.push(new J_(t.key,i,"array must have at least one stop"));return n},default:function(t){return wO({key:t.key,value:t.value,valueSpec:e,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&a&&h.push(new J_(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||h.push(new J_(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!m_(t.valueSpec)&&h.push(new J_(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!p_(t.valueSpec)?h.push(new J_(t.key,t.value,"property functions not supported")):a&&!y_(t.valueSpec)&&h.push(new J_(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!c||void 0!==t.value.property||h.push(new J_(t.key,t.value,'"property" property is required')),h;function f(t){var n=[],o=t.value,a=t.key;if("array"!==w_(o))return[new J_(a,o,"array expected, ".concat(w_(o)," found"))];if(2!==o.length)return[new J_(a,o,"array length 2 expected, length ".concat(o.length," found"))];if(c){if("object"!==w_(o[0]))return[new J_(a,o,"object expected, ".concat(w_(o[0])," found"))];if(void 0===o[0].zoom)return[new J_(a,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new J_(a,o,"object stop key must have value")];if(r&&r>Z_(o[0].zoom))return[new J_(a,o[0].zoom,"stop zoom values must appear in ascending order")];Z_(o[0].zoom)!==r&&(r=Z_(o[0].zoom),i=void 0,s={}),n=n.concat(Q_({key:"".concat(a,"[0]"),value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:nO,value:l}}))}else n=n.concat(l({key:"".concat(a,"[0]"),value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return x_($_(o[1]))?n.concat([new J_("".concat(a,"[1]"),o[1],"expressions are not allowed in function stops.")]):n.concat(wO({key:"".concat(a,"[1]"),value:o[1],valueSpec:e,style:t.style,styleSpec:t.styleSpec}))}function l(t,r){var a=w_(t.value),u=Z_(t.value),c=null!==t.value?t.value:r;if(n){if(a!==n)return[new J_(t.key,c,"".concat(a," stop domain type must match previous stop domain type ").concat(n))]}else n=a;if("number"!==a&&"string"!==a&&"boolean"!==a)return[new J_(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==a&&"categorical"!==o){var h="number expected, ".concat(a," found");return p_(e)&&void 0===o&&(h+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new J_(t.key,c,h)]}return"categorical"!==o||"number"!==a||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===a&&void 0!==i&&u":case">=":n.length>=2&&"$type"===Z_(n[1])&&o.push(new J_(i,n,'"$type" cannot be use with operator "'.concat(n[0],'"')));case"==":case"!=":3!==n.length&&o.push(new J_(i,n,'filter array for operator "'.concat(n[0],'" must have 3 elements')));case"in":case"!in":n.length>=2&&"string"!==(r=w_(n[1]))&&o.push(new J_("".concat(i,"[1]"),n[1],"string expected, ".concat(r," found")));for(var s=2;s1&&void 0!==arguments[1]?arguments[1]:zS,i=[];return i=i.concat(wO({key:"",value:t,valueSpec:n.$root,styleSpec:n,style:t,objectElementValidators:{glyphs:bO,"*":function(){return[]}}})),t.constants&&(i=i.concat(Y_({key:"constants",value:t.constants,style:t,styleSpec:n}))),xO(i)}function xO(t){return[].concat(t).sort((function(t,n){return t.line-n.line}))}function jO(t){return function(){for(var n=arguments.length,i=new Array(n),r=0;rc&&M.push("'"+this.lv[j]+"'");O=l.showPosition?"Parse error on line "+(a+1)+":\n"+l.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.lv[w]||w)+"'":"Parse error on line "+(a+1)+": Unexpected "+(w==h?"end of input":"'"+(this.lv[w]||w)+"'"),this.parseError(O,{text:l.match,token:this.lv[w]||w,line:l.yylineno,loc:p,expected:M})}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+w);switch(g[0]){case 1:i.push(w),r.push(l.yytext),e.push(l.yylloc),i.push(g[1]),w=null,u=l.yyleng,s=l.yytext,a=l.yylineno,p=l.yylloc;break;case 2:if(S=this.vv[g[1]][1],_.$=r[r.length-S],_._$={first_line:e[e.length-(S||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(S||1)].first_column,last_column:e[e.length-1].last_column},y&&(_._$.range=[e[e.length-(S||1)].range[0],e[e.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,u,a,v.yy,g[1],r,e].concat(f))))return x;S&&(i=i.slice(0,-1*S*2),r=r.slice(0,-1*S),e=e.slice(0,-1*S)),i.push(this.vv[g[1]][0]),r.push(_.$),e.push(_._$),k=o[i[i.length-2]][i[i.length-1]],i.push(k);break;case 3:return!0}}return!0}},l={EOF:1,parseError:function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},setInput:function(t,n){return this.yy=n||this.yy||{},this._input=t,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 t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.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),t},unput:function(t){var n=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var r=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),i.length-1&&(this.yylineno-=i.length-1);var e=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:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-n]),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(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},test_match:function(t,n){var i,r,e;if(this.options.backtrack_lexer&&(e={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&&(e.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var o in e)this[o]=e[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,n,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),o=0;on[0].length)){if(n=i,r=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,e[o])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,e[r]))&&t:""===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 t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},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(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,n,i,r){switch(i){case 0:break;case 1:return 6;case 2:return n.yytext=n.yytext.substr(1,n.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 v(){this.yy={}}return f.lexer=l,v.prototype=f,f.Parser=v,new v}();n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)}}));function kO(t){if(t instanceof String||"string"==typeof t||t instanceof Buffer)try{return SO.parse(t.toString())}catch(t){throw new K_(t)}return t}function MO(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zS,i=t;try{i=kO(i)}catch(t){return[t]}return gO(i,n)}new Set(["vector","raster","raster-dem"]);var _O=x_,OO=M_,TO=T_,EO=b_;MO.parsed=MO,MO.latest=MO;var AO="function"==typeof Object.assign?Object.assign:function(t,n){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),r=1,e=arguments.length;r=.05){for(var i="",r=t.split("\n"),e=NO.slice(0,Math.round(n/.1)),o=0,s=r.length;o0&&(i+="\n"),i+=r[o].split("").join(e);return i}return t}function FO(){return IO||(IO=PO(1,1).getContext("2d")),IO}function LO(t,n){return FO().measureText(t).width+(t.length-1)*n}var GO={};function DO(t,n,i,r){if(-1!==t.indexOf("\n")){for(var e=t.split("\n"),o=[],s=0,a=e.length;s1){var f=FO();f.font=n;var l=f.measureText("M").width*i,v="";for(o=[],s=0,a=h.length;s1;++s){var y=o[s];if(LO(y,r)<.35*l){var m=s>0?LO(o[s-1],r):1/0,w=s.7*l&&LO(g,r)<.6*l){var x=b.split(" "),j=x.pop();LO(j,r)<.2*l&&(o[s]=x.join(" "),o[s+1]=j+" "+g),a-=1}}c=o.join("\n")}else c=t;c=zO(c,r),GO[u]=c}return c}function UO(t){return(UO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Hs&&Y(Hs,F,(function(){GO={}}));var qO,BO,WO=EO,VO=TO,XO=_O,HO=OO,JO={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},KO={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]},YO={},ZO={zoom:0};function $O(t,n,i,r,e,o){var s=t.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[s]||(o[s]={});var a=o[s];if(!a[i]){var u=(t[n]||YO)[i],c=zS["".concat(n,"_").concat(t.type)][i];void 0===u&&(u=c.default);var h=XO(u);if(!h&&WO(u)&&(u=VO(u,c),h=!0),h){var f=function(t,n){var i=HO(t,n);if("error"===i.result)throw new Error(i.value.map((function(t){return"".concat(t.key,": ").concat(t.message)})).join(", "));return i.value}(u,c);a[i]=f.evaluate.bind(f)}else"color"==c.type&&(u=Ek.parse(u)),a[i]=function(){return u}}return ZO.zoom=r,a[i](ZO,e)}var QO=!1;function tT(t,n){if(t){if(!QO&&(0===t.a||0===n))return;var i=t.a;return n=void 0===n?1:n,0===i?"transparent":"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*n+")"}return t}var nT=/^([^]*)\{(.*)\}([^]*)$/;function iT(t,n){var i;do{if(i=t.match(nT)){var r=n[i[2]]||"";t=i[1]+r+i[3]}}while(i);return t}var rT=!1;function eT(t,n,i,r,e,o,s){if(void 0===r&&(r=RO),"string"==typeof n&&(n=JSON.parse(n)),8!=n.version)throw new Error("glStyle version 8 required.");var a,u;if(o)if("undefined"!=typeof Image){var c=new Image;c.crossOrigin="anonymous",c.onload=function(){a=c,u=[c.width,c.height],t.changed(),c.onload=null},c.src=o}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var h=self;h.postMessage({action:"loadImage",src:o}),h.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===o&&(a=t.data.image,u=[a.width,a.height])}))}for(var f,l=function(t){t=t.slice();for(var n=Object.create(null),i=0;i=g.maxzoom)return"continue";var k=g.filter;if(!k||function(t,n,i,r,e){return e||console.warn("No filterCache provided to evaluateFilter()"),t in e||(e[t]=L_(n).filter),ZO.zoom=r,e[t](ZO,i)}(x,k,l,c,w)){h=g;var M=void 0,_=void 0,A=void 0,C=void 0,R=void 0,P=void 0,I=b.index;if(3==f&&("fill"==g.type||"fill-extrusion"==g.type))if(_=$O(g,"paint",g.type+"-opacity",c,l,m),g.type+"-pattern"in S){var N=$O(g,"paint",g.type+"-pattern",c,l,m);if(N){var z="string"==typeof N?iT(N,i):N.toString();if(a&&e&&e[z]){++d,(P=E[d])&&P.getFill()&&!P.getStroke()&&!P.getText()||(P=new Qv({fill:new Cv}),E[d]=P),A=P.getFill(),P.setZIndex(I);var F=y[dt=z+"."+_];if(!F){var L=e[z],G=PO(L.width,L.height),D=G.getContext("2d");D.globalAlpha=_,D.drawImage(a,L.x,L.y,L.width,L.height,0,0,L.width,L.height),F=D.createPattern(G,"repeat"),y[dt]=F}A.setColor(F)}}}else M=tT($O(g,"paint",g.type+"-color",c,l,m),_),g.type+"-outline-color"in S&&(R=tT($O(g,"paint",g.type+"-outline-color",c,l,m),_)),R||(R=M),(M||R)&&(++d,(!(P=E[d])||M&&!P.getFill()||!M&&P.getFill()||R&&!P.getStroke()||!R&&P.getStroke()||P.getText())&&(P=new Qv({fill:M?new Cv:void 0,stroke:R?new Vv:void 0}),E[d]=P),M&&(A=P.getFill()).setColor(M),R&&((C=P.getStroke()).setColor(R),C.setWidth(.5)),P.setZIndex(I));if(1!=f&&"line"==g.type){M=!("line-pattern"in S)&&"line-color"in S?tT($O(g,"paint","line-color",c,l,m),$O(g,"paint","line-opacity",c,l,m)):void 0;var U=$O(g,"paint","line-width",c,l,m);M&&U>0&&(++d,(P=E[d])&&P.getStroke()&&!P.getFill()&&!P.getText()||(P=new Qv({stroke:new Vv}),E[d]=P),(C=P.getStroke()).setLineCap($O(g,"layout","line-cap",c,l,m)),C.setLineJoin($O(g,"layout","line-join",c,l,m)),C.setMiterLimit($O(g,"layout","line-miter-limit",c,l,m)),C.setColor(M),C.setWidth(U),C.setLineDash(S["line-dasharray"]?$O(g,"paint","line-dasharray",c,l,m).map((function(t){return t*U})):null),P.setZIndex(I))}var q=!1,B=null,W=0,V=void 0,X=void 0,H=void 0;if((1==f||2==f)&&"icon-image"in j){var J=$O(g,"layout","icon-image",c,l,m);if(J){V="string"==typeof J?iT(J,i):J.toString();var K=void 0;if(a&&e&&e[V]){var Y=$O(g,"layout","icon-rotation-alignment",c,l,m);if(2==f){var Z=t.getGeometry();if(Z.getFlatMidpoint||Z.getFlatMidpoints){var $=Z.getExtent();if(Math.sqrt(Math.max(Math.pow(($[2]-$[0])/n,2),Math.pow(($[3]-$[1])/n,2)))>150){var Q="MultiLineString"===Z.getType()?Z.getFlatMidpoints():Z.getFlatMidpoint();if(BO||(BO=new Pj("Point",qO=[NaN,NaN],[],{},null)),K=BO,qO[0]=Q[0],qO[1]=Q[1],"line"===(Rt=$O(g,"layout","symbol-placement",c,l,m))&&"map"===Y)for(var tt=Z.getStride(),nt=Z.getFlatCoordinates(),it=0,rt=nt.length-tt;it=ut&&Q[0]<=ht&&Q[1]>=ct&&Q[1]<=ft){W=Math.atan2(ot-at,st-et);break}}}}}if(2!==f||K){var lt=$O(g,"layout","icon-size",c,l,m),vt=void 0!==S["icon-color"]?$O(g,"paint","icon-color",c,l,m):null;if(!vt||0!==vt.a){var dt=V+"."+lt;if(null!==vt&&(dt+="."+vt),!(X=p[dt])){var pt=e[V];X=new Wv({color:vt?[255*vt.r,255*vt.g,255*vt.b,vt.a]:void 0,img:a,imgSize:u,size:[pt.width,pt.height],offset:[pt.x,pt.y],rotateWithView:"map"===Y,scale:lt/pt.pixelRatio,displacement:"icon-offset"in j?$O(g,"layout","icon-offset",c,l,m).map((function(t){return-t*pt.pixelRatio})):void 0}),p[dt]=X}}X&&(++d,(P=E[d])&&P.getImage()&&!P.getFill()&&!P.getStroke()||(P=new Qv,E[d]=P),P.setGeometry(K),X.setRotation(W+CO($O(g,"layout","icon-rotate",c,l,m))),X.setOpacity($O(g,"paint","icon-opacity",c,l,m)),X.setAnchor(KO[$O(g,"layout","icon-anchor",c,l,m)]),P.setImage(X),B=P.getText(),P.setText(void 0),P.setZIndex(I),q=!0,H=!1)}else H=!0}}}if(1==f&&"circle"===g.type){++d,(P=E[d])&&P.getImage()&&!P.getFill()&&!P.getStroke()||(P=new Qv,E[d]=P);var yt="circle-radius"in S?$O(g,"paint","circle-radius",c,l,m):5,mt=tT($O(g,"paint","circle-stroke-color",c,l,m),$O(g,"paint","circle-stroke-opacity",c,l,m)),wt=tT($O(g,"paint","circle-color",c,l,m),$O(g,"paint","circle-opacity",c,l,m)),bt=$O(g,"paint","circle-stroke-width",c,l,m),gt=yt+"."+mt+"."+wt+"."+bt;(X=p[gt])||(X=new Av({radius:yt,stroke:mt&&bt>0?new Vv({width:bt,color:mt}):void 0,fill:wt?new Cv({color:wt}):void 0}),p[gt]=X),P.setImage(X),B=P.getText(),P.setText(void 0),P.setGeometry(void 0),P.setZIndex(I),q=!0}var xt,jt,St,kt,Mt=void 0,_t=void 0;if("text-field"in j){jt=Math.round($O(g,"layout","text-size",c,l,m));var Ot=$O(g,"layout","text-font",c,l,m);xt=$O(g,"layout","text-line-height",c,l,m),_t=mS(s?s(Ot):Ot,jt,xt),St=$O(g,"layout","text-letter-spacing",c,l,m),kt=$O(g,"layout","text-max-width",c,l,m);var Tt=$O(g,"layout","text-field",c,l,m);Mt="object"===UO(Tt)&&Tt.sections?1===Tt.sections.length?Tt.toString():Tt.sections.reduce((function(t,n,i){var r=n.fontStack?n.fontStack.split(","):Ot,e=mS(s?s(r):r,jt*(n.scale||1),xt),o=n.text;if("\n"===o)return t.push("\n",""),t;if(2!=f){for(var a=0,u=(o=DO(o,e,kt,St).split("\n")).length;a0&&t.push("\n",""),t.push(o[a],e);return t}t.push(zO(o,St),e)}),[]):iT(Tt,i).trim(),_=$O(g,"paint","text-opacity",c,l,m)}if(Mt&&_&&!H){q||(++d,(P=E[d])&&P.getText()&&!P.getFill()&&!P.getStroke()||(P=new Qv,E[d]=P),P.setImage(void 0),P.setGeometry(void 0)),P.getText()||P.setText(B||new id({padding:[2,2,2,2]})),B=P.getText();var Et=j["text-transform"];"uppercase"==Et?Mt=Array.isArray(Mt)?Mt.map((function(t,n){return n%2?t:t.toUpperCase()})):Mt.toUpperCase():"lowercase"==Et&&(Mt=Array.isArray(Mt)?Mt.map((function(t,n){return n%2?t:t.toLowerCase()})):Mt.toLowerCase());var At=Array.isArray(Mt)?Mt:2==f?zO(Mt,St):DO(Mt,_t,kt,St);B.setText(At),B.setFont(_t),B.setRotation(CO($O(g,"layout","text-rotate",c,l,m)));var Ct=$O(g,"layout","text-anchor",c,l,m),Rt=q||1==f?"point":$O(g,"layout","symbol-placement",c,l,m);B.setPlacement(Rt),B.setOverflow("point"===Rt);var Pt=$O(g,"paint","text-halo-width",c,l,m),It=$O(g,"layout","text-offset",c,l,m),Nt=$O(g,"paint","text-translate",c,l,m),zt=0,Ft=0;if("point"==Rt){var Lt="center";-1!==Ct.indexOf("left")?(Lt="left",Ft=Pt):-1!==Ct.indexOf("right")&&(Lt="right",Ft=-Pt),B.setTextAlign(Lt);var Gt=$O(g,"layout","text-rotation-alignment",c,l,m);B.setRotateWithView("map"==Gt)}else B.setMaxAngle(CO($O(g,"layout","text-max-angle",c,l,m))*Mt.length/At.length),B.setTextAlign(),B.setRotateWithView(!1);var Dt="middle";0==Ct.indexOf("bottom")?(Dt="bottom",zt=-Pt-.5*(xt-1)*jt):0==Ct.indexOf("top")&&(Dt="top",zt=Pt+.5*(xt-1)*jt),B.setTextBaseline(Dt),B.setOffsetX(It[0]*jt+Ft+Nt[0]),B.setOffsetY(It[1]*jt+zt+Nt[1]),T.setColor(tT($O(g,"paint","text-color",c,l,m),_)),B.setFill(T);var Ut=tT($O(g,"paint","text-halo-color",c,l,m),_);if(Ut){O.setColor(Ut),Pt*=2;var qt=.5*jt;O.setWidth(Pt<=qt?Pt:qt),B.setStroke(O)}else B.setStroke(void 0);var Bt=$O(g,"layout","text-padding",c,l,m),Wt=B.getPadding();Bt!==Wt[0]&&(Wt[0]=Bt,Wt[1]=Bt,Wt[2]=Bt,Wt[3]=Bt),P.setZIndex(I)}}},g=0,x=o.length;g-1?(E.length=d+1,rT&&("function"==typeof t.set?t.set("mapbox-layer",h):t.getProperties()["mapbox-layer"]=h),E):void 0}};return t.setStyle(A),t.set("mapbox-source",f),t.set("mapbox-layers",d),A}var oT=i(338);function sT(t){return(sT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var aT,uT={},cT=/font-family: ?([^;]*);/,hT=/("|')/g;function fT(t){if(!aT){aT={};for(var n=document.styleSheets,i=0,r=n.length;i2?r[2]:""):t+i}function wT(t,n,i,r,e){return new Promise((function(o,s){if("object"!=sT(n)&&(n=JSON.parse(n)),8!=n.version)return s(new Error("glStyle version 8 required."));if(!(t instanceof Nj||t instanceof sS))return s(new Error("Can only apply to VectorLayer or VectorTileLayer"));var a,u,c;function h(){c||n.sprite&&!a?c?(t.setStyle(c),o()):s(new Error("Something went wrong trying to apply style.")):(c=eT(t,n,i,e,a,u,dT),t.getStyle()?o():s(new Error("Nothing to show for source [".concat(i,"]"))))}if(n.sprite){var f=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",l=mT(n.sprite,r,f+".json");fetch(l,{credentials:"same-origin"}).then((function(t){return t.ok||""===f?t:(l=mT(n.sprite,r,".json"),fetch(l,{credentials:"same-origin"}))})).then((function(t){if(t.ok)return t.json();s(new Error("Problem fetching sprite from ".concat(l,": ").concat(t.statusText)))})).then((function(t){if(void 0===t)return s(new Error("No sprites found."));a=t,u=mT(n.sprite,r,f+".png"),h()})).catch((function(t){s(new Error("Sprites cannot be loaded: ".concat(l,": ").concat(t.message)))}))}else h()}))}var bT={};function gT(t,n){var i={id:n.id,type:n.type},r={};function e(e){var o=n.layout||{},s=n.paint||{};i.paint=s;var a,u,c="function"==typeof t.getSource?t.getSource().getTileGrid().getZForResolution(e):t.getView().getZoom(),h="function"==typeof t.getTargetElement?t.getTargetElement():void 0;if(void 0!==s["background-color"]&&(a=$O(i,"paint","background-color",c,bT,r),h&&(h.style.background=Ek.parse(a).toString())),void 0!==s["background-opacity"]&&(u=$O(i,"paint","background-opacity",c,bT,r),h&&(h.style.opacity=u)),"none"!=o.visibility)return tT(a,u);h&&(h.style.backgroundColor="",h.style.opacity="")}if("function"==typeof t.getTargetElement)t.getTargetElement()&&e(),t.on(["change:resolution","change:target"],e);else{if("function"!=typeof t.setBackground)throw new Error("Unable to apply background.");t.setBackground(e)}}function xT(t){var n=t.bounds;if(n){var i=Or([n[0],n[1]]),r=Or([n[2],n[3]]);return[i[0],i[1],r[0],r[1]]}}function jT(t,n){t=AO({},t);var i=[n,JSON.stringify(t)].toString(),r=uT[i];return r||(r=new sx({url:t.tiles?void 0:n,tileJSON:t.tiles?t:void 0}),uT[i]=r),new Promise((function(t){var i=r.on("change",(function(){var e=r.getState();if("ready"===e){var o=r.getTileJSON(),s=Array.isArray(o.tiles)?o.tiles:[o.tiles];if(n)for(var a=0,u=s.length;a1&&!t.variables)throw new Error("Missing variables in style (expected ".concat(r.variables,")"));for(var v=function(n){var i=r.variables[n];if(!(i in t.variables))throw new Error("Missing '".concat(i,"' in style variables"));var e=pv(i);f[e]=function(){var n=t.variables[i];return"string"==typeof n&&(n=rv(r,n)),void 0!==n?n:-9999999}},d=0;d ").concat(Nl.RENDER_EXTENT,"[2] ||\n v_mapCoord[1] > ").concat(Nl.RENDER_EXTENT,"[3]\n ) {\n discard;\n }\n\n vec4 color = texture2D(").concat(Nl.TILE_TEXTURE_ARRAY,"[0], v_textureCoord);\n\n ").concat(e.join("\n"),"\n\n if (color.a == 0.0) {\n discard;\n }\n\n gl_FragColor = color;\n gl_FragColor.rgb *= gl_FragColor.a;\n gl_FragColor *= ").concat(Nl.TRANSITION_ALPHA,";\n }"),uniforms:f,paletteTextures:r.paletteTextures}}var GT=function(t){function n(n){var i=this,r=n?E({},n):{},e=r.style||{};delete r.style;var o=r.cacheSize;return delete r.cacheSize,(i=t.call(this,r)||this).gv=r.sources,i.xv=null,i.If=NaN,i.K=e,i.$t=o,i.wv=i.K.variables||{},i.addChangeListener(es,i.jv),i}return FT(n,t),n.prototype.getSources=function(t,n){var i=this.getSource();return this.gv?"function"==typeof this.gv?this.gv(t,n):this.gv:i?[i]:[]},n.prototype.getRenderSource=function(){return this.xv||this.getSource()},n.prototype.getSourceState=function(){var t=this.getRenderSource();return t?t.getState():ds},n.prototype.jv=function(){this.getSource()&&this.setStyle(this.K)},n.prototype.Sv=function(){var t=this.getSource();return t&&"bandCount"in t?t.bandCount:4},n.prototype.createRenderer=function(){var t=LT(this.K,this.Sv());return new Bl(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.$t,paletteTextures:t.paletteTextures})},n.prototype.renderSources=function(t,n){for(var i,r=this.getRenderer(),e=0,o=n.length;e.5*r.resolution){var h=this.getSources(t.extent,this.If).filter((function(t){return!e.includes(t)}));if(h.length>0)return this.renderSources(t,h)}return c},n.prototype.setStyle=function(t){this.wv=t.variables||{},this.K=t;var n=LT(this.K,this.Sv());this.getRenderer().reset({vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,uniforms:n.uniforms,paletteTextures:n.paletteTextures}),this.changed()},n.prototype.updateStyleVariables=function(t){E(this.wv,t),this.changed()},n}(Eg);GT.prototype.dispose;var DT=GT,UT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qT="addfeatures",BT=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.features=r,o.file=i,o.projection=e,o}return UT(n,t),n}(f),WT=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{handleEvent:k})||this).on,i.once,i.un,i.kv=!1,i.Mv=[];for(var e=r.formatConstructors?r.formatConstructors:[],o=0,s=e.length;o0){this.Ov&&(this.Ov.clear(),this.Ov.addFeatures(f)),this.dispatchEvent(new BT(qT,t,f,o));break}}},n.prototype.Av=function(){var t=this.getMap();if(t){var n=this.target?this.target:t.getViewport();this._v=[Y(n,B,this.handleDrop,this),Y(n,U,this.handleStop,this),Y(n,q,this.handleStop,this),Y(n,B,this.handleStop,this)]}},n.prototype.setActive=function(n){!this.getActive()&&n&&this.Av(),this.getActive()&&!n&&this.Cv(),t.prototype.setActive.call(this,n)},n.prototype.setMap=function(n){this.Cv(),t.prototype.setMap.call(this,n),this.getActive()&&this.Av()},n.prototype.Ev=function(t,n,i){try{return t.readFeatures(n,i)}catch(t){return null}},n.prototype.Cv=function(){this._v&&(this._v.forEach($),this._v=null)},n.prototype.handleDrop=function(t){for(var n=t.dataTransfer.files,i=0,r=n.length;i1?1:-1;return n.endInteraction(this.Lr,i),this.Oe=0,!1},n.prototype.handleDownEvent=function(t){return!!Wu(t)&&(!!this.Kr(t)&&(t.map.getView().beginInteraction(),this.Zr=void 0,this.Rv=void 0,!0))},n}(Cu),HT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),JT=function(t){function n(n,i,r){var e=t.call(this)||this;if(void 0!==r&&void 0===i)e.setFlatCoordinates(r,n);else{var o=i||0;e.setCenterAndRadius(n,o,r)}return e}return HT(n,t),n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){var e=this.flatCoordinates,o=t-e[0],s=n-e[1],a=o*o+s*s;if(a=n[0]||(t[1]<=n[1]&&t[3]>=n[1]||Bn(t,this.intersectsCoordinate.bind(this)))}return!1},n.prototype.setCenter=function(t){var n=this.stride,i=this.flatCoordinates[n]-this.flatCoordinates[0],r=t.slice();r[n]=r[0]+i;for(var e=1;e=this.Vv?(this.Nv=n.pixel,this.Iv=!this.Gv,i=!0):this.Fv=void 0,this.Iv&&void 0!==this.zv&&(clearTimeout(this.zv),this.zv=void 0));return this.Gv&&n.type===pa.POINTERDRAG&&null!==this.Hv?(this.ed(n.coordinate),r=!1):this.Gv&&n.type===pa.POINTERDOWN?r=!1:i&&this.getPointerCount()<2?(r=n.type===pa.POINTERMOVE)&&this.Gv?(this.Jn(n),this.Iv&&n.originalEvent.preventDefault()):("mouse"===n.originalEvent.pointerType||n.type===pa.POINTERDRAG&&void 0===this.zv)&&this.Jn(n):n.type===pa.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,n)&&r},n.prototype.handleDownEvent=function(t){return this.Iv=!this.Gv,this.Gv?(this.Nv=t.pixel,this.Xv||this.od(t.coordinate),!0):this.Kr(t)?(this.Fv=Date.now(),this.zv=setTimeout(function(){this.Jn(new da(pa.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.Vv),this.Nv=t.pixel,!0):(this.Fv=void 0,!1)},n.prototype.handleUpEvent=function(t){var n=!0;if(0===this.getPointerCount())if(this.zv&&(clearTimeout(this.zv),this.zv=void 0),this.Jn(t),this.Iv){var i=!this.Xv;i&&this.od(t.coordinate),!i&&this.Gv?this.finishDrawing():this.Gv||i&&this.ye!==ZT||(this.sd(t.pixel)?this.Wv(t)&&this.finishDrawing():this.ed(t.coordinate)),n=!1}else this.Gv&&this.abortDrawing();return!n&&this.Uv&&t.preventDefault(),n},n.prototype.Jn=function(t){if(this.Lv=t.originalEvent.pointerType,this.Nv&&(!this.Gv&&this.Iv||this.Gv&&!this.Iv)){var n=this.Nv,i=t.pixel,r=n[0]-i[0],e=n[1]-i[1],o=r*r+e*e;if(this.Iv=this.Gv?o>this.$v:o<=this.$v,!this.Iv)return}this.Xv?this.ad(t.coordinate):this.ud(t.coordinate.slice())},n.prototype.sd=function(t){var n=!1;if(this.Hv){var i=!1,r=[this.Xv],e=this.ye;if(e===ZT)n=!0;else if(e===tE)n=2===this.Kv.length;else if(e===$T)i=this.Kv.length>this.qv;else if(e===QT){var o=this.Kv;i=o[0].length>this.qv,r=[o[0][0],o[0][o[0].length-2]]}if(i)for(var s=this.getMap(),a=0,u=r.length;a=this.Bv&&(this.Gv?i.pop():n=!0),i.push(t.slice()),this.Va(i,r,e)):o===QT&&((i=this.Kv[0]).length>=this.Bv&&(this.Gv?i.pop():n=!0),i.push(t.slice()),n&&(this.Xv=i[0]),this.Va(this.Kv,r,e)),this.ud(t.slice()),this.hd(),n&&this.finishDrawing()},n.prototype.removeLastPoint=function(){if(this.Hv){var t,n=this.Hv.getGeometry(),i=this.getMap().getView().getProjection(),r=this.ye;if(r===$T||r===tE){if((t=this.Kv).splice(-2,1),t.length>=2){this.Xv=t[t.length-2].slice();var e=this.Xv.slice();t[t.length-1]=e,this.ud(e)}this.Va(t,n,i),n.getType()===Pt.POLYGON&&this.Yv&&this.fd(n)}else if(r===QT){(t=this.Kv[0]).splice(-2,1);var o=this.Yv.getGeometry();if(t.length>=2){e=t[t.length-2].slice();t[t.length-1]=e,this.ud(e)}o.setCoordinates(t),this.Va(this.Kv,n,i)}1===t.length&&this.abortDrawing(),this.hd()}},n.prototype.finishDrawing=function(){var t=this.ld();if(t){var n=this.Kv,i=t.getGeometry(),r=this.getMap().getView().getProjection();this.ye===$T?(n.pop(),this.Va(n,i,r)):this.ye===QT&&(n[0].pop(),this.Va(n,i,r),n=i.getCoordinates()),this.nl===Pt.MULTI_POINT?t.setGeometry(new bj([n])):this.nl===Pt.MULTI_LINE_STRING?t.setGeometry(new _j([n])):this.nl===Pt.MULTI_POLYGON&&t.setGeometry(new Ej([n])),this.dispatchEvent(new eE(iE,t)),this.Le&&this.Le.push(t),this.Ov&&this.Ov.addFeature(t)}},n.prototype.ld=function(){this.Xv=null;var t=this.Hv;return this.Hv=null,this.Jv=null,this.Yv=null,this.Qv.getSource().clear(!0),t},n.prototype.abortDrawing=function(){var t=this.ld();t&&this.dispatchEvent(new eE(rE,t))},n.prototype.appendCoordinates=function(t){var n,i=this.ye,r=!this.Hv;if(r&&this.od(t[0]),i===$T||i===tE)n=this.Kv;else{if(i!==QT)return;n=this.Kv&&this.Kv.length?this.Kv[0]:[]}r&&n.shift(),n.pop();for(var e=0;ef?o[1]:o[0]),s}}return null},n.prototype.Jn=function(t){var n=t.pixel,i=t.map,r=this.xd(n,i);r||(r=i.getCoordinateFromPixelInternal(n)),this.jd(r)},n.prototype.Sd=function(t){var n=this.md;return n?t?n.setGeometry($e(t)):n.setGeometry(void 0):(n=new Tt(t?$e(t):{}),this.md=n,this.bd.getSource().addFeature(n)),n},n.prototype.jd=function(t){var n=this.wd;n?n.getGeometry().setCoordinates(t):(n=new Tt(new Te(t)),this.wd=n,this.gd.getSource().addFeature(n));return n},n.prototype.handleEvent=function(n){return!n.originalEvent||!this.Kr(n)||(n.type!=pa.POINTERMOVE||this.handlingDownUpSequence||this.Jn(n),t.prototype.handleEvent.call(this,n),!1)},n.prototype.handleDownEvent=function(t){var n=t.pixel,i=t.map,r=this.getExtentInternal(),e=this.xd(n,i),o=function(t){var n=null,i=null;return t[0]==r[0]?n=r[2]:t[0]==r[2]&&(n=r[0]),t[1]==r[1]?i=r[3]:t[1]==r[3]&&(i=r[1]),null!==n&&null!==i?[n,i]:null};if(e&&r){var s=e[0]==r[0]||e[0]==r[2]?e[0]:null,a=e[1]==r[1]||e[1]==r[3]?e[1]:null;null!==s&&null!==a?this.vd=hE(o(e)):null!==s?this.vd=fE(o([s,r[1]]),o([s,r[3]])):null!==a&&(this.vd=fE(o([r[0],a]),o([r[2],a])))}else e=i.getCoordinateFromPixelInternal(n),this.setExtent([e[0],e[1],e[0],e[1]]),this.vd=hE(e);return!0},n.prototype.handleDragEvent=function(t){if(this.vd){var n=t.coordinate;this.setExtent(this.vd(n)),this.jd(n)}},n.prototype.handleUpEvent=function(t){this.vd=null;var n=this.getExtentInternal();return n&&0!==Wn(n)||this.setExtent(null),!1},n.prototype.setMap=function(n){this.bd.setMap(n),this.gd.setMap(n),t.prototype.setMap.call(this,n)},n.prototype.getExtent=function(){return Lr(this.getExtentInternal(),this.getMap().getView().getProjection())},n.prototype.getExtentInternal=function(){return this.st},n.prototype.setExtent=function(t){this.st=t||null,this.Sd(t),this.dispatchEvent(new uE(this.st))},n}(Cu);function vE(t){return(vE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var dE=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pE=[0,0,0,0],yE=[],mE="modifystart",wE="modifyend",bE=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.features=i,e.mapBrowserEvent=r,e}return dE(n,t),n}(f);function gE(t,n){return t.index-n.index}function xE(t,n,i){var r=n.geometry;if(r.getType()===Pt.CIRCLE){var e=r;if(1===n.index){var o=Nr();o&&(e=e.clone().transform(o,i));var s=rr(e.getCenter(),Fr(t,i)),a=Math.sqrt(s)-e.getRadius();return a*a}}var u=Fr(t,i);return yE[0]=Fr(n.segment[0],i),yE[1]=Fr(n.segment[1],i),or(u,yE)}function jE(t,n,i){var r=n.geometry;if(r.getType()===Pt.CIRCLE&&1===n.index){var e=r,o=Nr();return o&&(e=e.clone().transform(o,i)),zr(e.getClosestPoint(Fr(t,i)),i)}var s=Fr(t,i);return yE[0]=Fr(n.segment[0],i),yE[1]=Fr(n.segment[1],i),zr(Zi(s,yE),i)}var SE=function(t){function n(n){var i,r,e=t.call(this,n)||this;if(e.on,e.once,e.un,e.kd=e.Ku.bind(e),e.Kr=n.condition?n.condition:Vu,e.Md=function(t){return Pu(t)&&Du(t)},e._d=n.deleteCondition?n.deleteCondition:e.Md,e.Od=n.insertVertexCondition?n.insertVertexCondition:Fu,e.wd=null,e.Td=null,e.Ed=[0,0],e.Ad=!1,e.Cd=null,e.Rd=new od,e.dd=void 0!==n.pixelTolerance?n.pixelTolerance:10,e.yd=!1,e.Pd=!1,e.Id=[],e.Qv=new Nj({source:new Fd({useSpatialIndex:!1,wrapX:!!n.wrapX}),style:n.style?n.style:(i=Zv(),function(t,n){return i[Pt.POINT]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.Nd={Point:e.zd.bind(e),LineString:e.Fd.bind(e),LinearRing:e.Fd.bind(e),Polygon:e.Ld.bind(e),MultiPoint:e.Gd.bind(e),MultiLineString:e.Dd.bind(e),MultiPolygon:e.Ud.bind(e),Circle:e.qd.bind(e),GeometryCollection:e.Bd.bind(e)},e.Ov=null,e.Wd=null,n.features?r=n.features:n.source&&(e.Ov=n.source,r=new ft(e.Ov.getFeatures()),e.Ov.addEventListener(Td,e.Vd.bind(e)),e.Ov.addEventListener(Cd,e.Xd.bind(e))),!r)throw new Error("The modify interaction requires features, a source or a layer");return n.hitDetection&&(e.Wd=n.hitDetection),e.Le=r,e.Le.forEach(e.Hd.bind(e)),e.Le.addEventListener(st,e.Jd.bind(e)),e.Le.addEventListener(at,e.Kd.bind(e)),e.Yd=null,e.Br=[0,0],e.Zd=void 0===n.snapToPointer?!e.Wd:n.snapToPointer,e}return dE(n,t),n.prototype.Hd=function(t){var n=t.getGeometry();if(n){var i=this.Nd[n.getType()];i&&i(t,n)}var r=this.getMap();r&&r.isRendered()&&this.getActive()&&this.$d(this.Ed,r),t.addEventListener(N,this.kd)},n.prototype.Qd=function(t,n){if(!this.Cd){this.Cd=new ft;for(var i=this.Cd.getArray(),r=0,e=n.length;r=0;--r){for(var e=i[r],o=this.Id.length-1;o>=0;--o)this.Id[o][0]===e&&this.Id.splice(o,1);n.remove(e)}},n.prototype.setActive=function(n){this.wd&&!n&&(this.Qv.getSource().removeFeature(this.wd),this.wd=null),t.prototype.setActive.call(this,n)},n.prototype.setMap=function(n){this.Qv.setMap(n),t.prototype.setMap.call(this,n)},n.prototype.getOverlay=function(){return this.Qv},n.prototype.Vd=function(t){t.feature&&this.Le.push(t.feature)},n.prototype.Xd=function(t){t.feature&&this.Le.remove(t.feature)},n.prototype.Jd=function(t){this.Hd(t.element)},n.prototype.Ku=function(t){if(!this.Pd){var n=t.target;this.tp(n),this.Hd(n)}},n.prototype.Kd=function(t){var n=t.element;this.tp(n)},n.prototype.zd=function(t,n){var i=n.getCoordinates(),r={feature:t,geometry:n,segment:[i,i]};this.Rd.insert(n.getExtent(),r)},n.prototype.Gd=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r=0;--y)this.ep(e[y],s)}return!!this.wd},n.prototype.handleUpEvent=function(t){for(var n=this.Id.length-1;n>=0;--n){var i=this.Id[n][0],r=i.geometry;if(r.getType()===Pt.CIRCLE){var e=r.getCenter(),o=i.featureSegments[0],s=i.featureSegments[1];o.segment[0]=e,o.segment[1]=e,s.segment[0]=e,s.segment[1]=e,this.Rd.update(Pn(e),o);var a=r,u=Nr();if(u){var c=t.map.getView().getProjection();a=Qe(a=a.clone().transform(u,c)).transform(c,u)}this.Rd.update(a.getExtent(),s)}else this.Rd.update(jn(i.segment),i)}return this.Cd&&(this.dispatchEvent(new bE(wE,this.Cd,t)),this.Cd=null),!1},n.prototype.Jn=function(t){this.Ed=t.pixel,this.$d(t.pixel,t.map,t.coordinate)},n.prototype.$d=function(t,n,i){var r,e,s=this,a=i||n.getCoordinateFromPixel(t),u=n.getView().getProjection();if(this.Wd){var c="object"===vE(this.Wd)?function(t){return t===s.Wd}:void 0;n.forEachFeatureAtPixel(t,(function(t,n,i){if((i=i||t.getGeometry()).getType()===Pt.POINT&&y(s.Le.getArray(),t)){e=i;var o=i.getFlatCoordinates().slice(0,2);r=[{feature:t,geometry:i,segment:[o,o]}]}return!0}),{layerFilter:c})}if(!r){var h=Lr(Sn(Gr(Pn(a,pE),u),n.getView().getResolution()*this.dd,pE),u);r=this.Rd.getInExtent(h)}if(r&&r.length>0){var f=r.sort((function(t,n){return xE(a,t,u)-xE(a,n,u)}))[0],l=f.segment,v=jE(a,f,u),d=n.getPixelFromCoordinate(v),p=er(t,d);if(e||p<=this.dd){var m={};if(m[o(l)]=!0,this.Zd||(this.Br[0]=v[0]-a[0],this.Br[1]=v[1]-a[1]),f.geometry.getType()===Pt.CIRCLE&&1===f.index)this.yd=!0,this.ip(v,[f.feature],[f.geometry]);else{var w=n.getPixelFromCoordinate(l[0]),b=n.getPixelFromCoordinate(l[1]),g=rr(d,w),x=rr(d,b);p=Math.sqrt(Math.min(g,x)),this.yd=p<=this.dd,this.yd&&(v=g>x?l[1]:l[0]),this.ip(v,[f.feature],[f.geometry]);var j={};j[o(f.geometry)]=!0;for(var S=1,k=r.length;S=0;--e)f=o((h=(i=l[e])[0]).feature),h.depth&&(f+="-"+h.depth.join("-")),f in v||(v[f]={}),0===i[1]?(v[f].right=h,v[f].index=h.index):1==i[1]&&(v[f].left=h,v[f].index=h.index+1);for(f in v){switch(c=v[f].right,a=v[f].left,(u=(s=v[f].index)-1)<0&&(u=0),t=n=(r=(h=void 0!==a?a:c).geometry).getCoordinates(),d=!1,r.getType()){case Pt.MULTI_LINE_STRING:n[h.depth[0]].length>2&&(n[h.depth[0]].splice(s,1),d=!0);break;case Pt.LINE_STRING:n.length>2&&(n.splice(s,1),d=!0);break;case Pt.MULTI_POLYGON:t=t[h.depth[1]];case Pt.POLYGON:(t=t[h.depth[0]]).length>4&&(s==t.length-1&&(s=0),t.splice(s,1),d=!0,0===s&&(t.pop(),t.push(t[0]),u=t.length-1))}if(d){this.rp(r,n);var p=[];if(void 0!==a&&(this.Rd.remove(a),p.push(a.segment[0])),void 0!==c&&(this.Rd.remove(c),p.push(c.segment[1])),void 0!==a&&void 0!==c){var y={depth:h.depth,feature:h.feature,geometry:h.geometry,index:u,segment:p};this.Rd.insert(jn(y.segment),y)}this.op(r,s,h.depth,-1),this.wd&&(this.Qv.getSource().removeFeature(this.wd),this.wd=null),l.length=0}}return d},n.prototype.rp=function(t,n){this.Pd=!0,t.setCoordinates(n),this.Pd=!1},n.prototype.op=function(t,n,i,r){this.Rd.forEachInExtent(t.getExtent(),(function(e){e.geometry===t&&(void 0===i||void 0===e.depth||x(e.depth,i))&&e.index>n&&(e.index+=r)}))},n}(Cu),kE=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ME="select",_E=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.selected=i,o.deselected=r,o.mapBrowserEvent=e,o}return kE(n,t),n}(f),OE={};var TE=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r,e,o=n||{};if(i.ap=i.Hd.bind(i),i.up=i.tp.bind(i),i.Kr=o.condition?o.condition:Du,i.cp=o.addCondition?o.addCondition:Gu,i.hp=o.removeCondition?o.removeCondition:Gu,i.fp=o.toggleCondition?o.toggleCondition:qu,i.lp=!!o.multi&&o.multi,i.vp=o.filter?o.filter:k,i.dp=o.hitTolerance?o.hitTolerance:0,i.K=void 0!==o.style?o.style:(b((r=Zv())[Pt.POLYGON],r[Pt.LINE_STRING]),b(r[Pt.GEOMETRY_COLLECTION],r[Pt.LINE_STRING]),function(t){return t.getGeometry()?r[t.getGeometry().getType()]:null}),i.Le=o.features||new ft,o.layers)if("function"==typeof o.layers)e=o.layers;else{var s=o.layers;e=function(t){return y(s,t)}}else e=k;return i.pp=e,i.yp={},i}return kE(n,t),n.prototype.mp=function(t,n){this.yp[o(t)]=n},n.prototype.getFeatures=function(){return this.Le},n.prototype.getHitTolerance=function(){return this.dp},n.prototype.getLayer=function(t){return this.yp[o(t)]},n.prototype.setHitTolerance=function(t){this.dp=t},n.prototype.setMap=function(n){this.getMap()&&this.K&&this.Le.forEach(this.wp.bind(this)),t.prototype.setMap.call(this,n),n?(this.Le.addEventListener(st,this.ap),this.Le.addEventListener(at,this.up),this.K&&this.Le.forEach(this.bp.bind(this))):(this.Le.removeEventListener(st,this.ap),this.Le.removeEventListener(at,this.up))},n.prototype.Hd=function(t){var n=t.element;if(this.K&&this.bp(n),!this.getLayer(n)){var i=this.getMap().getAllLayers().find((function(t){if(t instanceof Nj&&t.getSource()&&t.getSource().hasFeature(n))return t}));i&&this.mp(n,i)}},n.prototype.tp=function(t){var n=t.element;this.K&&this.wp(n)},n.prototype.getStyle=function(){return this.K},n.prototype.bp=function(t){var n=o(t);n in OE||(OE[n]=t.getStyle()),t.setStyle(this.K)},n.prototype.wp=function(t){for(var i=this.getMap().getInteractions().getArray(),r=i.length-1;r>=0;--r){var e=i[r];if(e!==this&&e instanceof n&&e.getStyle()&&-1!==e.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(e.getStyle())}var s=o(t);t.setStyle(OE[s]),delete OE[s]},n.prototype.gp=function(t){delete this.yp[o(t)]},n.prototype.handleEvent=function(t){if(!this.Kr(t))return!0;var n=this.cp(t),i=this.hp(t),r=this.fp(t),e=!n&&!i&&!r,o=t.map,s=this.getFeatures(),a=[],u=[];if(e){A(this.yp),o.forEachFeatureAtPixel(t.pixel,function(t,n){if(this.vp(t,n))return this.mp(t,n),u.push(t),!this.lp}.bind(this),{layerFilter:this.pp,hitTolerance:this.dp});for(var c=s.getLength()-1;c>=0;--c){var h=s.item(c),f=u.indexOf(h);f>-1?u.splice(f,1):(s.remove(h),a.push(h))}0!==u.length&&s.extend(u)}else{o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.vp(t,e))return!n&&!r||y(s.getArray(),t)?(i||r)&&y(s.getArray(),t)&&(a.push(t),this.gp(t)):(this.mp(t,e),u.push(t)),!this.lp}.bind(this),{layerFilter:this.pp,hitTolerance:this.dp});for(var l=a.length-1;l>=0;--l)s.remove(a[l]);s.extend(u)}return(u.length>0||a.length>0)&&this.dispatchEvent(new _E(ME,u,a,t)),!0},n}(_u),EE=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function AE(t){return t.feature?t.feature:t.element?t.element:void 0}var CE=[],RE=function(t){function n(n){var i=this,r=n||{},e=r;return e.handleDownEvent||(e.handleDownEvent=k),e.stopDown||(e.stopDown=M),(i=t.call(this,e)||this).Ov=r.source?r.source:null,i.xp=void 0===r.vertex||r.vertex,i.jp=void 0===r.edge||r.edge,i.Le=r.features?r.features:null,i.Sp=[],i.kp={},i.Mp={},i._p={},i.dd=void 0!==r.pixelTolerance?r.pixelTolerance:10,i.Rd=new od,i.Op={Point:i.Tp.bind(i),LineString:i.Ep.bind(i),LinearRing:i.Ep.bind(i),Polygon:i.Ap.bind(i),MultiPoint:i.Cp.bind(i),MultiLineString:i.Rp.bind(i),MultiPolygon:i.Pp.bind(i),GeometryCollection:i.Ip.bind(i),Circle:i.Np.bind(i)},i}return EE(n,t),n.prototype.addFeature=function(t,n){var i=void 0===n||n,r=o(t),e=t.getGeometry();if(e){var s=this.Op[e.getType()];if(s){this.Mp[r]=e.getExtent([1/0,1/0,-1/0,-1/0]);var a=[];if(s(a,e),1===a.length)this.Rd.insert(jn(a[0]),{feature:t,segment:a[0]});else if(a.length>1){var u=a.map((function(t){return jn(t)})),c=a.map((function(n){return{feature:t,segment:n}}));this.Rd.load(u,c)}}}i&&(this.kp[r]=Y(t,N,this.Ku,this))},n.prototype.zp=function(t){this.addFeature(t)},n.prototype.Fp=function(t){this.removeFeature(t)},n.prototype.Lp=function(){var t;return this.Le?t=this.Le:this.Ov&&(t=this.Ov.getFeatures()),t},n.prototype.handleEvent=function(n){var i=this.snapTo(n.pixel,n.coordinate,n.map);return i&&(n.coordinate=i.vertex.slice(0,2),n.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,n)},n.prototype.Jd=function(t){var n=AE(t);this.addFeature(n)},n.prototype.Kd=function(t){var n=AE(t);this.removeFeature(n)},n.prototype.Ku=function(t){var n=t.target;if(this.handlingDownUpSequence){var i=o(n);i in this._p||(this._p[i]=n)}else this.Gp(n)},n.prototype.handleUpEvent=function(t){var n=C(this._p);return n.length&&(n.forEach(this.Gp.bind(this)),this._p={}),!1},n.prototype.removeFeature=function(t,n){var i=void 0===n||n,r=o(t),e=this.Mp[r];if(e){var s=this.Rd,a=[];s.forEachInExtent(e,(function(n){t===n.feature&&a.push(n)}));for(var u=a.length-1;u>=0;--u)s.remove(a[u])}i&&($(this.kp[r]),delete this.kp[r])},n.prototype.setMap=function(n){var i=this.getMap(),r=this.Sp,e=this.Lp();i&&(r.forEach($),r.length=0,e.forEach(this.Fp.bind(this))),t.prototype.setMap.call(this,n),n&&(this.Le?r.push(Y(this.Le,st,this.Jd,this),Y(this.Le,at,this.Kd,this)):this.Ov&&r.push(Y(this.Ov,Td,this.Jd,this),Y(this.Ov,Cd,this.Kd,this)),e.forEach(this.zp.bind(this)))},n.prototype.snapTo=function(t,n,i){var r=jn([i.getCoordinateFromPixel([t[0]-this.dd,t[1]+this.dd]),i.getCoordinateFromPixel([t[0]+this.dd,t[1]-this.dd])]),e=this.Rd.getInExtent(r),o=e.length;if(0===o)return null;var s,a=i.getView().getProjection(),u=Fr(n,a),c=1/0,h=this.dd*this.dd,f=function(){if(s){var n=i.getPixelFromCoordinate(s);if(rr(t,n)<=h)return{vertex:s,vertexPixel:[Math.round(n[0]),Math.round(n[1])]}}return null};if(this.xp){for(var l=0;l=0;i--){var c=o[i][0];if(On(new _e(c).getExtent(),new _e(a).getExtent())){o[i].push(a),u=!0;break}}u||o.push([a.reverse()])}return o}(o.rings,s);1===a.length?(e=Pt.POLYGON,t=E({},t,((i={}).rings=a[0],i))):(e=Pt.MULTI_POLYGON,t=E({},t,((r={}).rings=a,r)))}return Yj((0,UE[e])(t),!1,n)}function WE(t){var n=Et;return!0===t.hasZ&&!0===t.hasM?n=Rt:!0===t.hasZ?n=At:!0===t.hasM&&(n=Ct),n}function VE(t){var n=t.getLayout();return{hasZ:n===At||n===Rt,hasM:n===Ct||n===Rt}}function XE(t,n){return(0,qE[t.getType()])(Yj(t,!0,n),n)}qE[Pt.POINT]=function(t,n){var i,r=t.getCoordinates(),e=t.getLayout();e===At?i={x:r[0],y:r[1],z:r[2]}:e===Ct?i={x:r[0],y:r[1],m:r[2]}:e===Rt?i={x:r[0],y:r[1],z:r[2],m:r[3]}:e===Et?i={x:r[0],y:r[1]}:Mt(!1,34);return i},qE[Pt.LINE_STRING]=function(t,n){var i=VE(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:[t.getCoordinates()]}},qE[Pt.POLYGON]=function(t,n){var i=VE(t);return{hasZ:i.hasZ,hasM:i.hasM,rings:t.getCoordinates(!1)}},qE[Pt.MULTI_POINT]=function(t,n){var i=VE(t);return{hasZ:i.hasZ,hasM:i.hasM,points:t.getCoordinates()}},qE[Pt.MULTI_LINE_STRING]=function(t,n){var i=VE(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:t.getCoordinates()}},qE[Pt.MULTI_POLYGON]=function(t,n){for(var i=VE(t),r=t.getCoordinates(!1),e=[],o=0;o=0;s--)e.push(r[o][s]);return{hasZ:i.hasZ,hasM:i.hasM,rings:e}};var HE=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this)||this).H=r.geometryName,i}return DE(n,t),n.prototype.readFeatureFromObject=function(t,n,i){var r=t,e=BE(r.geometry,n),o=new Tt;if(this.H&&o.setGeometryName(this.H),o.setGeometry(e),r.attributes){o.setProperties(r.attributes,!0);var s=r.attributes[i];void 0!==s&&o.setId(s)}return o},n.prototype.readFeaturesFromObject=function(t,n){var i=n||{};if(t.features){for(var r=[],e=t.features,o=0,s=e.length;o0?i[0]:null},n.prototype.readFeatureFromNode=function(t,n){return null},n.prototype.readFeatures=function(t,n){if(t){if("string"==typeof t){var i=Sf(t);return this.readFeaturesFromDocument(i,n)}return xf(t)?this.readFeaturesFromDocument(t,n):this.readFeaturesFromNode(t,n)}return[]},n.prototype.readFeaturesFromDocument=function(t,n){for(var i=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&b(i,this.readFeaturesFromNode(r,n));return i},n.prototype.readFeaturesFromNode=function(t,n){return r()},n.prototype.readGeometry=function(t,n){if(t){if("string"==typeof t){var i=Sf(t);return this.readGeometryFromDocument(i,n)}return xf(t)?this.readGeometryFromDocument(t,n):this.readGeometryFromNode(t,n)}return null},n.prototype.readGeometryFromDocument=function(t,n){return null},n.prototype.readGeometryFromNode=function(t,n){return null},n.prototype.readProjection=function(t){if(t){if("string"==typeof t){var n=Sf(t);return this.readProjectionFromDocument(n)}return xf(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},n.prototype.readProjectionFromDocument=function(t){return this.dataProjection},n.prototype.readProjectionFromNode=function(t){return this.dataProjection},n.prototype.writeFeature=function(t,n){var i=this.writeFeatureNode(t,n);return this.Vp.serializeToString(i)},n.prototype.writeFeatureNode=function(t,n){return null},n.prototype.writeFeatures=function(t,n){var i=this.writeFeaturesNode(t,n);return this.Vp.serializeToString(i)},n.prototype.writeFeaturesNode=function(t,n){return null},n.prototype.writeGeometry=function(t,n){var i=this.writeGeometryNode(t,n);return this.Vp.serializeToString(i)},n.prototype.writeGeometryNode=function(t,n){return null},n}(Kj),YE=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ZE="http://www.opengis.net/gml",$E=/^[\s\xa0]*$/,QE=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.featureType=r.featureType,i.featureNS=r.featureNS,i.srsName=r.srsName,i.schemaLocation="",i.FEATURE_COLLECTION_PARSERS={},i.FEATURE_COLLECTION_PARSERS[i.namespace]={featureMember:Mf(i.readFeaturesInternal),featureMembers:_f(i.readFeaturesInternal)},i.supportedMediaTypes=["application/gml+xml"],i}return YE(n,t),n.prototype.readFeaturesInternal=function(t,n){var i=t.localName,r=null;if("FeatureCollection"==i)r=zf([],this.FEATURE_COLLECTION_PARSERS,t,n,this);else if("featureMembers"==i||"featureMember"==i||"member"==i){var e=n[0],o=e.featureType,s=e.featureNS;if(!o&&t.childNodes){o=[],s={};for(var a=0,u=t.childNodes.length;a0){e[a]={Xp:e[a]};for(var c=0;c0;else{var f=h.getType();a=f===Pt.POINT||f===Pt.MULTI_POINT}}a&&(u=o.get("name"),(a=a&&!!u)&&u.search(/&[^&]+;/)>-1&&(XC||(XC=document.createElement("textarea")),XC.innerHTML=u,u=XC.value));var l=i;if(t?l=t:n&&(l=ZC(n,i,r)),a){var v=function(t,n){var i=[0,0],r="start",e=t.getImage();if(e){var o=e.getSize();if(o&&2==o.length){var s=e.getScaleArray(),a=e.getAnchor();i[0]=s[0]*(o[0]-a[0]),i[1]=s[1]*(o[1]/2-a[1]),r="left"}}var u=t.getText();u?((u=u.clone()).setFont(u.getFont()||WC.getFont()),u.setScale(u.getScale()||WC.getScale()),u.setFill(u.getFill()||WC.getFill()),u.setStroke(u.getStroke()||qC)):u=WC.clone();return u.setText(n),u.setOffsetX(i[0]),u.setOffsetY(i[1]),u.setTextAlign(r),new Qv({image:e,text:u})}(l[0],u);return c.length>0?(v.setGeometry(new cS(c)),[v,new Qv({geometry:l[0].getGeometry(),image:null,fill:l[0].getFill(),stroke:l[0].getStroke(),text:null})].concat(l.slice(1))):v}return l}}(i.Style,i.styleUrl,this.gy,this.Sy,this.ky);r.setStyle(a)}return delete i.Style,r.setProperties(i,!0),r}},n.prototype.Ty=function(t,n){var i=t.getAttribute("id");if(null!==i){var r=_R.call(this,t,n);if(r){var e=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)e=new URL("#"+i,o).href;else e="#"+i;this.Sy[e]=r}}},n.prototype.Ey=function(t,n){var i=t.getAttribute("id");if(null!==i){var r=eR.call(this,t,n);if(r){var e,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)e=new URL("#"+i,o).href;else e="#"+i;this.Sy[e]=r}}},n.prototype.readFeatureFromNode=function(t,n){if(!y(CC,t.namespaceURI))return null;var i=this.Oy(t,[this.getReadOptions(t,n)]);return i||null},n.prototype.readFeaturesFromNode=function(t,n){if(!y(CC,t.namespaceURI))return[];var i,r=t.localName;if("Document"==r||"Folder"==r)return(i=this._y(t,[this.getReadOptions(t,n)]))||[];if("Placemark"==r){var e=this.Oy(t,[this.getReadOptions(t,n)]);return e?[e]:[]}if("kml"==r){i=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var s=this.readFeaturesFromNode(o,n);s&&b(i,s)}return i}return[]},n.prototype.readName=function(t){if(t){if("string"==typeof t){var n=Sf(t);return this.readNameFromDocument(n)}return xf(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},n.prototype.readNameFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE){var i=this.readNameFromNode(n);if(i)return i}},n.prototype.readNameFromNode=function(t){for(var n=t.firstElementChild;n;n=n.nextElementSibling)if(y(CC,n.namespaceURI)&&"name"==n.localName)return uA(n);for(n=t.firstElementChild;n;n=n.nextElementSibling){var i=n.localName;if(y(CC,n.namespaceURI)&&("Document"==i||"Folder"==i||"Placemark"==i||"kml"==i)){var r=this.readNameFromNode(n);if(r)return r}}},n.prototype.readNetworkLinks=function(t){var n=[];if("string"==typeof t){var i=Sf(t);b(n,this.readNetworkLinksFromDocument(i))}else xf(t)?b(n,this.readNetworkLinksFromDocument(t)):b(n,this.readNetworkLinksFromNode(t));return n},n.prototype.readNetworkLinksFromDocument=function(t){for(var n=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&b(n,this.readNetworkLinksFromNode(i));return n},n.prototype.readNetworkLinksFromNode=function(t){for(var n=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(y(CC,i.namespaceURI)&&"NetworkLink"==i.localName){var r=zf({},IC,i,[]);n.push(r)}for(i=t.firstElementChild;i;i=i.nextElementSibling){var e=i.localName;!y(CC,i.namespaceURI)||"Document"!=e&&"Folder"!=e&&"kml"!=e||b(n,this.readNetworkLinksFromNode(i))}return n},n.prototype.readRegion=function(t){var n=[];if("string"==typeof t){var i=Sf(t);b(n,this.readRegionFromDocument(i))}else xf(t)?b(n,this.readRegionFromDocument(t)):b(n,this.readRegionFromNode(t));return n},n.prototype.readRegionFromDocument=function(t){for(var n=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&b(n,this.readRegionFromNode(i));return n},n.prototype.readRegionFromNode=function(t){for(var n=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(y(CC,i.namespaceURI)&&"Region"==i.localName){var r=zf({},zC,i,[]);n.push(r)}for(i=t.firstElementChild;i;i=i.nextElementSibling){var e=i.localName;!y(CC,i.namespaceURI)||"Document"!=e&&"Folder"!=e&&"kml"!=e||b(n,this.readRegionFromNode(i))}return n},n.prototype.writeFeaturesNode=function(t,n){n=this.adaptOptions(n);var i=wf(CC[4],"kml"),r="http://www.w3.org/2000/xmlns/";i.setAttributeNS(r,"xmlns:gx",AC[0]),i.setAttributeNS(r,"xmlns:xsi",mf),i.setAttributeNS(mf,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var e={node:i},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=FC[i.namespaceURI],a=Pf(o,s);return Lf(e,LC,Rf,a,[n],s,this),i},n}(KE);function ZC(t,n,i){return Array.isArray(t)?t:"string"==typeof t?ZC(i[t],n,i):n}function $C(t){var n=bf(t,!1),i=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(n);if(i){var r=i[1];return[parseInt(r.substr(6,2),16),parseInt(r.substr(4,2),16),parseInt(r.substr(2,2),16),parseInt(r.substr(0,2),16)/255]}}function QC(t){var n=bf(t,!1),i=[];n=n.replace(/\s*,\s*/g,",");for(var r,e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;r=e.exec(n);){var o=parseFloat(r[1]),s=parseFloat(r[2]),a=r[3]?parseFloat(r[3]):0;i.push(o,s,a),n=n.substr(r[0].length)}if(""===n)return i}function tR(t){var n=bf(t,!1).trim(),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(n,i).href:n}function nR(t){var n=bf(t,!1).trim().replace(/^(?!.*#)/,"#"),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(n,i).href:n}function iR(t){return eA(t)}var rR=If(CC,{Pair:function(t,n){var i=zf({},RR,t,n,this);if(!i)return;var r=i.key;if(r&&"normal"==r){var e=i.styleUrl;e&&(n[n.length-1]=e);var o=i.Style;o&&(n[n.length-1]=o)}}});function eR(t,n){return zf(void 0,rR,t,n,this)}var oR=If(CC,{Icon:Tf((function(t,n){var i=zf({},dR,t,n);return i||null})),color:Tf($C),heading:Tf(eA),hotSpot:Tf((function(t){var n,i=t.getAttribute("xunits"),r=t.getAttribute("yunits");return n="insetPixels"!==i?"insetPixels"!==r?Iv:zv:"insetPixels"!==r?Nv:Fv,{x:parseFloat(t.getAttribute("x")),xunits:RC[i],y:parseFloat(t.getAttribute("y")),yunits:RC[r],origin:n}})),scale:Tf(iR)});var sR=If(CC,{color:Tf($C),scale:Tf(iR)});var aR=If(CC,{color:Tf($C),width:Tf(eA)});var uR=If(CC,{color:Tf($C),fill:Tf(nA),outline:Tf(nA)});var cR=If(CC,{coordinates:_f(QC)});function hR(t,n){return zf(null,cR,t,n)}var fR=If(AC,{Track:Mf(vR)});var lR=If(CC,{when:function(t,n){var i=n[n.length-1].whens,r=bf(t,!1),e=Date.parse(r);i.push(isNaN(e)?0:e)}},If(AC,{coord:function(t,n){var i=n[n.length-1].coordinates,r=bf(t,!1),e=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(r);if(e){var o=parseFloat(e[1]),s=parseFloat(e[2]),a=parseFloat(e[3]);i.push([o,s,a])}else i.push([])}}));function vR(t,n){var i=zf({coordinates:[],whens:[]},lR,t,n);if(i){for(var r=[],e=i.coordinates,o=i.whens,s=0,a=Math.min(e.length,o.length);s0){var r=n[n.length-1];r.push.apply(r,i)}},outerBoundaryIs:function(t,n){var i=zf(void 0,FR,t,n);if(i){n[n.length-1][0]=i}}});function kR(t,n){var i=zf({},mR,t,n),r=zf([null],SR,t,n);if(r&&r[0]){for(var e=r[0],o=[e.length],s=1,a=r.length;s0,h=u.href;h?r=h:c&&(r=TC);var f,l=Iv,v=i.hotSpot;v?(e=[v.x,v.y],o=v.xunits,s=v.yunits,l=v.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(r)&&(/pushpin/.test(r)?(e=kC,o=MC,s=_C):/arrow-reverse/.test(r)?(e=[54,42],o=MC,s=_C):/paddle/.test(r)&&(e=[32,1],o=MC,s=_C));var d,p=u.x,y=u.y;void 0!==p&&void 0!==y&&(f=[p,y]);var m,w=u.w,b=u.h;void 0!==w&&void 0!==b&&(d=[w,b]);var g=i.heading;void 0!==g&&(m=yi(g));var x=i.scale,j=i.color;if(c){r==TC&&(d=OC);var S=new Wv({anchor:e,anchorOrigin:l,anchorXUnits:o,anchorYUnits:s,crossOrigin:this.Bt,offset:f,offsetOrigin:Iv,rotation:m,scale:x,size:d,src:this.My(r),color:j}),k=S.getScaleArray()[0],M=S.getSize();if(null===M){var _=S.getImageState();if(_===mo||_===wo){S.listenImageChange((function t(){var n=S.getImageState();if(n!==mo&&n!==wo){var i=S.getSize();if(i&&2==i.length){var r=JC(i);S.setScale(k*r)}S.unlistenImageChange(t)}})),_===mo&&S.load()}}else if(2==M.length){var O=JC(M);S.setScale(k*O)}a.imageStyle=S}else a.imageStyle=DC}},LabelStyle:function(t,n){var i=zf({},sR,t,n);if(i){var r=n[n.length-1],e=new id({fill:new Cv({color:"color"in i?i.color:SC}),scale:i.scale});r.textStyle=e}},LineStyle:function(t,n){var i=zf({},aR,t,n);if(i){var r=n[n.length-1],e=new Vv({color:"color"in i?i.color:SC,width:"width"in i?i.width:1});r.strokeStyle=e}},PolyStyle:function(t,n){var i=zf({},uR,t,n);if(i){var r=n[n.length-1],e=new Cv({color:"color"in i?i.color:SC});r.fillStyle=e;var o=i.fill;void 0!==o&&(r.fill=o);var s=i.outline;void 0!==s&&(r.outline=s)}}});function _R(t,n){var i=zf({},MR,t,n,this);if(!i)return null;var r,e="fillStyle"in i?i.fillStyle:GC,o=i.fill;void 0===o||o||(e=null),"imageStyle"in i?i.imageStyle!=DC&&(r=i.imageStyle):r=UC;var s="textStyle"in i?i.textStyle:WC,a="strokeStyle"in i?i.strokeStyle:BC,u=i.outline;return void 0===u||u?[new Qv({fill:e,image:r,stroke:a,text:s,zIndex:void 0})]:[new Qv({geometry:function(t){var n=t.getGeometry(),i=n.getType();return i===Pt.GEOMETRY_COLLECTION?new cS(n.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return n!==Pt.POLYGON&&n!==Pt.MULTI_POLYGON}))):i!==Pt.POLYGON&&i!==Pt.MULTI_POLYGON?n:void 0},fill:e,image:r,stroke:a,text:s,zIndex:void 0}),new Qv({geometry:function(t){var n=t.getGeometry(),i=n.getType();return i===Pt.GEOMETRY_COLLECTION?new cS(n.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return n===Pt.POLYGON||n===Pt.MULTI_POLYGON}))):i===Pt.POLYGON||i===Pt.MULTI_POLYGON?n:void 0},fill:e,stroke:null,zIndex:void 0})]}function OR(t,n){var i,r,e,o=n.length,s=new Array(n.length),a=new Array(n.length),u=new Array(n.length);i=!1,r=!1,e=!1;for(var c=0;c0){var m=Pf(e,s);Lf(r,uP,hP,[{names:s,values:m}],i)}var w=i[0],b=n.getGeometry();b&&(b=Yj(b,!0,w)),Lf(r,uP,QR,[b],i)}var lP=If(CC,["extrude","tessellate","altitudeMode","coordinates"]),vP=If(CC,{extrude:Ef(cA),tessellate:Ef(cA),altitudeMode:Ef(dA),coordinates:Ef((function(t,n,i){var r,e=i[i.length-1],o=e.layout,s=e.stride;o==Et||o==Ct?r=2:o==At||o==Rt?r=3:Mt(!1,34);var a=n.length,u="";if(a>0){u+=n[0];for(var c=1;c>1):e>>1}return n}function sI(t){for(var n="",i=0,r=t.length;i=32;)n=63+(32|31&t),i+=String.fromCharCode(n),t>>=5;return n=t+63,i+=String.fromCharCode(n)}var cI=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.dataProjection=gr("EPSG:4326"),i.Ay=r.factor?r.factor:1e5,i.Cy=r.geometryLayout?r.geometryLayout:Et,i}return QP(n,t),n.prototype.readFeatureFromText=function(t,n){var i=this.readGeometryFromText(t,n);return new Tt(i)},n.prototype.readFeaturesFromText=function(t,n){return[this.readFeatureFromText(t,n)]},n.prototype.readGeometryFromText=function(t,n){var i=$r(this.Cy),r=nI(t,i,this.Ay);GE(r,0,r.length,i,r);var e=be(r,0,r.length,i);return Yj(new kj(e,this.Cy),!1,this.adaptOptions(n))},n.prototype.writeFeatureText=function(t,n){var i=t.getGeometry();return i?this.writeGeometryText(i,n):(Mt(!1,40),"")},n.prototype.writeFeaturesText=function(t,n){return this.writeFeatureText(t[0],n)},n.prototype.writeGeometryText=function(t,n){var i=(t=Yj(t,!0,this.adaptOptions(n))).getFlatCoordinates(),r=t.getStride();return GE(i,0,i.length,r,i),tI(i,r,this.Ay)},n}(lC),hI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fI=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.tv=r.layerName,i.qc=r.layers?r.layers:null,i.dataProjection=gr(r.dataProjection?r.dataProjection:"EPSG:4326"),i}return hI(n,t),n.prototype.readFeaturesFromObject=function(t,n){if("Topology"==t.type){var i=t,r=void 0,e=null,o=null;i.transform&&(e=(r=i.transform).scale,o=r.translate);var s=i.arcs;r&&function(t,n,i){for(var r=0,e=t.length;r0&&r.pop(),i>=0)for(var s=0,a=(u=n[i]).length;s=0;--s)r.push(u[s].slice(0))}return r}function dI(t,n,i,r,e,o,s){for(var a=t.geometries,u=[],c=0,h=a.length;c=2,57),r}return gI(n,t),n}(bI),jI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),SI=function(t){function n(n){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return jI(n,t),n}(xI),kI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),MI=function(t){function n(n,i,r){var e=t.call(this,"BBOX")||this;if(e.geometryName=n,e.extent=i,4!==i.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return e.srsName=r,e}return kI(n,t),n}(bI),_I=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),OI=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.geometryName=i||"the_geom",o.geometry=r,o.srsName=e,o}return _I(n,t),n}(bI),TI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),EI=function(t){function n(n,i,r){return t.call(this,"Contains",n,i,r)||this}return TI(n,t),n}(OI),AI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),CI=function(t){function n(n,i,r,e,o){var s=t.call(this,"DWithin",n,i,o)||this;return s.distance=r,s.unit=e,s}return AI(n,t),n}(OI),RI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),PI=function(t){function n(n,i,r){return t.call(this,"Disjoint",n,i,r)||this}return RI(n,t),n}(OI),II=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),NI=function(t){function n(n,i){var r=t.call(this,n)||this;return r.propertyName=i,r}return II(n,t),n}(bI),zI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),FI=function(t){function n(n,i,r){var e=t.call(this,"During",n)||this;return e.begin=i,e.end=r,e}return zI(n,t),n}(NI),LI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),GI=function(t){function n(n,i,r,e){var o=t.call(this,n,i)||this;return o.expression=r,o.matchCase=e,o}return LI(n,t),n}(NI),DI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),UI=function(t){function n(n,i,r){return t.call(this,"PropertyIsEqualTo",n,i,r)||this}return DI(n,t),n}(GI),qI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),BI=function(t){function n(n,i){return t.call(this,"PropertyIsGreaterThan",n,i)||this}return qI(n,t),n}(GI),WI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),VI=function(t){function n(n,i){return t.call(this,"PropertyIsGreaterThanOrEqualTo",n,i)||this}return WI(n,t),n}(GI),XI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),HI=function(t){function n(n,i,r){return t.call(this,"Intersects",n,i,r)||this}return XI(n,t),n}(OI),JI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),KI=function(t){function n(n,i,r){var e=t.call(this,"PropertyIsBetween",n)||this;return e.lowerBoundary=i,e.upperBoundary=r,e}return JI(n,t),n}(NI),YI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ZI=function(t){function n(n,i,r,e,o,s){var a=t.call(this,"PropertyIsLike",n)||this;return a.pattern=i,a.wildCard=void 0!==r?r:"*",a.singleChar=void 0!==e?e:".",a.escapeChar=void 0!==o?o:"!",a.matchCase=s,a}return YI(n,t),n}(NI),$I=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),QI=function(t){function n(n){return t.call(this,"PropertyIsNull",n)||this}return $I(n,t),n}(NI),tN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nN=function(t){function n(n,i){return t.call(this,"PropertyIsLessThan",n,i)||this}return tN(n,t),n}(GI),iN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rN=function(t){function n(n,i){return t.call(this,"PropertyIsLessThanOrEqualTo",n,i)||this}return iN(n,t),n}(GI),eN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),oN=function(t){function n(n){var i=t.call(this,"Not")||this;return i.condition=n,i}return eN(n,t),n}(bI),sN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),aN=function(t){function n(n,i,r){return t.call(this,"PropertyIsNotEqualTo",n,i,r)||this}return sN(n,t),n}(GI),uN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cN=function(t){function n(n){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}return uN(n,t),n}(xI),hN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fN=function(t){function n(n){var i=t.call(this,"ResourceId")||this;return i.rid=n,i}return hN(n,t),n}(bI),lN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vN=function(t){function n(n,i,r){return t.call(this,"Within",n,i,r)||this}return lN(n,t),n}(OI);function dN(t){var n=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(SI,n))}function pN(t,n,i){return new MI(t,n,i)}var yN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mN={"http://www.opengis.net/gml":{boundedBy:Tf(tA.prototype.readExtentElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:Mf(tA.prototype.readFeaturesInternal)}},wN={"http://www.opengis.net/wfs":{totalInserted:Tf(sA),totalUpdated:Tf(sA),totalDeleted:Tf(sA)},"http://www.opengis.net/wfs/2.0":{totalInserted:Tf(sA),totalUpdated:Tf(sA),totalDeleted:Tf(sA)}},bN={"http://www.opengis.net/wfs":{TransactionSummary:Tf(CN,"transactionSummary"),InsertResults:Tf(NN,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:Tf(CN,"transactionSummary"),InsertResults:Tf(NN,"insertIds")}},gN={"http://www.opengis.net/wfs":{PropertyName:Ef(dA)},"http://www.opengis.net/wfs/2.0":{PropertyName:Ef(dA)}},xN={"http://www.opengis.net/wfs":{Insert:Ef(zN),Update:Ef(DN),Delete:Ef(GN),Property:Ef(UN),Native:Ef(qN)},"http://www.opengis.net/wfs/2.0":{Insert:Ef(zN),Update:Ef(DN),Delete:Ef(GN),Property:Ef(UN),Native:Ef(qN)}},jN="feature",SN="http://www.w3.org/2000/xmlns/",kN={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},MN={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},_N={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},ON={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},TN={"2.0.0":OA,"1.1.0":jA,"1.0.0":wA},EN=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.sh=r.version?r.version:"1.1.0",i.Py=r.featureType,i.Iy=r.featureNS,i.Ny=r.gmlFormat?r.gmlFormat:new TN[i.sh],i.zy=r.schemaLocation?r.schemaLocation:ON[i.sh],i}return yN(n,t),n.prototype.getFeatureType=function(){return this.Py},n.prototype.setFeatureType=function(t){this.Py=t},n.prototype.readFeaturesFromNode=function(t,n){var i={node:t};E(i,{featureType:this.Py,featureNS:this.Iy}),E(i,this.getReadOptions(t,n||{}));var r=[i],e=zf([],"2.0.0"===this.sh?mN:this.Ny.FEATURE_COLLECTION_PARSERS,t,r,this.Ny);return e||(e=[]),e},n.prototype.readTransactionResponse=function(t){if(t){if("string"==typeof t){var n=Sf(t);return this.readTransactionResponseFromDocument(n)}return xf(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}},n.prototype.readFeatureCollectionMetadata=function(t){if(t){if("string"==typeof t){var n=Sf(t);return this.readFeatureCollectionMetadataFromDocument(n)}return xf(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}},n.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(n)},n.prototype.readFeatureCollectionMetadataFromNode=function(t){var n={},i=aA(t.getAttribute("numberOfFeatures"));return n.numberOfFeatures=i,zf(n,mN,t,[],this.Ny)},n.prototype.readTransactionResponseFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(n)},n.prototype.readTransactionResponseFromNode=function(t){return zf({},bN,t,[])},n.prototype.writeGetFeature=function(t){var n=this,i=wf(MN[this.sh],"GetFeature");i.setAttribute("service","WFS"),i.setAttribute("version",this.sh),t.handle&&i.setAttribute("handle",t.handle),t.outputFormat&&i.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&i.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&i.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&i.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&i.setAttribute("count",String(t.count)),void 0!==t.viewParams&&i.setAttribute("viewParams",t.viewParams),i.setAttributeNS(mf,"xsi:schemaLocation",this.zy);var r={node:i};if(E(r,{version:this.sh,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.Iy,featurePrefix:t.featurePrefix,propertyNames:t.propertyNames?t.propertyNames:[]}),Mt(Array.isArray(t.featureTypes),11),"string"==typeof t.featureTypes[0]){var e=t.filter;t.bbox&&(Mt(t.geometryName,12),e=this.combineBboxAndFilter(t.geometryName,t.bbox,t.srsName,e)),E(r,{geometryName:t.geometryName,filter:e}),sz(i,t.featureTypes,[r])}else t.featureTypes.forEach((function(e){var o=n.combineBboxAndFilter(e.geometryName,e.bbox,t.srsName,t.filter);E(r,{geometryName:e.geometryName,filter:o}),sz(i,[e.name],[r])}));return i},n.prototype.combineBboxAndFilter=function(t,n,i,r){var e=pN(t,n,i);return r?dN(r,e):e},n.prototype.writeTransaction=function(t,n,i,r){var e,o=[],s=r.version?r.version:this.sh,a=wf(MN[s],"Transaction");a.setAttribute("service","WFS"),a.setAttribute("version",s),r&&(e=r.gmlOptions?r.gmlOptions:{},r.handle&&a.setAttribute("handle",r.handle)),a.setAttributeNS(mf,"xsi:schemaLocation",ON[s]);var u=function(t,n,i,r){var e,o=r.featurePrefix?r.featurePrefix:jN;"1.0.0"===i?e=2:"1.1.0"===i?e=3:"2.0.0"===i&&(e=3.2);return E({node:t},{version:i,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:o,gmlVersion:e,hasZ:r.hasZ,srsName:r.srsName},n)}(a,e,s,r);return t&&AN("Insert",t,o,u),n&&AN("Update",n,o,u),i&&AN("Delete",i,o,u),r.nativeElements&&AN("Native",r.nativeElements,o,u),a},n.prototype.readProjectionFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(n);return null},n.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var n=(t=t.firstElementChild.firstElementChild).firstElementChild;n;n=n.nextElementSibling)if(0!==n.childNodes.length&&(1!==n.childNodes.length||3!==n.firstChild.nodeType)){var i=[{}];return this.Ny.readGeometryElement(n,i),gr(i.pop().srsName)}return null},n}(KE);function AN(t,n,i,r){Lf(r,xN,Cf(t),n,i)}function CN(t,n){return zf({},wN,t,n)}var RN={"http://www.opengis.net/ogc":{FeatureId:Mf((function(t,n){return t.getAttribute("fid")}))},"http://www.opengis.net/ogc/1.1":{FeatureId:Mf((function(t,n){return t.getAttribute("fid")}))}};function PN(t,n){Nf(RN,t,n)}var IN={"http://www.opengis.net/wfs":{Feature:PN},"http://www.opengis.net/wfs/2.0":{Feature:PN}};function NN(t,n){return zf([],IN,t,n)}function zN(t,n,i){var r=i[i.length-1],e=r.featureType,o=r.featureNS,s=r.gmlVersion,a=wf(o,e);t.appendChild(a),2===s?wA.prototype.writeFeatureElement(a,n,i):3===s?jA.prototype.writeFeatureElement(a,n,i):OA.prototype.writeFeatureElement(a,n,i)}function FN(t,n,i){var r=i[i.length-1].version,e=kN[r],o=wf(e,"Filter"),s=wf(e,"FeatureId");o.appendChild(s),s.setAttribute("fid",n),t.appendChild(o)}function LN(t,n){var i=(t=t||jN)+":";return 0===n.indexOf(i)?n:i+n}function GN(t,n,i){var r=i[i.length-1];Mt(void 0!==n.getId(),26);var e=r.featureType,o=r.featurePrefix,s=r.featureNS,a=LN(o,e);t.setAttribute("typeName",a),t.setAttributeNS(SN,"xmlns:"+o,s);var u=n.getId();void 0!==u&&FN(t,u,i)}function DN(t,n,i){var r=i[i.length-1];Mt(void 0!==n.getId(),27);var e=r.version,o=r.featureType,s=r.featurePrefix,a=r.featureNS,u=LN(s,o),c=n.getGeometryName();t.setAttribute("typeName",u),t.setAttributeNS(SN,"xmlns:"+s,a);var h=n.getId();if(void 0!==h){for(var f=n.getKeys(),l=[],v=0,d=f.length;v0,i=this.readUint32(n),r=Math.floor((268435455&i)/1e3),e=Boolean(2147483648&i)||1===r||3===r,o=Boolean(1073741824&i)||2===r||3===r,s=Boolean(536870912&i),a=(268435455&i)%1e3,u=["XY",e?"Z":"",o?"M":""].join(""),c=s?this.readUint32(n):null;if(void 0!==t&&t!==a)throw new Error("Unexpected WKB geometry type "+a);if(this.Gy){if(this.Dy!==n)throw new Error("Inconsistent endian");if(this.Wy!==u)throw new Error("Inconsistent geometry layout");if(c&&this.By!==c)throw new Error("Inconsistent coordinate system (SRID)")}else this.Dy=n,this.Uy=e,this.qy=o,this.Wy=u,this.By=c,this.Gy=!0;return a},t.prototype.readWkbPayload=function(t){switch(t){case hz:return this.readPoint();case fz:return this.readLineString();case lz:case bz:return this.readPolygon();case vz:return this.readMultiPoint();case dz:return this.readMultiLineString();case pz:case mz:case wz:return this.readMultiPolygon();case yz:return this.readGeometryCollection();default:throw new Error("Unsupported WKB geometry type "+t+" is found")}},t.prototype.readWkbBlock=function(t){return this.readWkbPayload(this.readWkbHeader(t))},t.prototype.readWkbCollection=function(t,n){for(var i=this.readUint32(),r=[],e=0;e=0&&(t+=this.Vy?2147483648:1e3),this.Wy.indexOf("M")>=0&&(t+=this.Vy?1073741824:2e3),this.Vy&&Number.isInteger(n)&&(t|=536870912),this.writeUint8(this.Dy?1:0),this.writeUint32(t),this.Vy&&Number.isInteger(n)&&this.writeUint32(n)},t.prototype.writeMultiPoint=function(t,n){this.writeUint32(t.length);for(var i=0;i="a"&&t<="z"||t>="A"&&t<="Z"},t.prototype.im=function(t,n){return t>="0"&&t<="9"||"."==t&&!(void 0!==n&&n)},t.prototype.rm=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},t.prototype.om=function(){return this.wkt.charAt(++this.tm)},t.prototype.nextToken=function(){var t,n=this.om(),i=this.tm,r=n;if("("==n)t=Ez;else if(","==n)t=Rz;else if(")"==n)t=Az;else if(this.im(n)||"-"==n)t=Cz,r=this.sm();else if(this.nm(n))t=Tz,r=this.am();else{if(this.rm(n))return this.nextToken();if(""!==n)throw new Error("Unexpected character: "+n);t=Pz}return{position:i,value:r,type:t}},t.prototype.sm=function(){var t,n=this.tm,i=!1,r=!1;do{"."==t?i=!0:"e"!=t&&"E"!=t||(r=!0),t=this.om()}while(this.im(t,i)||!r&&("e"==t||"E"==t)||r&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(n,this.tm--))},t.prototype.am=function(){var t,n=this.tm;do{t=this.om()}while(this.nm(t));return this.wkt.substring(n,this.tm--).toUpperCase()},t}(),Fz=function(){function t(t){this.um=t,this.hm={position:0,type:Oz},this.Wy=Et}return t.prototype.fm=function(){this.hm=this.um.nextToken()},t.prototype.isTokenType=function(t){return this.hm.type==t},t.prototype.match=function(t){var n=this.isTokenType(t);return n&&this.fm(),n},t.prototype.parse=function(){return this.fm(),this.lm()},t.prototype.vm=function(){var t=Et,n=this.hm;if(this.isTokenType(Tz)){var i=n.value;"Z"===i?t=At:"M"===i?t=Ct:"ZM"===i&&(t=Rt),t!==Et&&this.fm()}return t},t.prototype.dm=function(){if(this.match(Ez)){var t=[];do{t.push(this.lm())}while(this.match(Rz));if(this.match(Az))return t}throw new Error(this.pm())},t.prototype.ym=function(){if(this.match(Ez)){var t=this.wm();if(this.match(Az))return t}throw new Error(this.pm())},t.prototype.bm=function(){if(this.match(Ez)){var t=this.gm();if(this.match(Az))return t}throw new Error(this.pm())},t.prototype.xm=function(){if(this.match(Ez)){var t=this.jm();if(this.match(Az))return t}throw new Error(this.pm())},t.prototype.Sm=function(){if(this.match(Ez)){var t=void 0;if(t=this.hm.type==Ez?this.km():this.gm(),this.match(Az))return t}throw new Error(this.pm())},t.prototype.Mm=function(){if(this.match(Ez)){var t=this.jm();if(this.match(Az))return t}throw new Error(this.pm())},t.prototype._m=function(){if(this.match(Ez)){var t=this.Om();if(this.match(Az))return t}throw new Error(this.pm())},t.prototype.wm=function(){for(var t=[],n=this.Wy.length,i=0;i0&&(n+=" "+r)}return 0===i.length?n+" "+_z:n+"("+i+")"}var Wz=Lz,Vz=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Xz=[null,"http://www.opengis.net/wms"],Hz=If(Xz,{Service:Tf((function(t,n){return zf({},Yz,t,n)})),Capability:Tf((function(t,n){return zf({},Jz,t,n)}))}),Jz=If(Xz,{Request:Tf((function(t,n){return zf({},eF,t,n)})),Exception:Tf((function(t,n){return zf([],tF,t,n)})),Layer:Tf((function(t,n){var i=zf({},nF,t,n);if(void 0===i.Layer)return Object.assign(i,fF(t,n));return i}))}),Kz=function(t){function n(){var n=t.call(this)||this;return n.version=void 0,n}return Vz(n,t),n.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var n=zf({version:this.version},Hz,t,[]);return n||null},n}(PP),Yz=If(Xz,{Name:Tf(uA),Title:Tf(uA),Abstract:Tf(uA),KeywordList:Tf(pF),OnlineResource:Tf(IP),ContactInformation:Tf((function(t,n){return zf({},Zz,t,n)})),Fees:Tf(uA),AccessConstraints:Tf(uA),LayerLimit:Tf(sA),MaxWidth:Tf(sA),MaxHeight:Tf(sA)}),Zz=If(Xz,{ContactPersonPrimary:Tf((function(t,n){return zf({},$z,t,n)})),ContactPosition:Tf(uA),ContactAddress:Tf((function(t,n){return zf({},Qz,t,n)})),ContactVoiceTelephone:Tf(uA),ContactFacsimileTelephone:Tf(uA),ContactElectronicMailAddress:Tf(uA)}),$z=If(Xz,{ContactPerson:Tf(uA),ContactOrganization:Tf(uA)}),Qz=If(Xz,{AddressType:Tf(uA),Address:Tf(uA),City:Tf(uA),StateOrProvince:Tf(uA),PostCode:Tf(uA),Country:Tf(uA)}),tF=If(Xz,{Format:Mf(uA)}),nF=If(Xz,{Name:Tf(uA),Title:Tf(uA),Abstract:Tf(uA),KeywordList:Tf(pF),CRS:Of(uA),EX_GeographicBoundingBox:Tf((function(t,n){var i=zf({},rF,t,n);if(!i)return;var r=i.westBoundLongitude,e=i.southBoundLatitude,o=i.eastBoundLongitude,s=i.northBoundLatitude;if(void 0===r||void 0===e||void 0===o||void 0===s)return;return[r,e,o,s]})),BoundingBox:Of((function(t,n){var i=[oA(t.getAttribute("minx")),oA(t.getAttribute("miny")),oA(t.getAttribute("maxx")),oA(t.getAttribute("maxy"))],r=[oA(t.getAttribute("resx")),oA(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:i,res:r}})),Dimension:Of((function(t,n){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:iA(t.getAttribute("multipleValues")),nearestValue:iA(t.getAttribute("nearestValue")),current:iA(t.getAttribute("current")),values:uA(t)}})),Attribution:Tf((function(t,n){return zf({},iF,t,n)})),AuthorityURL:Of((function(t,n){var i=lF(t,n);if(i)return i.name=t.getAttribute("name"),i;return})),Identifier:Of(uA),MetadataURL:Of((function(t,n){var i=lF(t,n);if(i)return i.type=t.getAttribute("type"),i;return})),DataURL:Of(lF),FeatureListURL:Of(lF),Style:Of((function(t,n){return zf({},uF,t,n)})),MinScaleDenominator:Tf(eA),MaxScaleDenominator:Tf(eA),Layer:Of(fF)}),iF=If(Xz,{Title:Tf(uA),OnlineResource:Tf(IP),LogoURL:Tf(dF)}),rF=If(Xz,{westBoundLongitude:Tf(eA),eastBoundLongitude:Tf(eA),southBoundLatitude:Tf(eA),northBoundLatitude:Tf(eA)}),eF=If(Xz,{GetCapabilities:Tf(vF),GetMap:Tf(vF),GetFeatureInfo:Tf(vF)}),oF=If(Xz,{Format:Of(uA),DCPType:Of((function(t,n){return zf({},sF,t,n)}))}),sF=If(Xz,{HTTP:Tf((function(t,n){return zf({},aF,t,n)}))}),aF=If(Xz,{Get:Tf(lF),Post:Tf(lF)}),uF=If(Xz,{Name:Tf(uA),Title:Tf(uA),Abstract:Tf(uA),LegendURL:Of(dF),StyleSheetURL:Tf(lF),StyleURL:Tf(lF)}),cF=If(Xz,{Format:Tf(uA),OnlineResource:Tf(IP)}),hF=If(Xz,{Keyword:Mf(uA)});function fF(t,n){var i=n[n.length-1],r=zf({},nF,t,n);if(r){var e=iA(t.getAttribute("queryable"));void 0===e&&(e=i.queryable),r.queryable=void 0!==e&&e;var o=aA(t.getAttribute("cascaded"));void 0===o&&(o=i.cascaded),r.cascaded=o;var s=iA(t.getAttribute("opaque"));void 0===s&&(s=i.opaque),r.opaque=void 0!==s&&s;var a=iA(t.getAttribute("noSubsets"));void 0===a&&(a=i.noSubsets),r.noSubsets=void 0!==a&&a;var u=oA(t.getAttribute("fixedWidth"));u||(u=i.fixedWidth),r.fixedWidth=u;var c=oA(t.getAttribute("fixedHeight"));c||(c=i.fixedHeight),r.fixedHeight=c;["Style","CRS","AuthorityURL"].forEach((function(t){if(t in i){var n=r[t]||[];r[t]=n.concat(i[t])}}));return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach((function(t){if(!(t in r)){var n=i[t];r[t]=n}})),r}}function lF(t,n){return zf({},cF,t,n)}function vF(t,n){return zf({},oF,t,n)}function dF(t,n){var i=lF(t,n);if(i){var r=[aA(t.getAttribute("width")),aA(t.getAttribute("height"))];return i.size=r,i}}function pF(t,n){return zf([],hF,t,n)}var yF=Kz,mF=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),wF=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Iy="http://mapserver.gis.umn.edu/mapserver",i.Ny=new wA,i.qc=r.layers?r.layers:null,i}return mF(n,t),n.prototype.getLayers=function(){return this.qc},n.prototype.setLayers=function(t){this.qc=t},n.prototype.Cm=function(t,n){t.setAttribute("namespaceURI",this.Iy);var i=t.localName,r=[];if(0===t.childNodes.length)return r;if("msGMLOutput"==i)for(var e=0,o=t.childNodes.length;eh*YF||c>f*YF?this.sw():On(o,r)||this.cw()}}},n.prototype.sw=function(){var t=this.getMap(),n=this.nw,i=t.getSize(),r=t.getView().calculateExtentInternal(i),e=n.getView(),o=Math.log(7.5)/Math.LN2;ei(r,1/(Math.pow(2,o/2)*ZF)),e.fitInternal($e(r))},n.prototype.cw=function(){var t=this.getMap(),n=this.nw,i=t.getView();n.getView().setCenterInternal(i.getCenterInternal())},n.prototype.hw=function(){var t=this.getMap(),n=this.nw;if(t.isRendered()&&n.isRendered()){var i=t.getSize(),r=t.getView(),e=n.getView(),o=this.ca?0:-r.getRotation(),s=this.iw,a=this.iw.getElement(),u=r.getCenterInternal(),c=r.getResolution(),h=e.getResolution(),f=i[0]*c/h,l=i[1]*c/h;if(s.setPosition(u),a){a.style.width=f+"px",a.style.height=l+"px";var v="rotate("+o+"rad)";a.style.transform=v}}},n.prototype.aw=function(){this.fw||(this.fw=Z(this.nw,ja,(function(t){delete this.fw,this.hw()}),this))},n.prototype.Rr=function(t){t.preventDefault(),this.zr()},n.prototype.zr=function(){this.element.classList.toggle(Cs),this.kr?Ao(this.Er,this.Ar):Ao(this.Ar,this.Er),this.kr=!this.kr;var t=this.nw;if(!this.kr){if(t.isRendered())return this.Qm=void 0,void t.render();t.updateSize(),this.sw(),this.aw()}},n.prototype.getCollapsible=function(){return this.Tr},n.prototype.setCollapsible=function(t){this.Tr!==t&&(this.Tr=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.kr&&this.zr())},n.prototype.setCollapsed=function(t){this.Tr&&this.kr!==t&&this.zr()},n.prototype.getCollapsed=function(){return this.kr},n.prototype.getRotateWithView=function(){return this.ca},n.prototype.setRotateWithView=function(t){this.ca!==t&&(this.ca=t,0!==this.getMap().getView().getRotation()&&(this.ca?this.$m():this.nw.getView().setRotation(0),this.Qm=void 0,this.uw(),this.hw()))},n.prototype.getOverviewMap=function(){return this.nw},n.prototype.render=function(t){this.uw(),this.hw()},n}(du),tL=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nL="units",iL="degrees",rL="imperial",eL="nautical",oL="metric",sL="us",aL=[1,2,5],uL=25.4/.28,cL=function(t){function n(n){var i=this,r=n||{},e=void 0!==r.className?r.className:r.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).on,i.once,i.un,i.lw=document.createElement("div"),i.lw.className=e+"-inner",i.element.className=e+" "+Ts,i.element.appendChild(i.lw),i.dw=null,i.pw=void 0!==r.minWidth?r.minWidth:64,i.mn=!1,i.yw=void 0,i.Jm="",i.addChangeListener(nL,i.mw),i.setUnits(r.units||oL),i.ww=r.bar||!1,i.bw=r.steps||4,i.gw=r.text||!1,i.xw=r.dpi||void 0,i}return tL(n,t),n.prototype.getUnits=function(){return this.get(nL)},n.prototype.mw=function(){this.Nr()},n.prototype.setUnits=function(t){this.set(nL,t)},n.prototype.setDpi=function(t){this.xw=t},n.prototype.Nr=function(){var t=this.dw;if(t){var n=t.center,i=t.projection,r=this.getUnits(),e=r==iL?Gt.DEGREES:Gt.METERS,o=xr(i,t.resolution,n,e),s=this.pw*(this.xw||uL)/uL,a=s*o,u="";if(r==iL){var c=Ft[Gt.DEGREES];(a*=c)=s)break;++d}v=this.ww?this.createScaleBar(f,h,u):h.toFixed(l<0?-l:0)+" "+u,this.Jm!=v&&(this.lw.innerHTML=v,this.Jm=v),this.yw!=f&&(this.lw.style.width=f+"px",this.yw=f),this.mn||(this.element.style.display="",this.mn=!0)}else this.mn&&(this.element.style.display="none",this.mn=!1)},n.prototype.createScaleBar=function(t,n,i){for(var r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),e=[],o=t/this.bw,s="#ffffff",a=0;a
'+this.createMarker("relative",a)+(a%2==0||2===this.bw?this.createStepText(a,t,!1,n,i):"")+""),a===this.bw-1&&e.push(this.createStepText(a+1,t,!0,n,i)),s="#ffffff"===s?"#000000":"#ffffff";return'
'+(this.gw?'
'+r+"
":"")+e.join("")+"
"},n.prototype.createMarker=function(t,n){return'
'},n.prototype.createStepText=function(t,n,i,r,e){var o=(0===t?0:Math.round(r/this.bw*t*100)/100)+(0===t?"":" "+e);return'
'+o+"
"},n.prototype.getScaleForResolution=function(){var t=xr(this.dw.projection,this.dw.resolution,this.dw.center,Gt.METERS),n=this.xw||uL;return parseFloat(t.toString())*(1e3/25.4)*n},n.prototype.render=function(t){var n=t.frameState;this.dw=n?n.viewState:null,this.Nr()},n}(du),hL=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fL=0,lL=1,vL=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),render:r.render})||this).Rn=[],i.jw=void 0,i.Sw=fL,i.Cn,i.kw=0,i.Mw=0,i._w,i.Ow,i.Tw=null,i.Ew=!1,i.Lr=void 0!==r.duration?r.duration:200;var e=void 0!==r.className?r.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=e+"-thumb "+Ts;var s=i.element;return s.className=e+" "+"ol-unselectable "+As,s.appendChild(o),s.addEventListener(ma,i.Aw.bind(i),!1),s.addEventListener(ya,i.Cw.bind(i),!1),s.addEventListener(wa,i.Rw.bind(i),!1),s.addEventListener(G,i.Pw.bind(i),!1),o.addEventListener(G,h,!1),i}return hL(n,t),n.prototype.setMap=function(n){t.prototype.setMap.call(this,n),n&&n.render()},n.prototype.Iw=function(){var t=this.element,n=t.offsetWidth,i=t.offsetHeight;if(0===n&&0===i)return this.Ew=!1;var r=getComputedStyle(t);n-=parseFloat(r.paddingRight)+parseFloat(r.paddingLeft),i-=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom);var e=t.firstElementChild,o=getComputedStyle(e),s=e.offsetWidth+parseFloat(o.marginRight)+parseFloat(o.marginLeft),a=e.offsetHeight+parseFloat(o.marginTop)+parseFloat(o.marginBottom);return this.Tw=[s,a],n>i?(this.Sw=lL,this.Mw=n-s):(this.Sw=fL,this.kw=i-a),this.Ew=!0},n.prototype.Pw=function(t){var n=this.getMap().getView(),i=this.Nw(t.offsetX-this.Tw[0]/2,t.offsetY-this.Tw[1]/2),r=this.zw(i),e=n.getConstrainedZoom(n.getZoomForResolution(r));n.animateInternal({zoom:e,duration:this.Lr,easing:wt})},n.prototype.Aw=function(t){if(!this.Cn&&t.target===this.element.firstElementChild){var n=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this._w=t.clientX-parseFloat(n.style.left),this.Ow=t.clientY-parseFloat(n.style.top),this.Cn=!0,0===this.Rn.length){var i=this.Cw,r=this.Rw,e=this.getMap().getOwnerDocument();this.Rn.push(Y(e,ya,i,this),Y(e,wa,r,this))}}},n.prototype.Cw=function(t){if(this.Cn){var n=t.clientX-this._w,i=t.clientY-this.Ow,r=this.Nw(n,i);this.jw=this.zw(r),this.getMap().getView().setResolution(this.jw)}},n.prototype.Rw=function(t){this.Cn&&(this.getMap().getView().endInteraction(),this.Cn=!1,this._w=void 0,this.Ow=void 0,this.Rn.forEach($),this.Rn.length=0)},n.prototype.Fw=function(t){var n=this.Lw(t),i=this.element.firstElementChild;this.Sw==lL?i.style.left=this.Mw*n+"px":i.style.top=this.kw*n+"px"},n.prototype.Nw=function(t,n){return ci(this.Sw===lL?t/this.Mw:n/this.kw,0,1)},n.prototype.zw=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},n.prototype.Lw=function(t){return ci(1-this.getMap().getView().getValueForResolutionFunction()(t),0,1)},n.prototype.render=function(t){if(t.frameState&&(this.Ew||this.Iw())){var n=t.frameState.viewState.resolution;this.jw=n,this.Fw(n)}},n}(du),dL=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pL=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),target:r.target})||this).extent=r.extent?r.extent:null;var e=void 0!==r.className?r.className:"ol-zoom-extent",o=void 0!==r.label?r.label:"E",s=void 0!==r.tipLabel?r.tipLabel:"Fit to extent",a=document.createElement("button");a.setAttribute("type","button"),a.title=s,a.appendChild("string"==typeof o?document.createTextNode(o):o),a.addEventListener(G,i.Rr.bind(i),!1);var u=e+" "+"ol-unselectable "+As,c=i.element;return c.className=u,c.appendChild(a),i}return dL(n,t),n.prototype.Rr=function(t){t.preventDefault(),this.handleZoomToExtent()},n.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),n=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal($e(n))},n}(du),yL={};yL.AssertionError=c,yL.Collection=ft,yL.Collection.CollectionEvent=ht,yL.DataTile=kt,yL.Disposable=v,yL.Feature=Tt,yL.Feature.createStyleFunction=Ot,yL.Geolocation=vo,yL.Image=ko,yL.Image.listenImage=So,yL.ImageBase=yo,yL.ImageCanvas=_o,yL.ImageTile=No,yL.Kinetic=zo,yL.Map=Mc,yL.MapBrowserEvent=da,yL.MapBrowserEventHandler=xa,yL.MapEvent=la,yL.Object=ot,yL.Object.ObjectEvent=et,yL.Observable=it,yL.Observable.unByKey=nt,yL.Overlay=qc,yL.PluggableMap=lu,yL.Tile=jt,yL.TileCache=$c,yL.TileQueue=Ia,yL.TileQueue.getTilePriority=Na,yL.TileRange=nh,yL.TileRange.createOrUpdate=th,yL.VectorRenderTile=eh,yL.VectorTile=sh,yL.View=eu,yL.View.createCenterConstraint=Qa,yL.View.createResolutionConstraint=tu,yL.View.createRotationConstraint=nu,yL.View.isNoopAnimation=iu,yL.array={},yL.array.binarySearch=d,yL.array.equals=x,yL.array.extend=b,yL.array.find=g,yL.array.findIndex=j,yL.array.includes=y,yL.array.isSorted=S,yL.array.linearFindNearest=m,yL.array.numberSafeCompareFunction=p,yL.array.remove=function(t,n){var i=t.indexOf(n),r=i>-1;return r&&t.splice(i,1),r},yL.array.reverseSubArray=w,yL.array.stableSort=function(t,n){var i,r=t.length,e=Array(t.length);for(i=0;i3&&!!je(t,n,i,r)},yL.geom.flat.transform={},yL.geom.flat.transform.rotate=Vr,yL.geom.flat.transform.scale=Xr,yL.geom.flat.transform.transform2D=Wr,yL.geom.flat.transform.translate=Hr,yL.has={},yL.has.DEVICE_PIXEL_RATIO=Xt,yL.has.FIREFOX=Ut,yL.has.IMAGE_DECODE=Jt,yL.has.MAC=Vt,yL.has.PASSIVE_EVENT_LISTENERS=Kt,yL.has.SAFARI=qt,yL.has.SAFARI_BUG_237906=Bt,yL.has.WEBKIT=Wt,yL.has.WORKER_OFFSCREEN_CANVAS=Ht,yL.interaction={},yL.interaction.DoubleClickZoom=Tu,yL.interaction.DragAndDrop=WT,yL.interaction.DragAndDrop.DragAndDropEvent=BT,yL.interaction.DragBox=ec,yL.interaction.DragBox.DragBoxEvent=rc,yL.interaction.DragPan=Hu,yL.interaction.DragRotate=Ku,yL.interaction.DragRotateAndZoom=XT,yL.interaction.DragZoom=sc,yL.interaction.Draw=oE,yL.interaction.Draw.DrawEvent=eE,yL.interaction.Draw.createBox=function(){return function(t,n,i){var r=jn([t[0],t[t.length-1]].map((function(t){return Fr(t,i)}))),e=[[Vn(r),Xn(r),Qn(r),$n(r),Vn(r)]],o=n;o?o.setCoordinates(e):o=new Ye(e);var s=Nr();return s&&o.transform(i,s),o}},yL.interaction.Draw.createRegularPolygon=function(t,n){return function(i,r,e){var o=Fr(i[0],e),s=Fr(i[i.length-1],e),a=Math.sqrt(rr(o,s)),u=r||Qe(new KT(o),t),c=n;if(!n&&0!==n){var h=s[0]-o[0],f=s[1]-o[1];c=Math.atan2(f,h)}to(u,o,a,c);var l=Nr();return l&&u.transform(e,l),u}},yL.interaction.Extent=lE,yL.interaction.Extent.ExtentEvent=uE,yL.interaction.Interaction=_u,yL.interaction.Interaction.pan=ku,yL.interaction.Interaction.zoomByDelta=Mu,yL.interaction.KeyboardPan=lc,yL.interaction.KeyboardZoom=dc,yL.interaction.Modify=SE,yL.interaction.Modify.ModifyEvent=bE,yL.interaction.MouseWheelZoom=wc,yL.interaction.PinchRotate=gc,yL.interaction.PinchZoom=jc,yL.interaction.Pointer=Cu,yL.interaction.Pointer.centroid=Au,yL.interaction.Select=TE,yL.interaction.Select.SelectEvent=_E,yL.interaction.Snap=RE,yL.interaction.Translate=LE,yL.interaction.Translate.TranslateEvent=FE,yL.interaction.defaults=Sc,yL.layer={},yL.layer.Base=us,yL.layer.BaseImage=mg,yL.layer.BaseTile=Eg,yL.layer.BaseVector=wx,yL.layer.Graticule=qj,yL.layer.Group=ha,yL.layer.Group.GroupEvent=ua,yL.layer.Heatmap=Jj,yL.layer.Image=Mg,yL.layer.Layer=gs,yL.layer.Layer.inView=bs,yL.layer.MapboxVector=RT,yL.layer.MapboxVector.getMapboxPath=MT,yL.layer.MapboxVector.normalizeGlyphsUrl=OT,yL.layer.MapboxVector.normalizeSourceUrl=ET,yL.layer.MapboxVector.normalizeSpriteUrl=_T,yL.layer.MapboxVector.normalizeStyleUrl=TT,yL.layer.Tile=Pg,yL.layer.Vector=Nj,yL.layer.VectorImage=IT,yL.layer.VectorTile=sS,yL.layer.WebGLPoints=zT,yL.layer.WebGLTile=DT,yL.loadingstrategy={},yL.loadingstrategy.all=ph,yL.loadingstrategy.bbox=function(t,n){return[t]},yL.loadingstrategy.tile=function(t){return function(n,i,r){var e=t.getZForResolution(Ur(i,r)),o=t.getTileRangeForExtentAndZ(Gr(n,r),e),s=[],a=[e,0,0];for(a[1]=o.minX;a[1]<=o.maxX;++a[1])for(a[2]=o.minY;a[2]<=o.maxY;++a[2])s.push(Lr(t.getTileCoordExtent(a),r));return s}},yL.math={},yL.math.ceil=ji,yL.math.clamp=ci,yL.math.cosh=hi,yL.math.floor=xi,yL.math.lerp=wi,yL.math.log2=fi,yL.math.modulo=mi,yL.math.round=gi,yL.math.solveLinearSystem=di,yL.math.squaredDistance=vi,yL.math.squaredSegmentDistance=li,yL.math.toDegrees=pi,yL.math.toFixed=bi,yL.math.toRadians=yi,yL.net={},yL.net.ClientError=gh,yL.net.ResponseError=bh,yL.net.getJSON=xh,yL.net.jsonp=mh,yL.net.overrideXHR=function(t){"undefined"!=typeof XMLHttpRequest&&(wh=XMLHttpRequest),global.XMLHttpRequest=t},yL.net.resolveUrl=jh,yL.net.restoreXHR=function(){global.XMLHttpRequest=wh},yL.obj={},yL.obj.assign=E,yL.obj.clear=A,yL.obj.getValues=C,yL.obj.isEmpty=R,yL.proj={},yL.proj.Projection=ui,yL.proj.Units={},yL.proj.Units.METERS_PER_UNIT=Ft,yL.proj.Units.fromCode=zt,yL.proj.addCommon=Br,yL.proj.addCoordinateTransforms=_r,yL.proj.addEquivalentProjections=jr,yL.proj.addEquivalentTransforms=Sr,yL.proj.addProjection=wr,yL.proj.addProjections=br,yL.proj.clearAllProjections=function(){Di(),Wi()},yL.proj.clearUserProjection=function(){Pr=null},yL.proj.cloneTransform=yr,yL.proj.createProjection=kr,yL.proj.createSafeCoordinateTransform=qr,yL.proj.createTransformFromCoordinateTransform=Mr,yL.proj.disableCoordinateWarning=pr,yL.proj.epsg3857={},yL.proj.epsg3857.EXTENT=_i,yL.proj.epsg3857.HALF_SIZE=Mi,yL.proj.epsg3857.MAX_SAFE_Y=Ti,yL.proj.epsg3857.PROJECTIONS=Ai,yL.proj.epsg3857.RADIUS=ki,yL.proj.epsg3857.WORLD_EXTENT=Oi,yL.proj.epsg3857.fromEPSG4326=Ci,yL.proj.epsg3857.toEPSG4326=Ri,yL.proj.epsg4326={},yL.proj.epsg4326.EXTENT=Ni,yL.proj.epsg4326.METERS_PER_UNIT=zi,yL.proj.epsg4326.PROJECTIONS=Li,yL.proj.epsg4326.RADIUS=Ii,yL.proj.equivalent=Tr,yL.proj.fromLonLat=Or,yL.proj.fromUserCoordinate=Fr,yL.proj.fromUserExtent=Gr,yL.proj.fromUserResolution=Ur,yL.proj.get=gr,yL.proj.getPointResolution=xr,yL.proj.getTransform=Ar,yL.proj.getTransformFromProjections=Er,yL.proj.getUserProjection=Nr,yL.proj.identityTransform=mr,yL.proj.proj4={},yL.proj.proj4.register=function(t){var n,i,r=Object.keys(t.defs),e=r.length;for(n=0;n180)&&(i[0]=mi(r+180,360)-180),i},yL.proj.toUserCoordinate=zr,yL.proj.toUserExtent=Lr,yL.proj.toUserResolution=Dr,yL.proj.transform=Cr,yL.proj.transformExtent=Rr,yL.proj.transformWithProjections=function(t,n,i){return Er(n,i)(t)},yL.proj.transforms={},yL.proj.transforms.add=Vi,yL.proj.transforms.clear=Wi,yL.proj.transforms.get=Xi,yL.proj.transforms.remove=function(t,n){var i=t.getCode(),r=n.getCode(),e=Bi[i][r];return delete Bi[i][r],R(Bi[i])&&delete Bi[i],e},yL.proj.useGeographic=function(){Ir("EPSG:4326")},yL.render={},yL.render.Box=Zu,yL.render.Event=Ms,yL.render.Feature=Pj,yL.render.Feature.toFeature=function(t,n){var i=t.getId(),r=Rj(t),e=t.getProperties(),o=new Tt;return void 0!==n&&o.setGeometryName(n),o.setGeometry(r),void 0!==i&&o.setId(i),o.setProperties(e,!0),o},yL.render.Feature.toGeometry=Rj,yL.render.VectorContext=Sh,yL.render.canvas={},yL.render.canvas.Builder=Tx,yL.render.canvas.BuilderGroup=Dx,yL.render.canvas.Executor=$x,yL.render.canvas.ExecutorGroup=rj,yL.render.canvas.ExecutorGroup.getPixelIndexArray=ij,yL.render.canvas.ImageBuilder=Ax,yL.render.canvas.Immediate=Mh,yL.render.canvas.Instruction={},yL.render.canvas.Instruction.beginPathInstruction=kx,yL.render.canvas.Instruction.closePathInstruction=Mx,yL.render.canvas.Instruction.fillInstruction=jx,yL.render.canvas.Instruction.strokeInstruction=Sx,yL.render.canvas.LineStringBuilder=Rx,yL.render.canvas.PolygonBuilder=Ix,yL.render.canvas.TextBuilder=Lx,yL.render.canvas.checkedFonts=Xs,yL.render.canvas.defaultFillStyle=Fs,yL.render.canvas.defaultFont=zs,yL.render.canvas.defaultLineCap=Ls,yL.render.canvas.defaultLineDash=Gs,yL.render.canvas.defaultLineDashOffset=0,yL.render.canvas.defaultLineJoin=Ds,yL.render.canvas.defaultLineWidth=1,yL.render.canvas.defaultMiterLimit=Us,yL.render.canvas.defaultPadding=Vs,yL.render.canvas.defaultStrokeStyle=qs,yL.render.canvas.defaultTextAlign=Bs,yL.render.canvas.defaultTextBaseline=Ws,yL.render.canvas.drawImageOrLabel=ea,yL.render.canvas.getTextDimensions=ra,yL.render.canvas.hitdetect={},yL.render.canvas.hitdetect.HIT_DETECT_RESOLUTION=ej,yL.render.canvas.hitdetect.createHitDetectionImageData=oj,yL.render.canvas.hitdetect.hitDetect=sj,yL.render.canvas.labelCache=Hs,yL.render.canvas.measureAndCacheTextWidth=ia,yL.render.canvas.measureTextHeight=Qs,yL.render.canvas.measureTextWidth=na,yL.render.canvas.registerFont=$s,yL.render.canvas.rotateAtOffset=function(t,n,i,r){0!==n&&(t.translate(i,r),t.rotate(n),t.translate(-i,-r))},yL.render.canvas.textHeights=Zs,yL.render.getRenderPixel=function(t,n){return rn(t.inversePixelTransform,n.slice(0))},yL.render.getVectorContext=Lh,yL.render.toContext=function(t,n){var i=t.canvas,r=n||{},e=r.pixelRatio||Xt,o=r.size;o&&(i.width=o[0]*e,i.height=o[1]*e,i.style.width=o[0]+"px",i.style.height=o[1]+"px");var s=[0,0,i.width,i.height],a=on([1,0,0,1,0,0],e,e);return new Mh(t,e,s,a,0)},yL.renderer={},yL.renderer.Composite=sa,yL.renderer.Layer=kl,yL.renderer.Map=Ss,yL.renderer.canvas={},yL.renderer.canvas.ImageLayer=Sg,yL.renderer.canvas.Layer=xg,yL.renderer.canvas.TileLayer=Cg,yL.renderer.canvas.VectorImageLayer=hj,yL.renderer.canvas.VectorLayer=uj,yL.renderer.canvas.VectorTileLayer=mj,yL.renderer.canvas.common={},yL.renderer.canvas.common.IMAGE_SMOOTHING_DISABLED=Dh,yL.renderer.canvas.common.IMAGE_SMOOTHING_ENABLED=Uh,yL.renderer.vector={},yL.renderer.vector.defaultOrder=Ph,yL.renderer.vector.getSquaredTolerance=Ih,yL.renderer.vector.getTolerance=Nh,yL.renderer.vector.renderFeature=zh,yL.renderer.webgl={},yL.renderer.webgl.Layer=Pl,yL.renderer.webgl.Layer.colorDecodeId=Rl,yL.renderer.webgl.Layer.colorEncodeId=Cl,yL.renderer.webgl.Layer.getBlankImageData=function(){var t=document.createElement("canvas").getContext("2d").createImageData(1,1);return t.data[0]=255,t.data[1]=255,t.data[2]=255,t.data[3]=255,t},yL.renderer.webgl.Layer.writePointFeatureToBuffers=function(t,n,i,r,e,o){var s=3+e,a=t[n+0],u=t[n+1],c=Tl;c.length=e;for(var h=0;h1?j(i.TileMatrixSetLink,"projection"in n?function(t,i,r){var o=g(e,(function(n){return n.Identifier==t.TileMatrixSet})).SupportedCRS,s=gr(o),a=gr(n.projection);return s&&a?Tr(s,a):o==n.projection}:function(t,i,r){return t.TileMatrixSet==n.matrixSet}):0)<0&&(r=0);var o=i.TileMatrixSetLink[r].TileMatrixSet,s=i.TileMatrixSetLink[r].TileMatrixSetLimits,a=i.Format[0];"format"in n&&(a=n.format),(r=j(i.Style,(function(t,i,r){return"style"in n?t.Title==n.style:t.isDefault})))<0&&(r=0);var u=i.Style[r].Identifier,c={};"Dimension"in i&&i.Dimension.forEach((function(t,n,i){var r=t.Identifier,e=t.Default;void 0===e&&(e=t.Value[0]),c[r]=e}));var h,f=g(t.Contents.TileMatrixSet,(function(t,n,i){return t.Identifier==o})),l=f.SupportedCRS;if(l&&(h=gr(l)),"projection"in n){var v=gr(n.projection);v&&(h&&!Tr(v,h)||(h=v))}var d=!1,p="ne"==h.getAxisOrientation().substr(0,2),m=f.TileMatrix[0],w={MinTileCol:0,MinTileRow:0,MaxTileCol:m.MatrixWidth-1,MaxTileRow:m.MatrixHeight-1};if(s){w=s[s.length-1];var b=g(f.TileMatrix,(function(t){return t.Identifier===w.TileMatrix||f.Identifier+":"+t.Identifier===w.TileMatrix}));b&&(m=b)}var x=28e-5*m.ScaleDenominator/h.getMetersPerUnit(),S=p?[m.TopLeftCorner[1],m.TopLeftCorner[0]]:m.TopLeftCorner,k=m.TileWidth*x,M=m.TileHeight*x,_=f.BoundingBox,O=[S[0]+k*w.MinTileCol,S[1]-M*(1+w.MaxTileRow),S[0]+k*(1+w.MaxTileCol),S[1]-M*w.MinTileRow];if(void 0!==_&&!On(_,O)){var T=i.WGS84BoundingBox,E=gr("EPSG:4326").getExtent();if(O=_,T)d=T[0]===E[0]&&T[2]===E[2];else{var A=Rr(_,f.SupportedCRS,"EPSG:4326");d=A[0]-1e-10<=E[0]&&A[2]+1e-10>=E[2]}}var C=Mv(f,O,s),R=[],P=n.requestEncoding;if(P=void 0!==P?P:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var I=t.OperationsMetadata.GetTile.DCP.HTTP.Get,N=0,z=I.length;N