@opensystemslab/map 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
package/dist/map.es.js CHANGED
@@ -38,7 +38,7 @@ read:function(t,e,i,n,r){var o,s,a=8*r-n-1,l=(1<<a)-1,u=l>>1,h=-7,c=i?r-1:0,p=i?
38
38
  */
39
39
  var Gd=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function Nd(t,e){return t>e?1:t<e?-1:0}function Bd(t,e,i){for(var n=new Gd(null,null),r=n,o=n;;){var s=i(t,e.key);if(s<0){if(null===e.left)break;if(i(t,e.left.key)<0){var a=e.left;if(e.left=a.right,a.right=e,null===(e=a).left)break}o.left=e,o=e,e=e.left}else{if(!(s>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){a=e.right;if(e.right=a.left,a.left=e,null===(e=a).right)break}r.right=e,r=e,e=e.right}}return r.right=e.left,o.left=e.right,e.left=n.right,e.right=n.left,e}function Wd(t,e,i,n){var r=new Gd(t,e);if(null===i)return r.left=r.right=null,r;var o=n(t,(i=Bd(t,i,n)).key);return o<0?(r.left=i.left,r.right=i,i.left=null):o>=0&&(r.right=i.right,r.left=i,i.right=null),r}function qd(t,e,i){var n=null,r=null;if(e){var o=i((e=Bd(t,e,i)).key,t);0===o?(n=e.left,r=e.right):o<0?(r=e.right,e.right=null,n=e):(n=e.left,e.left=null,r=e)}return{left:n,right:r}}function Vd(t,e,i,n,r){if(t){n(e+(i?"└── ":"├── ")+r(t)+"\n");var o=e+(i?" ":"│ ");t.left&&Vd(t.left,o,!1,n,r),t.right&&Vd(t.right,o,!0,n,r)}}var Ud=function(){function t(t){void 0===t&&(t=Nd),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=Wd(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new Gd(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var n=this._comparator,r=Bd(t,this._root,n),o=n(t,r.key);return 0===o?this._root=r:(o<0?(i.left=r.left,i.right=r,r.left=null):o>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,i){var n;return null===e?null:0===i(t,(e=Bd(t,e,i)).key)?(null===e.left?n=e.right:(n=Bd(t,e.left,i)).right=e.right,this._size--,n):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Bd(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return e;e=n<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=Bd(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return!0;e=n<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,n=[],r=!1;!r;)null!==i?(n.push(i),i=i.left):0!==n.length?(i=n.pop(),t.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(t,e,i,n){for(var r=[],o=this._comparator,s=this._root;0!==r.length||s;)if(s)r.push(s),s=s.left;else{if(o((s=r.pop()).key,e)>0)break;if(o(s.key,t)>=0&&i.call(n,s))return this;s=s.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var i=e.key;return t.push(i)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var i=e.data;return t.push(i)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,i=!1,n=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),n===t)return e;n++,e=e.right}else i=!0;return null},t.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(t){var e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){var e=t,i=[],n=!1,r=new Gd(null,null),o=r;for(;!n;)e?(i.push(e),e=e.left):i.length>0?e=(e=o=o.next=i.pop()).right:n=!0;return o.next=null,r.next}(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var n=t.length,r=this._comparator;if(i&&Yd(t,e,0,n-1,r),null===this._root)this._root=Xd(t,e,0,n),this._size=n;else{var o=function(t,e,i){var n=new Gd(null,null),r=n,o=t,s=e;for(;null!==o&&null!==s;)i(o.key,s.key)<0?(r.next=o,o=o.next):(r.next=s,s=s.next),r=r.next;null!==o?r.next=o:null!==s&&(r.next=s);return n.next}(this.toList(),function(t,e){for(var i=new Gd(null,null),n=i,r=0;r<t.length;r++)n=n.next=new Gd(t[r],e[r]);return n.next=null,i.next}(t,e),r);n=this._size+n,this._root=Kd({head:o},0,n)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return Vd(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var n=this._comparator,r=qd(t,this._root,n),o=r.left,s=r.right;n(t,e)<0?s=Wd(e,i,s,n):o=Wd(e,i,o,n),this._root=function(t,e,i){return null===e?t:(null===t||((e=Bd(t.key,e,i)).left=t),e)}(o,s,n)},t.prototype.split=function(t){return qd(t,this._root,this._comparator)},t}();function Xd(t,e,i,n){var r=n-i;if(r>0){var o=i+Math.floor(r/2),s=t[o],a=e[o],l=new Gd(s,a);return l.left=Xd(t,e,i,o),l.right=Xd(t,e,o+1,n),l}return null}function Kd(t,e,i){var n=i-e;if(n>0){var r=e+Math.floor(n/2),o=Kd(t,e,r),s=t.head;return s.left=o,t.head=t.head.next,s.right=Kd(t,r+1,i),s}return null}function Yd(t,e,i,n,r){if(!(i>=n)){for(var o=t[i+n>>1],s=i-1,a=n+1;;){do{s++}while(r(t[s],o)<0);do{a--}while(r(t[a],o)>0);if(s>=a)break;var l=t[s];t[s]=t[a],t[a]=l,l=e[s],e[s]=e[a],e[a]=l}Yd(t,e,i,a,r),Yd(t,e,a+1,n,r)}}function Zd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hd(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $d(t,e,i){return e&&Hd(t.prototype,e),i&&Hd(t,i),t}var Jd=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},Qd=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var i=t.ll.x<e.ll.x?e.ll.x:t.ll.x,n=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:n,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},tf=Number.EPSILON;void 0===tf&&(tf=Math.pow(2,-52));var ef=tf*tf,nf=function(t,e){if(-tf<t&&t<tf&&-tf<e&&e<tf)return 0;var i=t-e;return i*i<ef*t*e?0:t<e?-1:1},rf=function(){function t(){Zd(this,t),this.reset()}return $d(t,[{key:"reset",value:function(){this.xRounder=new of,this.yRounder=new of}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),t}(),of=function(){function t(){Zd(this,t),this.tree=new Ud,this.round(0)}return $d(t,[{key:"round",value:function(t){var e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===nf(e.key,i.key))return this.tree.remove(t),i.key;var n=this.tree.next(e);return null!==n&&0===nf(e.key,n.key)?(this.tree.remove(t),n.key):t}}]),t}(),sf=new rf,af=function(t,e){return t.x*e.y-t.y*e.x},lf=function(t,e){return t.x*e.x+t.y*e.y},uf=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y},o=af(n,r);return nf(o,0)},hf=function(t){return Math.sqrt(lf(t,t))},cf=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y};return lf(r,n)/hf(r)/hf(n)},pf=function(t,e,i){return 0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i}},df=function(t,e,i){return 0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)}},ff=function(){function t(e,i){Zd(this,t),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=i}return $d(t,null,[{key:"compare",value:function(e,i){var n=t.comparePoints(e.point,i.point);return 0!==n?n:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:gf.compare(e.segment,i.segment))}},{key:"comparePoints",value:function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}}]),$d(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,i=0,n=e.length;i<n;i++){var r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var i=this.point.events[e];if(void 0===i.segment.consumedBy)for(var n=e+1;n<t;n++){var r=this.point.events[n];void 0===r.consumedBy&&(i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,i=this.point.events.length;e<i;e++){var n=this.point.events[e];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&t.push(n)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,i=new Map,n=function(n){var r,o,s,a,l,u=n.otherSE;i.set(n,{sine:(r=e.point,o=t.point,s=u.point,a={x:o.x-r.x,y:o.y-r.y},l={x:s.x-r.x,y:s.y-r.y},af(l,a)/hf(l)/hf(a)),cosine:cf(e.point,t.point,u.point)})};return function(t,e){i.has(t)||n(t),i.has(e)||n(e);var r=i.get(t),o=r.sine,s=r.cosine,a=i.get(e),l=a.sine,u=a.cosine;return o>=0&&l>=0?s<u?1:s>u?-1:0:o<0&&l<0?s<u?-1:s>u?1:0:l<o?-1:l>o?1:0}}}]),t}(),yf=0,gf=function(){function t(e,i,n,r){Zd(this,t),this.id=++yf,this.leftSE=e,e.segment=this,e.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=e,this.rings=n,this.windings=r}return $d(t,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,n=e.leftSE.point.x,r=t.rightSE.point.x,o=e.rightSE.point.x;if(o<i)return 1;if(r<n)return-1;var s=t.leftSE.point.y,a=e.leftSE.point.y,l=t.rightSE.point.y,u=e.rightSE.point.y;if(i<n){if(a<s&&a<l)return 1;if(a>s&&a>l)return-1;var h=t.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;var c=e.comparePoint(t.rightSE.point);return 0!==c?c:-1}if(i>n){if(s<a&&s<u)return-1;if(s>a&&s>u)return 1;var p=e.comparePoint(t.leftSE.point);if(0!==p)return p;var d=t.comparePoint(e.rightSE.point);return d<0?1:d>0?-1:1}if(s<a)return-1;if(s>a)return 1;if(r<o){var f=e.comparePoint(t.rightSE.point);if(0!==f)return f}if(r>o){var y=t.comparePoint(e.rightSE.point);if(y<0)return 1;if(y>0)return-1}if(r!==o){var g=l-s,m=r-i,v=u-a,_=o-n;if(g>m&&v<_)return 1;if(g<m&&v>_)return-1}return r>o?1:r<o||l<u?-1:l>u?1:t.id<e.id?-1:t.id>e.id?1:0}}]),$d(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,i=this.rightSE.point,n=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;var r=(t.y-e.y)/n.y,o=e.x+r*n.x;if(t.x===o)return 0;var s=(t.x-e.x)/n.x,a=e.y+s*n.y;return t.y===a?0:t.y<a?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),i=t.bbox(),n=Qd(e,i);if(null===n)return null;var r=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,l=Jd(e,s)&&0===this.comparePoint(s),u=Jd(i,r)&&0===t.comparePoint(r),h=Jd(e,a)&&0===this.comparePoint(a),c=Jd(i,o)&&0===t.comparePoint(o);if(u&&l)return c&&!h?o:!c&&h?a:null;if(u)return h&&r.x===a.x&&r.y===a.y?null:r;if(l)return c&&o.x===s.x&&o.y===s.y?null:s;if(c&&h)return null;if(c)return o;if(h)return a;var p=function(t,e,i,n){if(0===e.x)return df(i,n,t.x);if(0===n.x)return df(t,e,i.x);if(0===e.y)return pf(i,n,t.y);if(0===n.y)return pf(t,e,i.y);var r=af(e,n);if(0==r)return null;var o={x:i.x-t.x,y:i.y-t.y},s=af(o,e)/r,a=af(o,n)/r;return{x:(t.x+a*e.x+(i.x+s*n.x))/2,y:(t.y+a*e.y+(i.y+s*n.y))/2}}(r,this.vector(),s,t.vector());return null===p?null:Jd(n,p)?sf.round(p.x,p.y):null}},{key:"split",value:function(e){var i=[],n=void 0!==e.events,r=new ff(e,!0),o=new ff(e,!1),s=this.rightSE;this.replaceRightSE(o),i.push(o),i.push(r);var a=new t(r,s,this.rings.slice(),this.windings.slice());return ff.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),ff.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),o.checkForConsuming()),i}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}},{key:"consume",value:function(e){for(var i=this,n=e;i.consumedBy;)i=i.consumedBy;for(;n.consumedBy;)n=n.consumedBy;var r=t.compare(i,n);if(0!==r){if(r>0){var o=i;i=n,n=o}if(i.prev===n){var s=i;i=n,n=s}for(var a=0,l=n.rings.length;a<l;a++){var u=n.rings[a],h=n.windings[a],c=i.rings.indexOf(u);-1===c?(i.rings.push(u),i.windings.push(h)):i.windings[c]+=h}n.rings=null,n.windings=null,n.consumedBy=i,n.leftSE.consumedBy=i.leftSE,n.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,i=this._afterState.windings,n=this._afterState.multiPolys,r=0,o=this.rings.length;r<o;r++){var s=this.rings[r],a=this.windings[r],l=e.indexOf(s);-1===l?(e.push(s),i.push(a)):i[l]+=a}for(var u=[],h=[],c=0,p=e.length;c<p;c++)if(0!==i[c]){var d=e[c],f=d.poly;if(-1===h.indexOf(f))if(d.isExterior)u.push(f);else{-1===h.indexOf(f)&&h.push(f);var y=u.indexOf(d.poly);-1!==y&&u.splice(y,1)}}for(var g=0,m=u.length;g<m;g++){var v=u[g].multiPoly;-1===n.indexOf(v)&&n.push(v)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Ef.type){case"union":var i=0===t.length,n=0===e.length;this._isInResult=i!==n;break;case"intersection":var r,o;t.length<e.length?(r=t.length,o=e.length):(r=e.length,o=t.length),this._isInResult=o===Ef.numMultiPolys&&r<o;break;case"xor":var s=Math.abs(t.length-e.length);this._isInResult=s%2==1;break;case"difference":var a=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=a(t)!==a(e);break;default:throw new Error("Unrecognized operation type found ".concat(Ef.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,i,n){var r,o,s,a=ff.comparePoints(e,i);if(a<0)r=e,o=i,s=1;else{if(!(a>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));r=i,o=e,s=-1}return new t(new ff(r,!0),new ff(o,!1),[n],[s])}}]),t}(),mf=function(){function t(e,i,n){if(Zd(this,t),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=i,this.isExterior=n,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var r=sf.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};for(var o=r,s=1,a=e.length;s<a;s++){if("number"!=typeof e[s][0]||"number"!=typeof e[s][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=sf.round(e[s][0],e[s][1]);l.x===o.x&&l.y===o.y||(this.segments.push(gf.fromRing(o,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),o=l)}r.x===o.x&&r.y===o.y||this.segments.push(gf.fromRing(o,r,this))}return $d(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;e<i;e++){var n=this.segments[e];t.push(n.leftSE),t.push(n.rightSE)}return t}}]),t}(),vf=function(){function t(e,i){if(Zd(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new mf(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var n=1,r=e.length;n<r;n++){var o=new mf(e[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=i}return $d(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;e<i;e++)for(var n=this.interiorRings[e].getSweepEvents(),r=0,o=n.length;r<o;r++)t.push(n[r]);return t}}]),t}(),_f=function(){function t(e,i){if(Zd(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(s){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var n=0,r=e.length;n<r;n++){var o=new vf(e[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=i}return $d(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++)for(var n=this.polys[e].getSweepEvents(),r=0,o=n.length;r<o;r++)t.push(n[r]);return t}}]),t}(),xf=function(){function t(e){Zd(this,t),this.events=e;for(var i=0,n=e.length;i<n;i++)e[i].segment.ringOut=this;this.poly=null}return $d(t,null,[{key:"factory",value:function(e){for(var i=[],n=0,r=e.length;n<r;n++){var o=e[n];if(o.isInResult()&&!o.ringOut){for(var s=null,a=o.leftSE,l=o.rightSE,u=[a],h=a.point,c=[];s=a,a=l,u.push(a),a.point!==h;)for(;;){var p=a.getAvailableLinkedEvents();if(0===p.length){var d=u[0].point,f=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(d.x,",")+" ".concat(d.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(1===p.length){l=p[0].otherSE;break}for(var y=null,g=0,m=c.length;g<m;g++)if(c[g].point===a.point){y=g;break}if(null===y){c.push({index:u.length,point:a.point});var v=a.getLeftmostComparator(s);l=p.sort(v)[0].otherSE;break}var _=c.splice(y)[0],x=u.splice(_.index);x.unshift(x[0].otherSE),i.push(new t(x.reverse()))}i.push(new t(u))}}return i}}]),$d(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],i=1,n=this.events.length-1;i<n;i++){var r=this.events[i].point,o=this.events[i+1].point;0!==uf(r,t,o)&&(e.push(r),t=r)}if(1===e.length)return null;var s=e[0],a=e[1];0===uf(s,t,a)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,h=this.isExteriorRing()?e.length:-1,c=[],p=u;p!=h;p+=l)c.push([e[p].x,e[p].y]);return c}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,i=this.events.length;e<i;e++){var n=this.events[e];ff.compare(t,n)>0&&(t=n)}for(var r=t.segment.prevInResult(),o=r?r.prevInResult():null;;){if(!r)return null;if(!o)return r.ringOut;if(o.ringOut!==r.ringOut)return o.ringOut.enclosingRing()!==r.ringOut?r.ringOut:r.ringOut.enclosingRing();r=o.prevInResult(),o=r?r.prevInResult():null}}}]),t}(),bf=function(){function t(e){Zd(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return $d(t,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,i=this.interiorRings.length;e<i;e++){var n=this.interiorRings[e].getGeom();null!==n&&t.push(n)}return t}}]),t}(),wf=function(){function t(e){Zd(this,t),this.rings=e,this.polys=this._composePolys(e)}return $d(t,[{key:"getGeom",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++){var n=this.polys[e].getGeom();null!==n&&t.push(n)}return t}},{key:"_composePolys",value:function(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];if(!r.poly)if(r.isExteriorRing())e.push(new bf(r));else{var o=r.enclosingRing();o.poly||e.push(new bf(o)),o.poly.addInterior(r)}}return e}}]),t}(),Sf=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gf.compare;Zd(this,t),this.queue=e,this.tree=new Ud(i),this.segments=[]}return $d(t,[{key:"process",value:function(t){var e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;var n=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!n)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var r=n,o=n,s=void 0,a=void 0;void 0===s;)null===(r=this.tree.prev(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);for(;void 0===a;)null===(o=this.tree.next(o))?a=null:void 0===o.key.consumedBy&&(a=o.key);if(t.isLeft){var l=null;if(s){var u=s.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!s.isAnEndpoint(u)))for(var h=this._splitSafely(s,u),c=0,p=h.length;c<p;c++)i.push(h[c])}var d=null;if(a){var f=a.getIntersection(e);if(null!==f&&(e.isAnEndpoint(f)||(d=f),!a.isAnEndpoint(f)))for(var y=this._splitSafely(a,f),g=0,m=y.length;g<m;g++)i.push(y[g])}if(null!==l||null!==d){var v=null;if(null===l)v=d;else if(null===d)v=l;else{v=ff.comparePoints(l,d)<=0?l:d}this.queue.remove(e.rightSE),i.push(e.rightSE);for(var _=e.split(v),x=0,b=_.length;x<b;x++)i.push(_[x])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=s)}else{if(s&&a){var w=s.getIntersection(a);if(null!==w){if(!s.isAnEndpoint(w))for(var S=this._splitSafely(s,w),C=0,T=S.length;C<T;C++)i.push(S[C]);if(!a.isAnEndpoint(w))for(var E=this._splitSafely(a,w),k=0,P=E.length;k<P;k++)i.push(E[k])}}this.tree.remove(e)}return i}},{key:"_splitSafely",value:function(t,e){this.tree.remove(t);var i=t.rightSE;this.queue.remove(i);var n=t.split(e);return n.push(i),void 0===t.consumedBy&&this.tree.insert(t),n}}]),t}(),Cf="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Tf="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Ef=new(function(){function t(){Zd(this,t)}return $d(t,[{key:"run",value:function(t,e,i){Ef.type=t,sf.reset();for(var n=[new _f(e,!0)],r=0,o=i.length;r<o;r++)n.push(new _f(i[r],!1));if(Ef.numMultiPolys=n.length,"difference"===Ef.type)for(var s=n[0],a=1;a<n.length;)null!==Qd(n[a].bbox,s.bbox)?a++:n.splice(a,1);if("intersection"===Ef.type)for(var l=0,u=n.length;l<u;l++)for(var h=n[l],c=l+1,p=n.length;c<p;c++)if(null===Qd(h.bbox,n[c].bbox))return[];for(var d=new Ud(ff.compare),f=0,y=n.length;f<y;f++)for(var g=n[f].getSweepEvents(),m=0,v=g.length;m<v;m++)if(d.insert(g[m]),d.size>Cf)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var _=new Sf(d),x=d.size,b=d.pop();b;){var w=b.key;if(d.size===x){var S=w.segment;throw new Error("Unable to pop() ".concat(w.isLeft?"left":"right"," SweepEvent ")+"[".concat(w.point.x,", ").concat(w.point.y,"] from segment #").concat(S.id," ")+"[".concat(S.leftSE.point.x,", ").concat(S.leftSE.point.y,"] -> ")+"[".concat(S.rightSE.point.x,", ").concat(S.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>Cf)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>Tf)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var C=_.process(w),T=0,E=C.length;T<E;T++){var k=C[T];void 0===k.consumedBy&&d.insert(k)}x=d.size,b=d.pop()}sf.reset();var P=xf.factory(_.segments);return new wf(P).getGeom()}}]),t}()),kf=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return Ef.run("union",t,i)};function Pf(t,e,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=e||{},n.geometry=t,n}function Of(t){return"Feature"===t.type?t.geometry:t}function Rf(t,e,i){void 0===i&&(i={});var n=Of(t),r=Of(e),o=kf(n.coordinates,r.coordinates);return 0===o.length?null:1===o.length?function(t,e,i){void 0===i&&(i={});for(var n=0,r=t;n<r.length;n++){var o=r[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return Pf({type:"Polygon",coordinates:t},e,i)}(o[0],i.properties):function(t,e,i){return void 0===i&&(i={}),Pf({type:"MultiPolygon",coordinates:t},e,i)}(o,i.properties)}function If(t,e){const i=Gn(t),n=Math.round(100*i)/100;let r;return"m2"===e?r=n+" m²":"ha"===e&&(r=n/1e4+" ha"),r}function Ff(t,e,i){const n=e.getExtent();return t.getView().fit(Zi(n,i))}function jf(t,e){const[i,n,r]=Array.from(Pr(t));return Cr([i,n,r,e])}const Mf=new Ec,Af=new Ec;function Lf(t,e,i){const n=`\n <ogc:Filter>\n <ogc:Contains>\n <ogc:PropertyName>SHAPE</ogc:PropertyName>\n <gml:Point srsName="urn:ogc:def:crs:EPSG::4326">\n <gml:coordinates>${(r=t,s=rr(r,void 0!==o?o:"EPSG:3857","EPSG:4326"),a=s[0],(a<-180||a>180)&&(s[0]=Ge(a+180,360)-180),s).reverse().join(",")}</gml:coordinates>\n </gml:Point>\n </ogc:Contains>\n </ogc:Filter>\n `;var r,o,s,a;fetch(function(t){const e=Object.keys(t).map((e=>e+"="+encodeURI(t[e]))).join("&");return`https://api.os.uk/features/v1/wfs?${e}`}({key:e,service:"WFS",request:"GetFeature",version:"2.0.0",typeNames:"Topography_TopographicArea",propertyName:"TOID,DescriptiveGroup,SHAPE",outputFormat:"GEOJSON",srsName:"urn:ogc:def:crs:EPSG::4326",filter:n,count:1})).then((t=>t.json())).then((t=>{if(!t.features.length)return;const e=t.features[0].properties,n=["TOID","DescriptiveGroup"];Object.keys(e).forEach((t=>n.includes(t)||delete e[t]));const r=new ka,o=r.readFeatures(t,{featureProjection:"EPSG:3857"});i?o.forEach((t=>{const e=t.getProperties().TOID,i=Mf.getFeatureById(e);i?Mf.removeFeature(i):(t.setId(e),Mf.addFeature(t))})):(Mf.clear(),o.forEach((t=>{const e=t.getProperties().TOID;t.setId(e),Mf.addFeature(t)}))),Af.clear(),Af.addFeature(r.readFeature(Mf.getFeatures().reduce(((t,e)=>{const i=r.writeFeatureObject(e).geometry;return t?Rf(t,i):i}),null)))})).catch((t=>console.log(t)))}var Df={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},fog:{type:"fog",doc:"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector 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://<Tileset ID>`."},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 `{<sourceLayer>: <propertyName>}`. 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://<Tileset ID>`."},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://<Tileset ID>`."},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 `{<sourceLayer>: <propertyName>}`."}},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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",{"symbol-placement":["point"]}],"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 would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols 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. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"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. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",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<number>`, 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",android:"8.4.0",ios:"5.4.0",macos:"0.15.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`. `Multi*` feature types are only returned in GeoJSON sources. When working with vector tile sources, use the singular forms.",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",ios:"10.0.0",android:"10.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",android:"8.4.0",ios:"5.5.0",macos:"0.15.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",android:"7.0.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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."}}},zf="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Gf(t){var e={exports:{}};return t(e,e.exports),e.exports}function Nf(t,e){return Object.prototype.hasOwnProperty.call(t,e)}
40
40
  /*! https://mths.be/punycode v1.3.2 by @mathias */
41
- Gf((function(t,e){!function(i){var n=e&&!e.nodeType&&e,r=t&&!t.nodeType&&t,o="object"==typeof zf&&zf;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var s,a,l=2147483647,u=36,h=/^xn--/,c=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,y=String.fromCharCode;function g(t){throw RangeError(d[t])}function m(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function v(t,e){var i=t.split("@"),n="";return i.length>1&&(n=i[0]+"@",t=i[1]),n+m((t=t.replace(p,".")).split("."),e).join(".")}function _(t){for(var e,i,n=[],r=0,o=t.length;r<o;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<o?56320==(64512&(i=t.charCodeAt(r++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),r--):n.push(e);return n}function x(t){return m(t,(function(t){var e="";return t>65535&&(e+=y((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=y(t)})).join("")}function b(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function w(t,e,i){var n=0;for(t=i?f(t/700):t>>1,t+=f(t/e);t>455;n+=u)t=f(t/35);return f(n+36*t/(t+38))}function S(t){var e,i,n,r,o,s,a,h,c,p,d,y=[],m=t.length,v=0,_=128,b=72;for((i=t.lastIndexOf("-"))<0&&(i=0),n=0;n<i;++n)t.charCodeAt(n)>=128&&g("not-basic"),y.push(t.charCodeAt(n));for(r=i>0?i+1:0;r<m;){for(o=v,s=1,a=u;r>=m&&g("invalid-input"),((h=(d=t.charCodeAt(r++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||h>f((l-v)/s))&&g("overflow"),v+=h*s,!(h<(c=a<=b?1:a>=b+26?26:a-b));a+=u)s>f(l/(p=u-c))&&g("overflow"),s*=p;b=w(v-o,e=y.length+1,0==o),f(v/e)>l-_&&g("overflow"),_+=f(v/e),v%=e,y.splice(v++,0,_)}return x(y)}function C(t){var e,i,n,r,o,s,a,h,c,p,d,m,v,x,S,C=[];for(m=(t=_(t)).length,e=128,i=0,o=72,s=0;s<m;++s)(d=t[s])<128&&C.push(y(d));for(n=r=C.length,r&&C.push("-");n<m;){for(a=l,s=0;s<m;++s)(d=t[s])>=e&&d<a&&(a=d);for(a-e>f((l-i)/(v=n+1))&&g("overflow"),i+=(a-e)*v,e=a,s=0;s<m;++s)if((d=t[s])<e&&++i>l&&g("overflow"),d==e){for(h=i,c=u;!(h<(p=c<=o?1:c>=o+26?26:c-o));c+=u)S=h-p,x=u-p,C.push(y(b(p+S%x,0))),h=f(S/x);C.push(y(b(h,0))),o=w(i,v,n==r),i=0,++n}++i,++e}return C.join("")}if(s={version:"1.3.2",ucs2:{decode:_,encode:x},decode:S,encode:C,toASCII:function(t){return v(t,(function(t){return c.test(t)?"xn--"+C(t):t}))},toUnicode:function(t){return v(t,(function(t){return h.test(t)?S(t.slice(4).toLowerCase()):t}))}},n&&r)if(t.exports==n)r.exports=s;else for(a in s)s.hasOwnProperty(a)&&(n[a]=s[a]);else i.punycode=s}(zf)}));var Bf=function(t,e,i,n){e=e||"&",i=i||"=";var r={};if("string"!=typeof t||0===t.length)return r;var o=/\+/g;t=t.split(e);var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var l=0;l<a;++l){var u,h,c,p,d=t[l].replace(o,"%20"),f=d.indexOf(i);f>=0?(u=d.substr(0,f),h=d.substr(f+1)):(u=d,h=""),c=decodeURIComponent(u),p=decodeURIComponent(h),Nf(r,c)?Array.isArray(r[c])?r[c].push(p):r[c]=[r[c],p]:r[c]=p}return r},Wf=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},qf=function(t,e,i,n){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(n){var r=encodeURIComponent(Wf(n))+i;return Array.isArray(t[n])?t[n].map((function(t){return r+encodeURIComponent(Wf(t))})).join(e):r+encodeURIComponent(Wf(t[n]))})).join(e):n?encodeURIComponent(Wf(n))+i+encodeURIComponent(Wf(t)):""};Gf((function(t,e){e.decode=e.parse=Bf,e.encode=e.stringify=qf}));class Vf extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Uf{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[i,n]of e)this.bindings[i]=n}concat(t){return new Uf(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const Xf={kind:"null"},Kf={kind:"number"},Yf={kind:"string"},Zf={kind:"boolean"},Hf={kind:"color"},$f={kind:"object"},Jf={kind:"value"},Qf={kind:"collator"},ty={kind:"formatted"},ey={kind:"resolvedImage"};function iy(t,e){return{kind:"array",itemType:t,N:e}}function ny(t){if("array"===t.kind){const e=ny(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const ry=[Xf,Kf,Yf,Zf,Hf,ty,$f,iy(Jf),ey];function oy(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!oy(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of ry)if(!oy(t,e))return null}return`Expected ${ny(t)} but found ${ny(e)} instead.`}function sy(t,e){return e.some((e=>e.kind===t.kind))}function ay(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}var ly=Gf((function(t,e){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 n(t){return(t=Math.round(t))<0?0:t>255?255:t}function r(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function s(t){return"%"===t[t.length-1]?r(parseFloat(t)/100):r(parseFloat(t))}function a(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in i)return i[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=r.indexOf("("),u=r.indexOf(")");if(-1!==l&&u+1===r.length){var h=r.substr(0,l),c=r.substr(l+1,u-(l+1)).split(","),p=1;switch(h){case"rgba":if(4!==c.length)return null;p=s(c.pop());case"rgb":return 3!==c.length?null:[o(c[0]),o(c[1]),o(c[2]),p];case"hsla":if(4!==c.length)return null;p=s(c.pop());case"hsl":if(3!==c.length)return null;var d=(parseFloat(c[0])%360+360)%360/360,f=s(c[1]),y=s(c[2]),g=y<=.5?y*(f+1):y+f-y*f,m=2*y-g;return[n(255*a(m,g,d+1/3)),n(255*a(m,g,d)),n(255*a(m,g,d-1/3)),p];default:return null}}return null}}catch(l){}}));class uy{constructor(t,e,i,n=1){this.r=t,this.g=e,this.b=i,this.a=n}static parse(t){if(!t)return;if(t instanceof uy)return t;if("string"!=typeof t)return;const e=ly.parseCSSColor(t);return e?new uy(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,n]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${n})`}toArray(){const{r:t,g:e,b:i,a:n}=this;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*i/n,n]}}uy.black=new uy(0,0,0,1),uy.white=new uy(1,1,1,1),uy.transparent=new uy(0,0,0,0),uy.red=new uy(1,0,0,1),uy.blue=new uy(0,0,1,1);class hy{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class cy{constructor(t,e,i,n,r){this.text=t,this.image=e,this.scale=i,this.fontStack=n,this.textColor=r}}class py{constructor(t){this.sections=t}static fromString(t){return new py([new cy(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof py?t:py.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const i={};e.fontStack&&(i["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(i["font-scale"]=e.scale),e.textColor&&(i["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(i)}return t}}class dy{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new dy({name:t,available:!1}):null}serialize(){return["image",this.name]}}function fy(t,e,i,n){if(!("number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255)){return`Invalid rgba value [${("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`}function yy(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 uy)return!0;if(t instanceof hy)return!0;if(t instanceof py)return!0;if(t instanceof dy)return!0;if(Array.isArray(t)){for(const e of t)if(!yy(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!yy(t[e]))return!1;return!0}return!1}function gy(t){if(null===t)return Xf;if("string"==typeof t)return Yf;if("boolean"==typeof t)return Zf;if("number"==typeof t)return Kf;if(t instanceof uy)return Hf;if(t instanceof hy)return Qf;if(t instanceof py)return ty;if(t instanceof dy)return ey;if(Array.isArray(t)){const e=t.length;let i;for(const n of t){const t=gy(n);if(i){if(i===t)continue;i=Jf;break}i=t}return iy(i||Jf,e)}return $f}function my(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof uy||t instanceof py||t instanceof dy?t.toString():JSON.stringify(t)}class vy{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!yy(t[1]))return e.error("invalid value");const i=t[1];let n=gy(i);const r=e.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new vy(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof uy?["rgba"].concat(this.value.toArray()):this.value instanceof py?this.value.serialize():this.value}}class _y{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const xy={string:Yf,number:Kf,boolean:Zf,object:$f};class by{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,n=1;const r=t[0];if("array"===r){let r,o;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in xy)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=xy[i],n++}else r=Jf;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}i=iy(r,o)}else i=xy[r];const o=[];for(;n<t.length;n++){const i=e.parse(t[n],n,Jf);if(!i)return null;o.push(i)}return new by(i,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!oy(this.type,gy(i)))return i;if(e===this.args.length-1)throw new _y(`Expected value to be of type ${ny(this.type)}, but found ${ny(gy(i))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);const n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((t=>t.serialize())))}}class wy{constructor(t){this.type=ty,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const n=[];let r=!1;for(let o=1;o<=t.length-1;++o){const i=t[o];if(r&&"object"==typeof i&&!Array.isArray(i)){r=!1;let t=null;if(i["font-scale"]&&(t=e.parse(i["font-scale"],1,Kf),!t))return null;let o=null;if(i["text-font"]&&(o=e.parse(i["text-font"],1,iy(Yf)),!o))return null;let s=null;if(i["text-color"]&&(s=e.parse(i["text-color"],1,Hf),!s))return null;const a=n[n.length-1];a.scale=t,a.font=o,a.textColor=s}else{const i=e.parse(t[o],1,Jf);if(!i)return null;const s=i.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,n.push({content:i,scale:null,font:null,textColor:null})}}return new wy(n)}evaluate(t){return new py(this.sections.map((e=>{const i=e.content.evaluate(t);return gy(i)===ey?new cy("",i,null,null,null):new cy(my(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const i={};e.scale&&(i["font-scale"]=e.scale.serialize()),e.font&&(i["text-font"]=e.font.serialize()),e.textColor&&(i["text-color"]=e.textColor.serialize()),t.push(i)}return t}}class Sy{constructor(t){this.type=ey,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Yf);return i?new Sy(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=dy.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Cy={"to-boolean":Zf,"to-color":Hf,"to-number":Kf,"to-string":Yf};class Ty{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const n=Cy[i],r=[];for(let o=1;o<t.length;o++){const i=e.parse(t[o],o,Jf);if(!i)return null;r.push(i)}return new Ty(n,r)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const n of this.args){if(e=n.evaluate(t),i=null,e instanceof uy)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:fy(e[0],e[1],e[2],e[3]),!i))return new uy(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new _y(i||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new _y(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?py.fromString(my(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?dy.fromString(my(this.args[0].evaluate(t))):my(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new wy([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Sy(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}const Ey=["Unknown","Point","LineString","Polygon"];class ky{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Ey[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=uy.parse(t)),e}}class Py{constructor(t,e,i,n){this.name=t,this.type=e,this._evaluate=i,this.args=n}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const i=t[0],n=Py.definitions[i];if(!n)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let a=null;for(const[l,u]of s){a=new $y(e.registry,e.path,null,e.scope);const n=[];let o=!1;for(let e=1;e<t.length;e++){const i=t[e],r=Array.isArray(l)?l[e-1]:l.type,s=a.parse(i,1+n.length,r);if(!s){o=!0;break}n.push(s)}if(!o)if(Array.isArray(l)&&l.length!==n.length)a.error(`Expected ${l.length} arguments, but found ${n.length} instead.`);else{for(let t=0;t<n.length;t++){const e=Array.isArray(l)?l[t]:l.type,i=n[t];a.concat(t+1).checkSubtype(e,i.type)}if(0===a.errors.length)return new Py(i,r,u,n)}}if(1===s.length)e.errors.push(...a.errors);else{const i=(s.length?s:o).map((([t])=>{return e=t,Array.isArray(e)?`(${e.map(ny).join(", ")})`:`(${ny(e.type)}...)`;var e})).join(" | "),n=[];for(let r=1;r<t.length;r++){const i=e.parse(t[r],1+n.length);if(!i)return null;n.push(ny(i.type))}e.error(`Expected arguments of type ${i}, but found (${n.join(", ")}) instead.`)}return null}static register(t,e){Py.definitions=e;for(const i in e)t[i]=Py}}class Oy{constructor(t,e,i){this.type=Qf,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const n=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Zf);if(!n)return null;const r=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Zf);if(!r)return null;let o=null;return i.locale&&(o=e.parse(i.locale,1,Yf),!o)?null:new Oy(n,r,o)}evaluate(t){return new hy(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}function Ry(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Iy(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Fy(t,e){const i=(180+t[0])/360;const n=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360);var r;const o=Math.pow(2,e.z);return[Math.round(i*o*8192),Math.round(n*o*8192)]}function jy(t,e,i){const n=t[0]-e[0],r=t[1]-e[1],o=t[0]-i[0],s=t[1]-i[1];return n*s-o*r==0&&n*o<=0&&r*s<=0}function My(t,e){let i=!1;for(let s=0,a=e.length;s<a;s++){const a=e[s];for(let e=0,s=a.length;e<s-1;e++){if(jy(t,a[e],a[e+1]))return!1;n=t,r=a[e],o=a[e+1],r[1]>n[1]!=o[1]>n[1]&&n[0]<(o[0]-r[0])*(n[1]-r[1])/(o[1]-r[1])+r[0]&&(i=!i)}}var n,r,o;return i}function Ay(t,e){for(let i=0;i<e.length;i++)if(My(t,e[i]))return!0;return!1}function Ly(t,e,i,n){const r=t[0]-i[0],o=t[1]-i[1],s=e[0]-i[0],a=e[1]-i[1],l=n[0]-i[0],u=n[1]-i[1],h=r*u-l*o,c=s*u-l*a;return h>0&&c<0||h<0&&c>0}function Dy(t,e,i,n){const r=[e[0]-t[0],e[1]-t[1]],o=[n[0]-i[0],n[1]-i[1]];return 0!=(s=o)[0]*(a=r)[1]-s[1]*a[0]&&!(!Ly(t,e,i,n)||!Ly(i,n,t,e));var s,a}function zy(t,e,i){for(const n of i)for(let i=0;i<n.length-1;++i)if(Dy(t,e,n[i],n[i+1]))return!0;return!1}function Gy(t,e){for(let i=0;i<t.length;++i)if(!My(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(zy(t[i],t[i+1],e))return!1;return!0}function Ny(t,e){for(let i=0;i<e.length;i++)if(Gy(t,e[i]))return!0;return!1}function By(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=[];for(let n=0;n<t[r].length;n++){const s=Fy(t[r][n],i);Ry(e,s),o.push(s)}n.push(o)}return n}function Wy(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=By(t[r],e,i);n.push(o)}return n}function qy(t,e,i,n){if(t[0]<i[0]||t[0]>i[2]){const e=.5*n;let r=t[0]-i[0]>e?-n:i[0]-t[0]>e?n:0;0===r&&(r=t[0]-i[2]>e?-n:i[2]-t[0]>e?n:0),t[0]+=r}Ry(e,t)}function Vy(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];for(const a of t)for(const t of a){const n=[t.x+o[0],t.y+o[1]];qy(n,e,i,r),s.push(n)}return s}function Uy(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];for(const l of t){const t=[];for(const i of l){const n=[i.x+o[0],i.y+o[1]];Ry(e,n),t.push(n)}s.push(t)}if(e[2]-e[0]<=r/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of s)for(const n of t)qy(n,e,i,r)}var a;return s}class Xy{constructor(t,e){this.type=Zf,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(yy(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const i=e.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Xy(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new Xy(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new Xy(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const o=By(e.coordinates,n,r),s=Vy(t.geometry(),i,n,r);if(!Iy(i,n))return!1;for(const t of s)if(!My(t,o))return!1}if("MultiPolygon"===e.type){const o=Wy(e.coordinates,n,r),s=Vy(t.geometry(),i,n,r);if(!Iy(i,n))return!1;for(const t of s)if(!Ay(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const o=By(e.coordinates,n,r),s=Uy(t.geometry(),i,n,r);if(!Iy(i,n))return!1;for(const t of s)if(!Gy(t,o))return!1}if("MultiPolygon"===e.type){const o=Wy(e.coordinates,n,r),s=Uy(t.geometry(),i,n,r);if(!Iy(i,n))return!1;for(const t of s)if(!Ny(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Ky(t){if(t instanceof Py){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Xy)return!1;let e=!0;return t.eachChild((t=>{e&&!Ky(t)&&(e=!1)})),e}function Yy(t){if(t instanceof Py&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!Yy(t)&&(e=!1)})),e}function Zy(t,e){if(t instanceof Py&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!Zy(t,e)&&(i=!1)})),i}class Hy{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new Hy(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class $y{constructor(t,e=[],i,n=new Uf,r=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=n,this.errors=r,this.expectedType=i}parse(t,e,i,n,r={}){return e?this.concat(e,i,n)._parse(t,r):this._parse(t,r)}_parse(t,e){function i(t,e,i){return"assert"===i?new by(e,[t]):"coerce"===i?new Ty(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[r];if(o){let r=o.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,n=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(t,n))return null}else r=i(r,t,e.typeAnnotation||"coerce");else r=i(r,t,e.typeAnnotation||"assert")}if(!(r instanceof vy)&&"resolvedImage"!==r.type.kind&&Jy(r)){const t=new ky;try{r=new vy(r.type,r.evaluate(t))}catch(n){return this.error(n.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof t} instead.`)}concat(t,e,i){const n="number"==typeof t?this.path.concat(t):this.path,r=i?this.scope.concat(i):this.scope;return new $y(this.registry,n,e||null,r,this.errors)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new Vf(i,t))}checkSubtype(t,e){const i=oy(t,e);return i&&this.error(i),i}}function Jy(t){if(t instanceof Hy)return Jy(t.boundExpression);if(t instanceof Py&&"error"===t.name)return!1;if(t instanceof Oy)return!1;if(t instanceof Xy)return!1;const e=t instanceof Ty||t instanceof by;let i=!0;return t.eachChild((t=>{i=e?i&&Jy(t):i&&t instanceof vy})),!!i&&(Ky(t)&&Zy(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script"]))}function Qy(t,e){const i=t.length-1;let n,r,o=0,s=i,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=t[a],r=t[a+1],n<=e){if(a===i||e<r)return a;o=a+1}else{if(!(n>e))throw new _y("Input is not a number.");s=a-1}return 0}class tg{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[n,r]of i)this.labels.push(n),this.outputs.push(r)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const i=e.parse(t[1],1,Kf);if(!i)return null;const n=[];let r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(let o=1;o<t.length;o+=2){const i=1===o?-1/0:t[o],s=t[o+1],a=o,l=o+1;if("number"!=typeof i)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(n.length&&n[n.length-1][0]>=i)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const u=e.parse(s,l,r);if(!u)return null;r=r||u.type,n.push([i,u])}return new tg(r,i,n)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);return i[Qy(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var eg=ig;function ig(t,e,i,n){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=i,this.p2y=n}function ng(t,e,i){return t*(1-i)+e*i}ig.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},ig.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},ig.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},ig.prototype.solveCurveX=function(t,e){var i,n,r,o,s;for(void 0===e&&(e=1e-6),r=t,s=0;s<8;s++){if(o=this.sampleCurveX(r)-t,Math.abs(o)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}if((r=t)<(i=0))return i;if(r>(n=1))return n;for(;i<n;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?i=r:n=r,r=.5*(n-i)+i}return r},ig.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var rg=Object.freeze({__proto__:null,number:ng,color:function(t,e,i){return new uy(ng(t.r,e.r,i),ng(t.g,e.g,i),ng(t.b,e.b,i),ng(t.a,e.a,i))},array:function(t,e,i){return t.map(((t,n)=>ng(t,e[n],i)))}});const og=4/29,sg=6/29,ag=3*sg*sg,lg=Math.PI/180,ug=180/Math.PI;function hg(t){return t>.008856451679035631?Math.pow(t,1/3):t/ag+og}function cg(t){return t>sg?t*t*t:ag*(t-og)}function pg(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function dg(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fg(t){const e=dg(t.r),i=dg(t.g),n=dg(t.b),r=hg((.4124564*e+.3575761*i+.1804375*n)/.95047),o=hg((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-hg((.0193339*e+.119192*i+.9503041*n)/1.08883)),alpha:t.a}}function yg(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*cg(e),i=.95047*cg(i),n=1.08883*cg(n),new uy(pg(3.2404542*i-1.5371385*e-.4985314*n),pg(-.969266*i+1.8760108*e+.041556*n),pg(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function gg(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const mg={forward:fg,reverse:yg,interpolate:function(t,e,i){return{l:ng(t.l,e.l,i),a:ng(t.a,e.a,i),b:ng(t.b,e.b,i),alpha:ng(t.alpha,e.alpha,i)}}},vg={forward:function(t){const{l:e,a:i,b:n}=fg(t),r=Math.atan2(n,i)*ug;return{h:r<0?r+360:r,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*lg,i=t.c;return yg({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:gg(t.h,e.h,i),c:ng(t.c,e.c,i),l:ng(t.l,e.l,i),alpha:ng(t.alpha,e.alpha,i)}}};class _g{constructor(t,e,i,n,r){this.type=t,this.operator=e,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(const[o,s]of r)this.labels.push(o),this.outputs.push(s)}static interpolationFactor(t,e,i,n){let r=0;if("exponential"===t.name)r=xg(e,t.base,i,n);else if("linear"===t.name)r=xg(e,1,i,n);else if("cubic-bezier"===t.name){const o=t.controlPoints;r=new eg(o[0],o[1],o[2],o[3]).solve(xg(e,1,i,n))}return r}static parse(t,e){let[i,n,r,...o]=t;if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t}}else{if("cubic-bezier"!==n[0])return e.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const t=n.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(r=e.parse(r,2,Kf),!r)return null;const s=[];let a=null;"interpolate-hcl"===i||"interpolate-lab"===i?a=Hf:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let l=0;l<o.length;l+=2){const t=o[l],i=o[l+1],n=l+3,r=l+4;if("number"!=typeof t)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(s.length&&s[s.length-1][0]>=t)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const u=e.parse(i,r,a);if(!u)return null;a=a||u.type,s.push([t,u])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new _g(a,i,n,r,s):e.error(`Type ${ny(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);const o=Qy(e,n),s=e[o],a=e[o+1],l=_g.interpolationFactor(this.interpolation,n,s,a),u=i[o].evaluate(t),h=i[o+1].evaluate(t);return"interpolate"===this.operator?rg[this.type.kind.toLowerCase()](u,h,l):"interpolate-hcl"===this.operator?vg.reverse(vg.interpolate(vg.forward(u),vg.forward(h),l)):mg.reverse(mg.interpolate(mg.forward(u),mg.forward(h),l))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let 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);const e=[this.operator,t,this.input.serialize()];for(let i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e}}function xg(t,e,i,n){const r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}class bg{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let i=null;const n=e.expectedType;n&&"value"!==n.kind&&(i=n);const r=[];for(const s of t.slice(1)){const t=e.parse(s,1+r.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,r.push(t)}const o=n&&r.some((t=>oy(n,t.type)));return new bg(o?Jf:i,r)}evaluate(t){let e,i=null,n=0;for(const r of this.args)if(n++,i=r.evaluate(t),i&&i instanceof dy&&!i.available&&(e||(e=i.name),i=null,n===this.args.length&&(i=e)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class wg{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let r=1;r<t.length-1;r+=2){const n=t[r];if("string"!=typeof n)return e.error(`Expected string, but found ${typeof n} instead.`,r);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);const o=e.parse(t[r+1],r+1);if(!o)return null;i.push([n,o])}const n=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return n?new wg(i,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,i]of this.bindings)t.push(e,i.serialize());return t.push(this.result.serialize()),t}}class Sg{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Kf),n=e.parse(t[2],2,iy(e.expectedType||Jf));if(!i||!n)return null;const r=n.type;return new Sg(r.itemType,i,n)}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new _y(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new _y(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new _y(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class Cg{constructor(t,e){this.type=Zf,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Jf),n=e.parse(t[2],2,Jf);return i&&n?sy(i.type,[Zf,Yf,Kf,Xf,Jf])?new Cg(i,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${ny(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!ay(e,["boolean","string","number","null"]))throw new _y(`Expected first argument to be of type boolean, string, number or null, but found ${ny(gy(e))} instead.`);if(!ay(i,["string","array"]))throw new _y(`Expected second argument to be of type array or string, but found ${ny(gy(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class Tg{constructor(t,e,i){this.type=Kf,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Jf),n=e.parse(t[2],2,Jf);if(!i||!n)return null;if(!sy(i.type,[Zf,Yf,Kf,Xf,Jf]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${ny(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,Kf);return r?new Tg(i,n,r):null}return new Tg(i,n)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!ay(e,["boolean","string","number","null"]))throw new _y(`Expected first argument to be of type boolean, string, number or null, but found ${ny(gy(e))} instead.`);if(!ay(i,["string","array"]))throw new _y(`Expected second argument to be of type array or string, but found ${ny(gy(i))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(t);return i.indexOf(e,n)}return i.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class Eg{constructor(t,e,i,n,r,o){this.inputType=t,this.type=e,this.input=i,this.cases=n,this.outputs=r,this.otherwise=o}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const r={},o=[];for(let l=2;l<t.length-1;l+=2){let s=t[l];const a=t[l+1];Array.isArray(s)||(s=[s]);const u=e.concat(l);if(0===s.length)return u.error("Expected at least one branch label.");for(const t of s){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,gy(t)))return null}else i=gy(t);if(void 0!==r[String(t)])return u.error("Branch labels must be unique.");r[String(t)]=o.length}const h=e.parse(a,l,n);if(!h)return null;n=n||h.type,o.push(h)}const s=e.parse(t[1],1,Jf);if(!s)return null;const a=e.parse(t[t.length-1],t.length-1,n);return a?"value"!==s.type.kind&&e.concat(1).checkSubtype(i,s.type)?null:new Eg(i,n,s,r,o,a):null}evaluate(t){const e=this.input.evaluate(t);return(gy(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),i=[],n={};for(const o of e){const t=n[this.cases[o]];void 0===t?(n[this.cases[o]]=i.length,i.push([this.cases[o],[o]])):i[t][1].push(o)}const r=t=>"number"===this.inputType.kind?Number(t):t;for(const[o,s]of i)1===s.length?t.push(r(s[0])):t.push(s.map(r)),t.push(this.outputs[o].serialize());return t.push(this.otherwise.serialize()),t}}class kg{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const n=[];for(let o=1;o<t.length-1;o+=2){const r=e.parse(t[o],o,Zf);if(!r)return null;const s=e.parse(t[o+1],o+1,i);if(!s)return null;n.push([r,s]),i=i||s.type}const r=e.parse(t[t.length-1],t.length-1,i);return r?new kg(i,n,r):null}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every((([t,e])=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class Pg{constructor(t,e,i,n){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Jf),n=e.parse(t[2],2,Kf);if(!i||!n)return null;if(!sy(i.type,[iy(Jf),Yf,Jf]))return e.error(`Expected first argument to be of type array or string, but found ${ny(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,Kf);return r?new Pg(i.type,i,n,r):null}return new Pg(i.type,i,n)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!ay(e,["string","array"]))throw new _y(`Expected first argument to be of type array or string, but found ${ny(gy(e))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(t);return e.slice(i,n)}return e.slice(i)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function Og(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Rg(t,e,i,n){return 0===n.compare(e,i)}function Ig(t,e,i){const n="=="!==t&&"!="!==t;return class r{constructor(t,e,i){this.type=Zf,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let o=e.parse(t[1],1,Jf);if(!o)return null;if(!Og(i,o.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${ny(o.type)}'.`);let s=e.parse(t[2],2,Jf);if(!s)return null;if(!Og(i,s.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${ny(s.type)}'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error(`Cannot compare types '${ny(o.type)}' and '${ny(s.type)}'.`);n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new by(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new by(o.type,[s])));let a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,Qf),!a)return null}return new r(o,s,a)}evaluate(r){const o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){const e=gy(o),i=gy(s);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new _y(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=gy(o),i=gy(s);if("string"!==t.kind||"string"!==i.kind)return e(r,o,s)}return this.collator?i(r,o,s,this.collator.evaluate(r)):e(r,o,s)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const Fg=Ig("==",(function(t,e,i){return e===i}),Rg),jg=Ig("!=",(function(t,e,i){return e!==i}),(function(t,e,i,n){return!Rg(0,e,i,n)})),Mg=Ig("<",(function(t,e,i){return e<i}),(function(t,e,i,n){return n.compare(e,i)<0})),Ag=Ig(">",(function(t,e,i){return e>i}),(function(t,e,i,n){return n.compare(e,i)>0})),Lg=Ig("<=",(function(t,e,i){return e<=i}),(function(t,e,i,n){return n.compare(e,i)<=0})),Dg=Ig(">=",(function(t,e,i){return e>=i}),(function(t,e,i,n){return n.compare(e,i)>=0}));class zg{constructor(t,e,i,n,r){this.type=Yf,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=n,this.maxFractionDigits=r}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Kf);if(!i)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let r=null;if(n.locale&&(r=e.parse(n.locale,1,Yf),!r))return null;let o=null;if(n.currency&&(o=e.parse(n.currency,1,Yf),!o))return null;let s=null;if(n["min-fraction-digits"]&&(s=e.parse(n["min-fraction-digits"],1,Kf),!s))return null;let a=null;return n["max-fraction-digits"]&&(a=e.parse(n["max-fraction-digits"],1,Kf),!a)?null:new zg(i,r,o,s,a)}evaluate(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))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const 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]}}class Gg{constructor(t){this.type=Kf,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${ny(i.type)} instead.`):new Gg(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new _y(`Expected value to be of type string or array, but found ${ny(gy(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const Ng={"==":Fg,"!=":jg,">":Ag,"<":Mg,">=":Dg,"<=":Lg,array:by,at:Sg,boolean:by,case:kg,coalesce:bg,collator:Oy,format:wy,image:Sy,in:Cg,"index-of":Tg,interpolate:_g,"interpolate-hcl":_g,"interpolate-lab":_g,length:Gg,let:wg,literal:vy,match:Eg,number:by,"number-format":zg,object:by,slice:Pg,step:tg,string:by,"to-boolean":Ty,"to-color":Ty,"to-number":Ty,"to-string":Ty,var:Hy,within:Xy};function Bg(t,[e,i,n,r]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const o=r?r.evaluate(t):1,s=fy(e,i,n,o);if(s)throw new _y(s);return new uy(e/255*o,i/255*o,n/255*o,o)}function Wg(t,e){return t in e}function qg(t,e){const i=e[t];return void 0===i?null:i}function Vg(t){return{type:t}}function Ug(t){return{result:"success",value:t}}function Xg(t){return{result:"error",value:t}}function Kg(t){return!!t.expression&&t.expression.interpolated}function Yg(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}Py.register(Ng,{error:[{kind:"error"},[Yf],(t,[e])=>{throw new _y(e.evaluate(t))}],typeof:[Yf,[Jf],(t,[e])=>ny(gy(e.evaluate(t)))],"to-rgba":[iy(Kf,4),[Hf],(t,[e])=>e.evaluate(t).toArray()],rgb:[Hf,[Kf,Kf,Kf],Bg],rgba:[Hf,[Kf,Kf,Kf,Kf],Bg],has:{type:Zf,overloads:[[[Yf],(t,[e])=>Wg(e.evaluate(t),t.properties())],[[Yf,$f],(t,[e,i])=>Wg(e.evaluate(t),i.evaluate(t))]]},get:{type:Jf,overloads:[[[Yf],(t,[e])=>qg(e.evaluate(t),t.properties())],[[Yf,$f],(t,[e,i])=>qg(e.evaluate(t),i.evaluate(t))]]},"feature-state":[Jf,[Yf],(t,[e])=>qg(e.evaluate(t),t.featureState||{})],properties:[$f,[],t=>t.properties()],"geometry-type":[Yf,[],t=>t.geometryType()],id:[Jf,[],t=>t.id()],zoom:[Kf,[],t=>t.globals.zoom],"heatmap-density":[Kf,[],t=>t.globals.heatmapDensity||0],"line-progress":[Kf,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[Kf,[],t=>t.globals.skyRadialProgress||0],accumulated:[Jf,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[Kf,Vg(Kf),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[Kf,Vg(Kf),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:Kf,overloads:[[[Kf,Kf],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[Kf],(t,[e])=>-e.evaluate(t)]]},"/":[Kf,[Kf,Kf],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[Kf,[Kf,Kf],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[Kf,[],()=>Math.LN2],pi:[Kf,[],()=>Math.PI],e:[Kf,[],()=>Math.E],"^":[Kf,[Kf,Kf],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[Kf,[Kf],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[Kf,[Kf],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[Kf,[Kf],(t,[e])=>Math.log(e.evaluate(t))],log2:[Kf,[Kf],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[Kf,[Kf],(t,[e])=>Math.sin(e.evaluate(t))],cos:[Kf,[Kf],(t,[e])=>Math.cos(e.evaluate(t))],tan:[Kf,[Kf],(t,[e])=>Math.tan(e.evaluate(t))],asin:[Kf,[Kf],(t,[e])=>Math.asin(e.evaluate(t))],acos:[Kf,[Kf],(t,[e])=>Math.acos(e.evaluate(t))],atan:[Kf,[Kf],(t,[e])=>Math.atan(e.evaluate(t))],min:[Kf,Vg(Kf),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[Kf,Vg(Kf),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[Kf,[Kf],(t,[e])=>Math.abs(e.evaluate(t))],round:[Kf,[Kf],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[Kf,[Kf],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[Kf,[Kf],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Zf,[Yf,Jf],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Zf,[Jf],(t,[e])=>t.id()===e.value],"filter-type-==":[Zf,[Yf],(t,[e])=>t.geometryType()===e.value],"filter-<":[Zf,[Yf,Jf],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<r}],"filter-id-<":[Zf,[Jf],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<n}],"filter->":[Zf,[Yf,Jf],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>r}],"filter-id->":[Zf,[Jf],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[Zf,[Yf,Jf],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[Zf,[Jf],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[Zf,[Yf,Jf],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[Zf,[Jf],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[Zf,[Jf],(t,[e])=>e.value in t.properties()],"filter-has-id":[Zf,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Zf,[iy(Yf)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Zf,[iy(Jf)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Zf,[Yf,iy(Jf)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Zf,[Yf,iy(Jf)],(t,[e,i])=>function(t,e,i,n){for(;i<=n;){const r=i+n>>1;if(e[r]===t)return!0;e[r]>t?n=r-1:i=r+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Zf,overloads:[[[Zf,Zf],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Vg(Zf),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:Zf,overloads:[[[Zf,Zf],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Vg(Zf),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[Zf,[Zf],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Zf,[Yf],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Yf,[Yf],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Yf,[Yf],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Yf,Vg(Jf),(t,e)=>e.map((e=>my(e.evaluate(t)))).join("")],"resolved-locale":[Yf,[Qf],(t,[e])=>e.evaluate(t).resolvedLocale()]});class Zg{constructor(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new ky,this._defaultValue=e?"color"===(i=e).type&&Yg(i.default)?new uy(0,0,0,0):"color"===i.type?uy.parse(i.default)||null:void 0===i.default?null:i.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,n,r,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new _y(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,"undefined"!=typeof console&&console.warn(s.message)),this._defaultValue}}}function Hg(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Ng}function $g(t,e){const i=new $y(Ng,[],e?function(t){const e={color:Hf,string:Yf,number:Kf,enum:Yf,boolean:Zf,formatted:ty,resolvedImage:ey};if("array"===t.type)return iy(e[t.value]||Jf,t.length);return e[t.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Ug(new Zg(n,e)):Xg(i.errors)}class Jg{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Yy(e.expression)}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}}class Qg{constructor(t,e,i,n){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Yy(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}interpolationFactor(t,e,i){return this.interpolationType?_g.interpolationFactor(this.interpolationType,t,e,i):0}}function tm(t,e){if("error"===(t=$g(t,e)).result)return t;const i=t.value.expression,n=Ky(i);if(!n&&("data-driven"!==(r=e)["property-type"]&&"cross-faded-data-driven"!==r["property-type"]))return Xg([new Vf("","data expressions not supported")]);var r;const o=Zy(i,["zoom"]);if(!o&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return Xg([new Vf("","zoom expressions not supported")]);const s=em(i);if(!s&&!o)return Xg([new Vf("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof Vf)return Xg([s]);if(s instanceof _g&&!Kg(e))return Xg([new Vf("",'"interpolate" expressions cannot be used with this property')]);if(!s)return Ug(new Jg(n?"constant":"source",t.value));const a=s instanceof _g?s.interpolation:void 0;return Ug(new Qg(n?"camera":"composite",t.value,s.labels,a))}function em(t){let e=null;if(t instanceof wg)e=em(t.result);else if(t instanceof bg){for(const i of t.args)if(e=em(i),e)break}else(t instanceof tg||t instanceof _g)&&t.input instanceof Py&&"zoom"===t.input.name&&(e=t);return e instanceof Vf||t.eachChild((t=>{const i=em(t);i instanceof Vf?e=i:!e&&i?e=new Vf("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Vf("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function im(t){return"object"==typeof t?["literal",t]:t}function nm(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function rm(t,e){const i=im((n=t.default,r=e.default,void 0!==n?n:void 0!==r?r:void 0));var n,r;return void 0===i&&"resolvedImage"===e.type?"":i}function om(t,e,i){const n=lm(t,e),r=["get",t.property];if("categorical"===n&&"boolean"==typeof i[0][0]){const n=["case"];for(const t of i)n.push(["==",r,t[0]],t[1]);return n.push(rm(t,e)),n}if("categorical"===n){const n=["match",r];for(const t of i)am(n,t[0],t[1],!1);return n.push(rm(t,e)),n}if("interval"===n){const e=["step",["number",r]];for(const t of i)am(e,t[0],t[1],!0);return sm(e),void 0===t.default?e:["case",["==",["typeof",r],"number"],e,im(t.default)]}if("exponential"===n){const e=void 0!==t.base?t.base:1,n=[nm(t),1===e?["linear"]:["exponential",e],["number",r]];for(const t of i)am(n,t[0],t[1],!1);return void 0===t.default?n:["case",["==",["typeof",r],"number"],n,im(t.default)]}throw new Error(`Unknown property function type ${n}`)}function sm(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function am(t,e,i,n){t.length>3&&e===t[t.length-2]||(n&&2===t.length||t.push(e),t.push(i))}function lm(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function um(t){const e=["concat"],i=/{([^{}]+)}/g;let n=0;for(let r=i.exec(t);null!==r;r=i.exec(t)){const o=t.slice(n,i.lastIndex-r[0].length);n=i.lastIndex,o.length>0&&e.push(o),e.push(["get",r[1]])}if(1===e.length)return t;if(n<t.length)e.push(t.slice(n));else if(2===e.length)return["to-string",e[1]];return e}function hm(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!hm(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const cm={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function pm(t){if(null==t)return{filter:()=>!0,needGeometry:!1};hm(t)||(t=ym(t));const e=$g(t,cm);if("error"===e.result)throw new Error(e.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return{filter:(t,i,n)=>e.value.evaluate(t,i,{},n),needGeometry:fm(t)}}function dm(t,e){return t<e?-1:t>e?1:0}function fm(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e<t.length;e++)if(fm(t[e]))return!0;return!1}function ym(t){if(!t)return!0;const e=t[0];if(t.length<=1)return"any"!==e;var i;return"=="===e?gm(t[1],t[2],"=="):"!="===e?_m(gm(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?gm(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(ym))):"all"===e?["all"].concat(t.slice(1).map(ym)):"none"===e?["all"].concat(t.slice(1).map(ym).map(_m)):"in"===e?mm(t[1],t.slice(2)):"!in"===e?_m(mm(t[1],t.slice(2))):"has"===e?vm(t[1]):"!has"===e?_m(vm(t[1])):"within"!==e||t}function gm(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function mm(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(dm)]]:["filter-in-small",t,["literal",e]]}}function vm(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function _m(t){return["!",t]}var xm=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function bm(t,e){const i={};for(const n in t)"ref"!==n&&(i[n]=t[n]);return xm.forEach((t=>{t in e&&(i[t]=e[t])})),i}Gf((function(t,e){var i=function(){var t=function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},e=[1,12],i=[1,13],n=[1,9],r=[1,10],o=[1,11],s=[1,14],a=[1,15],l=[14,18,22,24],u=[18,22],h=[22,24],c={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,i,n,r,o,s){var a=o.length-1;switch(r){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=o[a-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=o[a-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[o[a-2],o[a]];break;case 16:this.$={},this.$[o[a][0]]=o[a][1];break;case 17:this.$=o[a-2],o[a-2][o[a][0]]=o[a][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[o[a]];break;case 21:this.$=o[a-2],o[a-2].push(o[a])}},table:[{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,12:1,13:2,15:7,16:8,17:s,23:a},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:23,15:7,16:8,17:s,23:a,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(u,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(h,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:30,15:7,16:8,17:s,23:a},t(l,[2,19]),{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:31,15:7,16:8,17:s,23:a},t(u,[2,17]),t(u,[2,15]),t(h,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,i=[0],n=[null],r=[],o=this.table,s="",a=0,l=0,u=2,h=1,c=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(d.yy[f]=this.yy[f]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var y=p.yylloc;r.push(y);var g=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=p.lex()||h)&&(t=e.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var v,_,x,b,w,S,C,T,E={};;){if(_=i[i.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==v&&(v=m()),x=o[_]&&o[_][v]),void 0===x||!x.length||!x[0]){var k="";for(w in T=[],o[_])this.terminals_[w]&&w>u&&T.push("'"+this.terminals_[w]+"'");k=p.showPosition?"Parse error on line "+(a+1)+":\n"+p.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(a+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(k,{text:p.match,token:this.terminals_[v]||v,line:p.yylineno,loc:y,expected:T})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:i.push(v),n.push(p.yytext),r.push(p.yylloc),i.push(x[1]),v=null,l=p.yyleng,s=p.yytext,a=p.yylineno,y=p.yylloc;break;case 2:if(S=this.productions_[x[1]][1],E.$=n[n.length-S],E._$={first_line:r[r.length-(S||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(S||1)].first_column,last_column:r[r.length-1].last_column},g&&(E._$.range=[r[r.length-(S||1)].range[0],r[r.length-1].range[1]]),void 0!==(b=this.performAction.apply(E,[s,l,a,d.yy,x[1],n,r].concat(c))))return b;S&&(i=i.slice(0,-1*S*2),n=n.slice(0,-1*S),r=r.slice(0,-1*S)),i.push(this.productions_[x[1]][0]),n.push(E.$),r.push(E._$),C=o[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},p={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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 e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var r=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===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),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(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,n,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var o in r)this[o]=r[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),o=0;o<r.length;o++)if((i=this._input.match(this.rules[r[o]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[o])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[n]))&&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,e,i,n){switch(i){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.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 d(){this.yy={}}return c.lexer=p,d.prototype=c,c.Parser=d,new d}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)}}));const wm=Hg,Sm=tm,Cm=function(t,e){let i=t.stops;if(!i)return function(t,e){const i=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",i]:i;if("enum"===e.type)return["match",i,Object.keys(e.values),i,t.default];{const n=["color"===e.type?"to-color":e.type,i,im(t.default)];return"array"===e.type&&n.splice(1,0,e.value,e.length||null),n}}(t,e);const n=i&&"object"==typeof i[0][0],r=n||void 0!==t.property,o=n||!r;return i=i.map((t=>!r&&e.tokens&&"string"==typeof t[1]?[t[0],um(t[1])]:[t[0],im(t[1])])),n?function(t,e,i){const n={},r={},o=[];for(let s=0;s<i.length;s++){const e=i[s],a=e[0].zoom;void 0===n[a]&&(n[a]={zoom:a,type:t.type,property:t.property,default:t.default},r[a]=[],o.push(a)),r[a].push([e[0].value,e[1]])}if("exponential"===lm({},e)){const i=[nm(t),["linear"],["zoom"]];for(const t of o){am(i,t,om(n[t],e,r[t]),!1)}return i}{const t=["step",["zoom"]];for(const i of o){am(t,i,om(n[i],e,r[i]),!0)}return sm(t),t}}(t,e,i):o?function(t,e,i,n=["zoom"]){const r=lm(t,e);let o,s=!1;if("interval"===r)o=["step",n],s=!0;else{if("exponential"!==r)throw new Error(`Unknown zoom function type "${r}"`);{const e=void 0!==t.base?t.base:1;o=[nm(t),1===e?["linear"]:["exponential",e],n]}}for(const a of i)am(o,a[0],a[1],s);return sm(o),o}(t,e,i):om(t,e,i)},Tm=Yg;function Em(t){return t*Math.PI/180}var km=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function Pm(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var i=document.createElement("canvas");return i.width=t,i.height=e,i}var Om,Rm=Array(256).join(" ");function Im(t,e){if(e>=.05){for(var i="",n=t.split("\n"),r=Rm.slice(0,Math.round(e/.1)),o=0,s=n.length;o<s;++o)o>0&&(i+="\n"),i+=n[o].split("").join(r);return i}return t}function Fm(){return Om||(Om=Pm(1,1).getContext("2d")),Om}function jm(t,e){return Fm().measureText(t).width+(t.length-1)*e}var Mm={};function Am(t,e,i,n){if(-1!==t.indexOf("\n")){for(var r=t.split("\n"),o=[],s=0,a=r.length;s<a;++s)o.push(Am(r[s],e,i,n));return o.join("\n")}var l=i+","+e+","+t+","+n,u=Mm[l];if(!u){var h=t.split(" ");if(h.length>1){var c=Fm();c.font=e;var p=c.measureText("M").width*i,d="";for(o=[],s=0,a=h.length;s<a;++s){var f=h[s],y=d+(d?" ":"")+f;jm(y,n)<=p?d=y:(d&&o.push(d),d=f)}d&&o.push(d);for(s=0,a=o.length;s<a&&a>1;++s){var g=o[s];if(jm(g,n)<.35*p){var m=s>0?jm(o[s-1],n):1/0,v=s<a-1?jm(o[s+1],n):1/0;o.splice(s,1),a-=1,m<v?(o[s-1]+=" "+g,s-=1):o[s]=g+" "+o[s]}}for(s=0,a=o.length-1;s<a;++s){var _=o[s],x=o[s+1];if(jm(_,n)>.7*p&&jm(x,n)<.6*p){var b=_.split(" "),w=b.pop();jm(w,n)<.2*p&&(o[s]=b.join(" "),o[s+1]=w+" "+x),a-=1}}u=o.join("\n")}else u=t;u=Im(u,n),Mm[l]=u}return u}Br&&qt(Br,jt,(function(){Mm={}}));var Lm,Dm,zm=Tm,Gm=Cm,Nm=wm,Bm=Sm,Wm={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},qm={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]},Vm={},Um={zoom:0},Xm={};function Km(t,e,i,n,r){var o=t.id;Xm[o]||(Xm[o]={});var s=Xm[o];if(!s[i]){var a=(t[e]||Vm)[i],l=Df[e+"_"+t.type][i];void 0===a&&(a=l.default);var u=Nm(a);if(!u&&zm(a)&&(a=Gm(a,l),u=!0),u){var h=function(t,e){var i=Bm(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}(a,l);s[i]=h.evaluate.bind(h)}else"color"==l.type&&(a=uy.parse(a)),s[i]=function(){return a}}return Um.zoom=n,s[i](Um,r)}var Ym={};function Zm(t,e){if(t){if(0===t.a||0===e)return;var i=t.a;return e=void 0===e?1:e,"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*e+")"}return t}var Hm=/^([^]*)\{(.*)\}([^]*)$/;function $m(t,e){var i;do{if(i=t.match(Hm)){var n=e[i[2]]||"";t=i[1]+n+i[3]}}while(i);return t}function Jm(t,e,i,n,r,o,s){if(void 0===n&&(n=km),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var a,l;if(o)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){a=u,l=[u.width,u.height],t.changed(),u.onload=null},u.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,l=[a.width,a.height])}))}for(var c,p=function(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=bm(t[i],e[t[i].ref]));return t}(e.layers),d={},f=[],y=0,g=p.length;y<g;++y){var m=p[y],v=m.id;if("string"==typeof i&&m.source==i||-1!==i.indexOf(v)){var _=m["source-layer"];if(!c){c=m.source;var x=e.sources[c];if(!x)throw new Error('Source "'+c+'" is not defined');var b=x.type;if("vector"!==b&&"geojson"!==b)throw new Error('Source "'+c+'" is not of type "vector" or "geojson", but "'+b+'"')}var w=d[_];w||(w=[],d[_]=w),w.push({layer:m,index:y}),f.push(v)}delete Xm[v],delete Ym[v]}var S=new Za,C=new Pa,T={},E={},k=[],P=function(t,e){var i=t.getProperties(),o=d[i.layer];if(o){var u=n.indexOf(e);-1==u&&(u=function(t,e){for(var i=0,n=e.length;i<n;++i)if(e[i]<t&&i+1<n){var r=e[i]/e[i+1];return i+Math.log(e[i]/t)/Math.log(r)}return n-1}(e,n));for(var h=Wm[t.getGeometry().getType()],c={properties:i,type:h},p=-1,f=function(n,d){var f=o[n],y=f.layer,g=y.id,m=y.layout||Vm,v=y.paint||Vm;if("none"===m.visibility||"minzoom"in y&&u<y.minzoom||"maxzoom"in y&&u>=y.maxzoom)return"continue";var _=y.filter;if(!_||function(t,e,i,n){return t in Ym||(Ym[t]=pm(e).filter),Um.zoom=n,Ym[t](Um,i)}(g,_,c,u)){var x=void 0,b=void 0,w=void 0,P=void 0,O=void 0,R=void 0,I=f.index;if(3==h&&("fill"==y.type||"fill-extrusion"==y.type))if(b=Km(y,"paint",y.type+"-opacity",u,c),y.type+"-pattern"in v){var F=Km(y,"paint",y.type+"-pattern",u,c);if(F){var j="string"==typeof F?$m(F,i):F.toString();if(a&&r&&r[j]){++p,(R=k[p])&&R.getFill()&&!R.getStroke()&&!R.getText()||(R=new sl({fill:new Pa}),k[p]=R),w=R.getFill(),R.setZIndex(I);var M=E[lt=j+"."+b];if(!M)(ct=(ht=Pm((ut=r[j]).width,ut.height)).getContext("2d")).globalAlpha=b,ct.drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height),M=ct.createPattern(ht,"repeat"),E[lt]=M;w.setColor(M)}}}else(x=Zm(Km(y,"paint",y.type+"-color",u,c),b))&&(y.type+"-outline-color"in v&&(O=Zm(Km(y,"paint",y.type+"-outline-color",u,c),b)),O||(O=x),++p,(R=k[p])&&R.getFill()&&R.getStroke()&&!R.getText()||(R=new sl({fill:new Pa,stroke:new Za}),k[p]=R),(w=R.getFill()).setColor(x),(P=R.getStroke()).setColor(O),P.setWidth(1),R.setZIndex(I));if(1!=h&&"line"==y.type){x=!("line-pattern"in v)&&"line-color"in v?Zm(Km(y,"paint","line-color",u,c),Km(y,"paint","line-opacity",u,c)):void 0;var A=Km(y,"paint","line-width",u,c);x&&A>0&&(++p,(R=k[p])&&R.getStroke()&&!R.getFill()&&!R.getText()||(R=new sl({stroke:new Za}),k[p]=R),(P=R.getStroke()).setLineCap(Km(y,"layout","line-cap",u,c)),P.setLineJoin(Km(y,"layout","line-join",u,c)),P.setMiterLimit(Km(y,"layout","line-miter-limit",u,c)),P.setColor(x),P.setWidth(A),P.setLineDash(v["line-dasharray"]?Km(y,"paint","line-dasharray",u,c).map((function(t){return t*A})):null),R.setZIndex(I))}var L=!1,D=null,z=0,G=void 0,N=void 0,B=void 0;if((1==h||2==h)&&"icon-image"in m){var W=Km(y,"layout","icon-image",u,c);if(W){G="string"==typeof W?$m(W,i):W.toString();var q=void 0;if(a&&r&&r[G]){var V=Km(y,"layout","icon-rotation-alignment",u,c);if(2==h){var U=t.getGeometry();if(U.getFlatMidpoint||U.getFlatMidpoints){var X=U.getExtent();if(Math.sqrt(Math.max(Math.pow((X[2]-X[0])/e,2),Math.pow((X[3]-X[1])/e,2)))>150){var K="MultiLineString"===U.getType()?U.getFlatMidpoints():U.getFlatMidpoint();if(Dm||(Dm=new Fl("Point",Lm=[NaN,NaN],[],{},null)),q=Dm,Lm[0]=K[0],Lm[1]=K[1],"line"===(It=Km(y,"layout","symbol-placement",u,c))&&"map"===V)for(var Y=U.getStride(),Z=U.getFlatCoordinates(),H=0,$=Z.length-Y;H<$;H+=Y){var J=Z[H],Q=Z[H+1],tt=Z[H+Y],et=Z[H+Y+1],it=Math.min(J,tt),nt=Math.min(Q,et),rt=Math.max(J,tt),ot=Math.max(Q,et);if(K[0]>=it&&K[0]<=rt&&K[1]>=nt&&K[1]<=ot){z=Math.atan2(Q-et,tt-J);break}}}}}if(2!==h||q){var st=Km(y,"layout","icon-size",u,c),at=void 0!==v["icon-color"]?Km(y,"paint","icon-color",u,c):null;if(!at||0!==at.a){var lt=G+"."+st;if(null!==at&&(lt+="."+at),!(N=T[lt])){var ut=r[G];if(null!==at){var ht,ct;(ct=(ht=Pm(ut.width,ut.height)).getContext("2d")).drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height);for(var pt=ct.getImageData(0,0,ht.width,ht.height),dt=0,ft=pt.data.length;dt<ft;dt+=4){var yt=at.a;0!==yt&&(pt.data[dt]=255*at.r/yt,pt.data[dt+1]=255*at.g/yt,pt.data[dt+2]=255*at.b/yt),pt.data[dt+3]=yt}ct.putImageData(pt,0,0),N=new Ya({img:ht,imgSize:[ht.width,ht.height],scale:st/ut.pixelRatio}),T[lt]=N}else N=new Ya({img:a,imgSize:l,size:[ut.width,ut.height],offset:[ut.x,ut.y],rotateWithView:"map"===V,scale:st/ut.pixelRatio}),T[lt]=N}}N&&(++p,(R=k[p])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new sl,k[p]=R),R.setGeometry(q),N.setRotation(z+Em(Km(y,"layout","icon-rotate",u,c))),N.setOpacity(Km(y,"paint","icon-opacity",u,c)),N.setAnchor(qm[Km(y,"layout","icon-anchor",u,c)]),R.setImage(N),D=R.getText(),R.setText(void 0),R.setZIndex(I),L=!0,B=!1)}else B=!0}}}if(1==h&&"circle-radius"in v){++p,(R=k[p])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new sl,k[p]=R);var gt=Km(y,"paint","circle-radius",u,c),mt=Zm(Km(y,"paint","circle-stroke-color",u,c),Km(y,"paint","circle-stroke-opacity",u,c)),vt=Zm(Km(y,"paint","circle-color",u,c),Km(y,"paint","circle-opacity",u,c)),_t=Km(y,"paint","circle-stroke-width",u,c),xt=gt+"."+mt+"."+vt+"."+_t;(N=T[xt])||(N=new tl({radius:gt,stroke:mt&&_t>0?new Za({width:_t,color:mt}):void 0,fill:vt?new Pa({color:vt}):void 0}),T[xt]=N),R.setImage(N),D=R.getText(),R.setText(void 0),R.setGeometry(void 0),R.setZIndex(I),L=!0}var bt=void 0;if("text-field"in m)bt=$m(Km(y,"layout","text-field",u,c).toString(),i).trim(),b=Km(y,"paint","text-opacity",u,c);if(bt&&b&&!B){L||(++p,(R=k[p])&&R.getText()&&!R.getFill()&&!R.getStroke()||(R=new sl,k[p]=R),R.setImage(void 0),R.setGeometry(void 0)),R.getText()||R.setText(D||new ul({padding:[2,2,2,2]})),D=R.getText();var wt=Math.round(Km(y,"layout","text-size",u,c)),St=Km(y,"layout","text-font",u,c),Ct=Km(y,"layout","text-line-height",u,c),Tt=function(t,e,i){var n=vd[t];if(!n){Array.isArray(t)||(t=[t]);for(var r=400,o="normal",s=[],a=0,l=t.length;a<l;++a){var u=t[a].split(" "),h=u[u.length-1].toLowerCase();for(var c in"normal"==h||"italic"==h||"oblique"==h?(o=h,u.pop(),h=u[u.length-1].toLowerCase()):md.test(h)&&(h=h.replace(md,""),o=u[u.length-1].replace(h,"")),gd)if(h==c||h==c.replace("-","")||h==c.replace("-"," ")){r=gd[c],u.pop();break}"number"==typeof h&&(r=h);var p=u.join(" ").replace("Klokantech Noto Sans","Noto Sans");-1!==p.indexOf(" ")&&(p='"'+p+'"'),s.push(p)}n=vd[t]=[o,r,s]}return n[0]+" "+n[1]+" "+e+"px"+(i?"/"+i:"")+" "+n[2]}(s?s(St):St,wt,Ct),Et=m["text-transform"];"uppercase"==Et?bt=bt.toUpperCase():"lowercase"==Et&&(bt=bt.toLowerCase());var kt=Km(y,"layout","text-max-width",u,c),Pt=Km(y,"layout","text-letter-spacing",u,c),Ot=2==h?Im(bt,Pt):Am(bt,Tt,kt,Pt);D.setText(Ot),D.setFont(Tt),D.setRotation(Em(Km(y,"layout","text-rotate",u,c)));var Rt=Km(y,"layout","text-anchor",u,c),It=L||1==h?"point":Km(y,"layout","symbol-placement",u,c);D.setPlacement(It);var Ft=Km(y,"paint","text-halo-width",u,c),jt=Km(y,"layout","text-offset",u,c),Mt=Km(y,"paint","text-translate",u,c),At=0,Lt=0;if("point"==It){var Dt="center";-1!==Rt.indexOf("left")?(Dt="left",Lt=Ft):-1!==Rt.indexOf("right")&&(Dt="right",Lt=-Ft),D.setTextAlign(Dt);var zt=Km(y,"layout","text-rotation-alignment",u,c);D.setRotateWithView("map"==zt)}else D.setMaxAngle(Em(Km(y,"layout","text-max-angle",u,c))*bt.length/Ot.length),D.setTextAlign(),D.setRotateWithView(!1);var Gt="middle";0==Rt.indexOf("bottom")?(Gt="bottom",At=-Ft-.5*(Ct-1)*wt):0==Rt.indexOf("top")&&(Gt="top",At=Ft+.5*(Ct-1)*wt),D.setTextBaseline(Gt),D.setOffsetX(jt[0]*wt+Lt+Mt[0]),D.setOffsetY(jt[1]*wt+At+Mt[1]),C.setColor(Zm(Km(y,"paint","text-color",u,c),b)),D.setFill(C);var Nt=Zm(Km(y,"paint","text-halo-color",u,c),b);if(Nt){S.setColor(Nt),Ft*=2;var Bt=.5*wt;S.setWidth(Ft<=Bt?Ft:Bt),D.setStroke(S)}else D.setStroke(void 0);var Wt=Km(y,"layout","text-padding",u,c),qt=D.getPadding();Wt!==qt[0]&&(qt[0]=Wt,qt[1]=Wt,qt[2]=Wt,qt[3]=Wt),R.setZIndex(I)}}},y=0,g=o.length;y<g;++y)f(y);return p>-1?(k.length=p+1,k):void 0}};return t.setStyle(P),t.set("mapbox-source",c),t.set("mapbox-layers",f),P}var Qm,tv=Object.freeze,ev=Object.defineProperty,iv=Object.getOwnPropertyDescriptor,nv=(t,e,i,n)=>{for(var r,o=n>1?void 0:n?iv(e,i):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(n?r(e,i,o):r(o))||o);return n&&o&&ev(e,i,o),o};let rv=class extends ht{constructor(){super(),this.id="map",this.latitude=51.507351,this.longitude=-.127758,this.zoom=10,this.minZoom=7,this.maxZoom=22,this.drawMode=!1,this.drawGeojsonData={type:"Feature",geometry:{}},this.drawGeojsonDataBuffer=100,this.drawPointer="crosshair",this.showFeaturesAtPoint=!1,this.clickFeatures=!1,this.featureColor="#0000ff",this.featureFill=!1,this.featureBuffer=40,this.geojsonData={type:"FeatureCollection",features:[]},this.geojsonColor="#ff0000",this.geojsonFill=!1,this.geojsonBuffer=12,this.disableVectorTiles=!1,this.osVectorTilesApiKey="",this.osFeaturesApiKey="",this.osCopyright=`© Crown copyright and database rights ${(new Date).getFullYear()} OS (0)100024857`,this.hideResetControl=!1,this.staticMode=!1,this.areaUnit="m2",this.showScale=!1,this.useScaleBarStyle=!1,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}firstUpdated(){var t;const e=this.renderRoot.querySelector(`#${this.id}`),i=!this.disableVectorTiles&&Boolean(this.osVectorTilesApiKey),n=(r=this.osCopyright,o=this.osVectorTilesApiKey,new yd({source:o?new xd({url:"https://api.os.uk/maps/raster/v1/zxy/Light_3857/{z}/{x}/{y}.png?key="+o,attributions:[r],attributionsCollapsible:!1,maxZoom:20}):new Sd({attributions:[wd]})}));var r,o;const s=function(t,e){let i=new fp({declutter:!0,source:new Yp({format:new zl,url:"https://api.os.uk/maps/vector/v1/vts/tile/{z}/{y}/{x}.pbf?srs=3857&key="+e,attributions:[t],attributionsCollapsible:!1})});return e&&fetch("https://api.os.uk/maps/vector/v1/vts/resources/styles?srs=3857&key="+e).then((t=>t.json())).then((t=>Jm(i,t,"esri"))).catch((t=>console.log(t))),i}(this.osCopyright,this.osVectorTilesApiKey),a=new $p({target:e,layers:[i?s:n],view:new zs({projection:"EPSG:3857",extent:(u=[-10.76418,49.528423,1.9134116,61.331151],h="EPSG:4326",c="EPSG:3857",kn(u,nr(h,c),void 0,p)),minZoom:this.minZoom,maxZoom:this.maxZoom,center:tr([this.longitude,this.latitude]),zoom:this.zoom,enableRotation:!1}),controls:$s({attribution:!0,zoom:!this.staticMode}).extend(this.showScale?[(l=this.useScaleBarStyle,new Hs({units:"metric",bar:l,steps:4,text:!0,minWidth:140}))]:[]),interactions:$c({doubleClickZoom:!this.staticMode,dragPan:!this.staticMode,mouseWheelZoom:!this.staticMode})});var l,u,h,c,p;this.map=a;const d=(f=this.drawPointer,new Lc({source:Ld,type:"Polygon",style:new sl({stroke:Id,fill:Fd,image:"crosshair"===f?jd:Md})}));var f;const y=function(t){return new Xc({source:Ld,style:new sl({image:"crosshair"===t?jd:Md})})}(this.drawPointer),g=document.createElement("button");g.innerHTML="↻",g.title="Reset map view";g.addEventListener("click",(()=>{this.showFeaturesAtPoint?Ff(a,Af,this.featureBuffer):x.getFeatures().length>0?Ff(a,x,this.geojsonBuffer):(a.getView().setCenter(tr([this.longitude,this.latitude])),a.getView().setZoom(this.zoom)),this.drawMode&&(Ld.clear(),this.dispatch("geojsonChange",{}),this.dispatch("areaChange",`0 ${"m2"===this.areaUnit?"m²":this.areaUnit}`),a.addInteraction(d),a.addInteraction(zd))}),!1);const m=document.createElement("div");m.className="reset-control ol-unselectable ol-control",m.appendChild(g);var v=new ge({element:m});this.hideResetControl||a.addControl(v);const _=null==(t=this.renderRoot)?void 0:t.querySelectorAll(".ol-control button");null==_||_.forEach((t=>t.setAttribute("aria-label",t.getAttribute("title")||""))),a.on("pointerdrag",(()=>{a.getViewport().style.cursor="grabbing"})),a.on("pointermove",(()=>{a.getViewport().style.cursor="grab"}));const x=new Ec;if("FeatureCollection"===this.geojsonData.type){let t=(new ka).readFeatures(this.geojsonData,{featureProjection:"EPSG:3857"});x.addFeatures(t)}else if("Feature"===this.geojsonData.type){let t=(new ka).readFeature(this.geojsonData,{featureProjection:"EPSG:3857"});x.addFeature(t)}const b=new uc({source:x,style:new sl({stroke:new Za({color:this.geojsonColor,width:3}),fill:new Pa({color:this.geojsonFill?jf(this.geojsonColor,.2):jf(this.geojsonColor,0)})})});if(a.addLayer(b),x.getFeatures().length>0){Ff(a,x,this.geojsonBuffer);const t=x.getFeatures()[0].getGeometry();t&&this.dispatch("geojsonDataArea",If(t,this.areaUnit))}if(this.drawMode){Ld.clear();const t=Object.keys(this.drawGeojsonData.geometry).length>0;if(t){let t=(new ka).readFeature(this.drawGeojsonData,{featureProjection:"EPSG:3857"});Ld.addFeature(t),Ff(a,Ld,this.drawGeojsonDataBuffer)}a.addLayer(Dd),t||a.addInteraction(d),a.addInteraction(y),a.addInteraction(zd),Ld.on("change",(()=>{var t;const e=Ld.getFeatures();if(e.length>0){const n=null==(t="string"==typeof(i=e)?i[i.length-1]||"":i[i.length-1])?void 0:t.getGeometry();this.dispatch("geojsonChange",(new ka).writeFeaturesObject(e,{featureProjection:"EPSG:3857"})),n&&this.dispatch("areaChange",If(n,this.areaUnit)),a.removeInteraction(d)}var i}))}if(this.drawMode&&Boolean(this.osVectorTilesApiKey)&&!this.disableVectorTiles&&(a.addLayer(kd),Dd.setZIndex(1001),a.on("moveend",(()=>{const t=a.getView().getZoom();t&&t<20?Ed.clear():setTimeout((()=>{Ed.clear();const t=a.getView().calculateExtent(a.getSize());Pd(s,t)}),200)}))),this.showFeaturesAtPoint&&Boolean(this.osFeaturesApiKey)){Lf(tr([this.longitude,this.latitude]),this.osFeaturesApiKey,!1),this.clickFeatures&&a.on("singleclick",(t=>{Lf(t.coordinate,this.osFeaturesApiKey,!0)}));const t=(w=this.featureColor,S=this.featureFill,new uc({source:Af,style:new sl({stroke:new Za({width:3,color:w}),fill:new Pa({color:jf(w,S?.2:0)})})}));a.addLayer(t),Af.on("change",(()=>{if("ready"===Af.getState()&&Af.getFeatures().length>0){Ff(a,Af,this.featureBuffer),this.dispatch("featuresGeojsonChange",(new ka).writeFeaturesObject(Af.getFeatures(),{featureProjection:"EPSG:3857"}));const t=Af.getFeatures()[0].getGeometry();t&&this.dispatch("featuresAreaChange",If(t,this.areaUnit))}}))}var w,S;setTimeout((()=>{window.dispatchEvent(new Event("resize")),e.style.opacity="1",this.dispatch("ready")}),500)}render(){return q(Qm||(Qm=tv(ev(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <link rel="stylesheet" href="https://cdn.skypack.dev/ol@^6.6.1/ol.css" />\n <div id="','" class="map" tabindex="0" />'],"raw",{value:tv(e||t.slice())}))),this.id);var t,e}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.map)||t.dispose()}};var ov;rv.styles=((t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(t instanceof c)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return d(i)})`
41
+ Gf((function(t,e){!function(i){var n=e&&!e.nodeType&&e,r=t&&!t.nodeType&&t,o="object"==typeof zf&&zf;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var s,a,l=2147483647,u=36,h=/^xn--/,c=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,y=String.fromCharCode;function g(t){throw RangeError(d[t])}function m(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function v(t,e){var i=t.split("@"),n="";return i.length>1&&(n=i[0]+"@",t=i[1]),n+m((t=t.replace(p,".")).split("."),e).join(".")}function _(t){for(var e,i,n=[],r=0,o=t.length;r<o;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<o?56320==(64512&(i=t.charCodeAt(r++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),r--):n.push(e);return n}function x(t){return m(t,(function(t){var e="";return t>65535&&(e+=y((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=y(t)})).join("")}function b(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function w(t,e,i){var n=0;for(t=i?f(t/700):t>>1,t+=f(t/e);t>455;n+=u)t=f(t/35);return f(n+36*t/(t+38))}function S(t){var e,i,n,r,o,s,a,h,c,p,d,y=[],m=t.length,v=0,_=128,b=72;for((i=t.lastIndexOf("-"))<0&&(i=0),n=0;n<i;++n)t.charCodeAt(n)>=128&&g("not-basic"),y.push(t.charCodeAt(n));for(r=i>0?i+1:0;r<m;){for(o=v,s=1,a=u;r>=m&&g("invalid-input"),((h=(d=t.charCodeAt(r++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||h>f((l-v)/s))&&g("overflow"),v+=h*s,!(h<(c=a<=b?1:a>=b+26?26:a-b));a+=u)s>f(l/(p=u-c))&&g("overflow"),s*=p;b=w(v-o,e=y.length+1,0==o),f(v/e)>l-_&&g("overflow"),_+=f(v/e),v%=e,y.splice(v++,0,_)}return x(y)}function C(t){var e,i,n,r,o,s,a,h,c,p,d,m,v,x,S,C=[];for(m=(t=_(t)).length,e=128,i=0,o=72,s=0;s<m;++s)(d=t[s])<128&&C.push(y(d));for(n=r=C.length,r&&C.push("-");n<m;){for(a=l,s=0;s<m;++s)(d=t[s])>=e&&d<a&&(a=d);for(a-e>f((l-i)/(v=n+1))&&g("overflow"),i+=(a-e)*v,e=a,s=0;s<m;++s)if((d=t[s])<e&&++i>l&&g("overflow"),d==e){for(h=i,c=u;!(h<(p=c<=o?1:c>=o+26?26:c-o));c+=u)S=h-p,x=u-p,C.push(y(b(p+S%x,0))),h=f(S/x);C.push(y(b(h,0))),o=w(i,v,n==r),i=0,++n}++i,++e}return C.join("")}if(s={version:"1.3.2",ucs2:{decode:_,encode:x},decode:S,encode:C,toASCII:function(t){return v(t,(function(t){return c.test(t)?"xn--"+C(t):t}))},toUnicode:function(t){return v(t,(function(t){return h.test(t)?S(t.slice(4).toLowerCase()):t}))}},n&&r)if(t.exports==n)r.exports=s;else for(a in s)s.hasOwnProperty(a)&&(n[a]=s[a]);else i.punycode=s}(zf)}));var Bf=function(t,e,i,n){e=e||"&",i=i||"=";var r={};if("string"!=typeof t||0===t.length)return r;var o=/\+/g;t=t.split(e);var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var l=0;l<a;++l){var u,h,c,p,d=t[l].replace(o,"%20"),f=d.indexOf(i);f>=0?(u=d.substr(0,f),h=d.substr(f+1)):(u=d,h=""),c=decodeURIComponent(u),p=decodeURIComponent(h),Nf(r,c)?Array.isArray(r[c])?r[c].push(p):r[c]=[r[c],p]:r[c]=p}return r},Wf=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},qf=function(t,e,i,n){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(n){var r=encodeURIComponent(Wf(n))+i;return Array.isArray(t[n])?t[n].map((function(t){return r+encodeURIComponent(Wf(t))})).join(e):r+encodeURIComponent(Wf(t[n]))})).join(e):n?encodeURIComponent(Wf(n))+i+encodeURIComponent(Wf(t)):""};Gf((function(t,e){e.decode=e.parse=Bf,e.encode=e.stringify=qf}));class Vf extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Uf{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[i,n]of e)this.bindings[i]=n}concat(t){return new Uf(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const Xf={kind:"null"},Kf={kind:"number"},Yf={kind:"string"},Zf={kind:"boolean"},Hf={kind:"color"},$f={kind:"object"},Jf={kind:"value"},Qf={kind:"collator"},ty={kind:"formatted"},ey={kind:"resolvedImage"};function iy(t,e){return{kind:"array",itemType:t,N:e}}function ny(t){if("array"===t.kind){const e=ny(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const ry=[Xf,Kf,Yf,Zf,Hf,ty,$f,iy(Jf),ey];function oy(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!oy(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of ry)if(!oy(t,e))return null}return`Expected ${ny(t)} but found ${ny(e)} instead.`}function sy(t,e){return e.some((e=>e.kind===t.kind))}function ay(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}var ly=Gf((function(t,e){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 n(t){return(t=Math.round(t))<0?0:t>255?255:t}function r(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function s(t){return"%"===t[t.length-1]?r(parseFloat(t)/100):r(parseFloat(t))}function a(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in i)return i[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=r.indexOf("("),u=r.indexOf(")");if(-1!==l&&u+1===r.length){var h=r.substr(0,l),c=r.substr(l+1,u-(l+1)).split(","),p=1;switch(h){case"rgba":if(4!==c.length)return null;p=s(c.pop());case"rgb":return 3!==c.length?null:[o(c[0]),o(c[1]),o(c[2]),p];case"hsla":if(4!==c.length)return null;p=s(c.pop());case"hsl":if(3!==c.length)return null;var d=(parseFloat(c[0])%360+360)%360/360,f=s(c[1]),y=s(c[2]),g=y<=.5?y*(f+1):y+f-y*f,m=2*y-g;return[n(255*a(m,g,d+1/3)),n(255*a(m,g,d)),n(255*a(m,g,d-1/3)),p];default:return null}}return null}}catch(l){}}));class uy{constructor(t,e,i,n=1){this.r=t,this.g=e,this.b=i,this.a=n}static parse(t){if(!t)return;if(t instanceof uy)return t;if("string"!=typeof t)return;const e=ly.parseCSSColor(t);return e?new uy(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,n]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${n})`}toArray(){const{r:t,g:e,b:i,a:n}=this;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*i/n,n]}}uy.black=new uy(0,0,0,1),uy.white=new uy(1,1,1,1),uy.transparent=new uy(0,0,0,0),uy.red=new uy(1,0,0,1),uy.blue=new uy(0,0,1,1);class hy{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class cy{constructor(t,e,i,n,r){this.text=t,this.image=e,this.scale=i,this.fontStack=n,this.textColor=r}}class py{constructor(t){this.sections=t}static fromString(t){return new py([new cy(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof py?t:py.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const i={};e.fontStack&&(i["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(i["font-scale"]=e.scale),e.textColor&&(i["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(i)}return t}}class dy{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new dy({name:t,available:!1}):null}serialize(){return["image",this.name]}}function fy(t,e,i,n){if(!("number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255)){return`Invalid rgba value [${("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`}function yy(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 uy)return!0;if(t instanceof hy)return!0;if(t instanceof py)return!0;if(t instanceof dy)return!0;if(Array.isArray(t)){for(const e of t)if(!yy(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!yy(t[e]))return!1;return!0}return!1}function gy(t){if(null===t)return Xf;if("string"==typeof t)return Yf;if("boolean"==typeof t)return Zf;if("number"==typeof t)return Kf;if(t instanceof uy)return Hf;if(t instanceof hy)return Qf;if(t instanceof py)return ty;if(t instanceof dy)return ey;if(Array.isArray(t)){const e=t.length;let i;for(const n of t){const t=gy(n);if(i){if(i===t)continue;i=Jf;break}i=t}return iy(i||Jf,e)}return $f}function my(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof uy||t instanceof py||t instanceof dy?t.toString():JSON.stringify(t)}class vy{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!yy(t[1]))return e.error("invalid value");const i=t[1];let n=gy(i);const r=e.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new vy(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof uy?["rgba"].concat(this.value.toArray()):this.value instanceof py?this.value.serialize():this.value}}class _y{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const xy={string:Yf,number:Kf,boolean:Zf,object:$f};class by{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,n=1;const r=t[0];if("array"===r){let r,o;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in xy)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=xy[i],n++}else r=Jf;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}i=iy(r,o)}else i=xy[r];const o=[];for(;n<t.length;n++){const i=e.parse(t[n],n,Jf);if(!i)return null;o.push(i)}return new by(i,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!oy(this.type,gy(i)))return i;if(e===this.args.length-1)throw new _y(`Expected value to be of type ${ny(this.type)}, but found ${ny(gy(i))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);const n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((t=>t.serialize())))}}class wy{constructor(t){this.type=ty,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const n=[];let r=!1;for(let o=1;o<=t.length-1;++o){const i=t[o];if(r&&"object"==typeof i&&!Array.isArray(i)){r=!1;let t=null;if(i["font-scale"]&&(t=e.parse(i["font-scale"],1,Kf),!t))return null;let o=null;if(i["text-font"]&&(o=e.parse(i["text-font"],1,iy(Yf)),!o))return null;let s=null;if(i["text-color"]&&(s=e.parse(i["text-color"],1,Hf),!s))return null;const a=n[n.length-1];a.scale=t,a.font=o,a.textColor=s}else{const i=e.parse(t[o],1,Jf);if(!i)return null;const s=i.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,n.push({content:i,scale:null,font:null,textColor:null})}}return new wy(n)}evaluate(t){return new py(this.sections.map((e=>{const i=e.content.evaluate(t);return gy(i)===ey?new cy("",i,null,null,null):new cy(my(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const i={};e.scale&&(i["font-scale"]=e.scale.serialize()),e.font&&(i["text-font"]=e.font.serialize()),e.textColor&&(i["text-color"]=e.textColor.serialize()),t.push(i)}return t}}class Sy{constructor(t){this.type=ey,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Yf);return i?new Sy(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=dy.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Cy={"to-boolean":Zf,"to-color":Hf,"to-number":Kf,"to-string":Yf};class Ty{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const n=Cy[i],r=[];for(let o=1;o<t.length;o++){const i=e.parse(t[o],o,Jf);if(!i)return null;r.push(i)}return new Ty(n,r)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const n of this.args){if(e=n.evaluate(t),i=null,e instanceof uy)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:fy(e[0],e[1],e[2],e[3]),!i))return new uy(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new _y(i||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new _y(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?py.fromString(my(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?dy.fromString(my(this.args[0].evaluate(t))):my(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new wy([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Sy(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}const Ey=["Unknown","Point","LineString","Polygon"];class ky{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Ey[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=uy.parse(t)),e}}class Py{constructor(t,e,i,n){this.name=t,this.type=e,this._evaluate=i,this.args=n}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const i=t[0],n=Py.definitions[i];if(!n)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let a=null;for(const[l,u]of s){a=new $y(e.registry,e.path,null,e.scope);const n=[];let o=!1;for(let e=1;e<t.length;e++){const i=t[e],r=Array.isArray(l)?l[e-1]:l.type,s=a.parse(i,1+n.length,r);if(!s){o=!0;break}n.push(s)}if(!o)if(Array.isArray(l)&&l.length!==n.length)a.error(`Expected ${l.length} arguments, but found ${n.length} instead.`);else{for(let t=0;t<n.length;t++){const e=Array.isArray(l)?l[t]:l.type,i=n[t];a.concat(t+1).checkSubtype(e,i.type)}if(0===a.errors.length)return new Py(i,r,u,n)}}if(1===s.length)e.errors.push(...a.errors);else{const i=(s.length?s:o).map((([t])=>{return e=t,Array.isArray(e)?`(${e.map(ny).join(", ")})`:`(${ny(e.type)}...)`;var e})).join(" | "),n=[];for(let r=1;r<t.length;r++){const i=e.parse(t[r],1+n.length);if(!i)return null;n.push(ny(i.type))}e.error(`Expected arguments of type ${i}, but found (${n.join(", ")}) instead.`)}return null}static register(t,e){Py.definitions=e;for(const i in e)t[i]=Py}}class Oy{constructor(t,e,i){this.type=Qf,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const n=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Zf);if(!n)return null;const r=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Zf);if(!r)return null;let o=null;return i.locale&&(o=e.parse(i.locale,1,Yf),!o)?null:new Oy(n,r,o)}evaluate(t){return new hy(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}function Ry(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Iy(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Fy(t,e){const i=(180+t[0])/360;const n=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360);var r;const o=Math.pow(2,e.z);return[Math.round(i*o*8192),Math.round(n*o*8192)]}function jy(t,e,i){const n=t[0]-e[0],r=t[1]-e[1],o=t[0]-i[0],s=t[1]-i[1];return n*s-o*r==0&&n*o<=0&&r*s<=0}function My(t,e){let i=!1;for(let s=0,a=e.length;s<a;s++){const a=e[s];for(let e=0,s=a.length;e<s-1;e++){if(jy(t,a[e],a[e+1]))return!1;n=t,r=a[e],o=a[e+1],r[1]>n[1]!=o[1]>n[1]&&n[0]<(o[0]-r[0])*(n[1]-r[1])/(o[1]-r[1])+r[0]&&(i=!i)}}var n,r,o;return i}function Ay(t,e){for(let i=0;i<e.length;i++)if(My(t,e[i]))return!0;return!1}function Ly(t,e,i,n){const r=t[0]-i[0],o=t[1]-i[1],s=e[0]-i[0],a=e[1]-i[1],l=n[0]-i[0],u=n[1]-i[1],h=r*u-l*o,c=s*u-l*a;return h>0&&c<0||h<0&&c>0}function Dy(t,e,i,n){const r=[e[0]-t[0],e[1]-t[1]],o=[n[0]-i[0],n[1]-i[1]];return 0!=(s=o)[0]*(a=r)[1]-s[1]*a[0]&&!(!Ly(t,e,i,n)||!Ly(i,n,t,e));var s,a}function zy(t,e,i){for(const n of i)for(let i=0;i<n.length-1;++i)if(Dy(t,e,n[i],n[i+1]))return!0;return!1}function Gy(t,e){for(let i=0;i<t.length;++i)if(!My(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(zy(t[i],t[i+1],e))return!1;return!0}function Ny(t,e){for(let i=0;i<e.length;i++)if(Gy(t,e[i]))return!0;return!1}function By(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=[];for(let n=0;n<t[r].length;n++){const s=Fy(t[r][n],i);Ry(e,s),o.push(s)}n.push(o)}return n}function Wy(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=By(t[r],e,i);n.push(o)}return n}function qy(t,e,i,n){if(t[0]<i[0]||t[0]>i[2]){const e=.5*n;let r=t[0]-i[0]>e?-n:i[0]-t[0]>e?n:0;0===r&&(r=t[0]-i[2]>e?-n:i[2]-t[0]>e?n:0),t[0]+=r}Ry(e,t)}function Vy(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];for(const a of t)for(const t of a){const n=[t.x+o[0],t.y+o[1]];qy(n,e,i,r),s.push(n)}return s}function Uy(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];for(const l of t){const t=[];for(const i of l){const n=[i.x+o[0],i.y+o[1]];Ry(e,n),t.push(n)}s.push(t)}if(e[2]-e[0]<=r/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of s)for(const n of t)qy(n,e,i,r)}var a;return s}class Xy{constructor(t,e){this.type=Zf,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(yy(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const i=e.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Xy(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new Xy(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new Xy(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const o=By(e.coordinates,n,r),s=Vy(t.geometry(),i,n,r);if(!Iy(i,n))return!1;for(const t of s)if(!My(t,o))return!1}if("MultiPolygon"===e.type){const o=Wy(e.coordinates,n,r),s=Vy(t.geometry(),i,n,r);if(!Iy(i,n))return!1;for(const t of s)if(!Ay(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const o=By(e.coordinates,n,r),s=Uy(t.geometry(),i,n,r);if(!Iy(i,n))return!1;for(const t of s)if(!Gy(t,o))return!1}if("MultiPolygon"===e.type){const o=Wy(e.coordinates,n,r),s=Uy(t.geometry(),i,n,r);if(!Iy(i,n))return!1;for(const t of s)if(!Ny(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Ky(t){if(t instanceof Py){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Xy)return!1;let e=!0;return t.eachChild((t=>{e&&!Ky(t)&&(e=!1)})),e}function Yy(t){if(t instanceof Py&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!Yy(t)&&(e=!1)})),e}function Zy(t,e){if(t instanceof Py&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!Zy(t,e)&&(i=!1)})),i}class Hy{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new Hy(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class $y{constructor(t,e=[],i,n=new Uf,r=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=n,this.errors=r,this.expectedType=i}parse(t,e,i,n,r={}){return e?this.concat(e,i,n)._parse(t,r):this._parse(t,r)}_parse(t,e){function i(t,e,i){return"assert"===i?new by(e,[t]):"coerce"===i?new Ty(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[r];if(o){let r=o.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,n=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(t,n))return null}else r=i(r,t,e.typeAnnotation||"coerce");else r=i(r,t,e.typeAnnotation||"assert")}if(!(r instanceof vy)&&"resolvedImage"!==r.type.kind&&Jy(r)){const t=new ky;try{r=new vy(r.type,r.evaluate(t))}catch(n){return this.error(n.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof t} instead.`)}concat(t,e,i){const n="number"==typeof t?this.path.concat(t):this.path,r=i?this.scope.concat(i):this.scope;return new $y(this.registry,n,e||null,r,this.errors)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new Vf(i,t))}checkSubtype(t,e){const i=oy(t,e);return i&&this.error(i),i}}function Jy(t){if(t instanceof Hy)return Jy(t.boundExpression);if(t instanceof Py&&"error"===t.name)return!1;if(t instanceof Oy)return!1;if(t instanceof Xy)return!1;const e=t instanceof Ty||t instanceof by;let i=!0;return t.eachChild((t=>{i=e?i&&Jy(t):i&&t instanceof vy})),!!i&&(Ky(t)&&Zy(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script"]))}function Qy(t,e){const i=t.length-1;let n,r,o=0,s=i,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=t[a],r=t[a+1],n<=e){if(a===i||e<r)return a;o=a+1}else{if(!(n>e))throw new _y("Input is not a number.");s=a-1}return 0}class tg{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[n,r]of i)this.labels.push(n),this.outputs.push(r)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const i=e.parse(t[1],1,Kf);if(!i)return null;const n=[];let r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(let o=1;o<t.length;o+=2){const i=1===o?-1/0:t[o],s=t[o+1],a=o,l=o+1;if("number"!=typeof i)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(n.length&&n[n.length-1][0]>=i)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const u=e.parse(s,l,r);if(!u)return null;r=r||u.type,n.push([i,u])}return new tg(r,i,n)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);return i[Qy(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var eg=ig;function ig(t,e,i,n){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=i,this.p2y=n}function ng(t,e,i){return t*(1-i)+e*i}ig.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},ig.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},ig.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},ig.prototype.solveCurveX=function(t,e){var i,n,r,o,s;for(void 0===e&&(e=1e-6),r=t,s=0;s<8;s++){if(o=this.sampleCurveX(r)-t,Math.abs(o)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}if((r=t)<(i=0))return i;if(r>(n=1))return n;for(;i<n;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?i=r:n=r,r=.5*(n-i)+i}return r},ig.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var rg=Object.freeze({__proto__:null,number:ng,color:function(t,e,i){return new uy(ng(t.r,e.r,i),ng(t.g,e.g,i),ng(t.b,e.b,i),ng(t.a,e.a,i))},array:function(t,e,i){return t.map(((t,n)=>ng(t,e[n],i)))}});const og=4/29,sg=6/29,ag=3*sg*sg,lg=Math.PI/180,ug=180/Math.PI;function hg(t){return t>.008856451679035631?Math.pow(t,1/3):t/ag+og}function cg(t){return t>sg?t*t*t:ag*(t-og)}function pg(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function dg(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fg(t){const e=dg(t.r),i=dg(t.g),n=dg(t.b),r=hg((.4124564*e+.3575761*i+.1804375*n)/.95047),o=hg((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-hg((.0193339*e+.119192*i+.9503041*n)/1.08883)),alpha:t.a}}function yg(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*cg(e),i=.95047*cg(i),n=1.08883*cg(n),new uy(pg(3.2404542*i-1.5371385*e-.4985314*n),pg(-.969266*i+1.8760108*e+.041556*n),pg(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function gg(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const mg={forward:fg,reverse:yg,interpolate:function(t,e,i){return{l:ng(t.l,e.l,i),a:ng(t.a,e.a,i),b:ng(t.b,e.b,i),alpha:ng(t.alpha,e.alpha,i)}}},vg={forward:function(t){const{l:e,a:i,b:n}=fg(t),r=Math.atan2(n,i)*ug;return{h:r<0?r+360:r,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*lg,i=t.c;return yg({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:gg(t.h,e.h,i),c:ng(t.c,e.c,i),l:ng(t.l,e.l,i),alpha:ng(t.alpha,e.alpha,i)}}};class _g{constructor(t,e,i,n,r){this.type=t,this.operator=e,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(const[o,s]of r)this.labels.push(o),this.outputs.push(s)}static interpolationFactor(t,e,i,n){let r=0;if("exponential"===t.name)r=xg(e,t.base,i,n);else if("linear"===t.name)r=xg(e,1,i,n);else if("cubic-bezier"===t.name){const o=t.controlPoints;r=new eg(o[0],o[1],o[2],o[3]).solve(xg(e,1,i,n))}return r}static parse(t,e){let[i,n,r,...o]=t;if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t}}else{if("cubic-bezier"!==n[0])return e.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const t=n.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(r=e.parse(r,2,Kf),!r)return null;const s=[];let a=null;"interpolate-hcl"===i||"interpolate-lab"===i?a=Hf:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let l=0;l<o.length;l+=2){const t=o[l],i=o[l+1],n=l+3,r=l+4;if("number"!=typeof t)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(s.length&&s[s.length-1][0]>=t)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const u=e.parse(i,r,a);if(!u)return null;a=a||u.type,s.push([t,u])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new _g(a,i,n,r,s):e.error(`Type ${ny(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);const o=Qy(e,n),s=e[o],a=e[o+1],l=_g.interpolationFactor(this.interpolation,n,s,a),u=i[o].evaluate(t),h=i[o+1].evaluate(t);return"interpolate"===this.operator?rg[this.type.kind.toLowerCase()](u,h,l):"interpolate-hcl"===this.operator?vg.reverse(vg.interpolate(vg.forward(u),vg.forward(h),l)):mg.reverse(mg.interpolate(mg.forward(u),mg.forward(h),l))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let 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);const e=[this.operator,t,this.input.serialize()];for(let i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e}}function xg(t,e,i,n){const r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}class bg{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let i=null;const n=e.expectedType;n&&"value"!==n.kind&&(i=n);const r=[];for(const s of t.slice(1)){const t=e.parse(s,1+r.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,r.push(t)}const o=n&&r.some((t=>oy(n,t.type)));return new bg(o?Jf:i,r)}evaluate(t){let e,i=null,n=0;for(const r of this.args)if(n++,i=r.evaluate(t),i&&i instanceof dy&&!i.available&&(e||(e=i.name),i=null,n===this.args.length&&(i=e)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class wg{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let r=1;r<t.length-1;r+=2){const n=t[r];if("string"!=typeof n)return e.error(`Expected string, but found ${typeof n} instead.`,r);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);const o=e.parse(t[r+1],r+1);if(!o)return null;i.push([n,o])}const n=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return n?new wg(i,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,i]of this.bindings)t.push(e,i.serialize());return t.push(this.result.serialize()),t}}class Sg{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Kf),n=e.parse(t[2],2,iy(e.expectedType||Jf));if(!i||!n)return null;const r=n.type;return new Sg(r.itemType,i,n)}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new _y(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new _y(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new _y(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class Cg{constructor(t,e){this.type=Zf,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Jf),n=e.parse(t[2],2,Jf);return i&&n?sy(i.type,[Zf,Yf,Kf,Xf,Jf])?new Cg(i,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${ny(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!ay(e,["boolean","string","number","null"]))throw new _y(`Expected first argument to be of type boolean, string, number or null, but found ${ny(gy(e))} instead.`);if(!ay(i,["string","array"]))throw new _y(`Expected second argument to be of type array or string, but found ${ny(gy(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class Tg{constructor(t,e,i){this.type=Kf,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Jf),n=e.parse(t[2],2,Jf);if(!i||!n)return null;if(!sy(i.type,[Zf,Yf,Kf,Xf,Jf]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${ny(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,Kf);return r?new Tg(i,n,r):null}return new Tg(i,n)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!ay(e,["boolean","string","number","null"]))throw new _y(`Expected first argument to be of type boolean, string, number or null, but found ${ny(gy(e))} instead.`);if(!ay(i,["string","array"]))throw new _y(`Expected second argument to be of type array or string, but found ${ny(gy(i))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(t);return i.indexOf(e,n)}return i.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class Eg{constructor(t,e,i,n,r,o){this.inputType=t,this.type=e,this.input=i,this.cases=n,this.outputs=r,this.otherwise=o}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const r={},o=[];for(let l=2;l<t.length-1;l+=2){let s=t[l];const a=t[l+1];Array.isArray(s)||(s=[s]);const u=e.concat(l);if(0===s.length)return u.error("Expected at least one branch label.");for(const t of s){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,gy(t)))return null}else i=gy(t);if(void 0!==r[String(t)])return u.error("Branch labels must be unique.");r[String(t)]=o.length}const h=e.parse(a,l,n);if(!h)return null;n=n||h.type,o.push(h)}const s=e.parse(t[1],1,Jf);if(!s)return null;const a=e.parse(t[t.length-1],t.length-1,n);return a?"value"!==s.type.kind&&e.concat(1).checkSubtype(i,s.type)?null:new Eg(i,n,s,r,o,a):null}evaluate(t){const e=this.input.evaluate(t);return(gy(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),i=[],n={};for(const o of e){const t=n[this.cases[o]];void 0===t?(n[this.cases[o]]=i.length,i.push([this.cases[o],[o]])):i[t][1].push(o)}const r=t=>"number"===this.inputType.kind?Number(t):t;for(const[o,s]of i)1===s.length?t.push(r(s[0])):t.push(s.map(r)),t.push(this.outputs[o].serialize());return t.push(this.otherwise.serialize()),t}}class kg{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const n=[];for(let o=1;o<t.length-1;o+=2){const r=e.parse(t[o],o,Zf);if(!r)return null;const s=e.parse(t[o+1],o+1,i);if(!s)return null;n.push([r,s]),i=i||s.type}const r=e.parse(t[t.length-1],t.length-1,i);return r?new kg(i,n,r):null}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every((([t,e])=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class Pg{constructor(t,e,i,n){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Jf),n=e.parse(t[2],2,Kf);if(!i||!n)return null;if(!sy(i.type,[iy(Jf),Yf,Jf]))return e.error(`Expected first argument to be of type array or string, but found ${ny(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,Kf);return r?new Pg(i.type,i,n,r):null}return new Pg(i.type,i,n)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!ay(e,["string","array"]))throw new _y(`Expected first argument to be of type array or string, but found ${ny(gy(e))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(t);return e.slice(i,n)}return e.slice(i)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function Og(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Rg(t,e,i,n){return 0===n.compare(e,i)}function Ig(t,e,i){const n="=="!==t&&"!="!==t;return class r{constructor(t,e,i){this.type=Zf,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let o=e.parse(t[1],1,Jf);if(!o)return null;if(!Og(i,o.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${ny(o.type)}'.`);let s=e.parse(t[2],2,Jf);if(!s)return null;if(!Og(i,s.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${ny(s.type)}'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error(`Cannot compare types '${ny(o.type)}' and '${ny(s.type)}'.`);n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new by(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new by(o.type,[s])));let a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,Qf),!a)return null}return new r(o,s,a)}evaluate(r){const o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){const e=gy(o),i=gy(s);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new _y(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=gy(o),i=gy(s);if("string"!==t.kind||"string"!==i.kind)return e(r,o,s)}return this.collator?i(r,o,s,this.collator.evaluate(r)):e(r,o,s)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const Fg=Ig("==",(function(t,e,i){return e===i}),Rg),jg=Ig("!=",(function(t,e,i){return e!==i}),(function(t,e,i,n){return!Rg(0,e,i,n)})),Mg=Ig("<",(function(t,e,i){return e<i}),(function(t,e,i,n){return n.compare(e,i)<0})),Ag=Ig(">",(function(t,e,i){return e>i}),(function(t,e,i,n){return n.compare(e,i)>0})),Lg=Ig("<=",(function(t,e,i){return e<=i}),(function(t,e,i,n){return n.compare(e,i)<=0})),Dg=Ig(">=",(function(t,e,i){return e>=i}),(function(t,e,i,n){return n.compare(e,i)>=0}));class zg{constructor(t,e,i,n,r){this.type=Yf,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=n,this.maxFractionDigits=r}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Kf);if(!i)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let r=null;if(n.locale&&(r=e.parse(n.locale,1,Yf),!r))return null;let o=null;if(n.currency&&(o=e.parse(n.currency,1,Yf),!o))return null;let s=null;if(n["min-fraction-digits"]&&(s=e.parse(n["min-fraction-digits"],1,Kf),!s))return null;let a=null;return n["max-fraction-digits"]&&(a=e.parse(n["max-fraction-digits"],1,Kf),!a)?null:new zg(i,r,o,s,a)}evaluate(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))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const 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]}}class Gg{constructor(t){this.type=Kf,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${ny(i.type)} instead.`):new Gg(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new _y(`Expected value to be of type string or array, but found ${ny(gy(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const Ng={"==":Fg,"!=":jg,">":Ag,"<":Mg,">=":Dg,"<=":Lg,array:by,at:Sg,boolean:by,case:kg,coalesce:bg,collator:Oy,format:wy,image:Sy,in:Cg,"index-of":Tg,interpolate:_g,"interpolate-hcl":_g,"interpolate-lab":_g,length:Gg,let:wg,literal:vy,match:Eg,number:by,"number-format":zg,object:by,slice:Pg,step:tg,string:by,"to-boolean":Ty,"to-color":Ty,"to-number":Ty,"to-string":Ty,var:Hy,within:Xy};function Bg(t,[e,i,n,r]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const o=r?r.evaluate(t):1,s=fy(e,i,n,o);if(s)throw new _y(s);return new uy(e/255*o,i/255*o,n/255*o,o)}function Wg(t,e){return t in e}function qg(t,e){const i=e[t];return void 0===i?null:i}function Vg(t){return{type:t}}function Ug(t){return{result:"success",value:t}}function Xg(t){return{result:"error",value:t}}function Kg(t){return!!t.expression&&t.expression.interpolated}function Yg(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}Py.register(Ng,{error:[{kind:"error"},[Yf],(t,[e])=>{throw new _y(e.evaluate(t))}],typeof:[Yf,[Jf],(t,[e])=>ny(gy(e.evaluate(t)))],"to-rgba":[iy(Kf,4),[Hf],(t,[e])=>e.evaluate(t).toArray()],rgb:[Hf,[Kf,Kf,Kf],Bg],rgba:[Hf,[Kf,Kf,Kf,Kf],Bg],has:{type:Zf,overloads:[[[Yf],(t,[e])=>Wg(e.evaluate(t),t.properties())],[[Yf,$f],(t,[e,i])=>Wg(e.evaluate(t),i.evaluate(t))]]},get:{type:Jf,overloads:[[[Yf],(t,[e])=>qg(e.evaluate(t),t.properties())],[[Yf,$f],(t,[e,i])=>qg(e.evaluate(t),i.evaluate(t))]]},"feature-state":[Jf,[Yf],(t,[e])=>qg(e.evaluate(t),t.featureState||{})],properties:[$f,[],t=>t.properties()],"geometry-type":[Yf,[],t=>t.geometryType()],id:[Jf,[],t=>t.id()],zoom:[Kf,[],t=>t.globals.zoom],"heatmap-density":[Kf,[],t=>t.globals.heatmapDensity||0],"line-progress":[Kf,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[Kf,[],t=>t.globals.skyRadialProgress||0],accumulated:[Jf,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[Kf,Vg(Kf),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[Kf,Vg(Kf),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:Kf,overloads:[[[Kf,Kf],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[Kf],(t,[e])=>-e.evaluate(t)]]},"/":[Kf,[Kf,Kf],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[Kf,[Kf,Kf],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[Kf,[],()=>Math.LN2],pi:[Kf,[],()=>Math.PI],e:[Kf,[],()=>Math.E],"^":[Kf,[Kf,Kf],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[Kf,[Kf],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[Kf,[Kf],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[Kf,[Kf],(t,[e])=>Math.log(e.evaluate(t))],log2:[Kf,[Kf],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[Kf,[Kf],(t,[e])=>Math.sin(e.evaluate(t))],cos:[Kf,[Kf],(t,[e])=>Math.cos(e.evaluate(t))],tan:[Kf,[Kf],(t,[e])=>Math.tan(e.evaluate(t))],asin:[Kf,[Kf],(t,[e])=>Math.asin(e.evaluate(t))],acos:[Kf,[Kf],(t,[e])=>Math.acos(e.evaluate(t))],atan:[Kf,[Kf],(t,[e])=>Math.atan(e.evaluate(t))],min:[Kf,Vg(Kf),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[Kf,Vg(Kf),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[Kf,[Kf],(t,[e])=>Math.abs(e.evaluate(t))],round:[Kf,[Kf],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[Kf,[Kf],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[Kf,[Kf],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Zf,[Yf,Jf],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Zf,[Jf],(t,[e])=>t.id()===e.value],"filter-type-==":[Zf,[Yf],(t,[e])=>t.geometryType()===e.value],"filter-<":[Zf,[Yf,Jf],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<r}],"filter-id-<":[Zf,[Jf],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<n}],"filter->":[Zf,[Yf,Jf],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>r}],"filter-id->":[Zf,[Jf],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[Zf,[Yf,Jf],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[Zf,[Jf],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[Zf,[Yf,Jf],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[Zf,[Jf],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[Zf,[Jf],(t,[e])=>e.value in t.properties()],"filter-has-id":[Zf,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Zf,[iy(Yf)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Zf,[iy(Jf)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Zf,[Yf,iy(Jf)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Zf,[Yf,iy(Jf)],(t,[e,i])=>function(t,e,i,n){for(;i<=n;){const r=i+n>>1;if(e[r]===t)return!0;e[r]>t?n=r-1:i=r+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Zf,overloads:[[[Zf,Zf],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Vg(Zf),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:Zf,overloads:[[[Zf,Zf],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Vg(Zf),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[Zf,[Zf],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Zf,[Yf],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Yf,[Yf],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Yf,[Yf],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Yf,Vg(Jf),(t,e)=>e.map((e=>my(e.evaluate(t)))).join("")],"resolved-locale":[Yf,[Qf],(t,[e])=>e.evaluate(t).resolvedLocale()]});class Zg{constructor(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new ky,this._defaultValue=e?"color"===(i=e).type&&Yg(i.default)?new uy(0,0,0,0):"color"===i.type?uy.parse(i.default)||null:void 0===i.default?null:i.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,n,r,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new _y(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,"undefined"!=typeof console&&console.warn(s.message)),this._defaultValue}}}function Hg(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Ng}function $g(t,e){const i=new $y(Ng,[],e?function(t){const e={color:Hf,string:Yf,number:Kf,enum:Yf,boolean:Zf,formatted:ty,resolvedImage:ey};if("array"===t.type)return iy(e[t.value]||Jf,t.length);return e[t.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Ug(new Zg(n,e)):Xg(i.errors)}class Jg{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Yy(e.expression)}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}}class Qg{constructor(t,e,i,n){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Yy(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}interpolationFactor(t,e,i){return this.interpolationType?_g.interpolationFactor(this.interpolationType,t,e,i):0}}function tm(t,e){if("error"===(t=$g(t,e)).result)return t;const i=t.value.expression,n=Ky(i);if(!n&&("data-driven"!==(r=e)["property-type"]&&"cross-faded-data-driven"!==r["property-type"]))return Xg([new Vf("","data expressions not supported")]);var r;const o=Zy(i,["zoom"]);if(!o&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return Xg([new Vf("","zoom expressions not supported")]);const s=em(i);if(!s&&!o)return Xg([new Vf("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof Vf)return Xg([s]);if(s instanceof _g&&!Kg(e))return Xg([new Vf("",'"interpolate" expressions cannot be used with this property')]);if(!s)return Ug(new Jg(n?"constant":"source",t.value));const a=s instanceof _g?s.interpolation:void 0;return Ug(new Qg(n?"camera":"composite",t.value,s.labels,a))}function em(t){let e=null;if(t instanceof wg)e=em(t.result);else if(t instanceof bg){for(const i of t.args)if(e=em(i),e)break}else(t instanceof tg||t instanceof _g)&&t.input instanceof Py&&"zoom"===t.input.name&&(e=t);return e instanceof Vf||t.eachChild((t=>{const i=em(t);i instanceof Vf?e=i:!e&&i?e=new Vf("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Vf("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function im(t){return"object"==typeof t?["literal",t]:t}function nm(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function rm(t,e){const i=im((n=t.default,r=e.default,void 0!==n?n:void 0!==r?r:void 0));var n,r;return void 0===i&&"resolvedImage"===e.type?"":i}function om(t,e,i){const n=lm(t,e),r=["get",t.property];if("categorical"===n&&"boolean"==typeof i[0][0]){const n=["case"];for(const t of i)n.push(["==",r,t[0]],t[1]);return n.push(rm(t,e)),n}if("categorical"===n){const n=["match",r];for(const t of i)am(n,t[0],t[1],!1);return n.push(rm(t,e)),n}if("interval"===n){const e=["step",["number",r]];for(const t of i)am(e,t[0],t[1],!0);return sm(e),void 0===t.default?e:["case",["==",["typeof",r],"number"],e,im(t.default)]}if("exponential"===n){const e=void 0!==t.base?t.base:1,n=[nm(t),1===e?["linear"]:["exponential",e],["number",r]];for(const t of i)am(n,t[0],t[1],!1);return void 0===t.default?n:["case",["==",["typeof",r],"number"],n,im(t.default)]}throw new Error(`Unknown property function type ${n}`)}function sm(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function am(t,e,i,n){t.length>3&&e===t[t.length-2]||(n&&2===t.length||t.push(e),t.push(i))}function lm(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function um(t){const e=["concat"],i=/{([^{}]+)}/g;let n=0;for(let r=i.exec(t);null!==r;r=i.exec(t)){const o=t.slice(n,i.lastIndex-r[0].length);n=i.lastIndex,o.length>0&&e.push(o),e.push(["get",r[1]])}if(1===e.length)return t;if(n<t.length)e.push(t.slice(n));else if(2===e.length)return["to-string",e[1]];return e}function hm(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!hm(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const cm={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function pm(t){if(null==t)return{filter:()=>!0,needGeometry:!1};hm(t)||(t=ym(t));const e=$g(t,cm);if("error"===e.result)throw new Error(e.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return{filter:(t,i,n)=>e.value.evaluate(t,i,{},n),needGeometry:fm(t)}}function dm(t,e){return t<e?-1:t>e?1:0}function fm(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e<t.length;e++)if(fm(t[e]))return!0;return!1}function ym(t){if(!t)return!0;const e=t[0];if(t.length<=1)return"any"!==e;var i;return"=="===e?gm(t[1],t[2],"=="):"!="===e?_m(gm(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?gm(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(ym))):"all"===e?["all"].concat(t.slice(1).map(ym)):"none"===e?["all"].concat(t.slice(1).map(ym).map(_m)):"in"===e?mm(t[1],t.slice(2)):"!in"===e?_m(mm(t[1],t.slice(2))):"has"===e?vm(t[1]):"!has"===e?_m(vm(t[1])):"within"!==e||t}function gm(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function mm(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(dm)]]:["filter-in-small",t,["literal",e]]}}function vm(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function _m(t){return["!",t]}var xm=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function bm(t,e){const i={};for(const n in t)"ref"!==n&&(i[n]=t[n]);return xm.forEach((t=>{t in e&&(i[t]=e[t])})),i}Gf((function(t,e){var i=function(){var t=function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},e=[1,12],i=[1,13],n=[1,9],r=[1,10],o=[1,11],s=[1,14],a=[1,15],l=[14,18,22,24],u=[18,22],h=[22,24],c={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,i,n,r,o,s){var a=o.length-1;switch(r){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=o[a-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=o[a-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[o[a-2],o[a]];break;case 16:this.$={},this.$[o[a][0]]=o[a][1];break;case 17:this.$=o[a-2],o[a-2][o[a][0]]=o[a][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[o[a]];break;case 21:this.$=o[a-2],o[a-2].push(o[a])}},table:[{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,12:1,13:2,15:7,16:8,17:s,23:a},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:23,15:7,16:8,17:s,23:a,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(u,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(h,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:30,15:7,16:8,17:s,23:a},t(l,[2,19]),{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:31,15:7,16:8,17:s,23:a},t(u,[2,17]),t(u,[2,15]),t(h,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,i=[0],n=[null],r=[],o=this.table,s="",a=0,l=0,u=2,h=1,c=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(d.yy[f]=this.yy[f]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var y=p.yylloc;r.push(y);var g=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=p.lex()||h)&&(t=e.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var v,_,x,b,w,S,C,T,E={};;){if(_=i[i.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==v&&(v=m()),x=o[_]&&o[_][v]),void 0===x||!x.length||!x[0]){var k="";for(w in T=[],o[_])this.terminals_[w]&&w>u&&T.push("'"+this.terminals_[w]+"'");k=p.showPosition?"Parse error on line "+(a+1)+":\n"+p.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(a+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(k,{text:p.match,token:this.terminals_[v]||v,line:p.yylineno,loc:y,expected:T})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:i.push(v),n.push(p.yytext),r.push(p.yylloc),i.push(x[1]),v=null,l=p.yyleng,s=p.yytext,a=p.yylineno,y=p.yylloc;break;case 2:if(S=this.productions_[x[1]][1],E.$=n[n.length-S],E._$={first_line:r[r.length-(S||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(S||1)].first_column,last_column:r[r.length-1].last_column},g&&(E._$.range=[r[r.length-(S||1)].range[0],r[r.length-1].range[1]]),void 0!==(b=this.performAction.apply(E,[s,l,a,d.yy,x[1],n,r].concat(c))))return b;S&&(i=i.slice(0,-1*S*2),n=n.slice(0,-1*S),r=r.slice(0,-1*S)),i.push(this.productions_[x[1]][0]),n.push(E.$),r.push(E._$),C=o[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},p={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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 e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var r=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===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),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(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,n,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var o in r)this[o]=r[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),o=0;o<r.length;o++)if((i=this._input.match(this.rules[r[o]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[o])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[n]))&&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,e,i,n){switch(i){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.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 d(){this.yy={}}return c.lexer=p,d.prototype=c,c.Parser=d,new d}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)}}));const wm=Hg,Sm=tm,Cm=function(t,e){let i=t.stops;if(!i)return function(t,e){const i=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",i]:i;if("enum"===e.type)return["match",i,Object.keys(e.values),i,t.default];{const n=["color"===e.type?"to-color":e.type,i,im(t.default)];return"array"===e.type&&n.splice(1,0,e.value,e.length||null),n}}(t,e);const n=i&&"object"==typeof i[0][0],r=n||void 0!==t.property,o=n||!r;return i=i.map((t=>!r&&e.tokens&&"string"==typeof t[1]?[t[0],um(t[1])]:[t[0],im(t[1])])),n?function(t,e,i){const n={},r={},o=[];for(let s=0;s<i.length;s++){const e=i[s],a=e[0].zoom;void 0===n[a]&&(n[a]={zoom:a,type:t.type,property:t.property,default:t.default},r[a]=[],o.push(a)),r[a].push([e[0].value,e[1]])}if("exponential"===lm({},e)){const i=[nm(t),["linear"],["zoom"]];for(const t of o){am(i,t,om(n[t],e,r[t]),!1)}return i}{const t=["step",["zoom"]];for(const i of o){am(t,i,om(n[i],e,r[i]),!0)}return sm(t),t}}(t,e,i):o?function(t,e,i,n=["zoom"]){const r=lm(t,e);let o,s=!1;if("interval"===r)o=["step",n],s=!0;else{if("exponential"!==r)throw new Error(`Unknown zoom function type "${r}"`);{const e=void 0!==t.base?t.base:1;o=[nm(t),1===e?["linear"]:["exponential",e],n]}}for(const a of i)am(o,a[0],a[1],s);return sm(o),o}(t,e,i):om(t,e,i)},Tm=Yg;function Em(t){return t*Math.PI/180}var km=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function Pm(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var i=document.createElement("canvas");return i.width=t,i.height=e,i}var Om,Rm=Array(256).join(" ");function Im(t,e){if(e>=.05){for(var i="",n=t.split("\n"),r=Rm.slice(0,Math.round(e/.1)),o=0,s=n.length;o<s;++o)o>0&&(i+="\n"),i+=n[o].split("").join(r);return i}return t}function Fm(){return Om||(Om=Pm(1,1).getContext("2d")),Om}function jm(t,e){return Fm().measureText(t).width+(t.length-1)*e}var Mm={};function Am(t,e,i,n){if(-1!==t.indexOf("\n")){for(var r=t.split("\n"),o=[],s=0,a=r.length;s<a;++s)o.push(Am(r[s],e,i,n));return o.join("\n")}var l=i+","+e+","+t+","+n,u=Mm[l];if(!u){var h=t.split(" ");if(h.length>1){var c=Fm();c.font=e;var p=c.measureText("M").width*i,d="";for(o=[],s=0,a=h.length;s<a;++s){var f=h[s],y=d+(d?" ":"")+f;jm(y,n)<=p?d=y:(d&&o.push(d),d=f)}d&&o.push(d);for(s=0,a=o.length;s<a&&a>1;++s){var g=o[s];if(jm(g,n)<.35*p){var m=s>0?jm(o[s-1],n):1/0,v=s<a-1?jm(o[s+1],n):1/0;o.splice(s,1),a-=1,m<v?(o[s-1]+=" "+g,s-=1):o[s]=g+" "+o[s]}}for(s=0,a=o.length-1;s<a;++s){var _=o[s],x=o[s+1];if(jm(_,n)>.7*p&&jm(x,n)<.6*p){var b=_.split(" "),w=b.pop();jm(w,n)<.2*p&&(o[s]=b.join(" "),o[s+1]=w+" "+x),a-=1}}u=o.join("\n")}else u=t;u=Im(u,n),Mm[l]=u}return u}Br&&qt(Br,jt,(function(){Mm={}}));var Lm,Dm,zm=Tm,Gm=Cm,Nm=wm,Bm=Sm,Wm={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},qm={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]},Vm={},Um={zoom:0},Xm={};function Km(t,e,i,n,r){var o=t.id;Xm[o]||(Xm[o]={});var s=Xm[o];if(!s[i]){var a=(t[e]||Vm)[i],l=Df[e+"_"+t.type][i];void 0===a&&(a=l.default);var u=Nm(a);if(!u&&zm(a)&&(a=Gm(a,l),u=!0),u){var h=function(t,e){var i=Bm(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}(a,l);s[i]=h.evaluate.bind(h)}else"color"==l.type&&(a=uy.parse(a)),s[i]=function(){return a}}return Um.zoom=n,s[i](Um,r)}var Ym={};function Zm(t,e){if(t){if(0===t.a||0===e)return;var i=t.a;return e=void 0===e?1:e,"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*e+")"}return t}var Hm=/^([^]*)\{(.*)\}([^]*)$/;function $m(t,e){var i;do{if(i=t.match(Hm)){var n=e[i[2]]||"";t=i[1]+n+i[3]}}while(i);return t}function Jm(t,e,i,n,r,o,s){if(void 0===n&&(n=km),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var a,l;if(o)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){a=u,l=[u.width,u.height],t.changed(),u.onload=null},u.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,l=[a.width,a.height])}))}for(var c,p=function(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=bm(t[i],e[t[i].ref]));return t}(e.layers),d={},f=[],y=0,g=p.length;y<g;++y){var m=p[y],v=m.id;if("string"==typeof i&&m.source==i||-1!==i.indexOf(v)){var _=m["source-layer"];if(!c){c=m.source;var x=e.sources[c];if(!x)throw new Error('Source "'+c+'" is not defined');var b=x.type;if("vector"!==b&&"geojson"!==b)throw new Error('Source "'+c+'" is not of type "vector" or "geojson", but "'+b+'"')}var w=d[_];w||(w=[],d[_]=w),w.push({layer:m,index:y}),f.push(v)}delete Xm[v],delete Ym[v]}var S=new Za,C=new Pa,T={},E={},k=[],P=function(t,e){var i=t.getProperties(),o=d[i.layer];if(o){var u=n.indexOf(e);-1==u&&(u=function(t,e){for(var i=0,n=e.length;i<n;++i)if(e[i]<t&&i+1<n){var r=e[i]/e[i+1];return i+Math.log(e[i]/t)/Math.log(r)}return n-1}(e,n));for(var h=Wm[t.getGeometry().getType()],c={properties:i,type:h},p=-1,f=function(n,d){var f=o[n],y=f.layer,g=y.id,m=y.layout||Vm,v=y.paint||Vm;if("none"===m.visibility||"minzoom"in y&&u<y.minzoom||"maxzoom"in y&&u>=y.maxzoom)return"continue";var _=y.filter;if(!_||function(t,e,i,n){return t in Ym||(Ym[t]=pm(e).filter),Um.zoom=n,Ym[t](Um,i)}(g,_,c,u)){var x=void 0,b=void 0,w=void 0,P=void 0,O=void 0,R=void 0,I=f.index;if(3==h&&("fill"==y.type||"fill-extrusion"==y.type))if(b=Km(y,"paint",y.type+"-opacity",u,c),y.type+"-pattern"in v){var F=Km(y,"paint",y.type+"-pattern",u,c);if(F){var j="string"==typeof F?$m(F,i):F.toString();if(a&&r&&r[j]){++p,(R=k[p])&&R.getFill()&&!R.getStroke()&&!R.getText()||(R=new sl({fill:new Pa}),k[p]=R),w=R.getFill(),R.setZIndex(I);var M=E[lt=j+"."+b];if(!M)(ct=(ht=Pm((ut=r[j]).width,ut.height)).getContext("2d")).globalAlpha=b,ct.drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height),M=ct.createPattern(ht,"repeat"),E[lt]=M;w.setColor(M)}}}else(x=Zm(Km(y,"paint",y.type+"-color",u,c),b))&&(y.type+"-outline-color"in v&&(O=Zm(Km(y,"paint",y.type+"-outline-color",u,c),b)),O||(O=x),++p,(R=k[p])&&R.getFill()&&R.getStroke()&&!R.getText()||(R=new sl({fill:new Pa,stroke:new Za}),k[p]=R),(w=R.getFill()).setColor(x),(P=R.getStroke()).setColor(O),P.setWidth(1),R.setZIndex(I));if(1!=h&&"line"==y.type){x=!("line-pattern"in v)&&"line-color"in v?Zm(Km(y,"paint","line-color",u,c),Km(y,"paint","line-opacity",u,c)):void 0;var A=Km(y,"paint","line-width",u,c);x&&A>0&&(++p,(R=k[p])&&R.getStroke()&&!R.getFill()&&!R.getText()||(R=new sl({stroke:new Za}),k[p]=R),(P=R.getStroke()).setLineCap(Km(y,"layout","line-cap",u,c)),P.setLineJoin(Km(y,"layout","line-join",u,c)),P.setMiterLimit(Km(y,"layout","line-miter-limit",u,c)),P.setColor(x),P.setWidth(A),P.setLineDash(v["line-dasharray"]?Km(y,"paint","line-dasharray",u,c).map((function(t){return t*A})):null),R.setZIndex(I))}var L=!1,D=null,z=0,G=void 0,N=void 0,B=void 0;if((1==h||2==h)&&"icon-image"in m){var W=Km(y,"layout","icon-image",u,c);if(W){G="string"==typeof W?$m(W,i):W.toString();var q=void 0;if(a&&r&&r[G]){var V=Km(y,"layout","icon-rotation-alignment",u,c);if(2==h){var U=t.getGeometry();if(U.getFlatMidpoint||U.getFlatMidpoints){var X=U.getExtent();if(Math.sqrt(Math.max(Math.pow((X[2]-X[0])/e,2),Math.pow((X[3]-X[1])/e,2)))>150){var K="MultiLineString"===U.getType()?U.getFlatMidpoints():U.getFlatMidpoint();if(Dm||(Dm=new Fl("Point",Lm=[NaN,NaN],[],{},null)),q=Dm,Lm[0]=K[0],Lm[1]=K[1],"line"===(It=Km(y,"layout","symbol-placement",u,c))&&"map"===V)for(var Y=U.getStride(),Z=U.getFlatCoordinates(),H=0,$=Z.length-Y;H<$;H+=Y){var J=Z[H],Q=Z[H+1],tt=Z[H+Y],et=Z[H+Y+1],it=Math.min(J,tt),nt=Math.min(Q,et),rt=Math.max(J,tt),ot=Math.max(Q,et);if(K[0]>=it&&K[0]<=rt&&K[1]>=nt&&K[1]<=ot){z=Math.atan2(Q-et,tt-J);break}}}}}if(2!==h||q){var st=Km(y,"layout","icon-size",u,c),at=void 0!==v["icon-color"]?Km(y,"paint","icon-color",u,c):null;if(!at||0!==at.a){var lt=G+"."+st;if(null!==at&&(lt+="."+at),!(N=T[lt])){var ut=r[G];if(null!==at){var ht,ct;(ct=(ht=Pm(ut.width,ut.height)).getContext("2d")).drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height);for(var pt=ct.getImageData(0,0,ht.width,ht.height),dt=0,ft=pt.data.length;dt<ft;dt+=4){var yt=at.a;0!==yt&&(pt.data[dt]=255*at.r/yt,pt.data[dt+1]=255*at.g/yt,pt.data[dt+2]=255*at.b/yt),pt.data[dt+3]=yt}ct.putImageData(pt,0,0),N=new Ya({img:ht,imgSize:[ht.width,ht.height],scale:st/ut.pixelRatio}),T[lt]=N}else N=new Ya({img:a,imgSize:l,size:[ut.width,ut.height],offset:[ut.x,ut.y],rotateWithView:"map"===V,scale:st/ut.pixelRatio}),T[lt]=N}}N&&(++p,(R=k[p])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new sl,k[p]=R),R.setGeometry(q),N.setRotation(z+Em(Km(y,"layout","icon-rotate",u,c))),N.setOpacity(Km(y,"paint","icon-opacity",u,c)),N.setAnchor(qm[Km(y,"layout","icon-anchor",u,c)]),R.setImage(N),D=R.getText(),R.setText(void 0),R.setZIndex(I),L=!0,B=!1)}else B=!0}}}if(1==h&&"circle-radius"in v){++p,(R=k[p])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new sl,k[p]=R);var gt=Km(y,"paint","circle-radius",u,c),mt=Zm(Km(y,"paint","circle-stroke-color",u,c),Km(y,"paint","circle-stroke-opacity",u,c)),vt=Zm(Km(y,"paint","circle-color",u,c),Km(y,"paint","circle-opacity",u,c)),_t=Km(y,"paint","circle-stroke-width",u,c),xt=gt+"."+mt+"."+vt+"."+_t;(N=T[xt])||(N=new tl({radius:gt,stroke:mt&&_t>0?new Za({width:_t,color:mt}):void 0,fill:vt?new Pa({color:vt}):void 0}),T[xt]=N),R.setImage(N),D=R.getText(),R.setText(void 0),R.setGeometry(void 0),R.setZIndex(I),L=!0}var bt=void 0;if("text-field"in m)bt=$m(Km(y,"layout","text-field",u,c).toString(),i).trim(),b=Km(y,"paint","text-opacity",u,c);if(bt&&b&&!B){L||(++p,(R=k[p])&&R.getText()&&!R.getFill()&&!R.getStroke()||(R=new sl,k[p]=R),R.setImage(void 0),R.setGeometry(void 0)),R.getText()||R.setText(D||new ul({padding:[2,2,2,2]})),D=R.getText();var wt=Math.round(Km(y,"layout","text-size",u,c)),St=Km(y,"layout","text-font",u,c),Ct=Km(y,"layout","text-line-height",u,c),Tt=function(t,e,i){var n=vd[t];if(!n){Array.isArray(t)||(t=[t]);for(var r=400,o="normal",s=[],a=0,l=t.length;a<l;++a){var u=t[a].split(" "),h=u[u.length-1].toLowerCase();for(var c in"normal"==h||"italic"==h||"oblique"==h?(o=h,u.pop(),h=u[u.length-1].toLowerCase()):md.test(h)&&(h=h.replace(md,""),o=u[u.length-1].replace(h,"")),gd)if(h==c||h==c.replace("-","")||h==c.replace("-"," ")){r=gd[c],u.pop();break}"number"==typeof h&&(r=h);var p=u.join(" ").replace("Klokantech Noto Sans","Noto Sans");-1!==p.indexOf(" ")&&(p='"'+p+'"'),s.push(p)}n=vd[t]=[o,r,s]}return n[0]+" "+n[1]+" "+e+"px"+(i?"/"+i:"")+" "+n[2]}(s?s(St):St,wt,Ct),Et=m["text-transform"];"uppercase"==Et?bt=bt.toUpperCase():"lowercase"==Et&&(bt=bt.toLowerCase());var kt=Km(y,"layout","text-max-width",u,c),Pt=Km(y,"layout","text-letter-spacing",u,c),Ot=2==h?Im(bt,Pt):Am(bt,Tt,kt,Pt);D.setText(Ot),D.setFont(Tt),D.setRotation(Em(Km(y,"layout","text-rotate",u,c)));var Rt=Km(y,"layout","text-anchor",u,c),It=L||1==h?"point":Km(y,"layout","symbol-placement",u,c);D.setPlacement(It);var Ft=Km(y,"paint","text-halo-width",u,c),jt=Km(y,"layout","text-offset",u,c),Mt=Km(y,"paint","text-translate",u,c),At=0,Lt=0;if("point"==It){var Dt="center";-1!==Rt.indexOf("left")?(Dt="left",Lt=Ft):-1!==Rt.indexOf("right")&&(Dt="right",Lt=-Ft),D.setTextAlign(Dt);var zt=Km(y,"layout","text-rotation-alignment",u,c);D.setRotateWithView("map"==zt)}else D.setMaxAngle(Em(Km(y,"layout","text-max-angle",u,c))*bt.length/Ot.length),D.setTextAlign(),D.setRotateWithView(!1);var Gt="middle";0==Rt.indexOf("bottom")?(Gt="bottom",At=-Ft-.5*(Ct-1)*wt):0==Rt.indexOf("top")&&(Gt="top",At=Ft+.5*(Ct-1)*wt),D.setTextBaseline(Gt),D.setOffsetX(jt[0]*wt+Lt+Mt[0]),D.setOffsetY(jt[1]*wt+At+Mt[1]),C.setColor(Zm(Km(y,"paint","text-color",u,c),b)),D.setFill(C);var Nt=Zm(Km(y,"paint","text-halo-color",u,c),b);if(Nt){S.setColor(Nt),Ft*=2;var Bt=.5*wt;S.setWidth(Ft<=Bt?Ft:Bt),D.setStroke(S)}else D.setStroke(void 0);var Wt=Km(y,"layout","text-padding",u,c),qt=D.getPadding();Wt!==qt[0]&&(qt[0]=Wt,qt[1]=Wt,qt[2]=Wt,qt[3]=Wt),R.setZIndex(I)}}},y=0,g=o.length;y<g;++y)f(y);return p>-1?(k.length=p+1,k):void 0}};return t.setStyle(P),t.set("mapbox-source",c),t.set("mapbox-layers",f),P}var Qm,tv=Object.freeze,ev=Object.defineProperty,iv=Object.getOwnPropertyDescriptor,nv=(t,e,i,n)=>{for(var r,o=n>1?void 0:n?iv(e,i):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(n?r(e,i,o):r(o))||o);return n&&o&&ev(e,i,o),o};let rv=class extends ht{constructor(){super(),this.id="map",this.latitude=51.507351,this.longitude=-.127758,this.zoom=10,this.minZoom=7,this.maxZoom=22,this.drawMode=!1,this.drawGeojsonData={type:"Feature",geometry:{}},this.drawGeojsonDataBuffer=100,this.drawPointer="crosshair",this.showFeaturesAtPoint=!1,this.clickFeatures=!1,this.featureColor="#0000ff",this.featureFill=!1,this.featureBuffer=40,this.geojsonData={type:"FeatureCollection",features:[]},this.geojsonColor="#ff0000",this.geojsonFill=!1,this.geojsonBuffer=12,this.disableVectorTiles=!1,this.osVectorTilesApiKey="",this.osFeaturesApiKey="",this.osCopyright=`© Crown copyright and database rights ${(new Date).getFullYear()} OS (0)100024857`,this.hideResetControl=!1,this.staticMode=!1,this.areaUnit="m2",this.showScale=!1,this.useScaleBarStyle=!1,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}firstUpdated(){var t;const e=this.renderRoot.querySelector(`#${this.id}`),i=!this.disableVectorTiles&&Boolean(this.osVectorTilesApiKey),n=(r=this.osCopyright,o=this.osVectorTilesApiKey,new yd({source:o?new xd({url:"https://api.os.uk/maps/raster/v1/zxy/Light_3857/{z}/{x}/{y}.png?key="+o,attributions:[r],attributionsCollapsible:!1,maxZoom:20}):new Sd({attributions:[wd]})}));var r,o;const s=function(t,e){let i=new fp({declutter:!0,source:new Yp({format:new zl,url:"https://api.os.uk/maps/vector/v1/vts/tile/{z}/{y}/{x}.pbf?srs=3857&key="+e,attributions:[t],attributionsCollapsible:!1})});return e&&fetch("https://api.os.uk/maps/vector/v1/vts/resources/styles?srs=3857&key="+e).then((t=>t.json())).then((t=>Jm(i,t,"esri"))).catch((t=>console.log(t))),i}(this.osCopyright,this.osVectorTilesApiKey),a=new $p({target:e,layers:[i?s:n],view:new zs({projection:"EPSG:3857",extent:(u=[-10.76418,49.528423,1.9134116,61.331151],h="EPSG:4326",c="EPSG:3857",kn(u,nr(h,c),void 0,p)),minZoom:this.minZoom,maxZoom:this.maxZoom,center:tr([this.longitude,this.latitude]),zoom:this.zoom,enableRotation:!1}),controls:$s({attribution:!0,zoom:!this.staticMode}).extend(this.showScale?[(l=this.useScaleBarStyle,new Hs({units:"metric",bar:l,steps:4,text:!0,minWidth:140}))]:[]),interactions:$c({doubleClickZoom:!this.staticMode,dragPan:!this.staticMode,mouseWheelZoom:!this.staticMode})});var l,u,h,c,p;this.map=a;const d=(f=this.drawPointer,new Lc({source:Ld,type:"Polygon",style:new sl({stroke:Id,fill:Fd,image:"crosshair"===f?jd:Md})}));var f;const y=function(t){return new Xc({source:Ld,style:new sl({image:"crosshair"===t?jd:Md})})}(this.drawPointer),g=document.createElement("button");g.innerHTML="↻",g.title="Reset map view";g.addEventListener("click",(()=>{this.showFeaturesAtPoint?Ff(a,Af,this.featureBuffer):x.getFeatures().length>0?Ff(a,x,this.geojsonBuffer):(a.getView().setCenter(tr([this.longitude,this.latitude])),a.getView().setZoom(this.zoom)),this.drawMode&&(Ld.clear(),this.dispatch("geojsonChange",{}),this.dispatch("areaChange",`0 ${"m2"===this.areaUnit?"m²":this.areaUnit}`),a.addInteraction(d),a.addInteraction(zd))}),!1);const m=document.createElement("div");m.className="reset-control ol-unselectable ol-control",m.appendChild(g);var v=new ge({element:m});this.hideResetControl||a.addControl(v);const _=null==(t=this.renderRoot)?void 0:t.querySelectorAll(".ol-control button");null==_||_.forEach((t=>t.setAttribute("aria-label",t.getAttribute("title")||""))),a.on("pointerdrag",(()=>{a.getViewport().style.cursor="grabbing"})),a.on("pointermove",(()=>{a.getViewport().style.cursor="grab"}));const x=new Ec;if("FeatureCollection"===this.geojsonData.type){let t=(new ka).readFeatures(this.geojsonData,{featureProjection:"EPSG:3857"});x.addFeatures(t)}else if("Feature"===this.geojsonData.type){let t=(new ka).readFeature(this.geojsonData,{featureProjection:"EPSG:3857"});x.addFeature(t)}const b=new uc({source:x,style:new sl({stroke:new Za({color:this.geojsonColor,width:3}),fill:new Pa({color:this.geojsonFill?jf(this.geojsonColor,.2):jf(this.geojsonColor,0)})})});if(a.addLayer(b),x.getFeatures().length>0){Ff(a,x,this.geojsonBuffer);const t=x.getFeatures()[0].getGeometry();t&&this.dispatch("geojsonDataArea",If(t,this.areaUnit))}if(this.drawMode){Ld.clear();const t=Object.keys(this.drawGeojsonData.geometry).length>0;if(t){let t=(new ka).readFeature(this.drawGeojsonData,{featureProjection:"EPSG:3857"});Ld.addFeature(t),Ff(a,Ld,this.drawGeojsonDataBuffer)}a.addLayer(Dd),t||a.addInteraction(d),a.addInteraction(y),a.addInteraction(zd),Ld.on("change",(()=>{var t;const e=Ld.getFeatures();if(e.length>0){const n=null==(t="string"==typeof(i=e)?i[i.length-1]||"":i[i.length-1])?void 0:t.getGeometry();this.dispatch("geojsonChange",(new ka).writeFeaturesObject(e,{featureProjection:"EPSG:3857"})),n&&this.dispatch("areaChange",If(n,this.areaUnit)),a.removeInteraction(d)}var i}))}if(this.drawMode&&Boolean(this.osVectorTilesApiKey)&&!this.disableVectorTiles){const t=20;if(a.addLayer(kd),Dd.setZIndex(1001),this.zoom<t){Ed.clear();const t=a.getView().calculateExtent(a.getSize());Pd(s,t)}a.on("moveend",(()=>{const e=a.getView().getZoom();e&&e<t?Ed.clear():setTimeout((()=>{Ed.clear();const t=a.getView().calculateExtent(a.getSize());Pd(s,t)}),200)}))}if(this.showFeaturesAtPoint&&Boolean(this.osFeaturesApiKey)){Lf(tr([this.longitude,this.latitude]),this.osFeaturesApiKey,!1),this.clickFeatures&&a.on("singleclick",(t=>{Lf(t.coordinate,this.osFeaturesApiKey,!0)}));const t=(w=this.featureColor,S=this.featureFill,new uc({source:Af,style:new sl({stroke:new Za({width:3,color:w}),fill:new Pa({color:jf(w,S?.2:0)})})}));a.addLayer(t),Af.on("change",(()=>{if("ready"===Af.getState()&&Af.getFeatures().length>0){Ff(a,Af,this.featureBuffer),this.dispatch("featuresGeojsonChange",(new ka).writeFeaturesObject(Af.getFeatures(),{featureProjection:"EPSG:3857"}));const t=Af.getFeatures()[0].getGeometry();t&&this.dispatch("featuresAreaChange",If(t,this.areaUnit))}}))}var w,S;setTimeout((()=>{window.dispatchEvent(new Event("resize")),e.style.opacity="1",this.dispatch("ready")}),500)}render(){return q(Qm||(Qm=tv(ev(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <link rel="stylesheet" href="https://cdn.skypack.dev/ol@^6.6.1/ol.css" />\n <div id="','" class="map" tabindex="0" />'],"raw",{value:tv(e||t.slice())}))),this.id);var t,e}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.map)||t.dispose()}};var ov;rv.styles=((t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(t instanceof c)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return d(i)})`
42
42
  :host {
43
43
  display: block;
44
44
  width: 800px;